Merge tag 'ieee802154-for-net-2022-01-28' of git://git.kernel.org/pub/scm/linux/kerne...
authorDavid S. Miller <davem@davemloft.net>
Fri, 28 Jan 2022 15:10:45 +0000 (15:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jan 2022 15:10:45 +0000 (15:10 +0000)
Stefan Schmidt says:

====================
pull-request: ieee802154 for net 2022-01-28

An update from ieee802154 for your *net* tree.

A bunch of fixes in drivers, all from Miquel Raynal.
Clarifying the default channel in hwsim, leak fixes in at86rf230 and ca8210 as
well as a symbol duration fix for mcr20a. Topping up the driver fixes with
better error codes in nl802154 and a cleanup in MAINTAINERS for an orphaned
driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
MAINTAINERS
drivers/net/ieee802154/at86rf230.c
drivers/net/ieee802154/ca8210.c
drivers/net/ieee802154/mac802154_hwsim.c
drivers/net/ieee802154/mcr20a.c
net/ieee802154/nl802154.c

index f410884..bb83dcb 100644 (file)
@@ -4157,9 +4157,8 @@ N:        csky
 K:     csky
 
 CA8210 IEEE-802.15.4 RADIO DRIVER
-M:     Harry Morris <h.morris@cascoda.com>
 L:     linux-wpan@vger.kernel.org
-S:     Maintained
+S:     Orphan
 W:     https://github.com/Cascoda/ca8210-linux.git
 F:     Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
 F:     drivers/net/ieee802154/ca8210.c
index 7d67f41..4f5ef8a 100644 (file)
@@ -100,6 +100,7 @@ struct at86rf230_local {
        unsigned long cal_timeout;
        bool is_tx;
        bool is_tx_from_off;
+       bool was_tx;
        u8 tx_retry;
        struct sk_buff *tx_skb;
        struct at86rf230_state_change tx;
@@ -343,7 +344,11 @@ at86rf230_async_error_recover_complete(void *context)
        if (ctx->free)
                kfree(ctx);
 
-       ieee802154_wake_queue(lp->hw);
+       if (lp->was_tx) {
+               lp->was_tx = 0;
+               dev_kfree_skb_any(lp->tx_skb);
+               ieee802154_wake_queue(lp->hw);
+       }
 }
 
 static void
@@ -352,7 +357,11 @@ at86rf230_async_error_recover(void *context)
        struct at86rf230_state_change *ctx = context;
        struct at86rf230_local *lp = ctx->lp;
 
-       lp->is_tx = 0;
+       if (lp->is_tx) {
+               lp->was_tx = 1;
+               lp->is_tx = 0;
+       }
+
        at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON,
                                     at86rf230_async_error_recover_complete);
 }
index ece6ff6..f3438d3 100644 (file)
@@ -1771,6 +1771,7 @@ static int ca8210_async_xmit_complete(
                        status
                );
                if (status != MAC_TRANSACTION_OVERFLOW) {
+                       dev_kfree_skb_any(priv->tx_skb);
                        ieee802154_wake_queue(priv->hw);
                        return 0;
                }
index 8caa61e..36f1c5a 100644 (file)
@@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
                goto err_pib;
        }
 
+       pib->channel = 13;
        rcu_assign_pointer(phy->pib, pib);
        phy->idx = idx;
        INIT_LIST_HEAD(&phy->edges);
index 8dc04e2..383231b 100644 (file)
@@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp)
        dev_dbg(printdev(lp), "%s\n", __func__);
 
        phy->symbol_duration = 16;
-       phy->lifs_period = 40;
-       phy->sifs_period = 12;
+       phy->lifs_period = 40 * phy->symbol_duration;
+       phy->sifs_period = 12 * phy->symbol_duration;
 
        hw->flags = IEEE802154_HW_TX_OMIT_CKSUM |
                        IEEE802154_HW_AFILT |
index 277124f..e0b072a 100644 (file)
@@ -1441,7 +1441,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
@@ -1634,7 +1634,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
@@ -1812,7 +1812,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;
@@ -1988,7 +1988,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
 
        hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
        if (!hdr)
-               return -1;
+               return -ENOBUFS;
 
        if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
                goto nla_put_failure;