Commit 1242c70d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5a501b30
...@@ -763,7 +763,7 @@ Return Value: ...@@ -763,7 +763,7 @@ Return Value:
NDIS_STATUS CreateThreads( NDIS_STATUS CreateThreads(
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;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
pid_t pid_number = -1; pid_t pid_number = -1;
......
...@@ -125,7 +125,7 @@ Return Value: ...@@ -125,7 +125,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)
...@@ -165,7 +165,7 @@ Return Value: ...@@ -165,7 +165,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)
...@@ -207,7 +207,7 @@ Return Value: ...@@ -207,7 +207,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;
#ifdef RT2870 #ifdef RT2870
...@@ -416,7 +416,7 @@ int rt28xx_close(IN PNET_DEV dev) ...@@ -416,7 +416,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 = net_dev->ml_priv;
UINT index; UINT index;
UCHAR TmpPhy; UCHAR TmpPhy;
NDIS_STATUS Status; NDIS_STATUS Status;
...@@ -688,8 +688,8 @@ static int rt28xx_init(IN struct net_device *net_dev) ...@@ -688,8 +688,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 //
...@@ -716,7 +716,7 @@ Return Value: ...@@ -716,7 +716,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;
...@@ -725,7 +725,7 @@ int rt28xx_open(IN PNET_DEV dev) ...@@ -725,7 +725,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;
} }
...@@ -1416,7 +1416,7 @@ INT __devinit rt28xx_probe( ...@@ -1416,7 +1416,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);
...@@ -1517,7 +1517,7 @@ Return Value: ...@@ -1517,7 +1517,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;
...@@ -1605,7 +1605,7 @@ INT rt28xx_send_packets( ...@@ -1605,7 +1605,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))
{ {
...@@ -1717,7 +1717,7 @@ static BOOLEAN RT28XXAvailRANameAssign( ...@@ -1717,7 +1717,7 @@ static BOOLEAN RT28XXAvailRANameAssign(
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"));
...@@ -1769,18 +1769,18 @@ INT rt28xx_ioctl( ...@@ -1769,18 +1769,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;
} }
...@@ -1817,7 +1817,7 @@ struct net_device_stats *RT28xx_get_ether_stats( ...@@ -1817,7 +1817,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)
{ {
......
This diff is collapsed.
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