aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/11d.c26
-rw-r--r--drivers/net/wireless/libertas/11d.h29
-rw-r--r--drivers/net/wireless/libertas/assoc.c28
-rw-r--r--drivers/net/wireless/libertas/cmd.c4
-rw-r--r--drivers/net/wireless/libertas/debugfs.c8
-rw-r--r--drivers/net/wireless/libertas/dev.h2
-rw-r--r--drivers/net/wireless/libertas/scan.c29
-rw-r--r--drivers/net/wireless/libertas/types.h91
8 files changed, 112 insertions, 105 deletions
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c
index 4bc46a60ae2f..9a5408e7d94a 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -207,7 +207,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d
207 lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband); 207 lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband);
208 lbs_deb_hex(LBS_DEB_11D, "domaininfo", (char *)domaininfo, 208 lbs_deb_hex(LBS_DEB_11D, "domaininfo", (char *)domaininfo,
209 COUNTRY_CODE_LEN + 1 + 209 COUNTRY_CODE_LEN + 1 +
210 sizeof(struct ieeetypes_subbandset) * nr_subband); 210 sizeof(struct ieee_subbandset) * nr_subband);
211 return 0; 211 return 0;
212} 212}
213 213
@@ -302,11 +302,9 @@ done:
302 * @param parsed_region_chan pointer to parsed_region_chan_11d 302 * @param parsed_region_chan pointer to parsed_region_chan_11d
303 * @return 0 303 * @return 0
304*/ 304*/
305static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* 305static int parse_domain_info_11d(struct ieee_ie_country_info_full_set *countryinfo,
306 countryinfo,
307 u8 band, 306 u8 band,
308 struct parsed_region_chan_11d * 307 struct parsed_region_chan_11d *parsed_region_chan)
309 parsed_region_chan)
310{ 308{
311 u8 nr_subband, nrchan; 309 u8 nr_subband, nrchan;
312 u8 lastchan, firstchan; 310 u8 lastchan, firstchan;
@@ -331,7 +329,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
331 lbs_deb_hex(LBS_DEB_11D, "countryinfo", (u8 *) countryinfo, 30); 329 lbs_deb_hex(LBS_DEB_11D, "countryinfo", (u8 *) countryinfo, 30);
332 330
333 if ((*(countryinfo->countrycode)) == 0 331 if ((*(countryinfo->countrycode)) == 0
334 || (countryinfo->len <= COUNTRY_CODE_LEN)) { 332 || (countryinfo->header.len <= COUNTRY_CODE_LEN)) {
335 /* No region Info or Wrong region info: treat as No 11D info */ 333 /* No region Info or Wrong region info: treat as No 11D info */
336 goto done; 334 goto done;
337 } 335 }
@@ -349,8 +347,8 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
349 memcpy(parsed_region_chan->countrycode, countryinfo->countrycode, 347 memcpy(parsed_region_chan->countrycode, countryinfo->countrycode,
350 COUNTRY_CODE_LEN); 348 COUNTRY_CODE_LEN);
351 349
352 nr_subband = (countryinfo->len - COUNTRY_CODE_LEN) / 350 nr_subband = (countryinfo->header.len - COUNTRY_CODE_LEN) /
353 sizeof(struct ieeetypes_subbandset); 351 sizeof(struct ieee_subbandset);
354 352
355 for (j = 0, lastchan = 0; j < nr_subband; j++) { 353 for (j = 0, lastchan = 0; j < nr_subband; j++) {
356 354
@@ -502,7 +500,7 @@ int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
502{ 500{
503 struct cmd_ds_802_11d_domain_info *pdomaininfo = 501 struct cmd_ds_802_11d_domain_info *pdomaininfo =
504 &cmd->params.domaininfo; 502 &cmd->params.domaininfo;
505 struct mrvlietypes_domainparamset *domain = &pdomaininfo->domain; 503 struct mrvl_ie_domain_param_set *domain = &pdomaininfo->domain;
506 u8 nr_subband = priv->domainreg.nr_subband; 504 u8 nr_subband = priv->domainreg.nr_subband;
507 505
508 lbs_deb_enter(LBS_DEB_11D); 506 lbs_deb_enter(LBS_DEB_11D);
@@ -524,16 +522,16 @@ int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
524 sizeof(domain->countrycode)); 522 sizeof(domain->countrycode));
525 523
526 domain->header.len = 524 domain->header.len =
527 cpu_to_le16(nr_subband * sizeof(struct ieeetypes_subbandset) + 525 cpu_to_le16(nr_subband * sizeof(struct ieee_subbandset) +
528 sizeof(domain->countrycode)); 526 sizeof(domain->countrycode));
529 527
530 if (nr_subband) { 528 if (nr_subband) {
531 memcpy(domain->subband, priv->domainreg.subband, 529 memcpy(domain->subband, priv->domainreg.subband,
532 nr_subband * sizeof(struct ieeetypes_subbandset)); 530 nr_subband * sizeof(struct ieee_subbandset));
533 531
534 cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) + 532 cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
535 le16_to_cpu(domain->header.len) + 533 le16_to_cpu(domain->header.len) +
536 sizeof(struct mrvlietypesheader) + 534 sizeof(struct mrvl_ie_header) +
537 S_DS_GEN); 535 S_DS_GEN);
538 } else { 536 } else {
539 cmd->size = 537 cmd->size =
@@ -556,7 +554,7 @@ done:
556int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp) 554int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp)
557{ 555{
558 struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp; 556 struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp;
559 struct mrvlietypes_domainparamset *domain = &domaininfo->domain; 557 struct mrvl_ie_domain_param_set *domain = &domaininfo->domain;
560 u16 action = le16_to_cpu(domaininfo->action); 558 u16 action = le16_to_cpu(domaininfo->action);
561 s16 ret = 0; 559 s16 ret = 0;
562 u8 nr_subband = 0; 560 u8 nr_subband = 0;
@@ -567,7 +565,7 @@ int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp)
567 (int)le16_to_cpu(resp->size)); 565 (int)le16_to_cpu(resp->size));
568 566
569 nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) / 567 nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
570 sizeof(struct ieeetypes_subbandset); 568 sizeof(struct ieee_subbandset);
571 569
572 lbs_deb_11d("domain info resp: nr_subband %d\n", nr_subband); 570 lbs_deb_11d("domain info resp: nr_subband %d\n", nr_subband);
573 571
diff --git a/drivers/net/wireless/libertas/11d.h b/drivers/net/wireless/libertas/11d.h
index 4f4f47f0f878..fb75d3e321a0 100644
--- a/drivers/net/wireless/libertas/11d.h
+++ b/drivers/net/wireless/libertas/11d.h
@@ -20,35 +20,36 @@
20struct cmd_ds_command; 20struct cmd_ds_command;
21 21
22/** Data structure for Country IE*/ 22/** Data structure for Country IE*/
23struct ieeetypes_subbandset { 23struct ieee_subbandset {
24 u8 firstchan; 24 u8 firstchan;
25 u8 nrchan; 25 u8 nrchan;
26 u8 maxtxpwr; 26 u8 maxtxpwr;
27} __attribute__ ((packed)); 27} __attribute__ ((packed));
28 28
29struct ieeetypes_countryinfoset { 29struct ieee_ie_country_info_set {
30 u8 element_id; 30 struct ieee_ie_header header;
31 u8 len; 31
32 u8 countrycode[COUNTRY_CODE_LEN]; 32 u8 countrycode[COUNTRY_CODE_LEN];
33 struct ieeetypes_subbandset subband[1]; 33 struct ieee_subbandset subband[1];
34}; 34};
35 35
36struct ieeetypes_countryinfofullset { 36struct ieee_ie_country_info_full_set {
37 u8 element_id; 37 struct ieee_ie_header header;
38 u8 len; 38
39 u8 countrycode[COUNTRY_CODE_LEN]; 39 u8 countrycode[COUNTRY_CODE_LEN];
40 struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; 40 struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
41} __attribute__ ((packed)); 41} __attribute__ ((packed));
42 42
43struct mrvlietypes_domainparamset { 43struct mrvl_ie_domain_param_set {
44 struct mrvlietypesheader header; 44 struct mrvl_ie_header header;
45
45 u8 countrycode[COUNTRY_CODE_LEN]; 46 u8 countrycode[COUNTRY_CODE_LEN];
46 struct ieeetypes_subbandset subband[1]; 47 struct ieee_subbandset subband[1];
47} __attribute__ ((packed)); 48} __attribute__ ((packed));
48 49
49struct cmd_ds_802_11d_domain_info { 50struct cmd_ds_802_11d_domain_info {
50 __le16 action; 51 __le16 action;
51 struct mrvlietypes_domainparamset domain; 52 struct mrvl_ie_domain_param_set domain;
52} __attribute__ ((packed)); 53} __attribute__ ((packed));
53 54
54/** domain regulatory information */ 55/** domain regulatory information */
@@ -57,7 +58,7 @@ struct lbs_802_11d_domain_reg {
57 u8 countrycode[COUNTRY_CODE_LEN]; 58 u8 countrycode[COUNTRY_CODE_LEN];
58 /** No. of subband*/ 59 /** No. of subband*/
59 u8 nr_subband; 60 u8 nr_subband;
60 struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; 61 struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
61}; 62};
62 63
63struct chan_power_11d { 64struct chan_power_11d {
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index d4d1d80045e0..75c67c9d1178 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -342,13 +342,13 @@ static int lbs_adhoc_start(struct lbs_private *priv,
342 WARN_ON(!assoc_req->channel); 342 WARN_ON(!assoc_req->channel);
343 343
344 /* set Physical parameter set */ 344 /* set Physical parameter set */
345 cmd.ds.elementid = WLAN_EID_DS_PARAMS; 345 cmd.ds.header.id = WLAN_EID_DS_PARAMS;
346 cmd.ds.len = 1; 346 cmd.ds.header.len = 1;
347 cmd.ds.channel = assoc_req->channel; 347 cmd.ds.channel = assoc_req->channel;
348 348
349 /* set IBSS parameter set */ 349 /* set IBSS parameter set */
350 cmd.ibss.elementid = WLAN_EID_IBSS_PARAMS; 350 cmd.ibss.header.id = WLAN_EID_IBSS_PARAMS;
351 cmd.ibss.len = 2; 351 cmd.ibss.header.len = 2;
352 cmd.ibss.atimwindow = cpu_to_le16(0); 352 cmd.ibss.atimwindow = cpu_to_le16(0);
353 353
354 /* set capability info */ 354 /* set capability info */
@@ -1558,11 +1558,11 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
1558 struct bss_descriptor *bss = &assoc_req->bss; 1558 struct bss_descriptor *bss = &assoc_req->bss;
1559 u8 *pos; 1559 u8 *pos;
1560 u16 tmpcap, tmplen; 1560 u16 tmpcap, tmplen;
1561 struct mrvlietypes_ssidparamset *ssid; 1561 struct mrvl_ie_ssid_param_set *ssid;
1562 struct mrvlietypes_dsparamset *ds; 1562 struct mrvl_ie_ds_param_set *ds;
1563 struct mrvlietypes_cfparamset *cf; 1563 struct mrvl_ie_cf_param_set *cf;
1564 struct mrvlietypes_ratesparamset *rates; 1564 struct mrvl_ie_rates_param_set *rates;
1565 struct mrvlietypes_rsnparamset *rsn; 1565 struct mrvl_ie_rsn_param_set *rsn;
1566 1566
1567 lbs_deb_enter(LBS_DEB_ASSOC); 1567 lbs_deb_enter(LBS_DEB_ASSOC);
1568 1568
@@ -1586,27 +1586,27 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
1586 pos += sizeof(passo->bcnperiod); 1586 pos += sizeof(passo->bcnperiod);
1587 pos += sizeof(passo->dtimperiod); 1587 pos += sizeof(passo->dtimperiod);
1588 1588
1589 ssid = (struct mrvlietypes_ssidparamset *) pos; 1589 ssid = (struct mrvl_ie_ssid_param_set *) pos;
1590 ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); 1590 ssid->header.type = cpu_to_le16(TLV_TYPE_SSID);
1591 tmplen = bss->ssid_len; 1591 tmplen = bss->ssid_len;
1592 ssid->header.len = cpu_to_le16(tmplen); 1592 ssid->header.len = cpu_to_le16(tmplen);
1593 memcpy(ssid->ssid, bss->ssid, tmplen); 1593 memcpy(ssid->ssid, bss->ssid, tmplen);
1594 pos += sizeof(ssid->header) + tmplen; 1594 pos += sizeof(ssid->header) + tmplen;
1595 1595
1596 ds = (struct mrvlietypes_dsparamset *) pos; 1596 ds = (struct mrvl_ie_ds_param_set *) pos;
1597 ds->header.type = cpu_to_le16(TLV_TYPE_PHY_DS); 1597 ds->header.type = cpu_to_le16(TLV_TYPE_PHY_DS);
1598 ds->header.len = cpu_to_le16(1); 1598 ds->header.len = cpu_to_le16(1);
1599 ds->channel = bss->phy.ds.channel; 1599 ds->channel = bss->phy.ds.channel;
1600 pos += sizeof(ds->header) + 1; 1600 pos += sizeof(ds->header) + 1;
1601 1601
1602 cf = (struct mrvlietypes_cfparamset *) pos; 1602 cf = (struct mrvl_ie_cf_param_set *) pos;
1603 cf->header.type = cpu_to_le16(TLV_TYPE_CF); 1603 cf->header.type = cpu_to_le16(TLV_TYPE_CF);
1604 tmplen = sizeof(*cf) - sizeof (cf->header); 1604 tmplen = sizeof(*cf) - sizeof (cf->header);
1605 cf->header.len = cpu_to_le16(tmplen); 1605 cf->header.len = cpu_to_le16(tmplen);
1606 /* IE payload should be zeroed, firmware fills it in for us */ 1606 /* IE payload should be zeroed, firmware fills it in for us */
1607 pos += sizeof(*cf); 1607 pos += sizeof(*cf);
1608 1608
1609 rates = (struct mrvlietypes_ratesparamset *) pos; 1609 rates = (struct mrvl_ie_rates_param_set *) pos;
1610 rates->header.type = cpu_to_le16(TLV_TYPE_RATES); 1610 rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
1611 memcpy(&rates->rates, &bss->rates, MAX_RATES); 1611 memcpy(&rates->rates, &bss->rates, MAX_RATES);
1612 tmplen = MAX_RATES; 1612 tmplen = MAX_RATES;
@@ -1628,7 +1628,7 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
1628 lbs_set_basic_rate_flags(rates->rates, tmplen); 1628 lbs_set_basic_rate_flags(rates->rates, tmplen);
1629 1629
1630 if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { 1630 if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) {
1631 rsn = (struct mrvlietypes_rsnparamset *) pos; 1631 rsn = (struct mrvl_ie_rsn_param_set *) pos;
1632 /* WPA_IE or WPA2_IE */ 1632 /* WPA_IE or WPA2_IE */
1633 rsn->header.type = cpu_to_le16((u16) assoc_req->wpa_ie[0]); 1633 rsn->header.type = cpu_to_le16((u16) assoc_req->wpa_ie[0]);
1634 tmplen = (u16) assoc_req->wpa_ie[1]; 1634 tmplen = (u16) assoc_req->wpa_ie[1];
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index c455b9abbfc0..ed079c1a34e6 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1470,8 +1470,8 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1470 break; 1470 break;
1471 case CMD_802_11_LED_GPIO_CTRL: 1471 case CMD_802_11_LED_GPIO_CTRL:
1472 { 1472 {
1473 struct mrvlietypes_ledgpio *gpio = 1473 struct mrvl_ie_ledgpio *gpio =
1474 (struct mrvlietypes_ledgpio*) 1474 (struct mrvl_ie_ledgpio*)
1475 cmdptr->params.ledgpio.data; 1475 cmdptr->params.ledgpio.data;
1476 1476
1477 memmove(&cmdptr->params.ledgpio, 1477 memmove(&cmdptr->params.ledgpio,
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 50e28a0cdfee..811ffc3ef414 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -183,12 +183,12 @@ out_unlock:
183 */ 183 */
184static void *lbs_tlv_find(uint16_t tlv_type, const uint8_t *tlv, uint16_t size) 184static void *lbs_tlv_find(uint16_t tlv_type, const uint8_t *tlv, uint16_t size)
185{ 185{
186 struct mrvlietypesheader *tlv_h; 186 struct mrvl_ie_header *tlv_h;
187 uint16_t length; 187 uint16_t length;
188 ssize_t pos = 0; 188 ssize_t pos = 0;
189 189
190 while (pos < size) { 190 while (pos < size) {
191 tlv_h = (struct mrvlietypesheader *) tlv; 191 tlv_h = (struct mrvl_ie_header *) tlv;
192 if (!tlv_h->len) 192 if (!tlv_h->len)
193 return NULL; 193 return NULL;
194 if (tlv_h->type == cpu_to_le16(tlv_type)) 194 if (tlv_h->type == cpu_to_le16(tlv_type))
@@ -206,7 +206,7 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask,
206 size_t count, loff_t *ppos) 206 size_t count, loff_t *ppos)
207{ 207{
208 struct cmd_ds_802_11_subscribe_event *subscribed; 208 struct cmd_ds_802_11_subscribe_event *subscribed;
209 struct mrvlietypes_thresholds *got; 209 struct mrvl_ie_thresholds *got;
210 struct lbs_private *priv = file->private_data; 210 struct lbs_private *priv = file->private_data;
211 ssize_t ret = 0; 211 ssize_t ret = 0;
212 size_t pos = 0; 212 size_t pos = 0;
@@ -259,7 +259,7 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask,
259 loff_t *ppos) 259 loff_t *ppos)
260{ 260{
261 struct cmd_ds_802_11_subscribe_event *events; 261 struct cmd_ds_802_11_subscribe_event *events;
262 struct mrvlietypes_thresholds *tlv; 262 struct mrvl_ie_thresholds *tlv;
263 struct lbs_private *priv = file->private_data; 263 struct lbs_private *priv = file->private_data;
264 ssize_t buf_size; 264 ssize_t buf_size;
265 int value, freq, new_mask; 265 int value, freq, new_mask;
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index d0de8c70f8c9..9e11f908c4e5 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -353,7 +353,7 @@ struct bss_descriptor {
353 union ieee_phy_param_set phy; 353 union ieee_phy_param_set phy;
354 union ieee_ss_param_set ss; 354 union ieee_ss_param_set ss;
355 355
356 struct ieeetypes_countryinfofullset countryinfo; 356 struct ieee_ie_country_info_full_set countryinfo;
357 357
358 u8 wpa_ie[MAX_WPA_IE_LEN]; 358 u8 wpa_ie[MAX_WPA_IE_LEN];
359 size_t wpa_ie_len; 359 size_t wpa_ie_len;
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 38b056066e19..e5e30b24cf02 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -27,12 +27,12 @@
27 + 40) /* 40 for WPAIE */ 27 + 40) /* 40 for WPAIE */
28 28
29//! Memory needed to store a max sized channel List TLV for a firmware scan 29//! Memory needed to store a max sized channel List TLV for a firmware scan
30#define CHAN_TLV_MAX_SIZE (sizeof(struct mrvlietypesheader) \ 30#define CHAN_TLV_MAX_SIZE (sizeof(struct mrvl_ie_header) \
31 + (MRVDRV_MAX_CHANNELS_PER_SCAN \ 31 + (MRVDRV_MAX_CHANNELS_PER_SCAN \
32 * sizeof(struct chanscanparamset))) 32 * sizeof(struct chanscanparamset)))
33 33
34//! Memory needed to store a max number/size SSID TLV for a firmware scan 34//! Memory needed to store a max number/size SSID TLV for a firmware scan
35#define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvlietypes_ssidparamset)) 35#define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvl_ie_ssid_param_set))
36 36
37//! Maximum memory needed for a cmd_ds_802_11_scan with all TLVs at max 37//! Maximum memory needed for a cmd_ds_802_11_scan with all TLVs at max
38#define MAX_SCAN_CFG_ALLOC (sizeof(struct cmd_ds_802_11_scan) \ 38#define MAX_SCAN_CFG_ALLOC (sizeof(struct cmd_ds_802_11_scan) \
@@ -211,7 +211,7 @@ static int lbs_scan_create_channel_list(struct lbs_private *priv,
211 */ 211 */
212static int lbs_scan_add_ssid_tlv(struct lbs_private *priv, u8 *tlv) 212static int lbs_scan_add_ssid_tlv(struct lbs_private *priv, u8 *tlv)
213{ 213{
214 struct mrvlietypes_ssidparamset *ssid_tlv = (void *)tlv; 214 struct mrvl_ie_ssid_param_set *ssid_tlv = (void *)tlv;
215 215
216 ssid_tlv->header.type = cpu_to_le16(TLV_TYPE_SSID); 216 ssid_tlv->header.type = cpu_to_le16(TLV_TYPE_SSID);
217 ssid_tlv->header.len = cpu_to_le16(priv->scan_ssid_len); 217 ssid_tlv->header.len = cpu_to_le16(priv->scan_ssid_len);
@@ -249,7 +249,7 @@ static int lbs_scan_add_chanlist_tlv(uint8_t *tlv,
249 int chan_count) 249 int chan_count)
250{ 250{
251 size_t size = sizeof(struct chanscanparamset) *chan_count; 251 size_t size = sizeof(struct chanscanparamset) *chan_count;
252 struct mrvlietypes_chanlistparamset *chan_tlv = (void *)tlv; 252 struct mrvl_ie_chanlist_param_set *chan_tlv = (void *)tlv;
253 253
254 chan_tlv->header.type = cpu_to_le16(TLV_TYPE_CHANLIST); 254 chan_tlv->header.type = cpu_to_le16(TLV_TYPE_CHANLIST);
255 memcpy(chan_tlv->chanscanparam, chan_list, size); 255 memcpy(chan_tlv->chanscanparam, chan_list, size);
@@ -270,7 +270,7 @@ static int lbs_scan_add_chanlist_tlv(uint8_t *tlv,
270static int lbs_scan_add_rates_tlv(uint8_t *tlv) 270static int lbs_scan_add_rates_tlv(uint8_t *tlv)
271{ 271{
272 int i; 272 int i;
273 struct mrvlietypes_ratesparamset *rate_tlv = (void *)tlv; 273 struct mrvl_ie_rates_param_set *rate_tlv = (void *)tlv;
274 274
275 rate_tlv->header.type = cpu_to_le16(TLV_TYPE_RATES); 275 rate_tlv->header.type = cpu_to_le16(TLV_TYPE_RATES);
276 tlv += sizeof(rate_tlv->header); 276 tlv += sizeof(rate_tlv->header);
@@ -518,7 +518,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
518 struct ieee_ie_cf_param_set *cf; 518 struct ieee_ie_cf_param_set *cf;
519 struct ieee_ie_ibss_param_set *ibss; 519 struct ieee_ie_ibss_param_set *ibss;
520 DECLARE_SSID_BUF(ssid); 520 DECLARE_SSID_BUF(ssid);
521 struct ieeetypes_countryinfoset *pcountryinfo; 521 struct ieee_ie_country_info_set *pcountryinfo;
522 uint8_t *pos, *end, *p; 522 uint8_t *pos, *end, *p;
523 uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; 523 uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
524 uint16_t beaconsize = 0; 524 uint16_t beaconsize = 0;
@@ -642,20 +642,23 @@ static int lbs_process_bss(struct bss_descriptor *bss,
642 break; 642 break;
643 643
644 case WLAN_EID_COUNTRY: 644 case WLAN_EID_COUNTRY:
645 pcountryinfo = (struct ieeetypes_countryinfoset *) pos; 645 pcountryinfo = (struct ieee_ie_country_info_set *) pos;
646 lbs_deb_scan("got COUNTRY IE\n"); 646 lbs_deb_scan("got COUNTRY IE\n");
647 if (pcountryinfo->len < sizeof(pcountryinfo->countrycode) 647 if (pcountryinfo->header.len < sizeof(pcountryinfo->countrycode)
648 || pcountryinfo->len > 254) { 648 || pcountryinfo->header.len > 254) {
649 lbs_deb_scan("process_bss: 11D- Err CountryInfo len %d, min %zd, max 254\n", 649 lbs_deb_scan("%s: 11D- Err CountryInfo len %d, min %zd, max 254\n",
650 pcountryinfo->len, sizeof(pcountryinfo->countrycode)); 650 __func__,
651 pcountryinfo->header.len,
652 sizeof(pcountryinfo->countrycode));
651 ret = -1; 653 ret = -1;
652 goto done; 654 goto done;
653 } 655 }
654 656
655 memcpy(&bss->countryinfo, pcountryinfo, pcountryinfo->len + 2); 657 memcpy(&bss->countryinfo, pcountryinfo,
658 pcountryinfo->header.len + 2);
656 lbs_deb_hex(LBS_DEB_SCAN, "process_bss: 11d countryinfo", 659 lbs_deb_hex(LBS_DEB_SCAN, "process_bss: 11d countryinfo",
657 (uint8_t *) pcountryinfo, 660 (uint8_t *) pcountryinfo,
658 (int) (pcountryinfo->len + 2)); 661 (int) (pcountryinfo->header.len + 2));
659 break; 662 break;
660 663
661 case WLAN_EID_EXT_SUPP_RATES: 664 case WLAN_EID_EXT_SUPP_RATES:
diff --git a/drivers/net/wireless/libertas/types.h b/drivers/net/wireless/libertas/types.h
index b8d2ce936046..1055ecfa1cc8 100644
--- a/drivers/net/wireless/libertas/types.h
+++ b/drivers/net/wireless/libertas/types.h
@@ -8,9 +8,14 @@
8#include <asm/byteorder.h> 8#include <asm/byteorder.h>
9#include <linux/wireless.h> 9#include <linux/wireless.h>
10 10
11struct ieee_ie_cf_param_set { 11struct ieee_ie_header {
12 u8 elementid; 12 u8 id;
13 u8 len; 13 u8 len;
14} __attribute__ ((packed));
15
16struct ieee_ie_cf_param_set {
17 struct ieee_ie_header header;
18
14 u8 cfpcnt; 19 u8 cfpcnt;
15 u8 cfpperiod; 20 u8 cfpperiod;
16 __le16 cfpmaxduration; 21 __le16 cfpmaxduration;
@@ -19,8 +24,8 @@ struct ieee_ie_cf_param_set {
19 24
20 25
21struct ieee_ie_ibss_param_set { 26struct ieee_ie_ibss_param_set {
22 u8 elementid; 27 struct ieee_ie_header header;
23 u8 len; 28
24 __le16 atimwindow; 29 __le16 atimwindow;
25} __attribute__ ((packed)); 30} __attribute__ ((packed));
26 31
@@ -30,8 +35,8 @@ union ieee_ss_param_set {
30} __attribute__ ((packed)); 35} __attribute__ ((packed));
31 36
32struct ieee_ie_fh_param_set { 37struct ieee_ie_fh_param_set {
33 u8 elementid; 38 struct ieee_ie_header header;
34 u8 len; 39
35 __le16 dwelltime; 40 __le16 dwelltime;
36 u8 hopset; 41 u8 hopset;
37 u8 hoppattern; 42 u8 hoppattern;
@@ -39,8 +44,8 @@ struct ieee_ie_fh_param_set {
39} __attribute__ ((packed)); 44} __attribute__ ((packed));
40 45
41struct ieee_ie_ds_param_set { 46struct ieee_ie_ds_param_set {
42 u8 elementid; 47 struct ieee_ie_header header;
43 u8 len; 48
44 u8 channel; 49 u8 channel;
45} __attribute__ ((packed)); 50} __attribute__ ((packed));
46 51
@@ -98,28 +103,28 @@ struct ieee_assoc_response {
98#define TLV_TYPE_OLD_MESH_ID (PROPRIETARY_TLV_BASE_ID + 291) 103#define TLV_TYPE_OLD_MESH_ID (PROPRIETARY_TLV_BASE_ID + 291)
99 104
100/** TLV related data structures*/ 105/** TLV related data structures*/
101struct mrvlietypesheader { 106struct mrvl_ie_header {
102 __le16 type; 107 __le16 type;
103 __le16 len; 108 __le16 len;
104} __attribute__ ((packed)); 109} __attribute__ ((packed));
105 110
106struct mrvlietypes_data { 111struct mrvl_ie_data {
107 struct mrvlietypesheader header; 112 struct mrvl_ie_header header;
108 u8 Data[1]; 113 u8 Data[1];
109} __attribute__ ((packed)); 114} __attribute__ ((packed));
110 115
111struct mrvlietypes_ratesparamset { 116struct mrvl_ie_rates_param_set {
112 struct mrvlietypesheader header; 117 struct mrvl_ie_header header;
113 u8 rates[1]; 118 u8 rates[1];
114} __attribute__ ((packed)); 119} __attribute__ ((packed));
115 120
116struct mrvlietypes_ssidparamset { 121struct mrvl_ie_ssid_param_set {
117 struct mrvlietypesheader header; 122 struct mrvl_ie_header header;
118 u8 ssid[1]; 123 u8 ssid[1];
119} __attribute__ ((packed)); 124} __attribute__ ((packed));
120 125
121struct mrvlietypes_wildcardssidparamset { 126struct mrvl_ie_wildcard_ssid_param_set {
122 struct mrvlietypesheader header; 127 struct mrvl_ie_header header;
123 u8 MaxSsidlength; 128 u8 MaxSsidlength;
124 u8 ssid[1]; 129 u8 ssid[1];
125} __attribute__ ((packed)); 130} __attribute__ ((packed));
@@ -144,66 +149,66 @@ struct chanscanparamset {
144 __le16 maxscantime; 149 __le16 maxscantime;
145} __attribute__ ((packed)); 150} __attribute__ ((packed));
146 151
147struct mrvlietypes_chanlistparamset { 152struct mrvl_ie_chanlist_param_set {
148 struct mrvlietypesheader header; 153 struct mrvl_ie_header header;
149 struct chanscanparamset chanscanparam[1]; 154 struct chanscanparamset chanscanparam[1];
150} __attribute__ ((packed)); 155} __attribute__ ((packed));
151 156
152struct mrvlietypes_cfparamset { 157struct mrvl_ie_cf_param_set {
153 struct mrvlietypesheader header; 158 struct mrvl_ie_header header;
154 u8 cfpcnt; 159 u8 cfpcnt;
155 u8 cfpperiod; 160 u8 cfpperiod;
156 __le16 cfpmaxduration; 161 __le16 cfpmaxduration;
157 __le16 cfpdurationremaining; 162 __le16 cfpdurationremaining;
158} __attribute__ ((packed)); 163} __attribute__ ((packed));
159 164
160struct mrvlietypes_dsparamset { 165struct mrvl_ie_ds_param_set {
161 struct mrvlietypesheader header; 166 struct mrvl_ie_header header;
162 u8 channel; 167 u8 channel;
163} __attribute__ ((packed)); 168} __attribute__ ((packed));
164 169
165struct mrvlietypes_rsnparamset { 170struct mrvl_ie_rsn_param_set {
166 struct mrvlietypesheader header; 171 struct mrvl_ie_header header;
167 u8 rsnie[1]; 172 u8 rsnie[1];
168} __attribute__ ((packed)); 173} __attribute__ ((packed));
169 174
170struct mrvlietypes_tsftimestamp { 175struct mrvl_ie_tsf_timestamp {
171 struct mrvlietypesheader header; 176 struct mrvl_ie_header header;
172 __le64 tsftable[1]; 177 __le64 tsftable[1];
173} __attribute__ ((packed)); 178} __attribute__ ((packed));
174 179
175/** Local Power capability */ 180/** Local Power capability */
176struct mrvlietypes_powercapability { 181struct mrvl_ie_power_capability {
177 struct mrvlietypesheader header; 182 struct mrvl_ie_header header;
178 s8 minpower; 183 s8 minpower;
179 s8 maxpower; 184 s8 maxpower;
180} __attribute__ ((packed)); 185} __attribute__ ((packed));
181 186
182/* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */ 187/* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */
183struct mrvlietypes_thresholds { 188struct mrvl_ie_thresholds {
184 struct mrvlietypesheader header; 189 struct mrvl_ie_header header;
185 u8 value; 190 u8 value;
186 u8 freq; 191 u8 freq;
187} __attribute__ ((packed)); 192} __attribute__ ((packed));
188 193
189struct mrvlietypes_beaconsmissed { 194struct mrvl_ie_beacons_missed {
190 struct mrvlietypesheader header; 195 struct mrvl_ie_header header;
191 u8 beaconmissed; 196 u8 beaconmissed;
192 u8 reserved; 197 u8 reserved;
193} __attribute__ ((packed)); 198} __attribute__ ((packed));
194 199
195struct mrvlietypes_numprobes { 200struct mrvl_ie_num_probes {
196 struct mrvlietypesheader header; 201 struct mrvl_ie_header header;
197 __le16 numprobes; 202 __le16 numprobes;
198} __attribute__ ((packed)); 203} __attribute__ ((packed));
199 204
200struct mrvlietypes_bcastprobe { 205struct mrvl_ie_bcast_probe {
201 struct mrvlietypesheader header; 206 struct mrvl_ie_header header;
202 __le16 bcastprobe; 207 __le16 bcastprobe;
203} __attribute__ ((packed)); 208} __attribute__ ((packed));
204 209
205struct mrvlietypes_numssidprobe { 210struct mrvl_ie_num_ssid_probe {
206 struct mrvlietypesheader header; 211 struct mrvl_ie_header header;
207 __le16 numssidprobe; 212 __le16 numssidprobe;
208} __attribute__ ((packed)); 213} __attribute__ ((packed));
209 214
@@ -212,8 +217,8 @@ struct led_pin {
212 u8 pin; 217 u8 pin;
213} __attribute__ ((packed)); 218} __attribute__ ((packed));
214 219
215struct mrvlietypes_ledgpio { 220struct mrvl_ie_ledgpio {
216 struct mrvlietypesheader header; 221 struct mrvl_ie_header header;
217 struct led_pin ledpin[1]; 222 struct led_pin ledpin[1];
218} __attribute__ ((packed)); 223} __attribute__ ((packed));
219 224
@@ -225,8 +230,8 @@ struct led_bhv {
225} __attribute__ ((packed)); 230} __attribute__ ((packed));
226 231
227 232
228struct mrvlietypes_ledbhv { 233struct mrvl_ie_ledbhv {
229 struct mrvlietypesheader header; 234 struct mrvl_ie_header header;
230 struct led_bhv ledbhv[1]; 235 struct led_bhv ledbhv[1];
231} __attribute__ ((packed)); 236} __attribute__ ((packed));
232 237