| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | | - * Marvell Wireless LAN device driver: commands and events |
|---|
| 2 | + * NXP Wireless LAN device driver: commands and events |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2011-2014, Marvell International Ltd. |
|---|
| 4 | + * Copyright 2011-2020 NXP |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * This software file (the "File") is distributed by Marvell International |
|---|
| 7 | | - * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 6 | + * This software file (the "File") is distributed by NXP |
|---|
| 7 | + * under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 8 | 8 | * (the "License"). You may use, redistribute and/or modify this File in |
|---|
| 9 | 9 | * accordance with the terms and conditions of the License, a copy of which |
|---|
| 10 | 10 | * is available by writing to the Free Software Foundation, Inc., |
|---|
| .. | .. |
|---|
| 39 | 39 | static void |
|---|
| 40 | 40 | mwifiex_init_cmd_node(struct mwifiex_private *priv, |
|---|
| 41 | 41 | struct cmd_ctrl_node *cmd_node, |
|---|
| 42 | | - u32 cmd_oid, void *data_buf, bool sync) |
|---|
| 42 | + u32 cmd_no, void *data_buf, bool sync) |
|---|
| 43 | 43 | { |
|---|
| 44 | 44 | cmd_node->priv = priv; |
|---|
| 45 | | - cmd_node->cmd_oid = cmd_oid; |
|---|
| 45 | + cmd_node->cmd_no = cmd_no; |
|---|
| 46 | + |
|---|
| 46 | 47 | if (sync) { |
|---|
| 47 | 48 | cmd_node->wait_q_enabled = true; |
|---|
| 48 | 49 | cmd_node->cmd_wait_q_woken = false; |
|---|
| .. | .. |
|---|
| 60 | 61 | mwifiex_get_cmd_node(struct mwifiex_adapter *adapter) |
|---|
| 61 | 62 | { |
|---|
| 62 | 63 | struct cmd_ctrl_node *cmd_node; |
|---|
| 63 | | - unsigned long flags; |
|---|
| 64 | 64 | |
|---|
| 65 | | - spin_lock_irqsave(&adapter->cmd_free_q_lock, flags); |
|---|
| 65 | + spin_lock_bh(&adapter->cmd_free_q_lock); |
|---|
| 66 | 66 | if (list_empty(&adapter->cmd_free_q)) { |
|---|
| 67 | 67 | mwifiex_dbg(adapter, ERROR, |
|---|
| 68 | 68 | "GET_CMD_NODE: cmd node not available\n"); |
|---|
| 69 | | - spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); |
|---|
| 69 | + spin_unlock_bh(&adapter->cmd_free_q_lock); |
|---|
| 70 | 70 | return NULL; |
|---|
| 71 | 71 | } |
|---|
| 72 | 72 | cmd_node = list_first_entry(&adapter->cmd_free_q, |
|---|
| 73 | 73 | struct cmd_ctrl_node, list); |
|---|
| 74 | 74 | list_del(&cmd_node->list); |
|---|
| 75 | | - spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); |
|---|
| 75 | + spin_unlock_bh(&adapter->cmd_free_q_lock); |
|---|
| 76 | 76 | |
|---|
| 77 | 77 | return cmd_node; |
|---|
| 78 | 78 | } |
|---|
| .. | .. |
|---|
| 92 | 92 | mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter, |
|---|
| 93 | 93 | struct cmd_ctrl_node *cmd_node) |
|---|
| 94 | 94 | { |
|---|
| 95 | | - cmd_node->cmd_oid = 0; |
|---|
| 95 | + cmd_node->cmd_no = 0; |
|---|
| 96 | 96 | cmd_node->cmd_flag = 0; |
|---|
| 97 | 97 | cmd_node->data_buf = NULL; |
|---|
| 98 | 98 | cmd_node->wait_q_enabled = false; |
|---|
| .. | .. |
|---|
| 116 | 116 | mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter, |
|---|
| 117 | 117 | struct cmd_ctrl_node *cmd_node) |
|---|
| 118 | 118 | { |
|---|
| 119 | | - unsigned long flags; |
|---|
| 120 | | - |
|---|
| 121 | 119 | if (!cmd_node) |
|---|
| 122 | 120 | return; |
|---|
| 123 | 121 | |
|---|
| .. | .. |
|---|
| 127 | 125 | mwifiex_clean_cmd_node(adapter, cmd_node); |
|---|
| 128 | 126 | |
|---|
| 129 | 127 | /* Insert node into cmd_free_q */ |
|---|
| 130 | | - spin_lock_irqsave(&adapter->cmd_free_q_lock, flags); |
|---|
| 128 | + spin_lock_bh(&adapter->cmd_free_q_lock); |
|---|
| 131 | 129 | list_add_tail(&cmd_node->list, &adapter->cmd_free_q); |
|---|
| 132 | | - spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags); |
|---|
| 130 | + spin_unlock_bh(&adapter->cmd_free_q_lock); |
|---|
| 133 | 131 | } |
|---|
| 134 | 132 | |
|---|
| 135 | 133 | /* This function reuses a command node. */ |
|---|
| .. | .. |
|---|
| 182 | 180 | struct host_cmd_ds_command *host_cmd; |
|---|
| 183 | 181 | uint16_t cmd_code; |
|---|
| 184 | 182 | uint16_t cmd_size; |
|---|
| 185 | | - unsigned long flags; |
|---|
| 186 | 183 | |
|---|
| 187 | 184 | if (!adapter || !cmd_node) |
|---|
| 188 | 185 | return -1; |
|---|
| .. | .. |
|---|
| 201 | 198 | } |
|---|
| 202 | 199 | |
|---|
| 203 | 200 | cmd_code = le16_to_cpu(host_cmd->command); |
|---|
| 201 | + cmd_node->cmd_no = cmd_code; |
|---|
| 204 | 202 | cmd_size = le16_to_cpu(host_cmd->size); |
|---|
| 205 | 203 | |
|---|
| 206 | 204 | if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET && |
|---|
| .. | .. |
|---|
| 221 | 219 | cmd_node->priv->bss_num, |
|---|
| 222 | 220 | cmd_node->priv->bss_type)); |
|---|
| 223 | 221 | |
|---|
| 224 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 222 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 225 | 223 | adapter->curr_cmd = cmd_node; |
|---|
| 226 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 224 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 227 | 225 | |
|---|
| 228 | 226 | /* Adjust skb length */ |
|---|
| 229 | 227 | if (cmd_node->cmd_skb->len > cmd_size) |
|---|
| .. | .. |
|---|
| 274 | 272 | adapter->cmd_wait_q.status = -1; |
|---|
| 275 | 273 | mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); |
|---|
| 276 | 274 | |
|---|
| 277 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 275 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 278 | 276 | adapter->curr_cmd = NULL; |
|---|
| 279 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 277 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 280 | 278 | |
|---|
| 281 | 279 | adapter->dbg.num_cmd_host_to_card_failure++; |
|---|
| 282 | 280 | return -1; |
|---|
| .. | .. |
|---|
| 341 | 339 | sleep_cfm_tmp = |
|---|
| 342 | 340 | dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm) |
|---|
| 343 | 341 | + MWIFIEX_TYPE_LEN); |
|---|
| 342 | + if (!sleep_cfm_tmp) { |
|---|
| 343 | + mwifiex_dbg(adapter, ERROR, |
|---|
| 344 | + "SLEEP_CFM: dev_alloc_skb failed\n"); |
|---|
| 345 | + return -ENOMEM; |
|---|
| 346 | + } |
|---|
| 347 | + |
|---|
| 344 | 348 | skb_put(sleep_cfm_tmp, sizeof(struct mwifiex_opt_sleep_confirm) |
|---|
| 345 | 349 | + MWIFIEX_TYPE_LEN); |
|---|
| 346 | 350 | put_unaligned_le32(MWIFIEX_USB_TYPE_CMD, sleep_cfm_tmp->data); |
|---|
| .. | .. |
|---|
| 615 | 619 | } |
|---|
| 616 | 620 | |
|---|
| 617 | 621 | /* Initialize the command node */ |
|---|
| 618 | | - mwifiex_init_cmd_node(priv, cmd_node, cmd_oid, data_buf, sync); |
|---|
| 622 | + mwifiex_init_cmd_node(priv, cmd_node, cmd_no, data_buf, sync); |
|---|
| 619 | 623 | |
|---|
| 620 | 624 | if (!cmd_node->cmd_skb) { |
|---|
| 621 | 625 | mwifiex_dbg(adapter, ERROR, |
|---|
| .. | .. |
|---|
| 689 | 693 | { |
|---|
| 690 | 694 | struct host_cmd_ds_command *host_cmd = NULL; |
|---|
| 691 | 695 | u16 command; |
|---|
| 692 | | - unsigned long flags; |
|---|
| 693 | 696 | bool add_tail = true; |
|---|
| 694 | 697 | |
|---|
| 695 | 698 | host_cmd = (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); |
|---|
| .. | .. |
|---|
| 711 | 714 | } |
|---|
| 712 | 715 | } |
|---|
| 713 | 716 | |
|---|
| 714 | | - spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); |
|---|
| 717 | + spin_lock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 715 | 718 | if (add_tail) |
|---|
| 716 | 719 | list_add_tail(&cmd_node->list, &adapter->cmd_pending_q); |
|---|
| 717 | 720 | else |
|---|
| 718 | 721 | list_add(&cmd_node->list, &adapter->cmd_pending_q); |
|---|
| 719 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); |
|---|
| 722 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 720 | 723 | |
|---|
| 721 | 724 | atomic_inc(&adapter->cmd_pending); |
|---|
| 722 | 725 | mwifiex_dbg(adapter, CMD, |
|---|
| .. | .. |
|---|
| 741 | 744 | struct cmd_ctrl_node *cmd_node; |
|---|
| 742 | 745 | int ret = 0; |
|---|
| 743 | 746 | struct host_cmd_ds_command *host_cmd; |
|---|
| 744 | | - unsigned long cmd_flags; |
|---|
| 745 | | - unsigned long cmd_pending_q_flags; |
|---|
| 746 | 747 | |
|---|
| 747 | 748 | /* Check if already in processing */ |
|---|
| 748 | 749 | if (adapter->curr_cmd) { |
|---|
| .. | .. |
|---|
| 751 | 752 | return -1; |
|---|
| 752 | 753 | } |
|---|
| 753 | 754 | |
|---|
| 754 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 755 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 755 | 756 | /* Check if any command is pending */ |
|---|
| 756 | | - spin_lock_irqsave(&adapter->cmd_pending_q_lock, cmd_pending_q_flags); |
|---|
| 757 | + spin_lock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 757 | 758 | if (list_empty(&adapter->cmd_pending_q)) { |
|---|
| 758 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, |
|---|
| 759 | | - cmd_pending_q_flags); |
|---|
| 760 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 759 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 760 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 761 | 761 | return 0; |
|---|
| 762 | 762 | } |
|---|
| 763 | 763 | cmd_node = list_first_entry(&adapter->cmd_pending_q, |
|---|
| .. | .. |
|---|
| 770 | 770 | mwifiex_dbg(adapter, ERROR, |
|---|
| 771 | 771 | "%s: cannot send cmd in sleep state,\t" |
|---|
| 772 | 772 | "this should not happen\n", __func__); |
|---|
| 773 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, |
|---|
| 774 | | - cmd_pending_q_flags); |
|---|
| 775 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 773 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 774 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 776 | 775 | return ret; |
|---|
| 777 | 776 | } |
|---|
| 778 | 777 | |
|---|
| 779 | 778 | list_del(&cmd_node->list); |
|---|
| 780 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, |
|---|
| 781 | | - cmd_pending_q_flags); |
|---|
| 779 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 782 | 780 | |
|---|
| 783 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 781 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 784 | 782 | ret = mwifiex_dnld_cmd_to_fw(priv, cmd_node); |
|---|
| 785 | 783 | priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); |
|---|
| 786 | 784 | /* Any command sent to the firmware when host is in sleep |
|---|
| .. | .. |
|---|
| 814 | 812 | uint16_t orig_cmdresp_no; |
|---|
| 815 | 813 | uint16_t cmdresp_no; |
|---|
| 816 | 814 | uint16_t cmdresp_result; |
|---|
| 817 | | - unsigned long flags; |
|---|
| 818 | | - |
|---|
| 819 | | - /* Now we got response from FW, cancel the command timer */ |
|---|
| 820 | | - del_timer_sync(&adapter->cmd_timer); |
|---|
| 821 | 815 | |
|---|
| 822 | 816 | if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) { |
|---|
| 823 | 817 | resp = (struct host_cmd_ds_command *) adapter->upld_buf; |
|---|
| .. | .. |
|---|
| 827 | 821 | return -1; |
|---|
| 828 | 822 | } |
|---|
| 829 | 823 | |
|---|
| 824 | + resp = (struct host_cmd_ds_command *)adapter->curr_cmd->resp_skb->data; |
|---|
| 825 | + orig_cmdresp_no = le16_to_cpu(resp->command); |
|---|
| 826 | + cmdresp_no = (orig_cmdresp_no & HostCmd_CMD_ID_MASK); |
|---|
| 827 | + |
|---|
| 828 | + if (adapter->curr_cmd->cmd_no != cmdresp_no) { |
|---|
| 829 | + mwifiex_dbg(adapter, ERROR, |
|---|
| 830 | + "cmdresp error: cmd=0x%x cmd_resp=0x%x\n", |
|---|
| 831 | + adapter->curr_cmd->cmd_no, cmdresp_no); |
|---|
| 832 | + return -1; |
|---|
| 833 | + } |
|---|
| 834 | + /* Now we got response from FW, cancel the command timer */ |
|---|
| 835 | + del_timer_sync(&adapter->cmd_timer); |
|---|
| 830 | 836 | clear_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags); |
|---|
| 831 | 837 | |
|---|
| 832 | | - resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data; |
|---|
| 833 | 838 | if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { |
|---|
| 834 | 839 | /* Copy original response back to response buffer */ |
|---|
| 835 | 840 | struct mwifiex_ds_misc_cmd *hostcmd; |
|---|
| .. | .. |
|---|
| 843 | 848 | memcpy(hostcmd->cmd, resp, size); |
|---|
| 844 | 849 | } |
|---|
| 845 | 850 | } |
|---|
| 846 | | - orig_cmdresp_no = le16_to_cpu(resp->command); |
|---|
| 847 | 851 | |
|---|
| 848 | 852 | /* Get BSS number and corresponding priv */ |
|---|
| 849 | 853 | priv = mwifiex_get_priv_by_id(adapter, |
|---|
| .. | .. |
|---|
| 876 | 880 | adapter->cmd_wait_q.status = -1; |
|---|
| 877 | 881 | |
|---|
| 878 | 882 | mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); |
|---|
| 879 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 883 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 880 | 884 | adapter->curr_cmd = NULL; |
|---|
| 881 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 885 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 882 | 886 | return -1; |
|---|
| 883 | 887 | } |
|---|
| 884 | 888 | |
|---|
| .. | .. |
|---|
| 910 | 914 | |
|---|
| 911 | 915 | mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); |
|---|
| 912 | 916 | |
|---|
| 913 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 917 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 914 | 918 | adapter->curr_cmd = NULL; |
|---|
| 915 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); |
|---|
| 919 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 916 | 920 | } |
|---|
| 917 | 921 | |
|---|
| 918 | 922 | return ret; |
|---|
| .. | .. |
|---|
| 1018 | 1022 | mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter) |
|---|
| 1019 | 1023 | { |
|---|
| 1020 | 1024 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; |
|---|
| 1021 | | - unsigned long flags; |
|---|
| 1022 | 1025 | |
|---|
| 1023 | 1026 | /* Cancel all pending scan command */ |
|---|
| 1024 | | - spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); |
|---|
| 1027 | + spin_lock_bh(&adapter->scan_pending_q_lock); |
|---|
| 1025 | 1028 | list_for_each_entry_safe(cmd_node, tmp_node, |
|---|
| 1026 | 1029 | &adapter->scan_pending_q, list) { |
|---|
| 1027 | 1030 | list_del(&cmd_node->list); |
|---|
| 1028 | 1031 | cmd_node->wait_q_enabled = false; |
|---|
| 1029 | 1032 | mwifiex_insert_cmd_to_free_q(adapter, cmd_node); |
|---|
| 1030 | 1033 | } |
|---|
| 1031 | | - spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); |
|---|
| 1034 | + spin_unlock_bh(&adapter->scan_pending_q_lock); |
|---|
| 1032 | 1035 | } |
|---|
| 1033 | 1036 | |
|---|
| 1034 | 1037 | /* |
|---|
| .. | .. |
|---|
| 1042 | 1045 | mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter) |
|---|
| 1043 | 1046 | { |
|---|
| 1044 | 1047 | struct cmd_ctrl_node *cmd_node = NULL, *tmp_node; |
|---|
| 1045 | | - unsigned long flags, cmd_flags; |
|---|
| 1046 | 1048 | |
|---|
| 1047 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 1049 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 1048 | 1050 | /* Cancel current cmd */ |
|---|
| 1049 | 1051 | if ((adapter->curr_cmd) && (adapter->curr_cmd->wait_q_enabled)) { |
|---|
| 1050 | 1052 | adapter->cmd_wait_q.status = -1; |
|---|
| .. | .. |
|---|
| 1053 | 1055 | /* no recycle probably wait for response */ |
|---|
| 1054 | 1056 | } |
|---|
| 1055 | 1057 | /* Cancel all pending command */ |
|---|
| 1056 | | - spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); |
|---|
| 1058 | + spin_lock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 1057 | 1059 | list_for_each_entry_safe(cmd_node, tmp_node, |
|---|
| 1058 | 1060 | &adapter->cmd_pending_q, list) { |
|---|
| 1059 | 1061 | list_del(&cmd_node->list); |
|---|
| .. | .. |
|---|
| 1062 | 1064 | adapter->cmd_wait_q.status = -1; |
|---|
| 1063 | 1065 | mwifiex_recycle_cmd_node(adapter, cmd_node); |
|---|
| 1064 | 1066 | } |
|---|
| 1065 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); |
|---|
| 1066 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 1067 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 1068 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 1067 | 1069 | |
|---|
| 1068 | 1070 | mwifiex_cancel_scan(adapter); |
|---|
| 1069 | 1071 | } |
|---|
| .. | .. |
|---|
| 1082 | 1084 | mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter) |
|---|
| 1083 | 1085 | { |
|---|
| 1084 | 1086 | struct cmd_ctrl_node *cmd_node = NULL; |
|---|
| 1085 | | - unsigned long cmd_flags; |
|---|
| 1086 | 1087 | |
|---|
| 1087 | 1088 | if ((adapter->curr_cmd) && |
|---|
| 1088 | 1089 | (adapter->curr_cmd->wait_q_enabled)) { |
|---|
| 1089 | | - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 1090 | + spin_lock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 1090 | 1091 | cmd_node = adapter->curr_cmd; |
|---|
| 1091 | 1092 | /* setting curr_cmd to NULL is quite dangerous, because |
|---|
| 1092 | 1093 | * mwifiex_process_cmdresp checks curr_cmd to be != NULL |
|---|
| .. | .. |
|---|
| 1097 | 1098 | * at that point |
|---|
| 1098 | 1099 | */ |
|---|
| 1099 | 1100 | adapter->curr_cmd = NULL; |
|---|
| 1100 | | - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, cmd_flags); |
|---|
| 1101 | + spin_unlock_bh(&adapter->mwifiex_cmd_lock); |
|---|
| 1101 | 1102 | |
|---|
| 1102 | 1103 | mwifiex_recycle_cmd_node(adapter, cmd_node); |
|---|
| 1103 | 1104 | } |
|---|
| .. | .. |
|---|
| 1494 | 1495 | struct mwifiex_adapter *adapter = priv->adapter; |
|---|
| 1495 | 1496 | struct mwifiex_ie_types_header *tlv; |
|---|
| 1496 | 1497 | struct hw_spec_api_rev *api_rev; |
|---|
| 1498 | + struct hw_spec_max_conn *max_conn; |
|---|
| 1497 | 1499 | u16 resp_size, api_id; |
|---|
| 1498 | 1500 | int i, left_len, parsed_len = 0; |
|---|
| 1499 | 1501 | |
|---|
| .. | .. |
|---|
| 1580 | 1582 | adapter->fw_api_ver = |
|---|
| 1581 | 1583 | api_rev->major_ver; |
|---|
| 1582 | 1584 | mwifiex_dbg(adapter, INFO, |
|---|
| 1583 | | - "Firmware api version %d\n", |
|---|
| 1584 | | - adapter->fw_api_ver); |
|---|
| 1585 | + "Firmware api version %d.%d\n", |
|---|
| 1586 | + adapter->fw_api_ver, |
|---|
| 1587 | + api_rev->minor_ver); |
|---|
| 1588 | + break; |
|---|
| 1589 | + case UAP_FW_API_VER_ID: |
|---|
| 1590 | + mwifiex_dbg(adapter, INFO, |
|---|
| 1591 | + "uAP api version %d.%d\n", |
|---|
| 1592 | + api_rev->major_ver, |
|---|
| 1593 | + api_rev->minor_ver); |
|---|
| 1594 | + break; |
|---|
| 1595 | + case CHANRPT_API_VER_ID: |
|---|
| 1596 | + mwifiex_dbg(adapter, INFO, |
|---|
| 1597 | + "channel report api version %d.%d\n", |
|---|
| 1598 | + api_rev->major_ver, |
|---|
| 1599 | + api_rev->minor_ver); |
|---|
| 1585 | 1600 | break; |
|---|
| 1586 | 1601 | default: |
|---|
| 1587 | 1602 | mwifiex_dbg(adapter, FATAL, |
|---|
| .. | .. |
|---|
| 1590 | 1605 | break; |
|---|
| 1591 | 1606 | } |
|---|
| 1592 | 1607 | break; |
|---|
| 1608 | + case TLV_TYPE_MAX_CONN: |
|---|
| 1609 | + max_conn = (struct hw_spec_max_conn *)tlv; |
|---|
| 1610 | + adapter->max_p2p_conn = max_conn->max_p2p_conn; |
|---|
| 1611 | + adapter->max_sta_conn = max_conn->max_sta_conn; |
|---|
| 1612 | + mwifiex_dbg(adapter, INFO, |
|---|
| 1613 | + "max p2p connections: %u\n", |
|---|
| 1614 | + adapter->max_p2p_conn); |
|---|
| 1615 | + mwifiex_dbg(adapter, INFO, |
|---|
| 1616 | + "max sta connections: %u\n", |
|---|
| 1617 | + adapter->max_sta_conn); |
|---|
| 1618 | + break; |
|---|
| 1593 | 1619 | default: |
|---|
| 1594 | 1620 | mwifiex_dbg(adapter, FATAL, |
|---|
| 1595 | 1621 | "Unknown GET_HW_SPEC TLV type: %#x\n", |
|---|