[PATCH] libertas: replace 'macaddress' with 'bssid'
authorDan Williams <dcbw@redhat.com>
Fri, 25 May 2007 17:16:38 +0000 (13:16 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jun 2007 18:28:40 +0000 (14:28 -0400)
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>
drivers/net/wireless/libertas/assoc.c
drivers/net/wireless/libertas/debugfs.c
drivers/net/wireless/libertas/join.c
drivers/net/wireless/libertas/scan.c
drivers/net/wireless/libertas/scan.h

index 187ffd8..9da29eb 100644 (file)
@@ -37,7 +37,7 @@ static int assoc_helper_essid(wlan_private *priv,
                        ret = wlan_associate(priv, &adapter->scantable[i]);
                        if (ret == 0) {
                                memcpy(&assoc_req->bssid,
-                                      &adapter->scantable[i].macaddress,
+                                      &adapter->scantable[i].bssid,
                                       ETH_ALEN);
                        }
                } else {
index 8720abb..aa11e0a 100644 (file)
@@ -76,9 +76,9 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
                pos += snprintf(buf+pos, len-pos,
                        "%02u| %03d | %03ld | %02x:%02x:%02x:%02x:%02x:%02x |",
                        numscansdone, pbssinfo->channel, pbssinfo->rssi,
-                       pbssinfo->macaddress[0], pbssinfo->macaddress[1],
-                       pbssinfo->macaddress[2], pbssinfo->macaddress[3],
-                       pbssinfo->macaddress[4], pbssinfo->macaddress[5]);
+                       pbssinfo->bssid[0], pbssinfo->bssid[1],
+                       pbssinfo->bssid[2], pbssinfo->bssid[3],
+                       pbssinfo->bssid[4], pbssinfo->bssid[5]);
                pos += snprintf(buf+pos, len-pos, " %04x-", cap);
                pos += snprintf(buf+pos, len-pos, "%c%c%c |",
                                pbssinfo->cap.ibss ? 'A' : 'I',
index 8c578ec..c9111b8 100644 (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,
                                    0, cmd_option_waitforrsp,
-                                   0, pbssdesc->macaddress);
+                                   0, pbssdesc->bssid);
 
        if (ret)
                goto done;
@@ -353,7 +353,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
        adapter->pattemptedbssdesc = pbssdesc;
 
        memcpy(passo->peerstaaddr,
-              pbssdesc->macaddress, sizeof(passo->peerstaaddr));
+              pbssdesc->bssid, sizeof(passo->peerstaaddr));
        pos += sizeof(passo->peerstaaddr);
 
        /* set the listen interval */
@@ -632,7 +632,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
        padhocjoin->bssdescriptor.beaconperiod = pbssdesc->beaconperiod;
 
        memcpy(&padhocjoin->bssdescriptor.BSSID,
-              &pbssdesc->macaddress, ETH_ALEN);
+              &pbssdesc->bssid, ETH_ALEN);
 
        memcpy(&padhocjoin->bssdescriptor.SSID,
               &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 */
        memcpy(adapter->curbssparams.bssid,
-              pbssdesc->macaddress, ETH_ALEN);
+              pbssdesc->bssid, ETH_ALEN);
 
        /* Make a copy of current BSSID descriptor */
        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) {
                /* Update the created network descriptor with the new BSSID */
-               memcpy(pbssdesc->macaddress,
-                      padhocresult->BSSID, ETH_ALEN);
+               memcpy(pbssdesc->bssid, padhocresult->BSSID, ETH_ALEN);
        } else {
 
                /* 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 */
-       memcpy(&adapter->curbssparams.bssid,
-              pbssdesc->macaddress, ETH_ALEN);
+       memcpy(&adapter->curbssparams.bssid, pbssdesc->bssid, ETH_ALEN);
 
        /* Set the new SSID to current SSID */
        memcpy(&adapter->curbssparams.ssid,
index 479c009..e009f9b 100644 (file)
@@ -229,7 +229,7 @@ static void wlan_scan_process_results(wlan_private * priv)
                        if (!libertas_SSID_cmp(&adapter->scantable[i].ssid,
                                     &adapter->curbssparams.ssid) &&
                            !memcmp(adapter->curbssparams.bssid,
-                                   adapter->scantable[i].macaddress,
+                                   adapter->scantable[i].bssid,
                                    ETH_ALEN)) {
                                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, "
                       "RSSI[%03d], SSID[%s]\n",
                       i,
-                      adapter->scantable[i].macaddress[0],
-                      adapter->scantable[i].macaddress[1],
-                      adapter->scantable[i].macaddress[2],
-                      adapter->scantable[i].macaddress[3],
-                      adapter->scantable[i].macaddress[4],
-                      adapter->scantable[i].macaddress[5],
+                      adapter->scantable[i].bssid[0],
+                      adapter->scantable[i].bssid[1],
+                      adapter->scantable[i].bssid[2],
+                      adapter->scantable[i].bssid[3],
+                      adapter->scantable[i].bssid[4],
+                      adapter->scantable[i].bssid[5],
                       (s32) adapter->scantable[i].rssi,
                       adapter->scantable[i].ssid.ssid);
        }
@@ -963,11 +963,11 @@ static int InterpretBSSDescriptionWithIE(struct bss_descriptor * pBSSEntry,
 
        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",
-              pBSSEntry->macaddress[0], pBSSEntry->macaddress[1],
-              pBSSEntry->macaddress[2], pBSSEntry->macaddress[3],
-              pBSSEntry->macaddress[4], pBSSEntry->macaddress[5]);
+              pBSSEntry->bssid[0], pBSSEntry->bssid[1],
+              pBSSEntry->bssid[2], pBSSEntry->bssid[3],
+              pBSSEntry->bssid[4], pBSSEntry->bssid[5]);
 
        pcurrentptr += 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
         */
        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) {
                        case IW_MODE_INFRA:
                        case IW_MODE_ADHOC:
@@ -1285,8 +1285,7 @@ int libertas_find_SSID_in_list(wlan_adapter * adapter,
        for (i = 0; i < adapter->numinscantable; i++) {
                if (!libertas_SSID_cmp(&adapter->scantable[i].ssid, ssid) &&
                    (!bssid ||
-                    !memcmp(adapter->scantable[i].
-                            macaddress, bssid, ETH_ALEN))) {
+                    !memcmp(adapter->scantable[i].bssid, bssid, ETH_ALEN))) {
                        switch (mode) {
                        case IW_MODE_INFRA:
                        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.u.ap_addr.sa_family = ARPHRD_ETHER;
                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;
                current_ev =
@@ -1945,24 +1944,22 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
                     0)
                    && CHECK_SSID_IS_VALID(&newbssentry.ssid)) {
 
-            lbs_deb_scan(
+                       lbs_deb_scan(
                               "SCAN_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n",
-                              newbssentry.macaddress[0],
-                              newbssentry.macaddress[1],
-                              newbssentry.macaddress[2],
-                              newbssentry.macaddress[3],
-                              newbssentry.macaddress[4],
-                              newbssentry.macaddress[5]);
+                              newbssentry.bssid[0],
+                              newbssentry.bssid[1],
+                              newbssentry.bssid[2],
+                              newbssentry.bssid[3],
+                              newbssentry.bssid[4],
+                              newbssentry.bssid[5]);
 
                        /*
                         * Search the scan table for the same bssid
                         */
                        for (bssIdx = 0; bssIdx < numintable; bssIdx++) {
-                               if (memcmp(newbssentry.macaddress,
-                                          adapter->scantable[bssIdx].
-                                          macaddress,
-                                          sizeof(newbssentry.macaddress)) ==
-                                   0) {
+                               if (memcmp(newbssentry.bssid,
+                                          adapter->scantable[bssIdx].bssid,
+                                          sizeof(newbssentry.bssid)) == 0) {
                                        /*
                                         * If the SSID matches as well, it is a duplicate of
                                         *   this entry.  Keep the bssIdx set to this
index 26287ca..4fe8610 100644 (file)
@@ -137,7 +137,7 @@ struct wlan_ioctl_user_scan_cfg {
  *  @brief Structure used to store information for each beacon/probe response
  */
 struct bss_descriptor {
-       u8 macaddress[ETH_ALEN];
+       u8 bssid[ETH_ALEN];
 
        struct WLAN_802_11_SSID ssid;