aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng/p80211netdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/wlan-ng/p80211netdev.c')
-rw-r--r--drivers/staging/wlan-ng/p80211netdev.c899
1 files changed, 254 insertions, 645 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 2b705eaa50e..00b186c5972 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -49,13 +49,6 @@
* --------------------------------------------------------------------
*/
-
-/*================================================================*/
-/* System Includes */
-
-
-#include <linux/version.h>
-
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@ -70,25 +63,20 @@
#include <linux/wireless.h>
#include <linux/sockios.h>
#include <linux/etherdevice.h>
-
-#include <asm/bitops.h>
-#include <asm/uaccess.h>
+#include <linux/if_ether.h>
+#include <linux/byteorder/generic.h>
+#include <linux/bitops.h>
+#include <linux/uaccess.h>
#include <asm/byteorder.h>
#ifdef SIOCETHTOOL
#include <linux/ethtool.h>
#endif
-#if WIRELESS_EXT > 12
#include <net/iw_handler.h>
-#endif
#include <net/net_namespace.h>
+#include <net/cfg80211.h>
-/*================================================================*/
-/* Project Includes */
-
-#include "version.h"
-#include "wlan_compat.h"
#include "p80211types.h"
#include "p80211hdr.h"
#include "p80211conv.h"
@@ -100,108 +88,29 @@
#include "p80211metastruct.h"
#include "p80211metadef.h"
-/*================================================================*/
-/* Local Constants */
-
-/*================================================================*/
-/* Local Macros */
-
-
-/*================================================================*/
-/* Local Types */
-
-/*================================================================*/
-/* Local Static Definitions */
-
-#define __NO_VERSION__ /* prevent the static definition */
-
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *proc_p80211;
-#endif
-
-/*================================================================*/
-/* Local Function Declarations */
-
-/* Support functions */
-static void p80211netdev_rx_bh(unsigned long arg);
+#include "cfg80211.c"
/* netdevice method functions */
-static int p80211knetdev_init( netdevice_t *netdev);
-static struct net_device_stats* p80211knetdev_get_stats(netdevice_t *netdev);
-static int p80211knetdev_open( netdevice_t *netdev);
-static int p80211knetdev_stop( netdevice_t *netdev );
-static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netdev);
+static int p80211knetdev_init(netdevice_t *netdev);
+static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev);
+static int p80211knetdev_open(netdevice_t *netdev);
+static int p80211knetdev_stop(netdevice_t *netdev);
+static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
+ netdevice_t *netdev);
static void p80211knetdev_set_multicast_list(netdevice_t *dev);
-static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd);
+static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr,
+ int cmd);
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr);
static void p80211knetdev_tx_timeout(netdevice_t *netdev);
-static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc);
-
-#ifdef CONFIG_PROC_FS
-static int
-p80211netdev_proc_read(
- char *page,
- char **start,
- off_t offset,
- int count,
- int *eof,
- void *data);
-#endif
+static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc);
-/*================================================================*/
-/* Function Definitions */
+int wlan_watchdog = 5000;
+module_param(wlan_watchdog, int, 0644);
+MODULE_PARM_DESC(wlan_watchdog, "transmit timeout in milliseconds");
-/*----------------------------------------------------------------
-* p80211knetdev_startup
-*
-* Initialize the wlandevice/netdevice part of 802.11 services at
-* load time.
-*
-* Arguments:
-* none
-*
-* Returns:
-* nothing
-----------------------------------------------------------------*/
-void p80211netdev_startup(void)
-{
- DBFENTER;
-
-#ifdef CONFIG_PROC_FS
- if (init_net.proc_net != NULL) {
- proc_p80211 = create_proc_entry(
- "p80211",
- (S_IFDIR|S_IRUGO|S_IXUGO),
- init_net.proc_net);
- }
-#endif
- DBFEXIT;
- return;
-}
-
-/*----------------------------------------------------------------
-* p80211knetdev_shutdown
-*
-* Shutdown the wlandevice/netdevice part of 802.11 services at
-* unload time.
-*
-* Arguments:
-* none
-*
-* Returns:
-* nothing
-----------------------------------------------------------------*/
-void
-p80211netdev_shutdown(void)
-{
- DBFENTER;
-#ifdef CONFIG_PROC_FS
- if (proc_p80211 != NULL) {
- remove_proc_entry("p80211", init_net.proc_net);
- }
-#endif
- DBFEXIT;
-}
+int wlan_wext_write = 1;
+module_param(wlan_wext_write, int, 0644);
+MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions");
/*----------------------------------------------------------------
* p80211knetdev_init
@@ -215,18 +124,15 @@ p80211netdev_shutdown(void)
* Returns:
* nothing
----------------------------------------------------------------*/
-static int p80211knetdev_init( netdevice_t *netdev)
+static int p80211knetdev_init(netdevice_t *netdev)
{
- DBFENTER;
/* Called in response to register_netdev */
/* This is usually the probe function, but the probe has */
/* already been done by the MSD and the create_kdev */
/* function. All we do here is return success */
- DBFEXIT;
return 0;
}
-
/*----------------------------------------------------------------
* p80211knetdev_get_stats
*
@@ -241,20 +147,16 @@ static int p80211knetdev_init( netdevice_t *netdev)
* Returns:
* the address of the statistics structure
----------------------------------------------------------------*/
-static struct net_device_stats*
-p80211knetdev_get_stats(netdevice_t *netdev)
+static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev)
{
- wlandevice_t *wlandev = netdev->ml_priv;
- DBFENTER;
+ wlandevice_t *wlandev = netdev->ml_priv;
/* TODO: review the MIB stats for items that correspond to
- linux stats */
+ linux stats */
- DBFEXIT;
return &(wlandev->linux_stats);
}
-
/*----------------------------------------------------------------
* p80211knetdev_open
*
@@ -269,37 +171,29 @@ p80211knetdev_get_stats(netdevice_t *netdev)
* Returns:
* zero on success, non-zero otherwise
----------------------------------------------------------------*/
-static int p80211knetdev_open( netdevice_t *netdev )
+static int p80211knetdev_open(netdevice_t *netdev)
{
- int result = 0; /* success */
- wlandevice_t *wlandev = netdev->ml_priv;
-
- DBFENTER;
+ int result = 0; /* success */
+ wlandevice_t *wlandev = netdev->ml_priv;
/* Check to make sure the MSD is running */
- if ( wlandev->msdstate != WLAN_MSD_RUNNING ) {
+ if (wlandev->msdstate != WLAN_MSD_RUNNING)
return -ENODEV;
- }
/* Tell the MSD to open */
- if ( wlandev->open != NULL) {
+ if (wlandev->open != NULL) {
result = wlandev->open(wlandev);
- if ( result == 0 ) {
-#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43) )
- netdev->interrupt = 0;
-#endif
- p80211netdev_start_queue(wlandev);
+ if (result == 0) {
+ netif_start_queue(wlandev->netdev);
wlandev->state = WLAN_DEVICE_OPEN;
}
} else {
result = -EAGAIN;
}
- DBFEXIT;
return result;
}
-
/*----------------------------------------------------------------
* p80211knetdev_stop
*
@@ -312,21 +206,17 @@ static int p80211knetdev_open( netdevice_t *netdev )
* Returns:
* zero on success, non-zero otherwise
----------------------------------------------------------------*/
-static int p80211knetdev_stop( netdevice_t *netdev )
+static int p80211knetdev_stop(netdevice_t *netdev)
{
- int result = 0;
- wlandevice_t *wlandev = netdev->ml_priv;
-
- DBFENTER;
+ int result = 0;
+ wlandevice_t *wlandev = netdev->ml_priv;
- if ( wlandev->close != NULL ) {
+ if (wlandev->close != NULL)
result = wlandev->close(wlandev);
- }
- p80211netdev_stop_queue(wlandev);
+ netif_stop_queue(wlandev->netdev);
wlandev->state = WLAN_DEVICE_CLOSED;
- DBFEXIT;
return result;
}
@@ -343,50 +233,74 @@ static int p80211knetdev_stop( netdevice_t *netdev )
* Side effects:
*
----------------------------------------------------------------*/
-void
-p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb )
+void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
{
- DBFENTER;
-
/* Enqueue for post-irq processing */
skb_queue_tail(&wlandev->nsd_rxq, skb);
-
tasklet_schedule(&wlandev->rx_bh);
+}
+
+#define CONV_TO_ETHER_SKIPPED 0x01
+#define CONV_TO_ETHER_FAILED 0x02
+
+/**
+ * p80211_convert_to_ether - conversion from 802.11 frame to ethernet frame
+ * @wlandev: pointer to WLAN device
+ * @skb: pointer to socket buffer
+ *
+ * Returns: 0 if conversion succeeded
+ * CONV_TO_ETHER_FAILED if conversion failed
+ * CONV_TO_ETHER_SKIPPED if frame is ignored
+ */
+static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb)
+{
+ struct p80211_hdr_a3 *hdr;
+
+ hdr = (struct p80211_hdr_a3 *) skb->data;
+ if (p80211_rx_typedrop(wlandev, hdr->fc))
+ return CONV_TO_ETHER_SKIPPED;
+
+ /* perform mcast filtering: allow my local address through but reject
+ * anything else that isn't multicast
+ */
+ if (wlandev->netdev->flags & IFF_ALLMULTI) {
+ if (!ether_addr_equal_unaligned(wlandev->netdev->dev_addr,
+ hdr->a1)) {
+ if (!is_multicast_ether_addr(hdr->a1))
+ return CONV_TO_ETHER_SKIPPED;
+ }
+ }
+
+ if (skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0) {
+ skb->dev->last_rx = jiffies;
+ wlandev->linux_stats.rx_packets++;
+ wlandev->linux_stats.rx_bytes += skb->len;
+ netif_rx_ni(skb);
+ return 0;
+ }
- DBFEXIT;
- return;
+ netdev_dbg(wlandev->netdev, "p80211_convert_to_ether failed.\n");
+ return CONV_TO_ETHER_FAILED;
}
-/*----------------------------------------------------------------
-* p80211netdev_rx_bh
-*
-* Deferred processing of all received frames.
-*
-* Arguments:
-* wlandev WLAN network device structure
-* skb skbuff containing a full 802.11 frame.
-* Returns:
-* nothing
-* Side effects:
-*
-----------------------------------------------------------------*/
+/**
+ * p80211netdev_rx_bh - deferred processing of all received frames
+ *
+ * @arg: pointer to WLAN network device structure (cast to unsigned long)
+ */
static void p80211netdev_rx_bh(unsigned long arg)
{
wlandevice_t *wlandev = (wlandevice_t *) arg;
struct sk_buff *skb = NULL;
- netdevice_t *dev = wlandev->netdev;
- p80211_hdr_a3_t *hdr;
- UINT16 fc;
-
- DBFENTER;
+ netdevice_t *dev = wlandev->netdev;
/* Let's empty our our queue */
- while ( (skb = skb_dequeue(&wlandev->nsd_rxq)) ) {
+ while ((skb = skb_dequeue(&wlandev->nsd_rxq))) {
if (wlandev->state == WLAN_DEVICE_OPEN) {
if (dev->type != ARPHRD_ETHER) {
/* RAW frame; we shouldn't convert it */
- // XXX Append the Prism Header here instead.
+ /* XXX Append the Prism Header here instead. */
/* set up various data fields */
skb->dev = dev;
@@ -401,42 +315,14 @@ static void p80211netdev_rx_bh(unsigned long arg)
netif_rx_ni(skb);
continue;
} else {
- hdr = (p80211_hdr_a3_t *)skb->data;
- fc = ieee2host16(hdr->fc);
- if (p80211_rx_typedrop(wlandev, fc)) {
- dev_kfree_skb(skb);
- continue;
- }
-
- /* perform mcast filtering */
- if (wlandev->netdev->flags & IFF_ALLMULTI) {
- /* allow my local address through */
- if (memcmp(hdr->a1, wlandev->netdev->dev_addr, WLAN_ADDR_LEN) != 0) {
- /* but reject anything else that isn't multicast */
- if (!(hdr->a1[0] & 0x01)) {
- dev_kfree_skb(skb);
- continue;
- }
- }
- }
-
- if ( skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0 ) {
- skb->dev->last_rx = jiffies;
- wlandev->linux_stats.rx_packets++;
- wlandev->linux_stats.rx_bytes += skb->len;
- netif_rx_ni(skb);
+ if (!p80211_convert_to_ether(wlandev, skb))
continue;
- }
- WLAN_LOG_DEBUG(1, "p80211_to_ether failed.\n");
}
}
dev_kfree_skb(skb);
}
-
- DBFEXIT;
}
-
/*----------------------------------------------------------------
* p80211knetdev_hard_start_xmit
*
@@ -456,53 +342,38 @@ static void p80211netdev_rx_bh(unsigned long arg)
* Returns:
* zero on success, non-zero on failure.
----------------------------------------------------------------*/
-static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netdev)
+static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
+ netdevice_t *netdev)
{
- int result = 0;
- int txresult = -1;
- wlandevice_t *wlandev = netdev->ml_priv;
- p80211_hdr_t p80211_hdr;
- p80211_metawep_t p80211_wep;
+ int result = 0;
+ int txresult = -1;
+ wlandevice_t *wlandev = netdev->ml_priv;
+ union p80211_hdr p80211_hdr;
+ struct p80211_metawep p80211_wep;
- DBFENTER;
+ p80211_wep.data = NULL;
- if (skb == NULL) {
- return 0;
- }
+ if (skb == NULL)
+ return NETDEV_TX_OK;
- if (wlandev->state != WLAN_DEVICE_OPEN) {
+ if (wlandev->state != WLAN_DEVICE_OPEN) {
result = 1;
goto failed;
}
- memset(&p80211_hdr, 0, sizeof(p80211_hdr_t));
- memset(&p80211_wep, 0, sizeof(p80211_metawep_t));
+ memset(&p80211_hdr, 0, sizeof(union p80211_hdr));
+ memset(&p80211_wep, 0, sizeof(struct p80211_metawep));
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
- if ( test_and_set_bit(0, (void*)&(netdev->tbusy)) != 0 ) {
- /* We've been called w/ tbusy set, has the tx */
- /* path stalled? */
- WLAN_LOG_DEBUG(1, "called when tbusy set\n");
- result = 1;
- goto failed;
- }
-#else
- if ( netif_queue_stopped(netdev) ) {
- WLAN_LOG_DEBUG(1, "called when queue stopped.\n");
+ if (netif_queue_stopped(netdev)) {
+ netdev_dbg(netdev, "called when queue stopped.\n");
result = 1;
goto failed;
}
netif_stop_queue(netdev);
- /* No timeout handling here, 2.3.38+ kernels call the
- * timeout function directly.
- * TODO: Add timeout handling.
- */
-#endif
-
/* Check to see that a valid mode is set */
- switch( wlandev->macmode ) {
+ switch (wlandev->macmode) {
case WLAN_MACMODE_IBSS_STA:
case WLAN_MACMODE_ESS_STA:
case WLAN_MACMODE_ESS_AP:
@@ -512,10 +383,9 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd
* and return success .
* TODO: we need a saner way to handle this
*/
- if(skb->protocol != ETH_P_80211_RAW) {
- p80211netdev_start_queue(wlandev);
- WLAN_LOG_NOTICE(
- "Tx attempt prior to association, frame dropped.\n");
+ if (skb->protocol != ETH_P_80211_RAW) {
+ netif_start_queue(wlandev->netdev);
+ netdev_notice(netdev, "Tx attempt prior to association, frame dropped.\n");
wlandev->linux_stats.tx_dropped++;
result = 0;
goto failed;
@@ -524,24 +394,26 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd
}
/* Check for raw transmits */
- if(skb->protocol == ETH_P_80211_RAW) {
+ if (skb->protocol == ETH_P_80211_RAW) {
if (!capable(CAP_NET_ADMIN)) {
result = 1;
goto failed;
}
/* move the header over */
- memcpy(&p80211_hdr, skb->data, sizeof(p80211_hdr_t));
- skb_pull(skb, sizeof(p80211_hdr_t));
+ memcpy(&p80211_hdr, skb->data, sizeof(union p80211_hdr));
+ skb_pull(skb, sizeof(union p80211_hdr));
} else {
- if ( skb_ether_to_p80211(wlandev, wlandev->ethconv, skb, &p80211_hdr, &p80211_wep) != 0 ) {
+ if (skb_ether_to_p80211
+ (wlandev, wlandev->ethconv, skb, &p80211_hdr,
+ &p80211_wep) != 0) {
/* convert failed */
- WLAN_LOG_DEBUG(1, "ether_to_80211(%d) failed.\n",
- wlandev->ethconv);
+ netdev_dbg(netdev, "ether_to_80211(%d) failed.\n",
+ wlandev->ethconv);
result = 1;
goto failed;
}
}
- if ( wlandev->txframe == NULL ) {
+ if (wlandev->txframe == NULL) {
result = 1;
goto failed;
}
@@ -554,45 +426,43 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd
txresult = wlandev->txframe(wlandev, skb, &p80211_hdr, &p80211_wep);
- if ( txresult == 0) {
+ if (txresult == 0) {
/* success and more buf */
/* avail, re: hw_txdata */
- p80211netdev_wake_queue(wlandev);
- result = 0;
- } else if ( txresult == 1 ) {
+ netif_wake_queue(wlandev->netdev);
+ result = NETDEV_TX_OK;
+ } else if (txresult == 1) {
/* success, no more avail */
- WLAN_LOG_DEBUG(3, "txframe success, no more bufs\n");
+ netdev_dbg(netdev, "txframe success, no more bufs\n");
/* netdev->tbusy = 1; don't set here, irqhdlr */
/* may have already cleared it */
- result = 0;
- } else if ( txresult == 2 ) {
+ result = NETDEV_TX_OK;
+ } else if (txresult == 2) {
/* alloc failure, drop frame */
- WLAN_LOG_DEBUG(3, "txframe returned alloc_fail\n");
- result = 1;
+ netdev_dbg(netdev, "txframe returned alloc_fail\n");
+ result = NETDEV_TX_BUSY;
} else {
/* buffer full or queue busy, drop frame. */
- WLAN_LOG_DEBUG(3, "txframe returned full or busy\n");
- result = 1;
+ netdev_dbg(netdev, "txframe returned full or busy\n");
+ result = NETDEV_TX_BUSY;
}
- failed:
+failed:
/* Free up the WEP buffer if it's not the same as the skb */
if ((p80211_wep.data) && (p80211_wep.data != skb->data))
- kfree(p80211_wep.data);
+ kzfree(p80211_wep.data);
/* we always free the skb here, never in a lower level. */
if (!result)
dev_kfree_skb(skb);
- DBFEXIT;
return result;
}
-
/*----------------------------------------------------------------
* p80211knetdev_set_multicast_list
*
-* Called from higher lavers whenever there's a need to set/clear
+* Called from higher layers whenever there's a need to set/clear
* promiscuous mode or rewrite the multicast list.
*
* Arguments:
@@ -603,23 +473,20 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd
----------------------------------------------------------------*/
static void p80211knetdev_set_multicast_list(netdevice_t *dev)
{
- wlandevice_t *wlandev = dev->ml_priv;
-
- DBFENTER;
+ wlandevice_t *wlandev = dev->ml_priv;
/* TODO: real multicast support as well */
if (wlandev->set_multicast_list)
wlandev->set_multicast_list(wlandev, dev);
- DBFEXIT;
}
#ifdef SIOCETHTOOL
static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
{
- UINT32 ethcmd;
+ u32 ethcmd;
struct ethtool_drvinfo info;
struct ethtool_value edata;
@@ -637,9 +504,6 @@ static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
snprintf(info.version, sizeof(info.version), "%s",
WLAN_RELEASE);
- // info.fw_version
- // info.bus_info
-
if (copy_to_user(useraddr, &info, sizeof(info)))
return -EFAULT;
return 0;
@@ -655,10 +519,10 @@ static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
}
if (copy_to_user(useraddr, &edata, sizeof(edata)))
- return -EFAULT;
+ return -EFAULT;
return 0;
- }
#endif
+ }
return -EOPNOTSUPP;
}
@@ -686,7 +550,7 @@ static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
* -EFAULT memory fault copying msg from user buffer
* -ENOMEM unable to allocate kernel msg buffer
* -ENOSYS bad magic, it the cmd really for us?
-* -EINTR sleeping on cmd, awakened by signal, cmd cancelled.
+* -EintR sleeping on cmd, awakened by signal, cmd cancelled.
*
* Call Context:
* Process thread (ioctl caller). TODO: SMP support may require
@@ -694,55 +558,46 @@ static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
----------------------------------------------------------------*/
static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
{
- int result = 0;
- p80211ioctl_req_t *req = (p80211ioctl_req_t*)ifr;
- wlandevice_t *wlandev = dev->ml_priv;
- UINT8 *msgbuf;
- DBFENTER;
-
- WLAN_LOG_DEBUG(2, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len);
-
-#if WIRELESS_EXT < 13
- /* Is this a wireless extensions ioctl? */
- if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
- if ((result = p80211wext_support_ioctl(dev, ifr, cmd))
- != (-EOPNOTSUPP)) {
- goto bail;
- }
- }
-#endif
+ int result = 0;
+ struct p80211ioctl_req *req = (struct p80211ioctl_req *) ifr;
+ wlandevice_t *wlandev = dev->ml_priv;
+ u8 *msgbuf;
+
+ netdev_dbg(dev, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len);
#ifdef SIOCETHTOOL
if (cmd == SIOCETHTOOL) {
- result = p80211netdev_ethtool(wlandev, (void __user *) ifr->ifr_data);
+ result =
+ p80211netdev_ethtool(wlandev, (void __user *)ifr->ifr_data);
goto bail;
}
#endif
/* Test the magic, assume ifr is good if it's there */
- if ( req->magic != P80211_IOCTL_MAGIC ) {
+ if (req->magic != P80211_IOCTL_MAGIC) {
result = -ENOSYS;
goto bail;
}
- if ( cmd == P80211_IFTEST ) {
+ if (cmd == P80211_IFTEST) {
result = 0;
goto bail;
- } else if ( cmd != P80211_IFREQ ) {
+ } else if (cmd != P80211_IFREQ) {
result = -ENOSYS;
goto bail;
}
/* Allocate a buf of size req->len */
- if ((msgbuf = kmalloc( req->len, GFP_KERNEL))) {
- if ( copy_from_user( msgbuf, (void __user *) req->data, req->len) ) {
+ msgbuf = kmalloc(req->len, GFP_KERNEL);
+ if (msgbuf) {
+ if (copy_from_user(msgbuf, (void __user *)req->data, req->len))
result = -EFAULT;
- } else {
- result = p80211req_dorequest( wlandev, msgbuf);
- }
+ else
+ result = p80211req_dorequest(wlandev, msgbuf);
- if ( result == 0 ) {
- if ( copy_to_user( (void __user *) req->data, msgbuf, req->len)) {
+ if (result == 0) {
+ if (copy_to_user
+ ((void __user *)req->data, msgbuf, req->len)) {
result = -EFAULT;
}
}
@@ -751,9 +606,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
result = -ENOMEM;
}
bail:
- DBFEXIT;
-
- return result; /* If allocate,copyfrom or copyto fails, return errno */
+ /* If allocate,copyfrom or copyto fails, return errno */
+ return result;
}
/*----------------------------------------------------------------
@@ -783,37 +637,28 @@ bail:
----------------------------------------------------------------*/
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
{
- struct sockaddr *new_addr = addr;
- p80211msg_dot11req_mibset_t dot11req;
- p80211item_unk392_t *mibattr;
- p80211item_pstr6_t *macaddr;
- p80211item_uint32_t *resultcode;
- int result = 0;
+ struct sockaddr *new_addr = addr;
+ struct p80211msg_dot11req_mibset dot11req;
+ p80211item_unk392_t *mibattr;
+ p80211item_pstr6_t *macaddr;
+ p80211item_uint32_t *resultcode;
+ int result;
- DBFENTER;
/* If we're running, we don't allow MAC address changes */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
- if ( dev->start) {
+ if (netif_running(dev))
return -EBUSY;
- }
-#else
- if (netif_running(dev)) {
- return -EBUSY;
- }
-#endif
/* Set up some convenience pointers. */
mibattr = &dot11req.mibattribute;
- macaddr = (p80211item_pstr6_t*)&mibattr->data;
+ macaddr = (p80211item_pstr6_t *) &mibattr->data;
resultcode = &dot11req.resultcode;
/* Set up a dot11req_mibset */
- memset(&dot11req, 0, sizeof(p80211msg_dot11req_mibset_t));
+ memset(&dot11req, 0, sizeof(struct p80211msg_dot11req_mibset));
dot11req.msgcode = DIDmsg_dot11req_mibset;
- dot11req.msglen = sizeof(p80211msg_dot11req_mibset_t);
+ dot11req.msglen = sizeof(struct p80211msg_dot11req_mibset);
memcpy(dot11req.devname,
- ((wlandevice_t *)dev->ml_priv)->name,
- WLAN_DEVNAMELEN_MAX - 1);
+ ((wlandevice_t *) dev->ml_priv)->name, WLAN_DEVNAMELEN_MAX - 1);
/* Set up the mibattribute argument */
mibattr->did = DIDmsg_dot11req_mibset_mibattribute;
@@ -823,8 +668,8 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
macaddr->did = DIDmib_dot11mac_dot11OperationTable_dot11MACAddress;
macaddr->status = P80211ENUM_msgitem_status_data_ok;
macaddr->len = sizeof(macaddr->data);
- macaddr->data.len = WLAN_ADDR_LEN;
- memcpy(&macaddr->data.data, new_addr->sa_data, WLAN_ADDR_LEN);
+ macaddr->data.len = ETH_ALEN;
+ memcpy(&macaddr->data.data, new_addr->sa_data, ETH_ALEN);
/* Set up the resultcode argument */
resultcode->did = DIDmsg_dot11req_mibset_resultcode;
@@ -833,40 +678,47 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
resultcode->data = 0;
/* now fire the request */
- result = p80211req_dorequest(dev->ml_priv, (UINT8 *)&dot11req);
+ result = p80211req_dorequest(dev->ml_priv, (u8 *) &dot11req);
/* If the request wasn't successful, report an error and don't
* change the netdev address
*/
- if ( result != 0 || resultcode->data != P80211ENUM_resultcode_success) {
- WLAN_LOG_ERROR(
- "Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
+ if (result != 0 || resultcode->data != P80211ENUM_resultcode_success) {
+ netdev_err(dev, "Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
result = -EADDRNOTAVAIL;
} else {
/* everything's ok, change the addr in netdev */
memcpy(dev->dev_addr, new_addr->sa_data, dev->addr_len);
}
- DBFEXIT;
return result;
}
static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
{
- DBFENTER;
- // 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
- // and another 8 for wep.
- if ( (new_mtu < 68) || (new_mtu > (2312 - 20 - 8)))
- return -EINVAL;
+ /* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
+ and another 8 for wep. */
+ if ((new_mtu < 68) || (new_mtu > (2312 - 20 - 8)))
+ return -EINVAL;
- dev->mtu = new_mtu;
+ dev->mtu = new_mtu;
- DBFEXIT;
-
- return 0;
+ return 0;
}
-
+static const struct net_device_ops p80211_netdev_ops = {
+ .ndo_init = p80211knetdev_init,
+ .ndo_open = p80211knetdev_open,
+ .ndo_stop = p80211knetdev_stop,
+ .ndo_get_stats = p80211knetdev_get_stats,
+ .ndo_start_xmit = p80211knetdev_hard_start_xmit,
+ .ndo_set_rx_mode = p80211knetdev_set_multicast_list,
+ .ndo_do_ioctl = p80211knetdev_do_ioctl,
+ .ndo_set_mac_address = p80211knetdev_set_mac_address,
+ .ndo_tx_timeout = p80211knetdev_tx_timeout,
+ .ndo_change_mtu = wlan_change_mtu,
+ .ndo_validate_addr = eth_validate_addr,
+};
/*----------------------------------------------------------------
* wlan_setup
@@ -882,6 +734,7 @@ static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
* Arguments:
* wlandev ptr to the wlandev structure for the
* interface.
+* physdev ptr to usb device
* Returns:
* zero on success, non-zero otherwise.
* Call Context:
@@ -890,12 +743,12 @@ static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
* compiled drivers, this function will be called in the
* context of the kernel startup code.
----------------------------------------------------------------*/
-int wlan_setup(wlandevice_t *wlandev)
+int wlan_setup(wlandevice_t *wlandev, struct device *physdev)
{
- int result = 0;
- netdevice_t *dev;
-
- DBFENTER;
+ int result = 0;
+ netdevice_t *netdev;
+ struct wiphy *wiphy;
+ struct wireless_dev *wdev;
/* Set up the wlandev */
wlandev->state = WLAN_DEVICE_CLOSED;
@@ -905,60 +758,35 @@ int wlan_setup(wlandevice_t *wlandev)
/* Set up the rx queue */
skb_queue_head_init(&wlandev->nsd_rxq);
tasklet_init(&wlandev->rx_bh,
- p80211netdev_rx_bh,
- (unsigned long)wlandev);
+ p80211netdev_rx_bh, (unsigned long)wlandev);
+
+ /* Allocate and initialize the wiphy struct */
+ wiphy = wlan_create_wiphy(physdev, wlandev);
+ if (wiphy == NULL) {
+ dev_err(physdev, "Failed to alloc wiphy.\n");
+ return 1;
+ }
/* Allocate and initialize the struct device */
- dev = kmalloc(sizeof(netdevice_t), GFP_ATOMIC);
- if ( dev == NULL ) {
- WLAN_LOG_ERROR("Failed to alloc netdev.\n");
+ netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d",
+ ether_setup);
+ if (netdev == NULL) {
+ dev_err(physdev, "Failed to alloc netdev.\n");
+ wlan_free_wiphy(wiphy);
result = 1;
} else {
- memset( dev, 0, sizeof(netdevice_t));
- ether_setup(dev);
- wlandev->netdev = dev;
- dev->ml_priv = wlandev;
- dev->hard_start_xmit = p80211knetdev_hard_start_xmit;
- dev->get_stats = p80211knetdev_get_stats;
-#ifdef HAVE_PRIVATE_IOCTL
- dev->do_ioctl = p80211knetdev_do_ioctl;
-#endif
-#ifdef HAVE_MULTICAST
- dev->set_multicast_list = p80211knetdev_set_multicast_list;
-#endif
- dev->init = p80211knetdev_init;
- dev->open = p80211knetdev_open;
- dev->stop = p80211knetdev_stop;
-
-#ifdef CONFIG_NET_WIRELESS
-#if ((WIRELESS_EXT < 17) && (WIRELESS_EXT < 21))
- dev->get_wireless_stats = p80211wext_get_wireless_stats;
-#endif
-#if WIRELESS_EXT > 12
- dev->wireless_handlers = &p80211wext_handler_def;
-#endif
-#endif
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
- dev->tbusy = 1;
- dev->start = 0;
-#else
- netif_stop_queue(dev);
-#endif
-#ifdef HAVE_CHANGE_MTU
- dev->change_mtu = wlan_change_mtu;
-#endif
-#ifdef HAVE_SET_MAC_ADDR
- dev->set_mac_address = p80211knetdev_set_mac_address;
-#endif
-#ifdef HAVE_TX_TIMEOUT
- dev->tx_timeout = &p80211knetdev_tx_timeout;
- dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000;
-#endif
- netif_carrier_off(dev);
+ wlandev->netdev = netdev;
+ netdev->ml_priv = wlandev;
+ netdev->netdev_ops = &p80211_netdev_ops;
+ wdev = netdev_priv(netdev);
+ wdev->wiphy = wiphy;
+ wdev->iftype = NL80211_IFTYPE_STATION;
+ netdev->ieee80211_ptr = wdev;
+
+ netif_stop_queue(netdev);
+ netif_carrier_off(netdev);
}
- DBFEXIT;
return result;
}
@@ -975,36 +803,27 @@ int wlan_setup(wlandevice_t *wlandev)
* Arguments:
* wlandev ptr to the wlandev structure for the
* interface.
-* Returns:
-* zero on success, non-zero otherwise.
* Call Context:
* Should be process thread. We'll assume it might be
* interrupt though. When we add support for statically
* compiled drivers, this function will be called in the
* context of the kernel startup code.
----------------------------------------------------------------*/
-int wlan_unsetup(wlandevice_t *wlandev)
+void wlan_unsetup(wlandevice_t *wlandev)
{
- int result = 0;
-
- DBFENTER;
+ struct wireless_dev *wdev;
tasklet_kill(&wlandev->rx_bh);
- if (wlandev->netdev == NULL ) {
- WLAN_LOG_ERROR("called without wlandev->netdev set.\n");
- result = 1;
- } else {
+ if (wlandev->netdev) {
+ wdev = netdev_priv(wlandev->netdev);
+ if (wdev->wiphy)
+ wlan_free_wiphy(wdev->wiphy);
free_netdev(wlandev->netdev);
wlandev->netdev = NULL;
}
-
- DBFEXIT;
- return 0;
}
-
-
/*----------------------------------------------------------------
* register_wlandev
*
@@ -1026,51 +845,9 @@ int wlan_unsetup(wlandevice_t *wlandev)
----------------------------------------------------------------*/
int register_wlandev(wlandevice_t *wlandev)
{
- int i = 0;
- netdevice_t *dev = wlandev->netdev;
-
- DBFENTER;
-
- i = dev_alloc_name(wlandev->netdev, "wlan%d");
- if (i >= 0) {
- i = register_netdev(wlandev->netdev);
- }
- if (i != 0) {
- return -EIO;
- }
-
-#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) )
- dev->name = wlandev->name;
-#else
- strcpy(wlandev->name, dev->name);
-#endif
-
-#ifdef CONFIG_PROC_FS
- if (proc_p80211) {
- wlandev->procdir = proc_mkdir(wlandev->name, proc_p80211);
- if ( wlandev->procdir )
- wlandev->procwlandev =
- create_proc_read_entry("wlandev", 0,
- wlandev->procdir,
- p80211netdev_proc_read,
- wlandev);
- if (wlandev->nsd_proc_read)
- create_proc_read_entry("nsd", 0,
- wlandev->procdir,
- wlandev->nsd_proc_read,
- wlandev);
- }
-#endif
-
-#ifdef CONFIG_HOTPLUG
- p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_REGISTER);
-#endif
-
- DBFEXIT;
- return 0;
+ return register_netdev(wlandev->netdev);
}
-
/*----------------------------------------------------------------
* unregister_wlandev
*
@@ -1092,106 +869,15 @@ int unregister_wlandev(wlandevice_t *wlandev)
{
struct sk_buff *skb;
- DBFENTER;
-
-#ifdef CONFIG_HOTPLUG
- p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_REMOVE);
-#endif
-
-#ifdef CONFIG_PROC_FS
- if ( wlandev->procwlandev ) {
- remove_proc_entry("wlandev", wlandev->procdir);
- }
- if ( wlandev->nsd_proc_read ) {
- remove_proc_entry("nsd", wlandev->procdir);
- }
- if (wlandev->procdir) {
- remove_proc_entry(wlandev->name, proc_p80211);
- }
-#endif
-
unregister_netdev(wlandev->netdev);
/* Now to clean out the rx queue */
- while ( (skb = skb_dequeue(&wlandev->nsd_rxq)) ) {
+ while ((skb = skb_dequeue(&wlandev->nsd_rxq)))
dev_kfree_skb(skb);
- }
- DBFEXIT;
return 0;
}
-#ifdef CONFIG_PROC_FS
-/*----------------------------------------------------------------
-* proc_read
-*
-* Read function for /proc/net/p80211/<device>/wlandev
-*
-* Arguments:
-* buf
-* start
-* offset
-* count
-* eof
-* data
-* Returns:
-* zero on success, non-zero otherwise.
-* Call Context:
-* Can be either interrupt or not.
-----------------------------------------------------------------*/
-static int
-p80211netdev_proc_read(
- char *page,
- char **start,
- off_t offset,
- int count,
- int *eof,
- void *data)
-{
- char *p = page;
- wlandevice_t *wlandev = (wlandevice_t *) data;
-
- DBFENTER;
- if (offset != 0) {
- *eof = 1;
- goto exit;
- }
-
- p += sprintf(p, "p80211 version: %s (%s)\n\n",
- WLAN_RELEASE, WLAN_BUILD_DATE);
- p += sprintf(p, "name : %s\n", wlandev->name);
- p += sprintf(p, "nsd name : %s\n", wlandev->nsdname);
- p += sprintf(p, "address : %02x:%02x:%02x:%02x:%02x:%02x\n",
- wlandev->netdev->dev_addr[0], wlandev->netdev->dev_addr[1], wlandev->netdev->dev_addr[2],
- wlandev->netdev->dev_addr[3], wlandev->netdev->dev_addr[4], wlandev->netdev->dev_addr[5]);
- p += sprintf(p, "nsd caps : %s%s%s%s%s%s%s%s%s%s\n",
- (wlandev->nsdcaps & P80211_NSDCAP_HARDWAREWEP) ? "wep_hw " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_TIEDWEP) ? "wep_tied " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_NOHOSTWEP) ? "wep_hw_only " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_PBCC) ? "pbcc " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_SHORT_PREAMBLE) ? "short_preamble " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_AGILITY) ? "agility " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_AP_RETRANSMIT) ? "ap_retransmit " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_HWFRAGMENT) ? "hw_frag " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_AUTOJOIN) ? "autojoin " : "",
- (wlandev->nsdcaps & P80211_NSDCAP_NOSCAN) ? "" : "scan ");
-
-
- p += sprintf(p, "bssid : %02x:%02x:%02x:%02x:%02x:%02x\n",
- wlandev->bssid[0], wlandev->bssid[1], wlandev->bssid[2],
- wlandev->bssid[3], wlandev->bssid[4], wlandev->bssid[5]);
-
- p += sprintf(p, "Enabled : %s%s\n",
- (wlandev->shortpreamble) ? "short_preamble " : "",
- (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) ? "privacy" : "");
-
-
- exit:
- DBFEXIT;
- return (p - page);
-}
-#endif
-
/*----------------------------------------------------------------
* p80211netdev_hwremoved
*
@@ -1224,18 +910,13 @@ p80211netdev_proc_read(
----------------------------------------------------------------*/
void p80211netdev_hwremoved(wlandevice_t *wlandev)
{
- DBFENTER;
wlandev->hwremoved = 1;
- if ( wlandev->state == WLAN_DEVICE_OPEN) {
- p80211netdev_stop_queue(wlandev);
- }
+ if (wlandev->state == WLAN_DEVICE_OPEN)
+ netif_stop_queue(wlandev->netdev);
netif_device_detach(wlandev->netdev);
-
- DBFEXIT;
}
-
/*----------------------------------------------------------------
* p80211_rx_typedrop
*
@@ -1257,28 +938,28 @@ void p80211netdev_hwremoved(wlandevice_t *wlandev)
* Call context:
* interrupt
----------------------------------------------------------------*/
-static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
+static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
{
- UINT16 ftype;
- UINT16 fstype;
- int drop = 0;
+ u16 ftype;
+ u16 fstype;
+ int drop = 0;
/* Classify frame, increment counter */
ftype = WLAN_GET_FC_FTYPE(fc);
fstype = WLAN_GET_FC_FSTYPE(fc);
#if 0
- WLAN_LOG_DEBUG(4,
- "rx_typedrop : ftype=%d fstype=%d.\n", ftype, fstype);
+ netdev_dbg(wlandev->netdev, "rx_typedrop : ftype=%d fstype=%d.\n",
+ ftype, fstype);
#endif
- switch ( ftype ) {
+ switch (ftype) {
case WLAN_FTYPE_MGMT:
if ((wlandev->netdev->flags & IFF_PROMISC) ||
- (wlandev->netdev->flags & IFF_ALLMULTI)) {
+ (wlandev->netdev->flags & IFF_ALLMULTI)) {
drop = 1;
break;
}
- WLAN_LOG_DEBUG(3, "rx'd mgmt:\n");
+ netdev_dbg(wlandev->netdev, "rx'd mgmt:\n");
wlandev->rx.mgmt++;
- switch( fstype ) {
+ switch (fstype) {
case WLAN_FSTYPE_ASSOCREQ:
/* printk("assocreq"); */
wlandev->rx.assocreq++;
@@ -1334,13 +1015,13 @@ static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
case WLAN_FTYPE_CTL:
if ((wlandev->netdev->flags & IFF_PROMISC) ||
- (wlandev->netdev->flags & IFF_ALLMULTI)) {
+ (wlandev->netdev->flags & IFF_ALLMULTI)) {
drop = 1;
break;
}
- WLAN_LOG_DEBUG(3, "rx'd ctl:\n");
+ netdev_dbg(wlandev->netdev, "rx'd ctl:\n");
wlandev->rx.ctl++;
- switch( fstype ) {
+ switch (fstype) {
case WLAN_FSTYPE_PSPOLL:
/* printk("pspoll"); */
wlandev->rx.pspoll++;
@@ -1376,7 +1057,7 @@ static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
case WLAN_FTYPE_DATA:
wlandev->rx.data++;
- switch( fstype ) {
+ switch (fstype) {
case WLAN_FSTYPE_DATAONLY:
wlandev->rx.dataonly++;
break;
@@ -1390,19 +1071,19 @@ static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
wlandev->rx.data__cfack_cfpoll++;
break;
case WLAN_FSTYPE_NULL:
- WLAN_LOG_DEBUG(3, "rx'd data:null\n");
+ netdev_dbg(wlandev->netdev, "rx'd data:null\n");
wlandev->rx.null++;
break;
case WLAN_FSTYPE_CFACK:
- WLAN_LOG_DEBUG(3, "rx'd data:cfack\n");
+ netdev_dbg(wlandev->netdev, "rx'd data:cfack\n");
wlandev->rx.cfack++;
break;
case WLAN_FSTYPE_CFPOLL:
- WLAN_LOG_DEBUG(3, "rx'd data:cfpoll\n");
+ netdev_dbg(wlandev->netdev, "rx'd data:cfpoll\n");
wlandev->rx.cfpoll++;
break;
case WLAN_FSTYPE_CFACK_CFPOLL:
- WLAN_LOG_DEBUG(3, "rx'd data:cfack_cfpoll\n");
+ netdev_dbg(wlandev->netdev, "rx'd data:cfack_cfpoll\n");
wlandev->rx.cfack_cfpoll++;
break;
default:
@@ -1416,87 +1097,15 @@ static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
return drop;
}
-#ifdef CONFIG_HOTPLUG
-/* Notify userspace when a netdevice event occurs,
- * by running '/sbin/hotplug net' with certain
- * environment variables set.
- */
-int p80211_run_sbin_hotplug(wlandevice_t *wlandev, char *action)
-{
- char *argv[3], *envp[7], ifname[12 + IFNAMSIZ], action_str[32];
- char nsdname[32], wlan_wext[32];
- int i;
-
- if (wlandev) {
- sprintf(ifname, "INTERFACE=%s", wlandev->name);
- sprintf(nsdname, "NSDNAME=%s", wlandev->nsdname);
- } else {
- sprintf(ifname, "INTERFACE=null");
- sprintf(nsdname, "NSDNAME=null");
- }
-
- sprintf(wlan_wext, "WLAN_WEXT=%s", wlan_wext_write ? "y" : "");
- sprintf(action_str, "ACTION=%s", action);
-
- i = 0;
- argv[i++] = hotplug_path;
- argv[i++] = "wlan";
- argv[i] = NULL;
-
- i = 0;
- /* minimal command environment */
- envp [i++] = "HOME=/";
- envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
- envp [i++] = ifname;
- envp [i++] = action_str;
- envp [i++] = nsdname;
- envp [i++] = wlan_wext;
- envp [i] = NULL;
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,62))
- return call_usermodehelper(argv [0], argv, envp);
-#else
- return call_usermodehelper(argv [0], argv, envp, 0);
-#endif
-}
-
-#endif
-
-
-void p80211_suspend(wlandevice_t *wlandev)
-{
- DBFENTER;
-
-#ifdef CONFIG_HOTPLUG
- p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_SUSPEND);
-#endif
-
- DBFEXIT;
-}
-
-void p80211_resume(wlandevice_t *wlandev)
+static void p80211knetdev_tx_timeout(netdevice_t *netdev)
{
- DBFENTER;
-
-#ifdef CONFIG_HOTPLUG
- p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_RESUME);
-#endif
-
- DBFEXIT;
-}
-
-static void p80211knetdev_tx_timeout( netdevice_t *netdev)
-{
- wlandevice_t *wlandev = netdev->ml_priv;
- DBFENTER;
+ wlandevice_t *wlandev = netdev->ml_priv;
if (wlandev->tx_timeout) {
wlandev->tx_timeout(wlandev);
} else {
- WLAN_LOG_WARNING("Implement tx_timeout for %s\n",
- wlandev->nsdname);
- p80211netdev_wake_queue(wlandev);
+ netdev_warn(netdev, "Implement tx_timeout for %s\n",
+ wlandev->nsdname);
+ netif_wake_queue(wlandev->netdev);
}
-
- DBFEXIT;
}