mac80211: push rx status into skb->cb
[safe/jmp/linux-2.6] / net / mac80211 / main.c
index 6b7e92e..5b69f5f 100644 (file)
@@ -289,16 +289,8 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
        drv_bss_info_changed(local, &sdata->vif,
                             &sdata->vif.bss_conf, changed);
 
-       /*
-        * DEPRECATED
-        *
-        * ~changed is just there to not do this at resume time
-        */
-       if (changed & BSS_CHANGED_BEACON_INT && ~changed) {
-               local->hw.conf.beacon_int = sdata->vif.bss_conf.beacon_int;
-               ieee80211_hw_config(local,
-                                   _IEEE80211_CONF_CHANGE_BEACON_INTERVAL);
-       }
+       /* DEPRECATED */
+       local->hw.conf.beacon_int = sdata->vif.bss_conf.beacon_int;
 }
 
 u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
@@ -338,19 +330,16 @@ static void ieee80211_tasklet_handler(unsigned long data)
 {
        struct ieee80211_local *local = (struct ieee80211_local *) data;
        struct sk_buff *skb;
-       struct ieee80211_rx_status rx_status;
        struct ieee80211_ra_tid *ra_tid;
 
        while ((skb = skb_dequeue(&local->skb_queue)) ||
               (skb = skb_dequeue(&local->skb_queue_unreliable))) {
                switch (skb->pkt_type) {
                case IEEE80211_RX_MSG:
-                       /* status is in skb->cb */
-                       memcpy(&rx_status, skb->cb, sizeof(rx_status));
                        /* Clear skb->pkt_type in order to not confuse kernel
                         * netstack. */
                        skb->pkt_type = 0;
-                       __ieee80211_rx(local_to_hw(local), skb, &rx_status);
+                       ieee80211_rx(local_to_hw(local), skb);
                        break;
                case IEEE80211_TX_STATUS_MSG:
                        skb->pkt_type = 0;
@@ -377,60 +366,12 @@ static void ieee80211_tasklet_handler(unsigned long data)
        }
 }
 
-/* Remove added headers (e.g., QoS control), encryption header/MIC, etc. to
- * make a prepared TX frame (one that has been given to hw) to look like brand
- * new IEEE 802.11 frame that is ready to go through TX processing again.
- */
-static void ieee80211_remove_tx_extra(struct ieee80211_local *local,
-                                     struct ieee80211_key *key,
-                                     struct sk_buff *skb)
-{
-       unsigned int hdrlen, iv_len, mic_len;
-       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-
-       hdrlen = ieee80211_hdrlen(hdr->frame_control);
-
-       if (!key)
-               goto no_key;
-
-       switch (key->conf.alg) {
-       case ALG_WEP:
-               iv_len = WEP_IV_LEN;
-               mic_len = WEP_ICV_LEN;
-               break;
-       case ALG_TKIP:
-               iv_len = TKIP_IV_LEN;
-               mic_len = TKIP_ICV_LEN;
-               break;
-       case ALG_CCMP:
-               iv_len = CCMP_HDR_LEN;
-               mic_len = CCMP_MIC_LEN;
-               break;
-       default:
-               goto no_key;
-       }
-
-       if (skb->len >= hdrlen + mic_len &&
-           !(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
-               skb_trim(skb, skb->len - mic_len);
-       if (skb->len >= hdrlen + iv_len) {
-               memmove(skb->data + iv_len, skb->data, hdrlen);
-               hdr = (struct ieee80211_hdr *)skb_pull(skb, iv_len);
-       }
-
-no_key:
-       if (ieee80211_is_data_qos(hdr->frame_control)) {
-               hdr->frame_control &= ~cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
-               memmove(skb->data + IEEE80211_QOS_CTL_LEN, skb->data,
-                       hdrlen - IEEE80211_QOS_CTL_LEN);
-               skb_pull(skb, IEEE80211_QOS_CTL_LEN);
-       }
-}
-
 static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
                                            struct sta_info *sta,
                                            struct sk_buff *skb)
 {
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+
        sta->tx_filtered_count++;
 
        /*
@@ -472,16 +413,15 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
         */
        if (test_sta_flags(sta, WLAN_STA_PS) &&
            skb_queue_len(&sta->tx_filtered) < STA_MAX_TX_BUFFER) {
-               ieee80211_remove_tx_extra(local, sta->key, skb);
                skb_queue_tail(&sta->tx_filtered, skb);
                return;
        }
 
-       if (!test_sta_flags(sta, WLAN_STA_PS) && !skb->requeue) {
+       if (!test_sta_flags(sta, WLAN_STA_PS) &&
+           !(info->flags & IEEE80211_TX_INTFL_RETRIED)) {
                /* Software retry the packet once */
-               skb->requeue = 1;
-               ieee80211_remove_tx_extra(local, sta->key, skb);
-               dev_queue_xmit(skb);
+               info->flags |= IEEE80211_TX_INTFL_RETRIED;
+               ieee80211_add_pending_skb(local, skb);
                return;
        }
 
@@ -735,9 +675,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
         * +-------------------------+
         *
         */
-       priv_size = ((sizeof(struct ieee80211_local) +
-                     NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST) +
-                   priv_data_len;
+       priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len;
 
        wiphy = wiphy_new(&mac80211_config_ops, priv_size);
 
@@ -754,9 +692,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 
        local->hw.wiphy = wiphy;
 
-       local->hw.priv = (char *)local +
-                        ((sizeof(struct ieee80211_local) +
-                          NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
+       local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN);
 
        BUG_ON(!ops->tx);
        BUG_ON(!ops->start);