[PATCH -next v2] mt76: mt7921: introduce mt7921e support

Nicolas Boichat drinkcat at chromium.org
Mon Dec 14 19:08:44 EST 2020


On Mon, Dec 14, 2020 at 8:56 PM <sean.wang at mediatek.com> wrote:
>
> From: Sean Wang <sean.wang at mediatek.com>
>
> Introduce support for mt7921e 802.11ax (Wi-Fi 6) 2x2:2SS chipset.
>
> Co-developed-by: Lorenzo Bianconi <lorenzo at kernel.org>
> Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
> Co-developed-by: Soul Huang <Soul.Huang at mediatek.com>
> Signed-off-by: Soul Huang <Soul.Huang at mediatek.com>
> Signed-off-by: Sean Wang <sean.wang at mediatek.com>
> ---
> v2:
>  - Mark the patch as -next
> ---
>  drivers/net/wireless/mediatek/mt76/Kconfig    |    1 +
>  drivers/net/wireless/mediatek/mt76/Makefile   |    1 +
>  .../net/wireless/mediatek/mt76/mt7921/Kconfig |   10 +
>  .../wireless/mediatek/mt76/mt7921/Makefile    |    6 +
>  .../wireless/mediatek/mt76/mt7921/debugfs.c   |  180 ++
>  .../net/wireless/mediatek/mt76/mt7921/dma.c   |  356 +++
>  .../wireless/mediatek/mt76/mt7921/eeprom.c    |  247 ++
>  .../wireless/mediatek/mt76/mt7921/eeprom.h    |  126 +
>  .../net/wireless/mediatek/mt76/mt7921/init.c  |  482 +++
>  .../net/wireless/mediatek/mt76/mt7921/mac.c   | 1387 +++++++++
>  .../net/wireless/mediatek/mt76/mt7921/mac.h   |  367 +++
>  .../net/wireless/mediatek/mt76/mt7921/main.c  |  854 ++++++
>  .../net/wireless/mediatek/mt76/mt7921/mcu.c   | 2588 +++++++++++++++++
>  .../net/wireless/mediatek/mt76/mt7921/mcu.h   |  991 +++++++
>  .../wireless/mediatek/mt76/mt7921/mt7921.h    |  379 +++
>  .../net/wireless/mediatek/mt76/mt7921/pci.c   |  209 ++
>  .../net/wireless/mediatek/mt76/mt7921/regs.h  |  455 +++
>  17 files changed, 8639 insertions(+)

I'm not likely to review this, but, this is a _huge_ patch, is there a
way to split it in easier to digest parts?

[snip]

> +static void
> +mt7921_mcu_debug_msg_event(struct mt7921_dev *dev, struct sk_buff *skb)
> +{
> +       struct mt7921_mcu_rxd *rxd = (struct mt7921_mcu_rxd *)skb->data;
> +       struct debug_msg {
> +               __le16 id;
> +               u8 type;
> +               u8 flag;
> +               __le32 value;
> +               __le16 len;
> +               u8 content[512];
> +       } __packed * debug_msg;
> +       u16 cur_len;
> +       int i;
> +
> +       skb_pull(skb, sizeof(*rxd));
> +       debug_msg = (struct debug_msg *)skb->data;
> +
> +       cur_len = min_t(u16, le16_to_cpu(debug_msg->len), 512);
> +
> +       if (debug_msg->type == 0x3) {
> +               for (i = 0 ; i < cur_len; i++)
> +                       if (!debug_msg->content[i])
> +                               debug_msg->content[i] = ' ';
> +
> +               trace_printk("%s", debug_msg->content);

Please do not use trace_printk in production code [1,2], it is only
meant for debug use. Consider using trace events, or dev_dbg.

[1] https://elixir.bootlin.com/linux/v5.8/source/kernel/trace/trace.c#L3158
[2] https://elixir.bootlin.com/linux/v5.8/source/include/linux/kernel.h#L766

> +       }
> +}
> +

> --
> 2.25.1
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek



More information about the Linux-mediatek mailing list