diff options
-rw-r--r-- | drivers/net/bfin_mac.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index cebe55440e13..ead7be969975 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -463,7 +463,7 @@ void setup_system_regs(struct net_device *dev) | |||
463 | bfin_write_DMA1_Y_MODIFY(0); | 463 | bfin_write_DMA1_Y_MODIFY(0); |
464 | } | 464 | } |
465 | 465 | ||
466 | void setup_mac_addr(u8 * mac_addr) | 466 | static void setup_mac_addr(u8 *mac_addr) |
467 | { | 467 | { |
468 | u32 addr_low = le32_to_cpu(*(__le32 *) & mac_addr[0]); | 468 | u32 addr_low = le32_to_cpu(*(__le32 *) & mac_addr[0]); |
469 | u16 addr_hi = le16_to_cpu(*(__le16 *) & mac_addr[4]); | 469 | u16 addr_hi = le16_to_cpu(*(__le16 *) & mac_addr[4]); |
@@ -473,6 +473,16 @@ void setup_mac_addr(u8 * mac_addr) | |||
473 | bfin_write_EMAC_ADDRHI(addr_hi); | 473 | bfin_write_EMAC_ADDRHI(addr_hi); |
474 | } | 474 | } |
475 | 475 | ||
476 | static int bf537mac_set_mac_address(struct net_device *dev, void *p) | ||
477 | { | ||
478 | struct sockaddr *addr = p; | ||
479 | if (netif_running(dev)) | ||
480 | return -EBUSY; | ||
481 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | ||
482 | setup_mac_addr(dev->dev_addr); | ||
483 | return 0; | ||
484 | } | ||
485 | |||
476 | static void adjust_tx_list(void) | 486 | static void adjust_tx_list(void) |
477 | { | 487 | { |
478 | int timeout_cnt = MAX_TIMEOUT_CNT; | 488 | int timeout_cnt = MAX_TIMEOUT_CNT; |
@@ -876,6 +886,7 @@ static int __init bf537mac_probe(struct net_device *dev) | |||
876 | dev->open = bf537mac_open; | 886 | dev->open = bf537mac_open; |
877 | dev->stop = bf537mac_close; | 887 | dev->stop = bf537mac_close; |
878 | dev->hard_start_xmit = bf537mac_hard_start_xmit; | 888 | dev->hard_start_xmit = bf537mac_hard_start_xmit; |
889 | dev->set_mac_address = bf537mac_set_mac_address; | ||
879 | dev->tx_timeout = bf537mac_timeout; | 890 | dev->tx_timeout = bf537mac_timeout; |
880 | dev->set_multicast_list = bf537mac_set_multicast_list; | 891 | dev->set_multicast_list = bf537mac_set_multicast_list; |
881 | #ifdef CONFIG_NET_POLL_CONTROLLER | 892 | #ifdef CONFIG_NET_POLL_CONTROLLER |