aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/assoc.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-05-22 20:01:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:05:09 -0400
commit5fd164e96cb9dc111f75468378de38c67b0fd161 (patch)
treeeeb4ec9dd3b2f1b034c1fc1c80b469de0c9275f7 /drivers/net/wireless/libertas/assoc.c
parentd77b034f62d4b8c6c39450d99de224b9b2c5debb (diff)
libertas: simplify and clean up association/start/join setup
Some of the parameters for association/join/start commands aren't used (like the FH and CF IEs for IBSS, and the FH IE for BSS), so get rid of their unions to reduce indirection. Also clean up structure names for kernel style. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r--drivers/net/wireless/libertas/assoc.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index a0e440cd8967..d4d1d80045e0 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -219,11 +219,10 @@ static int lbs_adhoc_join(struct lbs_private *priv,
219 memcpy(&cmd.bss.bssid, &bss->bssid, ETH_ALEN); 219 memcpy(&cmd.bss.bssid, &bss->bssid, ETH_ALEN);
220 memcpy(&cmd.bss.ssid, &bss->ssid, bss->ssid_len); 220 memcpy(&cmd.bss.ssid, &bss->ssid, bss->ssid_len);
221 221
222 memcpy(&cmd.bss.phyparamset, &bss->phyparamset, 222 memcpy(&cmd.bss.ds, &bss->phy.ds, sizeof(struct ieee_ie_ds_param_set));
223 sizeof(union ieeetypes_phyparamset));
224 223
225 memcpy(&cmd.bss.ssparamset, &bss->ssparamset, 224 memcpy(&cmd.bss.ibss, &bss->ss.ibss,
226 sizeof(union IEEEtypes_ssparamset)); 225 sizeof(struct ieee_ie_ibss_param_set));
227 226
228 cmd.bss.capability = cpu_to_le16(bss->capability & CAPINFO_MASK); 227 cmd.bss.capability = cpu_to_le16(bss->capability & CAPINFO_MASK);
229 lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", 228 lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n",
@@ -260,7 +259,7 @@ static int lbs_adhoc_join(struct lbs_private *priv,
260 */ 259 */
261 lbs_set_basic_rate_flags(cmd.bss.rates, ratesize); 260 lbs_set_basic_rate_flags(cmd.bss.rates, ratesize);
262 261
263 cmd.bss.ssparamset.ibssparamset.atimwindow = cpu_to_le16(bss->atimwindow); 262 cmd.bss.ibss.atimwindow = bss->atimwindow;
264 263
265 if (assoc_req->secinfo.wep_enabled) { 264 if (assoc_req->secinfo.wep_enabled) {
266 u16 tmp = le16_to_cpu(cmd.bss.capability); 265 u16 tmp = le16_to_cpu(cmd.bss.capability);
@@ -343,14 +342,14 @@ static int lbs_adhoc_start(struct lbs_private *priv,
343 WARN_ON(!assoc_req->channel); 342 WARN_ON(!assoc_req->channel);
344 343
345 /* set Physical parameter set */ 344 /* set Physical parameter set */
346 cmd.phyparamset.dsparamset.elementid = WLAN_EID_DS_PARAMS; 345 cmd.ds.elementid = WLAN_EID_DS_PARAMS;
347 cmd.phyparamset.dsparamset.len = 1; 346 cmd.ds.len = 1;
348 cmd.phyparamset.dsparamset.currentchan = assoc_req->channel; 347 cmd.ds.channel = assoc_req->channel;
349 348
350 /* set IBSS parameter set */ 349 /* set IBSS parameter set */
351 cmd.ssparamset.ibssparamset.elementid = WLAN_EID_IBSS_PARAMS; 350 cmd.ibss.elementid = WLAN_EID_IBSS_PARAMS;
352 cmd.ssparamset.ibssparamset.len = 2; 351 cmd.ibss.len = 2;
353 cmd.ssparamset.ibssparamset.atimwindow = 0; 352 cmd.ibss.atimwindow = cpu_to_le16(0);
354 353
355 /* set capability info */ 354 /* set capability info */
356 tmpcap = WLAN_CAPABILITY_IBSS; 355 tmpcap = WLAN_CAPABILITY_IBSS;
@@ -1560,8 +1559,8 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
1560 u8 *pos; 1559 u8 *pos;
1561 u16 tmpcap, tmplen; 1560 u16 tmpcap, tmplen;
1562 struct mrvlietypes_ssidparamset *ssid; 1561 struct mrvlietypes_ssidparamset *ssid;
1563 struct mrvlietypes_phyparamset *phy; 1562 struct mrvlietypes_dsparamset *ds;
1564 struct mrvlietypes_ssparamset *ss; 1563 struct mrvlietypes_cfparamset *cf;
1565 struct mrvlietypes_ratesparamset *rates; 1564 struct mrvlietypes_ratesparamset *rates;
1566 struct mrvlietypes_rsnparamset *rsn; 1565 struct mrvlietypes_rsnparamset *rsn;
1567 1566
@@ -1594,20 +1593,18 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
1594 memcpy(ssid->ssid, bss->ssid, tmplen); 1593 memcpy(ssid->ssid, bss->ssid, tmplen);
1595 pos += sizeof(ssid->header) + tmplen; 1594 pos += sizeof(ssid->header) + tmplen;
1596 1595
1597 phy = (struct mrvlietypes_phyparamset *) pos; 1596 ds = (struct mrvlietypes_dsparamset *) pos;
1598 phy->header.type = cpu_to_le16(TLV_TYPE_PHY_DS); 1597 ds->header.type = cpu_to_le16(TLV_TYPE_PHY_DS);
1599 tmplen = sizeof(phy->fh_ds.dsparamset); 1598 ds->header.len = cpu_to_le16(1);
1600 phy->header.len = cpu_to_le16(tmplen); 1599 ds->channel = bss->phy.ds.channel;
1601 memcpy(&phy->fh_ds.dsparamset, 1600 pos += sizeof(ds->header) + 1;
1602 &bss->phyparamset.dsparamset.currentchan, 1601
1603 tmplen); 1602 cf = (struct mrvlietypes_cfparamset *) pos;
1604 pos += sizeof(phy->header) + tmplen; 1603 cf->header.type = cpu_to_le16(TLV_TYPE_CF);
1605 1604 tmplen = sizeof(*cf) - sizeof (cf->header);
1606 ss = (struct mrvlietypes_ssparamset *) pos; 1605 cf->header.len = cpu_to_le16(tmplen);
1607 ss->header.type = cpu_to_le16(TLV_TYPE_CF); 1606 /* IE payload should be zeroed, firmware fills it in for us */
1608 tmplen = sizeof(ss->cf_ibss.cfparamset); 1607 pos += sizeof(*cf);
1609 ss->header.len = cpu_to_le16(tmplen);
1610 pos += sizeof(ss->header) + tmplen;
1611 1608
1612 rates = (struct mrvlietypes_ratesparamset *) pos; 1609 rates = (struct mrvlietypes_ratesparamset *) pos;
1613 rates->header.type = cpu_to_le16(TLV_TYPE_RATES); 1610 rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
@@ -1643,7 +1640,7 @@ int lbs_cmd_80211_associate(struct lbs_private *priv,
1643 } 1640 }
1644 1641
1645 /* update curbssparams */ 1642 /* update curbssparams */
1646 priv->curbssparams.channel = bss->phyparamset.dsparamset.currentchan; 1643 priv->curbssparams.channel = bss->phy.ds.channel;
1647 1644
1648 if (lbs_parse_dnld_countryinfo_11d(priv, bss)) { 1645 if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
1649 ret = -1; 1646 ret = -1;
@@ -1669,7 +1666,7 @@ int lbs_ret_80211_associate(struct lbs_private *priv,
1669{ 1666{
1670 int ret = 0; 1667 int ret = 0;
1671 union iwreq_data wrqu; 1668 union iwreq_data wrqu;
1672 struct ieeetypes_assocrsp *passocrsp; 1669 struct ieee_assoc_response *passocrsp;
1673 struct bss_descriptor *bss; 1670 struct bss_descriptor *bss;
1674 u16 status_code; 1671 u16 status_code;
1675 1672
@@ -1682,7 +1679,7 @@ int lbs_ret_80211_associate(struct lbs_private *priv,
1682 } 1679 }
1683 bss = &priv->in_progress_assoc_req->bss; 1680 bss = &priv->in_progress_assoc_req->bss;
1684 1681
1685 passocrsp = (struct ieeetypes_assocrsp *) &resp->params; 1682 passocrsp = (struct ieee_assoc_response *) &resp->params;
1686 1683
1687 /* 1684 /*
1688 * Older FW versions map the IEEE 802.11 Status Code in the association 1685 * Older FW versions map the IEEE 802.11 Status Code in the association