aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2014-02-27 09:41:52 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-06-24 14:55:39 -0400
commit1c87bbad439d818f94f2e8bff98f73d6fb568dfc (patch)
treebd820a1c50620a48a597726ce93a85a618c25a01
parent09b0ce1a874a644fb5799ebf5e54563632714115 (diff)
iwlwifi: mvm: support extended beacon notification
Use extended beacon notification when supported by FW. Set last beacon system time to AP or GO interface. System time of last beacon can be used to avoid TBTT overlapping between two interfaces, CSA and other uses. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fw.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h14
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c32
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h3
5 files changed, 42 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h
index c71331034e9b..13e5d69845e9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw.h
@@ -119,11 +119,13 @@ enum iwl_ucode_tlv_flag {
119/** 119/**
120 * enum iwl_ucode_tlv_api - ucode api 120 * enum iwl_ucode_tlv_api - ucode api
121 * @IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID: wowlan config includes tid field. 121 * @IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID: wowlan config includes tid field.
122 * @IWL_UCODE_TLV_CAPA_EXTENDED_BEACON: Support Extended beacon notification
122 * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. 123 * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA.
123 * @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit. 124 * @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit.
124 */ 125 */
125enum iwl_ucode_tlv_api { 126enum iwl_ucode_tlv_api {
126 IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), 127 IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0),
128 IWL_UCODE_TLV_CAPA_EXTENDED_BEACON = BIT(1),
127 IWL_UCODE_TLV_API_CSA_FLOW = BIT(4), 129 IWL_UCODE_TLV_API_CSA_FLOW = BIT(4),
128 IWL_UCODE_TLV_API_DISABLE_STA_TX = BIT(5), 130 IWL_UCODE_TLV_API_DISABLE_STA_TX = BIT(5),
129}; 131};
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h
index 6cc5f52b807f..bdd6ff648626 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h
@@ -549,6 +549,20 @@ struct iwl_beacon_notif {
549} __packed; 549} __packed;
550 550
551/** 551/**
552 * struct iwl_extended_beacon_notif - notifies about beacon transmission
553 * @beacon_notify_hdr: tx response command associated with the beacon
554 * @tsf: last beacon tsf
555 * @ibss_mgr_status: whether IBSS is manager
556 * @gp2: last beacon time in gp2
557 */
558struct iwl_extended_beacon_notif {
559 struct iwl_mvm_tx_resp beacon_notify_hdr;
560 __le64 tsf;
561 __le32 ibss_mgr_status;
562 __le32 gp2;
563} __packed; /* BEACON_NTFY_API_S_VER_5 */
564
565/**
552 * enum iwl_dump_control - dump (flush) control flags 566 * enum iwl_dump_control - dump (flush) control flags
553 * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty 567 * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty
554 * and the TFD queues are empty. 568 * and the TFD queues are empty.
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
index 8b5302777632..3b0390b8639c 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
@@ -1205,19 +1205,31 @@ int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,
1205 struct iwl_device_cmd *cmd) 1205 struct iwl_device_cmd *cmd)
1206{ 1206{
1207 struct iwl_rx_packet *pkt = rxb_addr(rxb); 1207 struct iwl_rx_packet *pkt = rxb_addr(rxb);
1208 struct iwl_beacon_notif *beacon = (void *)pkt->data; 1208 struct iwl_mvm_tx_resp *beacon_notify_hdr;
1209 u16 status __maybe_unused = 1209 u64 tsf;
1210 le16_to_cpu(beacon->beacon_notify_hdr.status.status);
1211 u32 rate __maybe_unused =
1212 le32_to_cpu(beacon->beacon_notify_hdr.initial_rate);
1213 1210
1214 lockdep_assert_held(&mvm->mutex); 1211 lockdep_assert_held(&mvm->mutex);
1215 1212
1216 IWL_DEBUG_RX(mvm, "beacon status %#x retries:%d tsf:0x%16llX rate:%d\n", 1213 if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_CAPA_EXTENDED_BEACON) {
1217 status & TX_STATUS_MSK, 1214 struct iwl_extended_beacon_notif *beacon = (void *)pkt->data;
1218 beacon->beacon_notify_hdr.failure_frame, 1215
1219 le64_to_cpu(beacon->tsf), 1216 beacon_notify_hdr = &beacon->beacon_notify_hdr;
1220 rate); 1217 tsf = le64_to_cpu(beacon->tsf);
1218 mvm->ap_last_beacon_gp2 = le32_to_cpu(beacon->gp2);
1219 } else {
1220 struct iwl_beacon_notif *beacon = (void *)pkt->data;
1221
1222 beacon_notify_hdr = &beacon->beacon_notify_hdr;
1223 tsf = le64_to_cpu(beacon->tsf);
1224 }
1225
1226 IWL_DEBUG_RX(mvm,
1227 "beacon status %#x retries:%d tsf:0x%16llX gp2:0x%X rate:%d\n",
1228 le16_to_cpu(beacon_notify_hdr->status.status) &
1229 TX_STATUS_MSK,
1230 beacon_notify_hdr->failure_frame, tsf,
1231 mvm->ap_last_beacon_gp2,
1232 le32_to_cpu(beacon_notify_hdr->initial_rate));
1221 1233
1222 if (unlikely(mvm->csa_vif && mvm->csa_vif->csa_active)) { 1234 if (unlikely(mvm->csa_vif && mvm->csa_vif->csa_active)) {
1223 if (!ieee80211_csa_is_complete(mvm->csa_vif)) { 1235 if (!ieee80211_csa_is_complete(mvm->csa_vif)) {
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index f22be88c0387..f2fde3649139 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -1465,6 +1465,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
1465 mutex_lock(&mvm->mutex); 1465 mutex_lock(&mvm->mutex);
1466 1466
1467 mvmvif->ap_ibss_active = false; 1467 mvmvif->ap_ibss_active = false;
1468 mvm->ap_last_beacon_gp2 = 0;
1468 1469
1469 iwl_mvm_bt_coex_vif_change(mvm); 1470 iwl_mvm_bt_coex_vif_change(mvm);
1470 1471
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 8419840d4701..da692582d502 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -658,6 +658,9 @@ struct iwl_mvm {
658 bool ps_disabled; 658 bool ps_disabled;
659 659
660 struct ieee80211_vif *csa_vif; 660 struct ieee80211_vif *csa_vif;
661
662 /* system time of last beacon (for AP/GO interface) */
663 u32 ap_last_beacon_gp2;
661}; 664};
662 665
663/* Extract MVM priv from op_mode and _hw */ 666/* Extract MVM priv from op_mode and _hw */