From: Ryder Lee <ryder.lee@mediatek.com>
To: <sean.wang@mediatek.com>
Cc: <nbd@nbd.name>, <lorenzo.bianconi@redhat.com>,
<Soul.Huang@mediatek.com>, <YN.Chen@mediatek.com>,
<robin.chiu@mediatek.com>, <ch.yeh@mediatek.com>,
<posh.sun@mediatek.com>, <Eric.Liang@mediatek.com>,
<linux-wireless@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: Re: [PATCH -next v4 02/13] mt76: mt7921: add MCU support
Date: Thu, 31 Dec 2020 16:55:46 +0800 [thread overview]
Message-ID: <1609404946.23449.15.camel@mtkswgap22> (raw)
In-Reply-To: <38dc730fe632525472456816dd51620d9b3ba547.1609347310.git.objelf@gmail.com>
On Thu, 2020-12-31 at 02:06 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> MT7921 contains a microprocessor with which the host can use command/event
> to communicate to implement offload features such as establish connection,
> hardware scan and so on. The host has to download the ROM patch, RAM
> firmware and finally activate the MCU to complete the MT7921
> initialization.
>
> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Co-developed-by: Soul Huang <Soul.Huang@mediatek.com>
> Signed-off-by: Soul Huang <Soul.Huang@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> .../wireless/mediatek/mt76/mt7921/Makefile | 2 +-
> .../net/wireless/mediatek/mt76/mt7921/mac.h | 333 +++
> .../net/wireless/mediatek/mt76/mt7921/mcu.c | 2438 +++++++++++++++++
> .../net/wireless/mediatek/mt76/mt7921/mcu.h | 1050 +++++++
> .../wireless/mediatek/mt76/mt7921/mt7921.h | 353 +++
> .../net/wireless/mediatek/mt76/mt7921/regs.h | 413 +++
> 6 files changed, 4588 insertions(+), 1 deletion(-)
> create mode 100644 drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> create mode 100644 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> create mode 100644 drivers/net/wireless/mediatek/mt76/mt7921/mcu.h
> create mode 100644 drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
> create mode 100644 drivers/net/wireless/mediatek/mt76/mt7921/regs.h
> +static int
> +mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
> + int cmd, int *wait_seq)
> +{
> + struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
> + int txd_len, mcu_cmd = cmd & MCU_CMD_MASK;
> + enum mt76_txq_id txq = MT_MCUQ_WM;
Implicit conversion from enumeration type 'enum mt76_mcuq_id' to
different enumeration type 'enum mt76_txq_id'
Should be enum mt76_mcuq_id
> +static int
> +mt7921_mcu_sta_key_tlv(struct sk_buff *skb, struct ieee80211_key_conf *key,
> + enum set_key_cmd cmd)
> +{
> + struct sta_rec_sec *sec;
> + struct tlv *tlv;
> + u32 len = sizeof(*sec);
> +
> + tlv = mt7921_mcu_add_tlv(skb, STA_REC_KEY_V2, sizeof(*sec));
> +
> + sec = (struct sta_rec_sec *)tlv;
> + sec->add = cmd;
> +
> + if (cmd == SET_KEY) {
> + struct sec_key *sec_key;
> + u8 cipher;
> +
> + cipher = mt7921_mcu_get_cipher(key->cipher);
> + if (cipher == MT_CIPHER_NONE)
> + return -EOPNOTSUPP;
> +
> + sec_key = &sec->key[0];
> + sec_key->cipher_len = sizeof(*sec_key);
> + sec_key->key_id = key->keyidx;
> +
> + if (cipher == MT_CIPHER_BIP_CMAC_128) {
This was copied/pasted my wrong flow from mt7915 so I guess BIP_CMAC_128
cannot work. I've fixed this recently for mt7915. You may take a look at
https://patchwork.kernel.org/project/linux-wireless/patch/fc6abcd810a74bb4e8568b0f46bfc851fdcfd800.1607445161.git.ryder.lee@mediatek.com/
Or, fallback to sw version
> +extern const struct ieee80211_ops mt7921_ops;
> +extern struct pci_driver mt7921_pci_driver;
> +
> +u32 mt7921_reg_map(struct mt7921_dev *dev, u32 addr);
> +
> +int mt7921_register_device(struct mt7921_dev *dev);
> +void mt7921_unregister_device(struct mt7921_dev *dev);
> +int mt7921_eeprom_init(struct mt7921_dev *dev);
> +void mt7921_eeprom_parse_band_config(struct mt7921_phy *phy);
> +int mt7921_eeprom_get_target_power(struct mt7921_dev *dev,
> + struct ieee80211_channel *chan,
> + u8 chain_idx);
> +void mt7921_eeprom_init_sku(struct mt7921_dev *dev);
> +int mt7921_dma_init(struct mt7921_dev *dev);
> +void mt7921_dma_prefetch(struct mt7921_dev *dev);
> +void mt7921_dma_cleanup(struct mt7921_dev *dev);
> +int mt7921_mcu_init(struct mt7921_dev *dev);
> +int mt7921_mcu_add_bss_info(struct mt7921_phy *phy,
> + struct ieee80211_vif *vif, int enable);
> +int mt7921_mcu_sta_update_hdr_trans(struct mt7921_dev *dev,
> + struct ieee80211_vif *vif,
> + struct ieee80211_sta *sta);
> +int mt7921_mcu_add_key(struct mt7921_dev *dev, struct ieee80211_vif *vif,
> + struct mt7921_sta *msta, struct ieee80211_key_conf *key,
> + enum set_key_cmd cmd);
> +int mt7921_set_channel(struct mt7921_phy *phy);
> +int mt7921_mcu_set_chan_info(struct mt7921_phy *phy, int cmd);
> +int mt7921_mcu_set_tx(struct mt7921_dev *dev, struct ieee80211_vif *vif);
> +int mt7921_mcu_set_eeprom(struct mt7921_dev *dev);
> +int mt7921_mcu_get_eeprom(struct mt7921_dev *dev, u32 offset);
> +int mt7921_mcu_set_mac(struct mt7921_dev *dev, int band, bool enable,
> + bool hdr_trans);
> +int mt7921_mcu_set_rts_thresh(struct mt7921_phy *phy, u32 val);
> +int mt7921_mcu_get_rx_rate(struct mt7921_phy *phy, struct ieee80211_vif *vif,
> + struct ieee80211_sta *sta, struct rate_info *rate);
Just a quick look. Seem some unused functions (used by mt7915) are
exported here. e.g. mt7921_mcu_get_rx_rate()
next prev parent reply other threads:[~2020-12-31 8:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 18:06 [PATCH -next v4 00/13] introduce mt7921e support sean.wang
2020-12-30 18:06 ` [PATCH -next v4 01/13] mt76: mt7921: add module support sean.wang
2021-01-03 12:00 ` Felix Fietkau
2020-12-30 18:06 ` [PATCH -next v4 02/13] mt76: mt7921: add MCU support sean.wang
2020-12-31 8:55 ` Ryder Lee [this message]
2020-12-30 18:06 ` [PATCH -next v4 03/13] mt76: mt7921: add MAC support sean.wang
2020-12-31 8:09 ` Ryder Lee
2020-12-31 22:58 ` Ryder Lee
2020-12-30 18:06 ` [PATCH -next v4 04/13] mt76: mt7921: add DMA support sean.wang
2020-12-30 18:06 ` [PATCH -next v4 05/13] mt76: mt7921: add EEPROM support sean.wang
2020-12-30 18:06 ` [PATCH -next v4 06/13] mt76: mt7921: add ieee80211_ops sean.wang
2020-12-30 18:06 ` [PATCH -next v4 07/13] mt76: mt7921: introduce mt7921e support sean.wang
2020-12-30 18:06 ` [PATCH -next v4 08/13] mt76: mt7921: add debugfs support sean.wang
2020-12-30 18:06 ` [PATCH -next v4 09/13] mt76: mt7921: introduce schedule scan support sean.wang
2020-12-30 18:06 ` [PATCH -next v4 10/13] mt76: mt7921: introduce 802.11 PS support in sta mode sean.wang
2020-12-30 18:06 ` [PATCH -next v4 11/13] mt76: mt7921: introduce support for hardware beacon filter sean.wang
2020-12-30 18:06 ` [PATCH -next v4 12/13] mt76: mt7921: introduce beacon_loss mcu event sean.wang
2020-12-30 18:06 ` [PATCH -next v4 13/13] mt76: mt7921: introduce PM support sean.wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1609404946.23449.15.camel@mtkswgap22 \
--to=ryder.lee@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=ch.yeh@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).