diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-20 23:14:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 23:14:53 -0500 |
commit | 008298231abbeb91bc7be9e8b078607b816d1a4a (patch) | |
tree | 8cb0c17720086ef97c614b96241f06aa63ce8511 /drivers/net | |
parent | 6ab33d51713d6d60c7677c0d020910a8cb37e513 (diff) |
netdev: add more functions to netdevice ops
This patch moves neigh_setup and hard_start_xmit into the network device ops
structure. For bisection, fix all the previously converted drivers as well.
Bonding driver took the biggest hit on this.
Added a prefetch of the hard_start_xmit in the fast path to try and reduce
any impact this would have.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
29 files changed, 132 insertions, 61 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 13f75b67872d..f6d9d1353dd5 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1824,6 +1824,7 @@ static const struct net_device_ops cp_netdev_ops = { | |||
1824 | .ndo_set_multicast_list = cp_set_rx_mode, | 1824 | .ndo_set_multicast_list = cp_set_rx_mode, |
1825 | .ndo_get_stats = cp_get_stats, | 1825 | .ndo_get_stats = cp_get_stats, |
1826 | .ndo_do_ioctl = cp_ioctl, | 1826 | .ndo_do_ioctl = cp_ioctl, |
1827 | .ndo_start_xmit = cp_start_xmit, | ||
1827 | .ndo_tx_timeout = cp_tx_timeout, | 1828 | .ndo_tx_timeout = cp_tx_timeout, |
1828 | #if CP_VLAN_TAG_USED | 1829 | #if CP_VLAN_TAG_USED |
1829 | .ndo_vlan_rx_register = cp_vlan_rx_register, | 1830 | .ndo_vlan_rx_register = cp_vlan_rx_register, |
@@ -1949,7 +1950,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1949 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 1950 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
1950 | 1951 | ||
1951 | dev->netdev_ops = &cp_netdev_ops; | 1952 | dev->netdev_ops = &cp_netdev_ops; |
1952 | dev->hard_start_xmit = cp_start_xmit; | ||
1953 | netif_napi_add(dev, &cp->napi, cp_rx_poll, 16); | 1953 | netif_napi_add(dev, &cp->napi, cp_rx_poll, 16); |
1954 | dev->ethtool_ops = &cp_ethtool_ops; | 1954 | dev->ethtool_ops = &cp_ethtool_ops; |
1955 | dev->watchdog_timeo = TX_TIMEOUT; | 1955 | dev->watchdog_timeo = TX_TIMEOUT; |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index f8866552386a..445a479db79d 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -921,6 +921,7 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
921 | .ndo_stop = rtl8139_close, | 921 | .ndo_stop = rtl8139_close, |
922 | .ndo_get_stats = rtl8139_get_stats, | 922 | .ndo_get_stats = rtl8139_get_stats, |
923 | .ndo_validate_addr = eth_validate_addr, | 923 | .ndo_validate_addr = eth_validate_addr, |
924 | .ndo_start_xmit = rtl8139_start_xmit, | ||
924 | .ndo_set_multicast_list = rtl8139_set_rx_mode, | 925 | .ndo_set_multicast_list = rtl8139_set_rx_mode, |
925 | .ndo_do_ioctl = netdev_ioctl, | 926 | .ndo_do_ioctl = netdev_ioctl, |
926 | .ndo_tx_timeout = rtl8139_tx_timeout, | 927 | .ndo_tx_timeout = rtl8139_tx_timeout, |
@@ -992,7 +993,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
992 | dev->netdev_ops = &rtl8139_netdev_ops; | 993 | dev->netdev_ops = &rtl8139_netdev_ops; |
993 | dev->ethtool_ops = &rtl8139_ethtool_ops; | 994 | dev->ethtool_ops = &rtl8139_ethtool_ops; |
994 | dev->watchdog_timeo = TX_TIMEOUT; | 995 | dev->watchdog_timeo = TX_TIMEOUT; |
995 | dev->hard_start_xmit = rtl8139_start_xmit; | ||
996 | netif_napi_add(dev, &tp->napi, rtl8139_poll, 64); | 996 | netif_napi_add(dev, &tp->napi, rtl8139_poll, 64); |
997 | 997 | ||
998 | /* note: the hardware is not capable of sg/csum/highdma, however | 998 | /* note: the hardware is not capable of sg/csum/highdma, however |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 309a90ea9211..21d24320210a 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -455,10 +455,13 @@ static const struct net_device_ops ace_netdev_ops = { | |||
455 | .ndo_stop = ace_close, | 455 | .ndo_stop = ace_close, |
456 | .ndo_tx_timeout = ace_watchdog, | 456 | .ndo_tx_timeout = ace_watchdog, |
457 | .ndo_get_stats = ace_get_stats, | 457 | .ndo_get_stats = ace_get_stats, |
458 | .ndo_start_xmit = ace_start_xmit, | ||
458 | .ndo_set_multicast_list = ace_set_multicast_list, | 459 | .ndo_set_multicast_list = ace_set_multicast_list, |
459 | .ndo_set_mac_address = ace_set_mac_addr, | 460 | .ndo_set_mac_address = ace_set_mac_addr, |
460 | .ndo_change_mtu = ace_change_mtu, | 461 | .ndo_change_mtu = ace_change_mtu, |
462 | #if ACENIC_DO_VLAN | ||
461 | .ndo_vlan_rx_register = ace_vlan_rx_register, | 463 | .ndo_vlan_rx_register = ace_vlan_rx_register, |
464 | #endif | ||
462 | }; | 465 | }; |
463 | 466 | ||
464 | static int __devinit acenic_probe_one(struct pci_dev *pdev, | 467 | static int __devinit acenic_probe_one(struct pci_dev *pdev, |
@@ -489,7 +492,6 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev, | |||
489 | dev->watchdog_timeo = 5*HZ; | 492 | dev->watchdog_timeo = 5*HZ; |
490 | 493 | ||
491 | dev->netdev_ops = &ace_netdev_ops; | 494 | dev->netdev_ops = &ace_netdev_ops; |
492 | dev->hard_start_xmit = &ace_start_xmit; | ||
493 | SET_ETHTOOL_OPS(dev, &ace_ethtool_ops); | 495 | SET_ETHTOOL_OPS(dev, &ace_ethtool_ops); |
494 | 496 | ||
495 | /* we only display this string ONCE */ | 497 | /* we only display this string ONCE */ |
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c index a815fffc2a5b..98b2a7a466b8 100644 --- a/drivers/net/atl1e/atl1e_main.c +++ b/drivers/net/atl1e/atl1e_main.c | |||
@@ -2256,6 +2256,7 @@ static void atl1e_shutdown(struct pci_dev *pdev) | |||
2256 | static const struct net_device_ops atl1e_netdev_ops = { | 2256 | static const struct net_device_ops atl1e_netdev_ops = { |
2257 | .ndo_open = atl1e_open, | 2257 | .ndo_open = atl1e_open, |
2258 | .ndo_stop = atl1e_close, | 2258 | .ndo_stop = atl1e_close, |
2259 | .ndo_start_xmit = atl1e_xmit_frame, | ||
2259 | .ndo_get_stats = atl1e_get_stats, | 2260 | .ndo_get_stats = atl1e_get_stats, |
2260 | .ndo_set_multicast_list = atl1e_set_multi, | 2261 | .ndo_set_multicast_list = atl1e_set_multi, |
2261 | .ndo_validate_addr = eth_validate_addr, | 2262 | .ndo_validate_addr = eth_validate_addr, |
@@ -2277,7 +2278,7 @@ static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) | |||
2277 | 2278 | ||
2278 | netdev->irq = pdev->irq; | 2279 | netdev->irq = pdev->irq; |
2279 | netdev->netdev_ops = &atl1e_netdev_ops; | 2280 | netdev->netdev_ops = &atl1e_netdev_ops; |
2280 | netdev->hard_start_xmit = atl1e_xmit_frame, | 2281 | |
2281 | netdev->watchdog_timeo = AT_TX_WATCHDOG; | 2282 | netdev->watchdog_timeo = AT_TX_WATCHDOG; |
2282 | atl1e_set_ethtool_ops(netdev); | 2283 | atl1e_set_ethtool_ops(netdev); |
2283 | 2284 | ||
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 7a0fb04e3480..aef7e47fdd24 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2883,12 +2883,13 @@ static void atl1_poll_controller(struct net_device *netdev) | |||
2883 | static const struct net_device_ops atl1_netdev_ops = { | 2883 | static const struct net_device_ops atl1_netdev_ops = { |
2884 | .ndo_open = atl1_open, | 2884 | .ndo_open = atl1_open, |
2885 | .ndo_stop = atl1_close, | 2885 | .ndo_stop = atl1_close, |
2886 | .ndo_start_xmit = atl1_xmit_frame, | ||
2886 | .ndo_set_multicast_list = atlx_set_multi, | 2887 | .ndo_set_multicast_list = atlx_set_multi, |
2887 | .ndo_validate_addr = eth_validate_addr, | 2888 | .ndo_validate_addr = eth_validate_addr, |
2888 | .ndo_set_mac_address = atl1_set_mac, | 2889 | .ndo_set_mac_address = atl1_set_mac, |
2889 | .ndo_change_mtu = atl1_change_mtu, | 2890 | .ndo_change_mtu = atl1_change_mtu, |
2890 | .ndo_do_ioctl = atlx_ioctl, | 2891 | .ndo_do_ioctl = atlx_ioctl, |
2891 | .ndo_tx_timeout = atlx_tx_timeout, | 2892 | .ndo_tx_timeout = atlx_tx_timeout, |
2892 | .ndo_vlan_rx_register = atlx_vlan_rx_register, | 2893 | .ndo_vlan_rx_register = atlx_vlan_rx_register, |
2893 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2894 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2894 | .ndo_poll_controller = atl1_poll_controller, | 2895 | .ndo_poll_controller = atl1_poll_controller, |
@@ -2983,7 +2984,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
2983 | adapter->mii.reg_num_mask = 0x1f; | 2984 | adapter->mii.reg_num_mask = 0x1f; |
2984 | 2985 | ||
2985 | netdev->netdev_ops = &atl1_netdev_ops; | 2986 | netdev->netdev_ops = &atl1_netdev_ops; |
2986 | netdev->hard_start_xmit = &atl1_xmit_frame; | ||
2987 | netdev->watchdog_timeo = 5 * HZ; | 2987 | netdev->watchdog_timeo = 5 * HZ; |
2988 | 2988 | ||
2989 | netdev->ethtool_ops = &atl1_ethtool_ops; | 2989 | netdev->ethtool_ops = &atl1_ethtool_ops; |
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index b8d585722e1a..0326a84503e3 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -1315,6 +1315,7 @@ static void atl2_poll_controller(struct net_device *netdev) | |||
1315 | static const struct net_device_ops atl2_netdev_ops = { | 1315 | static const struct net_device_ops atl2_netdev_ops = { |
1316 | .ndo_open = atl2_open, | 1316 | .ndo_open = atl2_open, |
1317 | .ndo_stop = atl2_close, | 1317 | .ndo_stop = atl2_close, |
1318 | .ndo_start_xmit = atl2_xmit_frame, | ||
1318 | .ndo_set_multicast_list = atl2_set_multi, | 1319 | .ndo_set_multicast_list = atl2_set_multi, |
1319 | .ndo_validate_addr = eth_validate_addr, | 1320 | .ndo_validate_addr = eth_validate_addr, |
1320 | .ndo_set_mac_address = atl2_set_mac, | 1321 | .ndo_set_mac_address = atl2_set_mac, |
@@ -1400,7 +1401,6 @@ static int __devinit atl2_probe(struct pci_dev *pdev, | |||
1400 | 1401 | ||
1401 | atl2_setup_pcicmd(pdev); | 1402 | atl2_setup_pcicmd(pdev); |
1402 | 1403 | ||
1403 | netdev->hard_start_xmit = &atl2_xmit_frame; | ||
1404 | netdev->netdev_ops = &atl2_netdev_ops; | 1404 | netdev->netdev_ops = &atl2_netdev_ops; |
1405 | atl2_set_ethtool_ops(netdev); | 1405 | atl2_set_ethtool_ops(netdev); |
1406 | netdev->watchdog_timeo = 5 * HZ; | 1406 | netdev->watchdog_timeo = 5 * HZ; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 614656c8187b..a339a8052737 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1377,14 +1377,12 @@ done: | |||
1377 | return 0; | 1377 | return 0; |
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | |||
1381 | static void bond_setup_by_slave(struct net_device *bond_dev, | 1380 | static void bond_setup_by_slave(struct net_device *bond_dev, |
1382 | struct net_device *slave_dev) | 1381 | struct net_device *slave_dev) |
1383 | { | 1382 | { |
1384 | struct bonding *bond = netdev_priv(bond_dev); | 1383 | struct bonding *bond = netdev_priv(bond_dev); |
1385 | 1384 | ||
1386 | bond_dev->neigh_setup = slave_dev->neigh_setup; | 1385 | bond_dev->header_ops = slave_dev->header_ops; |
1387 | bond_dev->header_ops = slave_dev->header_ops; | ||
1388 | 1386 | ||
1389 | bond_dev->type = slave_dev->type; | 1387 | bond_dev->type = slave_dev->type; |
1390 | bond_dev->hard_header_len = slave_dev->hard_header_len; | 1388 | bond_dev->hard_header_len = slave_dev->hard_header_len; |
@@ -4124,6 +4122,20 @@ static void bond_set_multicast_list(struct net_device *bond_dev) | |||
4124 | read_unlock(&bond->lock); | 4122 | read_unlock(&bond->lock); |
4125 | } | 4123 | } |
4126 | 4124 | ||
4125 | static int bond_neigh_setup(struct net_device *dev, struct neigh_parms *parms) | ||
4126 | { | ||
4127 | struct bonding *bond = netdev_priv(dev); | ||
4128 | struct slave *slave = bond->first_slave; | ||
4129 | |||
4130 | if (slave) { | ||
4131 | const struct net_device_ops *slave_ops | ||
4132 | = slave->dev->netdev_ops; | ||
4133 | if (slave_ops->ndo_neigh_setup) | ||
4134 | return slave_ops->ndo_neigh_setup(dev, parms); | ||
4135 | } | ||
4136 | return 0; | ||
4137 | } | ||
4138 | |||
4127 | /* | 4139 | /* |
4128 | * Change the MTU of all of a master's slaves to match the master | 4140 | * Change the MTU of all of a master's slaves to match the master |
4129 | */ | 4141 | */ |
@@ -4490,6 +4502,35 @@ static void bond_set_xmit_hash_policy(struct bonding *bond) | |||
4490 | } | 4502 | } |
4491 | } | 4503 | } |
4492 | 4504 | ||
4505 | static int bond_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
4506 | { | ||
4507 | const struct bonding *bond = netdev_priv(dev); | ||
4508 | |||
4509 | switch (bond->params.mode) { | ||
4510 | case BOND_MODE_ROUNDROBIN: | ||
4511 | return bond_xmit_roundrobin(skb, dev); | ||
4512 | case BOND_MODE_ACTIVEBACKUP: | ||
4513 | return bond_xmit_activebackup(skb, dev); | ||
4514 | case BOND_MODE_XOR: | ||
4515 | return bond_xmit_xor(skb, dev); | ||
4516 | case BOND_MODE_BROADCAST: | ||
4517 | return bond_xmit_broadcast(skb, dev); | ||
4518 | case BOND_MODE_8023AD: | ||
4519 | return bond_3ad_xmit_xor(skb, dev); | ||
4520 | case BOND_MODE_ALB: | ||
4521 | case BOND_MODE_TLB: | ||
4522 | return bond_alb_xmit(skb, dev); | ||
4523 | default: | ||
4524 | /* Should never happen, mode already checked */ | ||
4525 | printk(KERN_ERR DRV_NAME ": %s: Error: Unknown bonding mode %d\n", | ||
4526 | dev->name, bond->params.mode); | ||
4527 | WARN_ON_ONCE(1); | ||
4528 | dev_kfree_skb(skb); | ||
4529 | return NETDEV_TX_OK; | ||
4530 | } | ||
4531 | } | ||
4532 | |||
4533 | |||
4493 | /* | 4534 | /* |
4494 | * set bond mode specific net device operations | 4535 | * set bond mode specific net device operations |
4495 | */ | 4536 | */ |
@@ -4499,28 +4540,22 @@ void bond_set_mode_ops(struct bonding *bond, int mode) | |||
4499 | 4540 | ||
4500 | switch (mode) { | 4541 | switch (mode) { |
4501 | case BOND_MODE_ROUNDROBIN: | 4542 | case BOND_MODE_ROUNDROBIN: |
4502 | bond_dev->hard_start_xmit = bond_xmit_roundrobin; | ||
4503 | break; | 4543 | break; |
4504 | case BOND_MODE_ACTIVEBACKUP: | 4544 | case BOND_MODE_ACTIVEBACKUP: |
4505 | bond_dev->hard_start_xmit = bond_xmit_activebackup; | ||
4506 | break; | 4545 | break; |
4507 | case BOND_MODE_XOR: | 4546 | case BOND_MODE_XOR: |
4508 | bond_dev->hard_start_xmit = bond_xmit_xor; | ||
4509 | bond_set_xmit_hash_policy(bond); | 4547 | bond_set_xmit_hash_policy(bond); |
4510 | break; | 4548 | break; |
4511 | case BOND_MODE_BROADCAST: | 4549 | case BOND_MODE_BROADCAST: |
4512 | bond_dev->hard_start_xmit = bond_xmit_broadcast; | ||
4513 | break; | 4550 | break; |
4514 | case BOND_MODE_8023AD: | 4551 | case BOND_MODE_8023AD: |
4515 | bond_set_master_3ad_flags(bond); | 4552 | bond_set_master_3ad_flags(bond); |
4516 | bond_dev->hard_start_xmit = bond_3ad_xmit_xor; | ||
4517 | bond_set_xmit_hash_policy(bond); | 4553 | bond_set_xmit_hash_policy(bond); |
4518 | break; | 4554 | break; |
4519 | case BOND_MODE_ALB: | 4555 | case BOND_MODE_ALB: |
4520 | bond_set_master_alb_flags(bond); | 4556 | bond_set_master_alb_flags(bond); |
4521 | /* FALLTHRU */ | 4557 | /* FALLTHRU */ |
4522 | case BOND_MODE_TLB: | 4558 | case BOND_MODE_TLB: |
4523 | bond_dev->hard_start_xmit = bond_alb_xmit; | ||
4524 | break; | 4559 | break; |
4525 | default: | 4560 | default: |
4526 | /* Should never happen, mode already checked */ | 4561 | /* Should never happen, mode already checked */ |
@@ -4553,12 +4588,13 @@ static const struct ethtool_ops bond_ethtool_ops = { | |||
4553 | static const struct net_device_ops bond_netdev_ops = { | 4588 | static const struct net_device_ops bond_netdev_ops = { |
4554 | .ndo_open = bond_open, | 4589 | .ndo_open = bond_open, |
4555 | .ndo_stop = bond_close, | 4590 | .ndo_stop = bond_close, |
4591 | .ndo_start_xmit = bond_start_xmit, | ||
4556 | .ndo_get_stats = bond_get_stats, | 4592 | .ndo_get_stats = bond_get_stats, |
4557 | .ndo_do_ioctl = bond_do_ioctl, | 4593 | .ndo_do_ioctl = bond_do_ioctl, |
4558 | .ndo_set_multicast_list = bond_set_multicast_list, | 4594 | .ndo_set_multicast_list = bond_set_multicast_list, |
4559 | .ndo_change_mtu = bond_change_mtu, | 4595 | .ndo_change_mtu = bond_change_mtu, |
4560 | .ndo_validate_addr = NULL, | ||
4561 | .ndo_set_mac_address = bond_set_mac_address, | 4596 | .ndo_set_mac_address = bond_set_mac_address, |
4597 | .ndo_neigh_setup = bond_neigh_setup, | ||
4562 | .ndo_vlan_rx_register = bond_vlan_rx_register, | 4598 | .ndo_vlan_rx_register = bond_vlan_rx_register, |
4563 | .ndo_vlan_rx_add_vid = bond_vlan_rx_add_vid, | 4599 | .ndo_vlan_rx_add_vid = bond_vlan_rx_add_vid, |
4564 | .ndo_vlan_rx_kill_vid = bond_vlan_rx_kill_vid, | 4600 | .ndo_vlan_rx_kill_vid = bond_vlan_rx_kill_vid, |
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 482741797ebf..9b6011e7678e 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -915,7 +915,7 @@ static int t1_set_mac_addr(struct net_device *dev, void *p) | |||
915 | } | 915 | } |
916 | 916 | ||
917 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 917 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
918 | static void vlan_rx_register(struct net_device *dev, | 918 | static void t1_vlan_rx_register(struct net_device *dev, |
919 | struct vlan_group *grp) | 919 | struct vlan_group *grp) |
920 | { | 920 | { |
921 | struct adapter *adapter = dev->ml_priv; | 921 | struct adapter *adapter = dev->ml_priv; |
@@ -1013,6 +1013,7 @@ void t1_fatal_err(struct adapter *adapter) | |||
1013 | static const struct net_device_ops cxgb_netdev_ops = { | 1013 | static const struct net_device_ops cxgb_netdev_ops = { |
1014 | .ndo_open = cxgb_open, | 1014 | .ndo_open = cxgb_open, |
1015 | .ndo_stop = cxgb_close, | 1015 | .ndo_stop = cxgb_close, |
1016 | .ndo_start_xmit = t1_start_xmit, | ||
1016 | .ndo_get_stats = t1_get_stats, | 1017 | .ndo_get_stats = t1_get_stats, |
1017 | .ndo_validate_addr = eth_validate_addr, | 1018 | .ndo_validate_addr = eth_validate_addr, |
1018 | .ndo_set_multicast_list = t1_set_rxmode, | 1019 | .ndo_set_multicast_list = t1_set_rxmode, |
@@ -1020,7 +1021,7 @@ static const struct net_device_ops cxgb_netdev_ops = { | |||
1020 | .ndo_change_mtu = t1_change_mtu, | 1021 | .ndo_change_mtu = t1_change_mtu, |
1021 | .ndo_set_mac_address = t1_set_mac_addr, | 1022 | .ndo_set_mac_address = t1_set_mac_addr, |
1022 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 1023 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
1023 | .ndo_vlan_rx_register = vlan_rx_register, | 1024 | .ndo_vlan_rx_register = t1_vlan_rx_register, |
1024 | #endif | 1025 | #endif |
1025 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1026 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1026 | .ndo_poll_controller = t1_netpoll, | 1027 | .ndo_poll_controller = t1_netpoll, |
@@ -1157,7 +1158,6 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1157 | } | 1158 | } |
1158 | 1159 | ||
1159 | netdev->netdev_ops = &cxgb_netdev_ops; | 1160 | netdev->netdev_ops = &cxgb_netdev_ops; |
1160 | netdev->hard_start_xmit = t1_start_xmit; | ||
1161 | netdev->hard_header_len += (adapter->flags & TSO_CAPABLE) ? | 1161 | netdev->hard_header_len += (adapter->flags & TSO_CAPABLE) ? |
1162 | sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt); | 1162 | sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt); |
1163 | 1163 | ||
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index a9479be53ec3..cd9fcaca70f3 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -2955,7 +2955,6 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
2955 | 2955 | ||
2956 | netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 2956 | netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
2957 | netdev->netdev_ops = &cxgb_netdev_ops; | 2957 | netdev->netdev_ops = &cxgb_netdev_ops; |
2958 | netdev->hard_start_xmit = t3_eth_xmit; | ||
2959 | SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops); | 2958 | SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops); |
2960 | } | 2959 | } |
2961 | 2960 | ||
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 5894716de19f..2001a63794f5 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2615,6 +2615,7 @@ static int e100_close(struct net_device *netdev) | |||
2615 | static const struct net_device_ops e100_netdev_ops = { | 2615 | static const struct net_device_ops e100_netdev_ops = { |
2616 | .ndo_open = e100_open, | 2616 | .ndo_open = e100_open, |
2617 | .ndo_stop = e100_close, | 2617 | .ndo_stop = e100_close, |
2618 | .ndo_start_xmit = e100_xmit_frame, | ||
2618 | .ndo_validate_addr = eth_validate_addr, | 2619 | .ndo_validate_addr = eth_validate_addr, |
2619 | .ndo_set_multicast_list = e100_set_multicast_list, | 2620 | .ndo_set_multicast_list = e100_set_multicast_list, |
2620 | .ndo_set_mac_address = e100_set_mac_address, | 2621 | .ndo_set_mac_address = e100_set_mac_address, |
@@ -2640,7 +2641,6 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2640 | } | 2641 | } |
2641 | 2642 | ||
2642 | netdev->netdev_ops = &e100_netdev_ops; | 2643 | netdev->netdev_ops = &e100_netdev_ops; |
2643 | netdev->hard_start_xmit = e100_xmit_frame; | ||
2644 | SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops); | 2644 | SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops); |
2645 | netdev->watchdog_timeo = E100_WATCHDOG_PERIOD; | 2645 | netdev->watchdog_timeo = E100_WATCHDOG_PERIOD; |
2646 | strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); | 2646 | strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index debbba390d40..5c098c9d584e 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -891,6 +891,7 @@ static int e1000_is_need_ioport(struct pci_dev *pdev) | |||
891 | static const struct net_device_ops e1000_netdev_ops = { | 891 | static const struct net_device_ops e1000_netdev_ops = { |
892 | .ndo_open = e1000_open, | 892 | .ndo_open = e1000_open, |
893 | .ndo_stop = e1000_close, | 893 | .ndo_stop = e1000_close, |
894 | .ndo_start_xmit = e1000_xmit_frame, | ||
894 | .ndo_get_stats = e1000_get_stats, | 895 | .ndo_get_stats = e1000_get_stats, |
895 | .ndo_set_rx_mode = e1000_set_rx_mode, | 896 | .ndo_set_rx_mode = e1000_set_rx_mode, |
896 | .ndo_set_mac_address = e1000_set_mac, | 897 | .ndo_set_mac_address = e1000_set_mac, |
@@ -1001,7 +1002,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
1001 | } | 1002 | } |
1002 | 1003 | ||
1003 | netdev->netdev_ops = &e1000_netdev_ops; | 1004 | netdev->netdev_ops = &e1000_netdev_ops; |
1004 | netdev->hard_start_xmit = &e1000_xmit_frame; | ||
1005 | e1000_set_ethtool_ops(netdev); | 1005 | e1000_set_ethtool_ops(netdev); |
1006 | netdev->watchdog_timeo = 5 * HZ; | 1006 | netdev->watchdog_timeo = 5 * HZ; |
1007 | netif_napi_add(netdev, &adapter->napi, e1000_clean, 64); | 1007 | netif_napi_add(netdev, &adapter->napi, e1000_clean, 64); |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index ced839e4cae8..cc0502bbb9ff 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -4707,6 +4707,7 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter) | |||
4707 | static const struct net_device_ops e1000e_netdev_ops = { | 4707 | static const struct net_device_ops e1000e_netdev_ops = { |
4708 | .ndo_open = e1000_open, | 4708 | .ndo_open = e1000_open, |
4709 | .ndo_stop = e1000_close, | 4709 | .ndo_stop = e1000_close, |
4710 | .ndo_start_xmit = e1000_xmit_frame, | ||
4710 | .ndo_get_stats = e1000_get_stats, | 4711 | .ndo_get_stats = e1000_get_stats, |
4711 | .ndo_set_multicast_list = e1000_set_multi, | 4712 | .ndo_set_multicast_list = e1000_set_multi, |
4712 | .ndo_set_mac_address = e1000_set_mac, | 4713 | .ndo_set_mac_address = e1000_set_mac, |
@@ -4822,7 +4823,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4822 | 4823 | ||
4823 | /* construct the net_device struct */ | 4824 | /* construct the net_device struct */ |
4824 | netdev->netdev_ops = &e1000e_netdev_ops; | 4825 | netdev->netdev_ops = &e1000e_netdev_ops; |
4825 | netdev->hard_start_xmit = &e1000_xmit_frame; | ||
4826 | e1000e_set_ethtool_ops(netdev); | 4826 | e1000e_set_ethtool_ops(netdev); |
4827 | netdev->watchdog_timeo = 5 * HZ; | 4827 | netdev->watchdog_timeo = 5 * HZ; |
4828 | netif_napi_add(netdev, &adapter->napi, e1000_clean, 64); | 4828 | netif_napi_add(netdev, &adapter->napi, e1000_clean, 64); |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 40f8c88b166d..1c409df735d4 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1593,6 +1593,7 @@ static void enic_iounmap(struct enic *enic) | |||
1593 | static const struct net_device_ops enic_netdev_ops = { | 1593 | static const struct net_device_ops enic_netdev_ops = { |
1594 | .ndo_open = enic_open, | 1594 | .ndo_open = enic_open, |
1595 | .ndo_stop = enic_stop, | 1595 | .ndo_stop = enic_stop, |
1596 | .ndo_start_xmit = enic_hard_start_xmit, | ||
1596 | .ndo_get_stats = enic_get_stats, | 1597 | .ndo_get_stats = enic_get_stats, |
1597 | .ndo_validate_addr = eth_validate_addr, | 1598 | .ndo_validate_addr = eth_validate_addr, |
1598 | .ndo_set_multicast_list = enic_set_multicast_list, | 1599 | .ndo_set_multicast_list = enic_set_multicast_list, |
@@ -1830,7 +1831,6 @@ static int __devinit enic_probe(struct pci_dev *pdev, | |||
1830 | } | 1831 | } |
1831 | 1832 | ||
1832 | netdev->netdev_ops = &enic_netdev_ops; | 1833 | netdev->netdev_ops = &enic_netdev_ops; |
1833 | netdev->hard_start_xmit = enic_hard_start_xmit; | ||
1834 | netdev->watchdog_timeo = 2 * HZ; | 1834 | netdev->watchdog_timeo = 2 * HZ; |
1835 | netdev->ethtool_ops = &enic_ethtool_ops; | 1835 | netdev->ethtool_ops = &enic_ethtool_ops; |
1836 | 1836 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index dd2e1f670b0d..0d7e5750245a 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5412,6 +5412,23 @@ static const struct net_device_ops nv_netdev_ops = { | |||
5412 | .ndo_open = nv_open, | 5412 | .ndo_open = nv_open, |
5413 | .ndo_stop = nv_close, | 5413 | .ndo_stop = nv_close, |
5414 | .ndo_get_stats = nv_get_stats, | 5414 | .ndo_get_stats = nv_get_stats, |
5415 | .ndo_start_xmit = nv_start_xmit, | ||
5416 | .ndo_tx_timeout = nv_tx_timeout, | ||
5417 | .ndo_change_mtu = nv_change_mtu, | ||
5418 | .ndo_validate_addr = eth_validate_addr, | ||
5419 | .ndo_set_mac_address = nv_set_mac_address, | ||
5420 | .ndo_set_multicast_list = nv_set_multicast, | ||
5421 | .ndo_vlan_rx_register = nv_vlan_rx_register, | ||
5422 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5423 | .ndo_poll_controller = nv_poll_controller, | ||
5424 | #endif | ||
5425 | }; | ||
5426 | |||
5427 | static const struct net_device_ops nv_netdev_ops_optimized = { | ||
5428 | .ndo_open = nv_open, | ||
5429 | .ndo_stop = nv_close, | ||
5430 | .ndo_get_stats = nv_get_stats, | ||
5431 | .ndo_start_xmit = nv_start_xmit_optimized, | ||
5415 | .ndo_tx_timeout = nv_tx_timeout, | 5432 | .ndo_tx_timeout = nv_tx_timeout, |
5416 | .ndo_change_mtu = nv_change_mtu, | 5433 | .ndo_change_mtu = nv_change_mtu, |
5417 | .ndo_validate_addr = eth_validate_addr, | 5434 | .ndo_validate_addr = eth_validate_addr, |
@@ -5592,11 +5609,10 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5592 | goto out_freering; | 5609 | goto out_freering; |
5593 | 5610 | ||
5594 | if (!nv_optimized(np)) | 5611 | if (!nv_optimized(np)) |
5595 | dev->hard_start_xmit = nv_start_xmit; | 5612 | dev->netdev_ops = &nv_netdev_ops; |
5596 | else | 5613 | else |
5597 | dev->hard_start_xmit = nv_start_xmit_optimized; | 5614 | dev->netdev_ops = &nv_netdev_ops_optimized; |
5598 | 5615 | ||
5599 | dev->netdev_ops = &nv_netdev_ops; | ||
5600 | #ifdef CONFIG_FORCEDETH_NAPI | 5616 | #ifdef CONFIG_FORCEDETH_NAPI |
5601 | netif_napi_add(dev, &np->napi, nv_napi_poll, RX_WORK_PER_LOOP); | 5617 | netif_napi_add(dev, &np->napi, nv_napi_poll, RX_WORK_PER_LOOP); |
5602 | #endif | 5618 | #endif |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 363a166df8fb..60a263001933 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -138,15 +138,15 @@ resched: | |||
138 | } | 138 | } |
139 | 139 | ||
140 | static const struct net_device_ops ifb_netdev_ops = { | 140 | static const struct net_device_ops ifb_netdev_ops = { |
141 | .ndo_validate_addr = eth_validate_addr, | ||
142 | .ndo_open = ifb_open, | 141 | .ndo_open = ifb_open, |
143 | .ndo_stop = ifb_close, | 142 | .ndo_stop = ifb_close, |
143 | .ndo_start_xmit = ifb_xmit, | ||
144 | .ndo_validate_addr = eth_validate_addr, | ||
144 | }; | 145 | }; |
145 | 146 | ||
146 | static void ifb_setup(struct net_device *dev) | 147 | static void ifb_setup(struct net_device *dev) |
147 | { | 148 | { |
148 | /* Initialize the device structure. */ | 149 | /* Initialize the device structure. */ |
149 | dev->hard_start_xmit = ifb_xmit; | ||
150 | dev->destructor = free_netdev; | 150 | dev->destructor = free_netdev; |
151 | dev->netdev_ops = &ifb_netdev_ops; | 151 | dev->netdev_ops = &ifb_netdev_ops; |
152 | 152 | ||
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ceb0a0458796..eca5684d5655 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -953,6 +953,7 @@ static int igb_is_need_ioport(struct pci_dev *pdev) | |||
953 | static const struct net_device_ops igb_netdev_ops = { | 953 | static const struct net_device_ops igb_netdev_ops = { |
954 | .ndo_open = igb_open, | 954 | .ndo_open = igb_open, |
955 | .ndo_stop = igb_close, | 955 | .ndo_stop = igb_close, |
956 | .ndo_start_xmit = igb_xmit_frame_adv, | ||
956 | .ndo_get_stats = igb_get_stats, | 957 | .ndo_get_stats = igb_get_stats, |
957 | .ndo_set_multicast_list = igb_set_multi, | 958 | .ndo_set_multicast_list = igb_set_multi, |
958 | .ndo_set_mac_address = igb_set_mac, | 959 | .ndo_set_mac_address = igb_set_mac, |
@@ -1080,7 +1081,6 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1080 | netdev->netdev_ops = &igb_netdev_ops; | 1081 | netdev->netdev_ops = &igb_netdev_ops; |
1081 | igb_set_ethtool_ops(netdev); | 1082 | igb_set_ethtool_ops(netdev); |
1082 | netdev->watchdog_timeo = 5 * HZ; | 1083 | netdev->watchdog_timeo = 5 * HZ; |
1083 | netdev->hard_start_xmit = &igb_xmit_frame_adv; | ||
1084 | 1084 | ||
1085 | strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); | 1085 | strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); |
1086 | 1086 | ||
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 3ca9daa70b38..a04e3892ddf4 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -324,6 +324,7 @@ ixgb_reset(struct ixgb_adapter *adapter) | |||
324 | static const struct net_device_ops ixgb_netdev_ops = { | 324 | static const struct net_device_ops ixgb_netdev_ops = { |
325 | .ndo_open = ixgb_open, | 325 | .ndo_open = ixgb_open, |
326 | .ndo_stop = ixgb_close, | 326 | .ndo_stop = ixgb_close, |
327 | .ndo_start_xmit = ixgb_xmit_frame, | ||
327 | .ndo_get_stats = ixgb_get_stats, | 328 | .ndo_get_stats = ixgb_get_stats, |
328 | .ndo_set_multicast_list = ixgb_set_multi, | 329 | .ndo_set_multicast_list = ixgb_set_multi, |
329 | .ndo_validate_addr = eth_validate_addr, | 330 | .ndo_validate_addr = eth_validate_addr, |
@@ -414,7 +415,6 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
414 | } | 415 | } |
415 | 416 | ||
416 | netdev->netdev_ops = &ixgb_netdev_ops; | 417 | netdev->netdev_ops = &ixgb_netdev_ops; |
417 | netdev->hard_start_xmit = &ixgb_xmit_frame; | ||
418 | ixgb_set_ethtool_ops(netdev); | 418 | ixgb_set_ethtool_ops(netdev); |
419 | netdev->watchdog_timeo = 5 * HZ; | 419 | netdev->watchdog_timeo = 5 * HZ; |
420 | netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64); | 420 | netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7ad07a00680a..40108523377f 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3728,6 +3728,7 @@ static int ixgbe_link_config(struct ixgbe_hw *hw) | |||
3728 | static const struct net_device_ops ixgbe_netdev_ops = { | 3728 | static const struct net_device_ops ixgbe_netdev_ops = { |
3729 | .ndo_open = ixgbe_open, | 3729 | .ndo_open = ixgbe_open, |
3730 | .ndo_stop = ixgbe_close, | 3730 | .ndo_stop = ixgbe_close, |
3731 | .ndo_start_xmit = ixgbe_xmit_frame, | ||
3731 | .ndo_get_stats = ixgbe_get_stats, | 3732 | .ndo_get_stats = ixgbe_get_stats, |
3732 | .ndo_set_multicast_list = ixgbe_set_rx_mode, | 3733 | .ndo_set_multicast_list = ixgbe_set_rx_mode, |
3733 | .ndo_validate_addr = eth_validate_addr, | 3734 | .ndo_validate_addr = eth_validate_addr, |
@@ -3824,7 +3825,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
3824 | } | 3825 | } |
3825 | 3826 | ||
3826 | netdev->netdev_ops = &ixgbe_netdev_ops; | 3827 | netdev->netdev_ops = &ixgbe_netdev_ops; |
3827 | netdev->hard_start_xmit = &ixgbe_xmit_frame; | ||
3828 | ixgbe_set_ethtool_ops(netdev); | 3828 | ixgbe_set_ethtool_ops(netdev); |
3829 | netdev->watchdog_timeo = 5 * HZ; | 3829 | netdev->watchdog_timeo = 5 * HZ; |
3830 | strcpy(netdev->name, pci_name(pdev)); | 3830 | strcpy(netdev->name, pci_name(pdev)); |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 958450124dec..b7d438a367f3 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -145,6 +145,7 @@ static void loopback_dev_free(struct net_device *dev) | |||
145 | 145 | ||
146 | static const struct net_device_ops loopback_ops = { | 146 | static const struct net_device_ops loopback_ops = { |
147 | .ndo_init = loopback_dev_init, | 147 | .ndo_init = loopback_dev_init, |
148 | .ndo_start_xmit= loopback_xmit, | ||
148 | .ndo_get_stats = loopback_get_stats, | 149 | .ndo_get_stats = loopback_get_stats, |
149 | }; | 150 | }; |
150 | 151 | ||
@@ -155,7 +156,6 @@ static const struct net_device_ops loopback_ops = { | |||
155 | static void loopback_setup(struct net_device *dev) | 156 | static void loopback_setup(struct net_device *dev) |
156 | { | 157 | { |
157 | dev->mtu = (16 * 1024) + 20 + 20 + 12; | 158 | dev->mtu = (16 * 1024) + 20 + 20 + 12; |
158 | dev->hard_start_xmit = loopback_xmit; | ||
159 | dev->hard_header_len = ETH_HLEN; /* 14 */ | 159 | dev->hard_header_len = ETH_HLEN; /* 14 */ |
160 | dev->addr_len = ETH_ALEN; /* 6 */ | 160 | dev->addr_len = ETH_ALEN; /* 6 */ |
161 | dev->tx_queue_len = 0; | 161 | dev->tx_queue_len = 0; |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d00ea444e0a3..e8879217a1d2 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -140,7 +140,7 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb) | |||
140 | return NULL; | 140 | return NULL; |
141 | } | 141 | } |
142 | 142 | ||
143 | static int macvlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | 143 | static int macvlan_start_xmit(struct sk_buff *skb, struct net_device *dev) |
144 | { | 144 | { |
145 | const struct macvlan_dev *vlan = netdev_priv(dev); | 145 | const struct macvlan_dev *vlan = netdev_priv(dev); |
146 | unsigned int len = skb->len; | 146 | unsigned int len = skb->len; |
@@ -365,6 +365,7 @@ static const struct net_device_ops macvlan_netdev_ops = { | |||
365 | .ndo_init = macvlan_init, | 365 | .ndo_init = macvlan_init, |
366 | .ndo_open = macvlan_open, | 366 | .ndo_open = macvlan_open, |
367 | .ndo_stop = macvlan_stop, | 367 | .ndo_stop = macvlan_stop, |
368 | .ndo_start_xmit = macvlan_start_xmit, | ||
368 | .ndo_change_mtu = macvlan_change_mtu, | 369 | .ndo_change_mtu = macvlan_change_mtu, |
369 | .ndo_change_rx_flags = macvlan_change_rx_flags, | 370 | .ndo_change_rx_flags = macvlan_change_rx_flags, |
370 | .ndo_set_mac_address = macvlan_set_mac_address, | 371 | .ndo_set_mac_address = macvlan_set_mac_address, |
@@ -377,7 +378,6 @@ static void macvlan_setup(struct net_device *dev) | |||
377 | ether_setup(dev); | 378 | ether_setup(dev); |
378 | 379 | ||
379 | dev->netdev_ops = &macvlan_netdev_ops; | 380 | dev->netdev_ops = &macvlan_netdev_ops; |
380 | dev->hard_start_xmit = macvlan_hard_start_xmit; | ||
381 | dev->destructor = free_netdev; | 381 | dev->destructor = free_netdev; |
382 | dev->header_ops = &macvlan_hard_header_ops, | 382 | dev->header_ops = &macvlan_hard_header_ops, |
383 | dev->ethtool_ops = &macvlan_ethtool_ops; | 383 | dev->ethtool_ops = &macvlan_ethtool_ops; |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 318537efd583..a8d10630f804 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -8892,6 +8892,7 @@ static struct net_device * __devinit niu_alloc_and_init( | |||
8892 | static const struct net_device_ops niu_netdev_ops = { | 8892 | static const struct net_device_ops niu_netdev_ops = { |
8893 | .ndo_open = niu_open, | 8893 | .ndo_open = niu_open, |
8894 | .ndo_stop = niu_close, | 8894 | .ndo_stop = niu_close, |
8895 | .ndo_start_xmit = niu_start_xmit, | ||
8895 | .ndo_get_stats = niu_get_stats, | 8896 | .ndo_get_stats = niu_get_stats, |
8896 | .ndo_set_multicast_list = niu_set_rx_mode, | 8897 | .ndo_set_multicast_list = niu_set_rx_mode, |
8897 | .ndo_validate_addr = eth_validate_addr, | 8898 | .ndo_validate_addr = eth_validate_addr, |
@@ -8904,7 +8905,6 @@ static const struct net_device_ops niu_netdev_ops = { | |||
8904 | static void __devinit niu_assign_netdev_ops(struct net_device *dev) | 8905 | static void __devinit niu_assign_netdev_ops(struct net_device *dev) |
8905 | { | 8906 | { |
8906 | dev->netdev_ops = &niu_netdev_ops; | 8907 | dev->netdev_ops = &niu_netdev_ops; |
8907 | dev->hard_start_xmit = niu_start_xmit; | ||
8908 | dev->ethtool_ops = &niu_ethtool_ops; | 8908 | dev->ethtool_ops = &niu_ethtool_ops; |
8909 | dev->watchdog_timeo = NIU_TX_TIMEOUT; | 8909 | dev->watchdog_timeo = NIU_TX_TIMEOUT; |
8910 | } | 8910 | } |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index bad99e8cac33..1b15a088a3ba 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -972,7 +972,8 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
972 | } | 972 | } |
973 | 973 | ||
974 | static const struct net_device_ops ppp_netdev_ops = { | 974 | static const struct net_device_ops ppp_netdev_ops = { |
975 | .ndo_do_ioctl = ppp_net_ioctl, | 975 | .ndo_start_xmit = ppp_start_xmit, |
976 | .ndo_do_ioctl = ppp_net_ioctl, | ||
976 | }; | 977 | }; |
977 | 978 | ||
978 | static void ppp_setup(struct net_device *dev) | 979 | static void ppp_setup(struct net_device *dev) |
@@ -2437,8 +2438,6 @@ ppp_create_interface(int unit, int *retp) | |||
2437 | skb_queue_head_init(&ppp->mrq); | 2438 | skb_queue_head_init(&ppp->mrq); |
2438 | #endif /* CONFIG_PPP_MULTILINK */ | 2439 | #endif /* CONFIG_PPP_MULTILINK */ |
2439 | 2440 | ||
2440 | dev->hard_start_xmit = ppp_start_xmit; | ||
2441 | |||
2442 | ret = -EEXIST; | 2441 | ret = -EEXIST; |
2443 | mutex_lock(&all_ppp_mutex); | 2442 | mutex_lock(&all_ppp_mutex); |
2444 | if (unit < 0) | 2443 | if (unit < 0) |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index bac58ca628dd..dddf6aeff498 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1927,6 +1927,7 @@ static const struct net_device_ops rtl8169_netdev_ops = { | |||
1927 | .ndo_open = rtl8169_open, | 1927 | .ndo_open = rtl8169_open, |
1928 | .ndo_stop = rtl8169_close, | 1928 | .ndo_stop = rtl8169_close, |
1929 | .ndo_get_stats = rtl8169_get_stats, | 1929 | .ndo_get_stats = rtl8169_get_stats, |
1930 | .ndo_start_xmit = rtl8169_start_xmit, | ||
1930 | .ndo_tx_timeout = rtl8169_tx_timeout, | 1931 | .ndo_tx_timeout = rtl8169_tx_timeout, |
1931 | .ndo_validate_addr = eth_validate_addr, | 1932 | .ndo_validate_addr = eth_validate_addr, |
1932 | .ndo_change_mtu = rtl8169_change_mtu, | 1933 | .ndo_change_mtu = rtl8169_change_mtu, |
@@ -2125,7 +2126,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2125 | dev->dev_addr[i] = RTL_R8(MAC0 + i); | 2126 | dev->dev_addr[i] = RTL_R8(MAC0 + i); |
2126 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 2127 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
2127 | 2128 | ||
2128 | dev->hard_start_xmit = rtl8169_start_xmit; | ||
2129 | SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops); | 2129 | SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops); |
2130 | dev->watchdog_timeo = RTL8169_TX_TIMEOUT; | 2130 | dev->watchdog_timeo = RTL8169_TX_TIMEOUT; |
2131 | dev->irq = pdev->irq; | 2131 | dev->irq = pdev->irq; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 93c1b1d92962..f73ee7974003 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3805,6 +3805,7 @@ static __exit void skge_debug_cleanup(void) | |||
3805 | static const struct net_device_ops skge_netdev_ops = { | 3805 | static const struct net_device_ops skge_netdev_ops = { |
3806 | .ndo_open = skge_up, | 3806 | .ndo_open = skge_up, |
3807 | .ndo_stop = skge_down, | 3807 | .ndo_stop = skge_down, |
3808 | .ndo_start_xmit = skge_xmit_frame, | ||
3808 | .ndo_do_ioctl = skge_ioctl, | 3809 | .ndo_do_ioctl = skge_ioctl, |
3809 | .ndo_get_stats = skge_get_stats, | 3810 | .ndo_get_stats = skge_get_stats, |
3810 | .ndo_tx_timeout = skge_tx_timeout, | 3811 | .ndo_tx_timeout = skge_tx_timeout, |
@@ -3831,7 +3832,6 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3831 | } | 3832 | } |
3832 | 3833 | ||
3833 | SET_NETDEV_DEV(dev, &hw->pdev->dev); | 3834 | SET_NETDEV_DEV(dev, &hw->pdev->dev); |
3834 | dev->hard_start_xmit = skge_xmit_frame; | ||
3835 | dev->netdev_ops = &skge_netdev_ops; | 3835 | dev->netdev_ops = &skge_netdev_ops; |
3836 | dev->ethtool_ops = &skge_ethtool_ops; | 3836 | dev->ethtool_ops = &skge_ethtool_ops; |
3837 | dev->watchdog_timeo = TX_WATCHDOG; | 3837 | dev->watchdog_timeo = TX_WATCHDOG; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 251505125cb8..3668e81e474d 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -4047,6 +4047,7 @@ static const struct net_device_ops sky2_netdev_ops[2] = { | |||
4047 | { | 4047 | { |
4048 | .ndo_open = sky2_up, | 4048 | .ndo_open = sky2_up, |
4049 | .ndo_stop = sky2_down, | 4049 | .ndo_stop = sky2_down, |
4050 | .ndo_start_xmit = sky2_xmit_frame, | ||
4050 | .ndo_do_ioctl = sky2_ioctl, | 4051 | .ndo_do_ioctl = sky2_ioctl, |
4051 | .ndo_validate_addr = eth_validate_addr, | 4052 | .ndo_validate_addr = eth_validate_addr, |
4052 | .ndo_set_mac_address = sky2_set_mac_address, | 4053 | .ndo_set_mac_address = sky2_set_mac_address, |
@@ -4063,6 +4064,7 @@ static const struct net_device_ops sky2_netdev_ops[2] = { | |||
4063 | { | 4064 | { |
4064 | .ndo_open = sky2_up, | 4065 | .ndo_open = sky2_up, |
4065 | .ndo_stop = sky2_down, | 4066 | .ndo_stop = sky2_down, |
4067 | .ndo_start_xmit = sky2_xmit_frame, | ||
4066 | .ndo_do_ioctl = sky2_ioctl, | 4068 | .ndo_do_ioctl = sky2_ioctl, |
4067 | .ndo_validate_addr = eth_validate_addr, | 4069 | .ndo_validate_addr = eth_validate_addr, |
4068 | .ndo_set_mac_address = sky2_set_mac_address, | 4070 | .ndo_set_mac_address = sky2_set_mac_address, |
@@ -4090,7 +4092,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, | |||
4090 | 4092 | ||
4091 | SET_NETDEV_DEV(dev, &hw->pdev->dev); | 4093 | SET_NETDEV_DEV(dev, &hw->pdev->dev); |
4092 | dev->irq = hw->pdev->irq; | 4094 | dev->irq = hw->pdev->irq; |
4093 | dev->hard_start_xmit = sky2_xmit_frame; | ||
4094 | SET_ETHTOOL_OPS(dev, &sky2_ethtool_ops); | 4095 | SET_ETHTOOL_OPS(dev, &sky2_ethtool_ops); |
4095 | dev->watchdog_timeo = TX_WATCHDOG; | 4096 | dev->watchdog_timeo = TX_WATCHDOG; |
4096 | dev->netdev_ops = &sky2_netdev_ops[port]; | 4097 | dev->netdev_ops = &sky2_netdev_ops[port]; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 4b97cb601361..9ba18e1bc341 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -12614,19 +12614,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12614 | else | 12614 | else |
12615 | tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES; | 12615 | tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES; |
12616 | 12616 | ||
12617 | /* All chips before 5787 can get confused if TX buffers | ||
12618 | * straddle the 4GB address boundary in some cases. | ||
12619 | */ | ||
12620 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | ||
12621 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | ||
12622 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | ||
12623 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | ||
12624 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | ||
12625 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | ||
12626 | tp->dev->hard_start_xmit = tg3_start_xmit; | ||
12627 | else | ||
12628 | tp->dev->hard_start_xmit = tg3_start_xmit_dma_bug; | ||
12629 | |||
12630 | tp->rx_offset = 2; | 12617 | tp->rx_offset = 2; |
12631 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 && | 12618 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 && |
12632 | (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) | 12619 | (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) |
@@ -13346,6 +13333,26 @@ static void __devinit tg3_init_coal(struct tg3 *tp) | |||
13346 | static const struct net_device_ops tg3_netdev_ops = { | 13333 | static const struct net_device_ops tg3_netdev_ops = { |
13347 | .ndo_open = tg3_open, | 13334 | .ndo_open = tg3_open, |
13348 | .ndo_stop = tg3_close, | 13335 | .ndo_stop = tg3_close, |
13336 | .ndo_start_xmit = tg3_start_xmit, | ||
13337 | .ndo_get_stats = tg3_get_stats, | ||
13338 | .ndo_validate_addr = eth_validate_addr, | ||
13339 | .ndo_set_multicast_list = tg3_set_rx_mode, | ||
13340 | .ndo_set_mac_address = tg3_set_mac_addr, | ||
13341 | .ndo_do_ioctl = tg3_ioctl, | ||
13342 | .ndo_tx_timeout = tg3_tx_timeout, | ||
13343 | .ndo_change_mtu = tg3_change_mtu, | ||
13344 | #if TG3_VLAN_TAG_USED | ||
13345 | .ndo_vlan_rx_register = tg3_vlan_rx_register, | ||
13346 | #endif | ||
13347 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
13348 | .ndo_poll_controller = tg3_poll_controller, | ||
13349 | #endif | ||
13350 | }; | ||
13351 | |||
13352 | static const struct net_device_ops tg3_netdev_ops_dma_bug = { | ||
13353 | .ndo_open = tg3_open, | ||
13354 | .ndo_stop = tg3_close, | ||
13355 | .ndo_start_xmit = tg3_start_xmit_dma_bug, | ||
13349 | .ndo_get_stats = tg3_get_stats, | 13356 | .ndo_get_stats = tg3_get_stats, |
13350 | .ndo_validate_addr = eth_validate_addr, | 13357 | .ndo_validate_addr = eth_validate_addr, |
13351 | .ndo_set_multicast_list = tg3_set_rx_mode, | 13358 | .ndo_set_multicast_list = tg3_set_rx_mode, |
@@ -13475,7 +13482,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13475 | tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; | 13482 | tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; |
13476 | tp->tx_pending = TG3_DEF_TX_RING_PENDING; | 13483 | tp->tx_pending = TG3_DEF_TX_RING_PENDING; |
13477 | 13484 | ||
13478 | dev->netdev_ops = &tg3_netdev_ops; | ||
13479 | netif_napi_add(dev, &tp->napi, tg3_poll, 64); | 13485 | netif_napi_add(dev, &tp->napi, tg3_poll, 64); |
13480 | dev->ethtool_ops = &tg3_ethtool_ops; | 13486 | dev->ethtool_ops = &tg3_ethtool_ops; |
13481 | dev->watchdog_timeo = TG3_TX_TIMEOUT; | 13487 | dev->watchdog_timeo = TG3_TX_TIMEOUT; |
@@ -13488,6 +13494,17 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13488 | goto err_out_iounmap; | 13494 | goto err_out_iounmap; |
13489 | } | 13495 | } |
13490 | 13496 | ||
13497 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | ||
13498 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | ||
13499 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | ||
13500 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | ||
13501 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | ||
13502 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | ||
13503 | dev->netdev_ops = &tg3_netdev_ops; | ||
13504 | else | ||
13505 | dev->netdev_ops = &tg3_netdev_ops_dma_bug; | ||
13506 | |||
13507 | |||
13491 | /* The EPB bridge inside 5714, 5715, and 5780 and any | 13508 | /* The EPB bridge inside 5714, 5715, and 5780 and any |
13492 | * device behind the EPB cannot support DMA addresses > 40-bit. | 13509 | * device behind the EPB cannot support DMA addresses > 40-bit. |
13493 | * On 64-bit systems with IOMMU, use 40-bit dma_mask. | 13510 | * On 64-bit systems with IOMMU, use 40-bit dma_mask. |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index b4c941444756..fd0b11ea5562 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -308,13 +308,14 @@ tun_net_change_mtu(struct net_device *dev, int new_mtu) | |||
308 | static const struct net_device_ops tun_netdev_ops = { | 308 | static const struct net_device_ops tun_netdev_ops = { |
309 | .ndo_open = tun_net_open, | 309 | .ndo_open = tun_net_open, |
310 | .ndo_stop = tun_net_close, | 310 | .ndo_stop = tun_net_close, |
311 | .ndo_start_xmit = tun_net_xmit, | ||
311 | .ndo_change_mtu = tun_net_change_mtu, | 312 | .ndo_change_mtu = tun_net_change_mtu, |
312 | |||
313 | }; | 313 | }; |
314 | 314 | ||
315 | static const struct net_device_ops tap_netdev_ops = { | 315 | static const struct net_device_ops tap_netdev_ops = { |
316 | .ndo_open = tun_net_open, | 316 | .ndo_open = tun_net_open, |
317 | .ndo_stop = tun_net_close, | 317 | .ndo_stop = tun_net_close, |
318 | .ndo_start_xmit = tun_net_xmit, | ||
318 | .ndo_change_mtu = tun_net_change_mtu, | 319 | .ndo_change_mtu = tun_net_change_mtu, |
319 | .ndo_set_multicast_list = tun_net_mclist, | 320 | .ndo_set_multicast_list = tun_net_mclist, |
320 | .ndo_set_mac_address = eth_mac_addr, | 321 | .ndo_set_mac_address = eth_mac_addr, |
@@ -691,7 +692,6 @@ static void tun_setup(struct net_device *dev) | |||
691 | tun->owner = -1; | 692 | tun->owner = -1; |
692 | tun->group = -1; | 693 | tun->group = -1; |
693 | 694 | ||
694 | dev->hard_start_xmit = tun_net_xmit; | ||
695 | dev->ethtool_ops = &tun_ethtool_ops; | 695 | dev->ethtool_ops = &tun_ethtool_ops; |
696 | dev->destructor = free_netdev; | 696 | dev->destructor = free_netdev; |
697 | dev->features |= NETIF_F_NETNS_LOCAL; | 697 | dev->features |= NETIF_F_NETNS_LOCAL; |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 4f93a55aaaa5..852d0e7c4e62 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -265,6 +265,7 @@ static void veth_dev_free(struct net_device *dev) | |||
265 | static const struct net_device_ops veth_netdev_ops = { | 265 | static const struct net_device_ops veth_netdev_ops = { |
266 | .ndo_init = veth_dev_init, | 266 | .ndo_init = veth_dev_init, |
267 | .ndo_open = veth_open, | 267 | .ndo_open = veth_open, |
268 | .ndo_start_xmit = veth_xmit, | ||
268 | .ndo_get_stats = veth_get_stats, | 269 | .ndo_get_stats = veth_get_stats, |
269 | }; | 270 | }; |
270 | 271 | ||
@@ -273,7 +274,6 @@ static void veth_setup(struct net_device *dev) | |||
273 | ether_setup(dev); | 274 | ether_setup(dev); |
274 | 275 | ||
275 | dev->netdev_ops = &veth_netdev_ops; | 276 | dev->netdev_ops = &veth_netdev_ops; |
276 | dev->hard_start_xmit = veth_xmit; | ||
277 | dev->ethtool_ops = &veth_ethtool_ops; | 277 | dev->ethtool_ops = &veth_ethtool_ops; |
278 | dev->features |= NETIF_F_LLTX; | 278 | dev->features |= NETIF_F_LLTX; |
279 | dev->destructor = veth_dev_free; | 279 | dev->destructor = veth_dev_free; |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 033e63a68436..58e25d090ae0 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -852,6 +852,7 @@ static int velocity_soft_reset(struct velocity_info *vptr) | |||
852 | static const struct net_device_ops velocity_netdev_ops = { | 852 | static const struct net_device_ops velocity_netdev_ops = { |
853 | .ndo_open = velocity_open, | 853 | .ndo_open = velocity_open, |
854 | .ndo_stop = velocity_close, | 854 | .ndo_stop = velocity_close, |
855 | .ndo_start_xmit = velocity_xmit, | ||
855 | .ndo_get_stats = velocity_get_stats, | 856 | .ndo_get_stats = velocity_get_stats, |
856 | .ndo_validate_addr = eth_validate_addr, | 857 | .ndo_validate_addr = eth_validate_addr, |
857 | .ndo_set_multicast_list = velocity_set_multi, | 858 | .ndo_set_multicast_list = velocity_set_multi, |
@@ -971,7 +972,6 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
971 | vptr->phy_id = MII_GET_PHY_ID(vptr->mac_regs); | 972 | vptr->phy_id = MII_GET_PHY_ID(vptr->mac_regs); |
972 | 973 | ||
973 | dev->irq = pdev->irq; | 974 | dev->irq = pdev->irq; |
974 | dev->hard_start_xmit = velocity_xmit; | ||
975 | dev->netdev_ops = &velocity_netdev_ops; | 975 | dev->netdev_ops = &velocity_netdev_ops; |
976 | dev->ethtool_ops = &velocity_ethtool_ops; | 976 | dev->ethtool_ops = &velocity_ethtool_ops; |
977 | 977 | ||