diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-25 13:16:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:40 -0400 |
commit | 4ace1138767869547944798ba9f1fd6d1e048acb (patch) | |
tree | aa701b2c1c518e929be679d60223be1bb4e3b365 | |
parent | 7732ca45c68f893689a8c0d8c6e2eb2bfefbc087 (diff) |
[PATCH] libertas: replace 'macaddress' with 'bssid'
Start to normalize bss_descriptor with ieee80211_network so we can
eventually replace bss_descriptor more easily.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/debugfs.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/join.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 51 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.h | 2 |
5 files changed, 35 insertions, 40 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 187ffd85c4be..9da29ebe8b0d 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -37,7 +37,7 @@ static int assoc_helper_essid(wlan_private *priv, | |||
37 | ret = wlan_associate(priv, &adapter->scantable[i]); | 37 | ret = wlan_associate(priv, &adapter->scantable[i]); |
38 | if (ret == 0) { | 38 | if (ret == 0) { |
39 | memcpy(&assoc_req->bssid, | 39 | memcpy(&assoc_req->bssid, |
40 | &adapter->scantable[i].macaddress, | 40 | &adapter->scantable[i].bssid, |
41 | ETH_ALEN); | 41 | ETH_ALEN); |
42 | } | 42 | } |
43 | } else { | 43 | } else { |
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index 8720abb3a27e..aa11e0a6cae8 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -76,9 +76,9 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf, | |||
76 | pos += snprintf(buf+pos, len-pos, | 76 | pos += snprintf(buf+pos, len-pos, |
77 | "%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |", | 77 | "%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |", |
78 | numscansdone, pbssinfo->channel, pbssinfo->rssi, | 78 | numscansdone, pbssinfo->channel, pbssinfo->rssi, |
79 | pbssinfo->macaddress[0], pbssinfo->macaddress[1], | 79 | pbssinfo->bssid[0], pbssinfo->bssid[1], |
80 | pbssinfo->macaddress[2], pbssinfo->macaddress[3], | 80 | pbssinfo->bssid[2], pbssinfo->bssid[3], |
81 | pbssinfo->macaddress[4], pbssinfo->macaddress[5]); | 81 | pbssinfo->bssid[4], pbssinfo->bssid[5]); |
82 | pos += snprintf(buf+pos, len-pos, " %04x-", cap); | 82 | pos += snprintf(buf+pos, len-pos, " %04x-", cap); |
83 | pos += snprintf(buf+pos, len-pos, "%c%c%c |", | 83 | pos += snprintf(buf+pos, len-pos, "%c%c%c |", |
84 | pbssinfo->cap.ibss ? 'A' : 'I', | 84 | pbssinfo->cap.ibss ? 'A' : 'I', |
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c index 8c578ec452e4..c9111b877067 100644 --- a/drivers/net/wireless/libertas/join.c +++ b/drivers/net/wireless/libertas/join.c | |||
@@ -113,7 +113,7 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc) | |||
113 | 113 | ||
114 | ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, | 114 | ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, |
115 | 0, cmd_option_waitforrsp, | 115 | 0, cmd_option_waitforrsp, |
116 | 0, pbssdesc->macaddress); | 116 | 0, pbssdesc->bssid); |
117 | 117 | ||
118 | if (ret) | 118 | if (ret) |
119 | goto done; | 119 | goto done; |
@@ -353,7 +353,7 @@ int libertas_cmd_80211_associate(wlan_private * priv, | |||
353 | adapter->pattemptedbssdesc = pbssdesc; | 353 | adapter->pattemptedbssdesc = pbssdesc; |
354 | 354 | ||
355 | memcpy(passo->peerstaaddr, | 355 | memcpy(passo->peerstaaddr, |
356 | pbssdesc->macaddress, sizeof(passo->peerstaaddr)); | 356 | pbssdesc->bssid, sizeof(passo->peerstaaddr)); |
357 | pos += sizeof(passo->peerstaaddr); | 357 | pos += sizeof(passo->peerstaaddr); |
358 | 358 | ||
359 | /* set the listen interval */ | 359 | /* set the listen interval */ |
@@ -632,7 +632,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, | |||
632 | padhocjoin->bssdescriptor.beaconperiod = pbssdesc->beaconperiod; | 632 | padhocjoin->bssdescriptor.beaconperiod = pbssdesc->beaconperiod; |
633 | 633 | ||
634 | memcpy(&padhocjoin->bssdescriptor.BSSID, | 634 | memcpy(&padhocjoin->bssdescriptor.BSSID, |
635 | &pbssdesc->macaddress, ETH_ALEN); | 635 | &pbssdesc->bssid, ETH_ALEN); |
636 | 636 | ||
637 | memcpy(&padhocjoin->bssdescriptor.SSID, | 637 | memcpy(&padhocjoin->bssdescriptor.SSID, |
638 | &pbssdesc->ssid.ssid, pbssdesc->ssid.ssidlength); | 638 | &pbssdesc->ssid.ssid, pbssdesc->ssid.ssidlength); |
@@ -787,7 +787,7 @@ int libertas_ret_80211_associate(wlan_private * priv, | |||
787 | 787 | ||
788 | /* Set the new BSSID (AP's MAC address) to current BSSID */ | 788 | /* Set the new BSSID (AP's MAC address) to current BSSID */ |
789 | memcpy(adapter->curbssparams.bssid, | 789 | memcpy(adapter->curbssparams.bssid, |
790 | pbssdesc->macaddress, ETH_ALEN); | 790 | pbssdesc->bssid, ETH_ALEN); |
791 | 791 | ||
792 | /* Make a copy of current BSSID descriptor */ | 792 | /* Make a copy of current BSSID descriptor */ |
793 | memcpy(&adapter->curbssparams.bssdescriptor, | 793 | memcpy(&adapter->curbssparams.bssdescriptor, |
@@ -880,8 +880,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, | |||
880 | 880 | ||
881 | if (command == cmd_ret_802_11_ad_hoc_start) { | 881 | if (command == cmd_ret_802_11_ad_hoc_start) { |
882 | /* Update the created network descriptor with the new BSSID */ | 882 | /* Update the created network descriptor with the new BSSID */ |
883 | memcpy(pbssdesc->macaddress, | 883 | memcpy(pbssdesc->bssid, padhocresult->BSSID, ETH_ALEN); |
884 | padhocresult->BSSID, ETH_ALEN); | ||
885 | } else { | 884 | } else { |
886 | 885 | ||
887 | /* Make a copy of current BSSID descriptor, only needed for join since | 886 | /* Make a copy of current BSSID descriptor, only needed for join since |
@@ -892,8 +891,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, | |||
892 | } | 891 | } |
893 | 892 | ||
894 | /* Set the BSSID from the joined/started descriptor */ | 893 | /* Set the BSSID from the joined/started descriptor */ |
895 | memcpy(&adapter->curbssparams.bssid, | 894 | memcpy(&adapter->curbssparams.bssid, pbssdesc->bssid, ETH_ALEN); |
896 | pbssdesc->macaddress, ETH_ALEN); | ||
897 | 895 | ||
898 | /* Set the new SSID to current SSID */ | 896 | /* Set the new SSID to current SSID */ |
899 | memcpy(&adapter->curbssparams.ssid, | 897 | memcpy(&adapter->curbssparams.ssid, |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 479c0090b947..e009f9bd0ec7 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -229,7 +229,7 @@ static void wlan_scan_process_results(wlan_private * priv) | |||
229 | if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, | 229 | if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, |
230 | &adapter->curbssparams.ssid) && | 230 | &adapter->curbssparams.ssid) && |
231 | !memcmp(adapter->curbssparams.bssid, | 231 | !memcmp(adapter->curbssparams.bssid, |
232 | adapter->scantable[i].macaddress, | 232 | adapter->scantable[i].bssid, |
233 | ETH_ALEN)) { | 233 | ETH_ALEN)) { |
234 | foundcurrent = 1; | 234 | foundcurrent = 1; |
235 | } | 235 | } |
@@ -247,12 +247,12 @@ static void wlan_scan_process_results(wlan_private * priv) | |||
247 | lbs_deb_scan("Scan:(%02d) %02x:%02x:%02x:%02x:%02x:%02x, " | 247 | lbs_deb_scan("Scan:(%02d) %02x:%02x:%02x:%02x:%02x:%02x, " |
248 | "RSSI[%03d], SSID[%s]\n", | 248 | "RSSI[%03d], SSID[%s]\n", |
249 | i, | 249 | i, |
250 | adapter->scantable[i].macaddress[0], | 250 | adapter->scantable[i].bssid[0], |
251 | adapter->scantable[i].macaddress[1], | 251 | adapter->scantable[i].bssid[1], |
252 | adapter->scantable[i].macaddress[2], | 252 | adapter->scantable[i].bssid[2], |
253 | adapter->scantable[i].macaddress[3], | 253 | adapter->scantable[i].bssid[3], |
254 | adapter->scantable[i].macaddress[4], | 254 | adapter->scantable[i].bssid[4], |
255 | adapter->scantable[i].macaddress[5], | 255 | adapter->scantable[i].bssid[5], |
256 | (s32) adapter->scantable[i].rssi, | 256 | (s32) adapter->scantable[i].rssi, |
257 | adapter->scantable[i].ssid.ssid); | 257 | adapter->scantable[i].ssid.ssid); |
258 | } | 258 | } |
@@ -963,11 +963,11 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry, | |||
963 | 963 | ||
964 | bytesleftforcurrentbeacon = beaconsize; | 964 | bytesleftforcurrentbeacon = beaconsize; |
965 | 965 | ||
966 | memcpy(pBSSEntry->macaddress, pcurrentptr, ETH_ALEN); | 966 | memcpy(pBSSEntry->bssid, pcurrentptr, ETH_ALEN); |
967 | lbs_deb_scan("InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n", | 967 | lbs_deb_scan("InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n", |
968 | pBSSEntry->macaddress[0], pBSSEntry->macaddress[1], | 968 | pBSSEntry->bssid[0], pBSSEntry->bssid[1], |
969 | pBSSEntry->macaddress[2], pBSSEntry->macaddress[3], | 969 | pBSSEntry->bssid[2], pBSSEntry->bssid[3], |
970 | pBSSEntry->macaddress[4], pBSSEntry->macaddress[5]); | 970 | pBSSEntry->bssid[4], pBSSEntry->bssid[5]); |
971 | 971 | ||
972 | pcurrentptr += ETH_ALEN; | 972 | pcurrentptr += ETH_ALEN; |
973 | bytesleftforcurrentbeacon -= ETH_ALEN; | 973 | bytesleftforcurrentbeacon -= ETH_ALEN; |
@@ -1246,7 +1246,7 @@ int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, u8 mode) | |||
1246 | * AP with multiple SSIDs assigned to the same BSSID | 1246 | * AP with multiple SSIDs assigned to the same BSSID |
1247 | */ | 1247 | */ |
1248 | for (i = 0; ret < 0 && i < adapter->numinscantable; i++) { | 1248 | for (i = 0; ret < 0 && i < adapter->numinscantable; i++) { |
1249 | if (!memcmp(adapter->scantable[i].macaddress, bssid, ETH_ALEN)) { | 1249 | if (!memcmp(adapter->scantable[i].bssid, bssid, ETH_ALEN)) { |
1250 | switch (mode) { | 1250 | switch (mode) { |
1251 | case IW_MODE_INFRA: | 1251 | case IW_MODE_INFRA: |
1252 | case IW_MODE_ADHOC: | 1252 | case IW_MODE_ADHOC: |
@@ -1285,8 +1285,7 @@ int libertas_find_SSID_in_list(wlan_adapter * adapter, | |||
1285 | for (i = 0; i < adapter->numinscantable; i++) { | 1285 | for (i = 0; i < adapter->numinscantable; i++) { |
1286 | if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, ssid) && | 1286 | if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, ssid) && |
1287 | (!bssid || | 1287 | (!bssid || |
1288 | !memcmp(adapter->scantable[i]. | 1288 | !memcmp(adapter->scantable[i].bssid, bssid, ETH_ALEN))) { |
1289 | macaddress, bssid, ETH_ALEN))) { | ||
1290 | switch (mode) { | 1289 | switch (mode) { |
1291 | case IW_MODE_INFRA: | 1290 | case IW_MODE_INFRA: |
1292 | case IW_MODE_ADHOC: | 1291 | case IW_MODE_ADHOC: |
@@ -1609,7 +1608,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, | |||
1609 | iwe.cmd = SIOCGIWAP; | 1608 | iwe.cmd = SIOCGIWAP; |
1610 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; | 1609 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; |
1611 | memcpy(iwe.u.ap_addr.sa_data, | 1610 | memcpy(iwe.u.ap_addr.sa_data, |
1612 | &adapter->scantable[i].macaddress, ETH_ALEN); | 1611 | &adapter->scantable[i].bssid, ETH_ALEN); |
1613 | 1612 | ||
1614 | iwe.len = IW_EV_ADDR_LEN; | 1613 | iwe.len = IW_EV_ADDR_LEN; |
1615 | current_ev = | 1614 | current_ev = |
@@ -1945,24 +1944,22 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp) | |||
1945 | 0) | 1944 | 0) |
1946 | && CHECK_SSID_IS_VALID(&newbssentry.ssid)) { | 1945 | && CHECK_SSID_IS_VALID(&newbssentry.ssid)) { |
1947 | 1946 | ||
1948 | lbs_deb_scan( | 1947 | lbs_deb_scan( |
1949 | "SCAN_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", | 1948 | "SCAN_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", |
1950 | newbssentry.macaddress[0], | 1949 | newbssentry.bssid[0], |
1951 | newbssentry.macaddress[1], | 1950 | newbssentry.bssid[1], |
1952 | newbssentry.macaddress[2], | 1951 | newbssentry.bssid[2], |
1953 | newbssentry.macaddress[3], | 1952 | newbssentry.bssid[3], |
1954 | newbssentry.macaddress[4], | 1953 | newbssentry.bssid[4], |
1955 | newbssentry.macaddress[5]); | 1954 | newbssentry.bssid[5]); |
1956 | 1955 | ||
1957 | /* | 1956 | /* |
1958 | * Search the scan table for the same bssid | 1957 | * Search the scan table for the same bssid |
1959 | */ | 1958 | */ |
1960 | for (bssIdx = 0; bssIdx < numintable; bssIdx++) { | 1959 | for (bssIdx = 0; bssIdx < numintable; bssIdx++) { |
1961 | if (memcmp(newbssentry.macaddress, | 1960 | if (memcmp(newbssentry.bssid, |
1962 | adapter->scantable[bssIdx]. | 1961 | adapter->scantable[bssIdx].bssid, |
1963 | macaddress, | 1962 | sizeof(newbssentry.bssid)) == 0) { |
1964 | sizeof(newbssentry.macaddress)) == | ||
1965 | 0) { | ||
1966 | /* | 1963 | /* |
1967 | * If the SSID matches as well, it is a duplicate of | 1964 | * If the SSID matches as well, it is a duplicate of |
1968 | * this entry. Keep the bssIdx set to this | 1965 | * this entry. Keep the bssIdx set to this |
diff --git a/drivers/net/wireless/libertas/scan.h b/drivers/net/wireless/libertas/scan.h index 26287caaf9b7..4fe8610d8003 100644 --- a/drivers/net/wireless/libertas/scan.h +++ b/drivers/net/wireless/libertas/scan.h | |||
@@ -137,7 +137,7 @@ struct wlan_ioctl_user_scan_cfg { | |||
137 | * @brief Structure used to store information for each beacon/probe response | 137 | * @brief Structure used to store information for each beacon/probe response |
138 | */ | 138 | */ |
139 | struct bss_descriptor { | 139 | struct bss_descriptor { |
140 | u8 macaddress[ETH_ALEN]; | 140 | u8 bssid[ETH_ALEN]; |
141 | 141 | ||
142 | struct WLAN_802_11_SSID ssid; | 142 | struct WLAN_802_11_SSID ssid; |
143 | 143 | ||