diff options
-rw-r--r-- | drivers/net/8139cp.c | 33 | ||||
-rw-r--r-- | drivers/net/8139too.c | 27 |
2 files changed, 36 insertions, 24 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 664bd73645cb..13f75b67872d 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1817,6 +1817,25 @@ static void cp_set_d3_state (struct cp_private *cp) | |||
1817 | pci_set_power_state (cp->pdev, PCI_D3hot); | 1817 | pci_set_power_state (cp->pdev, PCI_D3hot); |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | static const struct net_device_ops cp_netdev_ops = { | ||
1821 | .ndo_open = cp_open, | ||
1822 | .ndo_stop = cp_close, | ||
1823 | .ndo_validate_addr = eth_validate_addr, | ||
1824 | .ndo_set_multicast_list = cp_set_rx_mode, | ||
1825 | .ndo_get_stats = cp_get_stats, | ||
1826 | .ndo_do_ioctl = cp_ioctl, | ||
1827 | .ndo_tx_timeout = cp_tx_timeout, | ||
1828 | #if CP_VLAN_TAG_USED | ||
1829 | .ndo_vlan_rx_register = cp_vlan_rx_register, | ||
1830 | #endif | ||
1831 | #ifdef BROKEN | ||
1832 | .ndo_change_mtu = cp_change_mtu, | ||
1833 | #endif | ||
1834 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1835 | .ndo_poll_controller = cp_poll_controller, | ||
1836 | #endif | ||
1837 | }; | ||
1838 | |||
1820 | static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | 1839 | static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) |
1821 | { | 1840 | { |
1822 | struct net_device *dev; | 1841 | struct net_device *dev; |
@@ -1929,26 +1948,14 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1929 | cpu_to_le16(read_eeprom (regs, i + 7, addr_len)); | 1948 | cpu_to_le16(read_eeprom (regs, i + 7, addr_len)); |
1930 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 1949 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
1931 | 1950 | ||
1932 | dev->open = cp_open; | 1951 | dev->netdev_ops = &cp_netdev_ops; |
1933 | dev->stop = cp_close; | ||
1934 | dev->set_multicast_list = cp_set_rx_mode; | ||
1935 | dev->hard_start_xmit = cp_start_xmit; | 1952 | dev->hard_start_xmit = cp_start_xmit; |
1936 | dev->get_stats = cp_get_stats; | ||
1937 | dev->do_ioctl = cp_ioctl; | ||
1938 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1939 | dev->poll_controller = cp_poll_controller; | ||
1940 | #endif | ||
1941 | netif_napi_add(dev, &cp->napi, cp_rx_poll, 16); | 1953 | netif_napi_add(dev, &cp->napi, cp_rx_poll, 16); |
1942 | #ifdef BROKEN | ||
1943 | dev->change_mtu = cp_change_mtu; | ||
1944 | #endif | ||
1945 | dev->ethtool_ops = &cp_ethtool_ops; | 1954 | dev->ethtool_ops = &cp_ethtool_ops; |
1946 | dev->tx_timeout = cp_tx_timeout; | ||
1947 | dev->watchdog_timeo = TX_TIMEOUT; | 1955 | dev->watchdog_timeo = TX_TIMEOUT; |
1948 | 1956 | ||
1949 | #if CP_VLAN_TAG_USED | 1957 | #if CP_VLAN_TAG_USED |
1950 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 1958 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
1951 | dev->vlan_rx_register = cp_vlan_rx_register; | ||
1952 | #endif | 1959 | #endif |
1953 | 1960 | ||
1954 | if (pci_using_dac) | 1961 | if (pci_using_dac) |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 37456ada44cf..f8866552386a 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -916,6 +916,19 @@ err_out: | |||
916 | return rc; | 916 | return rc; |
917 | } | 917 | } |
918 | 918 | ||
919 | static const struct net_device_ops rtl8139_netdev_ops = { | ||
920 | .ndo_open = rtl8139_open, | ||
921 | .ndo_stop = rtl8139_close, | ||
922 | .ndo_get_stats = rtl8139_get_stats, | ||
923 | .ndo_validate_addr = eth_validate_addr, | ||
924 | .ndo_set_multicast_list = rtl8139_set_rx_mode, | ||
925 | .ndo_do_ioctl = netdev_ioctl, | ||
926 | .ndo_tx_timeout = rtl8139_tx_timeout, | ||
927 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
928 | .ndo_poll_controller = rtl8139_poll_controller, | ||
929 | #endif | ||
930 | |||
931 | }; | ||
919 | 932 | ||
920 | static int __devinit rtl8139_init_one (struct pci_dev *pdev, | 933 | static int __devinit rtl8139_init_one (struct pci_dev *pdev, |
921 | const struct pci_device_id *ent) | 934 | const struct pci_device_id *ent) |
@@ -976,19 +989,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
976 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 989 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
977 | 990 | ||
978 | /* The Rtl8139-specific entries in the device structure. */ | 991 | /* The Rtl8139-specific entries in the device structure. */ |
979 | dev->open = rtl8139_open; | 992 | dev->netdev_ops = &rtl8139_netdev_ops; |
980 | dev->hard_start_xmit = rtl8139_start_xmit; | ||
981 | netif_napi_add(dev, &tp->napi, rtl8139_poll, 64); | ||
982 | dev->stop = rtl8139_close; | ||
983 | dev->get_stats = rtl8139_get_stats; | ||
984 | dev->set_multicast_list = rtl8139_set_rx_mode; | ||
985 | dev->do_ioctl = netdev_ioctl; | ||
986 | dev->ethtool_ops = &rtl8139_ethtool_ops; | 993 | dev->ethtool_ops = &rtl8139_ethtool_ops; |
987 | dev->tx_timeout = rtl8139_tx_timeout; | ||
988 | dev->watchdog_timeo = TX_TIMEOUT; | 994 | dev->watchdog_timeo = TX_TIMEOUT; |
989 | #ifdef CONFIG_NET_POLL_CONTROLLER | 995 | dev->hard_start_xmit = rtl8139_start_xmit; |
990 | dev->poll_controller = rtl8139_poll_controller; | 996 | netif_napi_add(dev, &tp->napi, rtl8139_poll, 64); |
991 | #endif | ||
992 | 997 | ||
993 | /* note: the hardware is not capable of sg/csum/highdma, however | 998 | /* note: the hardware is not capable of sg/csum/highdma, however |
994 | * through the use of skb_copy_and_csum_dev we enable these | 999 | * through the use of skb_copy_and_csum_dev we enable these |