diff options
Diffstat (limited to 'drivers/net/wireless/airo.c')
| -rw-r--r-- | drivers/net/wireless/airo.c | 276 | 
1 files changed, 111 insertions, 165 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index a36e7870b03..64747d457bb 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -36,8 +36,7 @@  #include <linux/bitops.h>  #include <linux/scatterlist.h>  #include <linux/crypto.h> -#include <asm/io.h> -#include <asm/system.h> +#include <linux/io.h>  #include <asm/unaligned.h>  #include <linux/netdevice.h> @@ -46,11 +45,11 @@  #include <linux/if_arp.h>  #include <linux/ioport.h>  #include <linux/pci.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h>  #include <linux/kthread.h>  #include <linux/freezer.h> -#include <linux/ieee80211.h> +#include <net/cfg80211.h>  #include <net/iw_handler.h>  #include "airo.h" @@ -79,7 +78,7 @@ static struct pci_driver airo_driver = {  	.name     = DRV_NAME,  	.id_table = card_ids,  	.probe    = airo_pci_probe, -	.remove   = __devexit_p(airo_pci_remove), +	.remove   = airo_pci_remove,  	.suspend  = airo_pci_suspend,  	.resume   = airo_pci_resume,  }; @@ -88,7 +87,6 @@ static struct pci_driver airo_driver = {  /* Include Wireless Extension definition and check version - Jean II */  #include <linux/wireless.h>  #define WIRELESS_SPY		/* enable iwspy support */ -#include <net/iw_handler.h>	/* New driver API */  #define CISCO_EXT		/* enable Cisco extensions */  #ifdef CISCO_EXT @@ -233,8 +231,10 @@ static int adhoc;  static int probe = 1; +static kuid_t proc_kuid;  static int proc_uid /* = 0 */; +static kgid_t proc_kgid;  static int proc_gid /* = 0 */;  static int airo_perm = 0555; @@ -242,9 +242,8 @@ static int airo_perm = 0555;  static int proc_perm = 0644;  MODULE_AUTHOR("Benjamin Reed"); -MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet \ -cards.  Direct support for ISA/PCI/MPI cards and support \ -for PCMCIA when used with airo_cs."); +MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet cards.  " +		   "Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs.");  MODULE_LICENSE("Dual BSD/GPL");  MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350");  module_param_array(io, int, NULL, 0); @@ -252,18 +251,20 @@ module_param_array(irq, int, NULL, 0);  module_param_array(rates, int, NULL, 0);  module_param_array(ssids, charp, NULL, 0);  module_param(auto_wep, int, 0); -MODULE_PARM_DESC(auto_wep, "If non-zero, the driver will keep looping through \ -the authentication options until an association is made.  The value of \ -auto_wep is number of the wep keys to check.  A value of 2 will try using \ -the key at index 0 and index 1."); +MODULE_PARM_DESC(auto_wep, +		 "If non-zero, the driver will keep looping through the authentication options until an association is made.  " +		 "The value of auto_wep is number of the wep keys to check.  " +		 "A value of 2 will try using the key at index 0 and index 1.");  module_param(aux_bap, int, 0); -MODULE_PARM_DESC(aux_bap, "If non-zero, the driver will switch into a mode \ -than seems to work better for older cards with some older buses.  Before \ -switching it checks that the switch is needed."); +MODULE_PARM_DESC(aux_bap, +		 "If non-zero, the driver will switch into a mode that seems to work better for older cards with some older buses.  " +		 "Before switching it checks that the switch is needed.");  module_param(maxencrypt, int, 0); -MODULE_PARM_DESC(maxencrypt, "The maximum speed that the card can do \ -encryption.  Units are in 512kbs.  Zero (default) means there is no limit. \ -Older cards used to be limited to 2mbs (4)."); +MODULE_PARM_DESC(maxencrypt, +		 "The maximum speed that the card can do encryption.  " +		 "Units are in 512kbs.  " +		 "Zero (default) means there is no limit.  " +		 "Older cards used to be limited to 2mbs (4).");  module_param(adhoc, int, 0);  MODULE_PARM_DESC(adhoc, "If non-zero, the card will start in adhoc mode.");  module_param(probe, int, 0); @@ -1417,7 +1418,7 @@ static int encapsulate(struct airo_info *ai ,etherHead *frame, MICBuffer *mic, i  	emmh32_update(&context->seed,frame->da,ETH_ALEN * 2); // DA,SA  	emmh32_update(&context->seed,(u8*)&mic->typelen,10); // Type/Length and Snap  	emmh32_update(&context->seed,(u8*)&mic->seq,sizeof(mic->seq)); //SEQ -	emmh32_update(&context->seed,frame->da + ETH_ALEN * 2,payLen); //payload +	emmh32_update(&context->seed,(u8*)(frame + 1),payLen); //payload  	emmh32_final(&context->seed, (u8*)&mic->mic);  	/*    New Type/length ?????????? */ @@ -1505,7 +1506,7 @@ static int decapsulate(struct airo_info *ai, MICBuffer *mic, etherHead *eth, u16  		emmh32_update(&context->seed, eth->da, ETH_ALEN*2);   		emmh32_update(&context->seed, (u8 *)&mic->typelen, sizeof(mic->typelen)+sizeof(mic->u.snap));   		emmh32_update(&context->seed, (u8 *)&mic->seq,sizeof(mic->seq));	 -		emmh32_update(&context->seed, eth->da + ETH_ALEN*2,payLen);	 +		emmh32_update(&context->seed, (u8 *)(eth + 1),payLen);	  		//Calculate MIC  		emmh32_final(&context->seed, digest); @@ -1868,7 +1869,7 @@ static int readStatsRid(struct airo_info*ai, StatsRid *sr, int rid, int lock)  static void try_auto_wep(struct airo_info *ai)  { -	if (auto_wep && !(ai->flags & FLAG_RADIO_DOWN)) { +	if (auto_wep && !test_bit(FLAG_RADIO_DOWN, &ai->flags)) {  		ai->expires = RUN_AT(3*HZ);  		wake_up_interruptible(&ai->thr_wait);  	} @@ -1884,7 +1885,7 @@ static int airo_open(struct net_device *dev) {  	/* Make sure the card is configured.  	 * Wireless Extensions may postpone config changes until the card  	 * is open (to pipeline changes and speed-up card setup). If -	 * those changes are not yet commited, do it now - Jean II */ +	 * those changes are not yet committed, do it now - Jean II */  	if (test_bit(FLAG_COMMIT, &ai->flags)) {  		disable_MAC(ai, 1);  		writeConfigRid(ai, 1); @@ -1892,7 +1893,8 @@ static int airo_open(struct net_device *dev) {  	if (ai->wifidev != dev) {  		clear_bit(JOB_DIE, &ai->jobs); -		ai->airo_thread_task = kthread_run(airo_thread, dev, dev->name); +		ai->airo_thread_task = kthread_run(airo_thread, dev, "%s", +						   dev->name);  		if (IS_ERR(ai->airo_thread_task))  			return (int)PTR_ERR(ai->airo_thread_task); @@ -1992,12 +1994,12 @@ static int mpi_send_packet (struct net_device *dev)  /*   * Magic, the cards firmware needs a length count (2 bytes) in the host buffer   * right after  TXFID_HDR.The TXFID_HDR contains the status short so payloadlen - * is immediatly after it. ------------------------------------------------ + * is immediately after it. ------------------------------------------------   *                         |TXFIDHDR+STATUS|PAYLOADLEN|802.3HDR|PACKETDATA|   *                         ------------------------------------------------   */ -	memcpy((char *)ai->txfids[0].virtual_host_addr, +	memcpy(ai->txfids[0].virtual_host_addr,  		(char *)&wifictlhdr8023, sizeof(wifictlhdr8023));  	payloadLen = (__le16 *)(ai->txfids[0].virtual_host_addr + @@ -2006,7 +2008,7 @@ static int mpi_send_packet (struct net_device *dev)  		sizeof(wifictlhdr8023) + 2 ;  	/* -	 * Firmware automaticly puts 802 header on so +	 * Firmware automatically puts 802 header on so  	 * we don't need to account for it in the length  	 */  	if (test_bit(FLAG_MIC_CAPABLE, &ai->flags) && ai->micstats.enabled && @@ -2531,7 +2533,7 @@ static int mpi_init_descriptors (struct airo_info *ai)  /*   * We are setting up three things here:   * 1) Map AUX memory for descriptors: Rid, TxFid, or RxFid. - * 2) Map PCI memory for issueing commands. + * 2) Map PCI memory for issuing commands.   * 3) Allocate memory (shared) to send and receive ethernet frames.   */  static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci) @@ -2691,7 +2693,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,  	dev->base_addr = ethdev->base_addr;  	dev->wireless_data = ethdev->wireless_data;  	SET_NETDEV_DEV(dev, ethdev->dev.parent); -	memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len); +	eth_hw_addr_inherit(dev, ethdev);  	err = register_netdev(dev);  	if (err<0) {  		free_netdev(dev); @@ -2753,7 +2755,7 @@ static const struct net_device_ops airo_netdev_ops = {  	.ndo_stop		= airo_close,  	.ndo_start_xmit		= airo_start_xmit,  	.ndo_get_stats		= airo_get_stats, -	.ndo_set_multicast_list	= airo_set_multicast_list, +	.ndo_set_rx_mode	= airo_set_multicast_list,  	.ndo_set_mac_address	= airo_set_mac_address,  	.ndo_do_ioctl		= airo_ioctl,  	.ndo_change_mtu		= airo_change_mtu, @@ -2765,7 +2767,7 @@ static const struct net_device_ops mpi_netdev_ops = {  	.ndo_stop		= airo_close,  	.ndo_start_xmit		= mpi_start_xmit,  	.ndo_get_stats		= airo_get_stats, -	.ndo_set_multicast_list	= airo_set_multicast_list, +	.ndo_set_rx_mode	= airo_set_multicast_list,  	.ndo_set_mac_address	= airo_set_mac_address,  	.ndo_do_ioctl		= airo_ioctl,  	.ndo_change_mtu		= airo_change_mtu, @@ -2822,6 +2824,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,  	dev->wireless_data = &ai->wireless_data;  	dev->irq = irq;  	dev->base_addr = port; +	dev->priv_flags &= ~IFF_TX_SKB_SHARING;  	SET_NETDEV_DEV(dev, dmdev); @@ -3947,7 +3950,7 @@ static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) {  	if ( max_tries == -1 ) {  		airo_print_err(ai->dev->name, -			"Max tries exceeded when issueing command"); +			"Max tries exceeded when issuing command");  		if (IN4500(ai, COMMAND) & COMMAND_BUSY)  			OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY);  		return ERROR; @@ -4173,7 +4176,7 @@ done:  }  /*  Note, that we are using BAP1 which is also used by transmit, so - *  make sure this isnt called when a transmit is happening */ + *  make sure this isn't called when a transmit is happening */  static int PC4500_writerid(struct airo_info *ai, u16 rid,  			   const void *pBuf, int len, int lock)  { @@ -4211,7 +4214,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid,  			airo_print_err(ai->dev->name, "%s: len=%d", __func__, len);  			rc = -1;  		} else { -			memcpy((char *)ai->config_desc.virtual_host_addr, +			memcpy(ai->config_desc.virtual_host_addr,  				pBuf, len);  			rc = issuecommand(ai, &cmd, &rsp); @@ -4498,122 +4501,81 @@ struct proc_data {  static int setup_proc_entry( struct net_device *dev,  			     struct airo_info *apriv ) {  	struct proc_dir_entry *entry; +  	/* First setup the device directory */  	strcpy(apriv->proc_name,dev->name); -	apriv->proc_entry = create_proc_entry(apriv->proc_name, -					      S_IFDIR|airo_perm, -					      airo_entry); +	apriv->proc_entry = proc_mkdir_mode(apriv->proc_name, airo_perm, +					    airo_entry);  	if (!apriv->proc_entry) -		goto fail; -	apriv->proc_entry->uid = proc_uid; -	apriv->proc_entry->gid = proc_gid; +		return -ENOMEM; +	proc_set_user(apriv->proc_entry, proc_kuid, proc_kgid);  	/* Setup the StatsDelta */ -	entry = proc_create_data("StatsDelta", -				 S_IFREG | (S_IRUGO&proc_perm), +	entry = proc_create_data("StatsDelta", S_IRUGO & proc_perm,  				 apriv->proc_entry, &proc_statsdelta_ops, dev);  	if (!entry) -		goto fail_stats_delta; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the Stats */ -	entry = proc_create_data("Stats", -				 S_IFREG | (S_IRUGO&proc_perm), +	entry = proc_create_data("Stats", S_IRUGO & proc_perm,  				 apriv->proc_entry, &proc_stats_ops, dev);  	if (!entry) -		goto fail_stats; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the Status */ -	entry = proc_create_data("Status", -				 S_IFREG | (S_IRUGO&proc_perm), +	entry = proc_create_data("Status", S_IRUGO & proc_perm,  				 apriv->proc_entry, &proc_status_ops, dev);  	if (!entry) -		goto fail_status; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the Config */ -	entry = proc_create_data("Config", -				 S_IFREG | proc_perm, +	entry = proc_create_data("Config", proc_perm,  				 apriv->proc_entry, &proc_config_ops, dev);  	if (!entry) -		goto fail_config; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the SSID */ -	entry = proc_create_data("SSID", -				 S_IFREG | proc_perm, +	entry = proc_create_data("SSID", proc_perm,  				 apriv->proc_entry, &proc_SSID_ops, dev);  	if (!entry) -		goto fail_ssid; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the APList */ -	entry = proc_create_data("APList", -				 S_IFREG | proc_perm, +	entry = proc_create_data("APList", proc_perm,  				 apriv->proc_entry, &proc_APList_ops, dev);  	if (!entry) -		goto fail_aplist; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the BSSList */ -	entry = proc_create_data("BSSList", -				 S_IFREG | proc_perm, +	entry = proc_create_data("BSSList", proc_perm,  				 apriv->proc_entry, &proc_BSSList_ops, dev);  	if (!entry) -		goto fail_bsslist; -	entry->uid = proc_uid; -	entry->gid = proc_gid; +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	/* Setup the WepKey */ -	entry = proc_create_data("WepKey", -				 S_IFREG | proc_perm, +	entry = proc_create_data("WepKey", proc_perm,  				 apriv->proc_entry, &proc_wepkey_ops, dev);  	if (!entry) -		goto fail_wepkey; -	entry->uid = proc_uid; -	entry->gid = proc_gid; - +		goto fail; +	proc_set_user(entry, proc_kuid, proc_kgid);  	return 0; -fail_wepkey: -	remove_proc_entry("BSSList", apriv->proc_entry); -fail_bsslist: -	remove_proc_entry("APList", apriv->proc_entry); -fail_aplist: -	remove_proc_entry("SSID", apriv->proc_entry); -fail_ssid: -	remove_proc_entry("Config", apriv->proc_entry); -fail_config: -	remove_proc_entry("Status", apriv->proc_entry); -fail_status: -	remove_proc_entry("Stats", apriv->proc_entry); -fail_stats: -	remove_proc_entry("StatsDelta", apriv->proc_entry); -fail_stats_delta: -	remove_proc_entry(apriv->proc_name, airo_entry);  fail: +	remove_proc_subtree(apriv->proc_name, airo_entry);  	return -ENOMEM;  }  static int takedown_proc_entry( struct net_device *dev, -				struct airo_info *apriv ) { -	if ( !apriv->proc_entry->namelen ) return 0; -	remove_proc_entry("Stats",apriv->proc_entry); -	remove_proc_entry("StatsDelta",apriv->proc_entry); -	remove_proc_entry("Status",apriv->proc_entry); -	remove_proc_entry("Config",apriv->proc_entry); -	remove_proc_entry("SSID",apriv->proc_entry); -	remove_proc_entry("APList",apriv->proc_entry); -	remove_proc_entry("BSSList",apriv->proc_entry); -	remove_proc_entry("WepKey",apriv->proc_entry); -	remove_proc_entry(apriv->proc_name,airo_entry); +				struct airo_info *apriv ) +{ +	remove_proc_subtree(apriv->proc_name, airo_entry);  	return 0;  } @@ -4652,31 +4614,24 @@ static ssize_t proc_write( struct file *file,  			   size_t len,  			   loff_t *offset )  { -	loff_t pos = *offset; +	ssize_t ret;  	struct proc_data *priv = file->private_data;  	if (!priv->wbuffer)  		return -EINVAL; -	if (pos < 0) -		return -EINVAL; -	if (pos >= priv->maxwritelen) -		return 0; -	if (len > priv->maxwritelen - pos) -		len = priv->maxwritelen - pos; -	if (copy_from_user(priv->wbuffer + pos, buffer, len)) -		return -EFAULT; -	if ( pos + len > priv->writelen ) -		priv->writelen = len + file->f_pos; -	*offset = pos + len; -	return len; +	ret = simple_write_to_buffer(priv->wbuffer, priv->maxwritelen, offset, +					buffer, len); +	if (ret > 0) +		priv->writelen = max_t(int, priv->writelen, *offset); + +	return ret;  }  static int proc_status_open(struct inode *inode, struct file *file)  {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *apriv = dev->ml_priv;  	CapabilityRid cap_rid;  	StatusRid status_rid; @@ -4758,8 +4713,7 @@ static int proc_stats_rid_open( struct inode *inode,  				u16 rid )  {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *apriv = dev->ml_priv;  	StatsRid stats;  	int i, j; @@ -4782,7 +4736,7 @@ static int proc_stats_rid_open( struct inode *inode,  		if (!statsLabels[i]) continue;  		if (j+strlen(statsLabels[i])+16>4096) {  			airo_print_warn(apriv->dev->name, -			       "Potentially disasterous buffer overflow averted!"); +			       "Potentially disastrous buffer overflow averted!");  			break;  		}  		j+=sprintf(data->rbuffer+j, "%s: %u\n", statsLabels[i], @@ -4821,8 +4775,7 @@ static inline int sniffing_mode(struct airo_info *ai)  static void proc_config_on_close(struct inode *inode, struct file *file)  {  	struct proc_data *data = file->private_data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	char *line; @@ -5033,8 +4986,7 @@ static const char *get_rmode(__le16 mode)  static int proc_config_open(struct inode *inode, struct file *file)  {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	int i;  	__le16 mode; @@ -5124,8 +5076,7 @@ static int proc_config_open(struct inode *inode, struct file *file)  static void proc_SSID_on_close(struct inode *inode, struct file *file)  {  	struct proc_data *data = file->private_data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	SsidRid SSID_rid;  	int i; @@ -5160,8 +5111,7 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)  static void proc_APList_on_close( struct inode *inode, struct file *file ) {  	struct proc_data *data = file->private_data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	APListRid APList_rid;  	int i; @@ -5295,8 +5245,7 @@ static int set_wep_tx_idx(struct airo_info *ai, u16 index, int perm, int lock)  static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	int i, rc;  	char key[16]; @@ -5347,8 +5296,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {  static int proc_wepkey_open( struct inode *inode, struct file *file )  {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	char *ptr;  	WepKeyRid wkr; @@ -5396,8 +5344,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file )  static int proc_SSID_open(struct inode *inode, struct file *file)  {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	int i;  	char *ptr; @@ -5440,8 +5387,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)  static int proc_APList_open( struct inode *inode, struct file *file ) {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	int i;  	char *ptr; @@ -5480,8 +5426,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {  static int proc_BSSList_open( struct inode *inode, struct file *file ) {  	struct proc_data *data; -	struct proc_dir_entry *dp = PDE(inode); -	struct net_device *dev = dp->data; +	struct net_device *dev = PDE_DATA(inode);  	struct airo_info *ai = dev->ml_priv;  	char *ptr;  	BSSListRid BSSList_rid; @@ -5596,7 +5541,7 @@ static void timer_func( struct net_device *dev ) {  }  #ifdef CONFIG_PCI -static int __devinit airo_pci_probe(struct pci_dev *pdev, +static int airo_pci_probe(struct pci_dev *pdev,  				    const struct pci_device_id *pent)  {  	struct net_device *dev; @@ -5618,14 +5563,13 @@ static int __devinit airo_pci_probe(struct pci_dev *pdev,  	return 0;  } -static void __devexit airo_pci_remove(struct pci_dev *pdev) +static void airo_pci_remove(struct pci_dev *pdev)  {  	struct net_device *dev = pci_get_drvdata(pdev);  	airo_print_info(dev->name, "Unregistering...");  	stop_airo_card(dev, 1);  	pci_disable_device(pdev); -	pci_set_drvdata(pdev, NULL);  }  static int airo_pci_suspend(struct pci_dev *pdev, pm_message_t state) @@ -5711,14 +5655,15 @@ static int __init airo_init_module( void )  {  	int i; -	airo_entry = create_proc_entry("driver/aironet", -				       S_IFDIR | airo_perm, -				       NULL); +	proc_kuid = make_kuid(&init_user_ns, proc_uid); +	proc_kgid = make_kgid(&init_user_ns, proc_gid); +	if (!uid_valid(proc_kuid) || !gid_valid(proc_kgid)) +		return -EINVAL; -	if (airo_entry) { -		airo_entry->uid = proc_uid; -		airo_entry->gid = proc_gid; -	} +	airo_entry = proc_mkdir_mode("driver/aironet", airo_perm, NULL); + +	if (airo_entry) +		proc_set_user(airo_entry, proc_kuid, proc_kgid);  	for (i = 0; i < 4 && io[i] && irq[i]; i++) {  		airo_print_info("", "Trying to configure ISA adapter at irq=%d " @@ -5852,7 +5797,7 @@ static int airo_set_freq(struct net_device *dev,  		/* Hack to fall through... */  		fwrq->e = 0; -		fwrq->m = ieee80211_freq_to_dsss_chan(f); +		fwrq->m = ieee80211_frequency_to_channel(f);  	}  	/* Setting by channel number */  	if((fwrq->m > 1000) || (fwrq->e > 0)) @@ -5896,7 +5841,8 @@ static int airo_get_freq(struct net_device *dev,  	ch = le16_to_cpu(status_rid.channel);  	if((ch > 0) && (ch < 15)) { -		fwrq->m = ieee80211_dsss_chan_to_freq(ch) * 100000; +		fwrq->m = 100000 * +			ieee80211_channel_to_frequency(ch, IEEE80211_BAND_2GHZ);  		fwrq->e = 1;  	} else {  		fwrq->m = ch; @@ -5992,13 +5938,11 @@ static int airo_set_wap(struct net_device *dev,  	Cmd cmd;  	Resp rsp;  	APListRid APList_rid; -	static const u8 any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; -	static const u8 off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };  	if (awrq->sa_family != ARPHRD_ETHER)  		return -EINVAL; -	else if (!memcmp(any, awrq->sa_data, ETH_ALEN) || -	         !memcmp(off, awrq->sa_data, ETH_ALEN)) { +	else if (is_broadcast_ether_addr(awrq->sa_data) || +		 is_zero_ether_addr(awrq->sa_data)) {  		memset(&cmd, 0, sizeof(cmd));  		cmd.cmd=CMD_LOSE_SYNC;  		if (down_interruptible(&local->sem)) @@ -6955,7 +6899,8 @@ static int airo_get_range(struct net_device *dev,  	k = 0;  	for(i = 0; i < 14; i++) {  		range->freq[k].i = i + 1; /* List index */ -		range->freq[k].m = ieee80211_dsss_chan_to_freq(i + 1) * 100000; +		range->freq[k].m = 100000 * +		     ieee80211_channel_to_frequency(i + 1, IEEE80211_BAND_2GHZ);  		range->freq[k++].e = 1;	/* Values in MHz -> * 10^5 * 10 */  	}  	range->num_frequency = k; @@ -7249,8 +7194,8 @@ static int airo_get_aplist(struct net_device *dev,  		}  	} else {  		dwrq->flags = 1; /* Should be define'd */ -		memcpy(extra + sizeof(struct sockaddr)*i, -		       &qual,  sizeof(struct iw_quality)*i); +		memcpy(extra + sizeof(struct sockaddr) * i, qual, +		       sizeof(struct iw_quality) * i);  	}  	dwrq->length = i; @@ -7354,7 +7299,8 @@ static inline char *airo_translate_scan(struct net_device *dev,  	/* Add frequency */  	iwe.cmd = SIOCGIWFREQ;  	iwe.u.freq.m = le16_to_cpu(bss->dsChannel); -	iwe.u.freq.m = ieee80211_dsss_chan_to_freq(iwe.u.freq.m) * 100000; +	iwe.u.freq.m = 100000 * +	      ieee80211_channel_to_frequency(iwe.u.freq.m, IEEE80211_BAND_2GHZ);  	iwe.u.freq.e = 1;  	current_ev = iwe_stream_add_event(info, current_ev, end_buf,  					  &iwe, IW_EV_FREQ_LEN); @@ -7444,7 +7390,7 @@ static inline char *airo_translate_scan(struct net_device *dev,  					num_null_ies++;  				break; -			case WLAN_EID_GENERIC: +			case WLAN_EID_VENDOR_SPECIFIC:  				if (ie[1] >= 4 &&  				    ie[2] == 0x00 &&  				    ie[3] == 0x50 &&  | 
