These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / wireless / iwlwifi / mvm / mac-ctxt.c
index 8088c71..ad7ad72 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
+ * Copyright(c) 2015 Intel Deutschland GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
@@ -33,6 +34,7 @@
  *
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
+ * Copyright(c) 2015 Intel Deutschland GmbH
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -484,16 +486,18 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
        switch (vif->type) {
        case NL80211_IFTYPE_P2P_DEVICE:
                iwl_mvm_enable_ac_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE,
-                                     IWL_MVM_TX_FIFO_VO, wdg_timeout);
+                                     IWL_MVM_OFFCHANNEL_QUEUE,
+                                     IWL_MVM_TX_FIFO_VO, 0, wdg_timeout);
                break;
        case NL80211_IFTYPE_AP:
-               iwl_mvm_enable_ac_txq(mvm, vif->cab_queue,
-                                     IWL_MVM_TX_FIFO_MCAST, wdg_timeout);
+               iwl_mvm_enable_ac_txq(mvm, vif->cab_queue, vif->cab_queue,
+                                     IWL_MVM_TX_FIFO_MCAST, 0, wdg_timeout);
                /* fall through */
        default:
                for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
                        iwl_mvm_enable_ac_txq(mvm, vif->hw_queue[ac],
-                                             iwl_mvm_ac_to_tx_fifo[ac],
+                                             vif->hw_queue[ac],
+                                             iwl_mvm_ac_to_tx_fifo[ac], 0,
                                              wdg_timeout);
                break;
        }
@@ -509,14 +513,19 @@ void iwl_mvm_mac_ctxt_release(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 
        switch (vif->type) {
        case NL80211_IFTYPE_P2P_DEVICE:
-               iwl_mvm_disable_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE, 0);
+               iwl_mvm_disable_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE,
+                                   IWL_MVM_OFFCHANNEL_QUEUE, IWL_MAX_TID_COUNT,
+                                   0);
                break;
        case NL80211_IFTYPE_AP:
-               iwl_mvm_disable_txq(mvm, vif->cab_queue, 0);
+               iwl_mvm_disable_txq(mvm, vif->cab_queue, vif->cab_queue,
+                                   IWL_MAX_TID_COUNT, 0);
                /* fall through */
        default:
                for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
-                       iwl_mvm_disable_txq(mvm, vif->hw_queue[ac], 0);
+                       iwl_mvm_disable_txq(mvm, vif->hw_queue[ac],
+                                           vif->hw_queue[ac],
+                                           IWL_MAX_TID_COUNT, 0);
        }
 }
 
@@ -834,6 +843,9 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm,
        ctxt_sta->listen_interval = cpu_to_le32(mvm->hw->conf.listen_interval);
        ctxt_sta->assoc_id = cpu_to_le32(vif->bss_conf.aid);
 
+       if (vif->probe_req_reg && vif->bss_conf.assoc && vif->p2p)
+               cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST);
+
        return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd);
 }
 
@@ -852,7 +864,7 @@ static int iwl_mvm_mac_ctxt_cmd_listener(struct iwl_mvm *mvm,
                                       MAC_FILTER_IN_BEACON |
                                       MAC_FILTER_IN_PROBE_REQUEST |
                                       MAC_FILTER_IN_CRC32);
-       mvm->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
+       ieee80211_hw_set(mvm->hw, RX_INCLUDES_FCS);
 
        return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd);
 }
@@ -1128,6 +1140,7 @@ static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm,
                                   struct ieee80211_vif *vif,
                                   u32 action)
 {
+       struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        struct iwl_mac_ctx_cmd cmd = {};
 
        WARN_ON(vif->type != NL80211_IFTYPE_AP || vif->p2p);
@@ -1137,10 +1150,16 @@ static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm,
 
        /*
         * pass probe requests and beacons from other APs (needed
-        * for ht protection)
+        * for ht protection); when there're no any associated station
+        * don't ask FW to pass beacons to prevent unnecessary wake-ups.
         */
-       cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST |
-                                       MAC_FILTER_IN_BEACON);
+       cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST);
+       if (mvmvif->ap_assoc_sta_count) {
+               cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_BEACON);
+               IWL_DEBUG_HC(mvm, "Asking FW to pass beacons\n");
+       } else {
+               IWL_DEBUG_HC(mvm, "No need to receive beacons\n");
+       }
 
        /* Fill the data specific for ap mode */
        iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap,
@@ -1270,7 +1289,7 @@ int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
        mvmvif->uploaded = false;
 
        if (vif->type == NL80211_IFTYPE_MONITOR)
-               mvm->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
+               __clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, mvm->hw->flags);
 
        return 0;
 }
@@ -1312,9 +1331,8 @@ static void iwl_mvm_csa_count_down(struct iwl_mvm *mvm,
        }
 }
 
-int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,
-                           struct iwl_rx_cmd_buffer *rxb,
-                           struct iwl_device_cmd *cmd)
+void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,
+                            struct iwl_rx_cmd_buffer *rxb)
 {
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
        struct iwl_extended_beacon_notif *beacon = (void *)pkt->data;
@@ -1365,8 +1383,6 @@ int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,
                        RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL);
                }
        }
-
-       return 0;
 }
 
 static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac,
@@ -1415,9 +1431,8 @@ static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac,
                iwl_mvm_fw_dbg_collect_trig(mvm, trigger, NULL);
 }
 
-int iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,
-                                   struct iwl_rx_cmd_buffer *rxb,
-                                   struct iwl_device_cmd *cmd)
+void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,
+                                    struct iwl_rx_cmd_buffer *rxb)
 {
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
        struct iwl_missed_beacons_notif *mb = (void *)pkt->data;
@@ -1434,5 +1449,4 @@ int iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,
                                                   IEEE80211_IFACE_ITER_NORMAL,
                                                   iwl_mvm_beacon_loss_iterator,
                                                   mb);
-       return 0;
 }