diff options
Diffstat (limited to 'drivers/staging/wlan-ng/p80211netdev.c')
-rw-r--r-- | drivers/staging/wlan-ng/p80211netdev.c | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 59e5ad10dbda..7be8efaf7c6f 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -70,6 +70,8 @@ #include <linux/wireless.h> #include <linux/sockios.h> #include <linux/etherdevice.h> +#include <linux/if_ether.h> +#include <linux/byteorder/generic.h> #include <asm/bitops.h> #include <asm/uaccess.h> @@ -156,12 +158,10 @@ MODULE_PARM_DESC(wlan_debug, "p80211 debug level"); ----------------------------------------------------------------*/ 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; } @@ -184,12 +184,10 @@ static struct net_device_stats* p80211knetdev_get_stats(netdevice_t *netdev) { wlandevice_t *wlandev = netdev->ml_priv; - DBFENTER; /* TODO: review the MIB stats for items that correspond to linux stats */ - DBFEXIT; return &(wlandev->linux_stats); } @@ -213,8 +211,6 @@ static int p80211knetdev_open( netdevice_t *netdev ) int result = 0; /* success */ wlandevice_t *wlandev = netdev->ml_priv; - DBFENTER; - /* Check to make sure the MSD is running */ if ( wlandev->msdstate != WLAN_MSD_RUNNING ) { return -ENODEV; @@ -231,7 +227,6 @@ static int p80211knetdev_open( netdevice_t *netdev ) result = -EAGAIN; } - DBFEXIT; return result; } @@ -253,8 +248,6 @@ static int p80211knetdev_stop( netdevice_t *netdev ) int result = 0; wlandevice_t *wlandev = netdev->ml_priv; - DBFENTER; - if ( wlandev->close != NULL ) { result = wlandev->close(wlandev); } @@ -262,7 +255,6 @@ static int p80211knetdev_stop( netdevice_t *netdev ) netif_stop_queue(wlandev->netdev); wlandev->state = WLAN_DEVICE_CLOSED; - DBFEXIT; return result; } @@ -282,14 +274,11 @@ static int p80211knetdev_stop( netdevice_t *netdev ) 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); - DBFEXIT; return; } @@ -314,8 +303,6 @@ static void p80211netdev_rx_bh(unsigned long arg) p80211_hdr_a3_t *hdr; u16 fc; - DBFENTER; - /* Let's empty our our queue */ while ( (skb = skb_dequeue(&wlandev->nsd_rxq)) ) { if (wlandev->state == WLAN_DEVICE_OPEN) { @@ -338,7 +325,7 @@ static void p80211netdev_rx_bh(unsigned long arg) continue; } else { hdr = (p80211_hdr_a3_t *)skb->data; - fc = ieee2host16(hdr->fc); + fc = le16_to_cpu(hdr->fc); if (p80211_rx_typedrop(wlandev, fc)) { dev_kfree_skb(skb); continue; @@ -347,7 +334,7 @@ static void p80211netdev_rx_bh(unsigned long arg) /* 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) { + 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); @@ -368,8 +355,6 @@ static void p80211netdev_rx_bh(unsigned long arg) } dev_kfree_skb(skb); } - - DBFEXIT; } @@ -400,8 +385,6 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd p80211_hdr_t p80211_hdr; p80211_metawep_t p80211_wep; - DBFENTER; - if (skb == NULL) { return 0; } @@ -505,7 +488,6 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd if (!result) dev_kfree_skb(skb); - DBFEXIT; return result; } @@ -526,14 +508,11 @@ static void p80211knetdev_set_multicast_list(netdevice_t *dev) { wlandevice_t *wlandev = dev->ml_priv; - DBFENTER; - /* TODO: real multicast support as well */ if (wlandev->set_multicast_list) wlandev->set_multicast_list(wlandev, dev); - DBFEXIT; } #ifdef SIOCETHTOOL @@ -619,7 +598,6 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) p80211ioctl_req_t *req = (p80211ioctl_req_t*)ifr; wlandevice_t *wlandev = dev->ml_priv; u8 *msgbuf; - DBFENTER; WLAN_LOG_DEBUG(2, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); @@ -662,8 +640,6 @@ 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 */ } @@ -701,7 +677,6 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) p80211item_uint32_t *resultcode; int result = 0; - DBFENTER; /* If we're running, we don't allow MAC address changes */ if (netif_running(dev)) { return -EBUSY; @@ -728,8 +703,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; @@ -752,13 +727,11 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) 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))) @@ -766,8 +739,6 @@ static int wlan_change_mtu(netdevice_t *dev, int new_mtu) dev->mtu = new_mtu; - DBFEXIT; - return 0; } @@ -800,8 +771,6 @@ int wlan_setup(wlandevice_t *wlandev) int result = 0; netdevice_t *dev; - DBFENTER; - /* Set up the wlandev */ wlandev->state = WLAN_DEVICE_CLOSED; wlandev->ethconv = WLAN_ETHCONV_8021h; @@ -852,7 +821,6 @@ int wlan_setup(wlandevice_t *wlandev) netif_carrier_off(dev); } - DBFEXIT; return result; } @@ -881,8 +849,6 @@ int wlan_unsetup(wlandevice_t *wlandev) { int result = 0; - DBFENTER; - tasklet_kill(&wlandev->rx_bh); if (wlandev->netdev == NULL ) { @@ -893,7 +859,6 @@ int wlan_unsetup(wlandevice_t *wlandev) wlandev->netdev = NULL; } - DBFEXIT; return 0; } @@ -922,13 +887,10 @@ int register_wlandev(wlandevice_t *wlandev) { int i = 0; - DBFENTER; - i = register_netdev(wlandev->netdev); if (i) return i; - DBFEXIT; return 0; } @@ -954,8 +916,6 @@ int unregister_wlandev(wlandevice_t *wlandev) { struct sk_buff *skb; - DBFENTER; - unregister_netdev(wlandev->netdev); /* Now to clean out the rx queue */ @@ -963,7 +923,6 @@ int unregister_wlandev(wlandevice_t *wlandev) dev_kfree_skb(skb); } - DBFEXIT; return 0; } @@ -1000,15 +959,12 @@ int unregister_wlandev(wlandevice_t *wlandev) ----------------------------------------------------------------*/ void p80211netdev_hwremoved(wlandevice_t *wlandev) { - DBFENTER; wlandev->hwremoved = 1; if ( wlandev->state == WLAN_DEVICE_OPEN) { netif_stop_queue(wlandev->netdev); } netif_device_detach(wlandev->netdev); - - DBFEXIT; } @@ -1195,7 +1151,6 @@ static int p80211_rx_typedrop( wlandevice_t *wlandev, u16 fc) static void p80211knetdev_tx_timeout( netdevice_t *netdev) { wlandevice_t *wlandev = netdev->ml_priv; - DBFENTER; if (wlandev->tx_timeout) { wlandev->tx_timeout(wlandev); @@ -1204,6 +1159,4 @@ static void p80211knetdev_tx_timeout( netdevice_t *netdev) wlandev->nsdname); netif_wake_queue(wlandev->netdev); } - - DBFEXIT; } |