aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:35:55 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-21 22:41:02 -0400
commit1703338c79f39178535fe54b5aeaebf9c42300f6 (patch)
treeb21d5ec1ba3b64fabcc0d5cad8b4d41f898e81b9
parent777baa4711c6b8373f4e03a3a558d44a6b046d7a (diff)
usbnet: convert asix driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/asix.c47
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 396f821b5ff0..87b4a0289919 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -807,6 +807,18 @@ static int ax88172_link_reset(struct usbnet *dev)
807 return 0; 807 return 0;
808} 808}
809 809
810static const struct net_device_ops ax88172_netdev_ops = {
811 .ndo_open = usbnet_open,
812 .ndo_stop = usbnet_stop,
813 .ndo_start_xmit = usbnet_start_xmit,
814 .ndo_tx_timeout = usbnet_tx_timeout,
815 .ndo_change_mtu = usbnet_change_mtu,
816 .ndo_set_mac_address = eth_mac_addr,
817 .ndo_validate_addr = eth_validate_addr,
818 .ndo_do_ioctl = asix_ioctl,
819 .ndo_set_multicast_list = ax88172_set_multicast,
820};
821
810static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf) 822static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
811{ 823{
812 int ret = 0; 824 int ret = 0;
@@ -846,9 +858,8 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
846 dev->mii.phy_id_mask = 0x3f; 858 dev->mii.phy_id_mask = 0x3f;
847 dev->mii.reg_num_mask = 0x1f; 859 dev->mii.reg_num_mask = 0x1f;
848 dev->mii.phy_id = asix_get_phy_addr(dev); 860 dev->mii.phy_id = asix_get_phy_addr(dev);
849 dev->net->do_ioctl = asix_ioctl;
850 861
851 dev->net->set_multicast_list = ax88172_set_multicast; 862 dev->net->netdev_ops = &ax88172_netdev_ops;
852 dev->net->ethtool_ops = &ax88172_ethtool_ops; 863 dev->net->ethtool_ops = &ax88172_ethtool_ops;
853 864
854 asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); 865 asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
@@ -898,6 +909,18 @@ static int ax88772_link_reset(struct usbnet *dev)
898 return 0; 909 return 0;
899} 910}
900 911
912static const struct net_device_ops ax88772_netdev_ops = {
913 .ndo_open = usbnet_open,
914 .ndo_stop = usbnet_stop,
915 .ndo_start_xmit = usbnet_start_xmit,
916 .ndo_tx_timeout = usbnet_tx_timeout,
917 .ndo_change_mtu = usbnet_change_mtu,
918 .ndo_set_mac_address = eth_mac_addr,
919 .ndo_validate_addr = eth_validate_addr,
920 .ndo_do_ioctl = asix_ioctl,
921 .ndo_set_multicast_list = asix_set_multicast,
922};
923
901static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 924static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
902{ 925{
903 int ret, embd_phy; 926 int ret, embd_phy;
@@ -962,7 +985,6 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
962 dev->mii.mdio_write = asix_mdio_write; 985 dev->mii.mdio_write = asix_mdio_write;
963 dev->mii.phy_id_mask = 0x1f; 986 dev->mii.phy_id_mask = 0x1f;
964 dev->mii.reg_num_mask = 0x1f; 987 dev->mii.reg_num_mask = 0x1f;
965 dev->net->do_ioctl = asix_ioctl;
966 dev->mii.phy_id = asix_get_phy_addr(dev); 988 dev->mii.phy_id = asix_get_phy_addr(dev);
967 989
968 phyid = asix_get_phyid(dev); 990 phyid = asix_get_phyid(dev);
@@ -978,7 +1000,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
978 1000
979 msleep(150); 1001 msleep(150);
980 1002
981 dev->net->set_multicast_list = asix_set_multicast; 1003 dev->net->netdev_ops = &ax88772_netdev_ops;
982 dev->net->ethtool_ops = &ax88772_ethtool_ops; 1004 dev->net->ethtool_ops = &ax88772_ethtool_ops;
983 1005
984 asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); 1006 asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
@@ -1181,6 +1203,18 @@ static int ax88178_change_mtu(struct net_device *net, int new_mtu)
1181 return 0; 1203 return 0;
1182} 1204}
1183 1205
1206static const struct net_device_ops ax88178_netdev_ops = {
1207 .ndo_open = usbnet_open,
1208 .ndo_stop = usbnet_stop,
1209 .ndo_start_xmit = usbnet_start_xmit,
1210 .ndo_tx_timeout = usbnet_tx_timeout,
1211 .ndo_set_mac_address = eth_mac_addr,
1212 .ndo_validate_addr = eth_validate_addr,
1213 .ndo_set_multicast_list = asix_set_multicast,
1214 .ndo_do_ioctl = asix_ioctl,
1215 .ndo_change_mtu = ax88178_change_mtu,
1216};
1217
1184static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf) 1218static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
1185{ 1219{
1186 struct asix_data *data = (struct asix_data *)&dev->data; 1220 struct asix_data *data = (struct asix_data *)&dev->data;
@@ -1247,11 +1281,10 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
1247 dev->mii.phy_id_mask = 0x1f; 1281 dev->mii.phy_id_mask = 0x1f;
1248 dev->mii.reg_num_mask = 0xff; 1282 dev->mii.reg_num_mask = 0xff;
1249 dev->mii.supports_gmii = 1; 1283 dev->mii.supports_gmii = 1;
1250 dev->net->do_ioctl = asix_ioctl;
1251 dev->mii.phy_id = asix_get_phy_addr(dev); 1284 dev->mii.phy_id = asix_get_phy_addr(dev);
1252 dev->net->set_multicast_list = asix_set_multicast; 1285
1286 dev->net->netdev_ops = &ax88178_netdev_ops;
1253 dev->net->ethtool_ops = &ax88178_ethtool_ops; 1287 dev->net->ethtool_ops = &ax88178_ethtool_ops;
1254 dev->net->change_mtu = &ax88178_change_mtu;
1255 1288
1256 phyid = asix_get_phyid(dev); 1289 phyid = asix_get_phyid(dev);
1257 dbg("PHYID=0x%08x", phyid); 1290 dbg("PHYID=0x%08x", phyid);