These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / wireless / mwifiex / init.c
index e12192f..de74a77 100644 (file)
@@ -56,7 +56,7 @@ static void wakeup_timer_fn(unsigned long data)
 {
        struct mwifiex_adapter *adapter = (struct mwifiex_adapter *)data;
 
-       dev_err(adapter->dev, "Firmware wakeup failed\n");
+       mwifiex_dbg(adapter, ERROR, "Firmware wakeup failed\n");
        adapter->hw_status = MWIFIEX_HW_STATUS_RESET;
        mwifiex_cancel_all_pending_cmd(adapter);
 
@@ -77,7 +77,8 @@ int mwifiex_init_priv(struct mwifiex_private *priv)
 
        priv->media_connected = false;
        eth_broadcast_addr(priv->curr_addr);
-
+       priv->port_open = false;
+       priv->usb_port = MWIFIEX_USB_EP_DATA;
        priv->pkt_tx_ctrl = 0;
        priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
        priv->data_rate = 0;    /* Initially indicate the rate as auto */
@@ -172,8 +173,9 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
        /* Allocate command buffer */
        ret = mwifiex_alloc_cmd_buffer(adapter);
        if (ret) {
-               dev_err(adapter->dev, "%s: failed to alloc cmd buffer\n",
-                       __func__);
+               mwifiex_dbg(adapter, ERROR,
+                           "%s: failed to alloc cmd buffer\n",
+                           __func__);
                return -1;
        }
 
@@ -182,8 +184,9 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
                              + INTF_HEADER_LEN);
 
        if (!adapter->sleep_cfm) {
-               dev_err(adapter->dev, "%s: failed to alloc sleep cfm"
-                       " cmd buffer\n", __func__);
+               mwifiex_dbg(adapter, ERROR,
+                           "%s: failed to alloc sleep cfm\t"
+                           " cmd buffer\n", __func__);
                return -1;
        }
        skb_reserve(adapter->sleep_cfm, INTF_HEADER_LEN);
@@ -299,7 +302,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
        adapter->iface_limit.sta_intf = MWIFIEX_MAX_STA_NUM;
        adapter->iface_limit.uap_intf = MWIFIEX_MAX_UAP_NUM;
        adapter->iface_limit.p2p_intf = MWIFIEX_MAX_P2P_NUM;
-
+       adapter->active_scan_triggered = false;
        setup_timer(&adapter->wakeup_timer, wakeup_timer_fn,
                    (unsigned long)adapter);
 }
@@ -417,7 +420,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
        mwifiex_free_lock_list(adapter);
 
        /* Free command buffer */
-       dev_dbg(adapter->dev, "info: free cmd buffer\n");
+       mwifiex_dbg(adapter, INFO, "info: free cmd buffer\n");
        mwifiex_free_cmd_buffer(adapter);
 
        for (idx = 0; idx < adapter->num_mem_types; idx++) {
@@ -433,6 +436,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
 
        if (adapter->drv_info_dump) {
                vfree(adapter->drv_info_dump);
+               adapter->drv_info_dump = NULL;
                adapter->drv_info_size = 0;
        }
 
@@ -496,6 +500,7 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
                INIT_LIST_HEAD(&priv->sta_list);
                INIT_LIST_HEAD(&priv->auto_tdls_list);
                skb_queue_head_init(&priv->tdls_txq);
+               skb_queue_head_init(&priv->bypass_txq);
 
                spin_lock_init(&priv->tx_ba_stream_tbl_lock);
                spin_lock_init(&priv->rx_reorder_tbl_lock);
@@ -547,11 +552,6 @@ int mwifiex_init_fw(struct mwifiex_adapter *adapter)
                }
        }
 
-       if (adapter->if_ops.init_fw_port) {
-               if (adapter->if_ops.init_fw_port(adapter))
-                       return -1;
-       }
-
        for (i = 0; i < adapter->priv_num; i++) {
                if (adapter->priv[i]) {
                        ret = mwifiex_sta_init_cmd(adapter->priv[i], first_sta,
@@ -595,10 +595,11 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
        for (i = 0; i < adapter->priv_num; ++i) {
                head = &adapter->bss_prio_tbl[i].bss_prio_head;
                lock = &adapter->bss_prio_tbl[i].bss_prio_lock;
-               dev_dbg(adapter->dev, "info: delete BSS priority table,"
-                               " bss_type = %d, bss_num = %d, i = %d,"
-                               " head = %p\n",
-                             priv->bss_type, priv->bss_num, i, head);
+               mwifiex_dbg(adapter, INFO,
+                           "info: delete BSS priority table,\t"
+                           "bss_type = %d, bss_num = %d, i = %d,\t"
+                           "head = %p\n",
+                           priv->bss_type, priv->bss_num, i, head);
 
                {
                        spin_lock_irqsave(lock, flags);
@@ -609,9 +610,10 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
                        list_for_each_entry_safe(bssprio_node, tmp_node, head,
                                                 list) {
                                if (bssprio_node->priv == priv) {
-                                       dev_dbg(adapter->dev, "info: Delete "
-                                               "node %p, next = %p\n",
-                                               bssprio_node, tmp_node);
+                                       mwifiex_dbg(adapter, INFO,
+                                                   "info: Delete\t"
+                                                   "node %p, next = %p\n",
+                                                   bssprio_node, tmp_node);
                                        list_del(&bssprio_node->list);
                                        kfree(bssprio_node);
                                }
@@ -659,20 +661,23 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
        adapter->hw_status = MWIFIEX_HW_STATUS_CLOSING;
        /* wait for mwifiex_process to complete */
        if (adapter->mwifiex_processing) {
-               dev_warn(adapter->dev, "main process is still running\n");
+               mwifiex_dbg(adapter, WARN,
+                           "main process is still running\n");
                return ret;
        }
 
        /* cancel current command */
        if (adapter->curr_cmd) {
-               dev_warn(adapter->dev, "curr_cmd is still in processing\n");
+               mwifiex_dbg(adapter, WARN,
+                           "curr_cmd is still in processing\n");
                del_timer_sync(&adapter->cmd_timer);
                mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd);
                adapter->curr_cmd = NULL;
        }
 
        /* shut down mwifiex */
-       dev_dbg(adapter->dev, "info: shutdown mwifiex...\n");
+       mwifiex_dbg(adapter, MSG,
+                   "info: shutdown mwifiex...\n");
 
        /* Clean up Tx/Rx queues and delete BSS priority table */
        for (i = 0; i < adapter->priv_num; i++) {
@@ -741,8 +746,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
                /* check if firmware is already running */
                ret = adapter->if_ops.check_fw_status(adapter, poll_num);
                if (!ret) {
-                       dev_notice(adapter->dev,
-                                  "WLAN FW already running! Skip FW dnld\n");
+                       mwifiex_dbg(adapter, MSG,
+                                   "WLAN FW already running! Skip FW dnld\n");
                        return 0;
                }
 
@@ -750,8 +755,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
 
                /* check if we are the winner for downloading FW */
                if (!adapter->winner) {
-                       dev_notice(adapter->dev,
-                                  "FW already running! Skip FW dnld\n");
+                       mwifiex_dbg(adapter, MSG,
+                                   "FW already running! Skip FW dnld\n");
                        goto poll_fw;
                }
        }
@@ -760,7 +765,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
                /* Download firmware with helper */
                ret = adapter->if_ops.prog_fw(adapter, pmfw);
                if (ret) {
-                       dev_err(adapter->dev, "prog_fw failed ret=%#x\n", ret);
+                       mwifiex_dbg(adapter, ERROR,
+                                   "prog_fw failed ret=%#x\n", ret);
                        return ret;
                }
        }
@@ -769,7 +775,8 @@ poll_fw:
        /* Check if the firmware is downloaded successfully or not */
        ret = adapter->if_ops.check_fw_status(adapter, poll_num);
        if (ret)
-               dev_err(adapter->dev, "FW failed to be active in time\n");
+               mwifiex_dbg(adapter, ERROR,
+                           "FW failed to be active in time\n");
 
        return ret;
 }