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
86
Issues
86
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
ea734f49
Commit
ea734f49
authored
Mar 21, 2013
by
Wesley W. Terpstra
Committed by
Alessandro Rubini
Mar 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrsw_hal: SFPs can use full 16 byte names
parent
c40cd72d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
i2c_sfp.c
userspace/libswitchhw/i2c_sfp.c
+3
-3
No files found.
userspace/libswitchhw/i2c_sfp.c
View file @
ea734f49
...
...
@@ -589,7 +589,7 @@ int shw_sfp_read_db(char *filename)
lua_pop
(
L
,
1
);
sfp
=
malloc
(
sizeof
(
struct
shw_sfp_caldata
));
str
cpy
(
sfp
->
part_num
,
sfp_pn
);
str
ncpy
(
sfp
->
part_num
,
sfp_pn
,
sizeof
(
sfp
->
part_num
)
);
if
(
!
sfp_vs
||
strcmp
(
sfp_vs
,
""
)
==
0
)
{
sfp
->
vendor_serial
[
0
]
=
0
;
sfp
->
flags
|=
SFP_FLAG_CLASS_DATA
;
...
...
@@ -639,9 +639,9 @@ struct shw_sfp_caldata *shw_sfp_get_cal_data(int num)
/* In the first pass, look for serial number */
while
(
t
)
{
// printf("search1 %s %s\n", t->part_num, t->vendor_serial);
if
(
str
cmp
(
pn
,
t
->
part_num
)
==
0
&&
strcmp
(
t
->
vendor_serial
,
""
)
==
0
)
if
(
str
ncmp
(
pn
,
t
->
part_num
,
16
)
==
0
&&
strncmp
(
t
->
vendor_serial
,
""
,
16
)
==
0
)
other
=
t
;
else
if
(
str
cmp
(
pn
,
t
->
part_num
)
==
0
&&
strcmp
(
vs
,
t
->
vendor_serial
)
==
0
)
else
if
(
str
ncmp
(
pn
,
t
->
part_num
,
16
)
==
0
&&
strncmp
(
vs
,
t
->
vendor_serial
,
16
)
==
0
)
return
t
;
t
=
t
->
next
;
}
...
...
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