net: cosmetic: Name ethaddr variables consistently
Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Simon Glass
parent
586cbe51ab
commit
0adb5b761f
@@ -289,7 +289,7 @@ static inline void cpsw_ale_get_addr(u32 *ale_entry, u8 *addr)
|
||||
addr[i] = cpsw_ale_get_field(ale_entry, 40 - 8*i, 8);
|
||||
}
|
||||
|
||||
static inline void cpsw_ale_set_addr(u32 *ale_entry, u8 *addr)
|
||||
static inline void cpsw_ale_set_addr(u32 *ale_entry, const u8 *addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -321,7 +321,7 @@ static int cpsw_ale_write(struct cpsw_priv *priv, int idx, u32 *ale_entry)
|
||||
return idx;
|
||||
}
|
||||
|
||||
static int cpsw_ale_match_addr(struct cpsw_priv *priv, u8* addr)
|
||||
static int cpsw_ale_match_addr(struct cpsw_priv *priv, const u8 *addr)
|
||||
{
|
||||
u32 ale_entry[ALE_ENTRY_WORDS];
|
||||
int type, idx;
|
||||
@@ -374,7 +374,7 @@ static int cpsw_ale_find_ageable(struct cpsw_priv *priv)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr,
|
||||
static int cpsw_ale_add_ucast(struct cpsw_priv *priv, const u8 *addr,
|
||||
int port, int flags)
|
||||
{
|
||||
u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
|
||||
@@ -399,7 +399,8 @@ static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpsw_ale_add_mcast(struct cpsw_priv *priv, u8 *addr, int port_mask)
|
||||
static int cpsw_ale_add_mcast(struct cpsw_priv *priv, const u8 *addr,
|
||||
int port_mask)
|
||||
{
|
||||
u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
|
||||
int idx, mask;
|
||||
@@ -644,7 +645,7 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv)
|
||||
slave_port = cpsw_get_slave_port(priv, slave->slave_num);
|
||||
cpsw_ale_port_state(priv, slave_port, ALE_PORT_STATE_FORWARD);
|
||||
|
||||
cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << slave_port);
|
||||
cpsw_ale_add_mcast(priv, net_bcast_ethaddr, 1 << slave_port);
|
||||
|
||||
priv->phy_mask |= 1 << slave->data->phy_addr;
|
||||
}
|
||||
@@ -773,7 +774,7 @@ static int cpsw_init(struct eth_device *dev, bd_t *bis)
|
||||
|
||||
cpsw_ale_add_ucast(priv, priv->dev->enetaddr, priv->host_port,
|
||||
ALE_SECURE);
|
||||
cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << priv->host_port);
|
||||
cpsw_ale_add_mcast(priv, net_bcast_ethaddr, 1 << priv->host_port);
|
||||
|
||||
for_active_slave(slave, priv)
|
||||
cpsw_slave_init(slave, priv);
|
||||
|
||||
@@ -342,10 +342,10 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
|
||||
DM9000_iow(DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
|
||||
|
||||
printf("MAC: %pM\n", dev->enetaddr);
|
||||
if (!is_valid_ether_addr(dev->enetaddr)) {
|
||||
if (!is_valid_ethaddr(dev->enetaddr)) {
|
||||
#ifdef CONFIG_RANDOM_MACADDR
|
||||
printf("Bad MAC address (uninitialized EEPROM?), randomizing\n");
|
||||
eth_random_addr(dev->enetaddr);
|
||||
net_random_ethaddr(dev->enetaddr);
|
||||
printf("MAC: %pM\n", dev->enetaddr);
|
||||
#else
|
||||
printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
|
||||
|
||||
@@ -1197,7 +1197,7 @@ e1000_read_mac_addr(struct eth_device *nic)
|
||||
nic->enetaddr[5] ^= 1;
|
||||
|
||||
#ifdef CONFIG_E1000_FALLBACK_MAC
|
||||
if (!is_valid_ether_addr(nic->enetaddr)) {
|
||||
if (!is_valid_ethaddr(nic->enetaddr)) {
|
||||
unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
|
||||
|
||||
memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);
|
||||
|
||||
@@ -357,7 +357,7 @@ static int fec_get_hwaddr(struct eth_device *dev, int dev_id,
|
||||
unsigned char *mac)
|
||||
{
|
||||
imx_get_mac_from_fuse(dev_id, mac);
|
||||
return !is_valid_ether_addr(mac);
|
||||
return !is_valid_ethaddr(mac);
|
||||
}
|
||||
|
||||
static int fec_set_hwaddr(struct eth_device *dev)
|
||||
|
||||
@@ -425,7 +425,7 @@ int ftmac110_initialize(bd_t *bis)
|
||||
dev->recv = ftmac110_recv;
|
||||
|
||||
if (!eth_getenv_enetaddr_by_index("eth", card_nr, dev->enetaddr))
|
||||
eth_random_addr(dev->enetaddr);
|
||||
net_random_ethaddr(dev->enetaddr);
|
||||
|
||||
/* allocate tx descriptors (it must be 16 bytes aligned) */
|
||||
chip->txd = dma_alloc_coherent(
|
||||
|
||||
@@ -595,7 +595,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
|
||||
}
|
||||
|
||||
/* update the ethaddr */
|
||||
if (is_valid_ether_addr(netdev->enetaddr)) {
|
||||
if (is_valid_ethaddr(netdev->enetaddr)) {
|
||||
macb_write_hwaddr(netdev);
|
||||
} else {
|
||||
printf("%s: mac address is not valid\n", netdev->name);
|
||||
|
||||
@@ -117,7 +117,7 @@ static int refresh_settings_from_env(void)
|
||||
void NcStart(void)
|
||||
{
|
||||
refresh_settings_from_env();
|
||||
if (!output_packet_len || memcmp(nc_ether, NetEtherNullAddr, 6)) {
|
||||
if (!output_packet_len || memcmp(nc_ether, net_null_ethaddr, 6)) {
|
||||
/* going to check for input packet */
|
||||
net_set_udp_handler(nc_handler);
|
||||
NetSetTimeout(net_timeout, nc_timeout);
|
||||
@@ -180,7 +180,7 @@ static void nc_send_packet(const char *buf, int len)
|
||||
if (eth == NULL)
|
||||
return;
|
||||
|
||||
if (!memcmp(nc_ether, NetEtherNullAddr, 6)) {
|
||||
if (!memcmp(nc_ether, net_null_ethaddr, 6)) {
|
||||
if (eth->state == ETH_STATE_ACTIVE)
|
||||
return; /* inside net loop */
|
||||
output_packet = buf;
|
||||
|
||||
Reference in New Issue
Block a user