mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 13:16:47 +02:00
util/nvmutil: rename some functions for clarity
also re-order the prototypes Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+10
-12
@@ -15,15 +15,13 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
void cmd_setchecksum(void), cmd_brick(void), swap(int partnum), writeGbe(void),
|
void cmd_setchecksum(void), cmd_brick(void), swap(int partnum), writeGbe(void),
|
||||||
cmd_dump(void), cmd_setmac(void), readGbe(void),
|
cmd_dump(void), cmd_setmac(void), readGbe(void), print_mac_address(int),
|
||||||
set_mac_nib(int, int, uint8_t *),
|
hexdump(int), set_mac_nib(int, int, uint8_t *), checkdir(const char *),
|
||||||
checkdir(const char *path), macf(int partnum), hexdump(int partnum),
|
|
||||||
parseMacString(const char *strMac, uint16_t *mac), cmd_swap(void),
|
parseMacString(const char *strMac, uint16_t *mac), cmd_swap(void),
|
||||||
openFiles(void), cmd_copy(void), writeGbe_part(int),
|
openFiles(void), cmd_copy(void), writeGbe_part(int), readGbe_part(int),
|
||||||
readGbe_part(int), usage(char*), set_io_flags(int, char **),
|
|
||||||
set_cmd(int, char **), setWord(int, int, uint16_t), check_bounds(int, int),
|
set_cmd(int, char **), setWord(int, int, uint16_t), check_bounds(int, int),
|
||||||
xopen (int *, const char *, int p, struct stat *),
|
xopen (int *, const char *, int p, struct stat *), checkMacSeparator(int),
|
||||||
set_mac_byte(int, uint64_t *), check_mac_separator(int);
|
set_mac_byte(int, uint64_t *), usage(char*), set_io_flags(int, char **);
|
||||||
int goodChecksum(int partnum);
|
int goodChecksum(int partnum);
|
||||||
uint8_t hextonum(char chs), rhex(void);
|
uint8_t hextonum(char chs), rhex(void);
|
||||||
uint16_t word(int, int);
|
uint16_t word(int, int);
|
||||||
@@ -216,7 +214,7 @@ cmd_setmac(void)
|
|||||||
setWord(w, partnum, mac[w]);
|
setWord(w, partnum, mac[w]);
|
||||||
|
|
||||||
printf("Wrote MAC address to part %d: ", partnum);
|
printf("Wrote MAC address to part %d: ", partnum);
|
||||||
macf(partnum);
|
print_mac_address(partnum);
|
||||||
|
|
||||||
cmd_setchecksum();
|
cmd_setchecksum();
|
||||||
mac_updated = 1;
|
mac_updated = 1;
|
||||||
@@ -246,14 +244,14 @@ void
|
|||||||
set_mac_byte(int strMacPos, uint64_t *total)
|
set_mac_byte(int strMacPos, uint64_t *total)
|
||||||
{
|
{
|
||||||
uint8_t h = 0;
|
uint8_t h = 0;
|
||||||
check_mac_separator(strMacPos);
|
checkMacSeparator(strMacPos);
|
||||||
|
|
||||||
for (int nib = 0; nib < 2; nib++, *total += h)
|
for (int nib = 0; nib < 2; nib++, *total += h)
|
||||||
set_mac_nib(strMacPos, nib, &h);
|
set_mac_nib(strMacPos, nib, &h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
check_mac_separator(int strMacPos)
|
checkMacSeparator(int strMacPos)
|
||||||
{
|
{
|
||||||
if (strMacPos == 15)
|
if (strMacPos == 15)
|
||||||
return;
|
return;
|
||||||
@@ -314,7 +312,7 @@ cmd_dump(void)
|
|||||||
++numInvalid;
|
++numInvalid;
|
||||||
|
|
||||||
printf("MAC (part %d): ", partnum);
|
printf("MAC (part %d): ", partnum);
|
||||||
macf(partnum);
|
print_mac_address(partnum);
|
||||||
hexdump(partnum);
|
hexdump(partnum);
|
||||||
|
|
||||||
if ((numInvalid < 2) && (partnum))
|
if ((numInvalid < 2) && (partnum))
|
||||||
@@ -323,7 +321,7 @@ cmd_dump(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
macf(int partnum)
|
print_mac_address(int partnum)
|
||||||
{
|
{
|
||||||
for (int c = 0; c < 3; c++) {
|
for (int c = 0; c < 3; c++) {
|
||||||
uint16_t val16 = word(c, partnum);
|
uint16_t val16 = word(c, partnum);
|
||||||
|
|||||||
Reference in New Issue
Block a user