aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2009-03-29 11:26:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-17 14:06:24 -0400
commit17a23b384f88a336a5230e80dea2013aad03b6f7 (patch)
treed0fdce4ec27b4a7fbcc0b6da2fcfbc4af07df796 /drivers
parentfa5a602a62d7dca6d8ea24cfb4aae349dbaabc7b (diff)
Staging: otus: convert to netdev_ops
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/otus/usbdrv.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/drivers/staging/otus/usbdrv.c b/drivers/staging/otus/usbdrv.c
index 565a839589f5..540cbbb826f9 100644
--- a/drivers/staging/otus/usbdrv.c
+++ b/drivers/staging/otus/usbdrv.c
@@ -822,6 +822,21 @@ int zfLnxVapXmitFrame(struct sk_buff *skb, struct net_device *dev)
822 return 0; 822 return 0;
823} 823}
824 824
825static const struct net_device_ops vap_netdev_ops = {
826 .ndo_open = zfLnxVapOpen,
827 .ndo_stop = zfLnxVapClose,
828 .ndo_start_xmit = zfLnxVapXmitFrame,
829 .ndo_get_stats = usbdrv_get_stats,
830 .ndo_change_mtu = usbdrv_change_mtu,
831 .ndo_validate_addr = eth_validate_addr,
832 .ndo_set_mac_address = eth_mac_addr,
833#ifdef ZM_HOSTAPD_SUPPORT
834 .ndo_do_ioctl = usbdrv_ioctl,
835#else
836 .ndo_do_ioctl = NULL,
837#endif
838};
839
825int zfLnxRegisterVapDev(struct net_device* parentDev, u16_t vapId) 840int zfLnxRegisterVapDev(struct net_device* parentDev, u16_t vapId)
826{ 841{
827 /* Allocate net device structure */ 842 /* Allocate net device structure */
@@ -846,16 +861,7 @@ int zfLnxRegisterVapDev(struct net_device* parentDev, u16_t vapId)
846 vap[vapId].dev->ml_priv = parentDev->ml_priv; 861 vap[vapId].dev->ml_priv = parentDev->ml_priv;
847 862
848 //dev->hard_start_xmit = &zd1212_wds_xmit_frame; 863 //dev->hard_start_xmit = &zd1212_wds_xmit_frame;
849 vap[vapId].dev->hard_start_xmit = &zfLnxVapXmitFrame; 864 vap[vapId].dev->netdev_ops = &vap_netdev_ops;
850 vap[vapId].dev->open = &zfLnxVapOpen;
851 vap[vapId].dev->stop = &zfLnxVapClose;
852 vap[vapId].dev->get_stats = &usbdrv_get_stats;
853 vap[vapId].dev->change_mtu = &usbdrv_change_mtu;
854#ifdef ZM_HOSTAPD_SUPPORT
855 vap[vapId].dev->do_ioctl = usbdrv_ioctl;
856#else
857 vap[vapId].dev->do_ioctl = NULL;
858#endif
859 vap[vapId].dev->destructor = free_netdev; 865 vap[vapId].dev->destructor = free_netdev;
860 866
861 vap[vapId].dev->tx_queue_len = 0; 867 vap[vapId].dev->tx_queue_len = 0;
@@ -1068,6 +1074,18 @@ void zfLnxUnlinkAllUrbs(struct usbdrv_private *macp)
1068 usb_unlink_urb(macp->RegInUrb); 1074 usb_unlink_urb(macp->RegInUrb);
1069} 1075}
1070 1076
1077static const struct net_device_ops otus_netdev_ops = {
1078 .ndo_open = usbdrv_open,
1079 .ndo_stop = usbdrv_close,
1080 .ndo_start_xmit = usbdrv_xmit_frame,
1081 .ndo_change_mtu = usbdrv_change_mtu,
1082 .ndo_get_stats = usbdrv_get_stats,
1083 .ndo_set_multicast_list = usbdrv_set_multi,
1084 .ndo_set_mac_address = usbdrv_set_mac,
1085 .ndo_do_ioctl = usbdrv_ioctl,
1086 .ndo_validate_addr = eth_validate_addr,
1087};
1088
1071u8_t zfLnxInitSetup(struct net_device *dev, struct usbdrv_private *macp) 1089u8_t zfLnxInitSetup(struct net_device *dev, struct usbdrv_private *macp)
1072{ 1090{
1073 //unsigned char addr[6]; 1091 //unsigned char addr[6];
@@ -1092,14 +1110,7 @@ u8_t zfLnxInitSetup(struct net_device *dev, struct usbdrv_private *macp)
1092 dev->wireless_handlers = (struct iw_handler_def *)&p80211wext_handler_def; 1110 dev->wireless_handlers = (struct iw_handler_def *)&p80211wext_handler_def;
1093#endif 1111#endif
1094 1112
1095 dev->open = usbdrv_open; 1113 dev->netdev_ops = &otus_netdev_ops;
1096 dev->hard_start_xmit = usbdrv_xmit_frame;
1097 dev->stop = usbdrv_close;
1098 dev->change_mtu = &usbdrv_change_mtu;
1099 dev->get_stats = usbdrv_get_stats;
1100 dev->set_multicast_list = usbdrv_set_multi;
1101 dev->set_mac_address = usbdrv_set_mac;
1102 dev->do_ioctl = usbdrv_ioctl;
1103 1114
1104 dev->flags |= IFF_MULTICAST; 1115 dev->flags |= IFF_MULTICAST;
1105 1116