aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/ieee80211_rx.c
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2005-10-03 11:20:47 -0400
committerJames Ketrenos <jketreno@linux.intel.com>2005-10-03 11:20:47 -0400
commitc1bda44a4aedf13251b2704e6e67afb4909195c8 (patch)
treeff5bd9d92894bf777183447df3fad5615da51db7 /net/ieee80211/ieee80211_rx.c
parentff9e00f1b09d594004f91700a371870f729ffc02 (diff)
When an assoc_resp is received the network structure is not completely
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>
Diffstat (limited to 'net/ieee80211/ieee80211_rx.c')
-rw-r--r--net/ieee80211/ieee80211_rx.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 3bf04d6d2b13..8d87d66c2a34 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -1106,10 +1106,41 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1106 //network->atim_window = le16_to_cpu(frame->aid) & (0x3FFF); 1106 //network->atim_window = le16_to_cpu(frame->aid) & (0x3FFF);
1107 network->atim_window = le16_to_cpu(frame->aid); 1107 network->atim_window = le16_to_cpu(frame->aid);
1108 network->listen_interval = le16_to_cpu(frame->status); 1108 network->listen_interval = le16_to_cpu(frame->status);
1109 memcpy(network->bssid, frame->header.addr3, ETH_ALEN);
1110 network->capability = le16_to_cpu(frame->capability);
1111 network->last_scanned = jiffies;
1112 network->rates_len = network->rates_ex_len = 0;
1113 network->last_associate = 0;
1114 network->ssid_len = 0;
1115 network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ? 0x3 : 0x0;
1116
1117 if (stats->freq == IEEE80211_52GHZ_BAND) {
1118 /* for A band (No DS info) */
1119 network->channel = stats->received_channel;
1120 } else
1121 network->flags |= NETWORK_HAS_CCK;
1122
1123 network->wpa_ie_len = 0;
1124 network->rsn_ie_len = 0;
1109 1125
1110 if(ieee80211_parse_info_param(frame->info_element, stats->len - sizeof(*frame), network)) 1126 if(ieee80211_parse_info_param(frame->info_element, stats->len - sizeof(*frame), network))
1111 return 1; 1127 return 1;
1112 1128
1129 network->mode = 0;
1130 if (stats->freq == IEEE80211_52GHZ_BAND)
1131 network->mode = IEEE_A;
1132 else {
1133 if (network->flags & NETWORK_HAS_OFDM)
1134 network->mode |= IEEE_G;
1135 if (network->flags & NETWORK_HAS_CCK)
1136 network->mode |= IEEE_B;
1137 }
1138
1139 if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))
1140 network->flags |= NETWORK_EMPTY_ESSID;
1141
1142 memcpy(&network->stats, stats, sizeof(network->stats));
1143
1113 if (ieee->handle_assoc_response != NULL) 1144 if (ieee->handle_assoc_response != NULL)
1114 ieee->handle_assoc_response(dev, frame, network); 1145 ieee->handle_assoc_response(dev, frame, network);
1115 1146
@@ -1126,6 +1157,7 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i
1126 network->qos_data.active = 0; 1157 network->qos_data.active = 0;
1127 network->qos_data.supported = 0; 1158 network->qos_data.supported = 0;
1128 network->qos_data.param_count = 0; 1159 network->qos_data.param_count = 0;
1160 network->qos_data.old_param_count = 0;
1129 1161
1130 /* Pull out fixed field data */ 1162 /* Pull out fixed field data */
1131 memcpy(network->bssid, beacon->header.addr3, ETH_ALEN); 1163 memcpy(network->bssid, beacon->header.addr3, ETH_ALEN);