[PATCH] ieee80211: Type-o, capbility definition for QoS, and ERP parsing
authorJames Ketrenos <jketreno@linux.intel.com>
Wed, 21 Sep 2005 16:58:29 +0000 (11:58 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Thu, 22 Sep 2005 03:04:57 +0000 (23:04 -0400)
tree 3ac0dd07b9972dfd68fee47ec2152d3d378de000
parent 9ada1d971d9829c34a14d98840080b7e69fdff6b
author Mohamed Abbad <mohamed.abbas@intel.com> 1126054379 -0500
committer James Ketrenos <jketreno@linux.intel.com> 1127314340 -0500

Type-o, capbility definition for QoS, and ERP parsing

Added WLAN_CAPABILITY_QOS
Fixed type-o WLAN_CAPABILITY_OSSS_OFDM -> WLAN_CAPABILITY_DSSS_OFDM
Added ERP IE parsing to ieee80211_rx
Added handle_probe_request callback.

Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
include/net/ieee80211.h
net/ieee80211/ieee80211_rx.c

index 9310b2e01d41b7b4ff3a3341dfd9e955db7a00c3..931737eec6c67e88e968272bcd127a1e185e4e5c 100644 (file)
@@ -225,8 +225,9 @@ struct ieee80211_snap_hdr {
 #define WLAN_CAPABILITY_PBCC (1<<6)
 #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
 #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
+#define WLAN_CAPABILITY_QOS (1<<9)
 #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
-#define WLAN_CAPABILITY_OSSS_OFDM (1<<13)
+#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
 
 /* Status codes */
 enum ieee80211_statuscode {
@@ -756,6 +757,7 @@ struct ieee80211_network {
        u16 beacon_interval;
        u16 listen_interval;
        u16 atim_window;
+       u8 erp_value;
        u8 wpa_ie[MAX_WPA_IE_LEN];
        size_t wpa_ie_len;
        u8 rsn_ie[MAX_WPA_IE_LEN];
@@ -910,6 +912,9 @@ struct ieee80211_device {
        int (*handle_probe_response) (struct net_device * dev,
                                      struct ieee80211_probe_response * resp,
                                      struct ieee80211_network * network);
+       int (*handle_probe_request) (struct net_device * dev,
+                                    struct ieee80211_probe_request * req,
+                                    struct ieee80211_rx_stats * stats);
        int (*handle_assoc_response) (struct net_device * dev,
                                      struct ieee80211_assoc_response * resp,
                                      struct ieee80211_network * network);
index 2c4613527dfd80746eff3892e91c7f92650b4f5f..8bcdbabae3a1ed3f3034ab262ea3bfa3878aa8cb 100644 (file)
@@ -1065,6 +1065,8 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i
        network->ssid_len = 0;
        network->flags = 0;
        network->atim_window = 0;
+       network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ?
+               0x3 : 0x0;
 
        if (stats->freq == IEEE80211_52GHZ_BAND) {
                /* for A band (No DS info) */
@@ -1178,8 +1180,16 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i
                        IEEE80211_DEBUG_SCAN("MFIE_TYPE_TIM: ignored\n");
                        break;
 
+               case MFIE_TYPE_ERP_INFO:
+                       network->erp_value = info_element->data[0];
+                       IEEE80211_DEBUG_SCAN("MFIE_TYPE_ERP_SET: %d\n",
+                                            network->erp_value);
+                       break;
+
                case MFIE_TYPE_IBSS_SET:
-                       IEEE80211_DEBUG_SCAN("MFIE_TYPE_IBSS_SET: ignored\n");
+                       network->atim_window = info_element->data[0];
+                       IEEE80211_DEBUG_SCAN("MFIE_TYPE_IBSS_SET: %d\n",
+                                            network->atim_window);
                        break;
 
                case MFIE_TYPE_CHALLENGE:
@@ -1290,6 +1300,7 @@ static inline void update_network(struct ieee80211_network *dst,
        dst->beacon_interval = src->beacon_interval;
        dst->listen_interval = src->listen_interval;
        dst->atim_window = src->atim_window;
+       dst->erp_value = src->erp_value;
 
        memcpy(dst->wpa_ie, src->wpa_ie, src->wpa_ie_len);
        dst->wpa_ie_len = src->wpa_ie_len;
@@ -1471,6 +1482,18 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
                                                       (header->frame_ctl)));
                break;
 
+       case IEEE80211_STYPE_PROBE_REQ:
+               IEEE80211_DEBUG_MGMT("recieved auth (%d)\n",
+                                    WLAN_FC_GET_STYPE(le16_to_cpu
+                                                      (header->frame_ctl)));
+
+               if (ieee->handle_probe_request != NULL)
+                       ieee->handle_probe_request(ieee->dev,
+                                                  (struct
+                                                   ieee80211_probe_request *)
+                                                  header, stats);
+               break;
+
        case IEEE80211_STYPE_PROBE_RESP:
                IEEE80211_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
                                     WLAN_FC_GET_STYPE(le16_to_cpu