infiniband: convert nes driver to net_device_ops
Also, removed unnecessary memset() since alloc_netdev returns zeroed memory. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
687c75dcf3
commit
d0929553be
1 changed files with 15 additions and 12 deletions
|
@ -1568,6 +1568,19 @@ static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct vlan_g
|
||||||
spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
|
spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops nes_netdev_ops = {
|
||||||
|
.ndo_open = nes_netdev_open,
|
||||||
|
.ndo_stop = nes_netdev_stop,
|
||||||
|
.ndo_start_xmit = nes_netdev_start_xmit,
|
||||||
|
.ndo_get_stats = nes_netdev_get_stats,
|
||||||
|
.ndo_tx_timeout = nes_netdev_tx_timeout,
|
||||||
|
.ndo_set_mac_address = nes_netdev_set_mac_address,
|
||||||
|
.ndo_set_multicast_list = nes_netdev_set_multicast_list,
|
||||||
|
.ndo_change_mtu = nes_netdev_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_vlan_rx_register = nes_netdev_vlan_rx_register,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nes_netdev_init - initialize network device
|
* nes_netdev_init - initialize network device
|
||||||
|
@ -1593,17 +1606,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
|
||||||
|
|
||||||
SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev);
|
SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev);
|
||||||
|
|
||||||
nesvnic = netdev_priv(netdev);
|
|
||||||
memset(nesvnic, 0, sizeof(*nesvnic));
|
|
||||||
|
|
||||||
netdev->open = nes_netdev_open;
|
|
||||||
netdev->stop = nes_netdev_stop;
|
|
||||||
netdev->hard_start_xmit = nes_netdev_start_xmit;
|
|
||||||
netdev->get_stats = nes_netdev_get_stats;
|
|
||||||
netdev->tx_timeout = nes_netdev_tx_timeout;
|
|
||||||
netdev->set_mac_address = nes_netdev_set_mac_address;
|
|
||||||
netdev->set_multicast_list = nes_netdev_set_multicast_list;
|
|
||||||
netdev->change_mtu = nes_netdev_change_mtu;
|
|
||||||
netdev->watchdog_timeo = NES_TX_TIMEOUT;
|
netdev->watchdog_timeo = NES_TX_TIMEOUT;
|
||||||
netdev->irq = nesdev->pcidev->irq;
|
netdev->irq = nesdev->pcidev->irq;
|
||||||
netdev->mtu = ETH_DATA_LEN;
|
netdev->mtu = ETH_DATA_LEN;
|
||||||
|
@ -1611,14 +1613,15 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
|
||||||
netdev->addr_len = ETH_ALEN;
|
netdev->addr_len = ETH_ALEN;
|
||||||
netdev->type = ARPHRD_ETHER;
|
netdev->type = ARPHRD_ETHER;
|
||||||
netdev->features = NETIF_F_HIGHDMA;
|
netdev->features = NETIF_F_HIGHDMA;
|
||||||
|
netdev->netdev_ops = &nes_netdev_ops;
|
||||||
netdev->ethtool_ops = &nes_ethtool_ops;
|
netdev->ethtool_ops = &nes_ethtool_ops;
|
||||||
netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
|
netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
|
||||||
nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
|
nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
|
||||||
netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
|
netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
|
||||||
netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
|
|
||||||
netdev->features |= NETIF_F_LLTX;
|
netdev->features |= NETIF_F_LLTX;
|
||||||
|
|
||||||
/* Fill in the port structure */
|
/* Fill in the port structure */
|
||||||
|
nesvnic = netdev_priv(netdev);
|
||||||
nesvnic->netdev = netdev;
|
nesvnic->netdev = netdev;
|
||||||
nesvnic->nesdev = nesdev;
|
nesvnic->nesdev = nesdev;
|
||||||
nesvnic->msg_enable = netif_msg_init(debug, default_msg);
|
nesvnic->msg_enable = netif_msg_init(debug, default_msg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue