When an assoc_resp is received the network structure is not completely
authorIvo van Doorn <IvDoorn@gmail.com>
Mon, 3 Oct 2005 15:20:47 +0000 (10:20 -0500)
committerJames Ketrenos <jketreno@linux.intel.com>
Mon, 3 Oct 2005 15:20:47 +0000 (10:20 -0500)
initialized which can cause problems for drivers that expect the network
structure to be completely filled in.

This patch will make sure the network is filled in as much as possible.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
net/ieee80211/ieee80211_rx.c

index 3bf04d6d2b13479ca3112f2abf5450830a37f564..8d87d66c2a3492118102bc96f8bf8c3936c92341 100644 (file)
@@ -1106,10 +1106,41 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
        //network->atim_window = le16_to_cpu(frame->aid) & (0x3FFF);
        network->atim_window = le16_to_cpu(frame->aid);
        network->listen_interval = le16_to_cpu(frame->status);
        //network->atim_window = le16_to_cpu(frame->aid) & (0x3FFF);
        network->atim_window = le16_to_cpu(frame->aid);
        network->listen_interval = le16_to_cpu(frame->status);
+       memcpy(network->bssid, frame->header.addr3, ETH_ALEN);
+       network->capability = le16_to_cpu(frame->capability);
+       network->last_scanned = jiffies;
+       network->rates_len = network->rates_ex_len = 0;
+       network->last_associate = 0;
+       network->ssid_len = 0;
+       network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ? 0x3 : 0x0;
+
+       if (stats->freq == IEEE80211_52GHZ_BAND) {
+               /* for A band (No DS info) */
+               network->channel = stats->received_channel;
+       } else
+               network->flags |= NETWORK_HAS_CCK;
+
+       network->wpa_ie_len = 0;
+       network->rsn_ie_len = 0;
 
        if(ieee80211_parse_info_param(frame->info_element, stats->len - sizeof(*frame), network))
                return 1;
 
 
        if(ieee80211_parse_info_param(frame->info_element, stats->len - sizeof(*frame), network))
                return 1;
 
+       network->mode = 0;
+       if (stats->freq == IEEE80211_52GHZ_BAND)
+               network->mode = IEEE_A;
+       else {
+               if (network->flags & NETWORK_HAS_OFDM)
+                       network->mode |= IEEE_G;
+               if (network->flags & NETWORK_HAS_CCK)
+                       network->mode |= IEEE_B;
+       }
+
+       if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))
+               network->flags |= NETWORK_EMPTY_ESSID;
+
+       memcpy(&network->stats, stats, sizeof(network->stats));
+
        if (ieee->handle_assoc_response != NULL)
                ieee->handle_assoc_response(dev, frame, network);
 
        if (ieee->handle_assoc_response != NULL)
                ieee->handle_assoc_response(dev, frame, network);
 
@@ -1126,6 +1157,7 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i
        network->qos_data.active = 0;
        network->qos_data.supported = 0;
        network->qos_data.param_count = 0;
        network->qos_data.active = 0;
        network->qos_data.supported = 0;
        network->qos_data.param_count = 0;
+       network->qos_data.old_param_count = 0;
 
        /* Pull out fixed field data */
        memcpy(network->bssid, beacon->header.addr3, ETH_ALEN);
 
        /* Pull out fixed field data */
        memcpy(network->bssid, beacon->header.addr3, ETH_ALEN);