o wl3501: kill magic numbers in cap_info, fix bss_type setting

it was only setting INFRA mode...
parent 40ec3f83
...@@ -187,6 +187,12 @@ enum wl3501_status { ...@@ -187,6 +187,12 @@ enum wl3501_status {
WL3501_STATUS_ALREADY_BSS, WL3501_STATUS_ALREADY_BSS,
}; };
#define WL3501_MGMT_CAPABILITY_ESS 0x0001 /* see 802.11 p.58 */
#define WL3501_MGMT_CAPABILITY_IBSS 0x0002 /* - " - */
#define WL3501_MGMT_CAPABILITY_CF_POLLABLE 0x0004 /* - " - */
#define WL3501_MGMT_CAPABILITY_CF_POLL_REQUEST 0x0008 /* - " - */
#define WL3501_MGMT_CAPABILITY_PRIVACY 0x0010 /* - " - */
#define WL3501_FREQ_DOMAIN_FCC 0x10 /* Channel 1 to 11 */ #define WL3501_FREQ_DOMAIN_FCC 0x10 /* Channel 1 to 11 */
#define WL3501_FREQ_DOMAIN_IC 0x20 /* Channel 1 to 11 */ #define WL3501_FREQ_DOMAIN_IC 0x20 /* Channel 1 to 11 */
#define WL3501_FREQ_DOMAIN_ETSI 0x30 /* Channel 1 to 13 */ #define WL3501_FREQ_DOMAIN_ETSI 0x30 /* Channel 1 to 13 */
......
...@@ -553,14 +553,18 @@ static int wl3501_mgmt_start(struct wl3501_card *this) ...@@ -553,14 +553,18 @@ static int wl3501_mgmt_start(struct wl3501_card *this)
memcpy((char *)signal.ssid, (char *)this->essid, WL3501_ESSID_MAX_LEN); memcpy((char *)signal.ssid, (char *)this->essid, WL3501_ESSID_MAX_LEN);
memcpy((char *)this->keep_essid, (char *)this->essid, memcpy((char *)this->keep_essid, (char *)this->essid,
WL3501_ESSID_MAX_LEN); WL3501_ESSID_MAX_LEN);
signal.bss_type = this->net_type = IW_MODE_INFRA ? if (this->net_type == IW_MODE_INFRA) {
WL3501_NET_TYPE_INFRA : WL3501_NET_TYPE_INFRA; signal.bss_type = WL3501_NET_TYPE_INFRA;
signal.cap_info = WL3501_MGMT_CAPABILITY_ESS;
} else {
signal.bss_type = WL3501_NET_TYPE_ADHOC;
signal.cap_info = WL3501_MGMT_CAPABILITY_IBSS;
}
signal.beacon_period = 400; signal.beacon_period = 400;
signal.dtim_period = 1; signal.dtim_period = 1;
signal.phy_pset[0] = 3; signal.phy_pset[0] = 3;
signal.phy_pset[1] = 1; signal.phy_pset[1] = 1;
signal.phy_pset[2] = this->chan; signal.phy_pset[2] = this->chan;
signal.cap_info = 0x02;
signal.bss_basic_rate_set[0] = 0x01; signal.bss_basic_rate_set[0] = 0x01;
signal.bss_basic_rate_set[1] = 0x02; signal.bss_basic_rate_set[1] = 0x02;
signal.bss_basic_rate_set[2] = 0x82; signal.bss_basic_rate_set[2] = 0x82;
...@@ -608,9 +612,9 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr) ...@@ -608,9 +612,9 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
this->bss_cnt++; this->bss_cnt++;
} }
} else if ((this->net_type == IW_MODE_INFRA && } else if ((this->net_type == IW_MODE_INFRA &&
(signal.cap_info & 0x01)) || (signal.cap_info & WL3501_MGMT_CAPABILITY_ESS)) ||
(this->net_type == IW_MODE_ADHOC && (this->net_type == IW_MODE_ADHOC &&
(signal.cap_info & 0x02)) || (signal.cap_info & WL3501_MGMT_CAPABILITY_IBSS)) ||
this->net_type == IW_MODE_AUTO) { this->net_type == IW_MODE_AUTO) {
if (!this->essid[1]) if (!this->essid[1])
matchflag = 1; matchflag = 1;
......
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