Commit 739b7979 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: rt2860: 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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 18727963
...@@ -170,7 +170,7 @@ static int rt2860_suspend( ...@@ -170,7 +170,7 @@ static int rt2860_suspend(
} }
else else
{ {
pAd = (PRTMP_ADAPTER)net_dev->priv; pAd = net_dev->ml_priv;
/* we can not use IFF_UP because ra0 down but ra1 up */ /* we can not use IFF_UP because ra0 down but ra1 up */
/* and 1 suspend/resume function for 1 module, not for each interface */ /* and 1 suspend/resume function for 1 module, not for each interface */
...@@ -249,7 +249,7 @@ static int rt2860_resume( ...@@ -249,7 +249,7 @@ static int rt2860_resume(
DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n")); DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
} }
else else
pAd = (PRTMP_ADAPTER)net_dev->priv; pAd = net_dev->ml_priv;
if (pAd != NULL) if (pAd != NULL)
{ {
...@@ -336,7 +336,7 @@ static VOID __devexit rt2860_remove_one( ...@@ -336,7 +336,7 @@ static VOID __devexit rt2860_remove_one(
IN struct pci_dev *pci_dev) IN struct pci_dev *pci_dev)
{ {
struct net_device *net_dev = pci_get_drvdata(pci_dev); struct net_device *net_dev = pci_get_drvdata(pci_dev);
RTMP_ADAPTER *pAd = net_dev->priv; RTMP_ADAPTER *pAd = net_dev->ml_priv;
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_remove_one\n")); DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_remove_one\n"));
...@@ -765,7 +765,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -765,7 +765,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
#endif #endif
{ {
struct net_device *net_dev = (struct net_device *) dev_instance; struct net_device *net_dev = (struct net_device *) dev_instance;
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; PRTMP_ADAPTER pAd = net_dev->ml_priv;
INT_SOURCE_CSR_STRUC IntSource; INT_SOURCE_CSR_STRUC IntSource;
POS_COOKIE pObj; POS_COOKIE pObj;
...@@ -1300,7 +1300,7 @@ VOID rt2860_stop(struct net_device *net_dev) ...@@ -1300,7 +1300,7 @@ VOID rt2860_stop(struct net_device *net_dev)
DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n")); DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
} }
else else
pAd = (PRTMP_ADAPTER)net_dev->priv; pAd = net_dev->ml_priv;
if (pAd != NULL) if (pAd != NULL)
{ {
......
...@@ -242,7 +242,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs); ...@@ -242,7 +242,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
#endif #endif
#define RT28XX_IRQ_REQUEST(net_dev) \ #define RT28XX_IRQ_REQUEST(net_dev) \
{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->priv); \ { PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \
POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
RTMP_MSI_ENABLE(_pAd); \ RTMP_MSI_ENABLE(_pAd); \
if ((retval = request_irq(_pObj->pci_dev->irq, \ if ((retval = request_irq(_pObj->pci_dev->irq, \
...@@ -253,7 +253,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs); ...@@ -253,7 +253,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define RT28XX_IRQ_RELEASE(net_dev) \ #define RT28XX_IRQ_RELEASE(net_dev) \
{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->priv); \ { PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \
POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
synchronize_irq(_pObj->pci_dev->irq); \ synchronize_irq(_pObj->pci_dev->irq); \
free_irq(_pObj->pci_dev->irq, (net_dev)); \ free_irq(_pObj->pci_dev->irq, (net_dev)); \
......
...@@ -135,7 +135,7 @@ Return Value: ...@@ -135,7 +135,7 @@ Return Value:
*/ */
int MainVirtualIF_close(IN struct net_device *net_dev) int MainVirtualIF_close(IN struct net_device *net_dev)
{ {
RTMP_ADAPTER *pAd = net_dev->priv; RTMP_ADAPTER *pAd = net_dev->ml_priv;
// Sanity check for pAd // Sanity check for pAd
if (pAd == NULL) if (pAd == NULL)
...@@ -174,7 +174,7 @@ Return Value: ...@@ -174,7 +174,7 @@ Return Value:
*/ */
int MainVirtualIF_open(IN struct net_device *net_dev) int MainVirtualIF_open(IN struct net_device *net_dev)
{ {
RTMP_ADAPTER *pAd = net_dev->priv; RTMP_ADAPTER *pAd = net_dev->ml_priv;
// Sanity check for pAd // Sanity check for pAd
if (pAd == NULL) if (pAd == NULL)
...@@ -216,7 +216,7 @@ Return Value: ...@@ -216,7 +216,7 @@ Return Value:
int rt28xx_close(IN PNET_DEV dev) int rt28xx_close(IN PNET_DEV dev)
{ {
struct net_device * net_dev = (struct net_device *)dev; struct net_device * net_dev = (struct net_device *)dev;
RTMP_ADAPTER *pAd = net_dev->priv; RTMP_ADAPTER *pAd = net_dev->ml_priv;
BOOLEAN Cancelled = FALSE; BOOLEAN Cancelled = FALSE;
UINT32 i = 0; UINT32 i = 0;
...@@ -396,7 +396,7 @@ int rt28xx_close(IN PNET_DEV dev) ...@@ -396,7 +396,7 @@ int rt28xx_close(IN PNET_DEV dev)
static int rt28xx_init(IN struct net_device *net_dev) static int rt28xx_init(IN struct net_device *net_dev)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->priv; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->ml_priv;
UINT index; UINT index;
UCHAR TmpPhy; UCHAR TmpPhy;
NDIS_STATUS Status; NDIS_STATUS Status;
...@@ -605,8 +605,8 @@ static int rt28xx_init(IN struct net_device *net_dev) ...@@ -605,8 +605,8 @@ static int rt28xx_init(IN struct net_device *net_dev)
#endif // DOT11_N_SUPPORT // #endif // DOT11_N_SUPPORT //
RT28XX_IRQ_RELEASE(net_dev); RT28XX_IRQ_RELEASE(net_dev);
// shall not set priv to NULL here because the priv didn't been free yet. // shall not set ml_priv to NULL here because the ml_priv didn't been free yet.
//net_dev->priv = 0; //net_dev->ml_priv = 0;
#ifdef INF_AMAZON_SE #ifdef INF_AMAZON_SE
err0: err0:
#endif // INF_AMAZON_SE // #endif // INF_AMAZON_SE //
...@@ -633,7 +633,7 @@ Return Value: ...@@ -633,7 +633,7 @@ Return Value:
int rt28xx_open(IN PNET_DEV dev) int rt28xx_open(IN PNET_DEV dev)
{ {
struct net_device * net_dev = (struct net_device *)dev; struct net_device * net_dev = (struct net_device *)dev;
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->priv; PRTMP_ADAPTER pAd = net_dev->ml_priv;
int retval = 0; int retval = 0;
POS_COOKIE pObj; POS_COOKIE pObj;
...@@ -642,7 +642,7 @@ int rt28xx_open(IN PNET_DEV dev) ...@@ -642,7 +642,7 @@ int rt28xx_open(IN PNET_DEV dev)
if (pAd == NULL) if (pAd == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -1; return -1;
} }
...@@ -1303,7 +1303,7 @@ INT __devinit rt28xx_probe( ...@@ -1303,7 +1303,7 @@ INT __devinit rt28xx_probe(
if (status != NDIS_STATUS_SUCCESS) if (status != NDIS_STATUS_SUCCESS)
goto err_out_free_netdev; goto err_out_free_netdev;
net_dev->priv = (PVOID)pAd; net_dev->ml_priv = (PVOID)pAd;
pAd->net_dev = net_dev; // must be before RT28XXNetDevInit() pAd->net_dev = net_dev; // must be before RT28XXNetDevInit()
RT28XXNetDevInit(_dev_p, net_dev, pAd); RT28XXNetDevInit(_dev_p, net_dev, pAd);
...@@ -1399,7 +1399,7 @@ Return Value: ...@@ -1399,7 +1399,7 @@ Return Value:
int rt28xx_packet_xmit(struct sk_buff *skb) int rt28xx_packet_xmit(struct sk_buff *skb)
{ {
struct net_device *net_dev = skb->dev; struct net_device *net_dev = skb->dev;
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; PRTMP_ADAPTER pAd = net_dev->ml_priv;
int status = 0; int status = 0;
PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; PNDIS_PACKET pPacket = (PNDIS_PACKET) skb;
...@@ -1478,7 +1478,7 @@ INT rt28xx_send_packets( ...@@ -1478,7 +1478,7 @@ INT rt28xx_send_packets(
IN struct sk_buff *skb_p, IN struct sk_buff *skb_p,
IN struct net_device *net_dev) IN struct net_device *net_dev)
{ {
RTMP_ADAPTER *pAd = net_dev->priv; RTMP_ADAPTER *pAd = net_dev->ml_priv;
if (!(net_dev->flags & IFF_UP)) if (!(net_dev->flags & IFF_UP))
{ {
RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE); RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE);
...@@ -1540,7 +1540,7 @@ void CfgInitHook(PRTMP_ADAPTER pAd) ...@@ -1540,7 +1540,7 @@ void CfgInitHook(PRTMP_ADAPTER pAd)
struct iw_statistics *rt28xx_get_wireless_stats( struct iw_statistics *rt28xx_get_wireless_stats(
IN struct net_device *net_dev) IN struct net_device *net_dev)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; PRTMP_ADAPTER pAd = net_dev->ml_priv;
DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n")); DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n"));
...@@ -1592,18 +1592,18 @@ INT rt28xx_ioctl( ...@@ -1592,18 +1592,18 @@ INT rt28xx_ioctl(
if (net_dev->priv_flags == INT_MAIN) if (net_dev->priv_flags == INT_MAIN)
{ {
pAd = net_dev->priv; pAd = net_dev->ml_priv;
} }
else else
{ {
pVirtualAd = net_dev->priv; pVirtualAd = net_dev->ml_priv;
pAd = pVirtualAd->RtmpDev->priv; pAd = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAd == NULL) if (pAd == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1640,7 +1640,7 @@ struct net_device_stats *RT28xx_get_ether_stats( ...@@ -1640,7 +1640,7 @@ struct net_device_stats *RT28xx_get_ether_stats(
RTMP_ADAPTER *pAd = NULL; RTMP_ADAPTER *pAd = NULL;
if (net_dev) if (net_dev)
pAd = net_dev->priv; pAd = net_dev->ml_priv;
if (pAd) if (pAd)
{ {
......
...@@ -571,7 +571,7 @@ rt_ioctl_giwname(struct net_device *dev, ...@@ -571,7 +571,7 @@ rt_ioctl_giwname(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
char *name, char *extra) char *name, char *extra)
{ {
// PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; // PRTMP_ADAPTER pAdapter = dev->ml_priv;
#ifdef RT2860 #ifdef RT2860
strncpy(name, "RT2860 Wireless", IFNAMSIZ); strncpy(name, "RT2860 Wireless", IFNAMSIZ);
...@@ -583,7 +583,7 @@ int rt_ioctl_siwfreq(struct net_device *dev, ...@@ -583,7 +583,7 @@ int rt_ioctl_siwfreq(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_freq *freq, char *extra) struct iw_freq *freq, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
int chan = -1; int chan = -1;
//check if the interface is down //check if the interface is down
...@@ -623,19 +623,19 @@ int rt_ioctl_giwfreq(struct net_device *dev, ...@@ -623,19 +623,19 @@ int rt_ioctl_giwfreq(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -653,7 +653,7 @@ int rt_ioctl_siwmode(struct net_device *dev, ...@@ -653,7 +653,7 @@ int rt_ioctl_siwmode(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
__u32 *mode, char *extra) __u32 *mode, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
//check if the interface is down //check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
...@@ -695,19 +695,19 @@ int rt_ioctl_giwmode(struct net_device *dev, ...@@ -695,19 +695,19 @@ int rt_ioctl_giwmode(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -732,7 +732,7 @@ int rt_ioctl_siwsens(struct net_device *dev, ...@@ -732,7 +732,7 @@ int rt_ioctl_siwsens(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
char *name, char *extra) char *name, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
//check if the interface is down //check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
...@@ -763,19 +763,19 @@ int rt_ioctl_giwrange(struct net_device *dev, ...@@ -763,19 +763,19 @@ int rt_ioctl_giwrange(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -857,7 +857,7 @@ int rt_ioctl_siwap(struct net_device *dev, ...@@ -857,7 +857,7 @@ int rt_ioctl_siwap(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra) struct sockaddr *ap_addr, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
NDIS_802_11_MAC_ADDRESS Bssid; NDIS_802_11_MAC_ADDRESS Bssid;
//check if the interface is down //check if the interface is down
...@@ -902,19 +902,19 @@ int rt_ioctl_giwap(struct net_device *dev, ...@@ -902,19 +902,19 @@ int rt_ioctl_giwap(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -984,7 +984,7 @@ int rt_ioctl_iwaplist(struct net_device *dev, ...@@ -984,7 +984,7 @@ int rt_ioctl_iwaplist(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_point *data, char *extra) struct iw_point *data, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
struct sockaddr addr[IW_MAX_AP]; struct sockaddr addr[IW_MAX_AP];
struct iw_quality qual[IW_MAX_AP]; struct iw_quality qual[IW_MAX_AP];
...@@ -1020,7 +1020,7 @@ int rt_ioctl_siwscan(struct net_device *dev, ...@@ -1020,7 +1020,7 @@ int rt_ioctl_siwscan(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_point *data, char *extra) struct iw_point *data, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
ULONG Now; ULONG Now;
int Status = NDIS_STATUS_SUCCESS; int Status = NDIS_STATUS_SUCCESS;
...@@ -1102,7 +1102,7 @@ int rt_ioctl_giwscan(struct net_device *dev, ...@@ -1102,7 +1102,7 @@ int rt_ioctl_giwscan(struct net_device *dev,
struct iw_point *data, char *extra) struct iw_point *data, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
int i=0; int i=0;
char *current_ev = extra, *previous_ev = extra; char *current_ev = extra, *previous_ev = extra;
char *end_buf; char *end_buf;
...@@ -1391,7 +1391,7 @@ int rt_ioctl_siwessid(struct net_device *dev, ...@@ -1391,7 +1391,7 @@ int rt_ioctl_siwessid(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_point *data, char *essid) struct iw_point *data, char *essid)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
//check if the interface is down //check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
...@@ -1437,19 +1437,19 @@ int rt_ioctl_giwessid(struct net_device *dev, ...@@ -1437,19 +1437,19 @@ int rt_ioctl_giwessid(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1480,7 +1480,7 @@ int rt_ioctl_siwnickn(struct net_device *dev, ...@@ -1480,7 +1480,7 @@ int rt_ioctl_siwnickn(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_point *data, char *nickname) struct iw_point *data, char *nickname)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
//check if the interface is down //check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
...@@ -1508,19 +1508,19 @@ int rt_ioctl_giwnickn(struct net_device *dev, ...@@ -1508,19 +1508,19 @@ int rt_ioctl_giwnickn(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1537,7 +1537,7 @@ int rt_ioctl_siwrts(struct net_device *dev, ...@@ -1537,7 +1537,7 @@ int rt_ioctl_siwrts(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_param *rts, char *extra) struct iw_param *rts, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
u16 val; u16 val;
//check if the interface is down //check if the interface is down
...@@ -1571,19 +1571,19 @@ int rt_ioctl_giwrts(struct net_device *dev, ...@@ -1571,19 +1571,19 @@ int rt_ioctl_giwrts(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1605,7 +1605,7 @@ int rt_ioctl_siwfrag(struct net_device *dev, ...@@ -1605,7 +1605,7 @@ int rt_ioctl_siwfrag(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_param *frag, char *extra) struct iw_param *frag, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
u16 val; u16 val;
//check if the interface is down //check if the interface is down
...@@ -1637,19 +1637,19 @@ int rt_ioctl_giwfrag(struct net_device *dev, ...@@ -1637,19 +1637,19 @@ int rt_ioctl_giwfrag(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1673,7 +1673,7 @@ int rt_ioctl_siwencode(struct net_device *dev, ...@@ -1673,7 +1673,7 @@ int rt_ioctl_siwencode(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_point *erq, char *extra) struct iw_point *erq, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
//check if the interface is down //check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
...@@ -1780,19 +1780,19 @@ rt_ioctl_giwencode(struct net_device *dev, ...@@ -1780,19 +1780,19 @@ rt_ioctl_giwencode(struct net_device *dev,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
if (pVirtualAd && pVirtualAd->RtmpDev) if (pVirtualAd && pVirtualAd->RtmpDev)
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1860,19 +1860,19 @@ rt_ioctl_setparam(struct net_device *dev, struct iw_request_info *info, ...@@ -1860,19 +1860,19 @@ rt_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
{ {
pAdapter = dev->priv; pAdapter = dev->ml_priv;
} }
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
pAdapter = pVirtualAd->RtmpDev->priv; pAdapter = pVirtualAd->RtmpDev->ml_priv;
} }
pObj = (POS_COOKIE) pAdapter->OS_Cookie; pObj = (POS_COOKIE) pAdapter->OS_Cookie;
if (pAdapter == NULL) if (pAdapter == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -1928,7 +1928,7 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info, ...@@ -1928,7 +1928,7 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
struct iw_point *wrq, char *extra) struct iw_point *wrq, char *extra)
{ {
INT Status = 0; INT Status = 0;
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
if (extra == NULL) if (extra == NULL)
{ {
...@@ -2055,18 +2055,18 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info, ...@@ -2055,18 +2055,18 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info,
u32 subcmd = wrq->flags; u32 subcmd = wrq->flags;
if (dev->priv_flags == INT_MAIN) if (dev->priv_flags == INT_MAIN)
pAd = dev->priv; pAd = dev->ml_priv;
else else
{ {
pVirtualAd = dev->priv; pVirtualAd = dev->ml_priv;
pAd = pVirtualAd->RtmpDev->priv; pAd = pVirtualAd->RtmpDev->ml_priv;
} }
pObj = (POS_COOKIE) pAd->OS_Cookie; pObj = (POS_COOKIE) pAd->OS_Cookie;
if (pAd == NULL) if (pAd == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
...@@ -2213,7 +2213,7 @@ int rt_ioctl_siwmlme(struct net_device *dev, ...@@ -2213,7 +2213,7 @@ int rt_ioctl_siwmlme(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer; struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer;
MLME_QUEUE_ELEM MsgElem; MLME_QUEUE_ELEM MsgElem;
MLME_DISASSOC_REQ_STRUCT DisAssocReq; MLME_DISASSOC_REQ_STRUCT DisAssocReq;
...@@ -2270,7 +2270,7 @@ int rt_ioctl_siwauth(struct net_device *dev, ...@@ -2270,7 +2270,7 @@ int rt_ioctl_siwauth(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
struct iw_param *param = &wrqu->param; struct iw_param *param = &wrqu->param;
//check if the interface is down //check if the interface is down
...@@ -2413,7 +2413,7 @@ int rt_ioctl_giwauth(struct net_device *dev, ...@@ -2413,7 +2413,7 @@ int rt_ioctl_giwauth(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
struct iw_param *param = &wrqu->param; struct iw_param *param = &wrqu->param;
//check if the interface is down //check if the interface is down
...@@ -2487,7 +2487,7 @@ int rt_ioctl_siwencodeext(struct net_device *dev, ...@@ -2487,7 +2487,7 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
struct iw_point *encoding = &wrqu->encoding; struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int keyIdx, alg = ext->alg; int keyIdx, alg = ext->alg;
...@@ -2596,7 +2596,7 @@ rt_ioctl_giwencodeext(struct net_device *dev, ...@@ -2596,7 +2596,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
PCHAR pKey = NULL; PCHAR pKey = NULL;
struct iw_point *encoding = &wrqu->encoding; struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
...@@ -2680,7 +2680,7 @@ int rt_ioctl_siwgenie(struct net_device *dev, ...@@ -2680,7 +2680,7 @@ int rt_ioctl_siwgenie(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
if (wrqu->data.length > MAX_LEN_OF_RSNIE || if (wrqu->data.length > MAX_LEN_OF_RSNIE ||
(wrqu->data.length && extra == NULL)) (wrqu->data.length && extra == NULL))
...@@ -2705,7 +2705,7 @@ int rt_ioctl_giwgenie(struct net_device *dev, ...@@ -2705,7 +2705,7 @@ int rt_ioctl_giwgenie(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
if ((pAd->StaCfg.RSNIE_Len == 0) || if ((pAd->StaCfg.RSNIE_Len == 0) ||
(pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA)) (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA))
...@@ -2751,7 +2751,7 @@ int rt_ioctl_siwpmksa(struct net_device *dev, ...@@ -2751,7 +2751,7 @@ int rt_ioctl_siwpmksa(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer; struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer;
INT CachedIdx = 0, idx = 0; INT CachedIdx = 0, idx = 0;
...@@ -2834,7 +2834,7 @@ rt_private_ioctl_bbp(struct net_device *dev, struct iw_request_info *info, ...@@ -2834,7 +2834,7 @@ rt_private_ioctl_bbp(struct net_device *dev, struct iw_request_info *info,
UINT32 bbpValue; UINT32 bbpValue;
BOOLEAN bIsPrintAllBBP = FALSE; BOOLEAN bIsPrintAllBBP = FALSE;
INT Status = 0; INT Status = 0;
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAdapter = dev->ml_priv;
memset(extra, 0x00, IW_PRIV_SIZE_MASK); memset(extra, 0x00, IW_PRIV_SIZE_MASK);
...@@ -2961,7 +2961,7 @@ int rt_ioctl_siwrate(struct net_device *dev, ...@@ -2961,7 +2961,7 @@ int rt_ioctl_siwrate(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed; UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed;
//check if the interface is down //check if the interface is down
...@@ -3019,7 +3019,7 @@ int rt_ioctl_giwrate(struct net_device *dev, ...@@ -3019,7 +3019,7 @@ int rt_ioctl_giwrate(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; PRTMP_ADAPTER pAd = dev->ml_priv;
int rate_index = 0, rate_count = 0; int rate_index = 0, rate_count = 0;
HTTRANSMIT_SETTING ht_setting; HTTRANSMIT_SETTING ht_setting;
__s32 ralinkrate[] = __s32 ralinkrate[] =
...@@ -5409,19 +5409,19 @@ INT rt28xx_sta_ioctl( ...@@ -5409,19 +5409,19 @@ INT rt28xx_sta_ioctl(
if (net_dev->priv_flags == INT_MAIN) if (net_dev->priv_flags == INT_MAIN)
{ {
pAd = net_dev->priv; pAd = net_dev->ml_priv;
} }
else else
{ {
pVirtualAd = net_dev->priv; pVirtualAd = net_dev->ml_priv;
pAd = pVirtualAd->RtmpDev->priv; pAd = pVirtualAd->RtmpDev->ml_priv;
} }
pObj = (POS_COOKIE) pAd->OS_Cookie; pObj = (POS_COOKIE) pAd->OS_Cookie;
if (pAd == NULL) if (pAd == NULL)
{ {
/* if 1st open fail, pAd will be free; /* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */ So the net_dev->ml_priv will be NULL in 2rd open */
return -ENETDOWN; return -ENETDOWN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment