mac80211: move semicolon out of CALL_RXH macro
[cascardo/linux.git] / net / mac80211 / rx.c
index dc27bec..570ae3d 100644 (file)
@@ -722,8 +722,8 @@ static int ieee80211_get_mmie_keyidx(struct sk_buff *skb)
        return -1;
 }
 
-static int iwl80211_get_cs_keyid(const struct ieee80211_cipher_scheme *cs,
-                                struct sk_buff *skb)
+static int ieee80211_get_cs_keyid(const struct ieee80211_cipher_scheme *cs,
+                                 struct sk_buff *skb)
 {
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
        __le16 fc;
@@ -1586,7 +1586,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
 
                if (ieee80211_has_protected(fc) && rx->sta->cipher_scheme) {
                        cs = rx->sta->cipher_scheme;
-                       keyid = iwl80211_get_cs_keyid(cs, rx->skb);
+                       keyid = ieee80211_get_cs_keyid(cs, rx->skb);
                        if (unlikely(keyid < 0))
                                return RX_DROP_UNUSABLE;
                }
@@ -1670,7 +1670,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
                hdrlen = ieee80211_hdrlen(fc);
 
                if (cs) {
-                       keyidx = iwl80211_get_cs_keyid(cs, rx->skb);
+                       keyidx = ieee80211_get_cs_keyid(cs, rx->skb);
 
                        if (unlikely(keyidx < 0))
                                return RX_DROP_UNUSABLE;
@@ -2129,6 +2129,15 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
 
        ieee80211_rx_stats(dev, skb->len);
 
+       if (rx->sta) {
+               /* The seqno index has the same property as needed
+                * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
+                * for non-QoS-data frames. Here we know it's a data
+                * frame, so count MSDUs.
+                */
+               rx->sta->rx_stats.msdu[rx->seqno_idx]++;
+       }
+
        if ((sdata->vif.type == NL80211_IFTYPE_AP ||
             sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
            !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
@@ -2415,15 +2424,6 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
        if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
                return RX_DROP_MONITOR;
 
-       if (rx->sta) {
-               /* The seqno index has the same property as needed
-                * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
-                * for non-QoS-data frames. Here we know it's a data
-                * frame, so count MSDUs.
-                */
-               rx->sta->rx_stats.msdu[rx->seqno_idx]++;
-       }
-
        /*
         * Send unexpected-4addr-frame event to hostapd. For older versions,
         * also drop the frame to cooked monitor interfaces.
@@ -2474,14 +2474,14 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 
        rx->skb->dev = dev;
 
-       if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
+       if (!ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS) &&
+           local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
            !is_multicast_ether_addr(
                    ((struct ethhdr *)rx->skb->data)->h_dest) &&
            (!local->scanning &&
-            !test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))) {
-                       mod_timer(&local->dynamic_ps_timer, jiffies +
-                        msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
-       }
+            !test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state)))
+               mod_timer(&local->dynamic_ps_timer, jiffies +
+                         msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 
        ieee80211_deliver_skb(rx);
 
@@ -3201,7 +3201,7 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx,
                res = rxh(rx);          \
                if (res != RX_CONTINUE) \
                        goto rxh_next;  \
-       } while (0);
+       } while (0)
 
        /* Lock here to avoid hitting all of the data used in the RX
         * path (e.g. key data, station data, ...) concurrently when
@@ -3219,30 +3219,30 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx,
                 */
                rx->skb = skb;
 
-               CALL_RXH(ieee80211_rx_h_check_more_data)
-               CALL_RXH(ieee80211_rx_h_uapsd_and_pspoll)
-               CALL_RXH(ieee80211_rx_h_sta_process)
-               CALL_RXH(ieee80211_rx_h_decrypt)
-               CALL_RXH(ieee80211_rx_h_defragment)
-               CALL_RXH(ieee80211_rx_h_michael_mic_verify)
+               CALL_RXH(ieee80211_rx_h_check_more_data);
+               CALL_RXH(ieee80211_rx_h_uapsd_and_pspoll);
+               CALL_RXH(ieee80211_rx_h_sta_process);
+               CALL_RXH(ieee80211_rx_h_decrypt);
+               CALL_RXH(ieee80211_rx_h_defragment);
+               CALL_RXH(ieee80211_rx_h_michael_mic_verify);
                /* must be after MMIC verify so header is counted in MPDU mic */
 #ifdef CONFIG_MAC80211_MESH
                if (ieee80211_vif_is_mesh(&rx->sdata->vif))
                        CALL_RXH(ieee80211_rx_h_mesh_fwding);
 #endif
-               CALL_RXH(ieee80211_rx_h_amsdu)
-               CALL_RXH(ieee80211_rx_h_data)
+               CALL_RXH(ieee80211_rx_h_amsdu);
+               CALL_RXH(ieee80211_rx_h_data);
 
                /* special treatment -- needs the queue */
                res = ieee80211_rx_h_ctrl(rx, frames);
                if (res != RX_CONTINUE)
                        goto rxh_next;
 
-               CALL_RXH(ieee80211_rx_h_mgmt_check)
-               CALL_RXH(ieee80211_rx_h_action)
-               CALL_RXH(ieee80211_rx_h_userspace_mgmt)
-               CALL_RXH(ieee80211_rx_h_action_return)
-               CALL_RXH(ieee80211_rx_h_mgmt)
+               CALL_RXH(ieee80211_rx_h_mgmt_check);
+               CALL_RXH(ieee80211_rx_h_action);
+               CALL_RXH(ieee80211_rx_h_userspace_mgmt);
+               CALL_RXH(ieee80211_rx_h_action_return);
+               CALL_RXH(ieee80211_rx_h_mgmt);
 
  rxh_next:
                ieee80211_rx_handlers_result(rx, res);
@@ -3265,10 +3265,10 @@ static void ieee80211_invoke_rx_handlers(struct ieee80211_rx_data *rx)
                res = rxh(rx);          \
                if (res != RX_CONTINUE) \
                        goto rxh_next;  \
-       } while (0);
+       } while (0)
 
-       CALL_RXH(ieee80211_rx_h_check_dup)
-       CALL_RXH(ieee80211_rx_h_check)
+       CALL_RXH(ieee80211_rx_h_check_dup);
+       CALL_RXH(ieee80211_rx_h_check);
 
        ieee80211_rx_reorder_ampdu(rx, &reorder_release);
 
@@ -3552,6 +3552,7 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
  * be called with rcu_read_lock protection.
  */
 static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
+                                        struct ieee80211_sta *pubsta,
                                         struct sk_buff *skb,
                                         struct napi_struct *napi)
 {
@@ -3561,7 +3562,6 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
        __le16 fc;
        struct ieee80211_rx_data rx;
        struct ieee80211_sub_if_data *prev;
-       struct sta_info *sta, *prev_sta;
        struct rhash_head *tmp;
        int err = 0;
 
@@ -3597,7 +3597,14 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
                     ieee80211_is_beacon(hdr->frame_control)))
                ieee80211_scan_rx(local, skb);
 
-       if (ieee80211_is_data(fc)) {
+       if (pubsta) {
+               rx.sta = container_of(pubsta, struct sta_info, sta);
+               rx.sdata = rx.sta->sdata;
+               if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
+                       return;
+               goto out;
+       } else if (ieee80211_is_data(fc)) {
+               struct sta_info *sta, *prev_sta;
                const struct bucket_table *tbl;
 
                prev_sta = NULL;
@@ -3671,8 +3678,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
  * This is the receive path handler. It is called by a low level driver when an
  * 802.11 MPDU is received from the hardware.
  */
-void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
-                      struct napi_struct *napi)
+void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
+                      struct sk_buff *skb, struct napi_struct *napi)
 {
        struct ieee80211_local *local = hw_to_local(hw);
        struct ieee80211_rate *rate = NULL;
@@ -3771,7 +3778,8 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
        ieee80211_tpt_led_trig_rx(local,
                        ((struct ieee80211_hdr *)skb->data)->frame_control,
                        skb->len);
-       __ieee80211_rx_handle_packet(hw, skb, napi);
+
+       __ieee80211_rx_handle_packet(hw, pubsta, skb, napi);
 
        rcu_read_unlock();