[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>
This commit is contained in:
Dan Williams 2007-05-25 13:16:38 -04:00 committed by John W. Linville
parent 7732ca45c6
commit 4ace113876
5 changed files with 35 additions and 40 deletions

View File

@ -37,7 +37,7 @@ static int assoc_helper_essid(wlan_private *priv,
ret = wlan_associate(priv, &adapter->scantable[i]); ret = wlan_associate(priv, &adapter->scantable[i]);
if (ret == 0) { if (ret == 0) {
memcpy(&assoc_req->bssid, memcpy(&assoc_req->bssid,
&adapter->scantable[i].macaddress, &adapter->scantable[i].bssid,
ETH_ALEN); ETH_ALEN);
} }
} else { } else {

View File

@ -76,9 +76,9 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
pos += snprintf(buf+pos, len-pos, pos += snprintf(buf+pos, len-pos,
"%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |", "%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |",
numscansdone, pbssinfo->channel, pbssinfo->rssi, numscansdone, pbssinfo->channel, pbssinfo->rssi,
pbssinfo->macaddress[0], pbssinfo->macaddress[1], pbssinfo->bssid[0], pbssinfo->bssid[1],
pbssinfo->macaddress[2], pbssinfo->macaddress[3], pbssinfo->bssid[2], pbssinfo->bssid[3],
pbssinfo->macaddress[4], pbssinfo->macaddress[5]); pbssinfo->bssid[4], pbssinfo->bssid[5]);
pos += snprintf(buf+pos, len-pos, " %04x-", cap); pos += snprintf(buf+pos, len-pos, " %04x-", cap);
pos += snprintf(buf+pos, len-pos, "%c%c%c |", pos += snprintf(buf+pos, len-pos, "%c%c%c |",
pbssinfo->cap.ibss ? 'A' : 'I', pbssinfo->cap.ibss ? 'A' : 'I',

View File

@ -113,7 +113,7 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc)
ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate,
0, cmd_option_waitforrsp, 0, cmd_option_waitforrsp,
0, pbssdesc->macaddress); 0, pbssdesc->bssid);
if (ret) if (ret)
goto done; goto done;
@ -353,7 +353,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
adapter->pattemptedbssdesc = pbssdesc; adapter->pattemptedbssdesc = pbssdesc;
memcpy(passo->peerstaaddr, memcpy(passo->peerstaaddr,
pbssdesc->macaddress, sizeof(passo->peerstaaddr)); pbssdesc->bssid, sizeof(passo->peerstaaddr));
pos += sizeof(passo->peerstaaddr); pos += sizeof(passo->peerstaaddr);
/* set the listen interval */ /* set the listen interval */
@ -632,7 +632,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
padhocjoin->bssdescriptor.beaconperiod = pbssdesc->beaconperiod; padhocjoin->bssdescriptor.beaconperiod = pbssdesc->beaconperiod;
memcpy(&padhocjoin->bssdescriptor.BSSID, memcpy(&padhocjoin->bssdescriptor.BSSID,
&pbssdesc->macaddress, ETH_ALEN); &pbssdesc->bssid, ETH_ALEN);
memcpy(&padhocjoin->bssdescriptor.SSID, memcpy(&padhocjoin->bssdescriptor.SSID,
&pbssdesc->ssid.ssid, pbssdesc->ssid.ssidlength); &pbssdesc->ssid.ssid, pbssdesc->ssid.ssidlength);
@ -787,7 +787,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
/* Set the new BSSID (AP's MAC address) to current BSSID */ /* Set the new BSSID (AP's MAC address) to current BSSID */
memcpy(adapter->curbssparams.bssid, memcpy(adapter->curbssparams.bssid,
pbssdesc->macaddress, ETH_ALEN); pbssdesc->bssid, ETH_ALEN);
/* Make a copy of current BSSID descriptor */ /* Make a copy of current BSSID descriptor */
memcpy(&adapter->curbssparams.bssdescriptor, memcpy(&adapter->curbssparams.bssdescriptor,
@ -880,8 +880,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
if (command == cmd_ret_802_11_ad_hoc_start) { if (command == cmd_ret_802_11_ad_hoc_start) {
/* Update the created network descriptor with the new BSSID */ /* Update the created network descriptor with the new BSSID */
memcpy(pbssdesc->macaddress, memcpy(pbssdesc->bssid, padhocresult->BSSID, ETH_ALEN);
padhocresult->BSSID, ETH_ALEN);
} else { } else {
/* Make a copy of current BSSID descriptor, only needed for join since /* 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,
} }
/* Set the BSSID from the joined/started descriptor */ /* Set the BSSID from the joined/started descriptor */
memcpy(&adapter->curbssparams.bssid, memcpy(&adapter->curbssparams.bssid, pbssdesc->bssid, ETH_ALEN);
pbssdesc->macaddress, ETH_ALEN);
/* Set the new SSID to current SSID */ /* Set the new SSID to current SSID */
memcpy(&adapter->curbssparams.ssid, memcpy(&adapter->curbssparams.ssid,

View File

@ -229,7 +229,7 @@ static void wlan_scan_process_results(wlan_private * priv)
if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, if (!libertas_SSID_cmp(&adapter->scantable[i].ssid,
&adapter->curbssparams.ssid) && &adapter->curbssparams.ssid) &&
!memcmp(adapter->curbssparams.bssid, !memcmp(adapter->curbssparams.bssid,
adapter->scantable[i].macaddress, adapter->scantable[i].bssid,
ETH_ALEN)) { ETH_ALEN)) {
foundcurrent = 1; foundcurrent = 1;
} }
@ -247,12 +247,12 @@ static void wlan_scan_process_results(wlan_private * priv)
lbs_deb_scan("Scan:(%02d) %02x:%02x:%02x:%02x:%02x:%02x, " lbs_deb_scan("Scan:(%02d) %02x:%02x:%02x:%02x:%02x:%02x, "
"RSSI[%03d], SSID[%s]\n", "RSSI[%03d], SSID[%s]\n",
i, i,
adapter->scantable[i].macaddress[0], adapter->scantable[i].bssid[0],
adapter->scantable[i].macaddress[1], adapter->scantable[i].bssid[1],
adapter->scantable[i].macaddress[2], adapter->scantable[i].bssid[2],
adapter->scantable[i].macaddress[3], adapter->scantable[i].bssid[3],
adapter->scantable[i].macaddress[4], adapter->scantable[i].bssid[4],
adapter->scantable[i].macaddress[5], adapter->scantable[i].bssid[5],
(s32) adapter->scantable[i].rssi, (s32) adapter->scantable[i].rssi,
adapter->scantable[i].ssid.ssid); adapter->scantable[i].ssid.ssid);
} }
@ -963,11 +963,11 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry,
bytesleftforcurrentbeacon = beaconsize; bytesleftforcurrentbeacon = beaconsize;
memcpy(pBSSEntry->macaddress, pcurrentptr, ETH_ALEN); memcpy(pBSSEntry->bssid, pcurrentptr, ETH_ALEN);
lbs_deb_scan("InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n", lbs_deb_scan("InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n",
pBSSEntry->macaddress[0], pBSSEntry->macaddress[1], pBSSEntry->bssid[0], pBSSEntry->bssid[1],
pBSSEntry->macaddress[2], pBSSEntry->macaddress[3], pBSSEntry->bssid[2], pBSSEntry->bssid[3],
pBSSEntry->macaddress[4], pBSSEntry->macaddress[5]); pBSSEntry->bssid[4], pBSSEntry->bssid[5]);
pcurrentptr += ETH_ALEN; pcurrentptr += ETH_ALEN;
bytesleftforcurrentbeacon -= ETH_ALEN; bytesleftforcurrentbeacon -= ETH_ALEN;
@ -1246,7 +1246,7 @@ int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, u8 mode)
* AP with multiple SSIDs assigned to the same BSSID * AP with multiple SSIDs assigned to the same BSSID
*/ */
for (i = 0; ret < 0 && i < adapter->numinscantable; i++) { for (i = 0; ret < 0 && i < adapter->numinscantable; i++) {
if (!memcmp(adapter->scantable[i].macaddress, bssid, ETH_ALEN)) { if (!memcmp(adapter->scantable[i].bssid, bssid, ETH_ALEN)) {
switch (mode) { switch (mode) {
case IW_MODE_INFRA: case IW_MODE_INFRA:
case IW_MODE_ADHOC: case IW_MODE_ADHOC:
@ -1285,8 +1285,7 @@ int libertas_find_SSID_in_list(wlan_adapter * adapter,
for (i = 0; i < adapter->numinscantable; i++) { for (i = 0; i < adapter->numinscantable; i++) {
if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, ssid) && if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, ssid) &&
(!bssid || (!bssid ||
!memcmp(adapter->scantable[i]. !memcmp(adapter->scantable[i].bssid, bssid, ETH_ALEN))) {
macaddress, bssid, ETH_ALEN))) {
switch (mode) { switch (mode) {
case IW_MODE_INFRA: case IW_MODE_INFRA:
case IW_MODE_ADHOC: case IW_MODE_ADHOC:
@ -1609,7 +1608,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
iwe.cmd = SIOCGIWAP; iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER; iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(iwe.u.ap_addr.sa_data, memcpy(iwe.u.ap_addr.sa_data,
&adapter->scantable[i].macaddress, ETH_ALEN); &adapter->scantable[i].bssid, ETH_ALEN);
iwe.len = IW_EV_ADDR_LEN; iwe.len = IW_EV_ADDR_LEN;
current_ev = current_ev =
@ -1945,24 +1944,22 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
0) 0)
&& CHECK_SSID_IS_VALID(&newbssentry.ssid)) { && CHECK_SSID_IS_VALID(&newbssentry.ssid)) {
lbs_deb_scan( lbs_deb_scan(
"SCAN_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", "SCAN_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n",
newbssentry.macaddress[0], newbssentry.bssid[0],
newbssentry.macaddress[1], newbssentry.bssid[1],
newbssentry.macaddress[2], newbssentry.bssid[2],
newbssentry.macaddress[3], newbssentry.bssid[3],
newbssentry.macaddress[4], newbssentry.bssid[4],
newbssentry.macaddress[5]); newbssentry.bssid[5]);
/* /*
* Search the scan table for the same bssid * Search the scan table for the same bssid
*/ */
for (bssIdx = 0; bssIdx < numintable; bssIdx++) { for (bssIdx = 0; bssIdx < numintable; bssIdx++) {
if (memcmp(newbssentry.macaddress, if (memcmp(newbssentry.bssid,
adapter->scantable[bssIdx]. adapter->scantable[bssIdx].bssid,
macaddress, sizeof(newbssentry.bssid)) == 0) {
sizeof(newbssentry.macaddress)) ==
0) {
/* /*
* If the SSID matches as well, it is a duplicate of * If the SSID matches as well, it is a duplicate of
* this entry. Keep the bssIdx set to this * this entry. Keep the bssIdx set to this

View File

@ -137,7 +137,7 @@ struct wlan_ioctl_user_scan_cfg {
* @brief Structure used to store information for each beacon/probe response * @brief Structure used to store information for each beacon/probe response
*/ */
struct bss_descriptor { struct bss_descriptor {
u8 macaddress[ETH_ALEN]; u8 bssid[ETH_ALEN];
struct WLAN_802_11_SSID ssid; struct WLAN_802_11_SSID ssid;