aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorForest Bond <forest@alittletooquiet.net>2009-06-01 20:00:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-19 14:00:51 -0400
commitc9d0352914e8fdaece56c8c3ea489d7214b0353e (patch)
tree8e7e003cd64108e7449cfe1e0717207bce112ba4
parente2ce5277eb9fdd6923f35b25e64ebfc7a70a03c3 (diff)
Staging: vt6655: Replace net_device->priv accesses with netdev_priv calls.
vt6655: 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>
-rw-r--r--drivers/staging/vt6655/device_main.c30
-rw-r--r--drivers/staging/vt6655/hostap.c6
-rw-r--r--drivers/staging/vt6655/iwctl.c62
-rw-r--r--drivers/staging/vt6655/wpactl.c7
4 files changed, 51 insertions, 54 deletions
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index d8f7f4f7bac4..93c626b8a0bd 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -997,11 +997,13 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
997 997
998 998
999#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 999#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
1000 dev = alloc_etherdev(0); 1000 dev = alloc_etherdev(sizeof(DEVICE_INFO));
1001#else 1001#else
1002 dev = init_etherdev(dev, 0); 1002 dev = init_etherdev(dev, 0);
1003#endif 1003#endif
1004 1004
1005 pDevice = (PSDevice) netdev_priv(dev);
1006
1005 if (dev == NULL) { 1007 if (dev == NULL) {
1006 printk(KERN_ERR DEVICE_NAME ": allocate net device failed \n"); 1008 printk(KERN_ERR DEVICE_NAME ": allocate net device failed \n");
1007 return -ENODEV; 1009 return -ENODEV;
@@ -1025,7 +1027,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
1025 pDevice->dev = dev; 1027 pDevice->dev = dev;
1026 pDevice->next_module = root_device_dev; 1028 pDevice->next_module = root_device_dev;
1027 root_device_dev = dev; 1029 root_device_dev = dev;
1028 dev->priv = pDevice;
1029 dev->irq = pcid->irq; 1030 dev->irq = pcid->irq;
1030 1031
1031 if (pci_enable_device(pcid)) { 1032 if (pci_enable_device(pcid)) {
@@ -1194,7 +1195,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
1194 printk("Fail to Register WPADEV?\n"); 1195 printk("Fail to Register WPADEV?\n");
1195 unregister_netdev(pDevice->dev); 1196 unregister_netdev(pDevice->dev);
1196 free_netdev(dev); 1197 free_netdev(dev);
1197 kfree(pDevice);
1198 } 1198 }
1199 device_print_info(pDevice); 1199 device_print_info(pDevice);
1200 pci_set_drvdata(pcid, pDevice); 1200 pci_set_drvdata(pcid, pDevice);
@@ -1226,11 +1226,6 @@ static BOOL device_init_info(struct pci_dev* pcid, PSDevice* ppDevice,
1226 1226
1227 PSDevice p; 1227 PSDevice p;
1228 1228
1229 *ppDevice = kmalloc(sizeof(DEVICE_INFO),GFP_ATOMIC);
1230
1231 if (*ppDevice == NULL)
1232 return FALSE;
1233
1234 memset(*ppDevice,0,sizeof(DEVICE_INFO)); 1229 memset(*ppDevice,0,sizeof(DEVICE_INFO));
1235 1230
1236 if (pDevice_Infos == NULL) { 1231 if (pDevice_Infos == NULL) {
@@ -1374,8 +1369,6 @@ device_release_WPADEV(pDevice);
1374 if (pDevice->pcid) { 1369 if (pDevice->pcid) {
1375 pci_set_drvdata(pDevice->pcid,NULL); 1370 pci_set_drvdata(pDevice->pcid,NULL);
1376 } 1371 }
1377 kfree(pDevice);
1378
1379} 1372}
1380#endif// ifndef PRIVATE_OBJ 1373#endif// ifndef PRIVATE_OBJ
1381 1374
@@ -2059,7 +2052,7 @@ int __device_open(HANDLE pExDevice) {
2059#else 2052#else
2060 2053
2061static int device_open(struct net_device *dev) { 2054static int device_open(struct net_device *dev) {
2062 PSDevice pDevice=(PSDevice) dev->priv; 2055 PSDevice pDevice=(PSDevice) netdev_priv(dev);
2063 int i; 2056 int i;
2064#endif 2057#endif
2065 pDevice->rx_buf_sz = PKT_BUF_SZ; 2058 pDevice->rx_buf_sz = PKT_BUF_SZ;
@@ -2212,7 +2205,7 @@ int __device_close(HANDLE pExDevice) {
2212 2205
2213#else 2206#else
2214static int device_close(struct net_device *dev) { 2207static int device_close(struct net_device *dev) {
2215 PSDevice pDevice=(PSDevice) dev->priv; 2208 PSDevice pDevice=(PSDevice) netdev_priv(dev);
2216#endif 2209#endif
2217 PSMgmtObject pMgmt = pDevice->pMgmt; 2210 PSMgmtObject pMgmt = pDevice->pMgmt;
2218 //PLICE_DEBUG-> 2211 //PLICE_DEBUG->
@@ -2282,7 +2275,7 @@ int __device_dma0_tx_80211(HANDLE pExDevice, struct sk_buff *skb) {
2282 2275
2283 2276
2284static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { 2277static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
2285 PSDevice pDevice=dev->priv; 2278 PSDevice pDevice=netdev_priv(dev);
2286#endif 2279#endif
2287 PBYTE pbMPDU; 2280 PBYTE pbMPDU;
2288 UINT cbMPDULen = 0; 2281 UINT cbMPDULen = 0;
@@ -2494,7 +2487,7 @@ int __device_xmit(HANDLE pExDevice, struct sk_buff *skb) {
2494 2487
2495#else 2488#else
2496static int device_xmit(struct sk_buff *skb, struct net_device *dev) { 2489static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
2497 PSDevice pDevice=dev->priv; 2490 PSDevice pDevice=netdev_priv(dev);
2498 2491
2499#endif 2492#endif
2500 PSMgmtObject pMgmt = pDevice->pMgmt; 2493 PSMgmtObject pMgmt = pDevice->pMgmt;
@@ -2950,7 +2943,7 @@ int __device_intr(int irq, HANDLE pExDevice, struct pt_regs *regs) {
2950#else 2943#else
2951static irqreturn_t device_intr(int irq, void *dev_instance) { 2944static irqreturn_t device_intr(int irq, void *dev_instance) {
2952 struct net_device* dev=dev_instance; 2945 struct net_device* dev=dev_instance;
2953 PSDevice pDevice=(PSDevice) dev->priv; 2946 PSDevice pDevice=(PSDevice) netdev_priv(dev);
2954#endif 2947#endif
2955 2948
2956 int max_count=0; 2949 int max_count=0;
@@ -3367,7 +3360,7 @@ void __device_set_multi(HANDLE pExDevice) {
3367#else 3360#else
3368 3361
3369static void device_set_multi(struct net_device *dev) { 3362static void device_set_multi(struct net_device *dev) {
3370 PSDevice pDevice = (PSDevice) dev->priv; 3363 PSDevice pDevice = (PSDevice) netdev_priv(dev);
3371#endif 3364#endif
3372 3365
3373 PSMgmtObject pMgmt = pDevice->pMgmt; 3366 PSMgmtObject pMgmt = pDevice->pMgmt;
@@ -3441,7 +3434,7 @@ struct net_device_stats *__device_get_stats(HANDLE pExDevice) {
3441 3434
3442#else 3435#else
3443static struct net_device_stats *device_get_stats(struct net_device *dev) { 3436static struct net_device_stats *device_get_stats(struct net_device *dev) {
3444 PSDevice pDevice=(PSDevice) dev->priv; 3437 PSDevice pDevice=(PSDevice) netdev_priv(dev);
3445#endif 3438#endif
3446 3439
3447 return &pDevice->stats; 3440 return &pDevice->stats;
@@ -3458,7 +3451,7 @@ int __device_ioctl(HANDLE pExDevice, struct ifreq *rq, int cmd) {
3458#else 3451#else
3459 3452
3460static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { 3453static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
3461 PSDevice pDevice = (PSDevice)dev->priv; 3454 PSDevice pDevice = (PSDevice)netdev_priv(dev);
3462#endif 3455#endif
3463 3456
3464#ifdef WIRELESS_EXT 3457#ifdef WIRELESS_EXT
@@ -4116,7 +4109,6 @@ int __device_hw_init(HANDLE pExDevice){
4116 PSDevice_info pDevice_info = (PSDevice_info)pExDevice; 4109 PSDevice_info pDevice_info = (PSDevice_info)pExDevice;
4117 PSDevice pDevice; 4110 PSDevice pDevice;
4118 4111
4119
4120 pDevice = (PSDevice)kmalloc(sizeof(DEVICE_INFO), (int)GFP_ATOMIC); 4112 pDevice = (PSDevice)kmalloc(sizeof(DEVICE_INFO), (int)GFP_ATOMIC);
4121 if (pDevice == NULL) 4113 if (pDevice == NULL)
4122 return FALSE; 4114 return FALSE;
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 134de869cb80..620b8bd745be 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -100,6 +100,7 @@ static int msglevel =MSG_LEVEL_INFO;
100 100
101static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) 101static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
102{ 102{
103 PSDevice apdev_priv;
103 struct net_device *dev = pDevice->dev; 104 struct net_device *dev = pDevice->dev;
104 int ret; 105 int ret;
105 106
@@ -124,12 +125,13 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
124 dev->name, pDevice->apdev->name); 125 dev->name, pDevice->apdev->name);
125 126
126#else 127#else
127 pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL); 128 pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
128 if (pDevice->apdev == NULL) 129 if (pDevice->apdev == NULL)
129 return -ENOMEM; 130 return -ENOMEM;
130 memset(pDevice->apdev, 0, sizeof(struct net_device)); 131 memset(pDevice->apdev, 0, sizeof(struct net_device));
131 132
132 pDevice->apdev->priv = pDevice; 133 apdev_priv = netdev_priv(pDevice->apdev);
134 *apdev_priv = *pDevice;
133 memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN); 135 memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
134 pDevice->apdev->hard_start_xmit = pDevice->tx_80211; 136 pDevice->apdev->hard_start_xmit = pDevice->tx_80211;
135 pDevice->apdev->type = ARPHRD_IEEE80211; 137 pDevice->apdev->type = ARPHRD_IEEE80211;
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 160baf0abc09..60ea9b4d44ba 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -113,7 +113,7 @@ static int msglevel =MSG_LEVEL_INFO;
113 113
114struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev) 114struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
115{ 115{
116 PSDevice pDevice = dev->priv; 116 PSDevice pDevice = netdev_priv(dev);
117 long ldBm; 117 long ldBm;
118 pDevice->wstats.status = pDevice->eOPMode; 118 pDevice->wstats.status = pDevice->eOPMode;
119 #ifdef Calcu_LinkQual 119 #ifdef Calcu_LinkQual
@@ -209,7 +209,7 @@ int iwctl_siwscan(struct net_device *dev,
209 struct iw_point *wrq, 209 struct iw_point *wrq,
210 char *extra) 210 char *extra)
211{ 211{
212 PSDevice pDevice = (PSDevice)dev->priv; 212 PSDevice pDevice = (PSDevice)netdev_priv(dev);
213 struct iw_scan_req *req = (struct iw_scan_req *)extra; 213 struct iw_scan_req *req = (struct iw_scan_req *)extra;
214 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 214 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
215 BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; 215 BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
@@ -276,7 +276,7 @@ int iwctl_giwscan(struct net_device *dev,
276 char *extra) 276 char *extra)
277{ 277{
278 int ii, jj, kk; 278 int ii, jj, kk;
279 PSDevice pDevice = (PSDevice)dev->priv; 279 PSDevice pDevice = (PSDevice)netdev_priv(dev);
280 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 280 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
281 PKnownBSS pBSS; 281 PKnownBSS pBSS;
282 PWLAN_IE_SSID pItemSSID; 282 PWLAN_IE_SSID pItemSSID;
@@ -522,7 +522,7 @@ int iwctl_siwfreq(struct net_device *dev,
522 struct iw_freq *wrq, 522 struct iw_freq *wrq,
523 char *extra) 523 char *extra)
524{ 524{
525 PSDevice pDevice = (PSDevice)dev->priv; 525 PSDevice pDevice = (PSDevice)netdev_priv(dev);
526 int rc = 0; 526 int rc = 0;
527 527
528 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFREQ \n"); 528 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFREQ \n");
@@ -568,7 +568,7 @@ int iwctl_giwfreq(struct net_device *dev,
568 struct iw_freq *wrq, 568 struct iw_freq *wrq,
569 char *extra) 569 char *extra)
570{ 570{
571 PSDevice pDevice = (PSDevice)dev->priv; 571 PSDevice pDevice = (PSDevice)netdev_priv(dev);
572 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 572 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
573 573
574 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFREQ \n"); 574 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFREQ \n");
@@ -598,7 +598,7 @@ int iwctl_siwmode(struct net_device *dev,
598 __u32 *wmode, 598 __u32 *wmode,
599 char *extra) 599 char *extra)
600{ 600{
601 PSDevice pDevice = (PSDevice)dev->priv; 601 PSDevice pDevice = (PSDevice)netdev_priv(dev);
602 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 602 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
603 int rc = 0; 603 int rc = 0;
604 604
@@ -665,7 +665,7 @@ int iwctl_giwmode(struct net_device *dev,
665 __u32 *wmode, 665 __u32 *wmode,
666 char *extra) 666 char *extra)
667{ 667{
668 PSDevice pDevice = (PSDevice)dev->priv; 668 PSDevice pDevice = (PSDevice)netdev_priv(dev);
669 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 669 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
670 670
671 671
@@ -819,7 +819,7 @@ int iwctl_siwap(struct net_device *dev,
819 struct sockaddr *wrq, 819 struct sockaddr *wrq,
820 char *extra) 820 char *extra)
821{ 821{
822 PSDevice pDevice = (PSDevice)dev->priv; 822 PSDevice pDevice = (PSDevice)netdev_priv(dev);
823 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 823 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
824 int rc = 0; 824 int rc = 0;
825 BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; 825 BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
@@ -877,7 +877,7 @@ int iwctl_giwap(struct net_device *dev,
877 struct sockaddr *wrq, 877 struct sockaddr *wrq,
878 char *extra) 878 char *extra)
879{ 879{
880 PSDevice pDevice = (PSDevice)dev->priv; 880 PSDevice pDevice = (PSDevice)netdev_priv(dev);
881 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 881 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
882 882
883 883
@@ -911,7 +911,7 @@ int iwctl_giwaplist(struct net_device *dev,
911 int ii,jj, rc = 0; 911 int ii,jj, rc = 0;
912 struct sockaddr sock[IW_MAX_AP]; 912 struct sockaddr sock[IW_MAX_AP];
913 struct iw_quality qual[IW_MAX_AP]; 913 struct iw_quality qual[IW_MAX_AP];
914 PSDevice pDevice = (PSDevice)dev->priv; 914 PSDevice pDevice = (PSDevice)netdev_priv(dev);
915 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 915 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
916 916
917 917
@@ -960,7 +960,7 @@ int iwctl_siwessid(struct net_device *dev,
960 struct iw_point *wrq, 960 struct iw_point *wrq,
961 char *extra) 961 char *extra)
962{ 962{
963 PSDevice pDevice = (PSDevice)dev->priv; 963 PSDevice pDevice = (PSDevice)netdev_priv(dev);
964 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 964 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
965 PWLAN_IE_SSID pItemSSID; 965 PWLAN_IE_SSID pItemSSID;
966 //2008-0409-05, <Add> by Einsn Liu 966 //2008-0409-05, <Add> by Einsn Liu
@@ -1089,7 +1089,7 @@ int iwctl_giwessid(struct net_device *dev,
1089 char *extra) 1089 char *extra)
1090{ 1090{
1091 1091
1092 PSDevice pDevice = (PSDevice)dev->priv; 1092 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1093 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1093 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1094 PWLAN_IE_SSID pItemSSID; 1094 PWLAN_IE_SSID pItemSSID;
1095 1095
@@ -1125,7 +1125,7 @@ int iwctl_siwrate(struct net_device *dev,
1125 struct iw_param *wrq, 1125 struct iw_param *wrq,
1126 char *extra) 1126 char *extra)
1127{ 1127{
1128 PSDevice pDevice = (PSDevice)dev->priv; 1128 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1129 int rc = 0; 1129 int rc = 0;
1130 u8 brate = 0; 1130 u8 brate = 0;
1131 int i; 1131 int i;
@@ -1210,7 +1210,7 @@ int iwctl_giwrate(struct net_device *dev,
1210 struct iw_param *wrq, 1210 struct iw_param *wrq,
1211 char *extra) 1211 char *extra)
1212{ 1212{
1213 PSDevice pDevice = (PSDevice)dev->priv; 1213 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1214//2007-0118-05,<Mark> by EinsnLiu 1214//2007-0118-05,<Mark> by EinsnLiu
1215//Mark the unnecessary sentences. 1215//Mark the unnecessary sentences.
1216// PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1216// PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@@ -1276,7 +1276,7 @@ int iwctl_siwrts(struct net_device *dev,
1276 struct iw_param *wrq, 1276 struct iw_param *wrq,
1277 char *extra) 1277 char *extra)
1278{ 1278{
1279 PSDevice pDevice = (PSDevice)dev->priv; 1279 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1280 int rc = 0; 1280 int rc = 0;
1281 1281
1282 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRTS \n"); 1282 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRTS \n");
@@ -1304,7 +1304,7 @@ int iwctl_giwrts(struct net_device *dev,
1304 struct iw_param *wrq, 1304 struct iw_param *wrq,
1305 char *extra) 1305 char *extra)
1306{ 1306{
1307 PSDevice pDevice = (PSDevice)dev->priv; 1307 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1308 1308
1309 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRTS \n"); 1309 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRTS \n");
1310 wrq->value = pDevice->wRTSThreshold; 1310 wrq->value = pDevice->wRTSThreshold;
@@ -1323,7 +1323,7 @@ int iwctl_siwfrag(struct net_device *dev,
1323 struct iw_param *wrq, 1323 struct iw_param *wrq,
1324 char *extra) 1324 char *extra)
1325{ 1325{
1326 PSDevice pDevice = (PSDevice)dev->priv; 1326 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1327 int rc = 0; 1327 int rc = 0;
1328 int fthr = wrq->value; 1328 int fthr = wrq->value;
1329 1329
@@ -1352,7 +1352,7 @@ int iwctl_giwfrag(struct net_device *dev,
1352 struct iw_param *wrq, 1352 struct iw_param *wrq,
1353 char *extra) 1353 char *extra)
1354{ 1354{
1355 PSDevice pDevice = (PSDevice)dev->priv; 1355 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1356 1356
1357 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFRAG \n"); 1357 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFRAG \n");
1358 wrq->value = pDevice->wFragmentationThreshold; 1358 wrq->value = pDevice->wFragmentationThreshold;
@@ -1372,7 +1372,7 @@ int iwctl_siwretry(struct net_device *dev,
1372 struct iw_param *wrq, 1372 struct iw_param *wrq,
1373 char *extra) 1373 char *extra)
1374{ 1374{
1375 PSDevice pDevice = (PSDevice)dev->priv; 1375 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1376 int rc = 0; 1376 int rc = 0;
1377 1377
1378 1378
@@ -1410,7 +1410,7 @@ int iwctl_giwretry(struct net_device *dev,
1410 struct iw_param *wrq, 1410 struct iw_param *wrq,
1411 char *extra) 1411 char *extra)
1412{ 1412{
1413 PSDevice pDevice = (PSDevice)dev->priv; 1413 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1414 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRETRY \n"); 1414 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRETRY \n");
1415 wrq->disabled = 0; // Can't be disabled 1415 wrq->disabled = 0; // Can't be disabled
1416 1416
@@ -1441,7 +1441,7 @@ int iwctl_siwencode(struct net_device *dev,
1441 struct iw_point *wrq, 1441 struct iw_point *wrq,
1442 char *extra) 1442 char *extra)
1443{ 1443{
1444 PSDevice pDevice = (PSDevice)dev->priv; 1444 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1445 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1445 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1446 DWORD dwKeyIndex = (DWORD)(wrq->flags & IW_ENCODE_INDEX); 1446 DWORD dwKeyIndex = (DWORD)(wrq->flags & IW_ENCODE_INDEX);
1447 int ii,uu, rc = 0; 1447 int ii,uu, rc = 0;
@@ -1660,7 +1660,7 @@ int iwctl_giwencode(struct net_device *dev,
1660 struct iw_point *wrq, 1660 struct iw_point *wrq,
1661 char *extra) 1661 char *extra)
1662{ 1662{
1663 PSDevice pDevice = (PSDevice)dev->priv; 1663 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1664 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1664 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1665 int rc = 0; 1665 int rc = 0;
1666 char abyKey[WLAN_WEP232_KEYLEN]; 1666 char abyKey[WLAN_WEP232_KEYLEN];
@@ -1729,7 +1729,7 @@ int iwctl_giwencode(struct net_device *dev,
1729 struct iw_point *wrq, 1729 struct iw_point *wrq,
1730 char *extra) 1730 char *extra)
1731{ 1731{
1732 PSDevice pDevice = (PSDevice)dev->priv; 1732 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1733 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1733 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1734 char abyKey[WLAN_WEP232_KEYLEN]; 1734 char abyKey[WLAN_WEP232_KEYLEN];
1735 1735
@@ -1790,7 +1790,7 @@ int iwctl_siwpower(struct net_device *dev,
1790 struct iw_param *wrq, 1790 struct iw_param *wrq,
1791 char *extra) 1791 char *extra)
1792{ 1792{
1793 PSDevice pDevice = (PSDevice)dev->priv; 1793 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1794 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1794 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1795 int rc = 0; 1795 int rc = 0;
1796 1796
@@ -1840,7 +1840,7 @@ int iwctl_giwpower(struct net_device *dev,
1840 struct iw_param *wrq, 1840 struct iw_param *wrq,
1841 char *extra) 1841 char *extra)
1842{ 1842{
1843 PSDevice pDevice = (PSDevice)dev->priv; 1843 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1844 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1844 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1845 int mode = pDevice->ePSMode; 1845 int mode = pDevice->ePSMode;
1846 1846
@@ -1872,7 +1872,7 @@ int iwctl_giwsens(struct net_device *dev,
1872 struct iw_param *wrq, 1872 struct iw_param *wrq,
1873 char *extra) 1873 char *extra)
1874{ 1874{
1875 PSDevice pDevice = (PSDevice)dev->priv; 1875 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1876 long ldBm; 1876 long ldBm;
1877 1877
1878 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS \n"); 1878 DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS \n");
@@ -1898,7 +1898,7 @@ int iwctl_siwauth(struct net_device *dev,
1898 struct iw_param *wrq, 1898 struct iw_param *wrq,
1899 char *extra) 1899 char *extra)
1900{ 1900{
1901 PSDevice pDevice = (PSDevice)dev->priv; 1901 PSDevice pDevice = (PSDevice)netdev_priv(dev);
1902 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 1902 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
1903 int ret=0; 1903 int ret=0;
1904 static int wpa_version=0; //must be static to save the last value,einsn liu 1904 static int wpa_version=0; //must be static to save the last value,einsn liu
@@ -2023,7 +2023,7 @@ int iwctl_siwgenie(struct net_device *dev,
2023 struct iw_point *wrq, 2023 struct iw_point *wrq,
2024 char *extra) 2024 char *extra)
2025{ 2025{
2026 PSDevice pDevice = (PSDevice)dev->priv; 2026 PSDevice pDevice = (PSDevice)netdev_priv(dev);
2027 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 2027 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
2028 int ret=0; 2028 int ret=0;
2029 2029
@@ -2056,7 +2056,7 @@ int iwctl_giwgenie(struct net_device *dev,
2056 struct iw_point *wrq, 2056 struct iw_point *wrq,
2057 char *extra) 2057 char *extra)
2058{ 2058{
2059 PSDevice pDevice = (PSDevice)dev->priv; 2059 PSDevice pDevice = (PSDevice)netdev_priv(dev);
2060 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 2060 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
2061 int ret=0; 2061 int ret=0;
2062 int space = wrq->length; 2062 int space = wrq->length;
@@ -2081,7 +2081,7 @@ int iwctl_siwencodeext(struct net_device *dev,
2081 struct iw_point *wrq, 2081 struct iw_point *wrq,
2082 char *extra) 2082 char *extra)
2083{ 2083{
2084 PSDevice pDevice = (PSDevice)dev->priv; 2084 PSDevice pDevice = (PSDevice)netdev_priv(dev);
2085 struct iw_encode_ext *ext = (struct iw_encode_ext*)extra; 2085 struct iw_encode_ext *ext = (struct iw_encode_ext*)extra;
2086 struct viawget_wpa_param *param=NULL; 2086 struct viawget_wpa_param *param=NULL;
2087//original member 2087//original member
@@ -2232,7 +2232,7 @@ int iwctl_siwmlme(struct net_device *dev,
2232 struct iw_point *wrq, 2232 struct iw_point *wrq,
2233 char *extra) 2233 char *extra)
2234{ 2234{
2235 PSDevice pDevice = (PSDevice)dev->priv; 2235 PSDevice pDevice = (PSDevice)netdev_priv(dev);
2236 PSMgmtObject pMgmt = &(pDevice->sMgmtObj); 2236 PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
2237 struct iw_mlme *mlme = (struct iw_mlme *)extra; 2237 struct iw_mlme *mlme = (struct iw_mlme *)extra;
2238 //u16 reason = cpu_to_le16(mlme->reason_code); 2238 //u16 reason = cpu_to_le16(mlme->reason_code);
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index ee7109d1b8ec..cc4f0adb963e 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -112,14 +112,17 @@ static void wpadev_setup(struct net_device *dev)
112 112
113static int wpa_init_wpadev(PSDevice pDevice) 113static int wpa_init_wpadev(PSDevice pDevice)
114{ 114{
115 PSDevice wpadev_priv;
115 struct net_device *dev = pDevice->dev; 116 struct net_device *dev = pDevice->dev;
116 int ret=0; 117 int ret=0;
117 118
118 pDevice->wpadev = alloc_netdev(0, "vntwpa", wpadev_setup); 119 pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup);
119 if (pDevice->wpadev == NULL) 120 if (pDevice->wpadev == NULL)
120 return -ENOMEM; 121 return -ENOMEM;
121 122
122 pDevice->wpadev->priv = pDevice; 123 wpadev_priv = netdev_priv(pDevice->wpadev);
124 *wpadev_priv = *pDevice;
125
123 memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, U_ETHER_ADDR_LEN); 126 memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, U_ETHER_ADDR_LEN);
124 pDevice->wpadev->base_addr = dev->base_addr; 127 pDevice->wpadev->base_addr = dev->base_addr;
125 pDevice->wpadev->irq = dev->irq; 128 pDevice->wpadev->irq = dev->irq;