i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()
[firefly-linux-kernel-4.4.55.git] / net / mac802154 / main.c
index 356b346e1ee86fdeadebf7be5d318c70dbc0d969..e8cab5bb80c664669f9c34b36e5e9178db83ae13 100644 (file)
@@ -40,7 +40,7 @@ static void ieee802154_tasklet_handler(unsigned long data)
                         * netstack.
                         */
                        skb->pkt_type = 0;
-                       ieee802154_rx(&local->hw, skb);
+                       ieee802154_rx(local, skb);
                        break;
                default:
                        WARN(1, "mac802154: Packet is of unknown type %d\n",
@@ -58,11 +58,9 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
        struct ieee802154_local *local;
        size_t priv_size;
 
-       if (!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed ||
-           !ops->start || !ops->stop || !ops->set_channel) {
-               pr_err("undefined IEEE802.15.4 device operations\n");
+       if (WARN_ON(!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed ||
+                   !ops->start || !ops->stop || !ops->set_channel))
                return NULL;
-       }
 
        /* Ensure 32-byte alignment of our private data and hw private data.
         * We use the wpan_phy priv data for both our ieee802154_local and for
@@ -107,11 +105,13 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
 
        skb_queue_head_init(&local->skb_queue);
 
+       INIT_WORK(&local->tx_work, ieee802154_xmit_worker);
+
        /* init supported flags with 802.15.4 default ranges */
        phy->supported.max_minbe = 8;
        phy->supported.min_maxbe = 3;
        phy->supported.max_maxbe = 8;
-       phy->supported.min_frame_retries = -1;
+       phy->supported.min_frame_retries = 0;
        phy->supported.max_frame_retries = 7;
        phy->supported.max_csma_backoffs = 5;
        phy->supported.lbt = NL802154_SUPPORTED_BOOL_FALSE;
@@ -177,11 +177,8 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
        }
 
        if (!(hw->flags & IEEE802154_HW_FRAME_RETRIES)) {
-               /* TODO should be 3, but our default value is -1 which means
-                * no ARET handling.
-                */
-               local->phy->supported.min_frame_retries = -1;
-               local->phy->supported.max_frame_retries = -1;
+               local->phy->supported.min_frame_retries = 3;
+               local->phy->supported.max_frame_retries = 3;
        }
 
        if (hw->flags & IEEE802154_HW_PROMISCUOUS)