aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/main_usb.c
diff options
context:
space:
mode:
authorForest Bond <forest@alittletooquiet.net>2009-06-13 07:38:50 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:01:32 -0400
commit1e28efa3eb3cdfe6a3be0499d309fb75250c1028 (patch)
tree238cd41a22a23da0d6ba13a082d24d96700a7cd7 /drivers/staging/vt6656/main_usb.c
parent8f9c466f291a94b138560f28242c44e320a79ca4 (diff)
Staging: vt6656: Replace net_device->priv accesses with netdev_priv calls.
vt6656: Replace net_device->priv accesses with netdev_priv calls. Signed-off-by: Forest Bond <forest@alittletooquiet.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vt6656/main_usb.c')
-rw-r--r--drivers/staging/vt6656/main_usb.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index f181d237e9e..12a9ae08789 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -866,15 +866,8 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
866 udev = usb_get_dev(udev); 866 udev = usb_get_dev(udev);
867#endif 867#endif
868 868
869 pDevice = kmalloc(sizeof(DEVICE_INFO), GFP_KERNEL);
870 if (pDevice == NULL) {
871 printk(KERN_ERR DEVICE_NAME ": allocate usb device failed \n");
872 goto err_nomem;
873 }
874 memset(pDevice, 0, sizeof(DEVICE_INFO));
875
876#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 869#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
877 netdev = alloc_etherdev(0); 870 netdev = alloc_etherdev(sizeof(DEVICE_INFO));
878#else 871#else
879 netdev = init_etherdev(netdev, 0); 872 netdev = init_etherdev(netdev, 0);
880#endif 873#endif
@@ -884,6 +877,10 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
884 kfree(pDevice); 877 kfree(pDevice);
885 goto err_nomem; 878 goto err_nomem;
886 } 879 }
880
881 pDevice = netdev_priv(netdev);
882 memset(pDevice, 0, sizeof(DEVICE_INFO));
883
887 pDevice->dev = netdev; 884 pDevice->dev = netdev;
888 pDevice->usb = udev; 885 pDevice->usb = udev;
889 886
@@ -899,7 +896,6 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
899 pDevice->tx_80211 = device_dma0_tx_80211; 896 pDevice->tx_80211 = device_dma0_tx_80211;
900 pDevice->sMgmtObj.pAdapter = (PVOID)pDevice; 897 pDevice->sMgmtObj.pAdapter = (PVOID)pDevice;
901 898
902 netdev->priv = pDevice;
903 netdev->open = device_open; 899 netdev->open = device_open;
904 netdev->hard_start_xmit = device_xmit; 900 netdev->hard_start_xmit = device_xmit;
905 netdev->stop = device_close; 901 netdev->stop = device_close;
@@ -1205,7 +1201,7 @@ BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) {
1205/*-----------------------------------------------------------------*/ 1201/*-----------------------------------------------------------------*/
1206 1202
1207static int device_open(struct net_device *dev) { 1203static int device_open(struct net_device *dev) {
1208 PSDevice pDevice=(PSDevice) dev->priv; 1204 PSDevice pDevice=(PSDevice) netdev_priv(dev);
1209 1205
1210#ifdef WPA_SM_Transtatus 1206#ifdef WPA_SM_Transtatus
1211 extern SWPAResult wpa_Result; 1207 extern SWPAResult wpa_Result;
@@ -1348,7 +1344,7 @@ free_rx_tx:
1348 1344
1349 1345
1350static int device_close(struct net_device *dev) { 1346static int device_close(struct net_device *dev) {
1351 PSDevice pDevice=(PSDevice) dev->priv; 1347 PSDevice pDevice=(PSDevice) netdev_priv(dev);
1352 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1348 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1353 1349
1354 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) 1350 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
@@ -1507,7 +1503,7 @@ device_release_WPADEV(pDevice);
1507 1503
1508 1504
1509static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { 1505static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
1510 PSDevice pDevice=dev->priv; 1506 PSDevice pDevice=netdev_priv(dev);
1511 PBYTE pbMPDU; 1507 PBYTE pbMPDU;
1512 UINT cbMPDULen = 0; 1508 UINT cbMPDULen = 0;
1513 1509
@@ -1535,7 +1531,7 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
1535 1531
1536 1532
1537static int device_xmit(struct sk_buff *skb, struct net_device *dev) { 1533static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
1538 PSDevice pDevice=dev->priv; 1534 PSDevice pDevice=netdev_priv(dev);
1539 struct net_device_stats* pStats = &pDevice->stats; 1535 struct net_device_stats* pStats = &pDevice->stats;
1540 1536
1541 1537
@@ -1768,7 +1764,7 @@ static int Read_config_file(PSDevice pDevice) {
1768} 1764}
1769 1765
1770static void device_set_multi(struct net_device *dev) { 1766static void device_set_multi(struct net_device *dev) {
1771 PSDevice pDevice = (PSDevice) dev->priv; 1767 PSDevice pDevice = (PSDevice) netdev_priv(dev);
1772 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1768 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1773 u32 mc_filter[2]; 1769 u32 mc_filter[2];
1774 int ii; 1770 int ii;
@@ -1833,14 +1829,14 @@ static void device_set_multi(struct net_device *dev) {
1833 1829
1834 1830
1835static struct net_device_stats *device_get_stats(struct net_device *dev) { 1831static struct net_device_stats *device_get_stats(struct net_device *dev) {
1836 PSDevice pDevice=(PSDevice) dev->priv; 1832 PSDevice pDevice=(PSDevice) netdev_priv(dev);
1837 1833
1838 return &pDevice->stats; 1834 return &pDevice->stats;
1839} 1835}
1840 1836
1841 1837
1842static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { 1838static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
1843 PSDevice pDevice = (PSDevice)dev->priv; 1839 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1844 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1840 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1845 PSCmdRequest pReq; 1841 PSCmdRequest pReq;
1846 //BOOL bCommit = FALSE; 1842 //BOOL bCommit = FALSE;