Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
Software for White Rabbit PTP Core
Commits
93783a86
Commit
93783a86
authored
Apr 21, 2020
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell: bring back sfp command and sfpdb support
parent
44f9671b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
storage.c
dev/storage.c
+7
-7
shell.c
shell/shell.c
+1
-0
No files found.
dev/storage.c
View file @
93783a86
...
@@ -426,6 +426,9 @@ int set_persistent_mac(uint8_t portnum, uint8_t *mac)
...
@@ -426,6 +426,9 @@ int set_persistent_mac(uint8_t portnum, uint8_t *mac)
return 0;
return 0;
}
}
#endif
/*
/*
* The SFP section is placed somewhere inside EEPROM (W1 or I2C), using sdbfs.
* The SFP section is placed somewhere inside EEPROM (W1 or I2C), using sdbfs.
*
*
...
@@ -450,10 +453,10 @@ int storage_sfpdb_erase(void)
...
@@ -450,10 +453,10 @@ int storage_sfpdb_erase(void)
if
(
sdbfs_open_id
(
&
wrc_sdbfs
,
SDB_VENDOR
,
SDB_DEV_SFP
)
<
0
)
if
(
sdbfs_open_id
(
&
wrc_sdbfs
,
SDB_VENDOR
,
SDB_DEV_SFP
)
<
0
)
return
-
1
;
return
-
1
;
ret = sdbfs_ferase(&wrc_sdbfs, 0, wrc_sdb.f_len);
ret
=
sdbfs_ferase
(
&
wrc_sdbfs
,
0
,
wrc_sdb
fs
.
f_len
);
if (ret == wrc_sdb.f_len)
if
(
ret
==
wrc_sdb
fs
.
f_len
)
ret
=
1
;
ret
=
1
;
sdbfs_close(&wrc_sdb);
sdbfs_close
(
&
wrc_sdb
fs
);
return
ret
==
1
?
0
:
-
1
;
return
ret
==
1
?
0
:
-
1
;
}
}
...
@@ -543,7 +546,7 @@ static int sfp_entry(struct s_sfpinfo *sfp, uint8_t oper, uint8_t pos)
...
@@ -543,7 +546,7 @@ static int sfp_entry(struct s_sfpinfo *sfp, uint8_t oper, uint8_t pos)
}
}
ret
=
sfpcount
;
ret
=
sfpcount
;
out:
out:
sdbfs_close(&wrc_sdb);
sdbfs_close
(
&
wrc_sdb
fs
);
return
ret
;
return
ret
;
}
}
...
@@ -607,11 +610,9 @@ int storage_get_sfp(struct s_sfpinfo *sfp, uint8_t oper, uint8_t pos)
...
@@ -607,11 +610,9 @@ int storage_get_sfp(struct s_sfpinfo *sfp, uint8_t oper, uint8_t pos)
pp_printf
(
"Update existing SFP entry
\n
"
);
pp_printf
(
"Update existing SFP entry
\n
"
);
return
storage_update_sfp
(
sfp
);
return
storage_update_sfp
(
sfp
);
}
}
#endif
int
storage_match_sfp
(
struct
s_sfpinfo
*
sfp
)
int
storage_match_sfp
(
struct
s_sfpinfo
*
sfp
)
{
{
#if 0
uint8_t
sfpcount
=
1
;
uint8_t
sfpcount
=
1
;
int8_t
i
;
int8_t
i
;
struct
s_sfpinfo
dbsfp
;
struct
s_sfpinfo
dbsfp
;
...
@@ -627,7 +628,6 @@ int storage_match_sfp(struct s_sfpinfo *sfp)
...
@@ -627,7 +628,6 @@ int storage_match_sfp(struct s_sfpinfo *sfp)
return
1
;
return
1
;
}
}
}
}
#endif
return
0
;
return
0
;
}
}
...
...
shell/shell.c
View file @
93783a86
...
@@ -397,5 +397,6 @@ void shell_register_commands()
...
@@ -397,5 +397,6 @@ void shell_register_commands()
REGISTER_WRC_COMMAND
(
help
);
REGISTER_WRC_COMMAND
(
help
);
REGISTER_WRC_COMMAND
(
diag
);
REGISTER_WRC_COMMAND
(
diag
);
REGISTER_WRC_COMMAND
(
init
);
REGISTER_WRC_COMMAND
(
init
);
REGISTER_WRC_COMMAND
(
sfp
);
}
}
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