aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ketrenos <jketreno@linux.intel.com>2005-09-13 18:25:51 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-16 03:06:31 -0400
commitfd27817ce941c7134adefd2852f8a5f274315ff4 (patch)
tree152c2194e03c104bb34fc105494ee5238f31acb9
parent9c8a11d7c2298680ff3ee8acda54575c88668bfc (diff)
[PATCH] Fixed some endian issues with 802.11 header usage in ieee80211_rx.c
Fixed some endian issues with 802.11 header usage in ieee80211_rx.c Signed-off-by: James Ketrenos <jketreno@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--net/ieee80211/ieee80211_rx.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index f7dcd854139e..74c4ed77cfd9 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -787,11 +787,11 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee,
787 787
788 /* Pull out fixed field data */ 788 /* Pull out fixed field data */
789 memcpy(network->bssid, beacon->header.addr3, ETH_ALEN); 789 memcpy(network->bssid, beacon->header.addr3, ETH_ALEN);
790 network->capability = beacon->capability; 790 network->capability = le16_to_cpu(beacon->capability);
791 network->last_scanned = jiffies; 791 network->last_scanned = jiffies;
792 network->time_stamp[0] = beacon->time_stamp[0]; 792 network->time_stamp[0] = le32_to_cpu(beacon->time_stamp[0]);
793 network->time_stamp[1] = beacon->time_stamp[1]; 793 network->time_stamp[1] = le32_to_cpu(beacon->time_stamp[1]);
794 network->beacon_interval = beacon->beacon_interval; 794 network->beacon_interval = le16_to_cpu(beacon->beacon_interval);
795 /* Where to pull this? beacon->listen_interval; */ 795 /* Where to pull this? beacon->listen_interval; */
796 network->listen_interval = 0x0A; 796 network->listen_interval = 0x0A;
797 network->rates_len = network->rates_ex_len = 0; 797 network->rates_len = network->rates_ex_len = 0;
@@ -1070,8 +1070,9 @@ static inline void ieee80211_process_probe_response(struct ieee80211_device
1070 escape_essid(info_element->data, 1070 escape_essid(info_element->data,
1071 info_element->len), 1071 info_element->len),
1072 MAC_ARG(beacon->header.addr3), 1072 MAC_ARG(beacon->header.addr3),
1073 WLAN_FC_GET_STYPE(beacon->header. 1073 WLAN_FC_GET_STYPE(le16_to_cpu
1074 frame_ctl) == 1074 (beacon->header.
1075 frame_ctl)) ==
1075 IEEE80211_STYPE_PROBE_RESP ? 1076 IEEE80211_STYPE_PROBE_RESP ?
1076 "PROBE RESPONSE" : "BEACON"); 1077 "PROBE RESPONSE" : "BEACON");
1077 return; 1078 return;
@@ -1122,8 +1123,9 @@ static inline void ieee80211_process_probe_response(struct ieee80211_device
1122 escape_essid(network.ssid, 1123 escape_essid(network.ssid,
1123 network.ssid_len), 1124 network.ssid_len),
1124 MAC_ARG(network.bssid), 1125 MAC_ARG(network.bssid),
1125 WLAN_FC_GET_STYPE(beacon->header. 1126 WLAN_FC_GET_STYPE(le16_to_cpu
1126 frame_ctl) == 1127 (beacon->header.
1128 frame_ctl)) ==
1127 IEEE80211_STYPE_PROBE_RESP ? 1129 IEEE80211_STYPE_PROBE_RESP ?
1128 "PROBE RESPONSE" : "BEACON"); 1130 "PROBE RESPONSE" : "BEACON");
1129#endif 1131#endif
@@ -1134,8 +1136,9 @@ static inline void ieee80211_process_probe_response(struct ieee80211_device
1134 escape_essid(target->ssid, 1136 escape_essid(target->ssid,
1135 target->ssid_len), 1137 target->ssid_len),
1136 MAC_ARG(target->bssid), 1138 MAC_ARG(target->bssid),
1137 WLAN_FC_GET_STYPE(beacon->header. 1139 WLAN_FC_GET_STYPE(le16_to_cpu
1138 frame_ctl) == 1140 (beacon->header.
1141 frame_ctl)) ==
1139 IEEE80211_STYPE_PROBE_RESP ? 1142 IEEE80211_STYPE_PROBE_RESP ?
1140 "PROBE RESPONSE" : "BEACON"); 1143 "PROBE RESPONSE" : "BEACON");
1141 update_network(target, &network); 1144 update_network(target, &network);
@@ -1148,20 +1151,23 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1148 struct ieee80211_hdr *header, 1151 struct ieee80211_hdr *header,
1149 struct ieee80211_rx_stats *stats) 1152 struct ieee80211_rx_stats *stats)
1150{ 1153{
1151 switch (WLAN_FC_GET_STYPE(header->frame_ctl)) { 1154 switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
1152 case IEEE80211_STYPE_ASSOC_RESP: 1155 case IEEE80211_STYPE_ASSOC_RESP:
1153 IEEE80211_DEBUG_MGMT("received ASSOCIATION RESPONSE (%d)\n", 1156 IEEE80211_DEBUG_MGMT("received ASSOCIATION RESPONSE (%d)\n",
1154 WLAN_FC_GET_STYPE(header->frame_ctl)); 1157 WLAN_FC_GET_STYPE(le16_to_cpu
1158 (header->frame_ctl)));
1155 break; 1159 break;
1156 1160
1157 case IEEE80211_STYPE_REASSOC_RESP: 1161 case IEEE80211_STYPE_REASSOC_RESP:
1158 IEEE80211_DEBUG_MGMT("received REASSOCIATION RESPONSE (%d)\n", 1162 IEEE80211_DEBUG_MGMT("received REASSOCIATION RESPONSE (%d)\n",
1159 WLAN_FC_GET_STYPE(header->frame_ctl)); 1163 WLAN_FC_GET_STYPE(le16_to_cpu
1164 (header->frame_ctl)));
1160 break; 1165 break;
1161 1166
1162 case IEEE80211_STYPE_PROBE_RESP: 1167 case IEEE80211_STYPE_PROBE_RESP:
1163 IEEE80211_DEBUG_MGMT("received PROBE RESPONSE (%d)\n", 1168 IEEE80211_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
1164 WLAN_FC_GET_STYPE(header->frame_ctl)); 1169 WLAN_FC_GET_STYPE(le16_to_cpu
1170 (header->frame_ctl)));
1165 IEEE80211_DEBUG_SCAN("Probe response\n"); 1171 IEEE80211_DEBUG_SCAN("Probe response\n");
1166 ieee80211_process_probe_response(ieee, 1172 ieee80211_process_probe_response(ieee,
1167 (struct 1173 (struct
@@ -1171,7 +1177,8 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1171 1177
1172 case IEEE80211_STYPE_BEACON: 1178 case IEEE80211_STYPE_BEACON:
1173 IEEE80211_DEBUG_MGMT("received BEACON (%d)\n", 1179 IEEE80211_DEBUG_MGMT("received BEACON (%d)\n",
1174 WLAN_FC_GET_STYPE(header->frame_ctl)); 1180 WLAN_FC_GET_STYPE(le16_to_cpu
1181 (header->frame_ctl)));
1175 IEEE80211_DEBUG_SCAN("Beacon\n"); 1182 IEEE80211_DEBUG_SCAN("Beacon\n");
1176 ieee80211_process_probe_response(ieee, 1183 ieee80211_process_probe_response(ieee,
1177 (struct 1184 (struct
@@ -1181,10 +1188,12 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1181 1188
1182 default: 1189 default:
1183 IEEE80211_DEBUG_MGMT("received UNKNOWN (%d)\n", 1190 IEEE80211_DEBUG_MGMT("received UNKNOWN (%d)\n",
1184 WLAN_FC_GET_STYPE(header->frame_ctl)); 1191 WLAN_FC_GET_STYPE(le16_to_cpu
1192 (header->frame_ctl)));
1185 IEEE80211_WARNING("%s: Unknown management packet: %d\n", 1193 IEEE80211_WARNING("%s: Unknown management packet: %d\n",
1186 ieee->dev->name, 1194 ieee->dev->name,
1187 WLAN_FC_GET_STYPE(header->frame_ctl)); 1195 WLAN_FC_GET_STYPE(le16_to_cpu
1196 (header->frame_ctl)));
1188 break; 1197 break;
1189 } 1198 }
1190} 1199}