diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-19 17:48:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-19 17:48:32 -0700 |
commit | fb20871a54961b82d35303b43452928186c1361d (patch) | |
tree | 1beeb39e45eda1c8b5893090904b583fceeb07ef /drivers/staging/wlan-ng/p80211netdev.c | |
parent | bee89ab228e6f51c4ddd3481b9bd491859a8ee7b (diff) | |
parent | c7a5d70796379e3d51d0c652fbe1634b81d3bbd5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (342 commits)
Staging: comedi: fix build errors
Staging: udlfb: update to version 0.2.3
Staging: udlfb: fix some sparse warnings.
Staging: udlfb: clean up checkpatch warnings in udlfb.c
Staging: udlfb: clean up checkpatch warnings in udlfb.h
Staging: udlfb: add udlfb driver to build
Staging: add udlfb driver
Staging: pata_rdc: remove pointless comments
Staging: pata_rdc: remove DRIVER macros
Staging: pata_rdc: remove dbgprintf macro
Staging: pata_rdc: remove broken flag
Staging: pata_rdc: fix build warnings
Staging: pata_rdc: use PCI_DEVICE
Staging: pata_rdc: remove function prototypes
Staging: pata_rdc: coding style fixes
Staging: pata_rdc: convert code to work in 2.6.29
Staging: pata_rdc: add driver to the build system
Staging: add pata_rdc driver
Staging: remove obsolete serqt_usb driver
Staging: serqt_usb2 add the driver to the build
...
Diffstat (limited to 'drivers/staging/wlan-ng/p80211netdev.c')
-rw-r--r-- | drivers/staging/wlan-ng/p80211netdev.c | 99 |
1 files changed, 42 insertions, 57 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index bc0d764d851..90f499e00dc 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -49,7 +49,6 @@ * -------------------------------------------------------------------- */ -#include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -95,18 +94,18 @@ static void p80211netdev_rx_bh(unsigned long arg); /* 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); @@ -128,7 +127,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 */ @@ -151,7 +150,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; @@ -175,7 +174,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; @@ -210,7 +209,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; @@ -237,7 +236,7 @@ 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); @@ -346,7 +345,7 @@ 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; @@ -410,7 +409,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, &p80211_wep) != 0) { /* convert failed */ pr_debug("ether_to_80211(%d) failed.\n", - wlandev->ethconv); + wlandev->ethconv); result = 1; goto failed; } @@ -473,7 +472,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; @@ -486,7 +485,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; @@ -558,7 +557,7 @@ 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; @@ -567,8 +566,6 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) pr_debug("rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len); - mutex_lock(&wlandev->ioctl_lock); - #ifdef SIOCETHTOOL if (cmd == SIOCETHTOOL) { result = @@ -609,8 +606,6 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) result = -ENOMEM; } bail: - mutex_unlock(&wlandev->ioctl_lock); - return result; /* If allocate,copyfrom or copyto fails, return errno */ } @@ -639,7 +634,7 @@ 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; @@ -654,7 +649,7 @@ 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 */ @@ -682,7 +677,7 @@ 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 @@ -699,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,17 +707,17 @@ static int wlan_change_mtu(netdevice_t *dev, int new_mtu) } 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_multicast_list = 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, + .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_multicast_list = 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, }; /*---------------------------------------------------------------- @@ -747,7 +742,7 @@ 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) { int result = 0; netdevice_t *dev; @@ -772,11 +767,6 @@ int wlan_setup(wlandevice_t *wlandev) dev->ml_priv = wlandev; dev->netdev_ops = &p80211_netdev_ops; - mutex_init(&wlandev->ioctl_lock); - /* block ioctls until fully initialised. Don't forget to call - allow_ioctls at some point!*/ - mutex_lock(&wlandev->ioctl_lock); - #if (WIRELESS_EXT < 21) dev->get_wireless_stats = p80211wext_get_wireless_stats; #endif @@ -810,7 +800,7 @@ int wlan_setup(wlandevice_t *wlandev) * compiled drivers, this function will be called in the * context of the kernel startup code. ----------------------------------------------------------------*/ -int wlan_unsetup(wlandevice_t *wlandev) +int wlan_unsetup(wlandevice_t * wlandev) { int result = 0; @@ -846,7 +836,7 @@ 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; @@ -874,7 +864,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; @@ -917,7 +907,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) @@ -947,7 +937,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; @@ -1105,7 +1095,7 @@ 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; @@ -1117,8 +1107,3 @@ static void p80211knetdev_tx_timeout(netdevice_t *netdev) netif_wake_queue(wlandev->netdev); } } - -void p80211_allow_ioctls(wlandevice_t *wlandev) -{ - mutex_unlock(&wlandev->ioctl_lock); -} |