Commit 9e5e9f80 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

cleanup get/set_persistent_mac calls

parent 23486d8a
......@@ -47,7 +47,7 @@ int wrc_board_early_init()
/*
* Try reading MAC addr stored in flash
*/
if (get_persistent_mac(0, mac_addr) == -1) {
if (storage_get_persistent_mac(mac_addr) == -1) {
board_dbg("Failed to get MAC address from the flash. Using fallback address.\n");
mac_addr[0] = 0x22;
mac_addr[1] = 0x33;
......
......@@ -61,7 +61,7 @@ int wrc_board_early_init()
// fixme: read MAC address from the MMC
uint8_t mac[6];
get_persistent_mac(0, mac);
storage_get_persistent_mac(mac);
board_dbg("Board MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
......
......@@ -818,7 +818,7 @@ int storage_phtrans(uint32_t *valp, uint8_t write)
/* MAC Address Storage */
int get_persistent_mac(uint8_t portnum, uint8_t *mac)
int storage_get_persistent_mac(uint8_t *mac)
{
int ret = 0;
int i;
......@@ -875,7 +875,7 @@ int get_persistent_mac(uint8_t portnum, uint8_t *mac)
return 0;
}
int set_persistent_mac(uint8_t portnum, uint8_t *mac)
int storage_set_persistent_mac(uint8_t *mac)
{
int ret;
......
......@@ -140,6 +140,8 @@ int storage_save_calibration(void);
int storage_read_hdl_cfg(void);
int storage_mount( struct storage_device *dev );
int storage_get_persistent_mac(uint8_t *mac);
int storage_set_persistent_mac(uint8_t *mac);
#endif
......@@ -14,6 +14,7 @@
#include "softpll_ng.h"
#include "shell.h"
#include "storage.h"
#include "dev/onewire.h"
#include "dev/endpoint.h"
......@@ -49,14 +50,14 @@ static int cmd_mac(const char *args[])
} else if (!strcasecmp(args[0], "getp")) {
/* get persistent MAC */
ep_get_mac_addr(mac);
get_persistent_mac(ONEWIRE_PORT, mac);
storage_get_persistent_mac(mac);
} else if (!strcasecmp(args[0], "set") && args[1]) {
decode_mac(args[1], mac);
ep_set_mac_addr(mac);
pfilter_init_default();
} else if (!strcasecmp(args[0], "setp") && args[1]) {
decode_mac(args[1], mac);
set_persistent_mac(ONEWIRE_PORT, mac);
storage_set_persistent_mac(mac);
} else {
return -EINVAL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment