o wl3501: introduce iw_mgmt_data_rset and rate labels enum

parent 4e349e0a
...@@ -203,6 +203,15 @@ enum wl3501_status { ...@@ -203,6 +203,15 @@ enum wl3501_status {
#define IW_REG_DOMAIN_MKK1 0x41 /* Channel 1-14 Japan */ #define IW_REG_DOMAIN_MKK1 0x41 /* Channel 1-14 Japan */
#define IW_REG_DOMAIN_ISRAEL 0x50 /* Channel 3 - 9 Israel */ #define IW_REG_DOMAIN_ISRAEL 0x50 /* Channel 3 - 9 Israel */
#define IW_MGMT_RATE_LABEL_MANDATORY 128 /* MSB */
enum iw_mgmt_rate_labels {
IW_MGMT_RATE_LABEL_1MBIT = 2,
IW_MGMT_RATE_LABEL_2MBIT = 4,
IW_MGMT_RATE_LABEL_5_5MBIT = 11,
IW_MGMT_RATE_LABEL_11MBIT = 22,
};
enum iw_mgmt_info_element_ids { enum iw_mgmt_info_element_ids {
IW_MGMT_INFO_ELEMENT_SSID, /* Service Set Identity */ IW_MGMT_INFO_ELEMENT_SSID, /* Service Set Identity */
IW_MGMT_INFO_ELEMENT_SUPPORTED_RATES, IW_MGMT_INFO_ELEMENT_SUPPORTED_RATES,
...@@ -229,6 +238,17 @@ struct iw_mgmt_essid_pset { ...@@ -229,6 +238,17 @@ struct iw_mgmt_essid_pset {
u8 essid[IW_ESSID_MAX_SIZE]; u8 essid[IW_ESSID_MAX_SIZE];
} __attribute__ ((packed)); } __attribute__ ((packed));
/*
* According to 802.11 Wireless Netowors, the definitive guide - O'Reilly
* Pg 75
*/
#define IW_DATA_RATE_MAX_LABELS 8
struct iw_mgmt_data_rset {
struct iw_mgmt_info_element el;
u8 data_rate_labels[IW_DATA_RATE_MAX_LABELS];
} __attribute__ ((packed));
struct iw_mgmt_ds_pset { struct iw_mgmt_ds_pset {
struct iw_mgmt_info_element el; struct iw_mgmt_info_element el;
u8 chan; u8 chan;
...@@ -294,8 +314,8 @@ struct wl3501_start_req { ...@@ -294,8 +314,8 @@ struct wl3501_start_req {
u16 probe_delay; u16 probe_delay;
u16 cap_info; u16 cap_info;
struct iw_mgmt_essid_pset ssid; struct iw_mgmt_essid_pset ssid;
u8 bss_basic_rate_set[10]; struct iw_mgmt_data_rset bss_basic_rset;
u8 operational_rate_set[10]; struct iw_mgmt_data_rset operational_rset;
struct iw_mgmt_cf_pset cf_pset; struct iw_mgmt_cf_pset cf_pset;
struct iw_mgmt_ds_pset ds_pset; struct iw_mgmt_ds_pset ds_pset;
struct iw_mgmt_ibss_pset ibss_pset; struct iw_mgmt_ibss_pset ibss_pset;
...@@ -362,7 +382,7 @@ struct wl3501_join_req { ...@@ -362,7 +382,7 @@ struct wl3501_join_req {
u16 next_blk; u16 next_blk;
u8 sig_id; u8 sig_id;
u8 reserved; u8 reserved;
u8 operational_rate_set[10]; struct iw_mgmt_data_rset operational_rset;
u16 reserved2; u16 reserved2;
u16 timeout; u16 timeout;
u16 probe_delay; u16 probe_delay;
...@@ -377,7 +397,7 @@ struct wl3501_join_req { ...@@ -377,7 +397,7 @@ struct wl3501_join_req {
struct iw_mgmt_ds_pset ds_pset; struct iw_mgmt_ds_pset ds_pset;
struct iw_mgmt_cf_pset cf_pset; struct iw_mgmt_cf_pset cf_pset;
struct iw_mgmt_ibss_pset ibss_pset; struct iw_mgmt_ibss_pset ibss_pset;
u8 bss_basic_rate_set[10]; struct iw_mgmt_data_rset bss_basic_rset;
}; };
struct wl3501_join_confirm { struct wl3501_join_confirm {
...@@ -431,7 +451,7 @@ struct wl3501_scan_confirm { ...@@ -431,7 +451,7 @@ struct wl3501_scan_confirm {
struct iw_mgmt_ds_pset ds_pset; struct iw_mgmt_ds_pset ds_pset;
struct iw_mgmt_cf_pset cf_pset; struct iw_mgmt_cf_pset cf_pset;
struct iw_mgmt_ibss_pset ibss_pset; struct iw_mgmt_ibss_pset ibss_pset;
u8 bss_basic_rate_set[10]; struct iw_mgmt_data_rset bss_basic_rset;
u8 rssi; u8 rssi;
}; };
......
...@@ -660,11 +660,25 @@ static int wl3501_mgmt_start(struct wl3501_card *this) ...@@ -660,11 +660,25 @@ static int wl3501_mgmt_start(struct wl3501_card *this)
.el.len = 1, .el.len = 1,
.chan = this->chan, .chan = this->chan,
}, },
.bss_basic_rate_set = { .bss_basic_rset = {
[0] = 0x01, [1] = 0x02, [2] = 0x82, [3] = 0x84, .el.id = IW_MGMT_INFO_ELEMENT_SUPPORTED_RATES,
.el.len = 2,
.data_rate_labels = {
[0] = IW_MGMT_RATE_LABEL_MANDATORY |
IW_MGMT_RATE_LABEL_1MBIT,
[1] = IW_MGMT_RATE_LABEL_MANDATORY |
IW_MGMT_RATE_LABEL_2MBIT,
},
}, },
.operational_rate_set = { .operational_rset = {
[0] = 0x01, [1] = 0x02, [2] = 0x82, [3] = 0x84, .el.id = IW_MGMT_INFO_ELEMENT_SUPPORTED_RATES,
.el.len = 2,
.data_rate_labels = {
[0] = IW_MGMT_RATE_LABEL_MANDATORY |
IW_MGMT_RATE_LABEL_1MBIT,
[1] = IW_MGMT_RATE_LABEL_MANDATORY |
IW_MGMT_RATE_LABEL_2MBIT,
},
}, },
.ibss_pset = { .ibss_pset = {
.el.id = IW_MGMT_INFO_ELEMENT_IBSS_PARAMETER_SET, .el.id = IW_MGMT_INFO_ELEMENT_IBSS_PARAMETER_SET,
......
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