mwifiex: fix checkpatch --strict warnings/errors Part 2
For files cfg80211.c, cfp.c, and cmdevt.c Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
842668417c
commit
aea0701e22
3 changed files with 133 additions and 127 deletions
|
@ -127,8 +127,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
|
||||||
|
|
||||||
if (timeout)
|
if (timeout)
|
||||||
wiphy_dbg(wiphy,
|
wiphy_dbg(wiphy,
|
||||||
"info: ignoring the timeout value"
|
"info: ignore timeout value for IEEE Power Save\n");
|
||||||
" for IEEE power save\n");
|
|
||||||
|
|
||||||
ps_mode = enabled;
|
ps_mode = enabled;
|
||||||
|
|
||||||
|
@ -168,7 +167,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
|
||||||
struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
|
struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
|
||||||
|
|
||||||
if (mwifiex_set_encode(priv, params->key, params->key_len,
|
if (mwifiex_set_encode(priv, params->key, params->key_len,
|
||||||
key_index, 0)) {
|
key_index, 0)) {
|
||||||
wiphy_err(wiphy, "crypto keys added\n");
|
wiphy_err(wiphy, "crypto keys added\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
@ -225,7 +224,7 @@ static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch->hw_value == next_chan + 1 &&
|
if (ch->hw_value == next_chan + 1 &&
|
||||||
ch->max_power == max_pwr) {
|
ch->max_power == max_pwr) {
|
||||||
next_chan++;
|
next_chan++;
|
||||||
no_of_parsed_chan++;
|
no_of_parsed_chan++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -252,7 +251,7 @@ static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
|
||||||
domain_info->no_of_triplet = no_of_triplet;
|
domain_info->no_of_triplet = no_of_triplet;
|
||||||
|
|
||||||
if (mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11D_DOMAIN_INFO,
|
if (mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11D_DOMAIN_INFO,
|
||||||
HostCmd_ACT_GEN_SET, 0, NULL)) {
|
HostCmd_ACT_GEN_SET, 0, NULL)) {
|
||||||
wiphy_err(wiphy, "11D: setting domain info in FW\n");
|
wiphy_err(wiphy, "11D: setting domain info in FW\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -271,7 +270,7 @@ static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
|
||||||
* - Set bt Country IE
|
* - Set bt Country IE
|
||||||
*/
|
*/
|
||||||
static int mwifiex_reg_notifier(struct wiphy *wiphy,
|
static int mwifiex_reg_notifier(struct wiphy *wiphy,
|
||||||
struct regulatory_request *request)
|
struct regulatory_request *request)
|
||||||
{
|
{
|
||||||
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
|
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
|
||||||
|
|
||||||
|
@ -316,7 +315,7 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
|
||||||
if (chan->band == IEEE80211_BAND_2GHZ) {
|
if (chan->band == IEEE80211_BAND_2GHZ) {
|
||||||
if (channel_type == NL80211_CHAN_NO_HT)
|
if (channel_type == NL80211_CHAN_NO_HT)
|
||||||
if (priv->adapter->config_bands == BAND_B ||
|
if (priv->adapter->config_bands == BAND_B ||
|
||||||
priv->adapter->config_bands == BAND_G)
|
priv->adapter->config_bands == BAND_G)
|
||||||
config_bands =
|
config_bands =
|
||||||
priv->adapter->config_bands;
|
priv->adapter->config_bands;
|
||||||
else
|
else
|
||||||
|
@ -336,7 +335,7 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
|
||||||
if (priv->bss_mode == NL80211_IFTYPE_ADHOC) {
|
if (priv->bss_mode == NL80211_IFTYPE_ADHOC) {
|
||||||
adapter->adhoc_start_band = config_bands;
|
adapter->adhoc_start_band = config_bands;
|
||||||
if ((config_bands & BAND_GN) ||
|
if ((config_bands & BAND_GN) ||
|
||||||
(config_bands & BAND_AN))
|
(config_bands & BAND_AN))
|
||||||
adapter->adhoc_11n_enabled = true;
|
adapter->adhoc_11n_enabled = true;
|
||||||
else
|
else
|
||||||
adapter->adhoc_11n_enabled = false;
|
adapter->adhoc_11n_enabled = false;
|
||||||
|
@ -350,9 +349,8 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
|
||||||
mwifiex_send_domain_info_cmd_fw(wiphy);
|
mwifiex_send_domain_info_cmd_fw(wiphy);
|
||||||
}
|
}
|
||||||
|
|
||||||
wiphy_dbg(wiphy, "info: setting band %d, channel offset %d and "
|
wiphy_dbg(wiphy, "info: setting band %d, chan offset %d, mode %d\n",
|
||||||
"mode %d\n", config_bands, adapter->sec_chan_offset,
|
config_bands, adapter->sec_chan_offset, priv->bss_mode);
|
||||||
priv->bss_mode);
|
|
||||||
if (!chan)
|
if (!chan)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -403,8 +401,8 @@ mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (frag_thr < MWIFIEX_FRAG_MIN_VALUE
|
if (frag_thr < MWIFIEX_FRAG_MIN_VALUE ||
|
||||||
|| frag_thr > MWIFIEX_FRAG_MAX_VALUE)
|
frag_thr > MWIFIEX_FRAG_MAX_VALUE)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Send request to firmware */
|
/* Send request to firmware */
|
||||||
|
@ -746,8 +744,7 @@ static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
|
||||||
adapter->channel_type = NL80211_CHAN_NO_HT;
|
adapter->channel_type = NL80211_CHAN_NO_HT;
|
||||||
|
|
||||||
wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n",
|
wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n",
|
||||||
(mode & BAND_B) ? "b" : "",
|
(mode & BAND_B) ? "b" : "", (mode & BAND_G) ? "g" : "");
|
||||||
(mode & BAND_G) ? "g" : "");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -802,8 +799,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
|
||||||
ie_buf[1] = bss_info.ssid.ssid_len;
|
ie_buf[1] = bss_info.ssid.ssid_len;
|
||||||
|
|
||||||
memcpy(&ie_buf[sizeof(struct ieee_types_header)],
|
memcpy(&ie_buf[sizeof(struct ieee_types_header)],
|
||||||
&bss_info.ssid.ssid,
|
&bss_info.ssid.ssid, bss_info.ssid.ssid_len);
|
||||||
bss_info.ssid.ssid_len);
|
|
||||||
ie_len = ie_buf[1] + sizeof(struct ieee_types_header);
|
ie_len = ie_buf[1] + sizeof(struct ieee_types_header);
|
||||||
|
|
||||||
band = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
|
band = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
|
||||||
|
@ -812,8 +808,8 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
|
||||||
band));
|
band));
|
||||||
|
|
||||||
bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
|
bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
|
||||||
bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
|
bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
|
||||||
0, ie_buf, ie_len, 0, GFP_KERNEL);
|
0, ie_buf, ie_len, 0, GFP_KERNEL);
|
||||||
cfg80211_put_bss(bss);
|
cfg80211_put_bss(bss);
|
||||||
memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN);
|
memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN);
|
||||||
|
|
||||||
|
@ -952,14 +948,15 @@ done:
|
||||||
|
|
||||||
if (!bss) {
|
if (!bss) {
|
||||||
if (is_scanning_required) {
|
if (is_scanning_required) {
|
||||||
dev_warn(priv->adapter->dev, "assoc: requested "
|
dev_warn(priv->adapter->dev,
|
||||||
"bss not found in scan results\n");
|
"assoc: requested bss not found in scan results\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
is_scanning_required = 1;
|
is_scanning_required = 1;
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(priv->adapter->dev, "info: trying to associate to %s and bssid %pM\n",
|
dev_dbg(priv->adapter->dev,
|
||||||
(char *) req_ssid.ssid, bss->bssid);
|
"info: trying to associate to '%s' bssid %pM\n",
|
||||||
|
(char *) req_ssid.ssid, bss->bssid);
|
||||||
memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
|
memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -999,7 +996,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n",
|
wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n",
|
||||||
(char *) sme->ssid, sme->bssid);
|
(char *) sme->ssid, sme->bssid);
|
||||||
|
|
||||||
ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
|
ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
|
||||||
priv->bss_mode, sme->channel, sme, 0);
|
priv->bss_mode, sme->channel, sme, 0);
|
||||||
|
@ -1041,11 +1038,11 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n",
|
wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n",
|
||||||
(char *) params->ssid, params->bssid);
|
(char *) params->ssid, params->bssid);
|
||||||
|
|
||||||
ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid,
|
ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid,
|
||||||
params->bssid, priv->bss_mode,
|
params->bssid, priv->bss_mode,
|
||||||
params->channel, NULL, params->privacy);
|
params->channel, NULL, params->privacy);
|
||||||
done:
|
done:
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, GFP_KERNEL);
|
cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, GFP_KERNEL);
|
||||||
|
@ -1072,7 +1069,7 @@ mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
|
||||||
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
|
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
|
||||||
|
|
||||||
wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n",
|
wiphy_dbg(wiphy, "info: disconnecting from essid %pM\n",
|
||||||
priv->cfg_bssid);
|
priv->cfg_bssid);
|
||||||
if (mwifiex_deauthenticate(priv, NULL))
|
if (mwifiex_deauthenticate(priv, NULL))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
|
@ -1101,7 +1098,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
|
||||||
priv->scan_request = request;
|
priv->scan_request = request;
|
||||||
|
|
||||||
priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg),
|
priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!priv->user_scan_cfg) {
|
if (!priv->user_scan_cfg) {
|
||||||
dev_err(priv->adapter->dev, "failed to alloc scan_req\n");
|
dev_err(priv->adapter->dev, "failed to alloc scan_req\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -1117,10 +1114,10 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
|
||||||
|
|
||||||
if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||||
priv->user_scan_cfg->chan_list[i].scan_type =
|
priv->user_scan_cfg->chan_list[i].scan_type =
|
||||||
MWIFIEX_SCAN_TYPE_PASSIVE;
|
MWIFIEX_SCAN_TYPE_PASSIVE;
|
||||||
else
|
else
|
||||||
priv->user_scan_cfg->chan_list[i].scan_type =
|
priv->user_scan_cfg->chan_list[i].scan_type =
|
||||||
MWIFIEX_SCAN_TYPE_ACTIVE;
|
MWIFIEX_SCAN_TYPE_ACTIVE;
|
||||||
|
|
||||||
priv->user_scan_cfg->chan_list[i].scan_time = 0;
|
priv->user_scan_cfg->chan_list[i].scan_time = 0;
|
||||||
}
|
}
|
||||||
|
@ -1191,9 +1188,9 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
|
||||||
memset(mcs, 0xff, rx_mcs_supp);
|
memset(mcs, 0xff, rx_mcs_supp);
|
||||||
/* Clear all the other values */
|
/* Clear all the other values */
|
||||||
memset(&mcs[rx_mcs_supp], 0,
|
memset(&mcs[rx_mcs_supp], 0,
|
||||||
sizeof(struct ieee80211_mcs_info) - rx_mcs_supp);
|
sizeof(struct ieee80211_mcs_info) - rx_mcs_supp);
|
||||||
if (priv->bss_mode == NL80211_IFTYPE_STATION ||
|
if (priv->bss_mode == NL80211_IFTYPE_STATION ||
|
||||||
ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap))
|
ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap))
|
||||||
/* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */
|
/* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */
|
||||||
SETHT_MCS32(mcs_set.rx_mask);
|
SETHT_MCS32(mcs_set.rx_mask);
|
||||||
|
|
||||||
|
@ -1206,10 +1203,10 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
|
||||||
* create a new virtual interface with the given name
|
* create a new virtual interface with the given name
|
||||||
*/
|
*/
|
||||||
struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
|
||||||
char *name,
|
char *name,
|
||||||
enum nl80211_iftype type,
|
enum nl80211_iftype type,
|
||||||
u32 *flags,
|
u32 *flags,
|
||||||
struct vif_params *params)
|
struct vif_params *params)
|
||||||
{
|
{
|
||||||
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
|
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
|
||||||
struct mwifiex_adapter *adapter;
|
struct mwifiex_adapter *adapter;
|
||||||
|
@ -1367,11 +1364,12 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
|
||||||
int ret;
|
int ret;
|
||||||
void *wdev_priv;
|
void *wdev_priv;
|
||||||
struct wireless_dev *wdev;
|
struct wireless_dev *wdev;
|
||||||
|
struct ieee80211_sta_ht_cap *ht_info;
|
||||||
|
|
||||||
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
|
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
|
||||||
if (!wdev) {
|
if (!wdev) {
|
||||||
dev_err(priv->adapter->dev, "%s: allocating wireless device\n",
|
dev_err(priv->adapter->dev, "%s: allocating wireless device\n",
|
||||||
__func__);
|
__func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
wdev->wiphy =
|
wdev->wiphy =
|
||||||
|
@ -1383,17 +1381,17 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
|
||||||
}
|
}
|
||||||
wdev->iftype = NL80211_IFTYPE_STATION;
|
wdev->iftype = NL80211_IFTYPE_STATION;
|
||||||
wdev->wiphy->max_scan_ssids = 10;
|
wdev->wiphy->max_scan_ssids = 10;
|
||||||
wdev->wiphy->interface_modes =
|
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
||||||
BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
|
BIT(NL80211_IFTYPE_ADHOC);
|
||||||
|
|
||||||
wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz;
|
wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz;
|
||||||
mwifiex_setup_ht_caps(
|
ht_info = &wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap;
|
||||||
&wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap, priv);
|
mwifiex_setup_ht_caps(ht_info, priv);
|
||||||
|
|
||||||
if (priv->adapter->config_bands & BAND_A) {
|
if (priv->adapter->config_bands & BAND_A) {
|
||||||
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz;
|
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz;
|
||||||
mwifiex_setup_ht_caps(
|
ht_info = &wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap;
|
||||||
&wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap, priv);
|
mwifiex_setup_ht_caps(ht_info, priv);
|
||||||
} else {
|
} else {
|
||||||
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
|
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1420,13 +1418,13 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
|
||||||
ret = wiphy_register(wdev->wiphy);
|
ret = wiphy_register(wdev->wiphy);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n",
|
dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n",
|
||||||
__func__);
|
__func__);
|
||||||
wiphy_free(wdev->wiphy);
|
wiphy_free(wdev->wiphy);
|
||||||
kfree(wdev);
|
kfree(wdev);
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(priv->adapter->dev,
|
dev_dbg(priv->adapter->dev,
|
||||||
"info: successfully registered wiphy device\n");
|
"info: successfully registered wiphy device\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->wdev = wdev;
|
priv->wdev = wdev;
|
||||||
|
|
|
@ -163,8 +163,8 @@ u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, u8 *rates)
|
||||||
return mwifiex_get_supported_rates(priv, rates);
|
return mwifiex_get_supported_rates(priv, rates);
|
||||||
else
|
else
|
||||||
return mwifiex_copy_rates(rates, 0,
|
return mwifiex_copy_rates(rates, 0,
|
||||||
priv->curr_bss_params.data_rates,
|
priv->curr_bss_params.data_rates,
|
||||||
priv->curr_bss_params.num_of_rates);
|
priv->curr_bss_params.num_of_rates);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -67,7 +67,7 @@ mwifiex_get_cmd_node(struct mwifiex_adapter *adapter)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
cmd_node = list_first_entry(&adapter->cmd_free_q,
|
cmd_node = list_first_entry(&adapter->cmd_free_q,
|
||||||
struct cmd_ctrl_node, list);
|
struct cmd_ctrl_node, list);
|
||||||
list_del(&cmd_node->list);
|
list_del(&cmd_node->list);
|
||||||
spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags);
|
spin_unlock_irqrestore(&adapter->cmd_free_q_lock, flags);
|
||||||
|
|
||||||
|
@ -158,8 +158,9 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
|
||||||
/* Set command sequence number */
|
/* Set command sequence number */
|
||||||
adapter->seq_num++;
|
adapter->seq_num++;
|
||||||
host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
|
host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
|
||||||
(adapter->seq_num, cmd_node->priv->bss_num,
|
(adapter->seq_num,
|
||||||
cmd_node->priv->bss_type));
|
cmd_node->priv->bss_num,
|
||||||
|
cmd_node->priv->bss_type));
|
||||||
|
|
||||||
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
|
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
|
||||||
adapter->curr_cmd = cmd_node;
|
adapter->curr_cmd = cmd_node;
|
||||||
|
@ -174,8 +175,8 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
|
||||||
dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d,"
|
dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d,"
|
||||||
" seqno %#x\n",
|
" seqno %#x\n",
|
||||||
tstamp.tv_sec, tstamp.tv_usec, cmd_code,
|
tstamp.tv_sec, tstamp.tv_usec, cmd_code,
|
||||||
le16_to_cpu(*(__le16 *) ((u8 *) host_cmd + S_DS_GEN)), cmd_size,
|
le16_to_cpu(*(__le16 *) ((u8 *) host_cmd + S_DS_GEN)), cmd_size,
|
||||||
le16_to_cpu(host_cmd->seq_num));
|
le16_to_cpu(host_cmd->seq_num));
|
||||||
|
|
||||||
skb_push(cmd_node->cmd_skb, INTF_HEADER_LEN);
|
skb_push(cmd_node->cmd_skb, INTF_HEADER_LEN);
|
||||||
|
|
||||||
|
@ -200,17 +201,17 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
|
||||||
|
|
||||||
/* Save the last command id and action to debug log */
|
/* Save the last command id and action to debug log */
|
||||||
adapter->dbg.last_cmd_index =
|
adapter->dbg.last_cmd_index =
|
||||||
(adapter->dbg.last_cmd_index + 1) % DBG_CMD_NUM;
|
(adapter->dbg.last_cmd_index + 1) % DBG_CMD_NUM;
|
||||||
adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index] = cmd_code;
|
adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index] = cmd_code;
|
||||||
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] =
|
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] =
|
||||||
le16_to_cpu(*(__le16 *) ((u8 *) host_cmd + S_DS_GEN));
|
le16_to_cpu(*(__le16 *) ((u8 *) host_cmd + S_DS_GEN));
|
||||||
|
|
||||||
/* Clear BSS_NO_BITS from HostCmd */
|
/* Clear BSS_NO_BITS from HostCmd */
|
||||||
cmd_code &= HostCmd_CMD_ID_MASK;
|
cmd_code &= HostCmd_CMD_ID_MASK;
|
||||||
|
|
||||||
/* Setup the timer after transmit command */
|
/* Setup the timer after transmit command */
|
||||||
mod_timer(&adapter->cmd_timer,
|
mod_timer(&adapter->cmd_timer,
|
||||||
jiffies + (MWIFIEX_TIMER_10S * HZ) / 1000);
|
jiffies + (MWIFIEX_TIMER_10S * HZ) / 1000);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +231,7 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
|
||||||
struct mwifiex_private *priv;
|
struct mwifiex_private *priv;
|
||||||
struct mwifiex_opt_sleep_confirm *sleep_cfm_buf =
|
struct mwifiex_opt_sleep_confirm *sleep_cfm_buf =
|
||||||
(struct mwifiex_opt_sleep_confirm *)
|
(struct mwifiex_opt_sleep_confirm *)
|
||||||
adapter->sleep_cfm->data;
|
adapter->sleep_cfm->data;
|
||||||
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
||||||
|
|
||||||
sleep_cfm_buf->seq_num =
|
sleep_cfm_buf->seq_num =
|
||||||
|
@ -250,7 +251,7 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY))
|
if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY))
|
||||||
== MWIFIEX_BSS_ROLE_STA) {
|
== MWIFIEX_BSS_ROLE_STA) {
|
||||||
if (!sleep_cfm_buf->resp_ctrl)
|
if (!sleep_cfm_buf->resp_ctrl)
|
||||||
/* Response is not needed for sleep
|
/* Response is not needed for sleep
|
||||||
confirm command */
|
confirm command */
|
||||||
|
@ -258,12 +259,12 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
|
||||||
else
|
else
|
||||||
adapter->ps_state = PS_STATE_SLEEP_CFM;
|
adapter->ps_state = PS_STATE_SLEEP_CFM;
|
||||||
|
|
||||||
if (!sleep_cfm_buf->resp_ctrl
|
if (!sleep_cfm_buf->resp_ctrl &&
|
||||||
&& (adapter->is_hs_configured
|
(adapter->is_hs_configured &&
|
||||||
&& !adapter->sleep_period.period)) {
|
!adapter->sleep_period.period)) {
|
||||||
adapter->pm_wakeup_card_req = true;
|
adapter->pm_wakeup_card_req = true;
|
||||||
mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
|
mwifiex_hs_activated_event(mwifiex_get_priv
|
||||||
MWIFIEX_BSS_ROLE_STA), true);
|
(adapter, MWIFIEX_BSS_ROLE_STA), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +294,7 @@ int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter)
|
||||||
cmd_array = kzalloc(buf_size, GFP_KERNEL);
|
cmd_array = kzalloc(buf_size, GFP_KERNEL);
|
||||||
if (!cmd_array) {
|
if (!cmd_array) {
|
||||||
dev_err(adapter->dev, "%s: failed to alloc cmd_array\n",
|
dev_err(adapter->dev, "%s: failed to alloc cmd_array\n",
|
||||||
__func__);
|
__func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,9 +377,9 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
|
||||||
|
|
||||||
/* Save the last event to debug log */
|
/* Save the last event to debug log */
|
||||||
adapter->dbg.last_event_index =
|
adapter->dbg.last_event_index =
|
||||||
(adapter->dbg.last_event_index + 1) % DBG_CMD_NUM;
|
(adapter->dbg.last_event_index + 1) % DBG_CMD_NUM;
|
||||||
adapter->dbg.last_event[adapter->dbg.last_event_index] =
|
adapter->dbg.last_event[adapter->dbg.last_event_index] =
|
||||||
(u16) eventcause;
|
(u16) eventcause;
|
||||||
|
|
||||||
/* Get BSS number and corresponding priv */
|
/* Get BSS number and corresponding priv */
|
||||||
priv = mwifiex_get_priv_by_id(adapter, EVENT_GET_BSS_NUM(eventcause),
|
priv = mwifiex_get_priv_by_id(adapter, EVENT_GET_BSS_NUM(eventcause),
|
||||||
|
@ -398,7 +399,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
|
||||||
if (eventcause != EVENT_PS_SLEEP && eventcause != EVENT_PS_AWAKE) {
|
if (eventcause != EVENT_PS_SLEEP && eventcause != EVENT_PS_AWAKE) {
|
||||||
do_gettimeofday(&tstamp);
|
do_gettimeofday(&tstamp);
|
||||||
dev_dbg(adapter->dev, "event: %lu.%lu: cause: %#x\n",
|
dev_dbg(adapter->dev, "event: %lu.%lu: cause: %#x\n",
|
||||||
tstamp.tv_sec, tstamp.tv_usec, eventcause);
|
tstamp.tv_sec, tstamp.tv_usec, eventcause);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mwifiex_process_sta_event(priv);
|
ret = mwifiex_process_sta_event(priv);
|
||||||
|
@ -509,7 +510,7 @@ int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no,
|
||||||
/* Return error, since the command preparation failed */
|
/* Return error, since the command preparation failed */
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(adapter->dev, "PREP_CMD: cmd %#x preparation failed\n",
|
dev_err(adapter->dev, "PREP_CMD: cmd %#x preparation failed\n",
|
||||||
cmd_no);
|
cmd_no);
|
||||||
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
|
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -577,9 +578,9 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
|
||||||
/* Exit_PS command needs to be queued in the header always. */
|
/* Exit_PS command needs to be queued in the header always. */
|
||||||
if (command == HostCmd_CMD_802_11_PS_MODE_ENH) {
|
if (command == HostCmd_CMD_802_11_PS_MODE_ENH) {
|
||||||
struct host_cmd_ds_802_11_ps_mode_enh *pm =
|
struct host_cmd_ds_802_11_ps_mode_enh *pm =
|
||||||
&host_cmd->params.psmode_enh;
|
&host_cmd->params.psmode_enh;
|
||||||
if ((le16_to_cpu(pm->action) == DIS_PS)
|
if ((le16_to_cpu(pm->action) == DIS_PS) ||
|
||||||
|| (le16_to_cpu(pm->action) == DIS_AUTO_PS)) {
|
(le16_to_cpu(pm->action) == DIS_AUTO_PS)) {
|
||||||
if (adapter->ps_state != PS_STATE_AWAKE)
|
if (adapter->ps_state != PS_STATE_AWAKE)
|
||||||
add_tail = false;
|
add_tail = false;
|
||||||
}
|
}
|
||||||
|
@ -692,7 +693,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
|
||||||
if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) {
|
if (!adapter->curr_cmd || !adapter->curr_cmd->resp_skb) {
|
||||||
resp = (struct host_cmd_ds_command *) adapter->upld_buf;
|
resp = (struct host_cmd_ds_command *) adapter->upld_buf;
|
||||||
dev_err(adapter->dev, "CMD_RESP: NULL curr_cmd, %#x\n",
|
dev_err(adapter->dev, "CMD_RESP: NULL curr_cmd, %#x\n",
|
||||||
le16_to_cpu(resp->command));
|
le16_to_cpu(resp->command));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,7 +702,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
|
||||||
resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data;
|
resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data;
|
||||||
if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) {
|
if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) {
|
||||||
dev_err(adapter->dev, "CMD_RESP: %#x been canceled\n",
|
dev_err(adapter->dev, "CMD_RESP: %#x been canceled\n",
|
||||||
le16_to_cpu(resp->command));
|
le16_to_cpu(resp->command));
|
||||||
mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
|
mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
|
||||||
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
|
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
|
||||||
adapter->curr_cmd = NULL;
|
adapter->curr_cmd = NULL;
|
||||||
|
@ -725,8 +726,8 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
|
||||||
|
|
||||||
/* Get BSS number and corresponding priv */
|
/* Get BSS number and corresponding priv */
|
||||||
priv = mwifiex_get_priv_by_id(adapter,
|
priv = mwifiex_get_priv_by_id(adapter,
|
||||||
HostCmd_GET_BSS_NO(le16_to_cpu(resp->seq_num)),
|
HostCmd_GET_BSS_NO(le16_to_cpu(resp->seq_num)),
|
||||||
HostCmd_GET_BSS_TYPE(le16_to_cpu(resp->seq_num)));
|
HostCmd_GET_BSS_TYPE(le16_to_cpu(resp->seq_num)));
|
||||||
if (!priv)
|
if (!priv)
|
||||||
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
||||||
/* Clear RET_BIT from HostCmd */
|
/* Clear RET_BIT from HostCmd */
|
||||||
|
@ -737,9 +738,9 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
|
||||||
|
|
||||||
/* Save the last command response to debug log */
|
/* Save the last command response to debug log */
|
||||||
adapter->dbg.last_cmd_resp_index =
|
adapter->dbg.last_cmd_resp_index =
|
||||||
(adapter->dbg.last_cmd_resp_index + 1) % DBG_CMD_NUM;
|
(adapter->dbg.last_cmd_resp_index + 1) % DBG_CMD_NUM;
|
||||||
adapter->dbg.last_cmd_resp_id[adapter->dbg.last_cmd_resp_index] =
|
adapter->dbg.last_cmd_resp_id[adapter->dbg.last_cmd_resp_index] =
|
||||||
orig_cmdresp_no;
|
orig_cmdresp_no;
|
||||||
|
|
||||||
do_gettimeofday(&tstamp);
|
do_gettimeofday(&tstamp);
|
||||||
dev_dbg(adapter->dev, "cmd: CMD_RESP: (%lu.%lu): 0x%x, result %d,"
|
dev_dbg(adapter->dev, "cmd: CMD_RESP: (%lu.%lu): 0x%x, result %d,"
|
||||||
|
@ -761,8 +762,8 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
|
||||||
|
|
||||||
if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) {
|
if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) {
|
||||||
adapter->curr_cmd->cmd_flag &= ~CMD_F_HOSTCMD;
|
adapter->curr_cmd->cmd_flag &= ~CMD_F_HOSTCMD;
|
||||||
if ((cmdresp_result == HostCmd_RESULT_OK)
|
if ((cmdresp_result == HostCmd_RESULT_OK) &&
|
||||||
&& (cmdresp_no == HostCmd_CMD_802_11_HS_CFG_ENH))
|
(cmdresp_no == HostCmd_CMD_802_11_HS_CFG_ENH))
|
||||||
ret = mwifiex_ret_802_11_hs_cfg(priv, resp);
|
ret = mwifiex_ret_802_11_hs_cfg(priv, resp);
|
||||||
} else {
|
} else {
|
||||||
/* handle response */
|
/* handle response */
|
||||||
|
@ -824,44 +825,45 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
|
||||||
adapter->dbg.timeout_cmd_act =
|
adapter->dbg.timeout_cmd_act =
|
||||||
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index];
|
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index];
|
||||||
do_gettimeofday(&tstamp);
|
do_gettimeofday(&tstamp);
|
||||||
dev_err(adapter->dev, "%s: Timeout cmd id (%lu.%lu) = %#x,"
|
dev_err(adapter->dev,
|
||||||
" act = %#x\n", __func__,
|
"%s: Timeout cmd id (%lu.%lu) = %#x, act = %#x\n",
|
||||||
tstamp.tv_sec, tstamp.tv_usec,
|
__func__, tstamp.tv_sec, tstamp.tv_usec,
|
||||||
adapter->dbg.timeout_cmd_id,
|
adapter->dbg.timeout_cmd_id,
|
||||||
adapter->dbg.timeout_cmd_act);
|
adapter->dbg.timeout_cmd_act);
|
||||||
|
|
||||||
dev_err(adapter->dev, "num_data_h2c_failure = %d\n",
|
dev_err(adapter->dev, "num_data_h2c_failure = %d\n",
|
||||||
adapter->dbg.num_tx_host_to_card_failure);
|
adapter->dbg.num_tx_host_to_card_failure);
|
||||||
dev_err(adapter->dev, "num_cmd_h2c_failure = %d\n",
|
dev_err(adapter->dev, "num_cmd_h2c_failure = %d\n",
|
||||||
adapter->dbg.num_cmd_host_to_card_failure);
|
adapter->dbg.num_cmd_host_to_card_failure);
|
||||||
|
|
||||||
dev_err(adapter->dev, "num_cmd_timeout = %d\n",
|
dev_err(adapter->dev, "num_cmd_timeout = %d\n",
|
||||||
adapter->dbg.num_cmd_timeout);
|
adapter->dbg.num_cmd_timeout);
|
||||||
dev_err(adapter->dev, "num_tx_timeout = %d\n",
|
dev_err(adapter->dev, "num_tx_timeout = %d\n",
|
||||||
adapter->dbg.num_tx_timeout);
|
adapter->dbg.num_tx_timeout);
|
||||||
|
|
||||||
dev_err(adapter->dev, "last_cmd_index = %d\n",
|
dev_err(adapter->dev, "last_cmd_index = %d\n",
|
||||||
adapter->dbg.last_cmd_index);
|
adapter->dbg.last_cmd_index);
|
||||||
print_hex_dump_bytes("last_cmd_id: ", DUMP_PREFIX_OFFSET,
|
print_hex_dump_bytes("last_cmd_id: ", DUMP_PREFIX_OFFSET,
|
||||||
adapter->dbg.last_cmd_id, DBG_CMD_NUM);
|
adapter->dbg.last_cmd_id, DBG_CMD_NUM);
|
||||||
print_hex_dump_bytes("last_cmd_act: ", DUMP_PREFIX_OFFSET,
|
print_hex_dump_bytes("last_cmd_act: ", DUMP_PREFIX_OFFSET,
|
||||||
adapter->dbg.last_cmd_act, DBG_CMD_NUM);
|
adapter->dbg.last_cmd_act, DBG_CMD_NUM);
|
||||||
|
|
||||||
dev_err(adapter->dev, "last_cmd_resp_index = %d\n",
|
dev_err(adapter->dev, "last_cmd_resp_index = %d\n",
|
||||||
adapter->dbg.last_cmd_resp_index);
|
adapter->dbg.last_cmd_resp_index);
|
||||||
print_hex_dump_bytes("last_cmd_resp_id: ", DUMP_PREFIX_OFFSET,
|
print_hex_dump_bytes("last_cmd_resp_id: ", DUMP_PREFIX_OFFSET,
|
||||||
adapter->dbg.last_cmd_resp_id, DBG_CMD_NUM);
|
adapter->dbg.last_cmd_resp_id,
|
||||||
|
DBG_CMD_NUM);
|
||||||
|
|
||||||
dev_err(adapter->dev, "last_event_index = %d\n",
|
dev_err(adapter->dev, "last_event_index = %d\n",
|
||||||
adapter->dbg.last_event_index);
|
adapter->dbg.last_event_index);
|
||||||
print_hex_dump_bytes("last_event: ", DUMP_PREFIX_OFFSET,
|
print_hex_dump_bytes("last_event: ", DUMP_PREFIX_OFFSET,
|
||||||
adapter->dbg.last_event, DBG_CMD_NUM);
|
adapter->dbg.last_event, DBG_CMD_NUM);
|
||||||
|
|
||||||
dev_err(adapter->dev, "data_sent=%d cmd_sent=%d\n",
|
dev_err(adapter->dev, "data_sent=%d cmd_sent=%d\n",
|
||||||
adapter->data_sent, adapter->cmd_sent);
|
adapter->data_sent, adapter->cmd_sent);
|
||||||
|
|
||||||
dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n",
|
dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n",
|
||||||
adapter->ps_mode, adapter->ps_state);
|
adapter->ps_mode, adapter->ps_state);
|
||||||
}
|
}
|
||||||
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
|
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
|
||||||
mwifiex_init_fw_complete(adapter);
|
mwifiex_init_fw_complete(adapter);
|
||||||
|
@ -942,7 +944,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
|
||||||
uint16_t cancel_scan_cmd = false;
|
uint16_t cancel_scan_cmd = false;
|
||||||
|
|
||||||
if ((adapter->curr_cmd) &&
|
if ((adapter->curr_cmd) &&
|
||||||
(adapter->curr_cmd->wait_q_enabled)) {
|
(adapter->curr_cmd->wait_q_enabled)) {
|
||||||
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags);
|
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags);
|
||||||
cmd_node = adapter->curr_cmd;
|
cmd_node = adapter->curr_cmd;
|
||||||
cmd_node->wait_q_enabled = false;
|
cmd_node->wait_q_enabled = false;
|
||||||
|
@ -996,9 +998,9 @@ mwifiex_check_ps_cond(struct mwifiex_adapter *adapter)
|
||||||
else
|
else
|
||||||
dev_dbg(adapter->dev,
|
dev_dbg(adapter->dev,
|
||||||
"cmd: Delay Sleep Confirm (%s%s%s)\n",
|
"cmd: Delay Sleep Confirm (%s%s%s)\n",
|
||||||
(adapter->cmd_sent) ? "D" : "",
|
(adapter->cmd_sent) ? "D" : "",
|
||||||
(adapter->curr_cmd) ? "C" : "",
|
(adapter->curr_cmd) ? "C" : "",
|
||||||
(IS_CARD_RX_RCVD(adapter)) ? "R" : "");
|
(IS_CARD_RX_RCVD(adapter)) ? "R" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1050,8 +1052,8 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
|
||||||
dev_dbg(adapter->dev, "cmd: CMD_RESP: HS_CFG cmd reply"
|
dev_dbg(adapter->dev, "cmd: CMD_RESP: HS_CFG cmd reply"
|
||||||
" result=%#x, conditions=0x%x gpio=0x%x gap=0x%x\n",
|
" result=%#x, conditions=0x%x gpio=0x%x gap=0x%x\n",
|
||||||
resp->result, conditions,
|
resp->result, conditions,
|
||||||
phs_cfg->params.hs_config.gpio,
|
phs_cfg->params.hs_config.gpio,
|
||||||
phs_cfg->params.hs_config.gap);
|
phs_cfg->params.hs_config.gap);
|
||||||
}
|
}
|
||||||
if (conditions != HOST_SLEEP_CFG_CANCEL) {
|
if (conditions != HOST_SLEEP_CFG_CANCEL) {
|
||||||
adapter->is_hs_configured = true;
|
adapter->is_hs_configured = true;
|
||||||
|
@ -1078,7 +1080,8 @@ mwifiex_process_hs_config(struct mwifiex_adapter *adapter)
|
||||||
adapter->hs_activated = false;
|
adapter->hs_activated = false;
|
||||||
adapter->is_hs_configured = false;
|
adapter->is_hs_configured = false;
|
||||||
mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
|
mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
|
||||||
MWIFIEX_BSS_ROLE_ANY), false);
|
MWIFIEX_BSS_ROLE_ANY),
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1114,22 +1117,24 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter,
|
||||||
command &= HostCmd_CMD_ID_MASK;
|
command &= HostCmd_CMD_ID_MASK;
|
||||||
|
|
||||||
if (command != HostCmd_CMD_802_11_PS_MODE_ENH) {
|
if (command != HostCmd_CMD_802_11_PS_MODE_ENH) {
|
||||||
dev_err(adapter->dev, "%s: received unexpected response for"
|
dev_err(adapter->dev,
|
||||||
" cmd %x, result = %x\n", __func__, command, result);
|
"%s: rcvd unexpected resp for cmd %#x, result = %x\n",
|
||||||
|
__func__, command, result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
dev_err(adapter->dev, "%s: sleep confirm cmd failed\n",
|
dev_err(adapter->dev, "%s: sleep confirm cmd failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
adapter->pm_wakeup_card_req = false;
|
adapter->pm_wakeup_card_req = false;
|
||||||
adapter->ps_state = PS_STATE_AWAKE;
|
adapter->ps_state = PS_STATE_AWAKE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
adapter->pm_wakeup_card_req = true;
|
adapter->pm_wakeup_card_req = true;
|
||||||
if (adapter->is_hs_configured)
|
if (adapter->is_hs_configured)
|
||||||
mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
|
mwifiex_hs_activated_event(mwifiex_get_priv
|
||||||
MWIFIEX_BSS_ROLE_ANY), true);
|
(adapter, MWIFIEX_BSS_ROLE_ANY),
|
||||||
|
true);
|
||||||
adapter->ps_state = PS_STATE_SLEEP;
|
adapter->ps_state = PS_STATE_SLEEP;
|
||||||
cmd->command = cpu_to_le16(command);
|
cmd->command = cpu_to_le16(command);
|
||||||
cmd->seq_num = cpu_to_le16(seq_num);
|
cmd->seq_num = cpu_to_le16(seq_num);
|
||||||
|
@ -1163,17 +1168,17 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
|
||||||
psmode_enh->action = cpu_to_le16(DIS_AUTO_PS);
|
psmode_enh->action = cpu_to_le16(DIS_AUTO_PS);
|
||||||
psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap);
|
psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap);
|
||||||
cmd->size = cpu_to_le16(S_DS_GEN + sizeof(psmode_enh->action) +
|
cmd->size = cpu_to_le16(S_DS_GEN + sizeof(psmode_enh->action) +
|
||||||
sizeof(psmode_enh->params.ps_bitmap));
|
sizeof(psmode_enh->params.ps_bitmap));
|
||||||
} else if (cmd_action == GET_PS) {
|
} else if (cmd_action == GET_PS) {
|
||||||
psmode_enh->action = cpu_to_le16(GET_PS);
|
psmode_enh->action = cpu_to_le16(GET_PS);
|
||||||
psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap);
|
psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap);
|
||||||
cmd->size = cpu_to_le16(S_DS_GEN + sizeof(psmode_enh->action) +
|
cmd->size = cpu_to_le16(S_DS_GEN + sizeof(psmode_enh->action) +
|
||||||
sizeof(psmode_enh->params.ps_bitmap));
|
sizeof(psmode_enh->params.ps_bitmap));
|
||||||
} else if (cmd_action == EN_AUTO_PS) {
|
} else if (cmd_action == EN_AUTO_PS) {
|
||||||
psmode_enh->action = cpu_to_le16(EN_AUTO_PS);
|
psmode_enh->action = cpu_to_le16(EN_AUTO_PS);
|
||||||
psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap);
|
psmode_enh->params.ps_bitmap = cpu_to_le16(ps_bitmap);
|
||||||
cmd_size = S_DS_GEN + sizeof(psmode_enh->action) +
|
cmd_size = S_DS_GEN + sizeof(psmode_enh->action) +
|
||||||
sizeof(psmode_enh->params.ps_bitmap);
|
sizeof(psmode_enh->params.ps_bitmap);
|
||||||
tlv = (u8 *) cmd + cmd_size;
|
tlv = (u8 *) cmd + cmd_size;
|
||||||
if (ps_bitmap & BITMAP_STA_PS) {
|
if (ps_bitmap & BITMAP_STA_PS) {
|
||||||
struct mwifiex_adapter *adapter = priv->adapter;
|
struct mwifiex_adapter *adapter = priv->adapter;
|
||||||
|
@ -1187,19 +1192,18 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
|
||||||
tlv += sizeof(*ps_tlv);
|
tlv += sizeof(*ps_tlv);
|
||||||
dev_dbg(adapter->dev, "cmd: PS Command: Enter PS\n");
|
dev_dbg(adapter->dev, "cmd: PS Command: Enter PS\n");
|
||||||
ps_mode->null_pkt_interval =
|
ps_mode->null_pkt_interval =
|
||||||
cpu_to_le16(adapter->null_pkt_interval);
|
cpu_to_le16(adapter->null_pkt_interval);
|
||||||
ps_mode->multiple_dtims =
|
ps_mode->multiple_dtims =
|
||||||
cpu_to_le16(adapter->multiple_dtim);
|
cpu_to_le16(adapter->multiple_dtim);
|
||||||
ps_mode->bcn_miss_timeout =
|
ps_mode->bcn_miss_timeout =
|
||||||
cpu_to_le16(adapter->bcn_miss_time_out);
|
cpu_to_le16(adapter->bcn_miss_time_out);
|
||||||
ps_mode->local_listen_interval =
|
ps_mode->local_listen_interval =
|
||||||
cpu_to_le16(adapter->local_listen_interval);
|
cpu_to_le16(adapter->local_listen_interval);
|
||||||
ps_mode->adhoc_wake_period =
|
ps_mode->adhoc_wake_period =
|
||||||
cpu_to_le16(adapter->adhoc_awake_period);
|
cpu_to_le16(adapter->adhoc_awake_period);
|
||||||
ps_mode->delay_to_ps =
|
ps_mode->delay_to_ps =
|
||||||
cpu_to_le16(adapter->delay_to_ps);
|
cpu_to_le16(adapter->delay_to_ps);
|
||||||
ps_mode->mode =
|
ps_mode->mode = cpu_to_le16(adapter->enhanced_ps_mode);
|
||||||
cpu_to_le16(adapter->enhanced_ps_mode);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ps_bitmap & BITMAP_AUTO_DS) {
|
if (ps_bitmap & BITMAP_AUTO_DS) {
|
||||||
|
@ -1217,7 +1221,7 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
|
||||||
if (auto_ds)
|
if (auto_ds)
|
||||||
idletime = auto_ds->idle_time;
|
idletime = auto_ds->idle_time;
|
||||||
dev_dbg(priv->adapter->dev,
|
dev_dbg(priv->adapter->dev,
|
||||||
"cmd: PS Command: Enter Auto Deep Sleep\n");
|
"cmd: PS Command: Enter Auto Deep Sleep\n");
|
||||||
auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime);
|
auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime);
|
||||||
}
|
}
|
||||||
cmd->size = cpu_to_le16(cmd_size);
|
cmd->size = cpu_to_le16(cmd_size);
|
||||||
|
@ -1244,8 +1248,9 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
|
||||||
uint16_t auto_ps_bitmap =
|
uint16_t auto_ps_bitmap =
|
||||||
le16_to_cpu(ps_mode->params.ps_bitmap);
|
le16_to_cpu(ps_mode->params.ps_bitmap);
|
||||||
|
|
||||||
dev_dbg(adapter->dev, "info: %s: PS_MODE cmd reply result=%#x action=%#X\n",
|
dev_dbg(adapter->dev,
|
||||||
__func__, resp->result, action);
|
"info: %s: PS_MODE cmd reply result=%#x action=%#X\n",
|
||||||
|
__func__, resp->result, action);
|
||||||
if (action == EN_AUTO_PS) {
|
if (action == EN_AUTO_PS) {
|
||||||
if (auto_ps_bitmap & BITMAP_AUTO_DS) {
|
if (auto_ps_bitmap & BITMAP_AUTO_DS) {
|
||||||
dev_dbg(adapter->dev, "cmd: Enabled auto deep sleep\n");
|
dev_dbg(adapter->dev, "cmd: Enabled auto deep sleep\n");
|
||||||
|
@ -1254,7 +1259,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
|
||||||
if (auto_ps_bitmap & BITMAP_STA_PS) {
|
if (auto_ps_bitmap & BITMAP_STA_PS) {
|
||||||
dev_dbg(adapter->dev, "cmd: Enabled STA power save\n");
|
dev_dbg(adapter->dev, "cmd: Enabled STA power save\n");
|
||||||
if (adapter->sleep_period.period)
|
if (adapter->sleep_period.period)
|
||||||
dev_dbg(adapter->dev, "cmd: set to uapsd/pps mode\n");
|
dev_dbg(adapter->dev,
|
||||||
|
"cmd: set to uapsd/pps mode\n");
|
||||||
}
|
}
|
||||||
} else if (action == DIS_AUTO_PS) {
|
} else if (action == DIS_AUTO_PS) {
|
||||||
if (ps_bitmap & BITMAP_AUTO_DS) {
|
if (ps_bitmap & BITMAP_AUTO_DS) {
|
||||||
|
@ -1373,12 +1379,13 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
|
||||||
adapter->number_of_antenna = le16_to_cpu(hw_spec->number_of_antenna);
|
adapter->number_of_antenna = le16_to_cpu(hw_spec->number_of_antenna);
|
||||||
|
|
||||||
dev_dbg(adapter->dev, "info: GET_HW_SPEC: fw_release_number- %#x\n",
|
dev_dbg(adapter->dev, "info: GET_HW_SPEC: fw_release_number- %#x\n",
|
||||||
adapter->fw_release_number);
|
adapter->fw_release_number);
|
||||||
dev_dbg(adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n",
|
dev_dbg(adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n",
|
||||||
hw_spec->permanent_addr);
|
hw_spec->permanent_addr);
|
||||||
dev_dbg(adapter->dev, "info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n",
|
dev_dbg(adapter->dev,
|
||||||
|
"info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n",
|
||||||
le16_to_cpu(hw_spec->hw_if_version),
|
le16_to_cpu(hw_spec->hw_if_version),
|
||||||
le16_to_cpu(hw_spec->version));
|
le16_to_cpu(hw_spec->version));
|
||||||
|
|
||||||
if (priv->curr_addr[0] == 0xff)
|
if (priv->curr_addr[0] == 0xff)
|
||||||
memmove(priv->curr_addr, hw_spec->permanent_addr, ETH_ALEN);
|
memmove(priv->curr_addr, hw_spec->permanent_addr, ETH_ALEN);
|
||||||
|
@ -1393,7 +1400,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
|
||||||
/* If it's unidentified region code, use the default (USA) */
|
/* If it's unidentified region code, use the default (USA) */
|
||||||
if (i >= MWIFIEX_MAX_REGION_CODE) {
|
if (i >= MWIFIEX_MAX_REGION_CODE) {
|
||||||
adapter->region_code = 0x10;
|
adapter->region_code = 0x10;
|
||||||
dev_dbg(adapter->dev, "cmd: unknown region code, use default (USA)\n");
|
dev_dbg(adapter->dev,
|
||||||
|
"cmd: unknown region code, use default (USA)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap);
|
adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap);
|
||||||
|
|
Loading…
Add table
Reference in a new issue