Commit 80ff32b7 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

cxgb2: convert to net_device_ops

Convert this driver to network device ops. Compile teseted only.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd752696
...@@ -1010,6 +1010,23 @@ void t1_fatal_err(struct adapter *adapter) ...@@ -1010,6 +1010,23 @@ void t1_fatal_err(struct adapter *adapter)
adapter->name); adapter->name);
} }
static const struct net_device_ops cxgb_netdev_ops = {
.ndo_open = cxgb_open,
.ndo_stop = cxgb_close,
.ndo_get_stats = t1_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_multicast_list = t1_set_rxmode,
.ndo_do_ioctl = t1_ioctl,
.ndo_change_mtu = t1_change_mtu,
.ndo_set_mac_address = t1_set_mac_addr,
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
.ndo_vlan_rx_register = vlan_rx_register,
#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = t1_netpoll,
#endif
};
static int __devinit init_one(struct pci_dev *pdev, static int __devinit init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
...@@ -1130,7 +1147,6 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1130,7 +1147,6 @@ static int __devinit init_one(struct pci_dev *pdev,
adapter->flags |= VLAN_ACCEL_CAPABLE; adapter->flags |= VLAN_ACCEL_CAPABLE;
netdev->features |= netdev->features |=
NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
netdev->vlan_rx_register = vlan_rx_register;
#endif #endif
/* T204: disable TSO */ /* T204: disable TSO */
...@@ -1140,19 +1156,11 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1140,19 +1156,11 @@ static int __devinit init_one(struct pci_dev *pdev,
} }
} }
netdev->open = cxgb_open; netdev->netdev_ops = &cxgb_netdev_ops;
netdev->stop = cxgb_close;
netdev->hard_start_xmit = t1_start_xmit; netdev->hard_start_xmit = t1_start_xmit;
netdev->hard_header_len += (adapter->flags & TSO_CAPABLE) ? netdev->hard_header_len += (adapter->flags & TSO_CAPABLE) ?
sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt); sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt);
netdev->get_stats = t1_get_stats;
netdev->set_multicast_list = t1_set_rxmode;
netdev->do_ioctl = t1_ioctl;
netdev->change_mtu = t1_change_mtu;
netdev->set_mac_address = t1_set_mac_addr;
#ifdef CONFIG_NET_POLL_CONTROLLER
netdev->poll_controller = t1_netpoll;
#endif
netif_napi_add(netdev, &adapter->napi, t1_poll, 64); netif_napi_add(netdev, &adapter->napi, t1_poll, 64);
SET_ETHTOOL_OPS(netdev, &t1_ethtool_ops); SET_ETHTOOL_OPS(netdev, &t1_ethtool_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment