aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:35:31 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-21 22:19:13 -0400
commitd0929553bebcac828b612e7d6d239559e08feaf4 (patch)
treee6d2e4561d26455c81b84c093487b72b9e0721d2 /drivers/infiniband
parent687c75dcf342f71329bd193af553e96a29581238 (diff)
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index f5484ad1279b..ae8c6888b533 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1568,6 +1568,19 @@ static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct vlan_g
1568 spin_unlock_irqrestore(&nesadapter->phy_lock, flags); 1568 spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
1569} 1569}
1570 1570
1571static const struct net_device_ops nes_netdev_ops = {
1572 .ndo_open = nes_netdev_open,
1573 .ndo_stop = nes_netdev_stop,
1574 .ndo_start_xmit = nes_netdev_start_xmit,
1575 .ndo_get_stats = nes_netdev_get_stats,
1576 .ndo_tx_timeout = nes_netdev_tx_timeout,
1577 .ndo_set_mac_address = nes_netdev_set_mac_address,
1578 .ndo_set_multicast_list = nes_netdev_set_multicast_list,
1579 .ndo_change_mtu = nes_netdev_change_mtu,
1580 .ndo_set_mac_address = eth_mac_addr,
1581 .ndo_validate_addr = eth_validate_addr,
1582 .ndo_vlan_rx_register = nes_netdev_vlan_rx_register,
1583};
1571 1584
1572/** 1585/**
1573 * nes_netdev_init - initialize network device 1586 * nes_netdev_init - initialize network device
@@ -1593,17 +1606,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1593 1606
1594 SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev); 1607 SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev);
1595 1608
1596 nesvnic = netdev_priv(netdev);
1597 memset(nesvnic, 0, sizeof(*nesvnic));
1598
1599 netdev->open = nes_netdev_open;
1600 netdev->stop = nes_netdev_stop;
1601 netdev->hard_start_xmit = nes_netdev_start_xmit;
1602 netdev->get_stats = nes_netdev_get_stats;
1603 netdev->tx_timeout = nes_netdev_tx_timeout;
1604 netdev->set_mac_address = nes_netdev_set_mac_address;
1605 netdev->set_multicast_list = nes_netdev_set_multicast_list;
1606 netdev->change_mtu = nes_netdev_change_mtu;
1607 netdev->watchdog_timeo = NES_TX_TIMEOUT; 1609 netdev->watchdog_timeo = NES_TX_TIMEOUT;
1608 netdev->irq = nesdev->pcidev->irq; 1610 netdev->irq = nesdev->pcidev->irq;
1609 netdev->mtu = ETH_DATA_LEN; 1611 netdev->mtu = ETH_DATA_LEN;
@@ -1611,14 +1613,15 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1611 netdev->addr_len = ETH_ALEN; 1613 netdev->addr_len = ETH_ALEN;
1612 netdev->type = ARPHRD_ETHER; 1614 netdev->type = ARPHRD_ETHER;
1613 netdev->features = NETIF_F_HIGHDMA; 1615 netdev->features = NETIF_F_HIGHDMA;
1616 netdev->netdev_ops = &nes_netdev_ops;
1614 netdev->ethtool_ops = &nes_ethtool_ops; 1617 netdev->ethtool_ops = &nes_ethtool_ops;
1615 netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128); 1618 netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
1616 nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n"); 1619 nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
1617 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1620 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1618 netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
1619 netdev->features |= NETIF_F_LLTX; 1621 netdev->features |= NETIF_F_LLTX;
1620 1622
1621 /* Fill in the port structure */ 1623 /* Fill in the port structure */
1624 nesvnic = netdev_priv(netdev);
1622 nesvnic->netdev = netdev; 1625 nesvnic->netdev = netdev;
1623 nesvnic->nesdev = nesdev; 1626 nesvnic->nesdev = nesdev;
1624 nesvnic->msg_enable = netif_msg_init(debug, default_msg); 1627 nesvnic->msg_enable = netif_msg_init(debug, default_msg);