diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-13 22:35:00 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-13 22:35:00 +0300 |
commit | 72cca7baf4fba777b8ab770b902cf2e08941773f (patch) | |
tree | c5cdbcd65ac166946f54f1dd6ef3693eea29d791 /drivers/staging/wlan-ng/p80211netdev.c | |
parent | 5266e70335dac35c35b5ca9cea4251c1389d4a68 (diff) | |
parent | 3e0f9b2ca8e4839335e4d64ec0a75f4fd5111c4b (diff) |
Merge tag 'staging-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO updates from Greg KH:
"Here's the "big" staging/iio pull request for 4.10-rc1.
Not as big as 4.9 was, but still just over a thousand changes. We
almost broke even of lines added vs. removed, as the slicoss driver
was removed (got a "clean" driver for the same hardware through the
netdev tree), and some iio drivers were also dropped, but I think we
ended up adding a few thousand lines to the source tree in the end.
Other than that it's a lot of minor fixes all over the place, nothing
major stands out at all.
All of these have been in linux-next for a while. There will be a
merge conflict with Al's vfs tree in the lustre code, but the
resolution for that should be pretty simple, that too has been in
linux-next"
* tag 'staging-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1002 commits)
staging: comedi: comedidev.h: Document usage of 'detach' handler
staging: fsl-mc: remove unnecessary info prints from bus driver
staging: fsl-mc: add sysfs ABI doc
staging/lustre/o2iblnd: Fix misspelled attemps->attempts
staging/lustre/o2iblnd: Fix misspelling intialized->intialized
staging/lustre: Convert all bare unsigned to unsigned int
staging/lustre/socklnd: Fix whitespace problem
staging/lustre/o2iblnd: Add missing space
staging/lustre/lnetselftest: Fix potential integer overflow
staging: greybus: audio_module: remove redundant OOM message
staging: dgnc: Fix lines longer than 80 characters
staging: dgnc: fix blank line after '{' warnings.
staging/android: remove Sync Framework tasks from TODO
staging/lustre/osc: Revert erroneous list_for_each_entry_safe use
staging: slicoss: remove the staging driver
staging: lustre: libcfs: remove lnet upcall code
staging: lustre: remove set but unused variables
staging: lustre: osc: set lock data for readahead lock
staging: lustre: import: don't reconnect during connect interpret
staging: lustre: clio: remove mtime check in vvp_io_fault_start()
...
Diffstat (limited to 'drivers/staging/wlan-ng/p80211netdev.c')
-rw-r--r-- | drivers/staging/wlan-ng/p80211netdev.c | 637 |
1 files changed, 326 insertions, 311 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 4762d38a720e..73fcf07254fe 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -1,53 +1,53 @@ /* src/p80211/p80211knetdev.c -* -* Linux Kernel net device interface -* -* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. -* -------------------------------------------------------------------- -* -* linux-wlan -* -* The contents of this file are subject to the Mozilla Public -* License Version 1.1 (the "License"); you may not use this file -* except in compliance with the License. You may obtain a copy of -* the License at http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS -* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -* implied. See the License for the specific language governing -* rights and limitations under the License. -* -* Alternatively, the contents of this file may be used under the -* terms of the GNU Public License version 2 (the "GPL"), in which -* case the provisions of the GPL are applicable instead of the -* above. If you wish to allow the use of your version of this file -* only under the terms of the GPL and not to allow others to use -* your version of this file under the MPL, indicate your decision -* by deleting the provisions above and replace them with the notice -* and other provisions required by the GPL. If you do not delete -* the provisions above, a recipient may use your version of this -* file under either the MPL or the GPL. -* -* -------------------------------------------------------------------- -* -* Inquiries regarding the linux-wlan Open Source project can be -* made directly to: -* -* AbsoluteValue Systems Inc. -* info@linux-wlan.com -* http://www.linux-wlan.com -* -* -------------------------------------------------------------------- -* -* Portions of the development of this software were funded by -* Intersil Corporation as part of PRISM(R) chipset product development. -* -* -------------------------------------------------------------------- -* -* The functions required for a Linux network device are defined here. -* -* -------------------------------------------------------------------- -*/ + * + * Linux Kernel net device interface + * + * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved. + * -------------------------------------------------------------------- + * + * linux-wlan + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License version 2 (the "GPL"), in which + * case the provisions of the GPL are applicable instead of the + * above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use + * your version of this file under the MPL, indicate your decision + * by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * -------------------------------------------------------------------- + * + * Inquiries regarding the linux-wlan Open Source project can be + * made directly to: + * + * AbsoluteValue Systems Inc. + * info@linux-wlan.com + * http://www.linux-wlan.com + * + * -------------------------------------------------------------------- + * + * Portions of the development of this software were funded by + * Intersil Corporation as part of PRISM(R) chipset product development. + * + * -------------------------------------------------------------------- + * + * The functions required for a Linux network device are defined here. + * + * -------------------------------------------------------------------- + */ #include <linux/module.h> #include <linux/kernel.h> @@ -112,17 +112,18 @@ module_param(wlan_wext_write, int, 0644); MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions"); /*---------------------------------------------------------------- -* p80211knetdev_init -* -* Init method for a Linux netdevice. Called in response to -* register_netdev. -* -* Arguments: -* none -* -* Returns: -* nothing -----------------------------------------------------------------*/ + * p80211knetdev_init + * + * Init method for a Linux netdevice. Called in response to + * register_netdev. + * + * Arguments: + * none + * + * Returns: + * nothing + *---------------------------------------------------------------- + */ static int p80211knetdev_init(struct net_device *netdev) { /* Called in response to register_netdev */ @@ -133,19 +134,20 @@ static int p80211knetdev_init(struct net_device *netdev) } /*---------------------------------------------------------------- -* p80211knetdev_open -* -* Linux netdevice open method. Following a successful call here, -* the device is supposed to be ready for tx and rx. In our -* situation that may not be entirely true due to the state of the -* MAC below. -* -* Arguments: -* netdev Linux network device structure -* -* Returns: -* zero on success, non-zero otherwise -----------------------------------------------------------------*/ + * p80211knetdev_open + * + * Linux netdevice open method. Following a successful call here, + * the device is supposed to be ready for tx and rx. In our + * situation that may not be entirely true due to the state of the + * MAC below. + * + * Arguments: + * netdev Linux network device structure + * + * Returns: + * zero on success, non-zero otherwise + *---------------------------------------------------------------- + */ static int p80211knetdev_open(struct net_device *netdev) { int result = 0; /* success */ @@ -170,17 +172,18 @@ static int p80211knetdev_open(struct net_device *netdev) } /*---------------------------------------------------------------- -* p80211knetdev_stop -* -* Linux netdevice stop (close) method. Following this call, -* no frames should go up or down through this interface. -* -* Arguments: -* netdev Linux network device structure -* -* Returns: -* zero on success, non-zero otherwise -----------------------------------------------------------------*/ + * p80211knetdev_stop + * + * Linux netdevice stop (close) method. Following this call, + * no frames should go up or down through this interface. + * + * Arguments: + * netdev Linux network device structure + * + * Returns: + * zero on success, non-zero otherwise + *---------------------------------------------------------------- + */ static int p80211knetdev_stop(struct net_device *netdev) { int result = 0; @@ -196,18 +199,19 @@ static int p80211knetdev_stop(struct net_device *netdev) } /*---------------------------------------------------------------- -* p80211netdev_rx -* -* Frame receive function called by the mac specific driver. -* -* Arguments: -* wlandev WLAN network device structure -* skb skbuff containing a full 802.11 frame. -* Returns: -* nothing -* Side effects: -* -----------------------------------------------------------------*/ + * p80211netdev_rx + * + * Frame receive function called by the mac specific driver. + * + * Arguments: + * wlandev WLAN network device structure + * skb skbuff containing a full 802.11 frame. + * Returns: + * nothing + * Side effects: + * + *---------------------------------------------------------------- + */ void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb) { /* Enqueue for post-irq processing */ @@ -227,7 +231,8 @@ void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb) * CONV_TO_ETHER_FAILED if conversion failed * CONV_TO_ETHER_SKIPPED if frame is ignored */ -static int p80211_convert_to_ether(struct wlandevice *wlandev, struct sk_buff *skb) +static int p80211_convert_to_ether(struct wlandevice *wlandev, + struct sk_buff *skb) { struct p80211_hdr_a3 *hdr; @@ -272,7 +277,6 @@ static void p80211netdev_rx_bh(unsigned long arg) /* Let's empty our our queue */ 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. */ @@ -299,24 +303,25 @@ static void p80211netdev_rx_bh(unsigned long arg) } /*---------------------------------------------------------------- -* p80211knetdev_hard_start_xmit -* -* Linux netdevice method for transmitting a frame. -* -* Arguments: -* skb Linux sk_buff containing the frame. -* netdev Linux netdevice. -* -* Side effects: -* If the lower layers report that buffers are full. netdev->tbusy -* will be set to prevent higher layers from sending more traffic. -* -* Note: If this function returns non-zero, higher layers retain -* ownership of the skb. -* -* Returns: -* zero on success, non-zero on failure. -----------------------------------------------------------------*/ + * p80211knetdev_hard_start_xmit + * + * Linux netdevice method for transmitting a frame. + * + * Arguments: + * skb Linux sk_buff containing the frame. + * netdev Linux netdevice. + * + * Side effects: + * If the lower layers report that buffers are full. netdev->tbusy + * will be set to prevent higher layers from sending more traffic. + * + * Note: If this function returns non-zero, higher layers retain + * ownership of the skb. + * + * Returns: + * zero on success, non-zero on failure. + *---------------------------------------------------------------- + */ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev) { @@ -336,8 +341,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, goto failed; } - memset(&p80211_hdr, 0, sizeof(union p80211_hdr)); - memset(&p80211_wep, 0, sizeof(struct p80211_metawep)); + memset(&p80211_hdr, 0, sizeof(p80211_hdr)); + memset(&p80211_wep, 0, sizeof(p80211_wep)); if (netif_queue_stopped(netdev)) { netdev_dbg(netdev, "called when queue stopped.\n"); @@ -375,8 +380,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, goto failed; } /* move the header over */ - memcpy(&p80211_hdr, skb->data, sizeof(union p80211_hdr)); - skb_pull(skb, sizeof(union p80211_hdr)); + memcpy(&p80211_hdr, skb->data, sizeof(p80211_hdr)); + skb_pull(skb, sizeof(p80211_hdr)); } else { if (skb_ether_to_p80211 (wlandev, wlandev->ethconv, skb, &p80211_hdr, @@ -435,17 +440,18 @@ failed: } /*---------------------------------------------------------------- -* p80211knetdev_set_multicast_list -* -* Called from higher layers whenever there's a need to set/clear -* promiscuous mode or rewrite the multicast list. -* -* Arguments: -* none -* -* Returns: -* nothing -----------------------------------------------------------------*/ + * p80211knetdev_set_multicast_list + * + * Called from higher layers whenever there's a need to set/clear + * promiscuous mode or rewrite the multicast list. + * + * Arguments: + * none + * + * Returns: + * nothing + *---------------------------------------------------------------- + */ static void p80211knetdev_set_multicast_list(struct net_device *dev) { struct wlandevice *wlandev = dev->ml_priv; @@ -454,12 +460,12 @@ static void p80211knetdev_set_multicast_list(struct net_device *dev) if (wlandev->set_multicast_list) wlandev->set_multicast_list(wlandev, dev); - } #ifdef SIOCETHTOOL -static int p80211netdev_ethtool(struct wlandevice *wlandev, void __user *useraddr) +static int p80211netdev_ethtool(struct wlandevice *wlandev, + void __user *useraddr) { u32 ethcmd; struct ethtool_drvinfo info; @@ -505,33 +511,35 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev, void __user *useradd #endif /*---------------------------------------------------------------- -* p80211knetdev_do_ioctl -* -* Handle an ioctl call on one of our devices. Everything Linux -* ioctl specific is done here. Then we pass the contents of the -* ifr->data to the request message handler. -* -* Arguments: -* dev Linux kernel netdevice -* ifr Our private ioctl request structure, typed for the -* generic struct ifreq so we can use ptr to func -* w/o cast. -* -* Returns: -* zero on success, a negative errno on failure. Possible values: -* -ENETDOWN Device isn't up. -* -EBUSY cmd already in progress -* -ETIME p80211 cmd timed out (MSD may have its own timers) -* -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. -* -* Call Context: -* Process thread (ioctl caller). TODO: SMP support may require -* locks. -----------------------------------------------------------------*/ -static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + * p80211knetdev_do_ioctl + * + * Handle an ioctl call on one of our devices. Everything Linux + * ioctl specific is done here. Then we pass the contents of the + * ifr->data to the request message handler. + * + * Arguments: + * dev Linux kernel netdevice + * ifr Our private ioctl request structure, typed for the + * generic struct ifreq so we can use ptr to func + * w/o cast. + * + * Returns: + * zero on success, a negative errno on failure. Possible values: + * -ENETDOWN Device isn't up. + * -EBUSY cmd already in progress + * -ETIME p80211 cmd timed out (MSD may have its own timers) + * -EFAULT memory fault copying msg from user buffer + * -ENOMEM unable to allocate kernel msg buffer + * -EINVAL bad magic, it the cmd really for us? + * -EintR sleeping on cmd, awakened by signal, cmd cancelled. + * + * Call Context: + * Process thread (ioctl caller). TODO: SMP support may require + * locks. + *---------------------------------------------------------------- + */ +static int p80211knetdev_do_ioctl(struct net_device *dev, + struct ifreq *ifr, int cmd) { int result = 0; struct p80211ioctl_req *req = (struct p80211ioctl_req *)ifr; @@ -550,7 +558,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr, int /* Test the magic, assume ifr is good if it's there */ if (req->magic != P80211_IOCTL_MAGIC) { - result = -ENOSYS; + result = -EINVAL; goto bail; } @@ -558,7 +566,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr, int result = 0; goto bail; } else if (cmd != P80211_IFREQ) { - result = -ENOSYS; + result = -EINVAL; goto bail; } @@ -586,30 +594,31 @@ bail: } /*---------------------------------------------------------------- -* p80211knetdev_set_mac_address -* -* Handles the ioctl for changing the MACAddress of a netdevice -* -* references: linux/netdevice.h and drivers/net/net_init.c -* -* NOTE: [MSM] We only prevent address changes when the netdev is -* up. We don't control anything based on dot11 state. If the -* address is changed on a STA that's currently associated, you -* will probably lose the ability to send and receive data frames. -* Just be aware. Therefore, this should usually only be done -* prior to scan/join/auth/assoc. -* -* Arguments: -* dev netdevice struct -* addr the new MACAddress (a struct) -* -* Returns: -* zero on success, a negative errno on failure. Possible values: -* -EBUSY device is bussy (cmd not possible) -* -and errors returned by: p80211req_dorequest(..) -* -* by: Collin R. Mulliner <collin@mulliner.org> -----------------------------------------------------------------*/ + * p80211knetdev_set_mac_address + * + * Handles the ioctl for changing the MACAddress of a netdevice + * + * references: linux/netdevice.h and drivers/net/net_init.c + * + * NOTE: [MSM] We only prevent address changes when the netdev is + * up. We don't control anything based on dot11 state. If the + * address is changed on a STA that's currently associated, you + * will probably lose the ability to send and receive data frames. + * Just be aware. Therefore, this should usually only be done + * prior to scan/join/auth/assoc. + * + * Arguments: + * dev netdevice struct + * addr the new MACAddress (a struct) + * + * Returns: + * zero on success, a negative errno on failure. Possible values: + * -EBUSY device is bussy (cmd not possible) + * -and errors returned by: p80211req_dorequest(..) + * + * by: Collin R. Mulliner <collin@mulliner.org> + *---------------------------------------------------------------- + */ static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr) { struct sockaddr *new_addr = addr; @@ -629,9 +638,9 @@ static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr) resultcode = &dot11req.resultcode; /* Set up a dot11req_mibset */ - memset(&dot11req, 0, sizeof(struct p80211msg_dot11req_mibset)); + memset(&dot11req, 0, sizeof(dot11req)); dot11req.msgcode = DIDmsg_dot11req_mibset; - dot11req.msglen = sizeof(struct p80211msg_dot11req_mibset); + dot11req.msglen = sizeof(dot11req); memcpy(dot11req.devname, ((struct wlandevice *)dev->ml_priv)->name, WLAN_DEVNAMELEN_MAX - 1); @@ -682,28 +691,29 @@ static const struct net_device_ops p80211_netdev_ops = { }; /*---------------------------------------------------------------- -* wlan_setup -* -* Roughly matches the functionality of ether_setup. Here -* we set up any members of the wlandevice structure that are common -* to all devices. Additionally, we allocate a linux 'struct device' -* and perform the same setup as ether_setup. -* -* Note: It's important that the caller have setup the wlandev->name -* ptr prior to calling this function. -* -* Arguments: -* wlandev ptr to the wlandev structure for the -* interface. -* physdev ptr to usb device -* 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. -----------------------------------------------------------------*/ + * wlan_setup + * + * Roughly matches the functionality of ether_setup. Here + * we set up any members of the wlandevice structure that are common + * to all devices. Additionally, we allocate a linux 'struct device' + * and perform the same setup as ether_setup. + * + * Note: It's important that the caller have setup the wlandev->name + * ptr prior to calling this function. + * + * Arguments: + * wlandev ptr to the wlandev structure for the + * interface. + * physdev ptr to usb device + * 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_setup(struct wlandevice *wlandev, struct device *physdev) { int result = 0; @@ -757,24 +767,25 @@ int wlan_setup(struct wlandevice *wlandev, struct device *physdev) } /*---------------------------------------------------------------- -* wlan_unsetup -* -* This function is paired with the wlan_setup routine. It should -* be called after unregister_wlandev. Basically, all it does is -* free the 'struct device' that's associated with the wlandev. -* We do it here because the 'struct device' isn't allocated -* explicitly in the driver code, it's done in wlan_setup. To -* do the free in the driver might seem like 'magic'. -* -* Arguments: -* wlandev ptr to the wlandev structure for the -* interface. -* 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. -----------------------------------------------------------------*/ + * wlan_unsetup + * + * This function is paired with the wlan_setup routine. It should + * be called after unregister_wlandev. Basically, all it does is + * free the 'struct device' that's associated with the wlandev. + * We do it here because the 'struct device' isn't allocated + * explicitly in the driver code, it's done in wlan_setup. To + * do the free in the driver might seem like 'magic'. + * + * Arguments: + * wlandev ptr to the wlandev structure for the + * interface. + * 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. + *---------------------------------------------------------------- + */ void wlan_unsetup(struct wlandevice *wlandev) { struct wireless_dev *wdev; @@ -791,46 +802,48 @@ void wlan_unsetup(struct wlandevice *wlandev) } /*---------------------------------------------------------------- -* register_wlandev -* -* Roughly matches the functionality of register_netdev. This function -* is called after the driver has successfully probed and set up the -* resources for the device. It's now ready to become a named device -* in the Linux system. -* -* First we allocate a name for the device (if not already set), then -* we call the Linux function register_netdevice. -* -* Arguments: -* wlandev ptr to the wlandev structure for the -* interface. -* Returns: -* zero on success, non-zero otherwise. -* Call Context: -* Can be either interrupt or not. -----------------------------------------------------------------*/ + * register_wlandev + * + * Roughly matches the functionality of register_netdev. This function + * is called after the driver has successfully probed and set up the + * resources for the device. It's now ready to become a named device + * in the Linux system. + * + * First we allocate a name for the device (if not already set), then + * we call the Linux function register_netdevice. + * + * Arguments: + * wlandev ptr to the wlandev structure for the + * interface. + * Returns: + * zero on success, non-zero otherwise. + * Call Context: + * Can be either interrupt or not. + *---------------------------------------------------------------- + */ int register_wlandev(struct wlandevice *wlandev) { return register_netdev(wlandev->netdev); } /*---------------------------------------------------------------- -* unregister_wlandev -* -* Roughly matches the functionality of unregister_netdev. This -* function is called to remove a named device from the system. -* -* First we tell linux that the device should no longer exist. -* Then we remove it from the list of known wlan devices. -* -* Arguments: -* wlandev ptr to the wlandev structure for the -* interface. -* Returns: -* zero on success, non-zero otherwise. -* Call Context: -* Can be either interrupt or not. -----------------------------------------------------------------*/ + * unregister_wlandev + * + * Roughly matches the functionality of unregister_netdev. This + * function is called to remove a named device from the system. + * + * First we tell linux that the device should no longer exist. + * Then we remove it from the list of known wlan devices. + * + * Arguments: + * wlandev ptr to the wlandev structure for the + * interface. + * Returns: + * zero on success, non-zero otherwise. + * Call Context: + * Can be either interrupt or not. + *---------------------------------------------------------------- + */ int unregister_wlandev(struct wlandevice *wlandev) { struct sk_buff *skb; @@ -845,35 +858,36 @@ int unregister_wlandev(struct wlandevice *wlandev) } /*---------------------------------------------------------------- -* p80211netdev_hwremoved -* -* Hardware removed notification. This function should be called -* immediately after an MSD has detected that the underlying hardware -* has been yanked out from under us. The primary things we need -* to do are: -* - Mark the wlandev -* - Prevent any further traffic from the knetdev i/f -* - Prevent any further requests from mgmt i/f -* - If there are any waitq'd mgmt requests or mgmt-frame exchanges, -* shut them down. -* - Call the MSD hwremoved function. -* -* The remainder of the cleanup will be handled by unregister(). -* Our primary goal here is to prevent as much tickling of the MSD -* as possible since the MSD is already in a 'wounded' state. -* -* TODO: As new features are added, this function should be -* updated. -* -* Arguments: -* wlandev WLAN network device structure -* Returns: -* nothing -* Side effects: -* -* Call context: -* Usually interrupt. -----------------------------------------------------------------*/ + * p80211netdev_hwremoved + * + * Hardware removed notification. This function should be called + * immediately after an MSD has detected that the underlying hardware + * has been yanked out from under us. The primary things we need + * to do are: + * - Mark the wlandev + * - Prevent any further traffic from the knetdev i/f + * - Prevent any further requests from mgmt i/f + * - If there are any waitq'd mgmt requests or mgmt-frame exchanges, + * shut them down. + * - Call the MSD hwremoved function. + * + * The remainder of the cleanup will be handled by unregister(). + * Our primary goal here is to prevent as much tickling of the MSD + * as possible since the MSD is already in a 'wounded' state. + * + * TODO: As new features are added, this function should be + * updated. + * + * Arguments: + * wlandev WLAN network device structure + * Returns: + * nothing + * Side effects: + * + * Call context: + * Usually interrupt. + *---------------------------------------------------------------- + */ void p80211netdev_hwremoved(struct wlandevice *wlandev) { wlandev->hwremoved = 1; @@ -884,26 +898,27 @@ void p80211netdev_hwremoved(struct wlandevice *wlandev) } /*---------------------------------------------------------------- -* p80211_rx_typedrop -* -* Classifies the frame, increments the appropriate counter, and -* returns 0|1|2 indicating whether the driver should handle, ignore, or -* drop the frame -* -* Arguments: -* wlandev wlan device structure -* fc frame control field -* -* Returns: -* zero if the frame should be handled by the driver, -* one if the frame should be ignored -* anything else means we drop it. -* -* Side effects: -* -* Call context: -* interrupt -----------------------------------------------------------------*/ + * p80211_rx_typedrop + * + * Classifies the frame, increments the appropriate counter, and + * returns 0|1|2 indicating whether the driver should handle, ignore, or + * drop the frame + * + * Arguments: + * wlandev wlan device structure + * fc frame control field + * + * Returns: + * zero if the frame should be handled by the driver, + * one if the frame should be ignored + * anything else means we drop it. + * + * Side effects: + * + * Call context: + * interrupt + *---------------------------------------------------------------- + */ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) { u16 ftype; |