Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
84
Issues
84
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
b6760017
Commit
b6760017
authored
Jul 24, 2015
by
Alessandro Rubini
Committed by
Grzegorz Daniluk
Jul 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/hal: save port's MAC address to shmem
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
01a0ac34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
hal_ports.c
userspace/wrsw_hal/hal_ports.c
+3
-3
No files found.
userspace/wrsw_hal/hal_ports.c
View file @
b6760017
...
...
@@ -74,7 +74,7 @@ static void hal_port_reset_state(struct hal_port_state * p)
}
/* checks if the port is supported by the FPGA firmware */
static
int
hal_port_check_presence
(
const
char
*
if_name
)
static
int
hal_port_check_presence
(
const
char
*
if_name
,
unsigned
char
*
mac
)
{
struct
ifreq
ifr
;
...
...
@@ -82,7 +82,7 @@ static int hal_port_check_presence(const char *if_name)
if
(
ioctl
(
hal_port_fd
,
SIOCGIFHWADDR
,
&
ifr
)
<
0
)
return
0
;
memcpy
(
mac
,
ifr
.
ifr_hwaddr
.
sa_data
,
ETH_ALEN
);
return
1
;
}
...
...
@@ -112,7 +112,7 @@ static int hal_port_init(int index)
strncpy
(
p
->
name
,
name
,
16
);
/* check if the port is built into the firmware, if not, we are done */
if
(
!
hal_port_check_presence
(
name
))
if
(
!
hal_port_check_presence
(
name
,
p
->
hw_addr
))
return
-
1
;
p
->
state
=
HAL_PORT_STATE_DISABLED
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment