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
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
Software for White Rabbit PTP Core
Commits
9e0d9fe8
Commit
9e0d9fe8
authored
Oct 10, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeprom: don't pass redundant parameters to eeprom_init_* functions
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
efd393c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
21 deletions
+16
-21
eeprom.c
dev/eeprom.c
+4
-5
sdb-eeprom.c
dev/sdb-eeprom.c
+4
-5
eeprom.h
include/eeprom.h
+4
-6
cmd_init.c
shell/cmd_init.c
+3
-3
shell.c
shell/shell.c
+1
-2
No files found.
dev/eeprom.c
View file @
9e0d9fe8
...
...
@@ -254,7 +254,7 @@ int eeprom_phtrans(uint32_t * val,
}
}
int
8_t
eeprom_init_erase
(
uint8_t
i2cif
,
uint8_t
i2c_addr
)
int
eeprom_init_erase
(
void
)
{
uint16_t
used
=
0
;
...
...
@@ -268,7 +268,7 @@ int8_t eeprom_init_erase(uint8_t i2cif, uint8_t i2c_addr)
/*
* Appends a new shell command at the end of boot script
*/
int
8_t
eeprom_init_add
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
const
char
*
args
[])
int
eeprom_init_add
(
const
char
*
args
[])
{
uint8_t
i
=
1
;
uint8_t
separator
=
' '
;
...
...
@@ -311,7 +311,7 @@ int8_t eeprom_init_add(uint8_t i2cif, uint8_t i2c_addr, const char *args[])
return
0
;
}
int
32_t
eeprom_init_show
(
uint8_t
i2cif
,
uint8_t
i2c_addr
)
int
eeprom_init_show
(
void
)
{
uint16_t
used
,
i
;
uint8_t
byte
;
...
...
@@ -335,8 +335,7 @@ int32_t eeprom_init_show(uint8_t i2cif, uint8_t i2c_addr)
return
0
;
}
int8_t
eeprom_init_readcmd
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint8_t
*
buf
,
uint8_t
bufsize
,
uint8_t
next
)
int
eeprom_init_readcmd
(
uint8_t
*
buf
,
uint8_t
bufsize
,
uint8_t
next
)
{
static
uint16_t
ptr
;
static
uint16_t
used
=
0
;
...
...
dev/sdb-eeprom.c
View file @
9e0d9fe8
...
...
@@ -420,7 +420,7 @@ out:
* ------------------------------------------------
*/
int
8_t
eeprom_init_erase
(
uint8_t
i2cif
,
uint8_t
i2c_addr
)
int
eeprom_init_erase
(
void
)
{
uint16_t
used
=
0
;
int
ret
;
...
...
@@ -435,7 +435,7 @@ int8_t eeprom_init_erase(uint8_t i2cif, uint8_t i2c_addr)
/*
* Appends a new shell command at the end of boot script
*/
int
8_t
eeprom_init_add
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
const
char
*
args
[])
int
eeprom_init_add
(
const
char
*
args
[])
{
int
len
,
i
=
1
;
/* args[0] is "add" */
uint8_t
separator
=
' '
;
...
...
@@ -481,7 +481,7 @@ out:
return
ret
;
}
int
32_t
eeprom_init_show
(
uint8_t
i2cif
,
uint8_t
i2c_addr
)
int
eeprom_init_show
(
void
)
{
int
i
,
ret
=
-
1
;
uint16_t
used
;
...
...
@@ -511,8 +511,7 @@ out:
return
ret
;
}
int8_t
eeprom_init_readcmd
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint8_t
*
buf
,
uint8_t
bufsize
,
uint8_t
next
)
int
eeprom_init_readcmd
(
uint8_t
*
buf
,
uint8_t
bufsize
,
uint8_t
next
)
{
int
i
=
0
,
ret
=
-
1
;
uint16_t
used
;
...
...
include/eeprom.h
View file @
9e0d9fe8
...
...
@@ -37,11 +37,9 @@ int eeprom_get_sfp(struct s_sfpinfo * sfp,
int
eeprom_phtrans
(
uint32_t
*
val
,
uint8_t
write
);
int8_t
eeprom_init_erase
(
uint8_t
i2cif
,
uint8_t
i2c_addr
);
int8_t
eeprom_init_add
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
const
char
*
args
[]);
int32_t
eeprom_init_show
(
uint8_t
i2cif
,
uint8_t
i2c_addr
);
int8_t
eeprom_init_readcmd
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint8_t
*
buf
,
uint8_t
bufsize
,
uint8_t
next
);
int
eeprom_init_erase
(
void
);
int
eeprom_init_add
(
const
char
*
args
[]);
int
eeprom_init_show
(
void
);
int
eeprom_init_readcmd
(
uint8_t
*
buf
,
uint8_t
bufsize
,
uint8_t
next
);
#endif
shell/cmd_init.c
View file @
9e0d9fe8
...
...
@@ -22,15 +22,15 @@ static int cmd_init(const char *args[])
}
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"erase"
))
{
if
(
eeprom_init_erase
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
)
<
0
)
if
(
eeprom_init_erase
()
<
0
)
mprintf
(
"Could not erase init script
\n
"
);
}
else
if
(
args
[
1
]
&&
!
strcasecmp
(
args
[
0
],
"add"
))
{
if
(
eeprom_init_add
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
args
)
<
0
)
if
(
eeprom_init_add
(
args
)
<
0
)
mprintf
(
"Could not add the command
\n
"
);
else
mprintf
(
"OK.
\n
"
);
}
else
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"show"
))
{
eeprom_init_show
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
);
eeprom_init_show
();
}
else
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"boot"
))
{
shell_boot_script
();
}
...
...
shell/shell.c
View file @
9e0d9fe8
...
...
@@ -256,8 +256,7 @@ int shell_boot_script(void)
return
-
1
;
while
(
1
)
{
cmd_len
=
eeprom_init_readcmd
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
(
uint8_t
*
)
cmd_buf
,
cmd_len
=
eeprom_init_readcmd
((
uint8_t
*
)
cmd_buf
,
SH_MAX_LINE_LEN
,
next
);
if
(
cmd_len
<=
0
)
{
if
(
next
==
0
)
...
...
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