提交 ed9b5d45 编写于 作者: D Dale Farnsworth 提交者: Jeff Garzik

[PATCH] mv643xx_eth: Remove needless mp->port_mac_addr

mp->port_mac_addr is just a redundant copy of dev->dev_addr, so remove it.
Signed-off-by: NDale Farnsworth <dale@farnsworth.org>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 cfc88b07
...@@ -243,8 +243,7 @@ static void mv643xx_eth_update_mac_address(struct net_device *dev) ...@@ -243,8 +243,7 @@ static void mv643xx_eth_update_mac_address(struct net_device *dev)
unsigned int port_num = mp->port_num; unsigned int port_num = mp->port_num;
eth_port_init_mac_tables(port_num); eth_port_init_mac_tables(port_num);
memcpy(mp->port_mac_addr, dev->dev_addr, 6); eth_port_uc_addr_set(port_num, dev->dev_addr);
eth_port_uc_addr_set(port_num, mp->port_mac_addr);
} }
/* /*
...@@ -320,7 +319,7 @@ static void mv643xx_eth_tx_timeout_task(struct net_device *dev) ...@@ -320,7 +319,7 @@ static void mv643xx_eth_tx_timeout_task(struct net_device *dev)
netif_device_detach(dev); netif_device_detach(dev);
eth_port_reset(mp->port_num); eth_port_reset(mp->port_num);
eth_port_start(mp); eth_port_start(dev);
netif_device_attach(dev); netif_device_attach(dev);
} }
...@@ -751,9 +750,6 @@ static int mv643xx_eth_open(struct net_device *dev) ...@@ -751,9 +750,6 @@ static int mv643xx_eth_open(struct net_device *dev)
/* Stop RX Queues */ /* Stop RX Queues */
mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), 0x0000ff00); mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), 0x0000ff00);
/* Set the MAC Address */
memcpy(mp->port_mac_addr, dev->dev_addr, 6);
eth_port_init(mp); eth_port_init(mp);
INIT_WORK(&mp->rx_task, (void (*)(void *))mv643xx_eth_rx_task, dev); INIT_WORK(&mp->rx_task, (void (*)(void *))mv643xx_eth_rx_task, dev);
...@@ -839,7 +835,7 @@ static int mv643xx_eth_open(struct net_device *dev) ...@@ -839,7 +835,7 @@ static int mv643xx_eth_open(struct net_device *dev)
mv643xx_eth_rx_task(dev); /* Fill RX ring with skb's */ mv643xx_eth_rx_task(dev); /* Fill RX ring with skb's */
eth_port_start(mp); eth_port_start(dev);
/* Interrupt Coalescing */ /* Interrupt Coalescing */
...@@ -1706,7 +1702,6 @@ MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX"); ...@@ -1706,7 +1702,6 @@ MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX");
* Prior to calling the initialization routine eth_port_init() the user * Prior to calling the initialization routine eth_port_init() the user
* must set the following fields under mv643xx_private struct: * must set the following fields under mv643xx_private struct:
* port_num User Ethernet port number. * port_num User Ethernet port number.
* port_mac_addr[6] User defined port MAC address.
* port_config User port configuration value. * port_config User port configuration value.
* port_config_extend User port config extend value. * port_config_extend User port config extend value.
* port_sdma_config User port SDMA config value. * port_sdma_config User port SDMA config value.
...@@ -1796,7 +1791,7 @@ static void eth_port_init(struct mv643xx_private *mp) ...@@ -1796,7 +1791,7 @@ static void eth_port_init(struct mv643xx_private *mp)
* and ether_init_rx_desc_ring for Rx queues). * and ether_init_rx_desc_ring for Rx queues).
* *
* INPUT: * INPUT:
* struct mv643xx_private *mp Ethernet port control struct * dev - a pointer to the required interface
* *
* OUTPUT: * OUTPUT:
* Ethernet port is ready to receive and transmit. * Ethernet port is ready to receive and transmit.
...@@ -1804,8 +1799,9 @@ static void eth_port_init(struct mv643xx_private *mp) ...@@ -1804,8 +1799,9 @@ static void eth_port_init(struct mv643xx_private *mp)
* RETURN: * RETURN:
* None. * None.
*/ */
static void eth_port_start(struct mv643xx_private *mp) static void eth_port_start(struct net_device *dev)
{ {
struct mv643xx_private *mp = netdev_priv(dev);
unsigned int port_num = mp->port_num; unsigned int port_num = mp->port_num;
int tx_curr_desc, rx_curr_desc; int tx_curr_desc, rx_curr_desc;
...@@ -1820,7 +1816,7 @@ static void eth_port_start(struct mv643xx_private *mp) ...@@ -1820,7 +1816,7 @@ static void eth_port_start(struct mv643xx_private *mp)
(u32)((struct eth_rx_desc *)mp->rx_desc_dma + rx_curr_desc)); (u32)((struct eth_rx_desc *)mp->rx_desc_dma + rx_curr_desc));
/* Add the assigned Ethernet address to the port's address table */ /* Add the assigned Ethernet address to the port's address table */
eth_port_uc_addr_set(port_num, mp->port_mac_addr); eth_port_uc_addr_set(port_num, dev->dev_addr);
/* Assign port configuration and command. */ /* Assign port configuration and command. */
mv_write(MV643XX_ETH_PORT_CONFIG_REG(port_num), mp->port_config); mv_write(MV643XX_ETH_PORT_CONFIG_REG(port_num), mp->port_config);
......
...@@ -324,7 +324,6 @@ struct mv643xx_mib_counters { ...@@ -324,7 +324,6 @@ struct mv643xx_mib_counters {
struct mv643xx_private { struct mv643xx_private {
int port_num; /* User Ethernet port number */ int port_num; /* User Ethernet port number */
u8 port_mac_addr[6]; /* User defined port MAC address.*/
u32 port_config; /* User port configuration value*/ u32 port_config; /* User port configuration value*/
u32 port_config_extend; /* User port config extend value*/ u32 port_config_extend; /* User port config extend value*/
u32 port_sdma_config; /* User port SDMA config value */ u32 port_sdma_config; /* User port SDMA config value */
...@@ -405,7 +404,7 @@ struct mv643xx_private { ...@@ -405,7 +404,7 @@ struct mv643xx_private {
/* Port operation control routines */ /* Port operation control routines */
static void eth_port_init(struct mv643xx_private *mp); static void eth_port_init(struct mv643xx_private *mp);
static void eth_port_reset(unsigned int eth_port_num); static void eth_port_reset(unsigned int eth_port_num);
static void eth_port_start(struct mv643xx_private *mp); static void eth_port_start(struct net_device *dev);
/* Port MAC address routines */ /* Port MAC address routines */
static void eth_port_uc_addr_set(unsigned int eth_port_num, static void eth_port_uc_addr_set(unsigned int eth_port_num,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册