aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-01-05 18:33:10 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 16:52:35 -0500
commit1242c70df56978e8abbf715a02fb1c55313f8471 (patch)
treee637dbef6b5cc3dac45b9e5e28737c2cae7ee0c8
parent5a501b3011095c9afb396cdade5be8db359df977 (diff)
Staging: rt2870: fix up netdev->priv usage
Now that netdev->priv is removed, fix the driver to use netdev->ml_priv like it always should have been doing. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/rt2870/common/2870_rtmp_init.c2
-rw-r--r--drivers/staging/rt2870/rt_main_dev.c34
-rw-r--r--drivers/staging/rt2870/sta_ioctl.c146
3 files changed, 91 insertions, 91 deletions
diff --git a/drivers/staging/rt2870/common/2870_rtmp_init.c b/drivers/staging/rt2870/common/2870_rtmp_init.c
index 359c1820e6d5..5d89a310d1ea 100644
--- a/drivers/staging/rt2870/common/2870_rtmp_init.c
+++ b/drivers/staging/rt2870/common/2870_rtmp_init.c
@@ -763,7 +763,7 @@ Note:
763NDIS_STATUS CreateThreads( 763NDIS_STATUS CreateThreads(
764 IN struct net_device *net_dev) 764 IN struct net_device *net_dev)
765{ 765{
766 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; 766 PRTMP_ADAPTER pAd = net_dev->ml_priv;
767 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; 767 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
768 pid_t pid_number = -1; 768 pid_t pid_number = -1;
769 769
diff --git a/drivers/staging/rt2870/rt_main_dev.c b/drivers/staging/rt2870/rt_main_dev.c
index 16cace7b4c14..b990f8a61641 100644
--- a/drivers/staging/rt2870/rt_main_dev.c
+++ b/drivers/staging/rt2870/rt_main_dev.c
@@ -125,7 +125,7 @@ Note:
125*/ 125*/
126int MainVirtualIF_close(IN struct net_device *net_dev) 126int MainVirtualIF_close(IN struct net_device *net_dev)
127{ 127{
128 RTMP_ADAPTER *pAd = net_dev->priv; 128 RTMP_ADAPTER *pAd = net_dev->ml_priv;
129 129
130 // Sanity check for pAd 130 // Sanity check for pAd
131 if (pAd == NULL) 131 if (pAd == NULL)
@@ -165,7 +165,7 @@ Note:
165*/ 165*/
166int MainVirtualIF_open(IN struct net_device *net_dev) 166int MainVirtualIF_open(IN struct net_device *net_dev)
167{ 167{
168 RTMP_ADAPTER *pAd = net_dev->priv; 168 RTMP_ADAPTER *pAd = net_dev->ml_priv;
169 169
170 // Sanity check for pAd 170 // Sanity check for pAd
171 if (pAd == NULL) 171 if (pAd == NULL)
@@ -207,7 +207,7 @@ Note:
207int rt28xx_close(IN PNET_DEV dev) 207int rt28xx_close(IN PNET_DEV dev)
208{ 208{
209 struct net_device * net_dev = (struct net_device *)dev; 209 struct net_device * net_dev = (struct net_device *)dev;
210 RTMP_ADAPTER *pAd = net_dev->priv; 210 RTMP_ADAPTER *pAd = net_dev->ml_priv;
211 BOOLEAN Cancelled = FALSE; 211 BOOLEAN Cancelled = FALSE;
212 UINT32 i = 0; 212 UINT32 i = 0;
213#ifdef RT2870 213#ifdef RT2870
@@ -416,7 +416,7 @@ int rt28xx_close(IN PNET_DEV dev)
416 416
417static int rt28xx_init(IN struct net_device *net_dev) 417static int rt28xx_init(IN struct net_device *net_dev)
418{ 418{
419 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->priv; 419 PRTMP_ADAPTER pAd = net_dev->ml_priv;
420 UINT index; 420 UINT index;
421 UCHAR TmpPhy; 421 UCHAR TmpPhy;
422 NDIS_STATUS Status; 422 NDIS_STATUS Status;
@@ -688,8 +688,8 @@ err1:
688#endif // DOT11_N_SUPPORT // 688#endif // DOT11_N_SUPPORT //
689 RT28XX_IRQ_RELEASE(net_dev); 689 RT28XX_IRQ_RELEASE(net_dev);
690 690
691 // shall not set priv to NULL here because the priv didn't been free yet. 691 // shall not set ml_priv to NULL here because the ml_priv didn't been free yet.
692 //net_dev->priv = 0; 692 //net_dev->ml_priv = 0;
693#ifdef INF_AMAZON_SE 693#ifdef INF_AMAZON_SE
694err0: 694err0:
695#endif // INF_AMAZON_SE // 695#endif // INF_AMAZON_SE //
@@ -716,7 +716,7 @@ Note:
716int rt28xx_open(IN PNET_DEV dev) 716int rt28xx_open(IN PNET_DEV dev)
717{ 717{
718 struct net_device * net_dev = (struct net_device *)dev; 718 struct net_device * net_dev = (struct net_device *)dev;
719 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->priv; 719 PRTMP_ADAPTER pAd = net_dev->ml_priv;
720 int retval = 0; 720 int retval = 0;
721 POS_COOKIE pObj; 721 POS_COOKIE pObj;
722 722
@@ -725,7 +725,7 @@ int rt28xx_open(IN PNET_DEV dev)
725 if (pAd == NULL) 725 if (pAd == NULL)
726 { 726 {
727 /* if 1st open fail, pAd will be free; 727 /* if 1st open fail, pAd will be free;
728 So the net_dev->priv will be NULL in 2rd open */ 728 So the net_dev->ml_priv will be NULL in 2rd open */
729 return -1; 729 return -1;
730 } 730 }
731 731
@@ -1416,7 +1416,7 @@ INT __devinit rt28xx_probe(
1416 if (status != NDIS_STATUS_SUCCESS) 1416 if (status != NDIS_STATUS_SUCCESS)
1417 goto err_out_free_netdev; 1417 goto err_out_free_netdev;
1418 1418
1419 net_dev->priv = (PVOID)pAd; 1419 net_dev->ml_priv = (PVOID)pAd;
1420 pAd->net_dev = net_dev; // must be before RT28XXNetDevInit() 1420 pAd->net_dev = net_dev; // must be before RT28XXNetDevInit()
1421 1421
1422 RT28XXNetDevInit(_dev_p, net_dev, pAd); 1422 RT28XXNetDevInit(_dev_p, net_dev, pAd);
@@ -1517,7 +1517,7 @@ Note:
1517int rt28xx_packet_xmit(struct sk_buff *skb) 1517int rt28xx_packet_xmit(struct sk_buff *skb)
1518{ 1518{
1519 struct net_device *net_dev = skb->dev; 1519 struct net_device *net_dev = skb->dev;
1520 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; 1520 PRTMP_ADAPTER pAd = net_dev->ml_priv;
1521 int status = 0; 1521 int status = 0;
1522 PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; 1522 PNDIS_PACKET pPacket = (PNDIS_PACKET) skb;
1523 1523
@@ -1605,7 +1605,7 @@ INT rt28xx_send_packets(
1605 IN struct sk_buff *skb_p, 1605 IN struct sk_buff *skb_p,
1606 IN struct net_device *net_dev) 1606 IN struct net_device *net_dev)
1607{ 1607{
1608 RTMP_ADAPTER *pAd = net_dev->priv; 1608 RTMP_ADAPTER *pAd = net_dev->ml_priv;
1609 1609
1610 if (!(net_dev->flags & IFF_UP)) 1610 if (!(net_dev->flags & IFF_UP))
1611 { 1611 {
@@ -1717,7 +1717,7 @@ static BOOLEAN RT28XXAvailRANameAssign(
1717struct iw_statistics *rt28xx_get_wireless_stats( 1717struct iw_statistics *rt28xx_get_wireless_stats(
1718 IN struct net_device *net_dev) 1718 IN struct net_device *net_dev)
1719{ 1719{
1720 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; 1720 PRTMP_ADAPTER pAd = net_dev->ml_priv;
1721 1721
1722 1722
1723 DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n")); 1723 DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n"));
@@ -1769,18 +1769,18 @@ INT rt28xx_ioctl(
1769 1769
1770 if (net_dev->priv_flags == INT_MAIN) 1770 if (net_dev->priv_flags == INT_MAIN)
1771 { 1771 {
1772 pAd = net_dev->priv; 1772 pAd = net_dev->ml_priv;
1773 } 1773 }
1774 else 1774 else
1775 { 1775 {
1776 pVirtualAd = net_dev->priv; 1776 pVirtualAd = net_dev->ml_priv;
1777 pAd = pVirtualAd->RtmpDev->priv; 1777 pAd = pVirtualAd->RtmpDev->ml_priv;
1778 } 1778 }
1779 1779
1780 if (pAd == NULL) 1780 if (pAd == NULL)
1781 { 1781 {
1782 /* if 1st open fail, pAd will be free; 1782 /* if 1st open fail, pAd will be free;
1783 So the net_dev->priv will be NULL in 2rd open */ 1783 So the net_dev->ml_priv will be NULL in 2rd open */
1784 return -ENETDOWN; 1784 return -ENETDOWN;
1785 } 1785 }
1786 1786
@@ -1817,7 +1817,7 @@ struct net_device_stats *RT28xx_get_ether_stats(
1817 RTMP_ADAPTER *pAd = NULL; 1817 RTMP_ADAPTER *pAd = NULL;
1818 1818
1819 if (net_dev) 1819 if (net_dev)
1820 pAd = net_dev->priv; 1820 pAd = net_dev->ml_priv;
1821 1821
1822 if (pAd) 1822 if (pAd)
1823 { 1823 {
diff --git a/drivers/staging/rt2870/sta_ioctl.c b/drivers/staging/rt2870/sta_ioctl.c
index bb386ab64c10..422f39f9004a 100644
--- a/drivers/staging/rt2870/sta_ioctl.c
+++ b/drivers/staging/rt2870/sta_ioctl.c
@@ -580,7 +580,7 @@ rt_ioctl_giwname(struct net_device *dev,
580 struct iw_request_info *info, 580 struct iw_request_info *info,
581 char *name, char *extra) 581 char *name, char *extra)
582{ 582{
583// PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 583// PRTMP_ADAPTER pAdapter = dev->ml_priv;
584 584
585#ifdef RT2870 585#ifdef RT2870
586 strncpy(name, "RT2870 Wireless", IFNAMSIZ); 586 strncpy(name, "RT2870 Wireless", IFNAMSIZ);
@@ -592,7 +592,7 @@ int rt_ioctl_siwfreq(struct net_device *dev,
592 struct iw_request_info *info, 592 struct iw_request_info *info,
593 struct iw_freq *freq, char *extra) 593 struct iw_freq *freq, char *extra)
594{ 594{
595 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 595 PRTMP_ADAPTER pAdapter = dev->ml_priv;
596 int chan = -1; 596 int chan = -1;
597 597
598 //check if the interface is down 598 //check if the interface is down
@@ -632,19 +632,19 @@ int rt_ioctl_giwfreq(struct net_device *dev,
632 632
633 if (dev->priv_flags == INT_MAIN) 633 if (dev->priv_flags == INT_MAIN)
634 { 634 {
635 pAdapter = dev->priv; 635 pAdapter = dev->ml_priv;
636 } 636 }
637 else 637 else
638 { 638 {
639 pVirtualAd = dev->priv; 639 pVirtualAd = dev->ml_priv;
640 if (pVirtualAd && pVirtualAd->RtmpDev) 640 if (pVirtualAd && pVirtualAd->RtmpDev)
641 pAdapter = pVirtualAd->RtmpDev->priv; 641 pAdapter = pVirtualAd->RtmpDev->ml_priv;
642 } 642 }
643 643
644 if (pAdapter == NULL) 644 if (pAdapter == NULL)
645 { 645 {
646 /* if 1st open fail, pAd will be free; 646 /* if 1st open fail, pAd will be free;
647 So the net_dev->priv will be NULL in 2rd open */ 647 So the net_dev->ml_priv will be NULL in 2rd open */
648 return -ENETDOWN; 648 return -ENETDOWN;
649 } 649 }
650 650
@@ -662,7 +662,7 @@ int rt_ioctl_siwmode(struct net_device *dev,
662 struct iw_request_info *info, 662 struct iw_request_info *info,
663 __u32 *mode, char *extra) 663 __u32 *mode, char *extra)
664{ 664{
665 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 665 PRTMP_ADAPTER pAdapter = dev->ml_priv;
666 666
667 //check if the interface is down 667 //check if the interface is down
668 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) 668 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -704,19 +704,19 @@ int rt_ioctl_giwmode(struct net_device *dev,
704 704
705 if (dev->priv_flags == INT_MAIN) 705 if (dev->priv_flags == INT_MAIN)
706 { 706 {
707 pAdapter = dev->priv; 707 pAdapter = dev->ml_priv;
708 } 708 }
709 else 709 else
710 { 710 {
711 pVirtualAd = dev->priv; 711 pVirtualAd = dev->ml_priv;
712 if (pVirtualAd && pVirtualAd->RtmpDev) 712 if (pVirtualAd && pVirtualAd->RtmpDev)
713 pAdapter = pVirtualAd->RtmpDev->priv; 713 pAdapter = pVirtualAd->RtmpDev->ml_priv;
714 } 714 }
715 715
716 if (pAdapter == NULL) 716 if (pAdapter == NULL)
717 { 717 {
718 /* if 1st open fail, pAd will be free; 718 /* if 1st open fail, pAd will be free;
719 So the net_dev->priv will be NULL in 2rd open */ 719 So the net_dev->ml_priv will be NULL in 2rd open */
720 return -ENETDOWN; 720 return -ENETDOWN;
721 } 721 }
722 722
@@ -741,7 +741,7 @@ int rt_ioctl_siwsens(struct net_device *dev,
741 struct iw_request_info *info, 741 struct iw_request_info *info,
742 char *name, char *extra) 742 char *name, char *extra)
743{ 743{
744 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 744 PRTMP_ADAPTER pAdapter = dev->ml_priv;
745 745
746 //check if the interface is down 746 //check if the interface is down
747 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) 747 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -772,19 +772,19 @@ int rt_ioctl_giwrange(struct net_device *dev,
772 772
773 if (dev->priv_flags == INT_MAIN) 773 if (dev->priv_flags == INT_MAIN)
774 { 774 {
775 pAdapter = dev->priv; 775 pAdapter = dev->ml_priv;
776 } 776 }
777 else 777 else
778 { 778 {
779 pVirtualAd = dev->priv; 779 pVirtualAd = dev->ml_priv;
780 if (pVirtualAd && pVirtualAd->RtmpDev) 780 if (pVirtualAd && pVirtualAd->RtmpDev)
781 pAdapter = pVirtualAd->RtmpDev->priv; 781 pAdapter = pVirtualAd->RtmpDev->ml_priv;
782 } 782 }
783 783
784 if (pAdapter == NULL) 784 if (pAdapter == NULL)
785 { 785 {
786 /* if 1st open fail, pAd will be free; 786 /* if 1st open fail, pAd will be free;
787 So the net_dev->priv will be NULL in 2rd open */ 787 So the net_dev->ml_priv will be NULL in 2rd open */
788 return -ENETDOWN; 788 return -ENETDOWN;
789 } 789 }
790 790
@@ -866,7 +866,7 @@ int rt_ioctl_siwap(struct net_device *dev,
866 struct iw_request_info *info, 866 struct iw_request_info *info,
867 struct sockaddr *ap_addr, char *extra) 867 struct sockaddr *ap_addr, char *extra)
868{ 868{
869 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 869 PRTMP_ADAPTER pAdapter = dev->ml_priv;
870 NDIS_802_11_MAC_ADDRESS Bssid; 870 NDIS_802_11_MAC_ADDRESS Bssid;
871 871
872 //check if the interface is down 872 //check if the interface is down
@@ -911,19 +911,19 @@ int rt_ioctl_giwap(struct net_device *dev,
911 911
912 if (dev->priv_flags == INT_MAIN) 912 if (dev->priv_flags == INT_MAIN)
913 { 913 {
914 pAdapter = dev->priv; 914 pAdapter = dev->ml_priv;
915 } 915 }
916 else 916 else
917 { 917 {
918 pVirtualAd = dev->priv; 918 pVirtualAd = dev->ml_priv;
919 if (pVirtualAd && pVirtualAd->RtmpDev) 919 if (pVirtualAd && pVirtualAd->RtmpDev)
920 pAdapter = pVirtualAd->RtmpDev->priv; 920 pAdapter = pVirtualAd->RtmpDev->ml_priv;
921 } 921 }
922 922
923 if (pAdapter == NULL) 923 if (pAdapter == NULL)
924 { 924 {
925 /* if 1st open fail, pAd will be free; 925 /* if 1st open fail, pAd will be free;
926 So the net_dev->priv will be NULL in 2rd open */ 926 So the net_dev->ml_priv will be NULL in 2rd open */
927 return -ENETDOWN; 927 return -ENETDOWN;
928 } 928 }
929 929
@@ -993,7 +993,7 @@ int rt_ioctl_iwaplist(struct net_device *dev,
993 struct iw_request_info *info, 993 struct iw_request_info *info,
994 struct iw_point *data, char *extra) 994 struct iw_point *data, char *extra)
995{ 995{
996 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 996 PRTMP_ADAPTER pAdapter = dev->ml_priv;
997 997
998 struct sockaddr addr[IW_MAX_AP]; 998 struct sockaddr addr[IW_MAX_AP];
999 struct iw_quality qual[IW_MAX_AP]; 999 struct iw_quality qual[IW_MAX_AP];
@@ -1029,7 +1029,7 @@ int rt_ioctl_siwscan(struct net_device *dev,
1029 struct iw_request_info *info, 1029 struct iw_request_info *info,
1030 struct iw_point *data, char *extra) 1030 struct iw_point *data, char *extra)
1031{ 1031{
1032 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1032 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1033 1033
1034 ULONG Now; 1034 ULONG Now;
1035 int Status = NDIS_STATUS_SUCCESS; 1035 int Status = NDIS_STATUS_SUCCESS;
@@ -1111,7 +1111,7 @@ int rt_ioctl_giwscan(struct net_device *dev,
1111 struct iw_point *data, char *extra) 1111 struct iw_point *data, char *extra)
1112{ 1112{
1113 1113
1114 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1114 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1115 int i=0; 1115 int i=0;
1116 char *current_ev = extra, *previous_ev = extra; 1116 char *current_ev = extra, *previous_ev = extra;
1117 char *end_buf; 1117 char *end_buf;
@@ -1400,7 +1400,7 @@ int rt_ioctl_siwessid(struct net_device *dev,
1400 struct iw_request_info *info, 1400 struct iw_request_info *info,
1401 struct iw_point *data, char *essid) 1401 struct iw_point *data, char *essid)
1402{ 1402{
1403 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1403 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1404 1404
1405 //check if the interface is down 1405 //check if the interface is down
1406 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) 1406 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1446,19 +1446,19 @@ int rt_ioctl_giwessid(struct net_device *dev,
1446 1446
1447 if (dev->priv_flags == INT_MAIN) 1447 if (dev->priv_flags == INT_MAIN)
1448 { 1448 {
1449 pAdapter = dev->priv; 1449 pAdapter = dev->ml_priv;
1450 } 1450 }
1451 else 1451 else
1452 { 1452 {
1453 pVirtualAd = dev->priv; 1453 pVirtualAd = dev->ml_priv;
1454 if (pVirtualAd && pVirtualAd->RtmpDev) 1454 if (pVirtualAd && pVirtualAd->RtmpDev)
1455 pAdapter = pVirtualAd->RtmpDev->priv; 1455 pAdapter = pVirtualAd->RtmpDev->ml_priv;
1456 } 1456 }
1457 1457
1458 if (pAdapter == NULL) 1458 if (pAdapter == NULL)
1459 { 1459 {
1460 /* if 1st open fail, pAd will be free; 1460 /* if 1st open fail, pAd will be free;
1461 So the net_dev->priv will be NULL in 2rd open */ 1461 So the net_dev->ml_priv will be NULL in 2rd open */
1462 return -ENETDOWN; 1462 return -ENETDOWN;
1463 } 1463 }
1464 1464
@@ -1499,7 +1499,7 @@ int rt_ioctl_siwnickn(struct net_device *dev,
1499 struct iw_request_info *info, 1499 struct iw_request_info *info,
1500 struct iw_point *data, char *nickname) 1500 struct iw_point *data, char *nickname)
1501{ 1501{
1502 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1502 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1503 1503
1504 //check if the interface is down 1504 //check if the interface is down
1505 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) 1505 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1527,19 +1527,19 @@ int rt_ioctl_giwnickn(struct net_device *dev,
1527 1527
1528 if (dev->priv_flags == INT_MAIN) 1528 if (dev->priv_flags == INT_MAIN)
1529 { 1529 {
1530 pAdapter = dev->priv; 1530 pAdapter = dev->ml_priv;
1531 } 1531 }
1532 else 1532 else
1533 { 1533 {
1534 pVirtualAd = dev->priv; 1534 pVirtualAd = dev->ml_priv;
1535 if (pVirtualAd && pVirtualAd->RtmpDev) 1535 if (pVirtualAd && pVirtualAd->RtmpDev)
1536 pAdapter = pVirtualAd->RtmpDev->priv; 1536 pAdapter = pVirtualAd->RtmpDev->ml_priv;
1537 } 1537 }
1538 1538
1539 if (pAdapter == NULL) 1539 if (pAdapter == NULL)
1540 { 1540 {
1541 /* if 1st open fail, pAd will be free; 1541 /* if 1st open fail, pAd will be free;
1542 So the net_dev->priv will be NULL in 2rd open */ 1542 So the net_dev->ml_priv will be NULL in 2rd open */
1543 return -ENETDOWN; 1543 return -ENETDOWN;
1544 } 1544 }
1545 1545
@@ -1556,7 +1556,7 @@ int rt_ioctl_siwrts(struct net_device *dev,
1556 struct iw_request_info *info, 1556 struct iw_request_info *info,
1557 struct iw_param *rts, char *extra) 1557 struct iw_param *rts, char *extra)
1558{ 1558{
1559 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1559 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1560 u16 val; 1560 u16 val;
1561 1561
1562 //check if the interface is down 1562 //check if the interface is down
@@ -1590,19 +1590,19 @@ int rt_ioctl_giwrts(struct net_device *dev,
1590 1590
1591 if (dev->priv_flags == INT_MAIN) 1591 if (dev->priv_flags == INT_MAIN)
1592 { 1592 {
1593 pAdapter = dev->priv; 1593 pAdapter = dev->ml_priv;
1594 } 1594 }
1595 else 1595 else
1596 { 1596 {
1597 pVirtualAd = dev->priv; 1597 pVirtualAd = dev->ml_priv;
1598 if (pVirtualAd && pVirtualAd->RtmpDev) 1598 if (pVirtualAd && pVirtualAd->RtmpDev)
1599 pAdapter = pVirtualAd->RtmpDev->priv; 1599 pAdapter = pVirtualAd->RtmpDev->ml_priv;
1600 } 1600 }
1601 1601
1602 if (pAdapter == NULL) 1602 if (pAdapter == NULL)
1603 { 1603 {
1604 /* if 1st open fail, pAd will be free; 1604 /* if 1st open fail, pAd will be free;
1605 So the net_dev->priv will be NULL in 2rd open */ 1605 So the net_dev->ml_priv will be NULL in 2rd open */
1606 return -ENETDOWN; 1606 return -ENETDOWN;
1607 } 1607 }
1608 1608
@@ -1624,7 +1624,7 @@ int rt_ioctl_siwfrag(struct net_device *dev,
1624 struct iw_request_info *info, 1624 struct iw_request_info *info,
1625 struct iw_param *frag, char *extra) 1625 struct iw_param *frag, char *extra)
1626{ 1626{
1627 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1627 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1628 u16 val; 1628 u16 val;
1629 1629
1630 //check if the interface is down 1630 //check if the interface is down
@@ -1656,19 +1656,19 @@ int rt_ioctl_giwfrag(struct net_device *dev,
1656 1656
1657 if (dev->priv_flags == INT_MAIN) 1657 if (dev->priv_flags == INT_MAIN)
1658 { 1658 {
1659 pAdapter = dev->priv; 1659 pAdapter = dev->ml_priv;
1660 } 1660 }
1661 else 1661 else
1662 { 1662 {
1663 pVirtualAd = dev->priv; 1663 pVirtualAd = dev->ml_priv;
1664 if (pVirtualAd && pVirtualAd->RtmpDev) 1664 if (pVirtualAd && pVirtualAd->RtmpDev)
1665 pAdapter = pVirtualAd->RtmpDev->priv; 1665 pAdapter = pVirtualAd->RtmpDev->ml_priv;
1666 } 1666 }
1667 1667
1668 if (pAdapter == NULL) 1668 if (pAdapter == NULL)
1669 { 1669 {
1670 /* if 1st open fail, pAd will be free; 1670 /* if 1st open fail, pAd will be free;
1671 So the net_dev->priv will be NULL in 2rd open */ 1671 So the net_dev->ml_priv will be NULL in 2rd open */
1672 return -ENETDOWN; 1672 return -ENETDOWN;
1673 } 1673 }
1674 1674
@@ -1692,7 +1692,7 @@ int rt_ioctl_siwencode(struct net_device *dev,
1692 struct iw_request_info *info, 1692 struct iw_request_info *info,
1693 struct iw_point *erq, char *extra) 1693 struct iw_point *erq, char *extra)
1694{ 1694{
1695 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 1695 PRTMP_ADAPTER pAdapter = dev->ml_priv;
1696 1696
1697 //check if the interface is down 1697 //check if the interface is down
1698 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) 1698 if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1800,19 +1800,19 @@ rt_ioctl_giwencode(struct net_device *dev,
1800 1800
1801 if (dev->priv_flags == INT_MAIN) 1801 if (dev->priv_flags == INT_MAIN)
1802 { 1802 {
1803 pAdapter = dev->priv; 1803 pAdapter = dev->ml_priv;
1804 } 1804 }
1805 else 1805 else
1806 { 1806 {
1807 pVirtualAd = dev->priv; 1807 pVirtualAd = dev->ml_priv;
1808 if (pVirtualAd && pVirtualAd->RtmpDev) 1808 if (pVirtualAd && pVirtualAd->RtmpDev)
1809 pAdapter = pVirtualAd->RtmpDev->priv; 1809 pAdapter = pVirtualAd->RtmpDev->ml_priv;
1810 } 1810 }
1811 1811
1812 if (pAdapter == NULL) 1812 if (pAdapter == NULL)
1813 { 1813 {
1814 /* if 1st open fail, pAd will be free; 1814 /* if 1st open fail, pAd will be free;
1815 So the net_dev->priv will be NULL in 2rd open */ 1815 So the net_dev->ml_priv will be NULL in 2rd open */
1816 return -ENETDOWN; 1816 return -ENETDOWN;
1817 } 1817 }
1818 1818
@@ -1880,19 +1880,19 @@ rt_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
1880 1880
1881 if (dev->priv_flags == INT_MAIN) 1881 if (dev->priv_flags == INT_MAIN)
1882 { 1882 {
1883 pAdapter = dev->priv; 1883 pAdapter = dev->ml_priv;
1884 } 1884 }
1885 else 1885 else
1886 { 1886 {
1887 pVirtualAd = dev->priv; 1887 pVirtualAd = dev->ml_priv;
1888 pAdapter = pVirtualAd->RtmpDev->priv; 1888 pAdapter = pVirtualAd->RtmpDev->ml_priv;
1889 } 1889 }
1890 pObj = (POS_COOKIE) pAdapter->OS_Cookie; 1890 pObj = (POS_COOKIE) pAdapter->OS_Cookie;
1891 1891
1892 if (pAdapter == NULL) 1892 if (pAdapter == NULL)
1893 { 1893 {
1894 /* if 1st open fail, pAd will be free; 1894 /* if 1st open fail, pAd will be free;
1895 So the net_dev->priv will be NULL in 2rd open */ 1895 So the net_dev->ml_priv will be NULL in 2rd open */
1896 return -ENETDOWN; 1896 return -ENETDOWN;
1897 } 1897 }
1898 1898
@@ -1948,7 +1948,7 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
1948 struct iw_point *wrq, char *extra) 1948 struct iw_point *wrq, char *extra)
1949{ 1949{
1950 INT Status = 0; 1950 INT Status = 0;
1951 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 1951 PRTMP_ADAPTER pAd = dev->ml_priv;
1952 1952
1953 if (extra == NULL) 1953 if (extra == NULL)
1954 { 1954 {
@@ -2075,18 +2075,18 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info,
2075 u32 subcmd = wrq->flags; 2075 u32 subcmd = wrq->flags;
2076 2076
2077 if (dev->priv_flags == INT_MAIN) 2077 if (dev->priv_flags == INT_MAIN)
2078 pAd = dev->priv; 2078 pAd = dev->ml_priv;
2079 else 2079 else
2080 { 2080 {
2081 pVirtualAd = dev->priv; 2081 pVirtualAd = dev->ml_priv;
2082 pAd = pVirtualAd->RtmpDev->priv; 2082 pAd = pVirtualAd->RtmpDev->ml_priv;
2083 } 2083 }
2084 pObj = (POS_COOKIE) pAd->OS_Cookie; 2084 pObj = (POS_COOKIE) pAd->OS_Cookie;
2085 2085
2086 if (pAd == NULL) 2086 if (pAd == NULL)
2087 { 2087 {
2088 /* if 1st open fail, pAd will be free; 2088 /* if 1st open fail, pAd will be free;
2089 So the net_dev->priv will be NULL in 2rd open */ 2089 So the net_dev->ml_priv will be NULL in 2rd open */
2090 return -ENETDOWN; 2090 return -ENETDOWN;
2091 } 2091 }
2092 2092
@@ -2237,7 +2237,7 @@ int rt_ioctl_siwmlme(struct net_device *dev,
2237 union iwreq_data *wrqu, 2237 union iwreq_data *wrqu,
2238 char *extra) 2238 char *extra)
2239{ 2239{
2240 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 2240 PRTMP_ADAPTER pAd = dev->ml_priv;
2241 struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer; 2241 struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer;
2242 MLME_QUEUE_ELEM MsgElem; 2242 MLME_QUEUE_ELEM MsgElem;
2243 MLME_DISASSOC_REQ_STRUCT DisAssocReq; 2243 MLME_DISASSOC_REQ_STRUCT DisAssocReq;
@@ -2294,7 +2294,7 @@ int rt_ioctl_siwauth(struct net_device *dev,
2294 struct iw_request_info *info, 2294 struct iw_request_info *info,
2295 union iwreq_data *wrqu, char *extra) 2295 union iwreq_data *wrqu, char *extra)
2296{ 2296{
2297 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 2297 PRTMP_ADAPTER pAdapter = dev->ml_priv;
2298 struct iw_param *param = &wrqu->param; 2298 struct iw_param *param = &wrqu->param;
2299 2299
2300 //check if the interface is down 2300 //check if the interface is down
@@ -2447,7 +2447,7 @@ int rt_ioctl_giwauth(struct net_device *dev,
2447 struct iw_request_info *info, 2447 struct iw_request_info *info,
2448 union iwreq_data *wrqu, char *extra) 2448 union iwreq_data *wrqu, char *extra)
2449{ 2449{
2450 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 2450 PRTMP_ADAPTER pAdapter = dev->ml_priv;
2451 struct iw_param *param = &wrqu->param; 2451 struct iw_param *param = &wrqu->param;
2452 2452
2453 //check if the interface is down 2453 //check if the interface is down
@@ -2521,7 +2521,7 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
2521 union iwreq_data *wrqu, 2521 union iwreq_data *wrqu,
2522 char *extra) 2522 char *extra)
2523 { 2523 {
2524 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 2524 PRTMP_ADAPTER pAdapter = dev->ml_priv;
2525 struct iw_point *encoding = &wrqu->encoding; 2525 struct iw_point *encoding = &wrqu->encoding;
2526 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 2526 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
2527 int keyIdx, alg = ext->alg; 2527 int keyIdx, alg = ext->alg;
@@ -2649,7 +2649,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
2649 struct iw_request_info *info, 2649 struct iw_request_info *info,
2650 union iwreq_data *wrqu, char *extra) 2650 union iwreq_data *wrqu, char *extra)
2651{ 2651{
2652 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 2652 PRTMP_ADAPTER pAd = dev->ml_priv;
2653 PCHAR pKey = NULL; 2653 PCHAR pKey = NULL;
2654 struct iw_point *encoding = &wrqu->encoding; 2654 struct iw_point *encoding = &wrqu->encoding;
2655 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 2655 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
@@ -2733,7 +2733,7 @@ int rt_ioctl_siwgenie(struct net_device *dev,
2733 struct iw_request_info *info, 2733 struct iw_request_info *info,
2734 union iwreq_data *wrqu, char *extra) 2734 union iwreq_data *wrqu, char *extra)
2735{ 2735{
2736 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 2736 PRTMP_ADAPTER pAd = dev->ml_priv;
2737 2737
2738 if (wrqu->data.length > MAX_LEN_OF_RSNIE || 2738 if (wrqu->data.length > MAX_LEN_OF_RSNIE ||
2739 (wrqu->data.length && extra == NULL)) 2739 (wrqu->data.length && extra == NULL))
@@ -2758,7 +2758,7 @@ int rt_ioctl_giwgenie(struct net_device *dev,
2758 struct iw_request_info *info, 2758 struct iw_request_info *info,
2759 union iwreq_data *wrqu, char *extra) 2759 union iwreq_data *wrqu, char *extra)
2760{ 2760{
2761 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 2761 PRTMP_ADAPTER pAd = dev->ml_priv;
2762 2762
2763 if ((pAd->StaCfg.RSNIE_Len == 0) || 2763 if ((pAd->StaCfg.RSNIE_Len == 0) ||
2764 (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA)) 2764 (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA))
@@ -2804,7 +2804,7 @@ int rt_ioctl_siwpmksa(struct net_device *dev,
2804 union iwreq_data *wrqu, 2804 union iwreq_data *wrqu,
2805 char *extra) 2805 char *extra)
2806{ 2806{
2807 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 2807 PRTMP_ADAPTER pAd = dev->ml_priv;
2808 struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer; 2808 struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer;
2809 INT CachedIdx = 0, idx = 0; 2809 INT CachedIdx = 0, idx = 0;
2810 2810
@@ -2888,7 +2888,7 @@ rt_private_ioctl_bbp(struct net_device *dev, struct iw_request_info *info,
2888 UINT32 bbpValue; 2888 UINT32 bbpValue;
2889 BOOLEAN bIsPrintAllBBP = FALSE; 2889 BOOLEAN bIsPrintAllBBP = FALSE;
2890 INT Status = 0; 2890 INT Status = 0;
2891 PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; 2891 PRTMP_ADAPTER pAdapter = dev->ml_priv;
2892 2892
2893 2893
2894 memset(extra, 0x00, IW_PRIV_SIZE_MASK); 2894 memset(extra, 0x00, IW_PRIV_SIZE_MASK);
@@ -3015,7 +3015,7 @@ int rt_ioctl_siwrate(struct net_device *dev,
3015 struct iw_request_info *info, 3015 struct iw_request_info *info,
3016 union iwreq_data *wrqu, char *extra) 3016 union iwreq_data *wrqu, char *extra)
3017{ 3017{
3018 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 3018 PRTMP_ADAPTER pAd = dev->ml_priv;
3019 UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed; 3019 UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed;
3020 3020
3021 //check if the interface is down 3021 //check if the interface is down
@@ -3073,7 +3073,7 @@ int rt_ioctl_giwrate(struct net_device *dev,
3073 struct iw_request_info *info, 3073 struct iw_request_info *info,
3074 union iwreq_data *wrqu, char *extra) 3074 union iwreq_data *wrqu, char *extra)
3075{ 3075{
3076 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; 3076 PRTMP_ADAPTER pAd = dev->ml_priv;
3077 int rate_index = 0, rate_count = 0; 3077 int rate_index = 0, rate_count = 0;
3078 HTTRANSMIT_SETTING ht_setting; 3078 HTTRANSMIT_SETTING ht_setting;
3079 __s32 ralinkrate[] = 3079 __s32 ralinkrate[] =
@@ -5483,19 +5483,19 @@ INT rt28xx_sta_ioctl(
5483 5483
5484 if (net_dev->priv_flags == INT_MAIN) 5484 if (net_dev->priv_flags == INT_MAIN)
5485 { 5485 {
5486 pAd = net_dev->priv; 5486 pAd = net_dev->ml_priv;
5487 } 5487 }
5488 else 5488 else
5489 { 5489 {
5490 pVirtualAd = net_dev->priv; 5490 pVirtualAd = net_dev->ml_priv;
5491 pAd = pVirtualAd->RtmpDev->priv; 5491 pAd = pVirtualAd->RtmpDev->ml_priv;
5492 } 5492 }
5493 pObj = (POS_COOKIE) pAd->OS_Cookie; 5493 pObj = (POS_COOKIE) pAd->OS_Cookie;
5494 5494
5495 if (pAd == NULL) 5495 if (pAd == NULL)
5496 { 5496 {
5497 /* if 1st open fail, pAd will be free; 5497 /* if 1st open fail, pAd will be free;
5498 So the net_dev->priv will be NULL in 2rd open */ 5498 So the net_dev->ml_priv will be NULL in 2rd open */
5499 return -ENETDOWN; 5499 return -ENETDOWN;
5500 } 5500 }
5501 5501