Lines Matching refs:mvm

76 iwl_mvm_bar_check_trigger(struct iwl_mvm *mvm, const u8 *addr,  in iwl_mvm_bar_check_trigger()  argument
82 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, NULL, FW_DBG_TRIGGER_BA); in iwl_mvm_bar_check_trigger()
91 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_bar_check_trigger()
99 static u16 iwl_mvm_tx_csum(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_tx_csum() argument
116 if (WARN_ONCE(!(mvm->hw->netdev_features & IWL_TX_CSUM_NETIF_FLAGS) || in iwl_mvm_tx_csum()
186 if (!iwl_mvm_has_new_tx_api(mvm) && info->control.hw_key && in iwl_mvm_tx_csum()
201 void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_set_tx_cmd() argument
241 iwl_mvm_bar_check_trigger(mvm, bar->ra, tx_cmd->tid_tspec, in iwl_mvm_set_tx_cmd()
261 tx_flags |= iwl_mvm_bt_coex_tx_prio(mvm, hdr, info, ac) << in iwl_mvm_set_tx_cmd()
282 if (ieee80211_is_data(fc) && len > mvm->rts_threshold && in iwl_mvm_set_tx_cmd()
286 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_set_tx_cmd()
303 cpu_to_le16(iwl_mvm_tx_csum(mvm, skb, hdr, info, in iwl_mvm_set_tx_cmd()
307 static u32 iwl_mvm_get_tx_ant(struct iwl_mvm *mvm, in iwl_mvm_get_tx_ant() argument
312 !iwl_mvm_bt_coex_is_shared_ant_avail(mvm)) in iwl_mvm_get_tx_ant()
313 return mvm->cfg->non_shared_ant << RATE_MCS_ANT_POS; in iwl_mvm_get_tx_ant()
321 return BIT(mvm->mgmt_last_antenna_idx) << RATE_MCS_ANT_POS; in iwl_mvm_get_tx_ant()
324 static u32 iwl_mvm_get_tx_rate(struct iwl_mvm *mvm, in iwl_mvm_get_tx_rate() argument
342 &mvm->nvm_data->bands[info->band], sta); in iwl_mvm_get_tx_rate()
361 static u32 iwl_mvm_get_tx_rate_n_flags(struct iwl_mvm *mvm, in iwl_mvm_get_tx_rate_n_flags() argument
365 return iwl_mvm_get_tx_rate(mvm, info, sta) | in iwl_mvm_get_tx_rate_n_flags()
366 iwl_mvm_get_tx_ant(mvm, info, sta, fc); in iwl_mvm_get_tx_rate_n_flags()
372 void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd, in iwl_mvm_set_tx_cmd_rate() argument
410 cpu_to_le32(iwl_mvm_get_tx_rate_n_flags(mvm, info, sta, fc)); in iwl_mvm_set_tx_cmd_rate()
433 static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm, in iwl_mvm_set_tx_cmd_crypto() argument
491 iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_set_tx_params() argument
499 dev_cmd = iwl_trans_alloc_tx_cmd(mvm->trans); in iwl_mvm_set_tx_params()
511 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_set_tx_params()
525 offload_assist = iwl_mvm_tx_csum(mvm, skb, hdr, info, in iwl_mvm_set_tx_params()
545 iwl_mvm_get_tx_rate_n_flags(mvm, info, sta, in iwl_mvm_set_tx_params()
549 if (mvm->trans->trans_cfg->device_family >= in iwl_mvm_set_tx_params()
583 iwl_mvm_set_tx_cmd_crypto(mvm, info, tx_cmd, skb, hdrlen); in iwl_mvm_set_tx_params()
585 iwl_mvm_set_tx_cmd(mvm, skb, tx_cmd, info, sta_id); in iwl_mvm_set_tx_params()
587 iwl_mvm_set_tx_cmd_rate(mvm, tx_cmd, info, sta, hdr->frame_control); in iwl_mvm_set_tx_params()
607 static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, in iwl_mvm_get_ctrl_vif_queue() argument
631 return mvm->probe_queue; in iwl_mvm_get_ctrl_vif_queue()
639 return mvm->probe_queue; in iwl_mvm_get_ctrl_vif_queue()
642 return mvm->p2p_dev_queue; in iwl_mvm_get_ctrl_vif_queue()
645 return mvm->p2p_dev_queue; in iwl_mvm_get_ctrl_vif_queue()
652 static void iwl_mvm_probe_resp_set_noa(struct iwl_mvm *mvm, in iwl_mvm_probe_resp_set_noa() argument
683 IWL_DEBUG_TX(mvm, "probe resp doesn't have P2P IE\n"); in iwl_mvm_probe_resp_set_noa()
689 IWL_ERR(mvm, in iwl_mvm_probe_resp_set_noa()
712 int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb) in iwl_mvm_tx_skb_non_sta() argument
747 queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, hdr); in iwl_mvm_tx_skb_non_sta()
749 queue = mvm->snif_queue; in iwl_mvm_tx_skb_non_sta()
750 sta_id = mvm->snif_sta.sta_id; in iwl_mvm_tx_skb_non_sta()
761 sta_id = mvm->aux_sta.sta_id; in iwl_mvm_tx_skb_non_sta()
762 queue = mvm->aux_queue; in iwl_mvm_tx_skb_non_sta()
767 IWL_ERR(mvm, "No queue was found. Dropping TX\n"); in iwl_mvm_tx_skb_non_sta()
772 iwl_mvm_probe_resp_set_noa(mvm, skb); in iwl_mvm_tx_skb_non_sta()
774 IWL_DEBUG_TX(mvm, "station Id %d, queue=%d\n", sta_id, queue); in iwl_mvm_tx_skb_non_sta()
776 dev_cmd = iwl_mvm_set_tx_params(mvm, skb, &info, hdrlen, NULL, sta_id); in iwl_mvm_tx_skb_non_sta()
783 if (iwl_trans_tx(mvm->trans, skb, dev_cmd, queue)) { in iwl_mvm_tx_skb_non_sta()
784 iwl_trans_free_tx_cmd(mvm->trans, dev_cmd); in iwl_mvm_tx_skb_non_sta()
791 unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, in iwl_mvm_max_amsdu_size() argument
800 if (iwl_mvm_is_cdb_supported(mvm) && in iwl_mvm_max_amsdu_size()
805 if (sta->he_cap.has_he && !WARN_ON(!iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_max_amsdu_size()
808 txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac); in iwl_mvm_max_amsdu_size()
817 mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] - 256); in iwl_mvm_max_amsdu_size()
890 static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_tx_tso() argument
938 max_amsdu_len = iwl_mvm_max_amsdu_size(mvm, sta, tid); in iwl_mvm_tx_tso()
973 mvm->trans->max_skb_frags) in iwl_mvm_tx_tso()
993 static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_tx_tso() argument
1006 static bool iwl_mvm_txq_should_update(struct iwl_mvm *mvm, int txq_id) in iwl_mvm_txq_should_update() argument
1008 unsigned long queue_tid_bitmap = mvm->queue_info[txq_id].tid_bitmap; in iwl_mvm_txq_should_update()
1012 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) in iwl_mvm_txq_should_update()
1016 if (time_before(mvm->queue_info[txq_id].last_frame_time[tid] + in iwl_mvm_txq_should_update()
1024 static void iwl_mvm_tx_airtime(struct iwl_mvm *mvm, in iwl_mvm_tx_airtime() argument
1034 mdata = &mvm->tcm.data[mac]; in iwl_mvm_tx_airtime()
1036 if (mvm->tcm.paused) in iwl_mvm_tx_airtime()
1039 if (time_after(jiffies, mvm->tcm.ts + MVM_TCM_PERIOD)) in iwl_mvm_tx_airtime()
1040 schedule_delayed_work(&mvm->tcm.work, 0); in iwl_mvm_tx_airtime()
1045 static int iwl_mvm_tx_pkt_queued(struct iwl_mvm *mvm, in iwl_mvm_tx_pkt_queued() argument
1055 mdata = &mvm->tcm.data[mac]; in iwl_mvm_tx_pkt_queued()
1067 static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_tx_mpdu() argument
1095 iwl_mvm_probe_resp_set_noa(mvm, skb); in iwl_mvm_tx_mpdu()
1097 dev_cmd = iwl_mvm_set_tx_params(mvm, skb, info, hdrlen, in iwl_mvm_tx_mpdu()
1130 if (!iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_tx_mpdu()
1147 iwl_trans_free_tx_cmd(mvm->trans, dev_cmd); in iwl_mvm_tx_mpdu()
1152 if (!iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_tx_mpdu()
1154 mvm->queue_info[txq_id].last_frame_time[tid] = jiffies; in iwl_mvm_tx_mpdu()
1166 if (unlikely(mvm->queue_info[txq_id].status == in iwl_mvm_tx_mpdu()
1168 iwl_mvm_txq_should_update(mvm, txq_id))) in iwl_mvm_tx_mpdu()
1169 schedule_work(&mvm->add_stream_wk); in iwl_mvm_tx_mpdu()
1172 IWL_DEBUG_TX(mvm, "TX to [%d|%d] Q:%d - seq: 0x%x len %d\n", in iwl_mvm_tx_mpdu()
1179 if (iwl_trans_tx(mvm->trans, skb, dev_cmd, txq_id)) in iwl_mvm_tx_mpdu()
1187 if (iwl_mvm_tx_pkt_queued(mvm, mvmsta, in iwl_mvm_tx_mpdu()
1194 iwl_trans_free_tx_cmd(mvm->trans, dev_cmd); in iwl_mvm_tx_mpdu()
1197 IWL_DEBUG_TX(mvm, "TX to [%d|%d] dropped\n", mvmsta->sta_id, tid); in iwl_mvm_tx_mpdu()
1201 int iwl_mvm_tx_skb(struct iwl_mvm *mvm, struct sk_buff *skb, in iwl_mvm_tx_skb() argument
1219 return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); in iwl_mvm_tx_skb()
1225 return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); in iwl_mvm_tx_skb()
1229 ret = iwl_mvm_tx_tso(mvm, skb, &info, sta, &mpdus_skbs); in iwl_mvm_tx_skb()
1239 ret = iwl_mvm_tx_mpdu(mvm, skb, &info, sta); in iwl_mvm_tx_skb()
1249 static void iwl_mvm_check_ratid_empty(struct iwl_mvm *mvm, in iwl_mvm_check_ratid_empty() argument
1261 iwl_mvm_tid_queued(mvm, tid_data) == 0) { in iwl_mvm_check_ratid_empty()
1275 if (mvm->trans->trans_cfg->gen2) in iwl_mvm_check_ratid_empty()
1283 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_check_ratid_empty()
1291 IWL_DEBUG_TX_QUEUES(mvm, in iwl_mvm_check_ratid_empty()
1392 static void iwl_mvm_tx_status_check_trigger(struct iwl_mvm *mvm, in iwl_mvm_tx_status_check_trigger() argument
1399 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, NULL, in iwl_mvm_tx_status_check_trigger()
1414 iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, in iwl_mvm_tx_status_check_trigger()
1434 static inline u32 iwl_mvm_get_scd_ssn(struct iwl_mvm *mvm, in iwl_mvm_get_scd_ssn() argument
1437 return le32_to_cpup((__le32 *)iwl_mvm_get_agg_status(mvm, tx_resp) + in iwl_mvm_get_scd_ssn()
1441 static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, in iwl_mvm_rx_tx_cmd_single() argument
1452 iwl_mvm_get_agg_status(mvm, tx_resp); in iwl_mvm_rx_tx_cmd_single()
1454 u16 ssn = iwl_mvm_get_scd_ssn(mvm, tx_resp); in iwl_mvm_rx_tx_cmd_single()
1463 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_rx_tx_cmd_single()
1469 iwl_trans_reclaim(mvm->trans, txq_id, ssn, &skbs); in iwl_mvm_rx_tx_cmd_single()
1479 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); in iwl_mvm_rx_tx_cmd_single()
1506 iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx); in iwl_mvm_rx_tx_cmd_single()
1516 iwl_mvm_tx_status_check_trigger(mvm, status); in iwl_mvm_rx_tx_cmd_single()
1562 ieee80211_tx_status(mvm->hw, skb); in iwl_mvm_rx_tx_cmd_single()
1581 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_tx_cmd_single()
1585 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_tx_cmd_single()
1593 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_rx_tx_cmd_single()
1604 iwl_mvm_tx_airtime(mvm, mvmsta, in iwl_mvm_rx_tx_cmd_single()
1609 iwl_mvm_toggle_tx_ant(mvm, &mvmsta->tx_ant); in iwl_mvm_rx_tx_cmd_single()
1620 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_tx_cmd_single()
1624 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_tx_cmd_single()
1628 iwl_mvm_check_ratid_empty(mvm, sta, tid); in iwl_mvm_rx_tx_cmd_single()
1633 !iwl_mvm_tid_queued(mvm, tid_data)) { in iwl_mvm_rx_tx_cmd_single()
1653 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, in iwl_mvm_rx_tx_cmd_single()
1693 static void iwl_mvm_rx_tx_cmd_agg_dbg(struct iwl_mvm *mvm, in iwl_mvm_rx_tx_cmd_agg_dbg() argument
1698 iwl_mvm_get_agg_status(mvm, tx_resp); in iwl_mvm_rx_tx_cmd_agg_dbg()
1704 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_tx_cmd_agg_dbg()
1714 static void iwl_mvm_rx_tx_cmd_agg_dbg(struct iwl_mvm *mvm, in iwl_mvm_rx_tx_cmd_agg_dbg() argument
1719 static void iwl_mvm_rx_tx_cmd_agg(struct iwl_mvm *mvm, in iwl_mvm_rx_tx_cmd_agg() argument
1734 iwl_mvm_rx_tx_cmd_agg_dbg(mvm, pkt); in iwl_mvm_rx_tx_cmd_agg()
1738 mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id); in iwl_mvm_rx_tx_cmd_agg()
1740 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_rx_tx_cmd_agg()
1753 iwl_mvm_tx_airtime(mvm, mvmsta, in iwl_mvm_rx_tx_cmd_agg()
1760 void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) in iwl_mvm_rx_tx_cmd() argument
1766 iwl_mvm_rx_tx_cmd_single(mvm, pkt); in iwl_mvm_rx_tx_cmd()
1768 iwl_mvm_rx_tx_cmd_agg(mvm, pkt); in iwl_mvm_rx_tx_cmd()
1771 static void iwl_mvm_tx_reclaim(struct iwl_mvm *mvm, int sta_id, int tid, in iwl_mvm_tx_reclaim() argument
1789 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_tx_reclaim()
1801 IWL_ERR(mvm, in iwl_mvm_tx_reclaim()
1815 iwl_trans_reclaim(mvm->trans, txq, index, &reclaimed_skbs); in iwl_mvm_tx_reclaim()
1821 iwl_mvm_check_ratid_empty(mvm, sta, tid); in iwl_mvm_tx_reclaim()
1840 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); in iwl_mvm_tx_reclaim()
1878 if (!iwl_mvm_has_tlc_offload(mvm)) { in iwl_mvm_tx_reclaim()
1879 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_tx_reclaim()
1881 iwl_mvm_rs_tx_status(mvm, sta, tid, ba_info, false); in iwl_mvm_tx_reclaim()
1890 ieee80211_tx_status(mvm->hw, skb); in iwl_mvm_tx_reclaim()
1894 void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) in iwl_mvm_rx_ba_notif() argument
1905 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_mvm_rx_ba_notif()
1924 mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id); in iwl_mvm_rx_ba_notif()
1938 iwl_mvm_tx_reclaim(mvm, sta_id, tid, in iwl_mvm_rx_ba_notif()
1945 iwl_mvm_tx_airtime(mvm, mvmsta, in iwl_mvm_rx_ba_notif()
1950 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_ba_notif()
1968 mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id); in iwl_mvm_rx_ba_notif()
1984 iwl_mvm_tx_reclaim(mvm, sta_id, tid, txq, index, &ba_info, in iwl_mvm_rx_ba_notif()
1987 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_ba_notif()
1991 IWL_DEBUG_TX_REPLY(mvm, in iwl_mvm_rx_ba_notif()
1997 IWL_DEBUG_TX_REPLY(mvm, "reduced txp from ba notif %d\n", in iwl_mvm_rx_ba_notif()
2009 int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, u32 flags) in iwl_mvm_flush_tx_path() argument
2017 WARN_ON(iwl_mvm_has_new_tx_api(mvm)); in iwl_mvm_flush_tx_path()
2019 ret = iwl_mvm_send_cmd_pdu(mvm, TXPATH_FLUSH, flags, in iwl_mvm_flush_tx_path()
2022 IWL_ERR(mvm, "Failed to send flush command (%d)\n", ret); in iwl_mvm_flush_tx_path()
2026 int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, in iwl_mvm_flush_sta_tids() argument
2035 WARN_ON(!iwl_mvm_has_new_tx_api(mvm)); in iwl_mvm_flush_sta_tids()
2037 ret = iwl_mvm_send_cmd_pdu(mvm, TXPATH_FLUSH, flags, in iwl_mvm_flush_sta_tids()
2040 IWL_ERR(mvm, "Failed to send flush command (%d)\n", ret); in iwl_mvm_flush_sta_tids()
2044 int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal, u32 flags) in iwl_mvm_flush_sta() argument
2052 if (iwl_mvm_has_new_tx_api(mvm)) in iwl_mvm_flush_sta()
2053 return iwl_mvm_flush_sta_tids(mvm, mvm_sta->sta_id, in iwl_mvm_flush_sta()
2057 return iwl_mvm_flush_tx_path(mvm, int_sta->tfd_queue_msk, in iwl_mvm_flush_sta()
2060 return iwl_mvm_flush_tx_path(mvm, mvm_sta->tfd_queue_msk, flags); in iwl_mvm_flush_sta()