mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
wireless-next patches for v6.12
The last -next "new features" pull request for v6.12. The stack now supports DFS on MLO but otherwise nothing really standing out. Major changes: cfg80211/mac80211 * EHT rate support in AQL airtime * DFS support for MLO rtw89 * complete BT-coexistence code for RTL8852BT * RTL8922A WoWLAN net-detect support -----BEGIN PGP SIGNATURE----- iQFFBAABCgAvFiEEiBjanGPFTz4PRfLobhckVSbrbZsFAmbhVykRHGt2YWxvQGtl cm5lbC5vcmcACgkQbhckVSbrbZtxgAf+J9om4LIpVd6hNT/hlkLf0jOlIkoOmbYT 16+g/dYRher0HJUMO/gcmubBO8dPmxopQEkR7XvkEqV72EAYcaDcios94cj0Uv1F GbnixnO3VvCOE86PoOruM+WHT6ct9+ECWB6yODnF7Pps+WNrzhVTfmXm4j8vWnFH KyHD/Hy4VsPDzj0EmzAC4ppkLMWfWypDbP4PBIOq9s+Oj6gJ671amWjmgFou+o9K yOtNTBiBaVuBrkv5sJTbQIDkAvK2V9im2VTjrZej2a/3wm6+z3XM28tWbcsYJEyS U2ZpHkS6QXlNaL4B8lDc6OP/c/xwM1CkzZsKe9p3T6iRemA0WLWaSg== =gaJv -----END PGP SIGNATURE----- Merge tag 'wireless-next-2024-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.12 The last -next "new features" pull request for v6.12. The stack now supports DFS on MLO but otherwise nothing really standing out. Major changes: cfg80211/mac80211 * EHT rate support in AQL airtime * DFS support for MLO rtw89 * complete BT-coexistence code for RTL8852BT * RTL8922A WoWLAN net-detect support * tag 'wireless-next-2024-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (105 commits) wifi: brcmfmac: cfg80211: Convert comma to semicolon wifi: rsi: Remove an unused field in struct rsi_debugfs wifi: libertas: Cleanup unused declarations wifi: wilc1000: Convert using devm_clk_get_optional_enabled() in wilc_bus_probe() wifi: wilc1000: Convert using devm_clk_get_optional_enabled() in wilc_sdio_probe() wifi: wilc1000: fix potential RCU dereference issue in wilc_parse_join_bss_param wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_cmd_802_11_scan_ext() wifi: mac80211: use two-phase skb reclamation in ieee80211_do_stop() wifi: cfg80211: fix two more possible UBSAN-detected off-by-one errors wifi: cfg80211: fix kernel-doc for per-link data wifi: mt76: mt7925: replace chan config with extend txpower config for clc wifi: mt76: mt7925: fix a potential array-index-out-of-bounds issue for clc wifi: mt76: mt7615: check devm_kasprintf() returned value wifi: mt76: mt7925: convert comma to semicolon wifi: mt76: mt7925: fix a potential association failure upon resuming wifi: mt76: Avoid multiple -Wflex-array-member-not-at-end warnings wifi: mt76: mt7921: Check devm_kasprintf() returned value wifi: mt76: mt7915: check devm_kasprintf() returned value wifi: mt76: mt7915: avoid long MCU command timeouts during SER wifi: mt76: mt7996: fix uninitialized TLV data ... ==================== Link: https://patch.msgid.link/20240911084147.A205DC4AF0F@smtp.kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
a18c097eda
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2005-2011 Atheros Communications Inc.
|
||||
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
|
||||
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@ -1774,7 +1774,7 @@ static ssize_t ath10k_write_simulate_radar(struct file *file,
|
||||
if (!arvif->is_started)
|
||||
return -EINVAL;
|
||||
|
||||
ieee80211_radar_detected(ar->hw);
|
||||
ieee80211_radar_detected(ar->hw, NULL);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -1437,7 +1437,7 @@ static void ath10k_recalc_radar_detection(struct ath10k *ar)
|
||||
* by indicating that radar was detected.
|
||||
*/
|
||||
ath10k_warn(ar, "failed to start CAC: %d\n", ret);
|
||||
ieee80211_radar_detected(ar->hw);
|
||||
ieee80211_radar_detected(ar->hw, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3990,7 +3990,7 @@ static void ath10k_radar_detected(struct ath10k *ar)
|
||||
if (ar->dfs_block_radar_events)
|
||||
ath10k_info(ar, "DFS Radar detected, but ignored as requested\n");
|
||||
else
|
||||
ieee80211_radar_detected(ar->hw);
|
||||
ieee80211_radar_detected(ar->hw, NULL);
|
||||
}
|
||||
|
||||
static void ath10k_radar_confirmation_work(struct work_struct *work)
|
||||
|
@ -407,11 +407,17 @@ struct ath11k_vif {
|
||||
bool wpaie_present;
|
||||
bool bcca_zero_sent;
|
||||
bool do_not_send_tmpl;
|
||||
struct ieee80211_chanctx_conf chanctx;
|
||||
struct ath11k_arp_ns_offload arp_ns_offload;
|
||||
struct ath11k_rekey_data rekey_data;
|
||||
|
||||
struct ath11k_reg_tpc_power_info reg_tpc_info;
|
||||
|
||||
/* Must be last - ends in a flexible-array member.
|
||||
*
|
||||
* FIXME: Driver should not copy struct ieee80211_chanctx_conf,
|
||||
* especially because it has a flexible array. Find a better way.
|
||||
*/
|
||||
struct ieee80211_chanctx_conf chanctx;
|
||||
};
|
||||
|
||||
struct ath11k_vif_iter {
|
||||
|
@ -1305,18 +1305,6 @@ struct htt_ppdu_stats_user_rate {
|
||||
#define HTT_TX_INFO_PEERID(_flags) \
|
||||
FIELD_GET(HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M, _flags)
|
||||
|
||||
struct htt_tx_ppdu_stats_info {
|
||||
struct htt_tlv tlv_hdr;
|
||||
u32 tx_success_bytes;
|
||||
u32 tx_retry_bytes;
|
||||
u32 tx_failed_bytes;
|
||||
u32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
|
||||
u16 tx_success_msdus;
|
||||
u16 tx_retry_msdus;
|
||||
u16 tx_failed_msdus;
|
||||
u16 tx_duration; /* united in us */
|
||||
} __packed;
|
||||
|
||||
enum htt_ppdu_stats_usr_compln_status {
|
||||
HTT_PPDU_STATS_USER_STATUS_OK,
|
||||
HTT_PPDU_STATS_USER_STATUS_FILTERED,
|
||||
@ -1364,17 +1352,6 @@ struct htt_ppdu_stats_usr_cmpltn_ack_ba_status {
|
||||
u32 success_bytes;
|
||||
} __packed;
|
||||
|
||||
struct htt_ppdu_stats_usr_cmn_array {
|
||||
struct htt_tlv tlv_hdr;
|
||||
u32 num_ppdu_stats;
|
||||
/* tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
|
||||
* elements.
|
||||
* tx_ppdu_stats_info is variable length, with length =
|
||||
* number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
|
||||
*/
|
||||
struct htt_tx_ppdu_stats_info tx_ppdu_info[];
|
||||
} __packed;
|
||||
|
||||
struct htt_ppdu_user_stats {
|
||||
u16 peer_id;
|
||||
u32 tlv_flags;
|
||||
|
@ -8358,7 +8358,7 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff
|
||||
if (ar->dfs_block_radar_events)
|
||||
ath11k_info(ab, "DFS Radar detected, but ignored as requested\n");
|
||||
else
|
||||
ieee80211_radar_detected(ar->hw);
|
||||
ieee80211_radar_detected(ar->hw, NULL);
|
||||
|
||||
exit:
|
||||
rcu_read_unlock();
|
||||
|
@ -287,7 +287,6 @@ struct ath12k_vif {
|
||||
int txpower;
|
||||
bool rsnie_present;
|
||||
bool wpaie_present;
|
||||
struct ieee80211_chanctx_conf chanctx;
|
||||
u32 key_cipher;
|
||||
u8 tx_encap_type;
|
||||
u8 vdev_stats_id;
|
||||
@ -295,6 +294,13 @@ struct ath12k_vif {
|
||||
bool ps;
|
||||
struct ath12k_vif_cache *cache;
|
||||
struct ath12k_rekey_data rekey_data;
|
||||
|
||||
/* Must be last - ends in a flexible-array member.
|
||||
*
|
||||
* FIXME: Driver should not copy struct ieee80211_chanctx_conf,
|
||||
* especially because it has a flexible array. Find a better way.
|
||||
*/
|
||||
struct ieee80211_chanctx_conf chanctx;
|
||||
};
|
||||
|
||||
struct ath12k_vif_iter {
|
||||
|
@ -1495,18 +1495,6 @@ struct htt_ppdu_stats_user_rate {
|
||||
#define HTT_TX_INFO_PEERID(_flags) \
|
||||
u32_get_bits(_flags, HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M)
|
||||
|
||||
struct htt_tx_ppdu_stats_info {
|
||||
struct htt_tlv tlv_hdr;
|
||||
__le32 tx_success_bytes;
|
||||
__le32 tx_retry_bytes;
|
||||
__le32 tx_failed_bytes;
|
||||
__le32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
|
||||
__le16 tx_success_msdus;
|
||||
__le16 tx_retry_msdus;
|
||||
__le16 tx_failed_msdus;
|
||||
__le16 tx_duration; /* united in us */
|
||||
} __packed;
|
||||
|
||||
enum htt_ppdu_stats_usr_compln_status {
|
||||
HTT_PPDU_STATS_USER_STATUS_OK,
|
||||
HTT_PPDU_STATS_USER_STATUS_FILTERED,
|
||||
|
@ -3663,7 +3663,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
|
||||
struct ath12k *ar, *prev_ar;
|
||||
struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
|
||||
struct cfg80211_scan_request *req = &hw_req->req;
|
||||
struct ath12k_wmi_scan_req_arg arg = {};
|
||||
struct ath12k_wmi_scan_req_arg *arg = NULL;
|
||||
int ret;
|
||||
int i;
|
||||
bool create = true;
|
||||
@ -3745,42 +3745,47 @@ scan:
|
||||
if (ret)
|
||||
goto exit;
|
||||
|
||||
ath12k_wmi_start_scan_init(ar, &arg);
|
||||
arg.vdev_id = arvif->vdev_id;
|
||||
arg.scan_id = ATH12K_SCAN_ID;
|
||||
arg = kzalloc(sizeof(*arg), GFP_KERNEL);
|
||||
if (!arg) {
|
||||
ret = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ath12k_wmi_start_scan_init(ar, arg);
|
||||
arg->vdev_id = arvif->vdev_id;
|
||||
arg->scan_id = ATH12K_SCAN_ID;
|
||||
|
||||
if (req->ie_len) {
|
||||
arg.extraie.ptr = kmemdup(req->ie, req->ie_len, GFP_KERNEL);
|
||||
if (!arg.extraie.ptr) {
|
||||
arg->extraie.ptr = kmemdup(req->ie, req->ie_len, GFP_KERNEL);
|
||||
if (!arg->extraie.ptr) {
|
||||
ret = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
arg.extraie.len = req->ie_len;
|
||||
arg->extraie.len = req->ie_len;
|
||||
}
|
||||
|
||||
if (req->n_ssids) {
|
||||
arg.num_ssids = req->n_ssids;
|
||||
for (i = 0; i < arg.num_ssids; i++)
|
||||
arg.ssid[i] = req->ssids[i];
|
||||
arg->num_ssids = req->n_ssids;
|
||||
for (i = 0; i < arg->num_ssids; i++)
|
||||
arg->ssid[i] = req->ssids[i];
|
||||
} else {
|
||||
arg.scan_f_passive = 1;
|
||||
arg->scan_f_passive = 1;
|
||||
}
|
||||
|
||||
if (req->n_channels) {
|
||||
arg.num_chan = req->n_channels;
|
||||
arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!arg.chan_list) {
|
||||
arg->num_chan = req->n_channels;
|
||||
arg->chan_list = kcalloc(arg->num_chan, sizeof(*arg->chan_list),
|
||||
GFP_KERNEL);
|
||||
if (!arg->chan_list) {
|
||||
ret = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (i = 0; i < arg.num_chan; i++)
|
||||
arg.chan_list[i] = req->channels[i]->center_freq;
|
||||
for (i = 0; i < arg->num_chan; i++)
|
||||
arg->chan_list[i] = req->channels[i]->center_freq;
|
||||
}
|
||||
|
||||
ret = ath12k_start_scan(ar, &arg);
|
||||
ret = ath12k_start_scan(ar, arg);
|
||||
if (ret) {
|
||||
ath12k_warn(ar->ab, "failed to start hw scan: %d\n", ret);
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
@ -3790,14 +3795,15 @@ scan:
|
||||
|
||||
/* Add a margin to account for event/command processing */
|
||||
ieee80211_queue_delayed_work(ath12k_ar_to_hw(ar), &ar->scan.timeout,
|
||||
msecs_to_jiffies(arg.max_scan_time +
|
||||
msecs_to_jiffies(arg->max_scan_time +
|
||||
ATH12K_MAC_SCAN_TIMEOUT_MSECS));
|
||||
|
||||
exit:
|
||||
kfree(arg.chan_list);
|
||||
|
||||
if (req->ie_len)
|
||||
kfree(arg.extraie.ptr);
|
||||
if (arg) {
|
||||
kfree(arg->chan_list);
|
||||
kfree(arg->extraie.ptr);
|
||||
kfree(arg);
|
||||
}
|
||||
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
|
||||
|
@ -6789,7 +6789,7 @@ ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff
|
||||
if (ar->dfs_block_radar_events)
|
||||
ath12k_info(ab, "DFS Radar detected, but ignored as requested\n");
|
||||
else
|
||||
ieee80211_radar_detected(ath12k_ar_to_hw(ar));
|
||||
ieee80211_radar_detected(ath12k_ar_to_hw(ar), NULL);
|
||||
|
||||
exit:
|
||||
rcu_read_unlock();
|
||||
|
@ -280,7 +280,7 @@ ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe)
|
||||
if (!pd->add_pulse(pd, pe, NULL))
|
||||
return;
|
||||
DFS_STAT_INC(sc, radar_detected);
|
||||
ieee80211_radar_detected(sc->hw);
|
||||
ieee80211_radar_detected(sc->hw, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -116,7 +116,7 @@ static ssize_t write_file_simulate_radar(struct file *file,
|
||||
{
|
||||
struct ath_softc *sc = file->private_data;
|
||||
|
||||
ieee80211_radar_detected(sc->hw);
|
||||
ieee80211_radar_detected(sc->hw, NULL);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -716,8 +716,7 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
|
||||
}
|
||||
|
||||
resubmit:
|
||||
skb_reset_tail_pointer(skb);
|
||||
skb_trim(skb, 0);
|
||||
__skb_set_length(skb, 0);
|
||||
|
||||
usb_anchor_urb(urb, &hif_dev->rx_submitted);
|
||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
@ -754,8 +753,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
|
||||
case -ESHUTDOWN:
|
||||
goto free_skb;
|
||||
default:
|
||||
skb_reset_tail_pointer(skb);
|
||||
skb_trim(skb, 0);
|
||||
__skb_set_length(skb, 0);
|
||||
|
||||
goto resubmit;
|
||||
}
|
||||
|
@ -1135,7 +1135,7 @@ static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
|
||||
offset = offsetof(struct brcmf_scan_params_v2_le, channel_list) +
|
||||
n_channels * sizeof(u16);
|
||||
offset = roundup(offset, sizeof(u32));
|
||||
length += sizeof(ssid_le) * n_ssids,
|
||||
length += sizeof(ssid_le) * n_ssids;
|
||||
ptr = (char *)params_le + offset;
|
||||
for (i = 0; i < n_ssids; i++) {
|
||||
memset(&ssid_le, 0, sizeof(ssid_le));
|
||||
|
@ -13,7 +13,7 @@ iwlmvm-y += ptp.o
|
||||
iwlmvm-y += time-sync.o
|
||||
iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o
|
||||
iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o
|
||||
iwlmvm-$(CONFIG_PM) += d3.o
|
||||
iwlmvm-$(CONFIG_PM_SLEEP) += d3.o
|
||||
iwlmvm-$(CONFIG_IWLMEI) += vendor-cmd.o
|
||||
|
||||
subdir-ccflags-y += -I $(src)/../
|
||||
|
@ -1232,7 +1232,7 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm)
|
||||
mvm->nvm_data = NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
/* fast_resume will be cleared by iwl_mvm_fast_resume */
|
||||
fast_resume = mvm->fast_resume;
|
||||
|
||||
@ -1254,7 +1254,7 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm)
|
||||
set_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) {
|
||||
/*
|
||||
|
@ -512,7 +512,7 @@ struct iwl_mvm_vif {
|
||||
bool bf_enabled;
|
||||
bool ba_enabled;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
/* WoWLAN GTK rekey data */
|
||||
struct {
|
||||
u8 kck[NL80211_KCK_EXT_LEN];
|
||||
@ -1178,7 +1178,7 @@ struct iwl_mvm {
|
||||
|
||||
struct ieee80211_vif *p2p_device_vif;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
struct wiphy_wowlan_support wowlan;
|
||||
int gtk_ivlen, gtk_icvlen, ptk_ivlen, ptk_icvlen;
|
||||
|
||||
@ -2306,7 +2306,7 @@ void iwl_mvm_ipv6_addr_change(struct ieee80211_hw *hw,
|
||||
void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif, int idx);
|
||||
extern const struct file_operations iwl_dbgfs_d3_test_ops;
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm,
|
||||
struct ieee80211_vif *vif);
|
||||
void iwl_mvm_fast_suspend(struct iwl_mvm *mvm);
|
||||
|
@ -2155,6 +2155,7 @@ static void iwl_op_mode_mvm_time_point(struct iwl_op_mode *op_mode,
|
||||
iwl_dbg_tlv_time_point(&mvm->fwrt, tp_id, tp_data);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode)
|
||||
{
|
||||
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
|
||||
@ -2163,11 +2164,13 @@ static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode)
|
||||
clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
|
||||
mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
|
||||
iwl_mvm_stop_device(mvm);
|
||||
#ifdef CONFIG_PM
|
||||
mvm->fast_resume = false;
|
||||
#endif
|
||||
mutex_unlock(&mvm->mutex);
|
||||
}
|
||||
#else
|
||||
static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#define IWL_MVM_COMMON_OPS \
|
||||
/* these could be differentiated */ \
|
||||
|
@ -116,11 +116,6 @@ int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
|
||||
int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
|
||||
int8_t p2, int usesnr);
|
||||
|
||||
int lbs_set_data_rate(struct lbs_private *priv, u8 rate);
|
||||
|
||||
int lbs_cmd_802_11_rate_adapt_rateset(struct lbs_private *priv,
|
||||
uint16_t cmd_action);
|
||||
|
||||
int lbs_set_tx_power(struct lbs_private *priv, s16 dbm);
|
||||
|
||||
int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep);
|
||||
|
@ -484,12 +484,9 @@ void lbtf_complete_command(struct lbtf_private *priv, struct cmd_ctrl_node *cmd,
|
||||
void lbtf_cmd_response_rx(struct lbtf_private *priv);
|
||||
|
||||
/* main.c */
|
||||
struct chan_freq_power *lbtf_get_region_cfp_table(u8 region,
|
||||
int *cfp_no);
|
||||
struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev,
|
||||
const struct lbtf_ops *ops);
|
||||
int lbtf_remove_card(struct lbtf_private *priv);
|
||||
int lbtf_start_card(struct lbtf_private *priv);
|
||||
int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb);
|
||||
void lbtf_send_tx_feedback(struct lbtf_private *priv, u8 retrycnt, u8 fail);
|
||||
void lbtf_bcn_sent(struct lbtf_private *priv);
|
||||
|
@ -117,12 +117,12 @@ void mwifiex_dfs_cac_work_queue(struct work_struct *work)
|
||||
dfs_cac_work);
|
||||
|
||||
chandef = priv->dfs_chandef;
|
||||
if (priv->wdev.cac_started) {
|
||||
if (priv->wdev.links[0].cac_started) {
|
||||
mwifiex_dbg(priv->adapter, MSG,
|
||||
"CAC timer finished; No radar detected\n");
|
||||
cfg80211_cac_event(priv->netdev, &chandef,
|
||||
NL80211_RADAR_CAC_FINISHED,
|
||||
GFP_KERNEL);
|
||||
GFP_KERNEL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ int mwifiex_stop_radar_detection(struct mwifiex_private *priv,
|
||||
*/
|
||||
void mwifiex_abort_cac(struct mwifiex_private *priv)
|
||||
{
|
||||
if (priv->wdev.cac_started) {
|
||||
if (priv->wdev.links[0].cac_started) {
|
||||
if (mwifiex_stop_radar_detection(priv, &priv->dfs_chandef))
|
||||
mwifiex_dbg(priv->adapter, ERROR,
|
||||
"failed to stop CAC in FW\n");
|
||||
@ -182,7 +182,8 @@ void mwifiex_abort_cac(struct mwifiex_private *priv)
|
||||
"Aborting delayed work for CAC.\n");
|
||||
cancel_delayed_work_sync(&priv->dfs_cac_work);
|
||||
cfg80211_cac_event(priv->netdev, &priv->dfs_chandef,
|
||||
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
|
||||
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,7 +222,7 @@ int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
|
||||
cfg80211_cac_event(priv->netdev,
|
||||
&priv->dfs_chandef,
|
||||
NL80211_RADAR_DETECTED,
|
||||
GFP_KERNEL);
|
||||
GFP_KERNEL, 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1906,7 +1906,7 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct mwifiex_sta_node *sta_node;
|
||||
u8 deauth_mac[ETH_ALEN];
|
||||
|
||||
if (!priv->bss_started && priv->wdev.cac_started) {
|
||||
if (!priv->bss_started && priv->wdev.links[0].cac_started) {
|
||||
mwifiex_dbg(priv->adapter, INFO, "%s: abort CAC!\n", __func__);
|
||||
mwifiex_abort_cac(priv);
|
||||
}
|
||||
@ -4038,7 +4038,7 @@ mwifiex_cfg80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (priv->wdev.cac_started)
|
||||
if (priv->wdev.links[0].cac_started)
|
||||
return -EBUSY;
|
||||
|
||||
if (cfg80211_chandef_identical(¶ms->chandef,
|
||||
@ -4205,7 +4205,7 @@ static int
|
||||
mwifiex_cfg80211_start_radar_detection(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
struct cfg80211_chan_def *chandef,
|
||||
u32 cac_time_ms)
|
||||
u32 cac_time_ms, int link_id)
|
||||
{
|
||||
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
|
||||
struct mwifiex_radar_params radar_params;
|
||||
|
@ -1627,7 +1627,7 @@ struct host_cmd_ds_802_11_scan_rsp {
|
||||
|
||||
struct host_cmd_ds_802_11_scan_ext {
|
||||
u32 reserved;
|
||||
u8 tlv_buffer[1];
|
||||
u8 tlv_buffer[];
|
||||
} __packed;
|
||||
|
||||
struct mwifiex_ie_types_bss_mode {
|
||||
|
@ -2534,8 +2534,7 @@ int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv,
|
||||
ext_scan_resp = &resp->params.ext_scan;
|
||||
|
||||
tlv = (void *)ext_scan_resp->tlv_buffer;
|
||||
buf_left = le16_to_cpu(resp->size) - (sizeof(*ext_scan_resp) + S_DS_GEN
|
||||
- 1);
|
||||
buf_left = le16_to_cpu(resp->size) - (sizeof(*ext_scan_resp) + S_DS_GEN);
|
||||
|
||||
while (buf_left >= sizeof(struct mwifiex_ie_types_header)) {
|
||||
type = le16_to_cpu(tlv->type);
|
||||
|
@ -929,14 +929,19 @@ void mt76_update_survey(struct mt76_phy *phy)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_update_survey);
|
||||
|
||||
void mt76_set_channel(struct mt76_phy *phy)
|
||||
int mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,
|
||||
bool offchannel)
|
||||
{
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
struct ieee80211_hw *hw = phy->hw;
|
||||
struct cfg80211_chan_def *chandef = &hw->conf.chandef;
|
||||
bool offchannel = hw->conf.flags & IEEE80211_CONF_OFFCHANNEL;
|
||||
int timeout = HZ / 5;
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&phy->mac_work);
|
||||
|
||||
mutex_lock(&dev->mutex);
|
||||
set_bit(MT76_RESET, &phy->state);
|
||||
|
||||
mt76_worker_disable(&dev->tx_worker);
|
||||
wait_event_timeout(dev->tx_wait, !mt76_has_tx_pending(phy), timeout);
|
||||
mt76_update_survey(phy);
|
||||
|
||||
@ -946,14 +951,34 @@ void mt76_set_channel(struct mt76_phy *phy)
|
||||
|
||||
phy->chandef = *chandef;
|
||||
phy->chan_state = mt76_channel_state(phy, chandef->chan);
|
||||
phy->offchannel = offchannel;
|
||||
|
||||
if (!offchannel)
|
||||
phy->main_chan = chandef->chan;
|
||||
|
||||
if (chandef->chan != phy->main_chan)
|
||||
memset(phy->chan_state, 0, sizeof(*phy->chan_state));
|
||||
mt76_worker_enable(&dev->tx_worker);
|
||||
|
||||
ret = dev->drv->set_channel(phy);
|
||||
|
||||
clear_bit(MT76_RESET, &phy->state);
|
||||
mt76_worker_schedule(&dev->tx_worker);
|
||||
|
||||
mutex_unlock(&dev->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_set_channel);
|
||||
|
||||
int mt76_update_channel(struct mt76_phy *phy)
|
||||
{
|
||||
struct ieee80211_hw *hw = phy->hw;
|
||||
struct cfg80211_chan_def *chandef = &hw->conf.chandef;
|
||||
bool offchannel = hw->conf.flags & IEEE80211_CONF_OFFCHANNEL;
|
||||
|
||||
return mt76_set_channel(phy, chandef, offchannel);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_update_channel);
|
||||
|
||||
int mt76_get_survey(struct ieee80211_hw *hw, int idx,
|
||||
struct survey_info *survey)
|
||||
@ -1484,21 +1509,32 @@ int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
{
|
||||
struct mt76_phy *phy = hw->priv;
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
enum mt76_sta_event ev;
|
||||
|
||||
if (old_state == IEEE80211_STA_NOTEXIST &&
|
||||
new_state == IEEE80211_STA_NONE)
|
||||
return mt76_sta_add(phy, vif, sta);
|
||||
|
||||
if (old_state == IEEE80211_STA_AUTH &&
|
||||
new_state == IEEE80211_STA_ASSOC &&
|
||||
dev->drv->sta_assoc)
|
||||
dev->drv->sta_assoc(dev, vif, sta);
|
||||
|
||||
if (old_state == IEEE80211_STA_NONE &&
|
||||
new_state == IEEE80211_STA_NOTEXIST)
|
||||
mt76_sta_remove(dev, vif, sta);
|
||||
|
||||
return 0;
|
||||
if (!dev->drv->sta_event)
|
||||
return 0;
|
||||
|
||||
if (old_state == IEEE80211_STA_AUTH &&
|
||||
new_state == IEEE80211_STA_ASSOC)
|
||||
ev = MT76_STA_EVENT_ASSOC;
|
||||
else if (old_state == IEEE80211_STA_ASSOC &&
|
||||
new_state == IEEE80211_STA_AUTHORIZED)
|
||||
ev = MT76_STA_EVENT_AUTHORIZE;
|
||||
else if (old_state == IEEE80211_STA_ASSOC &&
|
||||
new_state == IEEE80211_STA_AUTH)
|
||||
ev = MT76_STA_EVENT_DISASSOC;
|
||||
else
|
||||
return 0;
|
||||
|
||||
return dev->drv->sta_event(dev, vif, sta, ev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_sta_state);
|
||||
|
||||
@ -1521,6 +1557,7 @@ void mt76_wcid_init(struct mt76_wcid *wcid)
|
||||
{
|
||||
INIT_LIST_HEAD(&wcid->tx_list);
|
||||
skb_queue_head_init(&wcid->tx_pending);
|
||||
skb_queue_head_init(&wcid->tx_offchannel);
|
||||
|
||||
INIT_LIST_HEAD(&wcid->list);
|
||||
idr_init(&wcid->pktid);
|
||||
@ -1529,7 +1566,7 @@ EXPORT_SYMBOL_GPL(mt76_wcid_init);
|
||||
|
||||
void mt76_wcid_cleanup(struct mt76_dev *dev, struct mt76_wcid *wcid)
|
||||
{
|
||||
struct mt76_phy *phy = dev->phys[wcid->phy_idx];
|
||||
struct mt76_phy *phy = mt76_dev_phy(dev, wcid->phy_idx);
|
||||
struct ieee80211_hw *hw;
|
||||
struct sk_buff_head list;
|
||||
struct sk_buff *skb;
|
||||
@ -1697,14 +1734,15 @@ int mt76_get_rate(struct mt76_dev *dev,
|
||||
struct ieee80211_supported_band *sband,
|
||||
int idx, bool cck)
|
||||
{
|
||||
bool is_2g = sband->band == NL80211_BAND_2GHZ;
|
||||
int i, offset = 0, len = sband->n_bitrates;
|
||||
|
||||
if (cck) {
|
||||
if (sband != &dev->phy.sband_2g.sband)
|
||||
if (!is_2g)
|
||||
return 0;
|
||||
|
||||
idx &= ~BIT(2); /* short preamble */
|
||||
} else if (sband == &dev->phy.sband_2g.sband) {
|
||||
} else if (is_2g) {
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,8 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
int cmd, bool wait_resp,
|
||||
struct sk_buff **ret_skb)
|
||||
{
|
||||
unsigned int retry = 0;
|
||||
struct sk_buff *orig_skb = NULL;
|
||||
unsigned long expires;
|
||||
int ret, seq;
|
||||
|
||||
@ -81,6 +83,14 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
|
||||
mutex_lock(&dev->mcu.mutex);
|
||||
|
||||
if (dev->mcu_ops->mcu_skb_prepare_msg) {
|
||||
ret = dev->mcu_ops->mcu_skb_prepare_msg(dev, skb, cmd, &seq);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
retry:
|
||||
orig_skb = skb_get(skb);
|
||||
ret = dev->mcu_ops->mcu_skb_send_msg(dev, skb, cmd, &seq);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
@ -94,6 +104,14 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
|
||||
do {
|
||||
skb = mt76_mcu_get_response(dev, expires);
|
||||
if (!skb && !test_bit(MT76_MCU_RESET, &dev->phy.state) &&
|
||||
retry++ < dev->mcu_ops->max_retry) {
|
||||
dev_err(dev->dev, "Retry message %08x (seq %d)\n",
|
||||
cmd, seq);
|
||||
skb = orig_skb;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
ret = dev->mcu_ops->mcu_parse_response(dev, cmd, skb, seq);
|
||||
if (!ret && ret_skb)
|
||||
*ret_skb = skb;
|
||||
@ -101,7 +119,9 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
dev_kfree_skb(skb);
|
||||
} while (ret == -EAGAIN);
|
||||
|
||||
|
||||
out:
|
||||
dev_kfree_skb(orig_skb);
|
||||
mutex_unlock(&dev->mcu.mutex);
|
||||
|
||||
return ret;
|
||||
|
@ -162,8 +162,8 @@ enum mt76_dfs_state {
|
||||
|
||||
struct mt76_queue_buf {
|
||||
dma_addr_t addr;
|
||||
u16 len;
|
||||
bool skip_unmap;
|
||||
u16 len:15,
|
||||
skip_unmap:1;
|
||||
};
|
||||
|
||||
struct mt76_tx_info {
|
||||
@ -230,11 +230,14 @@ struct mt76_queue {
|
||||
};
|
||||
|
||||
struct mt76_mcu_ops {
|
||||
unsigned int max_retry;
|
||||
u32 headroom;
|
||||
u32 tailroom;
|
||||
|
||||
int (*mcu_send_msg)(struct mt76_dev *dev, int cmd, const void *data,
|
||||
int len, bool wait_resp);
|
||||
int (*mcu_skb_prepare_msg)(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
int cmd, int *seq);
|
||||
int (*mcu_skb_send_msg)(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
int cmd, int *seq);
|
||||
int (*mcu_parse_response)(struct mt76_dev *dev, int cmd,
|
||||
@ -347,6 +350,7 @@ struct mt76_wcid {
|
||||
u8 hw_key_idx2;
|
||||
|
||||
u8 sta:1;
|
||||
u8 sta_disabled:1;
|
||||
u8 amsdu:1;
|
||||
u8 phy_idx:2;
|
||||
u8 link_id:4;
|
||||
@ -361,6 +365,7 @@ struct mt76_wcid {
|
||||
|
||||
struct list_head tx_list;
|
||||
struct sk_buff_head tx_pending;
|
||||
struct sk_buff_head tx_offchannel;
|
||||
|
||||
struct list_head list;
|
||||
struct idr pktid;
|
||||
@ -466,6 +471,12 @@ enum {
|
||||
MT76_STATE_WED_RESET,
|
||||
};
|
||||
|
||||
enum mt76_sta_event {
|
||||
MT76_STA_EVENT_ASSOC,
|
||||
MT76_STA_EVENT_AUTHORIZE,
|
||||
MT76_STA_EVENT_DISASSOC,
|
||||
};
|
||||
|
||||
struct mt76_hw_cap {
|
||||
bool has_2ghz;
|
||||
bool has_5ghz;
|
||||
@ -487,6 +498,7 @@ struct mt76_driver_ops {
|
||||
u8 mcs_rates;
|
||||
|
||||
void (*update_survey)(struct mt76_phy *phy);
|
||||
int (*set_channel)(struct mt76_phy *phy);
|
||||
|
||||
int (*tx_prepare_skb)(struct mt76_dev *dev, void *txwi_ptr,
|
||||
enum mt76_txq_id qid, struct mt76_wcid *wcid,
|
||||
@ -511,8 +523,8 @@ struct mt76_driver_ops {
|
||||
int (*sta_add)(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
|
||||
void (*sta_assoc)(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
int (*sta_event)(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev);
|
||||
|
||||
void (*sta_remove)(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
@ -768,6 +780,7 @@ struct mt76_phy {
|
||||
|
||||
struct cfg80211_chan_def chandef;
|
||||
struct ieee80211_channel *main_chan;
|
||||
bool offchannel;
|
||||
|
||||
struct mt76_channel_state *chan_state;
|
||||
enum mt76_dfs_state dfs_state;
|
||||
@ -1370,7 +1383,7 @@ void mt76_release_buffered_frames(struct ieee80211_hw *hw,
|
||||
enum ieee80211_frame_release_type reason,
|
||||
bool more_data);
|
||||
bool mt76_has_tx_pending(struct mt76_phy *phy);
|
||||
void mt76_set_channel(struct mt76_phy *phy);
|
||||
int mt76_update_channel(struct mt76_phy *phy);
|
||||
void mt76_update_survey(struct mt76_phy *phy);
|
||||
void mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time);
|
||||
int mt76_get_survey(struct ieee80211_hw *hw, int idx,
|
||||
@ -1484,6 +1497,8 @@ void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames);
|
||||
void mt76_testmode_tx_pending(struct mt76_phy *phy);
|
||||
void mt76_queue_tx_complete(struct mt76_dev *dev, struct mt76_queue *q,
|
||||
struct mt76_queue_entry *e);
|
||||
int mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,
|
||||
bool offchannel);
|
||||
|
||||
/* usb */
|
||||
static inline bool mt76u_urb_error(struct urb *urb)
|
||||
|
@ -107,7 +107,7 @@ void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
|
||||
struct sk_buff *skb;
|
||||
int i, nframes;
|
||||
|
||||
if (mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL)
|
||||
if (dev->mphy.offchannel)
|
||||
return;
|
||||
|
||||
data.dev = dev;
|
||||
|
@ -29,7 +29,7 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
|
||||
struct ieee80211_sta *sta;
|
||||
struct mt7603_sta *msta;
|
||||
struct mt76_wcid *wcid;
|
||||
u8 tid = 0, hwq = 0;
|
||||
u8 qid, tid = 0, hwq = 0;
|
||||
void *priv;
|
||||
int idx;
|
||||
u32 val;
|
||||
@ -57,7 +57,7 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
|
||||
if (ieee80211_is_data_qos(hdr->frame_control)) {
|
||||
tid = *ieee80211_get_qos_ctl(hdr) &
|
||||
IEEE80211_QOS_CTL_TAG1D_MASK;
|
||||
u8 qid = tid_to_ac[tid];
|
||||
qid = tid_to_ac[tid];
|
||||
hwq = wmm_queue_map[qid];
|
||||
skb_set_queue_mapping(skb, qid);
|
||||
} else if (ieee80211_is_data(hdr->frame_control)) {
|
||||
|
@ -181,6 +181,7 @@ int mt7603_eeprom_init(struct mt7603_dev *dev)
|
||||
is_mt7688(dev))
|
||||
dev->mphy.antenna_mask = 1;
|
||||
|
||||
dev->mphy.chainmask = dev->mphy.antenna_mask;
|
||||
mt76_eeprom_override(&dev->mphy);
|
||||
|
||||
return 0;
|
||||
|
@ -15,9 +15,10 @@ const struct mt76_driver_ops mt7603_drv_ops = {
|
||||
.rx_poll_complete = mt7603_rx_poll_complete,
|
||||
.sta_ps = mt7603_sta_ps,
|
||||
.sta_add = mt7603_sta_add,
|
||||
.sta_assoc = mt7603_sta_assoc,
|
||||
.sta_event = mt7603_sta_event,
|
||||
.sta_remove = mt7603_sta_remove,
|
||||
.update_survey = mt7603_update_channel,
|
||||
.set_channel = mt7603_set_channel,
|
||||
};
|
||||
|
||||
static void
|
||||
@ -456,11 +457,13 @@ mt7603_init_txpower(struct mt7603_dev *dev,
|
||||
int target_power = eeprom[MT_EE_TX_POWER_0_START_2G + 2] & ~BIT(7);
|
||||
u8 *rate_power = &eeprom[MT_EE_TX_POWER_CCK];
|
||||
bool ext_pa = eeprom[MT_EE_NIC_CONF_0 + 1] & BIT(1);
|
||||
u8 ext_pa_pwr;
|
||||
int max_offset, cur_offset;
|
||||
int i;
|
||||
|
||||
if (ext_pa && is_mt7603(dev))
|
||||
target_power = eeprom[MT_EE_TX_POWER_TSSI_OFF] & ~BIT(7);
|
||||
ext_pa_pwr = eeprom[MT_EE_TX_POWER_TSSI_OFF];
|
||||
if (ext_pa && is_mt7603(dev) && ext_pa_pwr != 0 && ext_pa_pwr != 0xff)
|
||||
target_power = ext_pa_pwr & ~BIT(7);
|
||||
|
||||
if (target_power & BIT(6))
|
||||
target_power = -(target_power & GENMASK(5, 0));
|
||||
|
@ -133,30 +133,24 @@ void mt7603_init_edcca(struct mt7603_dev *dev)
|
||||
mt7603_edcca_set_strict(dev, false);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7603_set_channel(struct ieee80211_hw *hw, struct cfg80211_chan_def *def)
|
||||
int mt7603_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
struct mt7603_dev *dev = hw->priv;
|
||||
struct mt7603_dev *dev = container_of(mphy->dev, struct mt7603_dev, mt76);
|
||||
struct cfg80211_chan_def *def = &mphy->chandef;
|
||||
|
||||
u8 *rssi_data = (u8 *)dev->mt76.eeprom.data;
|
||||
int idx, ret;
|
||||
u8 bw = MT_BW_20;
|
||||
bool failed = false;
|
||||
|
||||
ieee80211_stop_queues(hw);
|
||||
cancel_delayed_work_sync(&dev->mphy.mac_work);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
set_bit(MT76_RESET, &dev->mphy.state);
|
||||
|
||||
mt7603_beacon_set_timer(dev, -1, 0);
|
||||
mt76_set_channel(&dev->mphy);
|
||||
mt7603_mac_stop(dev);
|
||||
|
||||
if (def->width == NL80211_CHAN_WIDTH_40)
|
||||
bw = MT_BW_40;
|
||||
|
||||
dev->mphy.chandef = *def;
|
||||
mt76_rmw_field(dev, MT_AGG_BWCR, MT_AGG_BWCR_BW, bw);
|
||||
ret = mt7603_mcu_set_channel(dev);
|
||||
if (ret) {
|
||||
@ -180,10 +174,6 @@ mt7603_set_channel(struct ieee80211_hw *hw, struct cfg80211_chan_def *def)
|
||||
mt7603_mac_set_timing(dev);
|
||||
mt7603_mac_start(dev);
|
||||
|
||||
clear_bit(MT76_RESET, &dev->mphy.state);
|
||||
|
||||
mt76_txq_schedule_all(&dev->mphy);
|
||||
|
||||
ieee80211_queue_delayed_work(mt76_hw(dev), &dev->mphy.mac_work,
|
||||
msecs_to_jiffies(MT7603_WATCHDOG_TIME));
|
||||
|
||||
@ -199,17 +189,14 @@ mt7603_set_channel(struct ieee80211_hw *hw, struct cfg80211_chan_def *def)
|
||||
mt7603_init_edcca(dev);
|
||||
|
||||
out:
|
||||
if (!(mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL))
|
||||
if (!mphy->offchannel)
|
||||
mt7603_beacon_set_timer(dev, -1, dev->mt76.beacon_int);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
if (failed)
|
||||
mt7603_mac_work(&dev->mphy.mac_work.work);
|
||||
|
||||
ieee80211_wake_queues(hw);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -227,7 +214,7 @@ static int mt7603_set_sar_specs(struct ieee80211_hw *hw,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return mt7603_set_channel(hw, &mphy->chandef);
|
||||
return mt76_update_channel(mphy);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -238,7 +225,7 @@ mt7603_config(struct ieee80211_hw *hw, u32 changed)
|
||||
|
||||
if (changed & (IEEE80211_CONF_CHANGE_CHANNEL |
|
||||
IEEE80211_CONF_CHANGE_POWER))
|
||||
ret = mt7603_set_channel(hw, &hw->conf.chandef);
|
||||
ret = mt76_update_channel(&dev->mphy);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
@ -368,13 +355,19 @@ mt7603_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
mt7603_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
int
|
||||
mt7603_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev)
|
||||
{
|
||||
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
|
||||
|
||||
mt7603_wtbl_update_cap(dev, sta);
|
||||
if (ev == MT76_STA_EVENT_ASSOC) {
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
mt7603_wtbl_update_cap(dev, sta);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -213,6 +213,7 @@ void mt7603_mac_sta_poll(struct mt7603_dev *dev);
|
||||
|
||||
void mt7603_pse_client_reset(struct mt7603_dev *dev);
|
||||
|
||||
int mt7603_set_channel(struct mt76_phy *mphy);
|
||||
int mt7603_mcu_set_channel(struct mt7603_dev *dev);
|
||||
int mt7603_mcu_set_eeprom(struct mt7603_dev *dev);
|
||||
void mt7603_mcu_exit(struct mt7603_dev *dev);
|
||||
@ -245,8 +246,8 @@ void mt7603_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q);
|
||||
void mt7603_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps);
|
||||
int mt7603_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
void mt7603_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
int mt7603_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev);
|
||||
void mt7603_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
|
||||
|
@ -56,6 +56,9 @@ int mt7615_thermal_init(struct mt7615_dev *dev)
|
||||
|
||||
name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7615_%s",
|
||||
wiphy_name(wiphy));
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
||||
hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, dev,
|
||||
mt7615_hwmon_groups);
|
||||
return PTR_ERR_OR_ZERO(hwmon);
|
||||
@ -319,7 +322,7 @@ void mt7615_init_work(struct mt7615_dev *dev)
|
||||
mt7615_mcu_set_eeprom(dev);
|
||||
mt7615_mac_init(dev);
|
||||
mt7615_phy_init(dev);
|
||||
mt7615_mcu_del_wtbl_all(dev);
|
||||
mt76_connac_mcu_del_wtbl_all(&dev->mt76);
|
||||
mt7615_check_offload_capability(dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7615_init_work);
|
||||
|
@ -282,19 +282,14 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,
|
||||
mt76_wcid_cleanup(&dev->mt76, &mvif->sta.wcid);
|
||||
}
|
||||
|
||||
int mt7615_set_channel(struct mt7615_phy *phy)
|
||||
int mt7615_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
struct mt7615_phy *phy = mphy->priv;
|
||||
struct mt7615_dev *dev = phy->dev;
|
||||
bool ext_phy = phy != &dev->phy;
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&phy->mt76->mac_work);
|
||||
|
||||
mt7615_mutex_acquire(dev);
|
||||
|
||||
set_bit(MT76_RESET, &phy->mt76->state);
|
||||
|
||||
mt76_set_channel(phy->mt76);
|
||||
mt76_connac_pm_wake(mphy, &dev->pm);
|
||||
|
||||
if (is_mt7615(&dev->mt76) && dev->flash_eeprom) {
|
||||
ret = mt7615_mcu_apply_rx_dcoc(phy);
|
||||
@ -325,11 +320,8 @@ int mt7615_set_channel(struct mt7615_phy *phy)
|
||||
phy->chfreq = mt76_rr(dev, MT_CHFREQ(ext_phy));
|
||||
|
||||
out:
|
||||
clear_bit(MT76_RESET, &phy->mt76->state);
|
||||
mt76_connac_power_save_sched(mphy, &dev->pm);
|
||||
|
||||
mt7615_mutex_release(dev);
|
||||
|
||||
mt76_worker_schedule(&dev->mt76.tx_worker);
|
||||
if (!mt76_testmode_enabled(phy->mt76)) {
|
||||
unsigned long timeout = mt7615_get_macwork_timeout(dev);
|
||||
|
||||
@ -339,6 +331,7 @@ out:
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7615_set_channel);
|
||||
|
||||
static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
|
||||
@ -425,11 +418,7 @@ static int mt7615_set_sar_specs(struct ieee80211_hw *hw,
|
||||
if (mt7615_firmware_offload(phy->dev))
|
||||
return mt76_connac_mcu_set_rate_txpower(phy->mt76);
|
||||
|
||||
ieee80211_stop_queues(hw);
|
||||
err = mt7615_set_channel(phy);
|
||||
ieee80211_wake_queues(hw);
|
||||
|
||||
return err;
|
||||
return mt76_update_channel(phy->mt76);
|
||||
}
|
||||
|
||||
static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
|
||||
@ -448,9 +437,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
|
||||
mt7615_mutex_release(dev);
|
||||
}
|
||||
#endif
|
||||
ieee80211_stop_queues(hw);
|
||||
ret = mt7615_set_channel(phy);
|
||||
ieee80211_wake_queues(hw);
|
||||
ret = mt76_update_channel(phy->mt76);
|
||||
}
|
||||
|
||||
mt7615_mutex_acquire(dev);
|
||||
|
@ -394,7 +394,7 @@ mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb)
|
||||
if (mt76_phy_dfs_state(mphy) < MT_DFS_STATE_CAC)
|
||||
return;
|
||||
|
||||
ieee80211_radar_detected(mphy->hw);
|
||||
ieee80211_radar_detected(mphy->hw, NULL);
|
||||
dev->hw_pattern++;
|
||||
}
|
||||
|
||||
@ -847,6 +847,7 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif,
|
||||
struct wtbl_req_hdr *wtbl_hdr;
|
||||
struct mt7615_sta *msta;
|
||||
bool new_entry = true;
|
||||
int conn_state;
|
||||
int cmd, err;
|
||||
|
||||
msta = sta ? (struct mt7615_sta *)sta->drv_priv : &mvif->sta;
|
||||
@ -863,8 +864,9 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif,
|
||||
else
|
||||
mvif->sta_added = true;
|
||||
}
|
||||
conn_state = enable ? CONN_STATE_PORT_SECURE : CONN_STATE_DISCONNECT;
|
||||
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, sskb, vif, link_sta,
|
||||
enable, new_entry);
|
||||
conn_state, new_entry);
|
||||
if (enable && sta)
|
||||
mt76_connac_mcu_sta_tlv(phy->mt76, sskb, sta, vif, 0,
|
||||
MT76_STA_INFO_STATE_ASSOC);
|
||||
@ -1878,16 +1880,6 @@ out:
|
||||
sizeof(req), true);
|
||||
}
|
||||
|
||||
int mt7615_mcu_del_wtbl_all(struct mt7615_dev *dev)
|
||||
{
|
||||
struct wtbl_req_hdr req = {
|
||||
.operation = WTBL_RESET_ALL,
|
||||
};
|
||||
|
||||
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(WTBL_UPDATE),
|
||||
&req, sizeof(req), true);
|
||||
}
|
||||
|
||||
int mt7615_mcu_set_fcc5_lpn(struct mt7615_dev *dev, int val)
|
||||
{
|
||||
struct {
|
||||
@ -2151,7 +2143,7 @@ int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd)
|
||||
if (cmd == MCU_EXT_CMD(SET_RX_PATH) ||
|
||||
phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR)
|
||||
req.switch_reason = CH_SWITCH_NORMAL;
|
||||
else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
|
||||
else if (phy->mt76->offchannel)
|
||||
req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
|
||||
else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
|
||||
NL80211_IFTYPE_AP))
|
||||
|
@ -182,6 +182,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,
|
||||
.sta_add = mt7615_mac_sta_add,
|
||||
.sta_remove = mt7615_mac_sta_remove,
|
||||
.update_survey = mt7615_update_channel,
|
||||
.set_channel = mt7615_set_channel,
|
||||
};
|
||||
struct mt76_bus_ops *bus_ops;
|
||||
struct ieee80211_ops *ops;
|
||||
|
@ -399,7 +399,6 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,
|
||||
struct ieee80211_tx_rate *rates);
|
||||
void mt7615_pm_wake_work(struct work_struct *work);
|
||||
void mt7615_pm_power_save_work(struct work_struct *work);
|
||||
int mt7615_mcu_del_wtbl_all(struct mt7615_dev *dev);
|
||||
int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd);
|
||||
int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue,
|
||||
const struct ieee80211_tx_queue_params *params);
|
||||
@ -457,7 +456,7 @@ void mt7615_roc_work(struct work_struct *work);
|
||||
void mt7615_roc_timer(struct timer_list *timer);
|
||||
void mt7615_init_txpower(struct mt7615_dev *dev,
|
||||
struct ieee80211_supported_band *sband);
|
||||
int mt7615_set_channel(struct mt7615_phy *phy);
|
||||
int mt7615_set_channel(struct mt76_phy *mphy);
|
||||
void mt7615_init_work(struct mt7615_dev *dev);
|
||||
|
||||
int mt7615_mcu_restart(struct mt76_dev *dev);
|
||||
|
@ -87,6 +87,7 @@ static int mt7663s_probe(struct sdio_func *func,
|
||||
.sta_add = mt7615_mac_sta_add,
|
||||
.sta_remove = mt7615_mac_sta_remove,
|
||||
.update_survey = mt7615_update_channel,
|
||||
.set_channel = mt7615_set_channel,
|
||||
};
|
||||
static const struct mt76_bus_ops mt7663s_ops = {
|
||||
.rr = mt76s_rr,
|
||||
|
@ -141,7 +141,7 @@ mt7615_tm_init(struct mt7615_phy *phy)
|
||||
mt7615_mcu_set_sku_en(phy, phy->mt76->test.state == MT76_TM_STATE_OFF);
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
mt7615_set_channel(phy);
|
||||
mt76_update_channel(phy->mt76);
|
||||
mt7615_ops.configure_filter(phy->mt76->hw, 0, &total_flags, 0);
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
|
@ -123,6 +123,7 @@ static int mt7663u_probe(struct usb_interface *usb_intf,
|
||||
.sta_add = mt7615_mac_sta_add,
|
||||
.sta_remove = mt7615_mac_sta_remove,
|
||||
.update_survey = mt7615_update_channel,
|
||||
.set_channel = mt7615_set_channel,
|
||||
};
|
||||
static struct mt76_bus_ops bus_ops = {
|
||||
.rr = mt7663u_rr,
|
||||
|
@ -355,4 +355,11 @@ enum tx_port_idx {
|
||||
MT_TX_PORT_IDX_MCU
|
||||
};
|
||||
|
||||
enum tx_frag_idx {
|
||||
MT_TX_FRAG_NONE,
|
||||
MT_TX_FRAG_FIRST,
|
||||
MT_TX_FRAG_MID,
|
||||
MT_TX_FRAG_LAST
|
||||
};
|
||||
|
||||
#endif /* __MT76_CONNAC2_MAC_H */
|
||||
|
@ -28,8 +28,6 @@ enum {
|
||||
#define MT_RXD0_MESH BIT(18)
|
||||
#define MT_RXD0_MHCP BIT(19)
|
||||
#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16)
|
||||
#define MT_RXD0_NORMAL_IP_SUM BIT(23)
|
||||
#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24)
|
||||
|
||||
#define MT_RXD0_SW_PKT_TYPE_MASK GENMASK(31, 16)
|
||||
#define MT_RXD0_SW_PKT_TYPE_MAP 0x380F
|
||||
@ -80,6 +78,8 @@ enum {
|
||||
#define MT_RXD3_NORMAL_BEACON_UC BIT(21)
|
||||
#define MT_RXD3_NORMAL_CO_ANT BIT(22)
|
||||
#define MT_RXD3_NORMAL_FCS_ERR BIT(24)
|
||||
#define MT_RXD3_NORMAL_IP_SUM BIT(26)
|
||||
#define MT_RXD3_NORMAL_UDP_TCP_SUM BIT(27)
|
||||
#define MT_RXD3_NORMAL_VLAN2ETH BIT(31)
|
||||
|
||||
/* RXD DW4 */
|
||||
@ -197,6 +197,13 @@ enum tx_mgnt_type {
|
||||
MT_TX_ADDBA,
|
||||
};
|
||||
|
||||
enum tx_frag_idx {
|
||||
MT_TX_FRAG_NONE,
|
||||
MT_TX_FRAG_FIRST,
|
||||
MT_TX_FRAG_MID,
|
||||
MT_TX_FRAG_LAST
|
||||
};
|
||||
|
||||
#define MT_CT_INFO_APPLY_TXD BIT(0)
|
||||
#define MT_CT_INFO_COPY_HOST_TXD_ALL BIT(1)
|
||||
#define MT_CT_INFO_MGMT_FRAME BIT(2)
|
||||
|
@ -391,6 +391,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
|
||||
bool multicast = is_multicast_ether_addr(hdr->addr1);
|
||||
u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
|
||||
__le16 fc = hdr->frame_control;
|
||||
__le16 sc = hdr->seq_ctrl;
|
||||
u8 fc_type, fc_stype;
|
||||
u32 val;
|
||||
|
||||
@ -432,6 +433,13 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
|
||||
info->flags & IEEE80211_TX_CTL_USE_MINRATE)
|
||||
val |= MT_TXD2_FIX_RATE;
|
||||
|
||||
if (ieee80211_has_morefrags(fc) && ieee80211_is_first_frag(sc))
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_FIRST);
|
||||
else if (ieee80211_has_morefrags(fc) && !ieee80211_is_first_frag(sc))
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_MID);
|
||||
else if (!ieee80211_has_morefrags(fc) && !ieee80211_is_first_frag(sc))
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_LAST);
|
||||
|
||||
txwi[2] |= cpu_to_le32(val);
|
||||
|
||||
if (ieee80211_is_beacon(fc)) {
|
||||
@ -440,7 +448,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
|
||||
}
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_INJECTED) {
|
||||
u16 seqno = le16_to_cpu(hdr->seq_ctrl);
|
||||
u16 seqno = le16_to_cpu(sc);
|
||||
|
||||
if (ieee80211_is_back_req(hdr->frame_control)) {
|
||||
struct ieee80211_bar *bar;
|
||||
|
@ -283,7 +283,7 @@ __mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
|
||||
};
|
||||
struct sk_buff *skb;
|
||||
|
||||
if (wcid && !wcid->sta)
|
||||
if (wcid && !wcid->sta && !wcid->sta_disabled)
|
||||
hdr.muar_idx = 0xe;
|
||||
|
||||
mt76_connac_mcu_get_wlan_idx(dev, wcid, &hdr.wlan_idx_lo,
|
||||
@ -371,7 +371,7 @@ EXPORT_SYMBOL_GPL(mt76_connac_mcu_bss_omac_tlv);
|
||||
void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_link_sta *link_sta,
|
||||
bool enable, bool newly)
|
||||
int conn_state, bool newly)
|
||||
{
|
||||
struct sta_rec_basic *basic;
|
||||
struct tlv *tlv;
|
||||
@ -382,13 +382,9 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
basic = (struct sta_rec_basic *)tlv;
|
||||
basic->extra_info = cpu_to_le16(EXTRA_INFO_VER);
|
||||
|
||||
if (enable) {
|
||||
if (newly)
|
||||
basic->extra_info |= cpu_to_le16(EXTRA_INFO_NEW);
|
||||
basic->conn_state = CONN_STATE_PORT_SECURE;
|
||||
} else {
|
||||
basic->conn_state = CONN_STATE_DISCONNECT;
|
||||
}
|
||||
if (newly && conn_state != CONN_STATE_DISCONNECT)
|
||||
basic->extra_info |= cpu_to_le16(EXTRA_INFO_NEW);
|
||||
basic->conn_state = conn_state;
|
||||
|
||||
if (!link_sta) {
|
||||
basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);
|
||||
@ -1051,15 +1047,18 @@ int mt76_connac_mcu_sta_cmd(struct mt76_phy *phy,
|
||||
struct wtbl_req_hdr *wtbl_hdr;
|
||||
struct tlv *sta_wtbl;
|
||||
struct sk_buff *skb;
|
||||
int conn_state;
|
||||
|
||||
skb = mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid);
|
||||
if (IS_ERR(skb))
|
||||
return PTR_ERR(skb);
|
||||
|
||||
conn_state = info->enable ? CONN_STATE_PORT_SECURE :
|
||||
CONN_STATE_DISCONNECT;
|
||||
link_sta = info->sta ? &info->sta->deflink : NULL;
|
||||
if (info->sta || !info->offload_fw)
|
||||
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
|
||||
link_sta, info->enable,
|
||||
link_sta, conn_state,
|
||||
info->newly);
|
||||
if (info->sta && info->enable)
|
||||
mt76_connac_mcu_sta_tlv(phy, skb, info->sta,
|
||||
@ -2850,6 +2849,17 @@ int mt76_connac_mcu_restart(struct mt76_dev *dev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_connac_mcu_restart);
|
||||
|
||||
int mt76_connac_mcu_del_wtbl_all(struct mt76_dev *dev)
|
||||
{
|
||||
struct wtbl_req_hdr req = {
|
||||
.operation = WTBL_RESET_ALL,
|
||||
};
|
||||
|
||||
return mt76_mcu_send_msg(dev, MCU_EXT_CMD(WTBL_UPDATE),
|
||||
&req, sizeof(req), true);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_connac_mcu_del_wtbl_all);
|
||||
|
||||
int mt76_connac_mcu_rdd_cmd(struct mt76_dev *dev, int cmd, u8 index,
|
||||
u8 rx_sel, u8 val)
|
||||
{
|
||||
|
@ -115,21 +115,26 @@ struct mt76_connac2_mcu_uni_txd {
|
||||
} __packed __aligned(4);
|
||||
|
||||
struct mt76_connac2_mcu_rxd {
|
||||
__le32 rxd[6];
|
||||
/* New members MUST be added within the struct_group() macro below. */
|
||||
struct_group_tagged(mt76_connac2_mcu_rxd_hdr, hdr,
|
||||
__le32 rxd[6];
|
||||
|
||||
__le16 len;
|
||||
__le16 pkt_type_id;
|
||||
__le16 len;
|
||||
__le16 pkt_type_id;
|
||||
|
||||
u8 eid;
|
||||
u8 seq;
|
||||
u8 option;
|
||||
u8 rsv;
|
||||
u8 ext_eid;
|
||||
u8 rsv1[2];
|
||||
u8 s2d_index;
|
||||
u8 eid;
|
||||
u8 seq;
|
||||
u8 option;
|
||||
u8 rsv;
|
||||
u8 ext_eid;
|
||||
u8 rsv1[2];
|
||||
u8 s2d_index;
|
||||
);
|
||||
|
||||
u8 tlv[];
|
||||
};
|
||||
static_assert(offsetof(struct mt76_connac2_mcu_rxd, tlv) == sizeof(struct mt76_connac2_mcu_rxd_hdr),
|
||||
"struct member likely outside of struct_group_tagged()");
|
||||
|
||||
struct mt76_connac2_patch_hdr {
|
||||
char build_date[16];
|
||||
@ -1898,7 +1903,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif);
|
||||
void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_link_sta *link_sta,
|
||||
bool enable, bool newly);
|
||||
int state, bool newly);
|
||||
void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, void *sta_wtbl,
|
||||
@ -2032,6 +2037,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
|
||||
void *sta_wtbl, void *wtbl_tlv);
|
||||
int mt76_connac_mcu_set_pm(struct mt76_dev *dev, int band, int enter);
|
||||
int mt76_connac_mcu_restart(struct mt76_dev *dev);
|
||||
int mt76_connac_mcu_del_wtbl_all(struct mt76_dev *dev);
|
||||
int mt76_connac_mcu_rdd_cmd(struct mt76_dev *dev, int cmd, u8 index,
|
||||
u8 rx_sel, u8 val);
|
||||
int mt76_connac_mcu_sta_wed_update(struct mt76_dev *dev, struct sk_buff *skb);
|
||||
|
@ -8,16 +8,15 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include "mt76x0.h"
|
||||
|
||||
static void
|
||||
mt76x0_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
||||
int mt76x0_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
struct mt76x02_dev *dev = container_of(mphy->dev, struct mt76x02_dev, mt76);
|
||||
|
||||
mt76x02_pre_tbtt_enable(dev, false);
|
||||
if (mt76_is_mmio(&dev->mt76))
|
||||
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
|
||||
|
||||
mt76_set_channel(&dev->mphy);
|
||||
mt76x0_phy_set_channel(dev, chandef);
|
||||
mt76x0_phy_set_channel(dev, &mphy->chandef);
|
||||
|
||||
mt76x02_mac_cc_reset(dev);
|
||||
mt76x02_edcca_init(dev);
|
||||
@ -28,8 +27,9 @@ mt76x0_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
||||
}
|
||||
mt76x02_pre_tbtt_enable(dev, true);
|
||||
|
||||
mt76_txq_schedule_all(&dev->mphy);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76x0_set_channel);
|
||||
|
||||
int mt76x0_set_sar_specs(struct ieee80211_hw *hw,
|
||||
const struct cfg80211_sar_specs *sar)
|
||||
@ -61,13 +61,10 @@ int mt76x0_config(struct ieee80211_hw *hw, u32 changed)
|
||||
{
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
||||
mt76_update_channel(&dev->mphy);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
ieee80211_stop_queues(hw);
|
||||
mt76x0_set_channel(dev, &hw->conf.chandef);
|
||||
ieee80211_wake_queues(hw);
|
||||
}
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_POWER) {
|
||||
struct mt76_phy *mphy = &dev->mphy;
|
||||
|
@ -49,6 +49,7 @@ void mt76x0_chip_onoff(struct mt76x02_dev *dev, bool enable, bool reset);
|
||||
void mt76x0_mac_stop(struct mt76x02_dev *dev);
|
||||
|
||||
int mt76x0_config(struct ieee80211_hw *hw, u32 changed);
|
||||
int mt76x0_set_channel(struct mt76_phy *mphy);
|
||||
int mt76x0_set_sar_specs(struct ieee80211_hw *hw,
|
||||
const struct cfg80211_sar_specs *sar);
|
||||
|
||||
|
@ -159,6 +159,7 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
MT_DRV_SW_RX_AIRTIME,
|
||||
.survey_flags = SURVEY_INFO_TIME_TX,
|
||||
.update_survey = mt76x02_update_channel,
|
||||
.set_channel = mt76x0_set_channel,
|
||||
.tx_prepare_skb = mt76x02_tx_prepare_skb,
|
||||
.tx_complete_skb = mt76x02_tx_complete_skb,
|
||||
.rx_skb = mt76x02_queue_rx_skb,
|
||||
|
@ -217,6 +217,7 @@ static int mt76x0u_probe(struct usb_interface *usb_intf,
|
||||
.drv_flags = MT_DRV_SW_RX_AIRTIME,
|
||||
.survey_flags = SURVEY_INFO_TIME_TX,
|
||||
.update_survey = mt76x02_update_channel,
|
||||
.set_channel = mt76x0_set_channel,
|
||||
.tx_prepare_skb = mt76x02u_tx_prepare_skb,
|
||||
.tx_complete_skb = mt76x02u_tx_complete_skb,
|
||||
.tx_status_data = mt76x02_tx_status_data,
|
||||
|
@ -630,7 +630,7 @@ static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
|
||||
radar_detected = mt76x02_dfs_check_detection(dev);
|
||||
if (radar_detected) {
|
||||
/* sw detector rx radar pattern */
|
||||
ieee80211_radar_detected(dev->mt76.hw);
|
||||
ieee80211_radar_detected(dev->mt76.hw, NULL);
|
||||
mt76x02_dfs_detector_reset(dev);
|
||||
|
||||
return;
|
||||
@ -658,7 +658,7 @@ static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
|
||||
|
||||
/* hw detector rx radar pattern */
|
||||
dfs_pd->stats[i].hw_pattern++;
|
||||
ieee80211_radar_detected(dev->mt76.hw);
|
||||
ieee80211_radar_detected(dev->mt76.hw, NULL);
|
||||
mt76x02_dfs_detector_reset(dev);
|
||||
|
||||
return;
|
||||
|
@ -22,7 +22,7 @@ static void mt76x02_pre_tbtt_tasklet(struct tasklet_struct *t)
|
||||
struct sk_buff *skb;
|
||||
int i;
|
||||
|
||||
if (mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL)
|
||||
if (dev->mphy.offchannel)
|
||||
return;
|
||||
|
||||
__skb_queue_head_init(&data.q);
|
||||
|
@ -188,10 +188,7 @@ static void mt76x02u_pre_tbtt_work(struct work_struct *work)
|
||||
struct sk_buff *skb;
|
||||
int nbeacons;
|
||||
|
||||
if (!dev->mt76.beacon_mask)
|
||||
return;
|
||||
|
||||
if (mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL)
|
||||
if (!dev->mt76.beacon_mask || dev->mphy.offchannel)
|
||||
return;
|
||||
|
||||
__skb_queue_head_init(&data.q);
|
||||
|
@ -47,6 +47,8 @@ void mt76x2_phy_power_on(struct mt76x02_dev *dev);
|
||||
void mt76x2_stop_hardware(struct mt76x02_dev *dev);
|
||||
int mt76x2_eeprom_init(struct mt76x02_dev *dev);
|
||||
int mt76x2_apply_calibration_data(struct mt76x02_dev *dev, int channel);
|
||||
int mt76x2e_set_channel(struct mt76_phy *phy);
|
||||
int mt76x2u_set_channel(struct mt76_phy *phy);
|
||||
|
||||
void mt76x2_phy_set_antenna(struct mt76x02_dev *dev);
|
||||
int mt76x2_phy_start(struct mt76x02_dev *dev);
|
||||
|
@ -25,6 +25,7 @@ mt76x2e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
MT_DRV_SW_RX_AIRTIME,
|
||||
.survey_flags = SURVEY_INFO_TIME_TX,
|
||||
.update_survey = mt76x02_update_channel,
|
||||
.set_channel = mt76x2e_set_channel,
|
||||
.tx_prepare_skb = mt76x02_tx_prepare_skb,
|
||||
.tx_complete_skb = mt76x02_tx_complete_skb,
|
||||
.rx_skb = mt76x02_queue_rx_skb,
|
||||
|
@ -32,33 +32,25 @@ mt76x2_stop(struct ieee80211_hw *hw, bool suspend)
|
||||
mt76x2_stop_hardware(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
||||
int mt76x2e_set_channel(struct mt76_phy *phy)
|
||||
{
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
struct mt76x02_dev *dev = container_of(phy->dev, struct mt76x02_dev, mt76);
|
||||
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
set_bit(MT76_RESET, &dev->mphy.state);
|
||||
|
||||
mt76_set_channel(&dev->mphy);
|
||||
|
||||
mt76x2_mac_stop(dev, true);
|
||||
mt76x2_phy_set_channel(dev, chandef);
|
||||
mt76x2_phy_set_channel(dev, &phy->chandef);
|
||||
|
||||
mt76x02_mac_cc_reset(dev);
|
||||
mt76x02_dfs_init_params(dev);
|
||||
|
||||
mt76x2_mac_resume(dev);
|
||||
|
||||
clear_bit(MT76_RESET, &dev->mphy.state);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
tasklet_enable(&dev->dfs_pd.dfs_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
mt76_txq_schedule_all(&dev->mphy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -95,11 +87,8 @@ mt76x2_config(struct ieee80211_hw *hw, u32 changed)
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
ieee80211_stop_queues(hw);
|
||||
mt76x2_set_channel(dev, &hw->conf.chandef);
|
||||
ieee80211_wake_queues(hw);
|
||||
}
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
||||
mt76_update_channel(&dev->mphy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ static int mt76x2u_probe(struct usb_interface *intf,
|
||||
.drv_flags = MT_DRV_SW_RX_AIRTIME,
|
||||
.survey_flags = SURVEY_INFO_TIME_TX,
|
||||
.update_survey = mt76x02_update_channel,
|
||||
.set_channel = mt76x2u_set_channel,
|
||||
.tx_prepare_skb = mt76x02u_tx_prepare_skb,
|
||||
.tx_complete_skb = mt76x02u_tx_complete_skb,
|
||||
.tx_status_data = mt76x02_tx_status_data,
|
||||
|
@ -31,32 +31,20 @@ static void mt76x2u_stop(struct ieee80211_hw *hw, bool suspend)
|
||||
mt76x2u_stop_hw(dev);
|
||||
}
|
||||
|
||||
static int
|
||||
mt76x2u_set_channel(struct mt76x02_dev *dev,
|
||||
struct cfg80211_chan_def *chandef)
|
||||
int mt76x2u_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
struct mt76x02_dev *dev = container_of(mphy->dev, struct mt76x02_dev, mt76);
|
||||
int err;
|
||||
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
mt76x02_pre_tbtt_enable(dev, false);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
set_bit(MT76_RESET, &dev->mphy.state);
|
||||
|
||||
mt76_set_channel(&dev->mphy);
|
||||
|
||||
mt76x2_mac_stop(dev, false);
|
||||
|
||||
err = mt76x2u_phy_set_channel(dev, chandef);
|
||||
err = mt76x2u_phy_set_channel(dev, &mphy->chandef);
|
||||
|
||||
mt76x02_mac_cc_reset(dev);
|
||||
mt76x2_mac_resume(dev);
|
||||
|
||||
clear_bit(MT76_RESET, &dev->mphy.state);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
mt76x02_pre_tbtt_enable(dev, true);
|
||||
mt76_txq_schedule_all(&dev->mphy);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -93,11 +81,8 @@ mt76x2u_config(struct ieee80211_hw *hw, u32 changed)
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
ieee80211_stop_queues(hw);
|
||||
err = mt76x2u_set_channel(dev, &hw->conf.chandef);
|
||||
ieee80211_wake_queues(hw);
|
||||
}
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
||||
mt76_update_channel(&dev->mphy);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -194,6 +194,8 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
|
||||
|
||||
name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7915_%s",
|
||||
wiphy_name(wiphy));
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
||||
cdev = thermal_cooling_device_register(name, phy, &mt7915_thermal_ops);
|
||||
if (!IS_ERR(cdev)) {
|
||||
@ -398,6 +400,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
|
||||
ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
|
||||
ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
|
||||
ieee80211_hw_set(hw, WANT_MONITOR_VIF);
|
||||
ieee80211_hw_set(hw, SUPPORTS_TX_FRAG);
|
||||
|
||||
hw->max_tx_fragments = 4;
|
||||
|
||||
|
@ -1448,6 +1448,7 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
|
||||
|
||||
dev->recovery.hw_full_reset = true;
|
||||
|
||||
set_bit(MT76_MCU_RESET, &dev->mphy.state);
|
||||
wake_up(&dev->mt76.mcu.wait);
|
||||
ieee80211_stop_queues(mt76_hw(dev));
|
||||
if (ext_phy)
|
||||
@ -1462,26 +1463,27 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
|
||||
if (!mt7915_mac_restart(dev))
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
if (i == 10)
|
||||
dev_err(dev->mt76.dev, "chip full reset failed\n");
|
||||
|
||||
spin_lock_bh(&dev->mt76.sta_poll_lock);
|
||||
while (!list_empty(&dev->mt76.sta_poll_list))
|
||||
list_del_init(dev->mt76.sta_poll_list.next);
|
||||
spin_unlock_bh(&dev->mt76.sta_poll_lock);
|
||||
|
||||
memset(dev->mt76.wcid_mask, 0, sizeof(dev->mt76.wcid_mask));
|
||||
dev->mt76.vif_mask = 0;
|
||||
|
||||
i = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
|
||||
dev->mt76.global_wcid.idx = i;
|
||||
dev->recovery.hw_full_reset = false;
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
ieee80211_restart_hw(mt76_hw(dev));
|
||||
if (ext_phy)
|
||||
ieee80211_restart_hw(ext_phy->hw);
|
||||
|
||||
ieee80211_wake_queues(mt76_hw(dev));
|
||||
if (ext_phy)
|
||||
ieee80211_wake_queues(ext_phy->hw);
|
||||
|
||||
dev->recovery.hw_full_reset = false;
|
||||
ieee80211_queue_delayed_work(mt76_hw(dev), &dev->mphy.mac_work,
|
||||
MT7915_WATCHDOG_TIME);
|
||||
if (ext_phy)
|
||||
ieee80211_queue_delayed_work(ext_phy->hw,
|
||||
&ext_phy->mac_work,
|
||||
MT7915_WATCHDOG_TIME);
|
||||
}
|
||||
|
||||
/* system error recovery */
|
||||
@ -1537,12 +1539,14 @@ void mt7915_mac_reset_work(struct work_struct *work)
|
||||
set_bit(MT76_RESET, &phy2->mt76->state);
|
||||
cancel_delayed_work_sync(&phy2->mt76->mac_work);
|
||||
}
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
mt76_worker_disable(&dev->mt76.tx_worker);
|
||||
mt76_for_each_q_rx(&dev->mt76, i)
|
||||
napi_disable(&dev->mt76.napi[i]);
|
||||
napi_disable(&dev->mt76.tx_napi);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
if (mtk_wed_device_active(&dev->mt76.mmio.wed))
|
||||
mtk_wed_device_stop(&dev->mt76.mmio.wed);
|
||||
@ -1692,6 +1696,11 @@ void mt7915_reset(struct mt7915_dev *dev)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA)) {
|
||||
set_bit(MT76_MCU_RESET, &dev->mphy.state);
|
||||
wake_up(&dev->mt76.mcu.wait);
|
||||
}
|
||||
|
||||
queue_work(dev->mt76.wq, &dev->reset_work);
|
||||
wake_up(&dev->reset_wait);
|
||||
}
|
||||
|
@ -245,7 +245,9 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
|
||||
dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx);
|
||||
phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx);
|
||||
|
||||
idx = MT7915_WTBL_RESERVED - mvif->mt76.idx;
|
||||
idx = mt76_wcid_alloc(dev->mt76.wcid_mask, mt7915_wtbl_size(dev));
|
||||
if (idx < 0)
|
||||
return -ENOSPC;
|
||||
|
||||
INIT_LIST_HEAD(&mvif->sta.rc_list);
|
||||
INIT_LIST_HEAD(&mvif->sta.wcid.poll_list);
|
||||
@ -272,7 +274,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
|
||||
memset(&mvif->cap, -1, sizeof(mvif->cap));
|
||||
|
||||
mt7915_mcu_add_bss_info(phy, vif, true);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, true);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_PORT_SECURE, true);
|
||||
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
|
||||
|
||||
out:
|
||||
@ -291,7 +293,8 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw,
|
||||
int idx = msta->wcid.idx;
|
||||
|
||||
mt7915_mcu_add_bss_info(phy, vif, false);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, false);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_DISCONNECT, false);
|
||||
mt76_wcid_mask_clear(dev->mt76.wcid_mask, mvif->sta.wcid.idx);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
mt76_testmode_reset(phy->mt76, true);
|
||||
@ -317,18 +320,12 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw,
|
||||
mt76_wcid_cleanup(&dev->mt76, &msta->wcid);
|
||||
}
|
||||
|
||||
int mt7915_set_channel(struct mt7915_phy *phy)
|
||||
int mt7915_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
struct mt7915_phy *phy = mphy->priv;
|
||||
struct mt7915_dev *dev = phy->dev;
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&phy->mt76->mac_work);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
set_bit(MT76_RESET, &phy->mt76->state);
|
||||
|
||||
mt76_set_channel(phy->mt76);
|
||||
|
||||
if (dev->cal) {
|
||||
ret = mt7915_mcu_apply_tx_dpd(phy);
|
||||
if (ret)
|
||||
@ -347,11 +344,6 @@ int mt7915_set_channel(struct mt7915_phy *phy)
|
||||
phy->noise = 0;
|
||||
|
||||
out:
|
||||
clear_bit(MT76_RESET, &phy->mt76->state);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
mt76_txq_schedule_all(phy->mt76);
|
||||
|
||||
if (!mt76_testmode_enabled(phy->mt76))
|
||||
ieee80211_queue_delayed_work(phy->mt76->hw,
|
||||
&phy->mt76->mac_work,
|
||||
@ -374,6 +366,9 @@ static int mt7915_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
int idx = key->keyidx;
|
||||
int err = 0;
|
||||
|
||||
if (sta && !wcid->sta)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* The hardware does not support per-STA RX GTK, fallback
|
||||
* to software mode for these.
|
||||
*/
|
||||
@ -464,11 +459,9 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
#endif
|
||||
ieee80211_stop_queues(hw);
|
||||
ret = mt7915_set_channel(phy);
|
||||
ret = mt76_update_channel(phy->mt76);
|
||||
if (ret)
|
||||
return ret;
|
||||
ieee80211_wake_queues(hw);
|
||||
}
|
||||
|
||||
if (changed & (IEEE80211_CONF_CHANGE_POWER |
|
||||
@ -564,8 +557,7 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
|
||||
|
||||
MT76_FILTER(CONTROL, MT_WF_RFCR_DROP_CTS |
|
||||
MT_WF_RFCR_DROP_RTS |
|
||||
MT_WF_RFCR_DROP_CTL_RSV |
|
||||
MT_WF_RFCR_DROP_NDPA);
|
||||
MT_WF_RFCR_DROP_CTL_RSV);
|
||||
|
||||
*total_flags = flags;
|
||||
rxfilter = phy->rxfilter;
|
||||
@ -633,7 +625,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
|
||||
if (set_bss_info == 1)
|
||||
mt7915_mcu_add_bss_info(phy, vif, true);
|
||||
if (set_sta == 1)
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, true);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_PORT_SECURE, false);
|
||||
|
||||
if (changed & BSS_CHANGED_ERP_CTS_PROT)
|
||||
mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot);
|
||||
@ -668,7 +660,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
|
||||
if (set_bss_info == 0)
|
||||
mt7915_mcu_add_bss_info(phy, vif, false);
|
||||
if (set_sta == 0)
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, false);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_DISCONNECT, false);
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
@ -706,7 +698,7 @@ mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
err = mt7915_mcu_add_bss_info(phy, vif, true);
|
||||
if (err)
|
||||
goto out;
|
||||
err = mt7915_mcu_add_sta(dev, vif, NULL, true);
|
||||
err = mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_PORT_SECURE, false);
|
||||
out:
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
@ -720,7 +712,7 @@ mt7915_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct mt7915_dev *dev = mt7915_hw_dev(hw);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, false);
|
||||
mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_DISCONNECT, false);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
@ -743,8 +735,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
||||
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
||||
bool ext_phy = mvif->phy != &dev->phy;
|
||||
int ret, idx;
|
||||
u32 addr;
|
||||
int idx;
|
||||
|
||||
idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
|
||||
if (idx < 0)
|
||||
@ -753,25 +744,61 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
INIT_LIST_HEAD(&msta->rc_list);
|
||||
INIT_LIST_HEAD(&msta->wcid.poll_list);
|
||||
msta->vif = mvif;
|
||||
msta->wcid.sta = 1;
|
||||
msta->wcid.sta_disabled = 1;
|
||||
msta->wcid.idx = idx;
|
||||
msta->wcid.phy_idx = ext_phy;
|
||||
msta->wcid.tx_info |= MT_WCID_TX_INFO_SET;
|
||||
msta->jiffies = jiffies;
|
||||
|
||||
ewma_avg_signal_init(&msta->avg_ack_signal);
|
||||
|
||||
mt7915_mac_wtbl_update(dev, idx,
|
||||
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
|
||||
mt7915_mcu_add_sta(dev, vif, sta, CONN_STATE_DISCONNECT, true);
|
||||
|
||||
ret = mt7915_mcu_add_sta(dev, vif, sta, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 30);
|
||||
mt76_rmw_field(dev, addr, GENMASK(7, 0), 0xa0);
|
||||
int mt7915_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev)
|
||||
{
|
||||
struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
||||
int i, ret;
|
||||
u32 addr;
|
||||
|
||||
return mt7915_mcu_add_rate_ctrl(dev, vif, sta, false);
|
||||
switch (ev) {
|
||||
case MT76_STA_EVENT_ASSOC:
|
||||
ret = mt7915_mcu_add_sta(dev, vif, sta, CONN_STATE_CONNECT, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 30);
|
||||
mt76_rmw_field(dev, addr, GENMASK(7, 0), 0xa0);
|
||||
|
||||
ret = mt7915_mcu_add_rate_ctrl(dev, vif, sta, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
msta->wcid.tx_info |= MT_WCID_TX_INFO_SET;
|
||||
msta->wcid.sta = 1;
|
||||
msta->wcid.sta_disabled = 0;
|
||||
|
||||
return 0;
|
||||
|
||||
case MT76_STA_EVENT_AUTHORIZE:
|
||||
return mt7915_mcu_add_sta(dev, vif, sta, CONN_STATE_PORT_SECURE, false);
|
||||
|
||||
case MT76_STA_EVENT_DISASSOC:
|
||||
for (i = 0; i < ARRAY_SIZE(msta->twt.flow); i++)
|
||||
mt7915_mac_twt_teardown_flow(dev, msta, i);
|
||||
|
||||
mt7915_mcu_add_sta(dev, vif, sta, CONN_STATE_DISCONNECT, false);
|
||||
msta->wcid.sta_disabled = 1;
|
||||
msta->wcid.sta = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
@ -779,16 +806,10 @@ void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
{
|
||||
struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
||||
int i;
|
||||
|
||||
mt7915_mcu_add_sta(dev, vif, sta, false);
|
||||
|
||||
mt7915_mac_wtbl_update(dev, msta->wcid.idx,
|
||||
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(msta->twt.flow); i++)
|
||||
mt7915_mac_twt_teardown_flow(dev, msta, i);
|
||||
|
||||
spin_lock_bh(&mdev->sta_poll_lock);
|
||||
if (!list_empty(&msta->wcid.poll_list))
|
||||
list_del_init(&msta->wcid.poll_list);
|
||||
@ -895,22 +916,6 @@ mt7915_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
return mt76_sta_state(hw, vif, sta, IEEE80211_STA_NOTEXIST,
|
||||
IEEE80211_STA_NONE);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
return mt76_sta_state(hw, vif, sta, IEEE80211_STA_NONE,
|
||||
IEEE80211_STA_NOTEXIST);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_get_stats(struct ieee80211_hw *hw,
|
||||
struct ieee80211_low_level_stats *stats)
|
||||
@ -1089,8 +1094,7 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
|
||||
struct rate_info *txrate = &msta->wcid.rate;
|
||||
struct rate_info rxrate = {};
|
||||
|
||||
if (is_mt7915(&phy->dev->mt76) &&
|
||||
!mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate)) {
|
||||
if (!mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate)) {
|
||||
sinfo->rxrate = rxrate;
|
||||
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE);
|
||||
}
|
||||
@ -1164,6 +1168,10 @@ static void mt7915_sta_rc_update(struct ieee80211_hw *hw,
|
||||
{
|
||||
struct mt7915_phy *phy = mt7915_hw_phy(hw);
|
||||
struct mt7915_dev *dev = phy->dev;
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
||||
|
||||
if (!msta->wcid.sta)
|
||||
return;
|
||||
|
||||
mt7915_sta_rc_work(&changed, sta);
|
||||
ieee80211_queue_work(hw, &dev->rc_work);
|
||||
@ -1207,6 +1215,9 @@ static void mt7915_sta_set_4addr(struct ieee80211_hw *hw,
|
||||
else
|
||||
clear_bit(MT_WCID_FLAG_4ADDR, &msta->wcid.flags);
|
||||
|
||||
if (!msta->wcid.sta)
|
||||
return;
|
||||
|
||||
mt76_connac_mcu_wtbl_update_hdr_trans(&dev->mt76, vif, sta);
|
||||
}
|
||||
|
||||
@ -1223,6 +1234,9 @@ static void mt7915_sta_set_decap_offload(struct ieee80211_hw *hw,
|
||||
else
|
||||
clear_bit(MT_WCID_FLAG_HDR_TRANS, &msta->wcid.flags);
|
||||
|
||||
if (!msta->wcid.sta)
|
||||
return;
|
||||
|
||||
mt76_connac_mcu_wtbl_update_hdr_trans(&dev->mt76, vif, sta);
|
||||
}
|
||||
|
||||
@ -1578,6 +1592,12 @@ mt7915_twt_teardown_request(struct ieee80211_hw *hw,
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_set_frag_threshold(struct ieee80211_hw *hw, u32 val)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_set_radar_background(struct ieee80211_hw *hw,
|
||||
struct cfg80211_chan_def *chandef)
|
||||
@ -1660,6 +1680,17 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
mt7915_reconfig_complete(struct ieee80211_hw *hw,
|
||||
enum ieee80211_reconfig_type reconfig_type)
|
||||
{
|
||||
struct mt7915_phy *phy = mt7915_hw_phy(hw);
|
||||
|
||||
ieee80211_wake_queues(hw);
|
||||
ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
|
||||
MT7915_WATCHDOG_TIME);
|
||||
}
|
||||
|
||||
const struct ieee80211_ops mt7915_ops = {
|
||||
.add_chanctx = ieee80211_emulate_add_chanctx,
|
||||
.remove_chanctx = ieee80211_emulate_remove_chanctx,
|
||||
@ -1676,8 +1707,7 @@ const struct ieee80211_ops mt7915_ops = {
|
||||
.bss_info_changed = mt7915_bss_info_changed,
|
||||
.start_ap = mt7915_start_ap,
|
||||
.stop_ap = mt7915_stop_ap,
|
||||
.sta_add = mt7915_sta_add,
|
||||
.sta_remove = mt7915_sta_remove,
|
||||
.sta_state = mt76_sta_state,
|
||||
.sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
|
||||
.sta_rc_update = mt7915_sta_rc_update,
|
||||
.set_key = mt7915_set_key,
|
||||
@ -1708,6 +1738,7 @@ const struct ieee80211_ops mt7915_ops = {
|
||||
.sta_set_decap_offload = mt7915_sta_set_decap_offload,
|
||||
.add_twt_setup = mt7915_mac_add_twt_setup,
|
||||
.twt_teardown_request = mt7915_twt_teardown_request,
|
||||
.set_frag_threshold = mt7915_set_frag_threshold,
|
||||
CFG80211_TESTMODE_CMD(mt76_testmode_cmd)
|
||||
CFG80211_TESTMODE_DUMP(mt76_testmode_dump)
|
||||
#ifdef CONFIG_MAC80211_DEBUGFS
|
||||
@ -1718,4 +1749,5 @@ const struct ieee80211_ops mt7915_ops = {
|
||||
.net_fill_forward_path = mt7915_net_fill_forward_path,
|
||||
.net_setup_tc = mt76_wed_net_setup_tc,
|
||||
#endif
|
||||
.reconfig_complete = mt7915_reconfig_complete,
|
||||
};
|
||||
|
@ -157,12 +157,21 @@ static int
|
||||
mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
|
||||
struct sk_buff *skb, int seq)
|
||||
{
|
||||
struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
|
||||
struct mt76_connac2_mcu_rxd *rxd;
|
||||
int ret = 0;
|
||||
|
||||
if (!skb) {
|
||||
dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
|
||||
cmd, seq);
|
||||
|
||||
if (!test_and_set_bit(MT76_MCU_RESET, &dev->mphy.state)) {
|
||||
dev->recovery.restart = true;
|
||||
wake_up(&dev->mt76.mcu.wait);
|
||||
queue_work(dev->mt76.wq, &dev->reset_work);
|
||||
wake_up(&dev->reset_wait);
|
||||
}
|
||||
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
@ -191,11 +200,6 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
|
||||
{
|
||||
struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
|
||||
enum mt76_mcuq_id qid;
|
||||
int ret;
|
||||
|
||||
ret = mt76_connac2_mcu_fill_message(mdev, skb, cmd, wait_seq);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (cmd == MCU_CMD(FW_SCATTER))
|
||||
qid = MT_MCUQ_FWDL;
|
||||
@ -293,7 +297,7 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)
|
||||
&dev->rdd2_chandef,
|
||||
GFP_ATOMIC);
|
||||
else
|
||||
ieee80211_radar_detected(mphy->hw);
|
||||
ieee80211_radar_detected(mphy->hw, NULL);
|
||||
dev->hw_pattern++;
|
||||
}
|
||||
|
||||
@ -690,13 +694,17 @@ int mt7915_mcu_add_tx_ba(struct mt7915_dev *dev,
|
||||
{
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)params->sta->drv_priv;
|
||||
struct mt7915_vif *mvif = msta->vif;
|
||||
int ret;
|
||||
|
||||
mt76_worker_disable(&dev->mt76.tx_worker);
|
||||
if (enable && !params->amsdu)
|
||||
msta->wcid.amsdu = false;
|
||||
ret = mt76_connac_mcu_sta_ba(&dev->mt76, &mvif->mt76, params,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE),
|
||||
enable, true);
|
||||
mt76_worker_enable(&dev->mt76.tx_worker);
|
||||
|
||||
return mt76_connac_mcu_sta_ba(&dev->mt76, &mvif->mt76, params,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE),
|
||||
enable, true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mt7915_mcu_add_rx_ba(struct mt7915_dev *dev,
|
||||
@ -1653,7 +1661,7 @@ mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
}
|
||||
|
||||
int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, bool enable)
|
||||
struct ieee80211_sta *sta, int conn_state, bool newly)
|
||||
{
|
||||
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
||||
struct ieee80211_link_sta *link_sta;
|
||||
@ -1670,13 +1678,10 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
return PTR_ERR(skb);
|
||||
|
||||
/* starec basic */
|
||||
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, link_sta, enable,
|
||||
!rcu_access_pointer(dev->mt76.wcid[msta->wcid.idx]));
|
||||
if (!enable)
|
||||
goto out;
|
||||
|
||||
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, link_sta,
|
||||
conn_state, newly);
|
||||
/* tag order is in accordance with firmware dependency. */
|
||||
if (sta) {
|
||||
if (sta && conn_state != CONN_STATE_DISCONNECT) {
|
||||
/* starec bfer */
|
||||
mt7915_mcu_sta_bfer_tlv(dev, skb, vif, sta);
|
||||
/* starec ht */
|
||||
@ -1687,12 +1692,17 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
mt76_connac_mcu_sta_uapsd(skb, vif, sta);
|
||||
}
|
||||
|
||||
ret = mt7915_mcu_sta_wtbl_tlv(dev, skb, vif, sta);
|
||||
if (ret) {
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
if (newly || conn_state != CONN_STATE_DISCONNECT) {
|
||||
ret = mt7915_mcu_sta_wtbl_tlv(dev, skb, vif, sta);
|
||||
if (ret) {
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (conn_state == CONN_STATE_DISCONNECT)
|
||||
goto out;
|
||||
|
||||
if (sta) {
|
||||
/* starec amsdu */
|
||||
mt7915_mcu_sta_amsdu_tlv(dev, skb, vif, sta);
|
||||
@ -2352,6 +2362,8 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
mt76_connac_mcu_del_wtbl_all(&dev->mt76);
|
||||
|
||||
if ((mtk_wed_device_active(&dev->mt76.mmio.wed) &&
|
||||
is_mt7915(&dev->mt76)) ||
|
||||
!mtk_wed_get_rx_capa(&dev->mt76.mmio.wed))
|
||||
@ -2376,7 +2388,9 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
|
||||
int mt7915_mcu_init(struct mt7915_dev *dev)
|
||||
{
|
||||
static const struct mt76_mcu_ops mt7915_mcu_ops = {
|
||||
.max_retry = 3,
|
||||
.headroom = sizeof(struct mt76_connac2_mcu_txd),
|
||||
.mcu_skb_prepare_msg = mt76_connac2_mcu_fill_message,
|
||||
.mcu_skb_send_msg = mt7915_mcu_send_message,
|
||||
.mcu_parse_response = mt7915_mcu_parse_response,
|
||||
};
|
||||
@ -2747,7 +2761,7 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
|
||||
|
||||
if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR)
|
||||
req.switch_reason = CH_SWITCH_NORMAL;
|
||||
else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL ||
|
||||
else if (phy->mt76->offchannel ||
|
||||
phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE)
|
||||
req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
|
||||
else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
|
||||
|
@ -29,7 +29,7 @@ struct mt7915_mcu_thermal_ctrl {
|
||||
} __packed;
|
||||
|
||||
struct mt7915_mcu_thermal_notify {
|
||||
struct mt76_connac2_mcu_rxd rxd;
|
||||
struct mt76_connac2_mcu_rxd_hdr rxd;
|
||||
|
||||
struct mt7915_mcu_thermal_ctrl ctrl;
|
||||
__le32 temperature;
|
||||
@ -37,7 +37,7 @@ struct mt7915_mcu_thermal_notify {
|
||||
} __packed;
|
||||
|
||||
struct mt7915_mcu_csa_notify {
|
||||
struct mt76_connac2_mcu_rxd rxd;
|
||||
struct mt76_connac2_mcu_rxd_hdr rxd;
|
||||
|
||||
u8 omac_idx;
|
||||
u8 csa_count;
|
||||
@ -46,7 +46,7 @@ struct mt7915_mcu_csa_notify {
|
||||
} __packed;
|
||||
|
||||
struct mt7915_mcu_bcc_notify {
|
||||
struct mt76_connac2_mcu_rxd rxd;
|
||||
struct mt76_connac2_mcu_rxd_hdr rxd;
|
||||
|
||||
u8 band_idx;
|
||||
u8 omac_idx;
|
||||
@ -55,7 +55,7 @@ struct mt7915_mcu_bcc_notify {
|
||||
} __packed;
|
||||
|
||||
struct mt7915_mcu_rdd_report {
|
||||
struct mt76_connac2_mcu_rxd rxd;
|
||||
struct mt76_connac2_mcu_rxd_hdr rxd;
|
||||
|
||||
u8 band_idx;
|
||||
u8 long_detected;
|
||||
|
@ -927,8 +927,10 @@ struct mt7915_dev *mt7915_mmio_probe(struct device *pdev,
|
||||
.rx_check = mt7915_rx_check,
|
||||
.rx_poll_complete = mt7915_rx_poll_complete,
|
||||
.sta_add = mt7915_mac_sta_add,
|
||||
.sta_event = mt7915_mac_sta_event,
|
||||
.sta_remove = mt7915_mac_sta_remove,
|
||||
.update_survey = mt7915_update_channel,
|
||||
.set_channel = mt7915_set_channel,
|
||||
};
|
||||
struct mt7915_dev *dev;
|
||||
struct mt76_dev *mdev;
|
||||
|
@ -444,7 +444,7 @@ int mt7915_mcu_add_dev_info(struct mt7915_phy *phy,
|
||||
int mt7915_mcu_add_bss_info(struct mt7915_phy *phy,
|
||||
struct ieee80211_vif *vif, int enable);
|
||||
int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, bool enable);
|
||||
struct ieee80211_sta *sta, int conn_state, bool newly);
|
||||
int mt7915_mcu_add_tx_ba(struct mt7915_dev *dev,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
bool add);
|
||||
@ -463,7 +463,7 @@ int mt7915_mcu_add_rate_ctrl(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, bool changed);
|
||||
int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
int mt7915_set_channel(struct mt7915_phy *phy);
|
||||
int mt7915_set_channel(struct mt76_phy *mphy);
|
||||
int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd);
|
||||
int mt7915_mcu_set_tx(struct mt7915_dev *dev, struct ieee80211_vif *vif);
|
||||
int mt7915_mcu_update_edca(struct mt7915_dev *dev, void *req);
|
||||
@ -560,6 +560,8 @@ void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
|
||||
void mt7915_mac_set_timing(struct mt7915_phy *phy);
|
||||
int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
int mt7915_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev);
|
||||
void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
void mt7915_mac_work(struct work_struct *work);
|
||||
|
@ -404,6 +404,7 @@ static void
|
||||
mt7915_tm_init(struct mt7915_phy *phy, bool en)
|
||||
{
|
||||
struct mt7915_dev *dev = phy->dev;
|
||||
int state;
|
||||
|
||||
if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state))
|
||||
return;
|
||||
@ -415,7 +416,8 @@ mt7915_tm_init(struct mt7915_phy *phy, bool en)
|
||||
mt7915_tm_set_trx(phy, TM_MAC_TXRX, !en);
|
||||
|
||||
mt7915_mcu_add_bss_info(phy, phy->monitor_vif, en);
|
||||
mt7915_mcu_add_sta(dev, phy->monitor_vif, NULL, en);
|
||||
state = en ? CONN_STATE_PORT_SECURE : CONN_STATE_DISCONNECT;
|
||||
mt7915_mcu_add_sta(dev, phy->monitor_vif, NULL, state, true);
|
||||
|
||||
if (!en)
|
||||
mt7915_tm_set_tam_arb(phy, en, 0);
|
||||
@ -425,7 +427,7 @@ static void
|
||||
mt7915_tm_update_channel(struct mt7915_phy *phy)
|
||||
{
|
||||
mutex_unlock(&phy->dev->mt76.mutex);
|
||||
mt7915_set_channel(phy);
|
||||
mt76_update_channel(phy->mt76);
|
||||
mutex_lock(&phy->dev->mt76.mutex);
|
||||
|
||||
mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD(SET_RX_PATH));
|
||||
|
@ -52,6 +52,8 @@ static int mt7921_thermal_init(struct mt792x_phy *phy)
|
||||
|
||||
name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7921_%s",
|
||||
wiphy_name(wiphy));
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
||||
hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy,
|
||||
mt7921_hwmon_groups);
|
||||
@ -83,7 +85,7 @@ mt7921_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
|
||||
}
|
||||
|
||||
/* UNII-4 */
|
||||
if (IS_UNII_INVALID(0, 5850, 5925))
|
||||
if (IS_UNII_INVALID(0, 5845, 5925))
|
||||
ch->flags |= IEEE80211_CHAN_DISABLED;
|
||||
}
|
||||
|
||||
|
@ -455,37 +455,30 @@ static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw,
|
||||
return mt7921_abort_roc(phy, mvif);
|
||||
}
|
||||
|
||||
static int mt7921_set_channel(struct mt792x_phy *phy)
|
||||
int mt7921_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
struct mt792x_phy *phy = mphy->priv;
|
||||
struct mt792x_dev *dev = phy->dev;
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&phy->mt76->mac_work);
|
||||
|
||||
mt792x_mutex_acquire(dev);
|
||||
set_bit(MT76_RESET, &phy->mt76->state);
|
||||
|
||||
mt76_set_channel(phy->mt76);
|
||||
|
||||
mt76_connac_pm_wake(mphy, &dev->pm);
|
||||
ret = mt7921_mcu_set_chan_info(phy, MCU_EXT_CMD(CHANNEL_SWITCH));
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
mt792x_mac_set_timeing(phy);
|
||||
|
||||
mt792x_mac_reset_counters(phy);
|
||||
phy->noise = 0;
|
||||
|
||||
out:
|
||||
clear_bit(MT76_RESET, &phy->mt76->state);
|
||||
mt792x_mutex_release(dev);
|
||||
mt76_connac_power_save_sched(mphy, &dev->pm);
|
||||
|
||||
mt76_worker_schedule(&dev->mt76.tx_worker);
|
||||
ieee80211_queue_delayed_work(phy->mt76->hw, &phy->mt76->mac_work,
|
||||
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
|
||||
MT792x_WATCHDOG_TIME);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7921_set_channel);
|
||||
|
||||
static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
|
||||
@ -620,11 +613,9 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
|
||||
int ret = 0;
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
ieee80211_stop_queues(hw);
|
||||
ret = mt7921_set_channel(phy);
|
||||
ret = mt76_update_channel(phy->mt76);
|
||||
if (ret)
|
||||
return ret;
|
||||
ieee80211_wake_queues(hw);
|
||||
}
|
||||
|
||||
mt792x_mutex_acquire(dev);
|
||||
@ -831,13 +822,16 @@ int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7921_mac_sta_add);
|
||||
|
||||
void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
int mt7921_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev)
|
||||
{
|
||||
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
|
||||
struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
|
||||
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
|
||||
|
||||
if (ev != MT76_STA_EVENT_ASSOC)
|
||||
return 0;
|
||||
|
||||
mt792x_mutex_acquire(dev);
|
||||
|
||||
if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
|
||||
@ -853,8 +847,10 @@ void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
mt7921_mcu_sta_update(dev, sta, vif, true, MT76_STA_INFO_STATE_ASSOC);
|
||||
|
||||
mt792x_mutex_release(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7921_mac_sta_assoc);
|
||||
EXPORT_SYMBOL_GPL(mt7921_mac_sta_event);
|
||||
|
||||
void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
|
@ -890,7 +890,7 @@ int mt7921_mcu_set_chan_info(struct mt792x_phy *phy, int cmd)
|
||||
if (cmd == MCU_EXT_CMD(SET_RX_PATH) ||
|
||||
dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR)
|
||||
req.switch_reason = CH_SWITCH_NORMAL;
|
||||
else if (dev->mt76.hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
|
||||
else if (phy->mt76->offchannel)
|
||||
req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
|
||||
else if (!cfg80211_reg_can_beacon(dev->mt76.hw->wiphy, chandef,
|
||||
NL80211_IFTYPE_AP))
|
||||
|
@ -186,6 +186,7 @@ int __mt7921_start(struct mt792x_phy *phy);
|
||||
int mt7921_register_device(struct mt792x_dev *dev);
|
||||
void mt7921_unregister_device(struct mt792x_dev *dev);
|
||||
int mt7921_run_firmware(struct mt792x_dev *dev);
|
||||
int mt7921_set_channel(struct mt76_phy *mphy);
|
||||
int mt7921_mcu_set_bss_pm(struct mt792x_dev *dev, struct ieee80211_vif *vif,
|
||||
bool enable);
|
||||
int mt7921_mcu_sta_update(struct mt792x_dev *dev, struct ieee80211_sta *sta,
|
||||
@ -244,8 +245,8 @@ int mt7921_mac_init(struct mt792x_dev *dev);
|
||||
bool mt7921_mac_wtbl_update(struct mt792x_dev *dev, int idx, u32 mask);
|
||||
int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
int mt7921_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev);
|
||||
void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
void mt7921_mac_reset_work(struct work_struct *work);
|
||||
|
@ -244,9 +244,10 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
|
||||
.rx_skb = mt7921_queue_rx_skb,
|
||||
.rx_poll_complete = mt792x_rx_poll_complete,
|
||||
.sta_add = mt7921_mac_sta_add,
|
||||
.sta_assoc = mt7921_mac_sta_assoc,
|
||||
.sta_event = mt7921_mac_sta_event,
|
||||
.sta_remove = mt7921_mac_sta_remove,
|
||||
.update_survey = mt792x_update_channel,
|
||||
.set_channel = mt7921_set_channel,
|
||||
};
|
||||
static const struct mt792x_hif_ops mt7921_pcie_ops = {
|
||||
.init_reset = mt7921e_init_reset,
|
||||
|
@ -100,9 +100,10 @@ static int mt7921s_probe(struct sdio_func *func,
|
||||
.rx_skb = mt7921_queue_rx_skb,
|
||||
.rx_check = mt7921_rx_check,
|
||||
.sta_add = mt7921_mac_sta_add,
|
||||
.sta_assoc = mt7921_mac_sta_assoc,
|
||||
.sta_event = mt7921_mac_sta_event,
|
||||
.sta_remove = mt7921_mac_sta_remove,
|
||||
.update_survey = mt792x_update_channel,
|
||||
.set_channel = mt7921_set_channel,
|
||||
};
|
||||
static const struct mt76_bus_ops mt7921s_ops = {
|
||||
.rr = mt76s_rr,
|
||||
|
@ -151,9 +151,10 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
|
||||
.rx_skb = mt7921_queue_rx_skb,
|
||||
.rx_check = mt7921_rx_check,
|
||||
.sta_add = mt7921_mac_sta_add,
|
||||
.sta_assoc = mt7921_mac_sta_assoc,
|
||||
.sta_event = mt7921_mac_sta_event,
|
||||
.sta_remove = mt7921_mac_sta_remove,
|
||||
.update_survey = mt792x_update_channel,
|
||||
.set_channel = mt7921_set_channel,
|
||||
};
|
||||
static const struct mt792x_hif_ops hif_ops = {
|
||||
.mcu_init = mt7921u_mcu_init,
|
||||
|
@ -352,7 +352,7 @@ mt7925_mac_fill_rx_rate(struct mt792x_dev *dev,
|
||||
static int
|
||||
mt7925_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)
|
||||
{
|
||||
u32 csum_mask = MT_RXD0_NORMAL_IP_SUM | MT_RXD0_NORMAL_UDP_TCP_SUM;
|
||||
u32 csum_mask = MT_RXD3_NORMAL_IP_SUM | MT_RXD3_NORMAL_UDP_TCP_SUM;
|
||||
struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb;
|
||||
bool hdr_trans, unicast, insert_ccmp_hdr = false;
|
||||
u8 chfreq, qos_ctl = 0, remove_pad, amsdu_info;
|
||||
@ -362,7 +362,6 @@ mt7925_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)
|
||||
struct mt792x_phy *phy = &dev->phy;
|
||||
struct ieee80211_supported_band *sband;
|
||||
u32 csum_status = *(u32 *)skb->cb;
|
||||
u32 rxd0 = le32_to_cpu(rxd[0]);
|
||||
u32 rxd1 = le32_to_cpu(rxd[1]);
|
||||
u32 rxd2 = le32_to_cpu(rxd[2]);
|
||||
u32 rxd3 = le32_to_cpu(rxd[3]);
|
||||
@ -420,7 +419,7 @@ mt7925_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)
|
||||
if (!sband->channels)
|
||||
return -EINVAL;
|
||||
|
||||
if (mt76_is_mmio(&dev->mt76) && (rxd0 & csum_mask) == csum_mask &&
|
||||
if (mt76_is_mmio(&dev->mt76) && (rxd3 & csum_mask) == csum_mask &&
|
||||
!(csum_status & (BIT(0) | BIT(2) | BIT(3))))
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
|
||||
|
@ -439,6 +439,19 @@ static void mt7925_roc_iter(void *priv, u8 *mac,
|
||||
mt7925_mcu_abort_roc(phy, &mvif->bss_conf, phy->roc_token_id);
|
||||
}
|
||||
|
||||
void mt7925_roc_abort_sync(struct mt792x_dev *dev)
|
||||
{
|
||||
struct mt792x_phy *phy = &dev->phy;
|
||||
|
||||
del_timer_sync(&phy->roc_timer);
|
||||
cancel_work_sync(&phy->roc_work);
|
||||
if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
|
||||
ieee80211_iterate_interfaces(mt76_hw(dev),
|
||||
IEEE80211_IFACE_ITER_RESUME_ALL,
|
||||
mt7925_roc_iter, (void *)phy);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7925_roc_abort_sync);
|
||||
|
||||
void mt7925_roc_work(struct work_struct *work)
|
||||
{
|
||||
struct mt792x_phy *phy;
|
||||
@ -1078,23 +1091,26 @@ static void mt7925_mac_link_sta_assoc(struct mt76_dev *mdev,
|
||||
mt792x_mutex_release(dev);
|
||||
}
|
||||
|
||||
void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
int mt7925_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev)
|
||||
{
|
||||
struct ieee80211_link_sta *link_sta = &sta->deflink;
|
||||
|
||||
if (ev != MT76_STA_EVENT_ASSOC)
|
||||
return 0;
|
||||
|
||||
if (ieee80211_vif_is_mld(vif)) {
|
||||
struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
|
||||
struct ieee80211_link_sta *link_sta;
|
||||
|
||||
link_sta = mt792x_sta_to_link_sta(vif, sta, msta->deflink_id);
|
||||
|
||||
mt7925_mac_set_links(mdev, vif);
|
||||
|
||||
mt7925_mac_link_sta_assoc(mdev, vif, link_sta);
|
||||
} else {
|
||||
mt7925_mac_link_sta_assoc(mdev, vif, &sta->deflink);
|
||||
}
|
||||
|
||||
mt7925_mac_link_sta_assoc(mdev, vif, link_sta);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt7925_mac_sta_assoc);
|
||||
EXPORT_SYMBOL_GPL(mt7925_mac_sta_event);
|
||||
|
||||
static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
|
||||
struct ieee80211_vif *vif,
|
||||
@ -1109,6 +1125,8 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
|
||||
msta = (struct mt792x_sta *)link_sta->sta->drv_priv;
|
||||
mlink = mt792x_sta_to_link(msta, link_id);
|
||||
|
||||
mt7925_roc_abort_sync(dev);
|
||||
|
||||
mt76_connac_free_pending_tx_skbs(&dev->pm, &mlink->wcid);
|
||||
mt76_connac_pm_wake(&dev->mphy, &dev->pm);
|
||||
|
||||
|
@ -638,6 +638,9 @@ static int mt7925_load_clc(struct mt792x_dev *dev, const char *fw_name)
|
||||
for (offset = 0; offset < len; offset += le32_to_cpu(clc->len)) {
|
||||
clc = (const struct mt7925_clc *)(clc_base + offset);
|
||||
|
||||
if (clc->idx > ARRAY_SIZE(phy->clc))
|
||||
break;
|
||||
|
||||
/* do not init buf again if chip reset triggered */
|
||||
if (phy->clc[clc->idx])
|
||||
continue;
|
||||
@ -1770,16 +1773,19 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
|
||||
struct mt76_vif *mvif = (struct mt76_vif *)info->vif->drv_priv;
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
struct sk_buff *skb;
|
||||
int conn_state;
|
||||
|
||||
skb = __mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid,
|
||||
MT7925_STA_UPDATE_MAX_SIZE);
|
||||
if (IS_ERR(skb))
|
||||
return PTR_ERR(skb);
|
||||
|
||||
conn_state = info->enable ? CONN_STATE_PORT_SECURE :
|
||||
CONN_STATE_DISCONNECT;
|
||||
if (info->link_sta)
|
||||
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
|
||||
info->link_sta,
|
||||
info->enable, info->newly);
|
||||
conn_state, info->newly);
|
||||
if (info->link_sta && info->enable) {
|
||||
mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta);
|
||||
mt7925_mcu_sta_ht_tlv(skb, info->link_sta);
|
||||
@ -2171,12 +2177,12 @@ void mt7925_mcu_bss_rlm_tlv(struct sk_buff *skb, struct mt76_phy *phy,
|
||||
|
||||
tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_RLM, sizeof(*req));
|
||||
req = (struct bss_rlm_tlv *)tlv;
|
||||
req->control_channel = chandef->chan->hw_value,
|
||||
req->center_chan = ieee80211_frequency_to_channel(freq1),
|
||||
req->center_chan2 = ieee80211_frequency_to_channel(freq2),
|
||||
req->tx_streams = hweight8(phy->antenna_mask),
|
||||
req->ht_op_info = 4, /* set HT 40M allowed */
|
||||
req->rx_streams = hweight8(phy->antenna_mask),
|
||||
req->control_channel = chandef->chan->hw_value;
|
||||
req->center_chan = ieee80211_frequency_to_channel(freq1);
|
||||
req->center_chan2 = ieee80211_frequency_to_channel(freq2);
|
||||
req->tx_streams = hweight8(phy->antenna_mask);
|
||||
req->ht_op_info = 4; /* set HT 40M allowed */
|
||||
req->rx_streams = hweight8(phy->antenna_mask);
|
||||
req->band = band;
|
||||
|
||||
switch (chandef->width) {
|
||||
|
@ -219,8 +219,8 @@ int mt7925_mac_init(struct mt792x_dev *dev);
|
||||
int mt7925_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
bool mt7925_mac_wtbl_update(struct mt792x_dev *dev, int idx, u32 mask);
|
||||
void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
int mt7925_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, enum mt76_sta_event ev);
|
||||
void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta);
|
||||
void mt7925_mac_reset_work(struct work_struct *work);
|
||||
@ -307,6 +307,7 @@ int mt7925_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
|
||||
enum mt7925_roc_req type, u8 token_id);
|
||||
int mt7925_mcu_abort_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
|
||||
u8 token_id);
|
||||
void mt7925_roc_abort_sync(struct mt792x_dev *dev);
|
||||
int mt7925_mcu_fill_message(struct mt76_dev *mdev, struct sk_buff *skb,
|
||||
int cmd, int *wait_seq);
|
||||
int mt7925_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
|
@ -279,7 +279,7 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
|
||||
.rx_skb = mt7925_queue_rx_skb,
|
||||
.rx_poll_complete = mt792x_rx_poll_complete,
|
||||
.sta_add = mt7925_mac_sta_add,
|
||||
.sta_assoc = mt7925_mac_sta_assoc,
|
||||
.sta_event = mt7925_mac_sta_event,
|
||||
.sta_remove = mt7925_mac_sta_remove,
|
||||
.update_survey = mt792x_update_channel,
|
||||
};
|
||||
@ -449,6 +449,8 @@ static int mt7925_pci_suspend(struct device *device)
|
||||
cancel_delayed_work_sync(&pm->ps_work);
|
||||
cancel_work_sync(&pm->wake_work);
|
||||
|
||||
mt7925_roc_abort_sync(dev);
|
||||
|
||||
err = mt792x_mcu_drv_pmctrl(dev);
|
||||
if (err < 0)
|
||||
goto restore_suspend;
|
||||
|
@ -142,7 +142,7 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
|
||||
.rx_skb = mt7925_queue_rx_skb,
|
||||
.rx_check = mt7925_rx_check,
|
||||
.sta_add = mt7925_mac_sta_add,
|
||||
.sta_assoc = mt7925_mac_sta_assoc,
|
||||
.sta_event = mt7925_mac_sta_event,
|
||||
.sta_remove = mt7925_mac_sta_remove,
|
||||
.update_survey = mt792x_update_channel,
|
||||
};
|
||||
|
@ -68,7 +68,7 @@ struct mt792x_fw_features {
|
||||
|
||||
enum {
|
||||
MT792x_CLC_POWER,
|
||||
MT792x_CLC_CHAN,
|
||||
MT792x_CLC_POWER_EXT,
|
||||
MT792x_CLC_MAX_NUM,
|
||||
};
|
||||
|
||||
|
@ -42,6 +42,7 @@ static const struct ieee80211_iface_combination if_comb[] = {
|
||||
BIT(NL80211_CHAN_WIDTH_40) |
|
||||
BIT(NL80211_CHAN_WIDTH_80) |
|
||||
BIT(NL80211_CHAN_WIDTH_160),
|
||||
.beacon_int_min_gcd = 100,
|
||||
}
|
||||
};
|
||||
|
||||
@ -941,8 +942,12 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy)
|
||||
cap = &phy->mt76->sband_5g.sband.vht_cap.cap;
|
||||
|
||||
*cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
|
||||
IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
|
||||
FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, sts - 1);
|
||||
IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
|
||||
|
||||
if (is_mt7996(phy->mt76->dev))
|
||||
*cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 3);
|
||||
else
|
||||
*cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 4);
|
||||
|
||||
*cap &= ~(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK |
|
||||
IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
|
||||
@ -987,9 +992,15 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
|
||||
IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO;
|
||||
elem->phy_cap_info[2] |= c;
|
||||
|
||||
c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE |
|
||||
IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
|
||||
IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
|
||||
c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE;
|
||||
|
||||
if (is_mt7996(phy->mt76->dev))
|
||||
c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
|
||||
IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
|
||||
else
|
||||
c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 |
|
||||
IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5;
|
||||
|
||||
elem->phy_cap_info[4] |= c;
|
||||
|
||||
/* do not support NG16 due to spec D4.0 changes subcarrier idx */
|
||||
@ -1011,8 +1022,6 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
|
||||
return;
|
||||
|
||||
elem->phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER;
|
||||
if (vif == NL80211_IFTYPE_AP)
|
||||
elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER;
|
||||
|
||||
c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
|
||||
sts - 1) |
|
||||
@ -1020,6 +1029,11 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
|
||||
sts - 1);
|
||||
elem->phy_cap_info[5] |= c;
|
||||
|
||||
if (vif != NL80211_IFTYPE_AP)
|
||||
return;
|
||||
|
||||
elem->phy_cap_info[4] |= IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER;
|
||||
|
||||
c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB |
|
||||
IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB;
|
||||
elem->phy_cap_info[6] |= c;
|
||||
@ -1179,12 +1193,12 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
||||
IEEE80211_EHT_MAC_CAP0_OM_CONTROL;
|
||||
|
||||
eht_cap_elem->phy_cap_info[0] =
|
||||
IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ |
|
||||
IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI |
|
||||
IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER |
|
||||
IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE;
|
||||
|
||||
val = max_t(u8, sts - 1, 3);
|
||||
/* Set the maximum capability regardless of the antenna configuration. */
|
||||
val = is_mt7992(phy->mt76->dev) ? 4 : 3;
|
||||
eht_cap_elem->phy_cap_info[0] |=
|
||||
u8_encode_bits(u8_get_bits(val, BIT(0)),
|
||||
IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK);
|
||||
@ -1193,30 +1207,36 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
||||
u8_encode_bits(u8_get_bits(val, GENMASK(2, 1)),
|
||||
IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK) |
|
||||
u8_encode_bits(val,
|
||||
IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK) |
|
||||
u8_encode_bits(val,
|
||||
IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK);
|
||||
IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK);
|
||||
|
||||
eht_cap_elem->phy_cap_info[2] =
|
||||
u8_encode_bits(sts - 1, IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_80MHZ_MASK) |
|
||||
u8_encode_bits(sts - 1, IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK) |
|
||||
u8_encode_bits(sts - 1, IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK);
|
||||
u8_encode_bits(sts - 1, IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK);
|
||||
|
||||
if (band == NL80211_BAND_6GHZ) {
|
||||
eht_cap_elem->phy_cap_info[0] |=
|
||||
IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ;
|
||||
|
||||
eht_cap_elem->phy_cap_info[1] |=
|
||||
u8_encode_bits(val,
|
||||
IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK);
|
||||
|
||||
eht_cap_elem->phy_cap_info[2] |=
|
||||
u8_encode_bits(sts - 1,
|
||||
IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK);
|
||||
}
|
||||
|
||||
eht_cap_elem->phy_cap_info[3] =
|
||||
IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK |
|
||||
IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK |
|
||||
IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK |
|
||||
IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK |
|
||||
IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK |
|
||||
IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK |
|
||||
IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK;
|
||||
IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK;
|
||||
|
||||
eht_cap_elem->phy_cap_info[4] =
|
||||
u8_encode_bits(min_t(int, sts - 1, 2),
|
||||
IEEE80211_EHT_PHY_CAP4_MAX_NC_MASK);
|
||||
|
||||
eht_cap_elem->phy_cap_info[5] =
|
||||
IEEE80211_EHT_PHY_CAP5_NON_TRIG_CQI_FEEDBACK |
|
||||
u8_encode_bits(IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US,
|
||||
IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK) |
|
||||
u8_encode_bits(u8_get_bits(0x11, GENMASK(1, 0)),
|
||||
@ -1230,14 +1250,6 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
||||
IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK) |
|
||||
u8_encode_bits(val, IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK);
|
||||
|
||||
eht_cap_elem->phy_cap_info[7] =
|
||||
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_80MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_320MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ;
|
||||
|
||||
val = u8_encode_bits(nss, IEEE80211_EHT_MCS_NSS_RX) |
|
||||
u8_encode_bits(nss, IEEE80211_EHT_MCS_NSS_TX);
|
||||
#define SET_EHT_MAX_NSS(_bw, _val) do { \
|
||||
@ -1248,8 +1260,29 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
|
||||
|
||||
SET_EHT_MAX_NSS(80, val);
|
||||
SET_EHT_MAX_NSS(160, val);
|
||||
SET_EHT_MAX_NSS(320, val);
|
||||
if (band == NL80211_BAND_6GHZ)
|
||||
SET_EHT_MAX_NSS(320, val);
|
||||
#undef SET_EHT_MAX_NSS
|
||||
|
||||
if (iftype != NL80211_IFTYPE_AP)
|
||||
return;
|
||||
|
||||
eht_cap_elem->phy_cap_info[3] |=
|
||||
IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK |
|
||||
IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK;
|
||||
|
||||
eht_cap_elem->phy_cap_info[7] =
|
||||
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_80MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ;
|
||||
|
||||
if (band != NL80211_BAND_6GHZ)
|
||||
return;
|
||||
|
||||
eht_cap_elem->phy_cap_info[7] |=
|
||||
IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_320MHZ |
|
||||
IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -435,7 +435,7 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q,
|
||||
u32 rxd2 = le32_to_cpu(rxd[2]);
|
||||
u32 rxd3 = le32_to_cpu(rxd[3]);
|
||||
u32 rxd4 = le32_to_cpu(rxd[4]);
|
||||
u32 csum_mask = MT_RXD0_NORMAL_IP_SUM | MT_RXD0_NORMAL_UDP_TCP_SUM;
|
||||
u32 csum_mask = MT_RXD3_NORMAL_IP_SUM | MT_RXD3_NORMAL_UDP_TCP_SUM;
|
||||
u32 csum_status = *(u32 *)skb->cb;
|
||||
u32 mesh_mask = MT_RXD0_MESH | MT_RXD0_MHCP;
|
||||
bool is_mesh = (rxd0 & mesh_mask) == mesh_mask;
|
||||
@ -497,7 +497,7 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q,
|
||||
if (!sband->channels)
|
||||
return -EINVAL;
|
||||
|
||||
if ((rxd0 & csum_mask) == csum_mask &&
|
||||
if ((rxd3 & csum_mask) == csum_mask &&
|
||||
!(csum_status & (BIT(0) | BIT(2) | BIT(3))))
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
|
||||
@ -746,7 +746,7 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi,
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
bool multicast = is_multicast_ether_addr(hdr->addr1);
|
||||
u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
|
||||
__le16 fc = hdr->frame_control;
|
||||
__le16 fc = hdr->frame_control, sc = hdr->seq_ctrl;
|
||||
u8 fc_type, fc_stype;
|
||||
u32 val;
|
||||
|
||||
@ -780,6 +780,15 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi,
|
||||
val = FIELD_PREP(MT_TXD2_FRAME_TYPE, fc_type) |
|
||||
FIELD_PREP(MT_TXD2_SUB_TYPE, fc_stype);
|
||||
|
||||
if (ieee80211_has_morefrags(fc) && ieee80211_is_first_frag(sc))
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_FIRST);
|
||||
else if (ieee80211_has_morefrags(fc) && !ieee80211_is_first_frag(sc))
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_MID);
|
||||
else if (!ieee80211_has_morefrags(fc) && !ieee80211_is_first_frag(sc))
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_LAST);
|
||||
else
|
||||
val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_NONE);
|
||||
|
||||
txwi[2] |= cpu_to_le32(val);
|
||||
|
||||
txwi[3] |= cpu_to_le32(FIELD_PREP(MT_TXD3_BCM, multicast));
|
||||
@ -789,7 +798,7 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi,
|
||||
}
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_INJECTED) {
|
||||
u16 seqno = le16_to_cpu(hdr->seq_ctrl);
|
||||
u16 seqno = le16_to_cpu(sc);
|
||||
|
||||
if (ieee80211_is_back_req(hdr->frame_control)) {
|
||||
struct ieee80211_bar *bar;
|
||||
|
@ -206,7 +206,7 @@ static int mt7996_add_interface(struct ieee80211_hw *hw,
|
||||
mvif->mt76.omac_idx = idx;
|
||||
mvif->phy = phy;
|
||||
mvif->mt76.band_idx = band_idx;
|
||||
mvif->mt76.wmm_idx = vif->type != NL80211_IFTYPE_AP;
|
||||
mvif->mt76.wmm_idx = vif->type == NL80211_IFTYPE_AP ? 0 : 3;
|
||||
|
||||
ret = mt7996_mcu_add_dev_info(phy, vif, true);
|
||||
if (ret)
|
||||
@ -291,22 +291,19 @@ static void mt7996_remove_interface(struct ieee80211_hw *hw,
|
||||
mt76_wcid_cleanup(&dev->mt76, &msta->wcid);
|
||||
}
|
||||
|
||||
int mt7996_set_channel(struct mt7996_phy *phy)
|
||||
int mt7996_set_channel(struct mt76_phy *mphy)
|
||||
{
|
||||
struct mt7996_dev *dev = phy->dev;
|
||||
struct mt7996_phy *phy = mphy->priv;
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&phy->mt76->mac_work);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
set_bit(MT76_RESET, &phy->mt76->state);
|
||||
|
||||
mt76_set_channel(phy->mt76);
|
||||
|
||||
ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
ret = mt7996_dfs_init_radar_detector(phy);
|
||||
mt7996_mac_cca_stats_reset(phy);
|
||||
|
||||
@ -314,13 +311,7 @@ int mt7996_set_channel(struct mt7996_phy *phy)
|
||||
phy->noise = 0;
|
||||
|
||||
out:
|
||||
clear_bit(MT76_RESET, &phy->mt76->state);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
mt76_txq_schedule_all(phy->mt76);
|
||||
|
||||
ieee80211_queue_delayed_work(phy->mt76->hw,
|
||||
&phy->mt76->mac_work,
|
||||
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
|
||||
MT7996_WATCHDOG_TIME);
|
||||
|
||||
return ret;
|
||||
@ -360,14 +351,14 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
||||
case WLAN_CIPHER_SUITE_SMS4:
|
||||
break;
|
||||
case WLAN_CIPHER_SUITE_AES_CMAC:
|
||||
wcid_keyidx = &wcid->hw_key_idx2;
|
||||
key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIE;
|
||||
fallthrough;
|
||||
case WLAN_CIPHER_SUITE_BIP_CMAC_256:
|
||||
case WLAN_CIPHER_SUITE_BIP_GMAC_128:
|
||||
case WLAN_CIPHER_SUITE_BIP_GMAC_256:
|
||||
if (key->keyidx == 6 || key->keyidx == 7)
|
||||
if (key->keyidx == 6 || key->keyidx == 7) {
|
||||
wcid_keyidx = &wcid->hw_key_idx2;
|
||||
key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIE;
|
||||
break;
|
||||
}
|
||||
fallthrough;
|
||||
case WLAN_CIPHER_SUITE_WEP40:
|
||||
case WLAN_CIPHER_SUITE_WEP104:
|
||||
@ -411,11 +402,9 @@ static int mt7996_config(struct ieee80211_hw *hw, u32 changed)
|
||||
int ret;
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
ieee80211_stop_queues(hw);
|
||||
ret = mt7996_set_channel(phy);
|
||||
ret = mt76_update_channel(phy->mt76);
|
||||
if (ret)
|
||||
return ret;
|
||||
ieee80211_wake_queues(hw);
|
||||
}
|
||||
|
||||
if (changed & (IEEE80211_CONF_CHANGE_POWER |
|
||||
|
@ -371,7 +371,7 @@ mt7996_mcu_rx_radar_detected(struct mt7996_dev *dev, struct sk_buff *skb)
|
||||
&dev->rdd2_chandef,
|
||||
GFP_ATOMIC);
|
||||
else
|
||||
ieee80211_radar_detected(mphy->hw);
|
||||
ieee80211_radar_detected(mphy->hw, NULL);
|
||||
dev->hw_pattern++;
|
||||
}
|
||||
|
||||
@ -735,7 +735,7 @@ void mt7996_mcu_rx_event(struct mt7996_dev *dev, struct sk_buff *skb)
|
||||
static struct tlv *
|
||||
mt7996_mcu_add_uni_tlv(struct sk_buff *skb, u16 tag, u16 len)
|
||||
{
|
||||
struct tlv *ptlv = skb_put(skb, len);
|
||||
struct tlv *ptlv = skb_put_zero(skb, len);
|
||||
|
||||
ptlv->tag = cpu_to_le16(tag);
|
||||
ptlv->len = cpu_to_le16(len);
|
||||
@ -822,7 +822,7 @@ mt7996_mcu_bss_mbssid_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
|
||||
struct bss_info_uni_mbssid *mbssid;
|
||||
struct tlv *tlv;
|
||||
|
||||
if (!vif->bss_conf.bssid_indicator)
|
||||
if (!vif->bss_conf.bssid_indicator && enable)
|
||||
return;
|
||||
|
||||
tlv = mt7996_mcu_add_uni_tlv(skb, UNI_BSS_INFO_11V_MBSSID, sizeof(*mbssid));
|
||||
@ -1429,10 +1429,10 @@ mt7996_is_ebf_supported(struct mt7996_phy *phy, struct ieee80211_vif *vif,
|
||||
|
||||
if (bfee)
|
||||
return vif->bss_conf.eht_su_beamformee &&
|
||||
EHT_PHY(CAP0_SU_BEAMFORMEE, pe->phy_cap_info[0]);
|
||||
EHT_PHY(CAP0_SU_BEAMFORMER, pe->phy_cap_info[0]);
|
||||
else
|
||||
return vif->bss_conf.eht_su_beamformer &&
|
||||
EHT_PHY(CAP0_SU_BEAMFORMER, pe->phy_cap_info[0]);
|
||||
EHT_PHY(CAP0_SU_BEAMFORMEE, pe->phy_cap_info[0]);
|
||||
}
|
||||
|
||||
if (sta->deflink.he_cap.has_he) {
|
||||
@ -1544,6 +1544,9 @@ mt7996_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
|
||||
u8 nss_mcs = mt7996_mcu_get_sta_nss(mcs_map);
|
||||
u8 snd_dim, sts;
|
||||
|
||||
if (!vc)
|
||||
return;
|
||||
|
||||
bf->tx_mode = MT_PHY_TYPE_HE_SU;
|
||||
|
||||
mt7996_mcu_sta_sounding_rate(bf);
|
||||
@ -1653,7 +1656,7 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb,
|
||||
{
|
||||
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
|
||||
struct mt7996_phy *phy = mvif->phy;
|
||||
int tx_ant = hweight8(phy->mt76->chainmask) - 1;
|
||||
int tx_ant = hweight16(phy->mt76->chainmask) - 1;
|
||||
struct sta_rec_bf *bf;
|
||||
struct tlv *tlv;
|
||||
static const u8 matrix[4][4] = {
|
||||
@ -2160,6 +2163,7 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_link_sta *link_sta;
|
||||
struct mt7996_sta *msta;
|
||||
struct sk_buff *skb;
|
||||
int conn_state;
|
||||
int ret;
|
||||
|
||||
msta = sta ? (struct mt7996_sta *)sta->drv_priv : &mvif->sta;
|
||||
@ -2172,8 +2176,9 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
return PTR_ERR(skb);
|
||||
|
||||
/* starec basic */
|
||||
conn_state = enable ? CONN_STATE_PORT_SECURE : CONN_STATE_DISCONNECT;
|
||||
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, link_sta,
|
||||
enable, newly);
|
||||
conn_state, newly);
|
||||
|
||||
if (!enable)
|
||||
goto out;
|
||||
@ -3460,7 +3465,7 @@ int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag)
|
||||
|
||||
if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR)
|
||||
req.switch_reason = CH_SWITCH_NORMAL;
|
||||
else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL ||
|
||||
else if (phy->mt76->offchannel ||
|
||||
phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE)
|
||||
req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
|
||||
else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
|
||||
@ -3923,8 +3928,9 @@ int mt7996_mcu_set_txbf(struct mt7996_dev *dev, u8 action)
|
||||
|
||||
tlv = mt7996_mcu_add_uni_tlv(skb, action, sizeof(*req_mod_en));
|
||||
req_mod_en = (struct bf_mod_en_ctrl *)tlv;
|
||||
req_mod_en->bf_num = 3;
|
||||
req_mod_en->bf_bitmap = GENMASK(2, 0);
|
||||
req_mod_en->bf_num = mt7996_band_valid(dev, MT_BAND2) ? 3 : 2;
|
||||
req_mod_en->bf_bitmap = mt7996_band_valid(dev, MT_BAND2) ?
|
||||
GENMASK(2, 0) : GENMASK(1, 0);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -620,6 +620,7 @@ struct mt7996_dev *mt7996_mmio_probe(struct device *pdev,
|
||||
.sta_add = mt7996_mac_sta_add,
|
||||
.sta_remove = mt7996_mac_sta_remove,
|
||||
.update_survey = mt7996_update_channel,
|
||||
.set_channel = mt7996_set_channel,
|
||||
};
|
||||
struct mt7996_dev *dev;
|
||||
struct mt76_dev *mdev;
|
||||
|
@ -468,7 +468,7 @@ int mt7996_mcu_add_obss_spr(struct mt7996_phy *phy, struct ieee80211_vif *vif,
|
||||
struct ieee80211_he_obss_pd *he_obss_pd);
|
||||
int mt7996_mcu_add_rate_ctrl(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, bool changed);
|
||||
int mt7996_set_channel(struct mt7996_phy *phy);
|
||||
int mt7996_set_channel(struct mt76_phy *mphy);
|
||||
int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag);
|
||||
int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif);
|
||||
int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev,
|
||||
|
@ -313,6 +313,9 @@ __mt76_tx_queue_skb(struct mt76_phy *phy, int qid, struct sk_buff *skb,
|
||||
return idx;
|
||||
|
||||
wcid = (struct mt76_wcid *)sta->drv_priv;
|
||||
if (!wcid->sta)
|
||||
return idx;
|
||||
|
||||
q->entry[idx].wcid = wcid->idx;
|
||||
|
||||
if (!non_aql)
|
||||
@ -330,6 +333,7 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
|
||||
struct mt76_wcid *wcid, struct sk_buff *skb)
|
||||
{
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct sk_buff_head *head;
|
||||
|
||||
if (mt76_testmode_enabled(phy)) {
|
||||
ieee80211_free_txskb(phy->hw, skb);
|
||||
@ -345,9 +349,15 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
|
||||
|
||||
info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->band_idx);
|
||||
|
||||
spin_lock_bh(&wcid->tx_pending.lock);
|
||||
__skb_queue_tail(&wcid->tx_pending, skb);
|
||||
spin_unlock_bh(&wcid->tx_pending.lock);
|
||||
if ((info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) ||
|
||||
(info->control.flags & IEEE80211_TX_CTRL_DONT_USE_RATE_MASK))
|
||||
head = &wcid->tx_offchannel;
|
||||
else
|
||||
head = &wcid->tx_pending;
|
||||
|
||||
spin_lock_bh(&head->lock);
|
||||
__skb_queue_tail(head, skb);
|
||||
spin_unlock_bh(&head->lock);
|
||||
|
||||
spin_lock_bh(&phy->tx_lock);
|
||||
if (list_empty(&wcid->tx_list))
|
||||
@ -478,7 +488,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
|
||||
return idx;
|
||||
|
||||
do {
|
||||
if (test_bit(MT76_RESET, &phy->state))
|
||||
if (test_bit(MT76_RESET, &phy->state) || phy->offchannel)
|
||||
return -EBUSY;
|
||||
|
||||
if (stop || mt76_txq_stopped(q))
|
||||
@ -522,7 +532,7 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
|
||||
while (1) {
|
||||
int n_frames = 0;
|
||||
|
||||
if (test_bit(MT76_RESET, &phy->state))
|
||||
if (test_bit(MT76_RESET, &phy->state) || phy->offchannel)
|
||||
return -EBUSY;
|
||||
|
||||
if (dev->queue_ops->tx_cleanup &&
|
||||
@ -568,7 +578,7 @@ void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (qid >= 4)
|
||||
if (qid >= 4 || phy->offchannel)
|
||||
return;
|
||||
|
||||
local_bh_disable();
|
||||
@ -586,7 +596,8 @@ void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid)
|
||||
EXPORT_SYMBOL_GPL(mt76_txq_schedule);
|
||||
|
||||
static int
|
||||
mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid)
|
||||
mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid,
|
||||
struct sk_buff_head *head)
|
||||
{
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
struct ieee80211_sta *sta;
|
||||
@ -594,8 +605,8 @@ mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid)
|
||||
struct sk_buff *skb;
|
||||
int ret = 0;
|
||||
|
||||
spin_lock(&wcid->tx_pending.lock);
|
||||
while ((skb = skb_peek(&wcid->tx_pending)) != NULL) {
|
||||
spin_lock(&head->lock);
|
||||
while ((skb = skb_peek(head)) != NULL) {
|
||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
int qid = skb_get_queue_mapping(skb);
|
||||
@ -607,13 +618,13 @@ mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid)
|
||||
qid = MT_TXQ_PSD;
|
||||
|
||||
q = phy->q_tx[qid];
|
||||
if (mt76_txq_stopped(q)) {
|
||||
if (mt76_txq_stopped(q) || test_bit(MT76_RESET, &phy->state)) {
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
__skb_unlink(skb, &wcid->tx_pending);
|
||||
spin_unlock(&wcid->tx_pending.lock);
|
||||
__skb_unlink(skb, head);
|
||||
spin_unlock(&head->lock);
|
||||
|
||||
sta = wcid_to_sta(wcid);
|
||||
spin_lock(&q->lock);
|
||||
@ -621,15 +632,17 @@ mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid)
|
||||
dev->queue_ops->kick(dev, q);
|
||||
spin_unlock(&q->lock);
|
||||
|
||||
spin_lock(&wcid->tx_pending.lock);
|
||||
spin_lock(&head->lock);
|
||||
}
|
||||
spin_unlock(&wcid->tx_pending.lock);
|
||||
spin_unlock(&head->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void mt76_txq_schedule_pending(struct mt76_phy *phy)
|
||||
{
|
||||
LIST_HEAD(tx_list);
|
||||
|
||||
if (list_empty(&phy->tx_list))
|
||||
return;
|
||||
|
||||
@ -637,22 +650,27 @@ static void mt76_txq_schedule_pending(struct mt76_phy *phy)
|
||||
rcu_read_lock();
|
||||
|
||||
spin_lock(&phy->tx_lock);
|
||||
while (!list_empty(&phy->tx_list)) {
|
||||
struct mt76_wcid *wcid = NULL;
|
||||
list_splice_init(&phy->tx_list, &tx_list);
|
||||
while (!list_empty(&tx_list)) {
|
||||
struct mt76_wcid *wcid;
|
||||
int ret;
|
||||
|
||||
wcid = list_first_entry(&phy->tx_list, struct mt76_wcid, tx_list);
|
||||
wcid = list_first_entry(&tx_list, struct mt76_wcid, tx_list);
|
||||
list_del_init(&wcid->tx_list);
|
||||
|
||||
spin_unlock(&phy->tx_lock);
|
||||
ret = mt76_txq_schedule_pending_wcid(phy, wcid);
|
||||
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel);
|
||||
if (ret >= 0 && !phy->offchannel)
|
||||
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_pending);
|
||||
spin_lock(&phy->tx_lock);
|
||||
|
||||
if (ret) {
|
||||
if (list_empty(&wcid->tx_list))
|
||||
list_add_tail(&wcid->tx_list, &phy->tx_list);
|
||||
if (!skb_queue_empty(&wcid->tx_pending) &&
|
||||
!skb_queue_empty(&wcid->tx_offchannel) &&
|
||||
list_empty(&wcid->tx_list))
|
||||
list_add_tail(&wcid->tx_list, &phy->tx_list);
|
||||
|
||||
if (ret < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock(&phy->tx_lock);
|
||||
|
||||
|
@ -384,6 +384,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss,
|
||||
struct wilc_join_bss_param *param;
|
||||
u8 rates_len = 0;
|
||||
int ies_len;
|
||||
u64 ies_tsf;
|
||||
int ret;
|
||||
|
||||
param = kzalloc(sizeof(*param), GFP_KERNEL);
|
||||
@ -399,6 +400,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss,
|
||||
return NULL;
|
||||
}
|
||||
ies_len = ies->len;
|
||||
ies_tsf = ies->tsf;
|
||||
rcu_read_unlock();
|
||||
|
||||
param->beacon_period = cpu_to_le16(bss->beacon_interval);
|
||||
@ -454,7 +456,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss,
|
||||
IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
|
||||
(u8 *)&noa_attr, sizeof(noa_attr));
|
||||
if (ret > 0) {
|
||||
param->tsf_lo = cpu_to_le32(ies->tsf);
|
||||
param->tsf_lo = cpu_to_le32(ies_tsf);
|
||||
param->noa_enabled = 1;
|
||||
param->idx = noa_attr.index;
|
||||
if (noa_attr.oppps_ctwindow & IEEE80211_P2P_OPPPS_ENABLE_BIT) {
|
||||
|
@ -174,19 +174,18 @@ static int wilc_sdio_probe(struct sdio_func *func,
|
||||
wilc->bus_data = sdio_priv;
|
||||
wilc->dev = &func->dev;
|
||||
|
||||
wilc->rtc_clk = devm_clk_get_optional(&func->card->dev, "rtc");
|
||||
wilc->rtc_clk = devm_clk_get_optional_enabled(&func->card->dev, "rtc");
|
||||
if (IS_ERR(wilc->rtc_clk)) {
|
||||
ret = PTR_ERR(wilc->rtc_clk);
|
||||
goto dispose_irq;
|
||||
}
|
||||
clk_prepare_enable(wilc->rtc_clk);
|
||||
|
||||
wilc_sdio_init(wilc, false);
|
||||
|
||||
ret = wilc_load_mac_from_nv(wilc);
|
||||
if (ret) {
|
||||
pr_err("Can not retrieve MAC address from chip\n");
|
||||
goto clk_disable_unprepare;
|
||||
goto dispose_irq;
|
||||
}
|
||||
|
||||
wilc_sdio_deinit(wilc);
|
||||
@ -195,14 +194,12 @@ static int wilc_sdio_probe(struct sdio_func *func,
|
||||
NL80211_IFTYPE_STATION, false);
|
||||
if (IS_ERR(vif)) {
|
||||
ret = PTR_ERR(vif);
|
||||
goto clk_disable_unprepare;
|
||||
goto dispose_irq;
|
||||
}
|
||||
|
||||
dev_info(&func->dev, "Driver Initializing success\n");
|
||||
return 0;
|
||||
|
||||
clk_disable_unprepare:
|
||||
clk_disable_unprepare(wilc->rtc_clk);
|
||||
dispose_irq:
|
||||
irq_dispose_mapping(wilc->dev_irq_num);
|
||||
wilc_netdev_cleanup(wilc);
|
||||
@ -217,7 +214,6 @@ static void wilc_sdio_remove(struct sdio_func *func)
|
||||
struct wilc *wilc = sdio_get_drvdata(func);
|
||||
struct wilc_sdio *sdio_priv = wilc->bus_data;
|
||||
|
||||
clk_disable_unprepare(wilc->rtc_clk);
|
||||
wilc_netdev_cleanup(wilc);
|
||||
kfree(sdio_priv->cmd53_buf);
|
||||
kfree(sdio_priv);
|
||||
|
@ -228,12 +228,11 @@ static int wilc_bus_probe(struct spi_device *spi)
|
||||
if (ret < 0)
|
||||
goto netdev_cleanup;
|
||||
|
||||
wilc->rtc_clk = devm_clk_get_optional(&spi->dev, "rtc");
|
||||
wilc->rtc_clk = devm_clk_get_optional_enabled(&spi->dev, "rtc");
|
||||
if (IS_ERR(wilc->rtc_clk)) {
|
||||
ret = PTR_ERR(wilc->rtc_clk);
|
||||
goto netdev_cleanup;
|
||||
}
|
||||
clk_prepare_enable(wilc->rtc_clk);
|
||||
|
||||
dev_info(&spi->dev, "Selected CRC config: crc7=%s, crc16=%s\n",
|
||||
enable_crc7 ? "on" : "off", enable_crc16 ? "on" : "off");
|
||||
@ -266,7 +265,6 @@ static int wilc_bus_probe(struct spi_device *spi)
|
||||
return 0;
|
||||
|
||||
power_down:
|
||||
clk_disable_unprepare(wilc->rtc_clk);
|
||||
wilc_wlan_power(wilc, false);
|
||||
netdev_cleanup:
|
||||
wilc_netdev_cleanup(wilc);
|
||||
@ -280,7 +278,6 @@ static void wilc_bus_remove(struct spi_device *spi)
|
||||
struct wilc *wilc = spi_get_drvdata(spi);
|
||||
struct wilc_spi *spi_priv = wilc->bus_data;
|
||||
|
||||
clk_disable_unprepare(wilc->rtc_clk);
|
||||
wilc_netdev_cleanup(wilc);
|
||||
kfree(spi_priv);
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev,
|
||||
static int qtnf_start_radar_detection(struct wiphy *wiphy,
|
||||
struct net_device *ndev,
|
||||
struct cfg80211_chan_def *chandef,
|
||||
u32 cac_time_ms)
|
||||
u32 cac_time_ms, int link_id)
|
||||
{
|
||||
struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev);
|
||||
int ret;
|
||||
|
@ -520,21 +520,21 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif,
|
||||
cfg80211_radar_event(wiphy, &chandef, GFP_KERNEL);
|
||||
break;
|
||||
case QLINK_RADAR_CAC_FINISHED:
|
||||
if (!vif->wdev.cac_started)
|
||||
if (!vif->wdev.links[0].cac_started)
|
||||
break;
|
||||
|
||||
cfg80211_cac_event(vif->netdev, &chandef,
|
||||
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
|
||||
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0);
|
||||
break;
|
||||
case QLINK_RADAR_CAC_ABORTED:
|
||||
if (!vif->wdev.cac_started)
|
||||
if (!vif->wdev.links[0].cac_started)
|
||||
break;
|
||||
|
||||
cfg80211_cac_event(vif->netdev, &chandef,
|
||||
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
|
||||
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0);
|
||||
break;
|
||||
case QLINK_RADAR_CAC_STARTED:
|
||||
if (vif->wdev.cac_started)
|
||||
if (vif->wdev.links[0].cac_started)
|
||||
break;
|
||||
|
||||
if (!wiphy_ext_feature_isset(wiphy,
|
||||
@ -542,7 +542,7 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif,
|
||||
break;
|
||||
|
||||
cfg80211_cac_event(vif->netdev, &chandef,
|
||||
NL80211_RADAR_CAC_STARTED, GFP_KERNEL);
|
||||
NL80211_RADAR_CAC_STARTED, GFP_KERNEL, 0);
|
||||
break;
|
||||
default:
|
||||
pr_warn("%s: unhandled radar event %u\n",
|
||||
|
@ -2194,7 +2194,6 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
|
||||
struct rtw_coex_stat *coex_stat = &coex->stat;
|
||||
struct rtw_efuse *efuse = &rtwdev->efuse;
|
||||
u8 table_case, tdma_case;
|
||||
bool wl_cpt_test = false, bt_cpt_test = false;
|
||||
|
||||
rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s()\n", __func__);
|
||||
|
||||
@ -2202,29 +2201,16 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
|
||||
rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
|
||||
if (efuse->share_ant) {
|
||||
/* Shared-Ant */
|
||||
if (wl_cpt_test) {
|
||||
if (coex_stat->wl_gl_busy) {
|
||||
table_case = 20;
|
||||
tdma_case = 17;
|
||||
} else {
|
||||
table_case = 10;
|
||||
tdma_case = 15;
|
||||
}
|
||||
} else if (bt_cpt_test) {
|
||||
table_case = 26;
|
||||
tdma_case = 26;
|
||||
} else {
|
||||
if (coex_stat->wl_gl_busy &&
|
||||
coex_stat->wl_noisy_level == 0)
|
||||
table_case = 14;
|
||||
else
|
||||
table_case = 10;
|
||||
if (coex_stat->wl_gl_busy &&
|
||||
coex_stat->wl_noisy_level == 0)
|
||||
table_case = 14;
|
||||
else
|
||||
table_case = 10;
|
||||
|
||||
if (coex_stat->wl_gl_busy)
|
||||
tdma_case = 15;
|
||||
else
|
||||
tdma_case = 20;
|
||||
}
|
||||
if (coex_stat->wl_gl_busy)
|
||||
tdma_case = 15;
|
||||
else
|
||||
tdma_case = 20;
|
||||
} else {
|
||||
/* Non-Shared-Ant */
|
||||
table_case = 112;
|
||||
@ -2235,11 +2221,7 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
|
||||
tdma_case = 120;
|
||||
}
|
||||
|
||||
if (wl_cpt_test)
|
||||
rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[1]);
|
||||
else
|
||||
rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
|
||||
|
||||
rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
|
||||
rtw_coex_table(rtwdev, false, table_case);
|
||||
rtw_coex_tdma(rtwdev, false, tdma_case);
|
||||
}
|
||||
|
@ -1468,10 +1468,12 @@ int rtw_fw_write_data_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr,
|
||||
val |= BIT_ENSWBCN >> 8;
|
||||
rtw_write8(rtwdev, REG_CR + 1, val);
|
||||
|
||||
val = rtw_read8(rtwdev, REG_FWHW_TXQ_CTRL + 2);
|
||||
bckp[1] = val;
|
||||
val &= ~(BIT_EN_BCNQ_DL >> 16);
|
||||
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, val);
|
||||
if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) {
|
||||
val = rtw_read8(rtwdev, REG_FWHW_TXQ_CTRL + 2);
|
||||
bckp[1] = val;
|
||||
val &= ~(BIT_EN_BCNQ_DL >> 16);
|
||||
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, val);
|
||||
}
|
||||
|
||||
ret = rtw_hci_write_data_rsvd_page(rtwdev, buf, size);
|
||||
if (ret) {
|
||||
@ -1496,7 +1498,8 @@ restore:
|
||||
rsvd_pg_head = rtwdev->fifo.rsvd_boundary;
|
||||
rtw_write16(rtwdev, REG_FIFOPAGE_CTRL_2,
|
||||
rsvd_pg_head | BIT_BCN_VALID_V1);
|
||||
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, bckp[1]);
|
||||
if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE)
|
||||
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, bckp[1]);
|
||||
rtw_write8(rtwdev, REG_CR + 1, bckp[0]);
|
||||
|
||||
return ret;
|
||||
|
@ -167,6 +167,12 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw,
|
||||
|
||||
mutex_lock(&rtwdev->mutex);
|
||||
|
||||
rtwvif->mac_id = rtw_acquire_macid(rtwdev);
|
||||
if (rtwvif->mac_id >= RTW_MAX_MAC_ID_NUM) {
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM);
|
||||
if (port >= RTW_PORT_NUM) {
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
@ -214,7 +220,8 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw,
|
||||
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
|
||||
rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM on port %d\n", vif->addr, rtwvif->port);
|
||||
rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM mac_id %d on port %d\n",
|
||||
vif->addr, rtwvif->mac_id, rtwvif->port);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -225,7 +232,8 @@ static void rtw_ops_remove_interface(struct ieee80211_hw *hw,
|
||||
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
|
||||
u32 config = 0;
|
||||
|
||||
rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM on port %d\n", vif->addr, rtwvif->port);
|
||||
rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM mac_id %d on port %d\n",
|
||||
vif->addr, rtwvif->mac_id, rtwvif->port);
|
||||
|
||||
mutex_lock(&rtwdev->mutex);
|
||||
|
||||
@ -242,6 +250,7 @@ static void rtw_ops_remove_interface(struct ieee80211_hw *hw,
|
||||
config |= PORT_SET_BCN_CTRL;
|
||||
rtw_vif_port_config(rtwdev, rtwvif, config);
|
||||
clear_bit(rtwvif->port, rtwdev->hw_port);
|
||||
rtw_release_macid(rtwdev, rtwvif->mac_id);
|
||||
rtw_recalc_lps(rtwdev, NULL);
|
||||
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
|
@ -311,17 +311,6 @@ static void rtw_ips_work(struct work_struct *work)
|
||||
mutex_unlock(&rtwdev->mutex);
|
||||
}
|
||||
|
||||
static u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
|
||||
{
|
||||
unsigned long mac_id;
|
||||
|
||||
mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
|
||||
if (mac_id < RTW_MAX_MAC_ID_NUM)
|
||||
set_bit(mac_id, rtwdev->mac_id_map);
|
||||
|
||||
return mac_id;
|
||||
}
|
||||
|
||||
static void rtw_sta_rc_work(struct work_struct *work)
|
||||
{
|
||||
struct rtw_sta_info *si = container_of(work, struct rtw_sta_info,
|
||||
@ -340,12 +329,14 @@ int rtw_sta_add(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
|
||||
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
|
||||
int i;
|
||||
|
||||
si->mac_id = rtw_acquire_macid(rtwdev);
|
||||
if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
|
||||
return -ENOSPC;
|
||||
if (vif->type == NL80211_IFTYPE_STATION) {
|
||||
si->mac_id = rtwvif->mac_id;
|
||||
} else {
|
||||
si->mac_id = rtw_acquire_macid(rtwdev);
|
||||
if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0)
|
||||
rtwvif->mac_id = si->mac_id;
|
||||
si->rtwdev = rtwdev;
|
||||
si->sta = sta;
|
||||
si->vif = vif;
|
||||
@ -370,11 +361,13 @@ void rtw_sta_remove(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
|
||||
bool fw_exist)
|
||||
{
|
||||
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
|
||||
struct ieee80211_vif *vif = si->vif;
|
||||
int i;
|
||||
|
||||
cancel_work_sync(&si->rc_work);
|
||||
|
||||
rtw_release_macid(rtwdev, si->mac_id);
|
||||
if (vif->type != NL80211_IFTYPE_STATION)
|
||||
rtw_release_macid(rtwdev, si->mac_id);
|
||||
if (fw_exist)
|
||||
rtw_fw_media_status_report(rtwdev, si->mac_id, false);
|
||||
|
||||
@ -614,6 +607,8 @@ static void rtw_reset_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
|
||||
rtw_bf_disassoc(rtwdev, vif, NULL);
|
||||
rtw_vif_assoc_changed(rtwvif, NULL);
|
||||
rtw_txq_cleanup(rtwdev, vif->txq);
|
||||
|
||||
rtw_release_macid(rtwdev, rtwvif->mac_id);
|
||||
}
|
||||
|
||||
void rtw_fw_recovery(struct rtw_dev *rtwdev)
|
||||
@ -2139,7 +2134,6 @@ int rtw_core_init(struct rtw_dev *rtwdev)
|
||||
rtwdev->sec.total_cam_num = 32;
|
||||
rtwdev->hal.current_channel = 1;
|
||||
rtwdev->dm_info.fix_rate = U8_MAX;
|
||||
set_bit(RTW_BC_MC_MACID, rtwdev->mac_id_map);
|
||||
|
||||
rtw_stats_init(rtwdev);
|
||||
|
||||
|
@ -742,7 +742,6 @@ struct rtw_txq {
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
#define RTW_BC_MC_MACID 1
|
||||
DECLARE_EWMA(rssi, 10, 16);
|
||||
|
||||
struct rtw_sta_info {
|
||||
@ -805,7 +804,7 @@ struct rtw_bf_info {
|
||||
struct rtw_vif {
|
||||
enum rtw_net_type net_type;
|
||||
u16 aid;
|
||||
u8 mac_id; /* for STA mode only */
|
||||
u8 mac_id;
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
u8 bssid[ETH_ALEN];
|
||||
u8 port;
|
||||
@ -2131,6 +2130,17 @@ static inline bool rtw_chip_has_tx_stbc(struct rtw_dev *rtwdev)
|
||||
return rtwdev->chip->tx_stbc;
|
||||
}
|
||||
|
||||
static inline u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
|
||||
{
|
||||
unsigned long mac_id;
|
||||
|
||||
mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
|
||||
if (mac_id < RTW_MAX_MAC_ID_NUM)
|
||||
set_bit(mac_id, rtwdev->mac_id_map);
|
||||
|
||||
return mac_id;
|
||||
}
|
||||
|
||||
static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id)
|
||||
{
|
||||
clear_bit(mac_id, rtwdev->mac_id_map);
|
||||
|
@ -46,7 +46,8 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb)
|
||||
le32_encode_bits(pkt_info->ls, RTW_TX_DESC_W0_LS) |
|
||||
le32_encode_bits(pkt_info->dis_qselseq, RTW_TX_DESC_W0_DISQSELSEQ);
|
||||
|
||||
tx_desc->w1 = le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) |
|
||||
tx_desc->w1 = le32_encode_bits(pkt_info->mac_id, RTW_TX_DESC_W1_MACID) |
|
||||
le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) |
|
||||
le32_encode_bits(pkt_info->rate_id, RTW_TX_DESC_W1_RATE_ID) |
|
||||
le32_encode_bits(pkt_info->sec_type, RTW_TX_DESC_W1_SEC_TYPE) |
|
||||
le32_encode_bits(pkt_info->pkt_offset, RTW_TX_DESC_W1_PKT_OFFSET) |
|
||||
@ -401,14 +402,18 @@ void rtw_tx_pkt_info_update(struct rtw_dev *rtwdev,
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||
struct ieee80211_vif *vif = info->control.vif;
|
||||
struct rtw_sta_info *si;
|
||||
struct ieee80211_vif *vif = NULL;
|
||||
struct rtw_vif *rtwvif;
|
||||
__le16 fc = hdr->frame_control;
|
||||
bool bmc;
|
||||
|
||||
if (sta) {
|
||||
si = (struct rtw_sta_info *)sta->drv_priv;
|
||||
vif = si->vif;
|
||||
pkt_info->mac_id = si->mac_id;
|
||||
} else if (vif) {
|
||||
rtwvif = (struct rtw_vif *)vif->drv_priv;
|
||||
pkt_info->mac_id = rtwvif->mac_id;
|
||||
}
|
||||
|
||||
if (ieee80211_is_mgmt(fc) || ieee80211_is_nullfunc(fc))
|
||||
|
@ -27,6 +27,7 @@ struct rtw_tx_desc {
|
||||
#define RTW_TX_DESC_W0_BMC BIT(24)
|
||||
#define RTW_TX_DESC_W0_LS BIT(26)
|
||||
#define RTW_TX_DESC_W0_DISQSELSEQ BIT(31)
|
||||
#define RTW_TX_DESC_W1_MACID GENMASK(7, 0)
|
||||
#define RTW_TX_DESC_W1_QSEL GENMASK(12, 8)
|
||||
#define RTW_TX_DESC_W1_RATE_ID GENMASK(20, 16)
|
||||
#define RTW_TX_DESC_W1_SEC_TYPE GENMASK(23, 22)
|
||||
|
@ -191,7 +191,7 @@ void rtw89_config_roc_chandef(struct rtw89_dev *rtwdev,
|
||||
enum rtw89_chanctx_idx cur;
|
||||
|
||||
if (chandef) {
|
||||
cur = atomic_cmpxchg(&hal->roc_entity_idx,
|
||||
cur = atomic_cmpxchg(&hal->roc_chanctx_idx,
|
||||
RTW89_CHANCTX_IDLE, idx);
|
||||
if (cur != RTW89_CHANCTX_IDLE) {
|
||||
rtw89_debug(rtwdev, RTW89_DBG_TXRX,
|
||||
@ -201,7 +201,7 @@ void rtw89_config_roc_chandef(struct rtw89_dev *rtwdev,
|
||||
|
||||
hal->roc_chandef = *chandef;
|
||||
} else {
|
||||
cur = atomic_cmpxchg(&hal->roc_entity_idx, idx,
|
||||
cur = atomic_cmpxchg(&hal->roc_chanctx_idx, idx,
|
||||
RTW89_CHANCTX_IDLE);
|
||||
if (cur == idx)
|
||||
return;
|
||||
@ -230,7 +230,7 @@ void rtw89_entity_init(struct rtw89_dev *rtwdev)
|
||||
hal->entity_pause = false;
|
||||
bitmap_zero(hal->entity_map, NUM_OF_RTW89_CHANCTX);
|
||||
bitmap_zero(hal->changes, NUM_OF_RTW89_CHANCTX_CHANGES);
|
||||
atomic_set(&hal->roc_entity_idx, RTW89_CHANCTX_IDLE);
|
||||
atomic_set(&hal->roc_chanctx_idx, RTW89_CHANCTX_IDLE);
|
||||
rtw89_config_default_chandef(rtwdev);
|
||||
}
|
||||
|
||||
@ -2395,11 +2395,11 @@ static void rtw89_swap_chanctx(struct rtw89_dev *rtwdev,
|
||||
rtwvif->chanctx_idx = idx1;
|
||||
}
|
||||
|
||||
cur = atomic_read(&hal->roc_entity_idx);
|
||||
cur = atomic_read(&hal->roc_chanctx_idx);
|
||||
if (cur == idx1)
|
||||
atomic_set(&hal->roc_entity_idx, idx2);
|
||||
atomic_set(&hal->roc_chanctx_idx, idx2);
|
||||
else if (cur == idx2)
|
||||
atomic_set(&hal->roc_entity_idx, idx1);
|
||||
atomic_set(&hal->roc_chanctx_idx, idx1);
|
||||
}
|
||||
|
||||
int rtw89_chanctx_ops_add(struct rtw89_dev *rtwdev,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user