]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ieee80211/softmac/ieee80211softmac_io.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6-omap-h63xx.git] / net / ieee80211 / softmac / ieee80211softmac_io.c
index 8cc8b20f5cda3529b7302141e0d7e48d751561fe..b96931001b43d131bc30d8d7841fda97b0897ce0 100644 (file)
@@ -96,8 +96,7 @@ ieee80211softmac_alloc_mgt(u32 size)
        if(size > IEEE80211_DATA_LEN)
                return NULL;
        /* Allocate the frame */
-       data = kmalloc(size, GFP_ATOMIC);
-       memset(data, 0, size);
+       data = kzalloc(size, GFP_ATOMIC);
        return data;
 }
 
@@ -305,7 +304,7 @@ ieee80211softmac_auth(struct ieee80211_auth **pkt,
                2 +             /* Auth Transaction Seq */
                2 +             /* Status Code */
                 /* Challenge Text IE */
-               is_shared_response ? 0 : 1 + 1 + net->challenge_len
+               (is_shared_response ? 1 + 1 + net->challenge_len : 0)
        );
        if (unlikely((*pkt) == NULL))
                return 0;
@@ -468,3 +467,22 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac,
        kfree(pkt);
        return 0;
 }
+
+/* Beacon handling */
+int ieee80211softmac_handle_beacon(struct net_device *dev,
+       struct ieee80211_beacon *beacon,
+       struct ieee80211_network *network)
+{
+       struct ieee80211softmac_device *mac = ieee80211_priv(dev);
+
+       /* This might race, but we don't really care and it's not worth
+        * adding heavyweight locking in this fastpath.
+        */
+       if (mac->associnfo.associated) {
+               if (memcmp(network->bssid, mac->associnfo.bssid, ETH_ALEN) == 0)
+                       ieee80211softmac_process_erp(mac, network->erp_value);
+       }
+
+       return 0;
+}
+