aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rt2860/rt_main_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rt2860/rt_main_dev.c')
-rw-r--r--drivers/staging/rt2860/rt_main_dev.c59
1 files changed, 7 insertions, 52 deletions
diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c
index 35c59d5aa99c..22f37cfbefbe 100644
--- a/drivers/staging/rt2860/rt_main_dev.c
+++ b/drivers/staging/rt2860/rt_main_dev.c
@@ -74,11 +74,9 @@ static void CfgInitHook(PRTMP_ADAPTER pAd);
extern const struct iw_handler_def rt28xx_iw_handler_def;
-#if WIRELESS_EXT >= 12
// This function will be called when query /proc
struct iw_statistics *rt28xx_get_wireless_stats(
IN struct net_device *net_dev);
-#endif
struct net_device_stats *RT28xx_get_ether_stats(
IN struct net_device *net_dev);
@@ -190,7 +188,7 @@ int rt28xx_close(IN PNET_DEV dev)
BOOLEAN Cancelled = FALSE;
UINT32 i = 0;
#ifdef RT2870
- DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup);
+ DECLARE_WAIT_QUEUE_HEAD_ONSTACK(unlink_wakeup);
DECLARE_WAITQUEUE(wait, current);
//RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS);
@@ -517,9 +515,6 @@ static int rt28xx_init(IN struct net_device *net_dev)
NICInitRT30xxRFRegisters(pAd);
#endif // RT2870 //
-#ifdef IKANOS_VX_1X0
- VR_IKANOS_FP_Init(pAd->ApCfg.BssidNum, pAd->PermanentAddress);
-#endif // IKANOS_VX_1X0 //
//
// Initialize RF register to default value
@@ -527,7 +522,7 @@ static int rt28xx_init(IN struct net_device *net_dev)
AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-#ifndef RT30xx
+#ifndef RT2870
// 8051 firmware require the signal during booting time.
AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00);
#endif
@@ -675,16 +670,12 @@ err:
static const struct net_device_ops rt2860_netdev_ops = {
.ndo_open = MainVirtualIF_open,
.ndo_stop = MainVirtualIF_close,
- .ndo_do_ioctl = rt28xx_ioctl,
+ .ndo_do_ioctl = rt28xx_sta_ioctl,
.ndo_get_stats = RT28xx_get_ether_stats,
.ndo_validate_addr = NULL,
.ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
-#ifdef IKANOS_VX_1X0
- .ndo_start_xmit = IKANOS_DataFramesTx,
-#else
.ndo_start_xmit = rt28xx_send_packets,
-#endif
};
/* Must not be called for mdev and apdev */
@@ -695,22 +686,17 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p
CHAR slot_name[IFNAMSIZ];
struct net_device *device;
-#if WIRELESS_EXT >= 12
if (pAd->OpMode == OPMODE_STA)
{
dev->wireless_handlers = &rt28xx_iw_handler_def;
}
-#endif //WIRELESS_EXT >= 12
-#if WIRELESS_EXT < 21
- dev->get_wireless_stats = rt28xx_get_wireless_stats;
-#endif
dev->priv_flags = INT_MAIN;
dev->netdev_ops = &rt2860_netdev_ops;
// find available device name
for (i = 0; i < 8; i++)
{
- sprintf(slot_name, "ra%d", i);
+ sprintf(slot_name, "wlan%d", i);
device = dev_get_by_name(dev_net(dev), slot_name);
if (device != NULL)
@@ -727,7 +713,7 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p
}
else
{
- sprintf(dev->name, "ra%d", i);
+ sprintf(dev->name, "wlan%d", i);
Status = NDIS_STATUS_SUCCESS;
}
@@ -791,6 +777,8 @@ INT __devinit rt28xx_probe(
// Allocate RTMP_ADAPTER miniport adapter structure
handle = kmalloc(sizeof(struct os_cookie), GFP_KERNEL);
+ if (handle == NULL)
+ goto err_out_free_netdev;;
RT28XX_HANDLE_DEV_ASSIGN(handle, dev_p);
status = RTMPAllocAdapterBlock(handle, &pAd);
@@ -942,7 +930,6 @@ void CfgInitHook(PRTMP_ADAPTER pAd)
} /* End of CfgInitHook */
-#if WIRELESS_EXT >= 12
// This function will be called when query /proc
struct iw_statistics *rt28xx_get_wireless_stats(
IN struct net_device *net_dev)
@@ -976,7 +963,6 @@ struct iw_statistics *rt28xx_get_wireless_stats(
DBGPRINT(RT_DEBUG_TRACE, ("<--- rt28xx_get_wireless_stats\n"));
return &pAd->iw_stats;
} /* End of rt28xx_get_wireless_stats */
-#endif // WIRELESS_EXT //
@@ -986,37 +972,6 @@ void tbtt_tasklet(unsigned long data)
}
-INT rt28xx_ioctl(
- IN struct net_device *net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd)
-{
- VIRTUAL_ADAPTER *pVirtualAd = NULL;
- RTMP_ADAPTER *pAd = NULL;
- INT ret = 0;
-
- if (net_dev->priv_flags == INT_MAIN)
- {
- pAd = net_dev->ml_priv;
- }
- else
- {
- pVirtualAd = net_dev->ml_priv;
- pAd = pVirtualAd->RtmpDev->ml_priv;
- }
-
- if (pAd == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->ml_priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- ret = rt28xx_sta_ioctl(net_dev, rq, cmd);
-
- return ret;
-}
-
/*
========================================================================