staging: wlan-ng: fix block comment warnings in p80211netdev.c
This patch fix the following checkpatch.pl warnings in p80211netdev.c: WARNING: Block comments should align the * on each line WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0a6b83e553
commit
84ad1efa7d
|
@ -1,53 +1,53 @@
|
||||||
/* src/p80211/p80211knetdev.c
|
/* src/p80211/p80211knetdev.c
|
||||||
*
|
*
|
||||||
* Linux Kernel net device interface
|
* Linux Kernel net device interface
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
|
* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* linux-wlan
|
* linux-wlan
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public
|
* The contents of this file are subject to the Mozilla Public
|
||||||
* License Version 1.1 (the "License"); you may not use this file
|
* License Version 1.1 (the "License"); you may not use this file
|
||||||
* except in compliance with the License. You may obtain a copy of
|
* except in compliance with the License. You may obtain a copy of
|
||||||
* the License at http://www.mozilla.org/MPL/
|
* the License at http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* Software distributed under the License is distributed on an "AS
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||||
* implied. See the License for the specific language governing
|
* implied. See the License for the specific language governing
|
||||||
* rights and limitations under the License.
|
* rights and limitations under the License.
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the
|
* Alternatively, the contents of this file may be used under the
|
||||||
* terms of the GNU Public License version 2 (the "GPL"), in which
|
* terms of the GNU Public License version 2 (the "GPL"), in which
|
||||||
* case the provisions of the GPL are applicable instead of the
|
* 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
|
* 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
|
* 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
|
* your version of this file under the MPL, indicate your decision
|
||||||
* by deleting the provisions above and replace them with the notice
|
* by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL. If you do not delete
|
* and other provisions required by the GPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this
|
* the provisions above, a recipient may use your version of this
|
||||||
* file under either the MPL or the GPL.
|
* file under either the MPL or the GPL.
|
||||||
*
|
*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Inquiries regarding the linux-wlan Open Source project can be
|
* Inquiries regarding the linux-wlan Open Source project can be
|
||||||
* made directly to:
|
* made directly to:
|
||||||
*
|
*
|
||||||
* AbsoluteValue Systems Inc.
|
* AbsoluteValue Systems Inc.
|
||||||
* info@linux-wlan.com
|
* info@linux-wlan.com
|
||||||
* http://www.linux-wlan.com
|
* http://www.linux-wlan.com
|
||||||
*
|
*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Portions of the development of this software were funded by
|
* Portions of the development of this software were funded by
|
||||||
* Intersil Corporation as part of PRISM(R) chipset product development.
|
* Intersil Corporation as part of PRISM(R) chipset product development.
|
||||||
*
|
*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* The functions required for a Linux network device are defined here.
|
* The functions required for a Linux network device are defined here.
|
||||||
*
|
*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/kernel.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");
|
MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions");
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_init
|
* p80211knetdev_init
|
||||||
*
|
*
|
||||||
* Init method for a Linux netdevice. Called in response to
|
* Init method for a Linux netdevice. Called in response to
|
||||||
* register_netdev.
|
* register_netdev.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* nothing
|
* nothing
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211knetdev_init(struct net_device *netdev)
|
static int p80211knetdev_init(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
/* Called in response to register_netdev */
|
/* Called in response to register_netdev */
|
||||||
|
@ -133,19 +134,20 @@ static int p80211knetdev_init(struct net_device *netdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_open
|
* p80211knetdev_open
|
||||||
*
|
*
|
||||||
* Linux netdevice open method. Following a successful call here,
|
* Linux netdevice open method. Following a successful call here,
|
||||||
* the device is supposed to be ready for tx and rx. In our
|
* 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
|
* situation that may not be entirely true due to the state of the
|
||||||
* MAC below.
|
* MAC below.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* netdev Linux network device structure
|
* netdev Linux network device structure
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, non-zero otherwise
|
* zero on success, non-zero otherwise
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211knetdev_open(struct net_device *netdev)
|
static int p80211knetdev_open(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
int result = 0; /* success */
|
int result = 0; /* success */
|
||||||
|
@ -170,17 +172,18 @@ static int p80211knetdev_open(struct net_device *netdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_stop
|
* p80211knetdev_stop
|
||||||
*
|
*
|
||||||
* Linux netdevice stop (close) method. Following this call,
|
* Linux netdevice stop (close) method. Following this call,
|
||||||
* no frames should go up or down through this interface.
|
* no frames should go up or down through this interface.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* netdev Linux network device structure
|
* netdev Linux network device structure
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, non-zero otherwise
|
* zero on success, non-zero otherwise
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211knetdev_stop(struct net_device *netdev)
|
static int p80211knetdev_stop(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
@ -196,18 +199,19 @@ static int p80211knetdev_stop(struct net_device *netdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211netdev_rx
|
* p80211netdev_rx
|
||||||
*
|
*
|
||||||
* Frame receive function called by the mac specific driver.
|
* Frame receive function called by the mac specific driver.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev WLAN network device structure
|
* wlandev WLAN network device structure
|
||||||
* skb skbuff containing a full 802.11 frame.
|
* skb skbuff containing a full 802.11 frame.
|
||||||
* Returns:
|
* Returns:
|
||||||
* nothing
|
* nothing
|
||||||
* Side effects:
|
* Side effects:
|
||||||
*
|
*
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb)
|
void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
/* Enqueue for post-irq processing */
|
/* Enqueue for post-irq processing */
|
||||||
|
@ -300,24 +304,25 @@ static void p80211netdev_rx_bh(unsigned long arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_hard_start_xmit
|
* p80211knetdev_hard_start_xmit
|
||||||
*
|
*
|
||||||
* Linux netdevice method for transmitting a frame.
|
* Linux netdevice method for transmitting a frame.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* skb Linux sk_buff containing the frame.
|
* skb Linux sk_buff containing the frame.
|
||||||
* netdev Linux netdevice.
|
* netdev Linux netdevice.
|
||||||
*
|
*
|
||||||
* Side effects:
|
* Side effects:
|
||||||
* If the lower layers report that buffers are full. netdev->tbusy
|
* If the lower layers report that buffers are full. netdev->tbusy
|
||||||
* will be set to prevent higher layers from sending more traffic.
|
* will be set to prevent higher layers from sending more traffic.
|
||||||
*
|
*
|
||||||
* Note: If this function returns non-zero, higher layers retain
|
* Note: If this function returns non-zero, higher layers retain
|
||||||
* ownership of the skb.
|
* ownership of the skb.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, non-zero on failure.
|
* zero on success, non-zero on failure.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
|
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
|
||||||
struct net_device *netdev)
|
struct net_device *netdev)
|
||||||
{
|
{
|
||||||
|
@ -436,17 +441,18 @@ failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_set_multicast_list
|
* p80211knetdev_set_multicast_list
|
||||||
*
|
*
|
||||||
* Called from higher layers 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.
|
* promiscuous mode or rewrite the multicast list.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* nothing
|
* nothing
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static void p80211knetdev_set_multicast_list(struct net_device *dev)
|
static void p80211knetdev_set_multicast_list(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct wlandevice *wlandev = dev->ml_priv;
|
struct wlandevice *wlandev = dev->ml_priv;
|
||||||
|
@ -507,32 +513,33 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_do_ioctl
|
* p80211knetdev_do_ioctl
|
||||||
*
|
*
|
||||||
* Handle an ioctl call on one of our devices. Everything Linux
|
* Handle an ioctl call on one of our devices. Everything Linux
|
||||||
* ioctl specific is done here. Then we pass the contents of the
|
* ioctl specific is done here. Then we pass the contents of the
|
||||||
* ifr->data to the request message handler.
|
* ifr->data to the request message handler.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* dev Linux kernel netdevice
|
* dev Linux kernel netdevice
|
||||||
* ifr Our private ioctl request structure, typed for the
|
* ifr Our private ioctl request structure, typed for the
|
||||||
* generic struct ifreq so we can use ptr to func
|
* generic struct ifreq so we can use ptr to func
|
||||||
* w/o cast.
|
* w/o cast.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, a negative errno on failure. Possible values:
|
* zero on success, a negative errno on failure. Possible values:
|
||||||
* -ENETDOWN Device isn't up.
|
* -ENETDOWN Device isn't up.
|
||||||
* -EBUSY cmd already in progress
|
* -EBUSY cmd already in progress
|
||||||
* -ETIME p80211 cmd timed out (MSD may have its own timers)
|
* -ETIME p80211 cmd timed out (MSD may have its own timers)
|
||||||
* -EFAULT memory fault copying msg from user buffer
|
* -EFAULT memory fault copying msg from user buffer
|
||||||
* -ENOMEM unable to allocate kernel msg buffer
|
* -ENOMEM unable to allocate kernel msg buffer
|
||||||
* -ENOSYS bad magic, it the cmd really for us?
|
* -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:
|
* Call Context:
|
||||||
* Process thread (ioctl caller). TODO: SMP support may require
|
* Process thread (ioctl caller). TODO: SMP support may require
|
||||||
* locks.
|
* locks.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211knetdev_do_ioctl(struct net_device *dev,
|
static int p80211knetdev_do_ioctl(struct net_device *dev,
|
||||||
struct ifreq *ifr, int cmd)
|
struct ifreq *ifr, int cmd)
|
||||||
{
|
{
|
||||||
|
@ -589,30 +596,31 @@ bail:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211knetdev_set_mac_address
|
* p80211knetdev_set_mac_address
|
||||||
*
|
*
|
||||||
* Handles the ioctl for changing the MACAddress of a netdevice
|
* Handles the ioctl for changing the MACAddress of a netdevice
|
||||||
*
|
*
|
||||||
* references: linux/netdevice.h and drivers/net/net_init.c
|
* references: linux/netdevice.h and drivers/net/net_init.c
|
||||||
*
|
*
|
||||||
* NOTE: [MSM] We only prevent address changes when the netdev is
|
* NOTE: [MSM] We only prevent address changes when the netdev is
|
||||||
* up. We don't control anything based on dot11 state. If the
|
* up. We don't control anything based on dot11 state. If the
|
||||||
* address is changed on a STA that's currently associated, you
|
* address is changed on a STA that's currently associated, you
|
||||||
* will probably lose the ability to send and receive data frames.
|
* will probably lose the ability to send and receive data frames.
|
||||||
* Just be aware. Therefore, this should usually only be done
|
* Just be aware. Therefore, this should usually only be done
|
||||||
* prior to scan/join/auth/assoc.
|
* prior to scan/join/auth/assoc.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* dev netdevice struct
|
* dev netdevice struct
|
||||||
* addr the new MACAddress (a struct)
|
* addr the new MACAddress (a struct)
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, a negative errno on failure. Possible values:
|
* zero on success, a negative errno on failure. Possible values:
|
||||||
* -EBUSY device is bussy (cmd not possible)
|
* -EBUSY device is bussy (cmd not possible)
|
||||||
* -and errors returned by: p80211req_dorequest(..)
|
* -and errors returned by: p80211req_dorequest(..)
|
||||||
*
|
*
|
||||||
* by: Collin R. Mulliner <collin@mulliner.org>
|
* by: Collin R. Mulliner <collin@mulliner.org>
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
|
static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
|
||||||
{
|
{
|
||||||
struct sockaddr *new_addr = addr;
|
struct sockaddr *new_addr = addr;
|
||||||
|
@ -675,7 +683,8 @@ static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
|
||||||
static int wlan_change_mtu(struct net_device *dev, int new_mtu)
|
static int wlan_change_mtu(struct net_device *dev, int new_mtu)
|
||||||
{
|
{
|
||||||
/* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
|
/* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
|
||||||
and another 8 for wep. */
|
* and another 8 for wep.
|
||||||
|
*/
|
||||||
if ((new_mtu < 68) || (new_mtu > (2312 - 20 - 8)))
|
if ((new_mtu < 68) || (new_mtu > (2312 - 20 - 8)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -698,28 +707,29 @@ static const struct net_device_ops p80211_netdev_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* wlan_setup
|
* wlan_setup
|
||||||
*
|
*
|
||||||
* Roughly matches the functionality of ether_setup. Here
|
* Roughly matches the functionality of ether_setup. Here
|
||||||
* we set up any members of the wlandevice structure that are common
|
* we set up any members of the wlandevice structure that are common
|
||||||
* to all devices. Additionally, we allocate a linux 'struct device'
|
* to all devices. Additionally, we allocate a linux 'struct device'
|
||||||
* and perform the same setup as ether_setup.
|
* and perform the same setup as ether_setup.
|
||||||
*
|
*
|
||||||
* Note: It's important that the caller have setup the wlandev->name
|
* Note: It's important that the caller have setup the wlandev->name
|
||||||
* ptr prior to calling this function.
|
* ptr prior to calling this function.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev ptr to the wlandev structure for the
|
* wlandev ptr to the wlandev structure for the
|
||||||
* interface.
|
* interface.
|
||||||
* physdev ptr to usb device
|
* physdev ptr to usb device
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, non-zero otherwise.
|
* zero on success, non-zero otherwise.
|
||||||
* Call Context:
|
* Call Context:
|
||||||
* Should be process thread. We'll assume it might be
|
* Should be process thread. We'll assume it might be
|
||||||
* interrupt though. When we add support for statically
|
* interrupt though. When we add support for statically
|
||||||
* compiled drivers, this function will be called in the
|
* compiled drivers, this function will be called in the
|
||||||
* context of the kernel startup code.
|
* context of the kernel startup code.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
int wlan_setup(struct wlandevice *wlandev, struct device *physdev)
|
int wlan_setup(struct wlandevice *wlandev, struct device *physdev)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
@ -768,24 +778,25 @@ int wlan_setup(struct wlandevice *wlandev, struct device *physdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* wlan_unsetup
|
* wlan_unsetup
|
||||||
*
|
*
|
||||||
* This function is paired with the wlan_setup routine. It should
|
* This function is paired with the wlan_setup routine. It should
|
||||||
* be called after unregister_wlandev. Basically, all it does is
|
* be called after unregister_wlandev. Basically, all it does is
|
||||||
* free the 'struct device' that's associated with the wlandev.
|
* free the 'struct device' that's associated with the wlandev.
|
||||||
* We do it here because the 'struct device' isn't allocated
|
* We do it here because the 'struct device' isn't allocated
|
||||||
* explicitly in the driver code, it's done in wlan_setup. To
|
* explicitly in the driver code, it's done in wlan_setup. To
|
||||||
* do the free in the driver might seem like 'magic'.
|
* do the free in the driver might seem like 'magic'.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev ptr to the wlandev structure for the
|
* wlandev ptr to the wlandev structure for the
|
||||||
* interface.
|
* interface.
|
||||||
* Call Context:
|
* Call Context:
|
||||||
* Should be process thread. We'll assume it might be
|
* Should be process thread. We'll assume it might be
|
||||||
* interrupt though. When we add support for statically
|
* interrupt though. When we add support for statically
|
||||||
* compiled drivers, this function will be called in the
|
* compiled drivers, this function will be called in the
|
||||||
* context of the kernel startup code.
|
* context of the kernel startup code.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
void wlan_unsetup(struct wlandevice *wlandev)
|
void wlan_unsetup(struct wlandevice *wlandev)
|
||||||
{
|
{
|
||||||
struct wireless_dev *wdev;
|
struct wireless_dev *wdev;
|
||||||
|
@ -802,46 +813,48 @@ void wlan_unsetup(struct wlandevice *wlandev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* register_wlandev
|
* register_wlandev
|
||||||
*
|
*
|
||||||
* Roughly matches the functionality of register_netdev. This function
|
* Roughly matches the functionality of register_netdev. This function
|
||||||
* is called after the driver has successfully probed and set up the
|
* 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
|
* resources for the device. It's now ready to become a named device
|
||||||
* in the Linux system.
|
* in the Linux system.
|
||||||
*
|
*
|
||||||
* First we allocate a name for the device (if not already set), then
|
* First we allocate a name for the device (if not already set), then
|
||||||
* we call the Linux function register_netdevice.
|
* we call the Linux function register_netdevice.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev ptr to the wlandev structure for the
|
* wlandev ptr to the wlandev structure for the
|
||||||
* interface.
|
* interface.
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, non-zero otherwise.
|
* zero on success, non-zero otherwise.
|
||||||
* Call Context:
|
* Call Context:
|
||||||
* Can be either interrupt or not.
|
* Can be either interrupt or not.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
int register_wlandev(struct wlandevice *wlandev)
|
int register_wlandev(struct wlandevice *wlandev)
|
||||||
{
|
{
|
||||||
return register_netdev(wlandev->netdev);
|
return register_netdev(wlandev->netdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* unregister_wlandev
|
* unregister_wlandev
|
||||||
*
|
*
|
||||||
* Roughly matches the functionality of unregister_netdev. This
|
* Roughly matches the functionality of unregister_netdev. This
|
||||||
* function is called to remove a named device from the system.
|
* function is called to remove a named device from the system.
|
||||||
*
|
*
|
||||||
* First we tell linux that the device should no longer exist.
|
* First we tell linux that the device should no longer exist.
|
||||||
* Then we remove it from the list of known wlan devices.
|
* Then we remove it from the list of known wlan devices.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev ptr to the wlandev structure for the
|
* wlandev ptr to the wlandev structure for the
|
||||||
* interface.
|
* interface.
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero on success, non-zero otherwise.
|
* zero on success, non-zero otherwise.
|
||||||
* Call Context:
|
* Call Context:
|
||||||
* Can be either interrupt or not.
|
* Can be either interrupt or not.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
int unregister_wlandev(struct wlandevice *wlandev)
|
int unregister_wlandev(struct wlandevice *wlandev)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
@ -856,35 +869,36 @@ int unregister_wlandev(struct wlandevice *wlandev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211netdev_hwremoved
|
* p80211netdev_hwremoved
|
||||||
*
|
*
|
||||||
* Hardware removed notification. This function should be called
|
* Hardware removed notification. This function should be called
|
||||||
* immediately after an MSD has detected that the underlying hardware
|
* immediately after an MSD has detected that the underlying hardware
|
||||||
* has been yanked out from under us. The primary things we need
|
* has been yanked out from under us. The primary things we need
|
||||||
* to do are:
|
* to do are:
|
||||||
* - Mark the wlandev
|
* - Mark the wlandev
|
||||||
* - Prevent any further traffic from the knetdev i/f
|
* - Prevent any further traffic from the knetdev i/f
|
||||||
* - Prevent any further requests from mgmt i/f
|
* - Prevent any further requests from mgmt i/f
|
||||||
* - If there are any waitq'd mgmt requests or mgmt-frame exchanges,
|
* - If there are any waitq'd mgmt requests or mgmt-frame exchanges,
|
||||||
* shut them down.
|
* shut them down.
|
||||||
* - Call the MSD hwremoved function.
|
* - Call the MSD hwremoved function.
|
||||||
*
|
*
|
||||||
* The remainder of the cleanup will be handled by unregister().
|
* The remainder of the cleanup will be handled by unregister().
|
||||||
* Our primary goal here is to prevent as much tickling of the MSD
|
* Our primary goal here is to prevent as much tickling of the MSD
|
||||||
* as possible since the MSD is already in a 'wounded' state.
|
* as possible since the MSD is already in a 'wounded' state.
|
||||||
*
|
*
|
||||||
* TODO: As new features are added, this function should be
|
* TODO: As new features are added, this function should be
|
||||||
* updated.
|
* updated.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev WLAN network device structure
|
* wlandev WLAN network device structure
|
||||||
* Returns:
|
* Returns:
|
||||||
* nothing
|
* nothing
|
||||||
* Side effects:
|
* Side effects:
|
||||||
*
|
*
|
||||||
* Call context:
|
* Call context:
|
||||||
* Usually interrupt.
|
* Usually interrupt.
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
void p80211netdev_hwremoved(struct wlandevice *wlandev)
|
void p80211netdev_hwremoved(struct wlandevice *wlandev)
|
||||||
{
|
{
|
||||||
wlandev->hwremoved = 1;
|
wlandev->hwremoved = 1;
|
||||||
|
@ -895,26 +909,27 @@ void p80211netdev_hwremoved(struct wlandevice *wlandev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* p80211_rx_typedrop
|
* p80211_rx_typedrop
|
||||||
*
|
*
|
||||||
* Classifies the frame, increments the appropriate counter, and
|
* Classifies the frame, increments the appropriate counter, and
|
||||||
* returns 0|1|2 indicating whether the driver should handle, ignore, or
|
* returns 0|1|2 indicating whether the driver should handle, ignore, or
|
||||||
* drop the frame
|
* drop the frame
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* wlandev wlan device structure
|
* wlandev wlan device structure
|
||||||
* fc frame control field
|
* fc frame control field
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* zero if the frame should be handled by the driver,
|
* zero if the frame should be handled by the driver,
|
||||||
* one if the frame should be ignored
|
* one if the frame should be ignored
|
||||||
* anything else means we drop it.
|
* anything else means we drop it.
|
||||||
*
|
*
|
||||||
* Side effects:
|
* Side effects:
|
||||||
*
|
*
|
||||||
* Call context:
|
* Call context:
|
||||||
* interrupt
|
* interrupt
|
||||||
----------------------------------------------------------------*/
|
*----------------------------------------------------------------
|
||||||
|
*/
|
||||||
static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
|
static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
|
||||||
{
|
{
|
||||||
u16 ftype;
|
u16 ftype;
|
||||||
|
|
Loading…
Reference in New Issue