Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nuttx-apps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
nuttx-apps
Commits
16b2090c
Commit
16b2090c
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
NSH Networking: Software assigned MAC address is now configurable. From Lazlo
parent
b5be2c6d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nshlib/Kconfig
+8
-0
8 additions, 0 deletions
nshlib/Kconfig
nshlib/nsh.h
+22
-0
22 additions, 0 deletions
nshlib/nsh.h
nshlib/nsh_netinit.c
+6
-6
6 additions, 6 deletions
nshlib/nsh_netinit.c
with
36 additions
and
6 deletions
nshlib/Kconfig
+
8
−
0
View file @
16b2090c
...
...
@@ -908,6 +908,14 @@ config NSH_NOMAC
Set if your ethernet hardware has no built-in MAC address.
If set, a bogus MAC will be assigned.
config NSH_MACADDR
hex "Software assigned MAC address"
default 0x00e0deadbeef
depends on NSH_NOMAC
---help---
Use this option to specific the software-assigned MAC address
to be used, in case the hardware has no built-in MAC address.
config NSH_MAX_ROUNDTRIP
int "Max Ping Round-Trip (DSEC)"
default 20
...
...
This diff is collapsed.
Click to expand it.
nshlib/nsh.h
+
22
−
0
View file @
16b2090c
...
...
@@ -104,6 +104,28 @@
# define CONFIG_NSH_TMPDIR "/tmp"
#endif
/* Networking support */
#ifndef CONFIG_NSH_IPADDR
# define CONFIG_NSH_IPADDR 0x0a000002
#endif
#ifndef CONFIG_NSH_DRIPADDR
# define CONFIG_NSH_DRIPADDR 0x0a000001
#endif
#ifndef CONFIG_NSH_NETMASK
# define CONFIG_NSH_NETMASK 0xffffff00
#endif
#ifndef CONFIG_NSH_DNSIPADDR
# define CONFIG_NSH_DNSIPADDR CONFIG_NSH_DRIPADDR
#endif
#ifndef CONFIG_NSH_MACADDR
# define CONFIG_NSH_MACADDR 0x00e0deadbeef
#endif
/* Telnetd requires networking support */
#ifndef CONFIG_NET
...
...
This diff is collapsed.
Click to expand it.
nshlib/nsh_netinit.c
+
6
−
6
View file @
16b2090c
...
...
@@ -119,12 +119,12 @@ int nsh_netinit(void)
/* Many embedded network interfaces must have a software assigned MAC */
#if defined(CONFIG_NSH_NOMAC) && !defined(CONFIG_NET_SLIP)
mac
[
0
]
=
0x00
;
mac
[
1
]
=
0xe0
;
mac
[
2
]
=
0xde
;
mac
[
3
]
=
0xad
;
mac
[
4
]
=
0xbe
;
mac
[
5
]
=
0x
e
f
;
mac
[
0
]
=
(
CONFIG_NSH_MACADDR
>>
(
8
*
5
))
&
0xff
;
mac
[
1
]
=
(
CONFIG_NSH_MACADDR
>>
(
8
*
4
))
&
0xff
;
mac
[
2
]
=
(
CONFIG_NSH_MACADDR
>>
(
8
*
3
))
&
0xff
;
mac
[
3
]
=
(
CONFIG_NSH_MACADDR
>>
(
8
*
2
))
&
0xff
;
mac
[
4
]
=
(
CONFIG_NSH_MACADDR
>>
(
8
*
1
))
&
0xff
;
mac
[
5
]
=
(
CONFIG_NSH_MACADDR
>>
(
8
*
0
))
&
0x
f
f
;
netlib_setmacaddr
(
NET_DEVNAME
,
mac
);
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment