From forest@alittletooquiet.net Thu Jul 2 12:45:56 2009 From: Forest Bond Date: Sat, 13 Jun 2009 07:38:54 -0400 Subject: Staging: vt6656: use net_device_ops for management functions To: Greg KH Cc: Larry Finger Message-ID: <20090613113854.GP26234@alittletooquiet.net> Content-Disposition: inline vt6656: use net_device_ops for management functions Signed-off-by: Forest Bond Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6656/hostap.c | 7 ++++++- drivers/staging/vt6656/main_usb.c | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) --- a/drivers/staging/vt6656/hostap.c +++ b/drivers/staging/vt6656/hostap.c @@ -117,7 +117,12 @@ static int hostap_enable_hostapd(PSDevic apdev_priv = netdev_priv(pDevice->apdev); *apdev_priv = *pDevice; memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN); - pDevice->apdev->hard_start_xmit = pDevice->tx_80211; + + const struct net_device_ops apdev_netdev_ops = { + .ndo_start_xmit = pDevice->tx_80211, + }; + pDevice->apdev->netdev_ops = &apdev_netdev_ops; + pDevice->apdev->type = ARPHRD_IEEE80211; pDevice->apdev->base_addr = dev->base_addr; --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -837,6 +837,17 @@ static int vntwusb_resume(struct usb_int } #endif + +static const struct net_device_ops device_netdev_ops = { + .ndo_open = device_open, + .ndo_stop = device_close, + .ndo_do_ioctl = device_ioctl, + .ndo_get_stats = device_get_stats, + .ndo_start_xmit = device_xmit, + .ndo_set_multicast_list = device_set_multi, +}; + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) static int @@ -896,12 +907,8 @@ vntwusb_found1(struct usb_device *udev, pDevice->tx_80211 = device_dma0_tx_80211; pDevice->sMgmtObj.pAdapter = (PVOID)pDevice; - netdev->open = device_open; - netdev->hard_start_xmit = device_xmit; - netdev->stop = device_close; - netdev->get_stats = device_get_stats; - netdev->set_multicast_list = device_set_multi; - netdev->do_ioctl = device_ioctl; + netdev->netdev_ops = &device_netdev_ops; + #ifdef WIRELESS_EXT //2007-0508-01by MikeLiu