Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: mwlwifi-10.3.0.16-20160105/dev.h
- ===================================================================
- --- mwlwifi-10.3.0.16-20160105.orig/dev.h
- +++ mwlwifi-10.3.0.16-20160105/dev.h
- @@ -18,6 +18,7 @@
- #ifndef _DEV_H_
- #define _DEV_H_
- +
- #include <linux/version.h>
- #include <linux/interrupt.h>
- #include <linux/pci.h>
- @@ -301,7 +302,7 @@ struct mwl_priv {
- void __iomem *iobase1; /* MEM Base Address Register 1 */
- u32 next_bar_num;
- - struct mutex fwcmd_mutex; /* for firmware command */
- + spinlock_t fwcmd_lock; /* for firmware command */
- unsigned short *pcmd_buf; /* pointer to CmdBuf (virtual) */
- dma_addr_t pphys_cmd_buf; /* pointer to CmdBuf (physical) */
- bool in_send_cmd;
- Index: mwlwifi-10.3.0.16-20160105/fwcmd.c
- ===================================================================
- --- mwlwifi-10.3.0.16-20160105.orig/fwcmd.c
- +++ mwlwifi-10.3.0.16-20160105/fwcmd.c
- @@ -152,8 +152,6 @@ static int mwl_fwcmd_exec_cmd(struct mwl
- {
- bool busy = false;
- - might_sleep();
- -
- if (!mwl_fwcmd_chk_adapter(priv)) {
- wiphy_err(priv->hw->wiphy, "adapter does not exist\n");
- priv->in_send_cmd = false;
- @@ -190,7 +188,7 @@ static int mwl_fwcmd_802_11_radio_contro
- pcmd = (struct hostcmd_cmd_802_11_radio_control *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11_RADIO_CONTROL);
- @@ -201,14 +199,14 @@ static int mwl_fwcmd_802_11_radio_contro
- pcmd->radio_on = cpu_to_le16(enable ? WL_ENABLE : WL_DISABLE);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11_RADIO_CONTROL)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- priv->radio_on = enable;
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -221,7 +219,7 @@ static int mwl_fwcmd_get_tx_powers(struc
- pcmd = (struct hostcmd_cmd_802_11_tx_power *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11_TX_POWER);
- @@ -233,7 +231,7 @@ static int mwl_fwcmd_get_tx_powers(struc
- pcmd->sub_ch = cpu_to_le16(sub_ch);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11_TX_POWER)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -241,7 +239,7 @@ static int mwl_fwcmd_get_tx_powers(struc
- for (i = 0; i < SYSADPT_TX_POWER_LEVEL_TOTAL; i++)
- powlist[i] = le16_to_cpu(pcmd->power_level_list[i]);
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -255,7 +253,7 @@ static int mwl_fwcmd_set_tx_powers(struc
- pcmd = (struct hostcmd_cmd_802_11_tx_power *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11_TX_POWER);
- @@ -270,12 +268,12 @@ static int mwl_fwcmd_set_tx_powers(struc
- pcmd->power_level_list[i] = cpu_to_le16(txpow[i]);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11_TX_POWER)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -542,7 +540,7 @@ static int mwl_fwcmd_set_ies(struct mwl_
- pcmd = (struct hostcmd_cmd_set_ies *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_IES);
- @@ -578,12 +576,12 @@ static int mwl_fwcmd_set_ies(struct mwl_
- pcmd->ie_list_len_proprietary = cpu_to_le16(ie_list_len_proprietary);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_IES)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- @@ -618,7 +616,7 @@ static int mwl_fwcmd_set_ap_beacon(struc
- pcmd = (struct hostcmd_cmd_ap_beacon *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_AP_BEACON);
- @@ -655,12 +653,12 @@ static int mwl_fwcmd_set_ap_beacon(struc
- SYSADPT_MAX_DATA_RATES_G);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_AP_BEACON)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- @@ -677,7 +675,7 @@ static int mwl_fwcmd_set_spectrum_mgmt(s
- pcmd = (struct hostcmd_cmd_set_spectrum_mgmt *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_SPECTRUM_MGMT);
- @@ -685,12 +683,12 @@ static int mwl_fwcmd_set_spectrum_mgmt(s
- pcmd->spectrum_mgmt = cpu_to_le32(enable);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_SPECTRUM_MGMT)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -702,7 +700,7 @@ static int mwl_fwcmd_set_power_constrain
- pcmd = (struct hostcmd_cmd_set_power_constraint *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_POWER_CONSTRAINT);
- @@ -710,12 +708,12 @@ static int mwl_fwcmd_set_power_constrain
- pcmd->power_constraint = cpu_to_le32(power_constraint);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_POWER_CONSTRAINT)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -752,7 +750,7 @@ static int mwl_fwcmd_set_country_code(st
- pcmd = (struct hostcmd_cmd_set_country_code *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_COUNTRY_CODE);
- @@ -775,12 +773,12 @@ static int mwl_fwcmd_set_country_code(st
- }
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_COUNTRY_CODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -873,7 +871,7 @@ int mwl_fwcmd_get_hw_specs(struct ieee80
- pcmd = (struct hostcmd_cmd_get_hw_spec *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- wiphy_debug(hw->wiphy, "pcmd = %p\n", pcmd);
- memset(pcmd, 0x00, sizeof(*pcmd));
- @@ -886,11 +884,11 @@ int mwl_fwcmd_get_hw_specs(struct ieee80
- while (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_GET_HW_SPEC)) {
- if (retry++ > MAX_WAIT_GET_HW_SPECS_ITERATONS) {
- wiphy_err(hw->wiphy, "can't get hw specs\n");
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return -EIO;
- }
- - msleep(1000);
- + mdelay(1000);
- wiphy_debug(hw->wiphy,
- "repeat command = %p\n", pcmd);
- }
- @@ -913,7 +911,7 @@ int mwl_fwcmd_get_hw_specs(struct ieee80
- priv->hw_data.hw_version = pcmd->version;
- priv->hw_data.host_interface = pcmd->host_if;
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -929,7 +927,7 @@ int mwl_fwcmd_set_hw_specs(struct ieee80
- pcmd = (struct hostcmd_cmd_set_hw_spec *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_HW_SPEC);
- @@ -945,12 +943,12 @@ int mwl_fwcmd_set_hw_specs(struct ieee80
- pcmd->features = 0;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_HW_SPEC)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -963,14 +961,14 @@ int mwl_fwcmd_get_stat(struct ieee80211_
- pcmd = (struct hostcmd_cmd_802_11_get_stat *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11_GET_STAT);
- pcmd->cmd_hdr.len = cpu_to_le16(sizeof(*pcmd));
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11_GET_STAT)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -984,7 +982,7 @@ int mwl_fwcmd_get_stat(struct ieee80211_
- stats->dot11RTSSuccessCount =
- le32_to_cpu(pcmd->rts_successes);
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1022,7 +1020,7 @@ int mwl_fwcmd_get_addr_value(struct ieee
- pcmd = (struct hostcmd_cmd_mem_addr_access *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_MEM_ADDR_ACCESS);
- @@ -1033,7 +1031,7 @@ int mwl_fwcmd_get_addr_value(struct ieee
- pcmd->reserved = cpu_to_le16(set);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_MEM_ADDR_ACCESS)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -1041,7 +1039,7 @@ int mwl_fwcmd_get_addr_value(struct ieee
- for (i = 0; i < len; i++)
- val[i] = le32_to_cpu(pcmd->value[i]);
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1272,7 +1270,7 @@ int mwl_fwcmd_rf_antenna(struct ieee8021
- pcmd = (struct hostcmd_cmd_802_11_rf_antenna *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11_RF_ANTENNA);
- @@ -1297,12 +1295,12 @@ int mwl_fwcmd_rf_antenna(struct ieee8021
- }
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11_RF_ANTENNA)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1318,7 +1316,7 @@ int mwl_fwcmd_broadcast_ssid_enable(stru
- pcmd = (struct hostcmd_cmd_broadcast_ssid_enable *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_BROADCAST_SSID_ENABLE);
- @@ -1327,12 +1325,12 @@ int mwl_fwcmd_broadcast_ssid_enable(stru
- pcmd->enable = cpu_to_le32(enable);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_BROADCAST_SSID_ENABLE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1347,7 +1345,7 @@ int mwl_fwcmd_set_rf_channel(struct ieee
- pcmd = (struct hostcmd_cmd_set_rf_channel *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_RF_CHANNEL);
- @@ -1360,7 +1358,7 @@ int mwl_fwcmd_set_rf_channel(struct ieee
- } else if (channel->band == IEEE80211_BAND_5GHZ) {
- freq_band = FREQ_BAND_5GHZ;
- } else {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return -EINVAL;
- }
- @@ -1383,7 +1381,7 @@ int mwl_fwcmd_set_rf_channel(struct ieee
- mwl_fwcmd_get_80m_pri_chnl(pcmd->curr_chnl);
- break;
- default:
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return -EINVAL;
- }
- @@ -1394,12 +1392,12 @@ int mwl_fwcmd_set_rf_channel(struct ieee
- pcmd->chnl_flags = cpu_to_le32(chnl_flags);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_RF_CHANNEL)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1415,7 +1413,7 @@ int mwl_fwcmd_set_aid(struct ieee80211_h
- pcmd = (struct hostcmd_cmd_set_aid *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_AID);
- @@ -1425,12 +1423,12 @@ int mwl_fwcmd_set_aid(struct ieee80211_h
- ether_addr_copy(pcmd->mac_addr, bssid);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_AID)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1446,7 +1444,7 @@ int mwl_fwcmd_set_infra_mode(struct ieee
- pcmd = (struct hostcmd_cmd_set_infra_mode *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_INFRA_MODE);
- @@ -1454,12 +1452,12 @@ int mwl_fwcmd_set_infra_mode(struct ieee
- pcmd->cmd_hdr.macid = mwl_vif->macid;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_INFRA_MODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1471,7 +1469,7 @@ int mwl_fwcmd_set_rts_threshold(struct i
- pcmd = (struct hostcmd_cmd_802_11_rts_thsd *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11_RTS_THSD);
- @@ -1480,12 +1478,12 @@ int mwl_fwcmd_set_rts_threshold(struct i
- pcmd->threshold = cpu_to_le16(threshold);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11_RTS_THSD)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1498,7 +1496,7 @@ int mwl_fwcmd_set_edca_params(struct iee
- pcmd = (struct hostcmd_cmd_set_edca_params *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_EDCA_PARAMS);
- @@ -1521,12 +1519,12 @@ int mwl_fwcmd_set_edca_params(struct iee
- pcmd->txq_num = 0;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_EDCA_PARAMS)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1551,7 +1549,7 @@ int mwl_fwcmd_set_radar_detect(struct ie
- radar_type = RADAR_TYPE_CODE_ETSI;
- }
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_802_11H_DETECT_RADAR);
- @@ -1565,12 +1563,12 @@ int mwl_fwcmd_set_radar_detect(struct ie
- pcmd->pri_min_num = cpu_to_le16(priv->dfs_min_pri_count);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_802_11H_DETECT_RADAR)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1582,7 +1580,7 @@ int mwl_fwcmd_set_wmm_mode(struct ieee80
- pcmd = (struct hostcmd_cmd_set_wmm_mode *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_WMM_MODE);
- @@ -1590,12 +1588,12 @@ int mwl_fwcmd_set_wmm_mode(struct ieee80
- pcmd->action = cpu_to_le16(enable ? WL_ENABLE : WL_DISABLE);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_WMM_MODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1607,7 +1605,7 @@ int mwl_fwcmd_ht_guard_interval(struct i
- pcmd = (struct hostcmd_cmd_ht_guard_interval *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_HT_GUARD_INTERVAL);
- @@ -1616,12 +1614,12 @@ int mwl_fwcmd_ht_guard_interval(struct i
- pcmd->gi_type = cpu_to_le32(gi_type);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_HT_GUARD_INTERVAL)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1633,7 +1631,7 @@ int mwl_fwcmd_use_fixed_rate(struct ieee
- pcmd = (struct hostcmd_cmd_set_fixed_rate *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_FIXED_RATE);
- @@ -1644,12 +1642,12 @@ int mwl_fwcmd_use_fixed_rate(struct ieee
- pcmd->management_rate = mgmt;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_FIXED_RATE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1661,7 +1659,7 @@ int mwl_fwcmd_set_linkadapt_cs_mode(stru
- pcmd = (struct hostcmd_cmd_set_linkadapt_cs_mode *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_LINKADAPT_CS_MODE);
- @@ -1670,12 +1668,12 @@ int mwl_fwcmd_set_linkadapt_cs_mode(stru
- pcmd->cs_mode = cpu_to_le16(cs_mode);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_LINKADAPT_CS_MODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1687,7 +1685,7 @@ int mwl_fwcmd_set_rate_adapt_mode(struct
- pcmd = (struct hostcmd_cmd_set_rate_adapt_mode *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_RATE_ADAPT_MODE);
- @@ -1696,12 +1694,12 @@ int mwl_fwcmd_set_rate_adapt_mode(struct
- pcmd->rate_adapt_mode = cpu_to_le16(mode);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_RATE_ADAPT_MODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1717,7 +1715,7 @@ int mwl_fwcmd_set_mac_addr_client(struct
- pcmd = (struct hostcmd_cmd_set_mac_addr *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_MAC_ADDR);
- @@ -1727,12 +1725,12 @@ int mwl_fwcmd_set_mac_addr_client(struct
- ether_addr_copy(pcmd->mac_addr, mac_addr);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_MAC_ADDR)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1744,21 +1742,21 @@ int mwl_fwcmd_get_watchdog_bitmap(struct
- pcmd = (struct hostcmd_cmd_get_watchdog_bitmap *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_GET_WATCHDOG_BITMAP);
- pcmd->cmd_hdr.len = cpu_to_le16(sizeof(*pcmd));
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_GET_WATCHDOG_BITMAP)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- *bitmap = pcmd->watchdog_bitmap;
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1774,7 +1772,7 @@ int mwl_fwcmd_remove_mac_addr(struct iee
- pcmd = (struct hostcmd_cmd_set_mac_addr *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_DEL_MAC_ADDR);
- @@ -1783,12 +1781,12 @@ int mwl_fwcmd_remove_mac_addr(struct iee
- ether_addr_copy(pcmd->mac_addr, mac_addr);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_DEL_MAC_ADDR)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1810,7 +1808,7 @@ int mwl_fwcmd_bss_start(struct ieee80211
- pcmd = (struct hostcmd_cmd_bss_start *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_BSS_START);
- @@ -1827,7 +1825,7 @@ int mwl_fwcmd_bss_start(struct ieee80211
- }
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_BSS_START)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -1837,7 +1835,7 @@ int mwl_fwcmd_bss_start(struct ieee80211
- else
- priv->running_bsses &= ~(1 << mwl_vif->macid);
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1907,7 +1905,7 @@ int mwl_fwcmd_set_new_stn_add(struct iee
- pcmd = (struct hostcmd_cmd_set_new_stn *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_NEW_STN);
- @@ -1968,7 +1966,7 @@ int mwl_fwcmd_set_new_stn_add(struct iee
- pcmd->qos_info = ((sta->uapsd_queues << 4) | (sta->max_sp << 1));
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_NEW_STN)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -1977,13 +1975,13 @@ int mwl_fwcmd_set_new_stn_add(struct iee
- ether_addr_copy(pcmd->mac_addr, mwl_vif->sta_mac);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_NEW_STN)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -1999,7 +1997,7 @@ int mwl_fwcmd_set_new_stn_add_self(struc
- pcmd = (struct hostcmd_cmd_set_new_stn *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_NEW_STN);
- @@ -2010,12 +2008,12 @@ int mwl_fwcmd_set_new_stn_add_self(struc
- ether_addr_copy(pcmd->mac_addr, vif->addr);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_NEW_STN)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2031,7 +2029,7 @@ int mwl_fwcmd_set_new_stn_del(struct iee
- pcmd = (struct hostcmd_cmd_set_new_stn *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_NEW_STN);
- @@ -2042,7 +2040,7 @@ int mwl_fwcmd_set_new_stn_del(struct iee
- ether_addr_copy(pcmd->mac_addr, addr);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_NEW_STN)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -2051,13 +2049,13 @@ int mwl_fwcmd_set_new_stn_del(struct iee
- ether_addr_copy(pcmd->mac_addr, mwl_vif->sta_mac);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_NEW_STN)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2069,7 +2067,7 @@ int mwl_fwcmd_set_apmode(struct ieee8021
- pcmd = (struct hostcmd_cmd_set_apmode *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_APMODE);
- @@ -2077,12 +2075,12 @@ int mwl_fwcmd_set_apmode(struct ieee8021
- pcmd->apmode = apmode;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_APMODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2142,7 +2140,7 @@ int mwl_fwcmd_set_switch_channel(struct
- pcmd = (struct hostcmd_cmd_set_switch_channel *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_SWITCH_CHANNEL);
- @@ -2154,14 +2152,14 @@ int mwl_fwcmd_set_switch_channel(struct
- pcmd->next_ht_extchnl_offset = cpu_to_le32(sec_chnl_offset);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_SWITCH_CHANNEL)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution\n");
- return -EIO;
- }
- priv->csa_active = true;
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2178,7 +2176,7 @@ int mwl_fwcmd_update_encryption_enable(s
- pcmd = (struct hostcmd_cmd_update_encryption *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_UPDATE_ENCRYPTION);
- @@ -2190,7 +2188,7 @@ int mwl_fwcmd_update_encryption_enable(s
- pcmd->action_data[0] = encr_type;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_UPDATE_ENCRYPTION)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -2202,13 +2200,13 @@ int mwl_fwcmd_update_encryption_enable(s
- ether_addr_copy(pcmd->mac_addr, mwl_vif->bssid);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_UPDATE_ENCRYPTION)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2229,7 +2227,7 @@ int mwl_fwcmd_encryption_set_key(struct
- pcmd = (struct hostcmd_cmd_set_key *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_UPDATE_ENCRYPTION);
- @@ -2238,7 +2236,7 @@ int mwl_fwcmd_encryption_set_key(struct
- rc = mwl_fwcmd_encryption_set_cmd_info(pcmd, addr, key);
- if (rc) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- if (rc != 1)
- wiphy_err(hw->wiphy, "encryption not support\n");
- return rc;
- @@ -2275,7 +2273,7 @@ int mwl_fwcmd_encryption_set_key(struct
- keymlen = key->keylen;
- break;
- default:
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "encryption not support\n");
- return -ENOTSUPP;
- }
- @@ -2284,7 +2282,7 @@ int mwl_fwcmd_encryption_set_key(struct
- pcmd->action_type = cpu_to_le32(action);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_UPDATE_ENCRYPTION)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- @@ -2298,13 +2296,13 @@ int mwl_fwcmd_encryption_set_key(struct
- mwl_vif->bssid);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_UPDATE_ENCRYPTION)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2322,7 +2320,7 @@ int mwl_fwcmd_encryption_remove_key(stru
- pcmd = (struct hostcmd_cmd_set_key *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_UPDATE_ENCRYPTION);
- @@ -2331,7 +2329,7 @@ int mwl_fwcmd_encryption_remove_key(stru
- rc = mwl_fwcmd_encryption_set_cmd_info(pcmd, addr, key);
- if (rc) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- if (rc != 1)
- wiphy_err(hw->wiphy, "encryption not support\n");
- return rc;
- @@ -2344,12 +2342,12 @@ int mwl_fwcmd_encryption_remove_key(stru
- mwl_vif->wep_key_conf[key->keyidx].enabled = 0;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_UPDATE_ENCRYPTION)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2367,7 +2365,7 @@ int mwl_fwcmd_check_ba(struct ieee80211_
- pcmd = (struct hostcmd_cmd_bastream *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_BASTREAM);
- @@ -2387,19 +2385,12 @@ int mwl_fwcmd_check_ba(struct ieee80211_
- pcmd->ba_info.create_params.queue_id = stream->idx;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_BASTREAM)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "check ba failed execution\n");
- return -EIO;
- }
- - if (pcmd->cmd_hdr.result != 0) {
- - mutex_unlock(&priv->fwcmd_mutex);
- - wiphy_err(hw->wiphy, "check ba result error %d\n",
- - le16_to_cpu(pcmd->cmd_hdr.result));
- - return -EINVAL;
- - }
- -
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2417,7 +2408,7 @@ int mwl_fwcmd_create_ba(struct ieee80211
- pcmd = (struct hostcmd_cmd_bastream *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_BASTREAM);
- @@ -2446,19 +2437,12 @@ int mwl_fwcmd_create_ba(struct ieee80211
- pcmd->ba_info.create_params.current_seq = cpu_to_le16(0);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_BASTREAM)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "create ba failed execution\n");
- return -EIO;
- }
- - if (pcmd->cmd_hdr.result != 0) {
- - mutex_unlock(&priv->fwcmd_mutex);
- - wiphy_err(hw->wiphy, "create ba result error %d\n",
- - le16_to_cpu(pcmd->cmd_hdr.result));
- - return -EINVAL;
- - }
- -
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2472,7 +2456,7 @@ int mwl_fwcmd_destroy_ba(struct ieee8021
- pcmd = (struct hostcmd_cmd_bastream *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_BASTREAM);
- @@ -2487,12 +2471,12 @@ int mwl_fwcmd_destroy_ba(struct ieee8021
- pcmd->ba_info.destroy_params.fw_ba_context.context = cpu_to_le32(idx);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_BASTREAM)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "destroy ba failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2598,7 +2582,7 @@ int mwl_fwcmd_set_optimization_level(str
- pcmd = (struct hostcmd_cmd_set_optimization_level *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_OPTIMIZATION_LEVEL);
- @@ -2606,12 +2590,12 @@ int mwl_fwcmd_set_optimization_level(str
- pcmd->opt_level = opt_level;
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_OPTIMIZATION_LEVEL)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2623,7 +2607,7 @@ int mwl_fwcmd_set_dwds_stamode(struct ie
- pcmd = (struct hostcmd_cmd_dwds_enable *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_DWDS_ENABLE);
- @@ -2631,12 +2615,12 @@ int mwl_fwcmd_set_dwds_stamode(struct ie
- pcmd->enable = cpu_to_le32(enable);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_DWDS_ENABLE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2648,7 +2632,7 @@ int mwl_fwcmd_set_fw_flush_timer(struct
- pcmd = (struct hostcmd_cmd_fw_flush_timer *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_FW_FLUSH_TIMER);
- @@ -2656,12 +2640,12 @@ int mwl_fwcmd_set_fw_flush_timer(struct
- pcmd->value = cpu_to_le32(value);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_FW_FLUSH_TIMER)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2673,7 +2657,7 @@ int mwl_fwcmd_set_cdd(struct ieee80211_h
- pcmd = (struct hostcmd_cmd_set_cdd *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_CDD);
- @@ -2681,12 +2665,12 @@ int mwl_fwcmd_set_cdd(struct ieee80211_h
- pcmd->enable = cpu_to_le32(priv->cdd);
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_CDD)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2698,21 +2682,21 @@ int mwl_fwcmd_get_temp(struct ieee80211_
- pcmd = (struct hostcmd_cmd_get_temp *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_GET_TEMP);
- pcmd->cmd_hdr.len = cpu_to_le16(sizeof(*pcmd));
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_GET_TEMP)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- *temp = le32_to_cpu(pcmd->celcius);
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2725,7 +2709,7 @@ int mwl_fwcmd_quiet_mode(struct ieee8021
- pcmd = (struct hostcmd_cmd_quiet_mode *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- memset(pcmd, 0x00, sizeof(*pcmd));
- pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_QUIET_MODE);
- @@ -2739,12 +2723,12 @@ int mwl_fwcmd_quiet_mode(struct ieee8021
- }
- if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_QUIET_MODE)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(hw->wiphy, "failed execution\n");
- return -EIO;
- }
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- @@ -2758,21 +2742,21 @@ int mwl_fwcmd_send_mfg_cmd(struct mwl_pr
- pcmd = (struct hostcmd_header *)&priv->pcmd_buf[0];
- - mutex_lock(&priv->fwcmd_mutex);
- + spin_lock_bh(&priv->fwcmd_lock);
- len = le16_to_cpu(cmd_hd->len);
- memset(pcmd, 0x00, len + 4);
- memcpy((char *)pcmd, mfgcmd, len + 4);
- cmd = le16_to_cpu(cmd_hd->command);
- if (mwl_fwcmd_exec_cmd(priv, cmd)) {
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- wiphy_err(priv->hw->wiphy, "failed execution");
- return -EIO;
- }
- cmd_hd = (struct cmd_header *)&priv->pcmd_buf[2];
- len = le16_to_cpu(cmd_hd->len);
- memcpy(mfgcmd, (char *)&priv->pcmd_buf[2], len);
- - mutex_unlock(&priv->fwcmd_mutex);
- + spin_unlock_bh(&priv->fwcmd_lock);
- return 0;
- }
- Index: mwlwifi-10.3.0.16-20160105/fwdl.c
- ===================================================================
- --- mwlwifi-10.3.0.16-20160105.orig/fwdl.c
- +++ mwlwifi-10.3.0.16-20160105/fwdl.c
- @@ -22,7 +22,7 @@
- #include "sysadpt.h"
- #include "dev.h"
- #include "fwcmd.h"
- -#ifdef SUPPORT_MFG
- +#ifdef CONFIG_SUPPORT_MFG
- #include "mfg.h"
- #endif
- #include "fwdl.h"
- @@ -60,7 +60,7 @@ int mwl_fwdl_download_firmware(struct ie
- u32 size_fw_downloaded = 0;
- u32 int_code = 0;
- u32 len = 0;
- -#ifdef SUPPORT_MFG
- +#ifdef CONFIG_SUPPORT_MFG
- u32 fwreadysignature = priv->mfg_mode ?
- MFG_FW_READY_SIGNATURE : HOSTCMD_SOFTAP_FWRDY_SIGNATURE;
- #else
- Index: mwlwifi-10.3.0.16-20160105/main.c
- ===================================================================
- --- mwlwifi-10.3.0.16-20160105.orig/main.c
- +++ mwlwifi-10.3.0.16-20160105/main.c
- @@ -27,7 +27,7 @@
- #include "tx.h"
- #include "rx.h"
- #include "isr.h"
- -#ifdef SUPPORT_MFG
- +#ifdef CONFIG_SUPPORT_MFG
- #include "mfg.h"
- #endif
- #ifdef CONFIG_DEBUG_FS
- @@ -210,7 +210,8 @@ static int mwl_init_firmware(struct mwl_
- {
- int rc = 0;
- -#ifdef SUPPORT_MFG
- +
- +#ifdef CONFIG_SUPPORT_MFG
- if (priv->mfg_mode)
- rc = mwl_mfg_request_firmware(priv);
- else
- @@ -243,7 +244,7 @@ static int mwl_init_firmware(struct mwl_
- err_download_fw:
- -#ifdef SUPPORT_MFG
- +#ifdef CONFIG_SUPPORT_MFG
- if (priv->mfg_mode)
- mwl_mfg_release_firmware(priv);
- else
- @@ -580,8 +581,8 @@ static int mwl_wl_init(struct mwl_priv *
- priv->qe_trigger_num = 0;
- priv->qe_trigger_time = jiffies;
- - mutex_init(&priv->fwcmd_mutex);
- spin_lock_init(&priv->tx_desc_lock);
- + spin_lock_init(&priv->fwcmd_lock);
- spin_lock_init(&priv->vif_lock);
- spin_lock_init(&priv->sta_lock);
- spin_lock_init(&priv->stream_lock);
- @@ -767,7 +768,7 @@ static int mwl_probe(struct pci_dev *pde
- fw_name = mwl_chip_tbl[priv->chip_type].fw_image;
- -#ifdef SUPPORT_MFG
- +#ifdef CONFIG_SUPPORT_MFG
- if (mfg_mode)
- mwl_mfg_handler_init(priv);
- #endif
- @@ -781,7 +782,7 @@ static int mwl_probe(struct pci_dev *pde
- }
- /* firmware is loaded to H/W, it can be released now */
- -#ifdef SUPPORT_MFG
- +#ifdef CONFIG_SUPPORT_MFG
- if (priv->mfg_mode)
- mwl_mfg_release_firmware(priv);
- else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement