diff options
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 59 |
1 files changed, 13 insertions, 46 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index ab15ecd4b3d6..1799eee88db7 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -51,8 +51,8 @@ | |||
51 | #include "mv643xx_eth.h" | 51 | #include "mv643xx_eth.h" |
52 | 52 | ||
53 | /* Static function declarations */ | 53 | /* Static function declarations */ |
54 | static void eth_port_uc_addr_get(struct net_device *dev, | 54 | static void eth_port_uc_addr_get(unsigned int port_num, unsigned char *p_addr); |
55 | unsigned char *MacAddr); | 55 | static void eth_port_uc_addr_set(unsigned int port_num, unsigned char *p_addr); |
56 | static void eth_port_set_multicast_list(struct net_device *); | 56 | static void eth_port_set_multicast_list(struct net_device *); |
57 | static void mv643xx_eth_port_enable_tx(unsigned int port_num, | 57 | static void mv643xx_eth_port_enable_tx(unsigned int port_num, |
58 | unsigned int queues); | 58 | unsigned int queues); |
@@ -1381,7 +1381,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
1381 | port_num = mp->port_num = pd->port_number; | 1381 | port_num = mp->port_num = pd->port_number; |
1382 | 1382 | ||
1383 | /* set default config values */ | 1383 | /* set default config values */ |
1384 | eth_port_uc_addr_get(dev, dev->dev_addr); | 1384 | eth_port_uc_addr_get(port_num, dev->dev_addr); |
1385 | mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE; | 1385 | mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE; |
1386 | mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE; | 1386 | mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE; |
1387 | 1387 | ||
@@ -1839,26 +1839,9 @@ static void eth_port_start(struct net_device *dev) | |||
1839 | } | 1839 | } |
1840 | 1840 | ||
1841 | /* | 1841 | /* |
1842 | * eth_port_uc_addr_set - This function Set the port Unicast address. | 1842 | * eth_port_uc_addr_set - Write a MAC address into the port's hw registers |
1843 | * | ||
1844 | * DESCRIPTION: | ||
1845 | * This function Set the port Ethernet MAC address. | ||
1846 | * | ||
1847 | * INPUT: | ||
1848 | * unsigned int eth_port_num Port number. | ||
1849 | * char * p_addr Address to be set | ||
1850 | * | ||
1851 | * OUTPUT: | ||
1852 | * Set MAC address low and high registers. also calls | ||
1853 | * eth_port_set_filter_table_entry() to set the unicast | ||
1854 | * table with the proper information. | ||
1855 | * | ||
1856 | * RETURN: | ||
1857 | * N/A. | ||
1858 | * | ||
1859 | */ | 1843 | */ |
1860 | static void eth_port_uc_addr_set(unsigned int eth_port_num, | 1844 | static void eth_port_uc_addr_set(unsigned int port_num, unsigned char *p_addr) |
1861 | unsigned char *p_addr) | ||
1862 | { | 1845 | { |
1863 | unsigned int mac_h; | 1846 | unsigned int mac_h; |
1864 | unsigned int mac_l; | 1847 | unsigned int mac_l; |
@@ -1868,40 +1851,24 @@ static void eth_port_uc_addr_set(unsigned int eth_port_num, | |||
1868 | mac_h = (p_addr[0] << 24) | (p_addr[1] << 16) | (p_addr[2] << 8) | | 1851 | mac_h = (p_addr[0] << 24) | (p_addr[1] << 16) | (p_addr[2] << 8) | |
1869 | (p_addr[3] << 0); | 1852 | (p_addr[3] << 0); |
1870 | 1853 | ||
1871 | mv_write(MV643XX_ETH_MAC_ADDR_LOW(eth_port_num), mac_l); | 1854 | mv_write(MV643XX_ETH_MAC_ADDR_LOW(port_num), mac_l); |
1872 | mv_write(MV643XX_ETH_MAC_ADDR_HIGH(eth_port_num), mac_h); | 1855 | mv_write(MV643XX_ETH_MAC_ADDR_HIGH(port_num), mac_h); |
1873 | 1856 | ||
1874 | /* Accept frames of this address */ | 1857 | /* Accept frames with this address */ |
1875 | table = MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE(eth_port_num); | 1858 | table = MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE(port_num); |
1876 | eth_port_set_filter_table_entry(table, p_addr[5] & 0x0f); | 1859 | eth_port_set_filter_table_entry(table, p_addr[5] & 0x0f); |
1877 | } | 1860 | } |
1878 | 1861 | ||
1879 | /* | 1862 | /* |
1880 | * eth_port_uc_addr_get - This function retrieves the port Unicast address | 1863 | * eth_port_uc_addr_get - Read the MAC address from the port's hw registers |
1881 | * (MAC address) from the ethernet hw registers. | ||
1882 | * | ||
1883 | * DESCRIPTION: | ||
1884 | * This function retrieves the port Ethernet MAC address. | ||
1885 | * | ||
1886 | * INPUT: | ||
1887 | * unsigned int eth_port_num Port number. | ||
1888 | * char *MacAddr pointer where the MAC address is stored | ||
1889 | * | ||
1890 | * OUTPUT: | ||
1891 | * Copy the MAC address to the location pointed to by MacAddr | ||
1892 | * | ||
1893 | * RETURN: | ||
1894 | * N/A. | ||
1895 | * | ||
1896 | */ | 1864 | */ |
1897 | static void eth_port_uc_addr_get(struct net_device *dev, unsigned char *p_addr) | 1865 | static void eth_port_uc_addr_get(unsigned int port_num, unsigned char *p_addr) |
1898 | { | 1866 | { |
1899 | struct mv643xx_private *mp = netdev_priv(dev); | ||
1900 | unsigned int mac_h; | 1867 | unsigned int mac_h; |
1901 | unsigned int mac_l; | 1868 | unsigned int mac_l; |
1902 | 1869 | ||
1903 | mac_h = mv_read(MV643XX_ETH_MAC_ADDR_HIGH(mp->port_num)); | 1870 | mac_h = mv_read(MV643XX_ETH_MAC_ADDR_HIGH(port_num)); |
1904 | mac_l = mv_read(MV643XX_ETH_MAC_ADDR_LOW(mp->port_num)); | 1871 | mac_l = mv_read(MV643XX_ETH_MAC_ADDR_LOW(port_num)); |
1905 | 1872 | ||
1906 | p_addr[0] = (mac_h >> 24) & 0xff; | 1873 | p_addr[0] = (mac_h >> 24) & 0xff; |
1907 | p_addr[1] = (mac_h >> 16) & 0xff; | 1874 | p_addr[1] = (mac_h >> 16) & 0xff; |