[PATCH v2 08/16] mt76: mt7921: make all event parser reusable between mt7921s and mt7921e
Lorenzo Bianconi
lorenzo.bianconi at redhat.com
Sat Sep 18 03:16:02 PDT 2021
> From: Sean Wang <sean.wang at mediatek.com>
>
> The longer event such as the event for mcu_get_nic_capability would hold
> the data in paged fragment skb for the SDIO device so we turn the skb to
> be linearized skb before accessing it to reuse the same event parser
> betweem mt7921s and mt7921e.
>
> Tested-by: Deren Wu <deren.wu at mediatek.com>
> Signed-off-by: Sean Wang <sean.wang at mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> index 866b8797f16e..863781895652 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> @@ -456,7 +456,14 @@ mt7921_mcu_rx_unsolicited_event(struct mt7921_dev *dev, struct sk_buff *skb)
>
> void mt7921_mcu_rx_event(struct mt7921_dev *dev, struct sk_buff *skb)
> {
> - struct mt7921_mcu_rxd *rxd = (struct mt7921_mcu_rxd *)skb->data;
> + struct mt7921_mcu_rxd *rxd;
> + int ret;
> +
> + ret = skb_linearize(skb);
nit: we do not need ret variable here:
if (skb_linearize(skb))
return;
> + if (ret)
> + return;
> +
> + rxd = (struct mt7921_mcu_rxd *)skb->data;
>
> if (rxd->eid == 0x6) {
> mt76_mcu_rx_event(&dev->mt76, skb);
> --
> 2.25.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20210918/83ca6a83/attachment-0001.sig>
More information about the Linux-mediatek
mailing list