diff options
Diffstat (limited to 'drivers/net/wireless/wl3501_cs.c')
| -rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 37 | 
1 files changed, 11 insertions, 26 deletions
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index ee82df62e64..d5c371d77dd 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -29,7 +29,6 @@  #include <linux/delay.h>  #include <linux/types.h> -#include <linux/init.h>  #include <linux/interrupt.h>  #include <linux/in.h>  #include <linux/kernel.h> @@ -43,7 +42,7 @@  #include <linux/slab.h>  #include <linux/string.h>  #include <linux/wireless.h> -#include <linux/ieee80211.h> +#include <net/cfg80211.h>  #include <net/iw_handler.h> @@ -53,7 +52,6 @@  #include <asm/io.h>  #include <asm/uaccess.h> -#include <asm/system.h>  #include "wl3501.h" @@ -192,7 +190,7 @@ static inline void wl3501_switch_page(struct wl3501_card *this, u8 page)  }  /* - * Get Ethernet MAC addresss. + * Get Ethernet MAC address.   *   * WARNING: We switch to FPAGE0 and switc back again.   *          Making sure there is no other WL function beening called by ISR. @@ -290,7 +288,7 @@ static void wl3501_get_from_wla(struct wl3501_card *this, u16 src, void *dest,   *  \               \- IEEE 802.11 -/ \-------------- len --------------/   *   \-struct wl3501_80211_tx_hdr--/   \-------- Ethernet Frame -------/   * - * Return = Postion in Card + * Return = Position in Card   */  static u16 wl3501_get_tx_buffer(struct wl3501_card *this, u16 len)  { @@ -674,8 +672,7 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)  				matchflag = 1;  			if (matchflag) {  				for (i = 0; i < this->bss_cnt; i++) { -					if (!memcmp(this->bss_set[i].bssid, -						    sig.bssid, ETH_ALEN)) { +					if (ether_addr_equal_unaligned(this->bss_set[i].bssid, sig.bssid)) {  						matchflag = 0;  						break;  					} @@ -1456,7 +1453,8 @@ static int wl3501_get_freq(struct net_device *dev, struct iw_request_info *info,  {  	struct wl3501_card *this = netdev_priv(dev); -	wrqu->freq.m = ieee80211_dsss_chan_to_freq(this->chan) * 100000; +	wrqu->freq.m = 100000 * +		ieee80211_channel_to_frequency(this->chan, IEEE80211_BAND_2GHZ);  	wrqu->freq.e = 1;  	return 0;  } @@ -1521,13 +1519,12 @@ static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info,  			  union iwreq_data *wrqu, char *extra)  {  	struct wl3501_card *this = netdev_priv(dev); -	static const u8 bcast[ETH_ALEN] = { 255, 255, 255, 255, 255, 255 };  	int rc = -EINVAL;  	/* FIXME: we support other ARPHRDs...*/  	if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)  		goto out; -	if (!memcmp(bcast, wrqu->ap_addr.sa_data, ETH_ALEN)) { +	if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data)) {  		/* FIXME: rescan? */  	} else  		memcpy(this->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); @@ -1781,7 +1778,7 @@ static int wl3501_get_encode(struct net_device *dev,  				  keys, len_keys);  	if (rc)  		goto out; -	tocopy = min_t(u8, len_keys, wrqu->encoding.length); +	tocopy = min_t(u16, len_keys, wrqu->encoding.length);  	tocopy = min_t(u8, tocopy, 100);  	wrqu->encoding.length = tocopy;  	memcpy(extra, keys, tocopy); @@ -1932,7 +1929,7 @@ static int wl3501_config(struct pcmcia_device *link)  	this->base_addr = dev->base_addr;  	if (!wl3501_get_flash_mac_addr(this)) { -		printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", +		printk(KERN_WARNING "%s: Can't read MAC addr in flash ROM?\n",  		       dev->name);  		unregister_netdev(dev);  		goto failed; @@ -2000,7 +1997,7 @@ static int wl3501_resume(struct pcmcia_device *link)  } -static struct pcmcia_device_id wl3501_ids[] = { +static const struct pcmcia_device_id wl3501_ids[] = {  	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0001),  	PCMCIA_DEVICE_NULL  }; @@ -2015,19 +2012,7 @@ static struct pcmcia_driver wl3501_driver = {  	.suspend	= wl3501_suspend,  	.resume		= wl3501_resume,  }; - -static int __init wl3501_init_module(void) -{ -	return pcmcia_register_driver(&wl3501_driver); -} - -static void __exit wl3501_exit_module(void) -{ -	pcmcia_unregister_driver(&wl3501_driver); -} - -module_init(wl3501_init_module); -module_exit(wl3501_exit_module); +module_pcmcia_driver(wl3501_driver);  MODULE_AUTHOR("Fox Chen <mhchen@golf.ccl.itri.org.tw>, "  	      "Arnaldo Carvalho de Melo <acme@conectiva.com.br>,"  | 
