aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2016-03-30 08:05:56 -0400
committerLuca Coelho <luciano.coelho@intel.com>2016-05-10 15:14:51 -0400
commit16e4dd8faa9e5de9dd956a18c0f19d911a97ef79 (patch)
treec0669b448196e2d818763d8cc9ac1e53968a8ae3 /drivers/net/wireless/intel/iwlwifi/mvm
parent43ec72b75a8851b48e561c29f49586cc747bdad8 (diff)
iwlwifi: mvm: add a new mvm reference type for RX data
When a data packet is received, we need to make sure that we stay awake until it can be processed and wait a while before trying to enter runtime_suspend os system_suspend again. To do so, add a new reference type for RX data and take the reference when sending the packet to mac80211. We only do this for data packets, all the other RX packets sent by the firmware (e.g. notifications) are not a reason to prevent suspend. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/rx.c15
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 513a85403924..406cf1cb945c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1310,6 +1310,7 @@ static ssize_t iwl_dbgfs_d0i3_refs_read(struct file *file,
1310 PRINT_MVM_REF(IWL_MVM_REF_FW_DBG_COLLECT); 1310 PRINT_MVM_REF(IWL_MVM_REF_FW_DBG_COLLECT);
1311 PRINT_MVM_REF(IWL_MVM_REF_INIT_UCODE); 1311 PRINT_MVM_REF(IWL_MVM_REF_INIT_UCODE);
1312 PRINT_MVM_REF(IWL_MVM_REF_SENDING_CMD); 1312 PRINT_MVM_REF(IWL_MVM_REF_SENDING_CMD);
1313 PRINT_MVM_REF(IWL_MVM_REF_RX);
1313 1314
1314 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1315 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1315} 1316}
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 23d7539edf17..820f8d661e15 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -302,6 +302,7 @@ enum iwl_mvm_ref_type {
302 IWL_MVM_REF_FW_DBG_COLLECT, 302 IWL_MVM_REF_FW_DBG_COLLECT,
303 IWL_MVM_REF_INIT_UCODE, 303 IWL_MVM_REF_INIT_UCODE,
304 IWL_MVM_REF_SENDING_CMD, 304 IWL_MVM_REF_SENDING_CMD,
305 IWL_MVM_REF_RX,
305 306
306 /* update debugfs.c when changing this */ 307 /* update debugfs.c when changing this */
307 308
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
index 58e7e4feed3a..ab7f7eda9c13 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
@@ -272,6 +272,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
272 u32 rate_n_flags; 272 u32 rate_n_flags;
273 u32 rx_pkt_status; 273 u32 rx_pkt_status;
274 u8 crypt_len = 0; 274 u8 crypt_len = 0;
275 bool take_ref;
275 276
276 phy_info = &mvm->last_phy_info; 277 phy_info = &mvm->last_phy_info;
277 rx_res = (struct iwl_rx_mpdu_res_start *)pkt->data; 278 rx_res = (struct iwl_rx_mpdu_res_start *)pkt->data;
@@ -458,8 +459,22 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
458 ieee80211_is_probe_resp(hdr->frame_control))) 459 ieee80211_is_probe_resp(hdr->frame_control)))
459 rx_status->boottime_ns = ktime_get_boot_ns(); 460 rx_status->boottime_ns = ktime_get_boot_ns();
460 461
462 /* Take a reference briefly to kick off a d0i3 entry delay so
463 * we can handle bursts of RX packets without toggling the
464 * state too often. But don't do this for beacons if we are
465 * going to idle because the beacon filtering changes we make
466 * cause the firmware to send us collateral beacons. */
467 take_ref = !(test_bit(STATUS_TRANS_GOING_IDLE, &mvm->trans->status) &&
468 ieee80211_is_beacon(hdr->frame_control));
469
470 if (take_ref)
471 iwl_mvm_ref(mvm, IWL_MVM_REF_RX);
472
461 iwl_mvm_pass_packet_to_mac80211(mvm, sta, napi, skb, hdr, len, 473 iwl_mvm_pass_packet_to_mac80211(mvm, sta, napi, skb, hdr, len,
462 ampdu_status, crypt_len, rxb); 474 ampdu_status, crypt_len, rxb);
475
476 if (take_ref)
477 iwl_mvm_unref(mvm, IWL_MVM_REF_RX);
463} 478}
464 479
465static void iwl_mvm_update_rx_statistics(struct iwl_mvm *mvm, 480static void iwl_mvm_update_rx_statistics(struct iwl_mvm *mvm,