Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
57ff450
wifi: mt76: mt7915: initialize rssi on adding stations
nbd168 Mar 9, 2024
a90a3d5
wifi: mt76: replace skb_put with skb_put_zero
nbd168 Mar 14, 2024
b9c6f95
wifi: mt76: fix tx packet loss when scanning on DBDC
nbd168 Mar 15, 2024
478ecf6
wifi: mt76: mt7915: fix mcu command format for mt7915 tx stats
Jan 29, 2024
7f4224e
wifi: mt76: mt7915: fix bogus Tx/Rx airtime duration values
Feb 22, 2024
88f2982
wifi: mt76: mt7915: fix HE PHY capabilities IE for station mode
haogroot Mar 6, 2024
6611994
wifi: mt76: mt7915: only set MT76_MCU_RESET for the main phy
Mar 7, 2024
0169bcd
wifi: mt76: mt7996: only set MT76_MCU_RESET for the main phy
nbd168 Mar 15, 2024
5ad235d
wifi: mt76: mt7915: add support for disabling in-band discovery
Mar 23, 2023
f37b260
wifi: mt76: mt7915: add mt7986, mt7916 and mt7981 pre-calibration
Dec 13, 2023
3d49790
wifi: mt76: mt7915: add fallback in case of missing precal data
nbd168 Mar 18, 2024
1772c6e
wifi: mt76: mt7603: fix tx queue of loopback packets
nbd168 Apr 2, 2024
4b546f8
wifi: mt76: mt7603: add wpdma tx eof flag for PSE client reset
nbd168 Apr 3, 2024
4fd6619
wifi: mt76: connac: check for null before dereferencing
Mar 1, 2024
4d0b3cc
wifi: mt76: mt7996: fix size of txpower MCU command
cmonroe Mar 5, 2024
e34f2ac
wifi: mt76: mt7921: introduce mt7920 PCIe support
deren Mar 6, 2024
c3a6eb7
wifi: mt76: mt7921s: fix potential hung tasks during chip recovery
leon-yen Mar 7, 2024
0db9697
wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
Mar 7, 2024
968f0e7
wifi: mt76: mt7996: fix uninitialized variable in mt7996_irq_tasklet()
LorenzoBianconi Mar 19, 2024
554298c
wifi: mt76: sdio: move mcu queue size check inside critical section
LorenzoBianconi Mar 25, 2024
7025a41
wifi: mt76: mt7915: add missing chanctx ops
greearb Mar 27, 2024
b648ed2
wifi: mt76: mt7915: Remove unused of_gpio.h
andy-shev Feb 28, 2024
d2251db
wifi: mt76: mt7996: disable rx header translation for BMC entry
csyuanc Mar 20, 2024
501258b
wifi: mt76: connac: use peer address for station BMC entry
csyuanc Mar 20, 2024
fd657d4
wifi: mt76: mt7996: set RCPI value in rate control command
Mar 20, 2024
d4b793f
wifi: mt76: connac: enable HW CSO module for mt7996
haogroot Mar 20, 2024
bcf3c28
wifi: mt76: mt7996: fix non-main BSS no beacon issue for MBSS scenario
Mar 20, 2024
6bcbd33
wifi: mt76: mt7996: fix potential memory leakage when reading chip te…
haogroot Mar 20, 2024
3b02e59
wifi: mt76: connac: enable critical packet mode support for mt7992
haogroot Mar 20, 2024
8c7dff3
wifi: mt76: mt7996: add sanity checks for background radar trigger
Mar 20, 2024
b15bd10
wifi: mt76: connac: use muar idx 0xe for non-mt799x as well
nbd168 Apr 3, 2024
51e3d98
build(deps): bump idna from 3.4 to 3.7 in /drivers/gpu/drm/ci/xfails
dependabot[bot] Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/gpu/drm/ci/xfails/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ termcolor==2.3.0
# ci-collate dependencies
certifi==2023.7.22
charset-normalizer==3.2.0
idna==3.4
idna==3.7
pip==23.3
python-gitlab==3.15.0
requests==2.31.0
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/mediatek/mt76/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
}

static int
mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
mt76_dma_tx_queue_skb(struct mt76_phy *phy, struct mt76_queue *q,
enum mt76_txq_id qid, struct sk_buff *skb,
struct mt76_wcid *wcid, struct ieee80211_sta *sta)
{
Expand All @@ -542,14 +542,15 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
struct mt76_tx_info tx_info = {
.skb = skb,
};
struct mt76_dev *dev = phy->dev;
struct ieee80211_hw *hw;
int len, n = 0, ret = -ENOMEM;
struct mt76_txwi_cache *t;
struct sk_buff *iter;
dma_addr_t addr;
u8 *txwi;

if (test_bit(MT76_RESET, &dev->phy.state))
if (test_bit(MT76_RESET, &phy->state))
goto free_skb;

t = mt76_get_txwi(dev);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ struct mt76_queue_ops {
int idx, int n_desc, int bufsize,
u32 ring_base);

int (*tx_queue_skb)(struct mt76_dev *dev, struct mt76_queue *q,
int (*tx_queue_skb)(struct mt76_phy *phy, struct mt76_queue *q,
enum mt76_txq_id qid, struct sk_buff *skb,
struct mt76_wcid *wcid, struct ieee80211_sta *sta);

Expand Down Expand Up @@ -1127,7 +1127,7 @@ static inline int mt76_wed_dma_setup(struct mt76_dev *dev, struct mt76_queue *q,
#define mt76_init_queues(dev, ...) (dev)->mt76.queue_ops->init(&((dev)->mt76), __VA_ARGS__)
#define mt76_queue_alloc(dev, ...) (dev)->mt76.queue_ops->alloc(&((dev)->mt76), __VA_ARGS__)
#define mt76_tx_queue_skb_raw(dev, ...) (dev)->mt76.queue_ops->tx_queue_skb_raw(&((dev)->mt76), __VA_ARGS__)
#define mt76_tx_queue_skb(dev, ...) (dev)->mt76.queue_ops->tx_queue_skb(&((dev)->mt76), __VA_ARGS__)
#define mt76_tx_queue_skb(dev, ...) (dev)->mt76.queue_ops->tx_queue_skb(&((dev)->mphy), __VA_ARGS__)
#define mt76_queue_rx_reset(dev, ...) (dev)->mt76.queue_ops->rx_reset(&((dev)->mt76), __VA_ARGS__)
#define mt76_queue_tx_cleanup(dev, ...) (dev)->mt76.queue_ops->tx_cleanup(&((dev)->mt76), __VA_ARGS__)
#define mt76_queue_rx_cleanup(dev, ...) (dev)->mt76.queue_ops->rx_cleanup(&((dev)->mt76), __VA_ARGS__)
Expand Down
46 changes: 32 additions & 14 deletions drivers/net/wireless/mediatek/mt76/mt7603/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
#include "mac.h"
#include "../dma.h"

static const u8 wmm_queue_map[] = {
[IEEE80211_AC_BK] = 0,
[IEEE80211_AC_BE] = 1,
[IEEE80211_AC_VI] = 2,
[IEEE80211_AC_VO] = 3,
};

static void
mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
{
Expand All @@ -22,10 +29,10 @@ 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;
void *priv;
int idx;
u32 val;
u8 tid = 0;

if (skb->len < MT_TXD_SIZE + sizeof(struct ieee80211_hdr))
goto free;
Expand All @@ -42,19 +49,36 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
goto free;

priv = msta = container_of(wcid, struct mt7603_sta, wcid);
val = le32_to_cpu(txd[0]);
val &= ~(MT_TXD0_P_IDX | MT_TXD0_Q_IDX);
val |= FIELD_PREP(MT_TXD0_Q_IDX, MT_TX_HW_QUEUE_MGMT);
txd[0] = cpu_to_le32(val);

sta = container_of(priv, struct ieee80211_sta, drv_priv);
hdr = (struct ieee80211_hdr *)&skb->data[MT_TXD_SIZE];
if (ieee80211_is_data_qos(hdr->frame_control))

hwq = wmm_queue_map[IEEE80211_AC_BE];
if (ieee80211_is_data_qos(hdr->frame_control)) {
tid = *ieee80211_get_qos_ctl(hdr) &
IEEE80211_QOS_CTL_TAG1D_MASK;
skb_set_queue_mapping(skb, tid_to_ac[tid]);
IEEE80211_QOS_CTL_TAG1D_MASK;
u8 qid = tid_to_ac[tid];
hwq = wmm_queue_map[qid];
skb_set_queue_mapping(skb, qid);
} else if (ieee80211_is_data(hdr->frame_control)) {
skb_set_queue_mapping(skb, IEEE80211_AC_BE);
hwq = wmm_queue_map[IEEE80211_AC_BE];
} else {
skb_pull(skb, MT_TXD_SIZE);
if (!ieee80211_is_bufferable_mmpdu(skb))
goto free;
skb_push(skb, MT_TXD_SIZE);
skb_set_queue_mapping(skb, MT_TXQ_PSD);
hwq = MT_TX_HW_QUEUE_MGMT;
}

ieee80211_sta_set_buffered(sta, tid, true);

val = le32_to_cpu(txd[0]);
val &= ~(MT_TXD0_P_IDX | MT_TXD0_Q_IDX);
val |= FIELD_PREP(MT_TXD0_Q_IDX, hwq);
txd[0] = cpu_to_le32(val);

spin_lock_bh(&dev->ps_lock);
__skb_queue_tail(&msta->psq, skb);
if (skb_queue_len(&msta->psq) >= 64) {
Expand Down Expand Up @@ -151,12 +175,6 @@ static int mt7603_poll_tx(struct napi_struct *napi, int budget)

int mt7603_dma_init(struct mt7603_dev *dev)
{
static const u8 wmm_queue_map[] = {
[IEEE80211_AC_BK] = 0,
[IEEE80211_AC_BE] = 1,
[IEEE80211_AC_VI] = 2,
[IEEE80211_AC_VO] = 3,
};
int ret;
int i;

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/mt7603/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,7 @@ void mt7603_pse_client_reset(struct mt7603_dev *dev)
MT_CLIENT_RESET_TX_R_E_2_S);

/* Start PSE client TX abort */
mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_FORCE_TX_EOF);
mt76_set(dev, addr, MT_CLIENT_RESET_TX_R_E_1);
mt76_poll_msec(dev, addr, MT_CLIENT_RESET_TX_R_E_1_S,
MT_CLIENT_RESET_TX_R_E_1_S, 500);
Expand Down
8 changes: 7 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt76_connac.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,19 @@ static inline bool is_mt7925(struct mt76_dev *dev)
return mt76_chip(dev) == 0x7925;
}

static inline bool is_mt7920(struct mt76_dev *dev)
{
return mt76_chip(dev) == 0x7920;
}

static inline bool is_mt7922(struct mt76_dev *dev)
{
return mt76_chip(dev) == 0x7922;
}

static inline bool is_mt7921(struct mt76_dev *dev)
{
return mt76_chip(dev) == 0x7961 || is_mt7922(dev);
return mt76_chip(dev) == 0x7961 || is_mt7922(dev) || is_mt7920(dev);
}

static inline bool is_mt7663(struct mt76_dev *dev)
Expand Down Expand Up @@ -259,6 +264,7 @@ static inline bool is_mt76_fw_txp(struct mt76_dev *dev)
{
switch (mt76_chip(dev)) {
case 0x7961:
case 0x7920:
case 0x7922:
case 0x7925:
case 0x7663:
Expand Down
22 changes: 15 additions & 7 deletions drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mt76_connac_mcu_add_nested_tlv(struct sk_buff *skb, int tag, int len,
};
u16 ntlv;

ptlv = skb_put(skb, len);
ptlv = skb_put_zero(skb, len);
memcpy(ptlv, &tlv, sizeof(tlv));

ntlv = le16_to_cpu(ntlv_hdr->tlv_num);
Expand All @@ -283,7 +283,7 @@ __mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
};
struct sk_buff *skb;

if (is_mt799x(dev) && !wcid->sta)
if (wcid && !wcid->sta)
hdr.muar_idx = 0xe;

mt76_connac_mcu_get_wlan_idx(dev, wcid, &hdr.wlan_idx_lo,
Expand Down Expand Up @@ -392,7 +392,14 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,

if (!sta) {
basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);
eth_broadcast_addr(basic->peer_addr);

if (vif->type == NL80211_IFTYPE_STATION &&
!is_zero_ether_addr(vif->bss_conf.bssid)) {
memcpy(basic->peer_addr, vif->bss_conf.bssid, ETH_ALEN);
basic->aid = cpu_to_le16(vif->cfg.aid);
} else {
eth_broadcast_addr(basic->peer_addr);
}
return;
}

Expand Down Expand Up @@ -1670,7 +1677,7 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
set_bit(MT76_HW_SCANNING, &phy->state);
mvif->scan_seq_num = (mvif->scan_seq_num + 1) & 0x7f;

req = (struct mt76_connac_hw_scan_req *)skb_put(skb, sizeof(*req));
req = (struct mt76_connac_hw_scan_req *)skb_put_zero(skb, sizeof(*req));

req->seq_num = mvif->scan_seq_num | mvif->band_idx << 7;
req->bss_idx = mvif->idx;
Expand Down Expand Up @@ -1798,7 +1805,7 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy,

mvif->scan_seq_num = (mvif->scan_seq_num + 1) & 0x7f;

req = (struct mt76_connac_sched_scan_req *)skb_put(skb, sizeof(*req));
req = (struct mt76_connac_sched_scan_req *)skb_put_zero(skb, sizeof(*req));
req->version = 1;
req->seq_num = mvif->scan_seq_num | mvif->band_idx << 7;

Expand Down Expand Up @@ -2321,7 +2328,7 @@ int mt76_connac_mcu_update_gtk_rekey(struct ieee80211_hw *hw,
return -ENOMEM;

skb_put_data(skb, &hdr, sizeof(hdr));
gtk_tlv = (struct mt76_connac_gtk_rekey_tlv *)skb_put(skb,
gtk_tlv = (struct mt76_connac_gtk_rekey_tlv *)skb_put_zero(skb,
sizeof(*gtk_tlv));
gtk_tlv->tag = cpu_to_le16(UNI_OFFLOAD_OFFLOAD_GTK_REKEY);
gtk_tlv->len = cpu_to_le16(sizeof(*gtk_tlv));
Expand Down Expand Up @@ -2446,7 +2453,7 @@ mt76_connac_mcu_set_wow_pattern(struct mt76_dev *dev,
return -ENOMEM;

skb_put_data(skb, &hdr, sizeof(hdr));
ptlv = (struct mt76_connac_wow_pattern_tlv *)skb_put(skb, sizeof(*ptlv));
ptlv = (struct mt76_connac_wow_pattern_tlv *)skb_put_zero(skb, sizeof(*ptlv));
ptlv->tag = cpu_to_le16(UNI_SUSPEND_WOW_PATTERN);
ptlv->len = cpu_to_le16(sizeof(*ptlv));
ptlv->data_len = pattern->pattern_len;
Expand Down Expand Up @@ -2527,6 +2534,7 @@ int mt76_connac_mcu_set_hif_suspend(struct mt76_dev *dev, bool suspend)
__le16 tag;
__le16 len;
u8 suspend;
u8 pad[7];
} __packed hif_suspend;
} req = {
.hif_suspend = {
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,12 @@ struct sta_rec_ra_fixed {
u8 mmps_mode;
} __packed;

struct sta_rec_tx_proc {
__le16 tag;
__le16 len;
__le32 flag;
} __packed;

/* wtbl_rec */

struct wtbl_req_hdr {
Expand Down Expand Up @@ -777,6 +783,7 @@ struct wtbl_raw {
sizeof(struct sta_rec_ra_fixed) + \
sizeof(struct sta_rec_he_6g_capa) + \
sizeof(struct sta_rec_pn_info) + \
sizeof(struct sta_rec_tx_proc) + \
sizeof(struct tlv) + \
MT76_CONNAC_WTBL_UPDATE_MAX_SIZE)

Expand Down Expand Up @@ -1213,6 +1220,7 @@ enum {
MCU_EXT_CMD_TXDPD_CAL = 0x60,
MCU_EXT_CMD_CAL_CACHE = 0x67,
MCU_EXT_CMD_RED_ENABLE = 0x68,
MCU_EXT_CMD_CP_SUPPORT = 0x75,
MCU_EXT_CMD_SET_RADAR_TH = 0x7c,
MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d,
MCU_EXT_CMD_MWDS_SUPPORT = 0x80,
Expand Down
29 changes: 16 additions & 13 deletions drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,34 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
{
struct mt76_dev *mdev = &dev->mt76;
u8 *eeprom = mdev->eeprom.data;
u32 val = eeprom[MT_EE_DO_PRE_CAL];
u32 offs;
u32 offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
u32 size, val = eeprom[offs];
int ret;

if (!dev->flash_mode)
if (!dev->flash_mode || !val)
return 0;

if (val != (MT_EE_WIFI_CAL_DPD | MT_EE_WIFI_CAL_GROUP))
return 0;
size = mt7915_get_cal_group_size(dev) + mt7915_get_cal_dpd_size(dev);

val = MT_EE_CAL_GROUP_SIZE + MT_EE_CAL_DPD_SIZE;
dev->cal = devm_kzalloc(mdev->dev, val, GFP_KERNEL);
dev->cal = devm_kzalloc(mdev->dev, size, GFP_KERNEL);
if (!dev->cal)
return -ENOMEM;

offs = is_mt7915(&dev->mt76) ? MT_EE_PRECAL : MT_EE_PRECAL_V2;

ret = mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val);
ret = mt76_get_of_data_from_mtd(mdev, dev->cal, offs, size);
if (!ret)
return ret;

return mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", val);
ret = mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", size);
if (!ret)
return ret;

dev_warn(mdev->dev, "missing precal data, size=%d\n", size);
devm_kfree(mdev->dev, dev->cal);
dev->cal = NULL;

return ret;
}

static int mt7915_check_eeprom(struct mt7915_dev *dev)
Expand Down Expand Up @@ -256,10 +262,7 @@ int mt7915_eeprom_init(struct mt7915_dev *dev)
return ret;
}

ret = mt7915_eeprom_load_precal(dev);
if (ret)
return ret;

mt7915_eeprom_load_precal(dev);
mt7915_eeprom_parse_hw_cap(dev, &dev->phy);
memcpy(dev->mphy.macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR,
ETH_ALEN);
Expand Down
Loading