Skip to content

Commit

Permalink
via-velocity: convert to net_device_ops
Browse files Browse the repository at this point in the history
Convert this driver to network device ops. Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Nov 20, 2008
1 parent 0e7614b commit 39a11bd
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,19 @@ static int velocity_soft_reset(struct velocity_info *vptr)
return 0;
}

static const struct net_device_ops velocity_netdev_ops = {
.ndo_open = velocity_open,
.ndo_stop = velocity_close,
.ndo_get_stats = velocity_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_multicast_list = velocity_set_multi,
.ndo_change_mtu = velocity_change_mtu,
.ndo_do_ioctl = velocity_ioctl,
.ndo_vlan_rx_add_vid = velocity_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = velocity_vlan_rx_kill_vid,
.ndo_vlan_rx_register = velocity_vlan_rx_register,
};

/**
* velocity_found1 - set up discovered velocity card
* @pdev: PCI device
Expand Down Expand Up @@ -958,18 +971,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
vptr->phy_id = MII_GET_PHY_ID(vptr->mac_regs);

dev->irq = pdev->irq;
dev->open = velocity_open;
dev->hard_start_xmit = velocity_xmit;
dev->stop = velocity_close;
dev->get_stats = velocity_get_stats;
dev->set_multicast_list = velocity_set_multi;
dev->do_ioctl = velocity_ioctl;
dev->netdev_ops = &velocity_netdev_ops;
dev->ethtool_ops = &velocity_ethtool_ops;
dev->change_mtu = velocity_change_mtu;

dev->vlan_rx_add_vid = velocity_vlan_rx_add_vid;
dev->vlan_rx_kill_vid = velocity_vlan_rx_kill_vid;
dev->vlan_rx_register = velocity_vlan_rx_register;

#ifdef VELOCITY_ZERO_COPY_SUPPORT
dev->features |= NETIF_F_SG;
Expand Down

0 comments on commit 39a11bd

Please sign in to comment.