o wl3501: use the regulatory domain defines

I.e. less magic numbers, also rename freq_domain to reg_domain, as
in regulatory domain, as the atmel driver does, and that made me
realize that this defines and the function that checks if a channel
is valid in a regulatory domain should be moved to the wireless
extensions (or some other place) common code.
parent 7765fae1
...@@ -194,12 +194,12 @@ enum wl3501_status { ...@@ -194,12 +194,12 @@ enum wl3501_status {
#define WL3501_MGMT_CAPABILITY_CF_POLL_REQUEST 0x0008 /* - " - */ #define WL3501_MGMT_CAPABILITY_CF_POLL_REQUEST 0x0008 /* - " - */
#define WL3501_MGMT_CAPABILITY_PRIVACY 0x0010 /* - " - */ #define WL3501_MGMT_CAPABILITY_PRIVACY 0x0010 /* - " - */
#define WL3501_FREQ_DOMAIN_FCC 0x10 /* Channel 1 to 11 */ #define WL3501_REG_DOMAIN_FCC 0x10 /* Channel 1 to 11 */
#define WL3501_FREQ_DOMAIN_IC 0x20 /* Channel 1 to 11 */ #define WL3501_REG_DOMAIN_IC 0x20 /* Channel 1 to 11 */
#define WL3501_FREQ_DOMAIN_ETSI 0x30 /* Channel 1 to 13 */ #define WL3501_REG_DOMAIN_ETSI 0x30 /* Channel 1 to 13 */
#define WL3501_FREQ_DOMAIN_SPAIN 0x31 /* Channel 10 to 11 */ #define WL3501_REG_DOMAIN_SPAIN 0x31 /* Channel 10 to 11 */
#define WL3501_FREQ_DOMAIN_FRANCE 0x32 /* Channel 10 to 13 */ #define WL3501_REG_DOMAIN_FRANCE 0x32 /* Channel 10 to 13 */
#define WL3501_FREQ_DOMAIN_MKK 0x40 /* Channel 14 */ #define WL3501_REG_DOMAIN_MKK 0x40 /* Channel 14 */
#define WL3501_ESSID_MAX_LEN (IW_ESSID_MAX_SIZE + 2) #define WL3501_ESSID_MAX_LEN (IW_ESSID_MAX_SIZE + 2)
...@@ -528,7 +528,7 @@ struct wl3501_card { ...@@ -528,7 +528,7 @@ struct wl3501_card {
u16 join_sta_bss; u16 join_sta_bss;
unsigned char rssi; unsigned char rssi;
u8 adhoc_times; u8 adhoc_times;
u8 freq_domain; u8 reg_domain;
u8 version[2]; u8 version[2];
struct wl3501_scan_confirm bss_set[20]; struct wl3501_scan_confirm bss_set[20];
struct net_device_stats stats; struct net_device_stats stats;
......
...@@ -175,7 +175,7 @@ static int wl3501_get_flash_mac_addr(struct wl3501_card *this) ...@@ -175,7 +175,7 @@ static int wl3501_get_flash_mac_addr(struct wl3501_card *this)
WL3501_NOPLOOP(100); WL3501_NOPLOOP(100);
this->mac_addr[5] = inb(base_addr + WL3501_NIC_IODPA); this->mac_addr[5] = inb(base_addr + WL3501_NIC_IODPA);
WL3501_NOPLOOP(100); WL3501_NOPLOOP(100);
this->freq_domain = inb(base_addr + WL3501_NIC_IODPA); this->reg_domain = inb(base_addr + WL3501_NIC_IODPA);
WL3501_NOPLOOP(100); WL3501_NOPLOOP(100);
wl3501_outb(WL3501_BSS_FPAGE0, base_addr + WL3501_NIC_BSS); wl3501_outb(WL3501_BSS_FPAGE0, base_addr + WL3501_NIC_BSS);
wl3501_outb(0x04, base_addr + WL3501_NIC_LMAL); wl3501_outb(0x04, base_addr + WL3501_NIC_LMAL);
...@@ -2093,17 +2093,17 @@ static void wl3501_config(dev_link_t *link) ...@@ -2093,17 +2093,17 @@ static void wl3501_config(dev_link_t *link)
spin_lock_init(&this->lock); spin_lock_init(&this->lock);
init_waitqueue_head(&this->wait); init_waitqueue_head(&this->wait);
switch (this->freq_domain) { switch (this->reg_domain) {
case 0x31: case WL3501_REG_DOMAIN_SPAIN:
case 0x32: case WL3501_REG_DOMAIN_FRANCE:
this->def_chan = 10; this->def_chan = 10;
break; break;
case 0x40: case WL3501_REG_DOMAIN_MKK:
this->def_chan = 14; this->def_chan = 14;
break; break;
case 0x10: case WL3501_REG_DOMAIN_FCC:
case 0x20: case WL3501_REG_DOMAIN_IC:
case 0x30: case WL3501_REG_DOMAIN_ETSI:
default: default:
this->def_chan = 1; this->def_chan = 1;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment