Merge branch 'upstream-fixes' into upstream
[powerpc.git] / net / ieee80211 / softmac / ieee80211softmac_io.c
index 0954161..82bfddb 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;
 }
 
@@ -229,6 +228,9 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
                return 0;
        ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid);
 
+       /* Fill in the capabilities */
+       (*pkt)->capability = ieee80211softmac_capabilities(mac, net);
+
        /* Fill in Listen Interval (?) */
        (*pkt)->listen_interval = cpu_to_le16(10);
        
@@ -465,3 +467,17 @@ 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);
+
+       if (mac->associated && memcmp(network->bssid, mac->associnfo.bssid, ETH_ALEN) == 0)
+               ieee80211softmac_process_erp(mac, network->erp_value);
+
+       return 0;
+}
+