diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-28 23:54:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:46 -0400 |
commit | d8efea254887128d710cc1475505514da004932c (patch) | |
tree | 450ce4f6bbc1fca6468de784c1ce7b6d34b2059e /drivers/net/wireless/libertas/join.c | |
parent | 785e8f2679ce9ae703f1c737aa4d48b315d511ca (diff) |
[PATCH] libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid
Replace WLAN_802_11_SSID with direct 'ssid' and 'ssid_len' members
like ieee80211. In the process, remove private libertas_escape_essid
and depend on the ieee80211 implementation of escape_essid instead.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/join.c')
-rw-r--r-- | drivers/net/wireless/libertas/join.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c index b728f7fb9e34..1f866aa29a62 100644 --- a/drivers/net/wireless/libertas/join.c +++ b/drivers/net/wireless/libertas/join.c | |||
@@ -184,18 +184,20 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso | |||
184 | struct bss_descriptor * bss = &assoc_req->bss; | 184 | struct bss_descriptor * bss = &assoc_req->bss; |
185 | int ret = 0; | 185 | int ret = 0; |
186 | 186 | ||
187 | lbs_deb_join("libertas_join_adhoc_network: CurBss.ssid =%s\n", | 187 | lbs_deb_join("%s: Current SSID '%s', ssid length %u\n", |
188 | adapter->curbssparams.ssid.ssid); | 188 | __func__, |
189 | lbs_deb_join("libertas_join_adhoc_network: CurBss.ssid_len =%u\n", | 189 | escape_essid(adapter->curbssparams.ssid, |
190 | adapter->curbssparams.ssid.ssidlength); | 190 | adapter->curbssparams.ssid_len), |
191 | lbs_deb_join("libertas_join_adhoc_network: ssid = '%s'\n", | 191 | adapter->curbssparams.ssid_len); |
192 | bss->ssid.ssid); | 192 | lbs_deb_join("%s: requested ssid '%s', ssid length %u\n", |
193 | lbs_deb_join("libertas_join_adhoc_network: ssid len = %u\n", | 193 | __func__, escape_essid(bss->ssid, bss->ssid_len), |
194 | bss->ssid.ssidlength); | 194 | bss->ssid_len); |
195 | 195 | ||
196 | /* check if the requested SSID is already joined */ | 196 | /* check if the requested SSID is already joined */ |
197 | if (adapter->curbssparams.ssid.ssidlength | 197 | if (adapter->curbssparams.ssid_len |
198 | && !libertas_SSID_cmp(&bss->ssid, &adapter->curbssparams.ssid) | 198 | && !libertas_SSID_cmp(adapter->curbssparams.ssid, |
199 | adapter->curbssparams.ssid_len, | ||
200 | bss->ssid, bss->ssid_len) | ||
199 | && (adapter->mode == IW_MODE_ADHOC)) { | 201 | && (adapter->mode == IW_MODE_ADHOC)) { |
200 | lbs_deb_join( | 202 | lbs_deb_join( |
201 | "ADHOC_J_CMD: New ad-hoc SSID is the same as current, " | 203 | "ADHOC_J_CMD: New ad-hoc SSID is the same as current, " |
@@ -362,9 +364,9 @@ int libertas_cmd_80211_associate(wlan_private * priv, | |||
362 | 364 | ||
363 | ssid = (struct mrvlietypes_ssidparamset *) pos; | 365 | ssid = (struct mrvlietypes_ssidparamset *) pos; |
364 | ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); | 366 | ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); |
365 | tmplen = bss->ssid.ssidlength; | 367 | tmplen = bss->ssid_len; |
366 | ssid->header.len = cpu_to_le16(tmplen); | 368 | ssid->header.len = cpu_to_le16(tmplen); |
367 | memcpy(ssid->ssid, bss->ssid.ssid, tmplen); | 369 | memcpy(ssid->ssid, bss->ssid, tmplen); |
368 | pos += sizeof(ssid->header) + tmplen; | 370 | pos += sizeof(ssid->header) + tmplen; |
369 | 371 | ||
370 | phy = (struct mrvlietypes_phyparamset *) pos; | 372 | phy = (struct mrvlietypes_phyparamset *) pos; |
@@ -482,9 +484,11 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, | |||
482 | */ | 484 | */ |
483 | 485 | ||
484 | memset(adhs->SSID, 0, IW_ESSID_MAX_SIZE); | 486 | memset(adhs->SSID, 0, IW_ESSID_MAX_SIZE); |
485 | memcpy(adhs->SSID, assoc_req->ssid.ssid, assoc_req->ssid.ssidlength); | 487 | memcpy(adhs->SSID, assoc_req->ssid, assoc_req->ssid_len); |
486 | 488 | ||
487 | lbs_deb_join("ADHOC_S_CMD: SSID = %s\n", adhs->SSID); | 489 | lbs_deb_join("ADHOC_S_CMD: SSID '%s', ssid length %u\n", |
490 | escape_essid(assoc_req->ssid, assoc_req->ssid_len), | ||
491 | assoc_req->ssid_len); | ||
488 | 492 | ||
489 | /* set the BSS type */ | 493 | /* set the BSS type */ |
490 | adhs->bsstype = cmd_bss_type_ibss; | 494 | adhs->bsstype = cmd_bss_type_ibss; |
@@ -600,7 +604,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, | |||
600 | padhocjoin->bssdescriptor.beaconperiod = cpu_to_le16(bss->beaconperiod); | 604 | padhocjoin->bssdescriptor.beaconperiod = cpu_to_le16(bss->beaconperiod); |
601 | 605 | ||
602 | memcpy(&padhocjoin->bssdescriptor.BSSID, &bss->bssid, ETH_ALEN); | 606 | memcpy(&padhocjoin->bssdescriptor.BSSID, &bss->bssid, ETH_ALEN); |
603 | memcpy(&padhocjoin->bssdescriptor.SSID, &bss->ssid.ssid, bss->ssid.ssidlength); | 607 | memcpy(&padhocjoin->bssdescriptor.SSID, &bss->ssid, bss->ssid_len); |
604 | 608 | ||
605 | memcpy(&padhocjoin->bssdescriptor.phyparamset, | 609 | memcpy(&padhocjoin->bssdescriptor.phyparamset, |
606 | &bss->phyparamset, sizeof(union ieeetypes_phyparamset)); | 610 | &bss->phyparamset, sizeof(union ieeetypes_phyparamset)); |
@@ -733,11 +737,12 @@ int libertas_ret_80211_associate(wlan_private * priv, | |||
733 | /* Send a Media Connected event, according to the Spec */ | 737 | /* Send a Media Connected event, according to the Spec */ |
734 | adapter->connect_status = libertas_connected; | 738 | adapter->connect_status = libertas_connected; |
735 | 739 | ||
736 | lbs_deb_join("ASSOC_RESP: %s\n", bss->ssid.ssid); | 740 | lbs_deb_join("ASSOC_RESP: assocated to '%s'\n", |
741 | escape_essid(bss->ssid, bss->ssid_len)); | ||
737 | 742 | ||
738 | /* Update current SSID and BSSID */ | 743 | /* Update current SSID and BSSID */ |
739 | memcpy(&adapter->curbssparams.ssid, | 744 | memcpy(&adapter->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); |
740 | &bss->ssid, sizeof(struct WLAN_802_11_SSID)); | 745 | adapter->curbssparams.ssid_len = bss->ssid_len; |
741 | memcpy(adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); | 746 | memcpy(adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); |
742 | 747 | ||
743 | lbs_deb_join("ASSOC_RESP: currentpacketfilter is %x\n", | 748 | lbs_deb_join("ASSOC_RESP: currentpacketfilter is %x\n", |
@@ -821,7 +826,8 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, | |||
821 | * Now the join cmd should be successful | 826 | * Now the join cmd should be successful |
822 | * If BSSID has changed use SSID to compare instead of BSSID | 827 | * If BSSID has changed use SSID to compare instead of BSSID |
823 | */ | 828 | */ |
824 | lbs_deb_join("ADHOC_RESP: %s\n", bss->ssid.ssid); | 829 | lbs_deb_join("ADHOC_RESP: associated to '%s'\n", |
830 | escape_essid(bss->ssid, bss->ssid_len)); | ||
825 | 831 | ||
826 | /* Send a Media Connected event, according to the Spec */ | 832 | /* Send a Media Connected event, according to the Spec */ |
827 | adapter->connect_status = libertas_connected; | 833 | adapter->connect_status = libertas_connected; |
@@ -835,8 +841,8 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, | |||
835 | memcpy(&adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); | 841 | memcpy(&adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); |
836 | 842 | ||
837 | /* Set the new SSID to current SSID */ | 843 | /* Set the new SSID to current SSID */ |
838 | memcpy(&adapter->curbssparams.ssid, &bss->ssid, | 844 | memcpy(&adapter->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); |
839 | sizeof(struct WLAN_802_11_SSID)); | 845 | adapter->curbssparams.ssid_len = bss->ssid_len; |
840 | 846 | ||
841 | netif_carrier_on(priv->dev); | 847 | netif_carrier_on(priv->dev); |
842 | netif_wake_queue(priv->dev); | 848 | netif_wake_queue(priv->dev); |