aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2009-03-06 09:32:26 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-16 18:09:34 -0400
commitd74cc9a7a317cc173fb522252fdff9e4cdd282a0 (patch)
tree91e6242c6b7c1f107d1b2cff0bb6e7bc40b5e6e0
parent30e1863ccb2eb8052eb134abe51d6884cac50e29 (diff)
ipw2x00: Use IE definitions from linux/ieee80211.h
Use IE definitions from linux/ieee80211.h and drop the appropriate enum from ipw2x00/ieee80211.h Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ipw2x00/ieee80211.h31
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_rx.c84
2 files changed, 42 insertions, 73 deletions
diff --git a/drivers/net/wireless/ipw2x00/ieee80211.h b/drivers/net/wireless/ipw2x00/ieee80211.h
index e292114629d7..299e29fa2904 100644
--- a/drivers/net/wireless/ipw2x00/ieee80211.h
+++ b/drivers/net/wireless/ipw2x00/ieee80211.h
@@ -358,37 +358,6 @@ Total: 28-2340 bytes
358 358
359#define BEACON_PROBE_SSID_ID_POSITION 12 359#define BEACON_PROBE_SSID_ID_POSITION 12
360 360
361/* Management Frame Information Element Types */
362enum ieee80211_mfie {
363 MFIE_TYPE_SSID = 0,
364 MFIE_TYPE_RATES = 1,
365 MFIE_TYPE_FH_SET = 2,
366 MFIE_TYPE_DS_SET = 3,
367 MFIE_TYPE_CF_SET = 4,
368 MFIE_TYPE_TIM = 5,
369 MFIE_TYPE_IBSS_SET = 6,
370 MFIE_TYPE_COUNTRY = 7,
371 MFIE_TYPE_HOP_PARAMS = 8,
372 MFIE_TYPE_HOP_TABLE = 9,
373 MFIE_TYPE_REQUEST = 10,
374 MFIE_TYPE_CHALLENGE = 16,
375 MFIE_TYPE_POWER_CONSTRAINT = 32,
376 MFIE_TYPE_POWER_CAPABILITY = 33,
377 MFIE_TYPE_TPC_REQUEST = 34,
378 MFIE_TYPE_TPC_REPORT = 35,
379 MFIE_TYPE_SUPP_CHANNELS = 36,
380 MFIE_TYPE_CSA = 37,
381 MFIE_TYPE_MEASURE_REQUEST = 38,
382 MFIE_TYPE_MEASURE_REPORT = 39,
383 MFIE_TYPE_QUIET = 40,
384 MFIE_TYPE_IBSS_DFS = 41,
385 MFIE_TYPE_ERP_INFO = 42,
386 MFIE_TYPE_RSN = 48,
387 MFIE_TYPE_RATES_EX = 50,
388 MFIE_TYPE_GENERIC = 221,
389 MFIE_TYPE_QOS_PARAMETER = 222,
390};
391
392struct ieee80211_hdr_1addr { 361struct ieee80211_hdr_1addr {
393 __le16 frame_ctl; 362 __le16 frame_ctl;
394 __le16 duration_id; 363 __le16 duration_id;
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index 794d2fc05813..079007936d8a 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -1081,36 +1081,36 @@ static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element
1081} 1081}
1082 1082
1083#ifdef CONFIG_LIBIPW_DEBUG 1083#ifdef CONFIG_LIBIPW_DEBUG
1084#define MFIE_STRING(x) case MFIE_TYPE_ ##x: return #x 1084#define MFIE_STRING(x) case WLAN_EID_ ##x: return #x
1085 1085
1086static const char *get_info_element_string(u16 id) 1086static const char *get_info_element_string(u16 id)
1087{ 1087{
1088 switch (id) { 1088 switch (id) {
1089 MFIE_STRING(SSID); 1089 MFIE_STRING(SSID);
1090 MFIE_STRING(RATES); 1090 MFIE_STRING(SUPP_RATES);
1091 MFIE_STRING(FH_SET); 1091 MFIE_STRING(FH_PARAMS);
1092 MFIE_STRING(DS_SET); 1092 MFIE_STRING(DS_PARAMS);
1093 MFIE_STRING(CF_SET); 1093 MFIE_STRING(CF_PARAMS);
1094 MFIE_STRING(TIM); 1094 MFIE_STRING(TIM);
1095 MFIE_STRING(IBSS_SET); 1095 MFIE_STRING(IBSS_PARAMS);
1096 MFIE_STRING(COUNTRY); 1096 MFIE_STRING(COUNTRY);
1097 MFIE_STRING(HOP_PARAMS); 1097 MFIE_STRING(HP_PARAMS);
1098 MFIE_STRING(HOP_TABLE); 1098 MFIE_STRING(HP_TABLE);
1099 MFIE_STRING(REQUEST); 1099 MFIE_STRING(REQUEST);
1100 MFIE_STRING(CHALLENGE); 1100 MFIE_STRING(CHALLENGE);
1101 MFIE_STRING(POWER_CONSTRAINT); 1101 MFIE_STRING(PWR_CONSTRAINT);
1102 MFIE_STRING(POWER_CAPABILITY); 1102 MFIE_STRING(PWR_CAPABILITY);
1103 MFIE_STRING(TPC_REQUEST); 1103 MFIE_STRING(TPC_REQUEST);
1104 MFIE_STRING(TPC_REPORT); 1104 MFIE_STRING(TPC_REPORT);
1105 MFIE_STRING(SUPP_CHANNELS); 1105 MFIE_STRING(SUPPORTED_CHANNELS);
1106 MFIE_STRING(CSA); 1106 MFIE_STRING(CHANNEL_SWITCH);
1107 MFIE_STRING(MEASURE_REQUEST); 1107 MFIE_STRING(MEASURE_REQUEST);
1108 MFIE_STRING(MEASURE_REPORT); 1108 MFIE_STRING(MEASURE_REPORT);
1109 MFIE_STRING(QUIET); 1109 MFIE_STRING(QUIET);
1110 MFIE_STRING(IBSS_DFS); 1110 MFIE_STRING(IBSS_DFS);
1111 MFIE_STRING(ERP_INFO); 1111 MFIE_STRING(ERP_INFO);
1112 MFIE_STRING(RSN); 1112 MFIE_STRING(RSN);
1113 MFIE_STRING(RATES_EX); 1113 MFIE_STRING(EXT_SUPP_RATES);
1114 MFIE_STRING(GENERIC); 1114 MFIE_STRING(GENERIC);
1115 MFIE_STRING(QOS_PARAMETER); 1115 MFIE_STRING(QOS_PARAMETER);
1116 default: 1116 default:
@@ -1145,7 +1145,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1145 } 1145 }
1146 1146
1147 switch (info_element->id) { 1147 switch (info_element->id) {
1148 case MFIE_TYPE_SSID: 1148 case WLAN_EID_SSID:
1149 network->ssid_len = min(info_element->len, 1149 network->ssid_len = min(info_element->len,
1150 (u8) IW_ESSID_MAX_SIZE); 1150 (u8) IW_ESSID_MAX_SIZE);
1151 memcpy(network->ssid, info_element->data, 1151 memcpy(network->ssid, info_element->data,
@@ -1154,13 +1154,13 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1154 memset(network->ssid + network->ssid_len, 0, 1154 memset(network->ssid + network->ssid_len, 0,
1155 IW_ESSID_MAX_SIZE - network->ssid_len); 1155 IW_ESSID_MAX_SIZE - network->ssid_len);
1156 1156
1157 IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", 1157 IEEE80211_DEBUG_MGMT("WLAN_EID_SSID: '%s' len=%d.\n",
1158 print_ssid(ssid, network->ssid, 1158 print_ssid(ssid, network->ssid,
1159 network->ssid_len), 1159 network->ssid_len),
1160 network->ssid_len); 1160 network->ssid_len);
1161 break; 1161 break;
1162 1162
1163 case MFIE_TYPE_RATES: 1163 case WLAN_EID_SUPP_RATES:
1164#ifdef CONFIG_LIBIPW_DEBUG 1164#ifdef CONFIG_LIBIPW_DEBUG
1165 p = rates_str; 1165 p = rates_str;
1166#endif 1166#endif
@@ -1183,11 +1183,11 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1183 } 1183 }
1184 } 1184 }
1185 1185
1186 IEEE80211_DEBUG_MGMT("MFIE_TYPE_RATES: '%s' (%d)\n", 1186 IEEE80211_DEBUG_MGMT("WLAN_EID_SUPP_RATES: '%s' (%d)\n",
1187 rates_str, network->rates_len); 1187 rates_str, network->rates_len);
1188 break; 1188 break;
1189 1189
1190 case MFIE_TYPE_RATES_EX: 1190 case WLAN_EID_EXT_SUPP_RATES:
1191#ifdef CONFIG_LIBIPW_DEBUG 1191#ifdef CONFIG_LIBIPW_DEBUG
1192 p = rates_str; 1192 p = rates_str;
1193#endif 1193#endif
@@ -1210,49 +1210,49 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1210 } 1210 }
1211 } 1211 }
1212 1212
1213 IEEE80211_DEBUG_MGMT("MFIE_TYPE_RATES_EX: '%s' (%d)\n", 1213 IEEE80211_DEBUG_MGMT("WLAN_EID_EXT_SUPP_RATES: '%s' (%d)\n",
1214 rates_str, network->rates_ex_len); 1214 rates_str, network->rates_ex_len);
1215 break; 1215 break;
1216 1216
1217 case MFIE_TYPE_DS_SET: 1217 case WLAN_EID_DS_PARAMS:
1218 IEEE80211_DEBUG_MGMT("MFIE_TYPE_DS_SET: %d\n", 1218 IEEE80211_DEBUG_MGMT("WLAN_EID_DS_PARAMS: %d\n",
1219 info_element->data[0]); 1219 info_element->data[0]);
1220 network->channel = info_element->data[0]; 1220 network->channel = info_element->data[0];
1221 break; 1221 break;
1222 1222
1223 case MFIE_TYPE_FH_SET: 1223 case WLAN_EID_FH_PARAMS:
1224 IEEE80211_DEBUG_MGMT("MFIE_TYPE_FH_SET: ignored\n"); 1224 IEEE80211_DEBUG_MGMT("WLAN_EID_FH_PARAMS: ignored\n");
1225 break; 1225 break;
1226 1226
1227 case MFIE_TYPE_CF_SET: 1227 case WLAN_EID_CF_PARAMS:
1228 IEEE80211_DEBUG_MGMT("MFIE_TYPE_CF_SET: ignored\n"); 1228 IEEE80211_DEBUG_MGMT("WLAN_EID_CF_PARAMS: ignored\n");
1229 break; 1229 break;
1230 1230
1231 case MFIE_TYPE_TIM: 1231 case WLAN_EID_TIM:
1232 network->tim.tim_count = info_element->data[0]; 1232 network->tim.tim_count = info_element->data[0];
1233 network->tim.tim_period = info_element->data[1]; 1233 network->tim.tim_period = info_element->data[1];
1234 IEEE80211_DEBUG_MGMT("MFIE_TYPE_TIM: partially ignored\n"); 1234 IEEE80211_DEBUG_MGMT("WLAN_EID_TIM: partially ignored\n");
1235 break; 1235 break;
1236 1236
1237 case MFIE_TYPE_ERP_INFO: 1237 case WLAN_EID_ERP_INFO:
1238 network->erp_value = info_element->data[0]; 1238 network->erp_value = info_element->data[0];
1239 network->flags |= NETWORK_HAS_ERP_VALUE; 1239 network->flags |= NETWORK_HAS_ERP_VALUE;
1240 IEEE80211_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n", 1240 IEEE80211_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n",
1241 network->erp_value); 1241 network->erp_value);
1242 break; 1242 break;
1243 1243
1244 case MFIE_TYPE_IBSS_SET: 1244 case WLAN_EID_IBSS_PARAMS:
1245 network->atim_window = info_element->data[0]; 1245 network->atim_window = info_element->data[0];
1246 IEEE80211_DEBUG_MGMT("MFIE_TYPE_IBSS_SET: %d\n", 1246 IEEE80211_DEBUG_MGMT("WLAN_EID_IBSS_PARAMS: %d\n",
1247 network->atim_window); 1247 network->atim_window);
1248 break; 1248 break;
1249 1249
1250 case MFIE_TYPE_CHALLENGE: 1250 case WLAN_EID_CHALLENGE:
1251 IEEE80211_DEBUG_MGMT("MFIE_TYPE_CHALLENGE: ignored\n"); 1251 IEEE80211_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n");
1252 break; 1252 break;
1253 1253
1254 case MFIE_TYPE_GENERIC: 1254 case WLAN_EID_GENERIC:
1255 IEEE80211_DEBUG_MGMT("MFIE_TYPE_GENERIC: %d bytes\n", 1255 IEEE80211_DEBUG_MGMT("WLAN_EID_GENERIC: %d bytes\n",
1256 info_element->len); 1256 info_element->len);
1257 if (!ieee80211_parse_qos_info_param_IE(info_element, 1257 if (!ieee80211_parse_qos_info_param_IE(info_element,
1258 network)) 1258 network))
@@ -1270,8 +1270,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1270 } 1270 }
1271 break; 1271 break;
1272 1272
1273 case MFIE_TYPE_RSN: 1273 case WLAN_EID_RSN:
1274 IEEE80211_DEBUG_MGMT("MFIE_TYPE_RSN: %d bytes\n", 1274 IEEE80211_DEBUG_MGMT("WLAN_EID_RSN: %d bytes\n",
1275 info_element->len); 1275 info_element->len);
1276 network->rsn_ie_len = min(info_element->len + 2, 1276 network->rsn_ie_len = min(info_element->len + 2,
1277 MAX_WPA_IE_LEN); 1277 MAX_WPA_IE_LEN);
@@ -1279,22 +1279,22 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1279 network->rsn_ie_len); 1279 network->rsn_ie_len);
1280 break; 1280 break;
1281 1281
1282 case MFIE_TYPE_QOS_PARAMETER: 1282 case WLAN_EID_QOS_PARAMETER:
1283 printk(KERN_ERR 1283 printk(KERN_ERR
1284 "QoS Error need to parse QOS_PARAMETER IE\n"); 1284 "QoS Error need to parse QOS_PARAMETER IE\n");
1285 break; 1285 break;
1286 /* 802.11h */ 1286 /* 802.11h */
1287 case MFIE_TYPE_POWER_CONSTRAINT: 1287 case WLAN_EID_PWR_CONSTRAINT:
1288 network->power_constraint = info_element->data[0]; 1288 network->power_constraint = info_element->data[0];
1289 network->flags |= NETWORK_HAS_POWER_CONSTRAINT; 1289 network->flags |= NETWORK_HAS_POWER_CONSTRAINT;
1290 break; 1290 break;
1291 1291
1292 case MFIE_TYPE_CSA: 1292 case WLAN_EID_CHANNEL_SWITCH:
1293 network->power_constraint = info_element->data[0]; 1293 network->power_constraint = info_element->data[0];
1294 network->flags |= NETWORK_HAS_CSA; 1294 network->flags |= NETWORK_HAS_CSA;
1295 break; 1295 break;
1296 1296
1297 case MFIE_TYPE_QUIET: 1297 case WLAN_EID_QUIET:
1298 network->quiet.count = info_element->data[0]; 1298 network->quiet.count = info_element->data[0];
1299 network->quiet.period = info_element->data[1]; 1299 network->quiet.period = info_element->data[1];
1300 network->quiet.duration = info_element->data[2]; 1300 network->quiet.duration = info_element->data[2];
@@ -1302,7 +1302,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1302 network->flags |= NETWORK_HAS_QUIET; 1302 network->flags |= NETWORK_HAS_QUIET;
1303 break; 1303 break;
1304 1304
1305 case MFIE_TYPE_IBSS_DFS: 1305 case WLAN_EID_IBSS_DFS:
1306 if (network->ibss_dfs) 1306 if (network->ibss_dfs)
1307 break; 1307 break;
1308 network->ibss_dfs = kmemdup(info_element->data, 1308 network->ibss_dfs = kmemdup(info_element->data,
@@ -1313,7 +1313,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1313 network->flags |= NETWORK_HAS_IBSS_DFS; 1313 network->flags |= NETWORK_HAS_IBSS_DFS;
1314 break; 1314 break;
1315 1315
1316 case MFIE_TYPE_TPC_REPORT: 1316 case WLAN_EID_TPC_REPORT:
1317 network->tpc_report.transmit_power = 1317 network->tpc_report.transmit_power =
1318 info_element->data[0]; 1318 info_element->data[0];
1319 network->tpc_report.link_margin = info_element->data[1]; 1319 network->tpc_report.link_margin = info_element->data[1];