diff options
Diffstat (limited to 'drivers/staging/wlan-ng/p80211netdev.c')
| -rw-r--r-- | drivers/staging/wlan-ng/p80211netdev.c | 304 |
1 files changed, 153 insertions, 151 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 90f499e00dc..00b186c5972 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -75,9 +75,7 @@ #include <net/iw_handler.h> #include <net/net_namespace.h> - -/*================================================================*/ -/* Project Includes */ +#include <net/cfg80211.h> #include "p80211types.h" #include "p80211hdr.h" @@ -90,22 +88,21 @@ #include "p80211metastruct.h" #include "p80211metadef.h" -/* 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_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, + 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_set_mac_address(netdevice_t * dev, void *addr); -static void p80211knetdev_tx_timeout(netdevice_t * netdev); -static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc); +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, u16 fc); int wlan_watchdog = 5000; module_param(wlan_watchdog, int, 0644); @@ -127,7 +124,7 @@ MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions"); * Returns: * nothing ----------------------------------------------------------------*/ -static int p80211knetdev_init(netdevice_t * netdev) +static int p80211knetdev_init(netdevice_t *netdev) { /* Called in response to register_netdev */ /* This is usually the probe function, but the probe has */ @@ -150,7 +147,7 @@ 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; @@ -174,7 +171,7 @@ static struct net_device_stats *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; @@ -209,7 +206,7 @@ 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; @@ -236,36 +233,66 @@ 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) { /* 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; - return; + /* 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; + } + + 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; - u16 fc; /* Let's empty our our queue */ while ((skb = skb_dequeue(&wlandev->nsd_rxq))) { @@ -288,37 +315,8 @@ static void p80211netdev_rx_bh(unsigned long arg) netif_rx_ni(skb); continue; } else { - hdr = (p80211_hdr_a3_t *) skb->data; - fc = le16_to_cpu(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, - ETH_ALEN) != 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; - } - pr_debug("p80211_to_ether failed.\n"); } } dev_kfree_skb(skb); @@ -345,27 +343,29 @@ static void p80211netdev_rx_bh(unsigned long arg) * zero on success, non-zero on failure. ----------------------------------------------------------------*/ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, - netdevice_t * netdev) + 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; + union p80211_hdr p80211_hdr; + struct p80211_metawep p80211_wep; + + p80211_wep.data = NULL; if (skb == NULL) - return 0; + return NETDEV_TX_OK; 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 (netif_queue_stopped(netdev)) { - pr_debug("called when queue stopped.\n"); + netdev_dbg(netdev, "called when queue stopped.\n"); result = 1; goto failed; } @@ -385,8 +385,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, */ if (skb->protocol != ETH_P_80211_RAW) { netif_start_queue(wlandev->netdev); - printk(KERN_NOTICE - "Tx attempt prior to association, frame dropped.\n"); + netdev_notice(netdev, "Tx attempt prior to association, frame dropped.\n"); wlandev->linux_stats.tx_dropped++; result = 0; goto failed; @@ -401,15 +400,15 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, 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) { /* convert failed */ - pr_debug("ether_to_80211(%d) failed.\n", - wlandev->ethconv); + netdev_dbg(netdev, "ether_to_80211(%d) failed.\n", + wlandev->ethconv); result = 1; goto failed; } @@ -434,24 +433,24 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, result = NETDEV_TX_OK; } else if (txresult == 1) { /* success, no more avail */ - pr_debug("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 = NETDEV_TX_OK; } else if (txresult == 2) { /* alloc failure, drop frame */ - pr_debug("txframe returned alloc_fail\n"); + netdev_dbg(netdev, "txframe returned alloc_fail\n"); result = NETDEV_TX_BUSY; } else { /* buffer full or queue busy, drop frame. */ - pr_debug("txframe returned full or busy\n"); + netdev_dbg(netdev, "txframe returned full or busy\n"); result = NETDEV_TX_BUSY; } 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) @@ -463,7 +462,7 @@ failed: /*---------------------------------------------------------------- * 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: @@ -472,7 +471,7 @@ failed: * Returns: * nothing ----------------------------------------------------------------*/ -static void p80211knetdev_set_multicast_list(netdevice_t * dev) +static void p80211knetdev_set_multicast_list(netdevice_t *dev) { wlandevice_t *wlandev = dev->ml_priv; @@ -485,7 +484,7 @@ static void p80211knetdev_set_multicast_list(netdevice_t * dev) #ifdef SIOCETHTOOL -static int p80211netdev_ethtool(wlandevice_t * wlandev, void __user * useraddr) +static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr) { u32 ethcmd; struct ethtool_drvinfo info; @@ -522,8 +521,8 @@ static int p80211netdev_ethtool(wlandevice_t * wlandev, void __user * useraddr) if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; - } #endif + } return -EOPNOTSUPP; } @@ -557,14 +556,14 @@ static int p80211netdev_ethtool(wlandevice_t * wlandev, void __user * useraddr) * Process thread (ioctl caller). TODO: SMP support may require * locks. ----------------------------------------------------------------*/ -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) { int result = 0; - p80211ioctl_req_t *req = (p80211ioctl_req_t *) ifr; + struct p80211ioctl_req *req = (struct p80211ioctl_req *) ifr; wlandevice_t *wlandev = dev->ml_priv; u8 *msgbuf; - pr_debug("rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); + netdev_dbg(dev, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); #ifdef SIOCETHTOOL if (cmd == SIOCETHTOOL) { @@ -589,7 +588,8 @@ static int p80211knetdev_do_ioctl(netdevice_t * dev, struct ifreq *ifr, int cmd) } /* Allocate a buf of size req->len */ - if ((msgbuf = kmalloc(req->len, GFP_KERNEL))) { + msgbuf = kmalloc(req->len, GFP_KERNEL); + if (msgbuf) { if (copy_from_user(msgbuf, (void __user *)req->data, req->len)) result = -EFAULT; else @@ -606,7 +606,8 @@ static int p80211knetdev_do_ioctl(netdevice_t * dev, struct ifreq *ifr, int cmd) result = -ENOMEM; } bail: - return result; /* If allocate,copyfrom or copyto fails, return errno */ + /* If allocate,copyfrom or copyto fails, return errno */ + return result; } /*---------------------------------------------------------------- @@ -634,14 +635,14 @@ bail: * * by: Collin R. Mulliner <collin@mulliner.org> ----------------------------------------------------------------*/ -static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr) +static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) { struct sockaddr *new_addr = addr; - p80211msg_dot11req_mibset_t dot11req; + struct p80211msg_dot11req_mibset dot11req; p80211item_unk392_t *mibattr; p80211item_pstr6_t *macaddr; p80211item_uint32_t *resultcode; - int result = 0; + int result; /* If we're running, we don't allow MAC address changes */ if (netif_running(dev)) @@ -649,13 +650,13 @@ static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr) /* 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); @@ -677,14 +678,13 @@ static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr) resultcode->data = 0; /* now fire the request */ - result = p80211req_dorequest(dev->ml_priv, (u8 *) & 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) { - printk(KERN_ERR - "Low-level driver failed dot11req_mibset(dot11MACAddress).\n"); + netdev_err(dev, "Low-level driver failed dot11req_mibset(dot11MACAddress).\n"); result = -EADDRNOTAVAIL; } else { /* everything's ok, change the addr in netdev */ @@ -694,7 +694,7 @@ static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr) return result; } -static int wlan_change_mtu(netdevice_t * dev, int new_mtu) +static int wlan_change_mtu(netdevice_t *dev, int new_mtu) { /* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap) and another 8 for wep. */ @@ -712,7 +712,7 @@ static const struct net_device_ops p80211_netdev_ops = { .ndo_stop = p80211knetdev_stop, .ndo_get_stats = p80211knetdev_get_stats, .ndo_start_xmit = p80211knetdev_hard_start_xmit, - .ndo_set_multicast_list = p80211knetdev_set_multicast_list, + .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, @@ -734,6 +734,7 @@ static const struct net_device_ops p80211_netdev_ops = { * Arguments: * wlandev ptr to the wlandev structure for the * interface. +* physdev ptr to usb device * Returns: * zero on success, non-zero otherwise. * Call Context: @@ -742,10 +743,12 @@ static const struct net_device_ops p80211_netdev_ops = { * 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; + netdevice_t *netdev; + struct wiphy *wiphy; + struct wireless_dev *wdev; /* Set up the wlandev */ wlandev->state = WLAN_DEVICE_CLOSED; @@ -757,23 +760,31 @@ int wlan_setup(wlandevice_t * wlandev) tasklet_init(&wlandev->rx_bh, 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 = alloc_netdev(0, "wlan%d", ether_setup); - if (dev == NULL) { - printk(KERN_ERR "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 { - wlandev->netdev = dev; - dev->ml_priv = wlandev; - dev->netdev_ops = &p80211_netdev_ops; - -#if (WIRELESS_EXT < 21) - dev->get_wireless_stats = p80211wext_get_wireless_stats; -#endif - dev->wireless_handlers = &p80211wext_handler_def; - - netif_stop_queue(dev); - 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); } return result; @@ -792,29 +803,25 @@ 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; + struct wireless_dev *wdev; tasklet_kill(&wlandev->rx_bh); - if (wlandev->netdev == NULL) { - printk(KERN_ERR "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; } - - return 0; } /*---------------------------------------------------------------- @@ -836,15 +843,9 @@ int wlan_unsetup(wlandevice_t * wlandev) * Call Context: * Can be either interrupt or not. ----------------------------------------------------------------*/ -int register_wlandev(wlandevice_t * wlandev) +int register_wlandev(wlandevice_t *wlandev) { - int i = 0; - - i = register_netdev(wlandev->netdev); - if (i) - return i; - - return 0; + return register_netdev(wlandev->netdev); } /*---------------------------------------------------------------- @@ -864,7 +865,7 @@ int register_wlandev(wlandevice_t * wlandev) * Call Context: * Can be either interrupt or not. ----------------------------------------------------------------*/ -int unregister_wlandev(wlandevice_t * wlandev) +int unregister_wlandev(wlandevice_t *wlandev) { struct sk_buff *skb; @@ -907,7 +908,7 @@ int unregister_wlandev(wlandevice_t * wlandev) * Call context: * Usually interrupt. ----------------------------------------------------------------*/ -void p80211netdev_hwremoved(wlandevice_t * wlandev) +void p80211netdev_hwremoved(wlandevice_t *wlandev) { wlandev->hwremoved = 1; if (wlandev->state == WLAN_DEVICE_OPEN) @@ -937,7 +938,7 @@ void p80211netdev_hwremoved(wlandevice_t * wlandev) * Call context: * interrupt ----------------------------------------------------------------*/ -static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc) +static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc) { u16 ftype; u16 fstype; @@ -946,7 +947,8 @@ static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc) ftype = WLAN_GET_FC_FTYPE(fc); fstype = WLAN_GET_FC_FSTYPE(fc); #if 0 - pr_debug("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) { case WLAN_FTYPE_MGMT: @@ -955,7 +957,7 @@ static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc) drop = 1; break; } - pr_debug("rx'd mgmt:\n"); + netdev_dbg(wlandev->netdev, "rx'd mgmt:\n"); wlandev->rx.mgmt++; switch (fstype) { case WLAN_FSTYPE_ASSOCREQ: @@ -1017,7 +1019,7 @@ static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc) drop = 1; break; } - pr_debug("rx'd ctl:\n"); + netdev_dbg(wlandev->netdev, "rx'd ctl:\n"); wlandev->rx.ctl++; switch (fstype) { case WLAN_FSTYPE_PSPOLL: @@ -1069,19 +1071,19 @@ static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc) wlandev->rx.data__cfack_cfpoll++; break; case WLAN_FSTYPE_NULL: - pr_debug("rx'd data:null\n"); + netdev_dbg(wlandev->netdev, "rx'd data:null\n"); wlandev->rx.null++; break; case WLAN_FSTYPE_CFACK: - pr_debug("rx'd data:cfack\n"); + netdev_dbg(wlandev->netdev, "rx'd data:cfack\n"); wlandev->rx.cfack++; break; case WLAN_FSTYPE_CFPOLL: - pr_debug("rx'd data:cfpoll\n"); + netdev_dbg(wlandev->netdev, "rx'd data:cfpoll\n"); wlandev->rx.cfpoll++; break; case WLAN_FSTYPE_CFACK_CFPOLL: - pr_debug("rx'd data:cfack_cfpoll\n"); + netdev_dbg(wlandev->netdev, "rx'd data:cfack_cfpoll\n"); wlandev->rx.cfack_cfpoll++; break; default: @@ -1095,15 +1097,15 @@ static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc) return drop; } -static void p80211knetdev_tx_timeout(netdevice_t * netdev) +static void p80211knetdev_tx_timeout(netdevice_t *netdev) { wlandevice_t *wlandev = netdev->ml_priv; if (wlandev->tx_timeout) { wlandev->tx_timeout(wlandev); } else { - printk(KERN_WARNING "Implement tx_timeout for %s\n", - wlandev->nsdname); + netdev_warn(netdev, "Implement tx_timeout for %s\n", + wlandev->nsdname); netif_wake_queue(wlandev->netdev); } } |
