mwifiex: shorten the host sleep configuration macro names
As we are adding a few more macros in this category in next patch, this cleanup work is required. Signed-off-by: Amitkumar Karwar <akarwar@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
f553e1aad7
commit
cc0b5a64b8
|
@ -1139,7 +1139,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv,
|
||||||
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 != HS_CFG_CANCEL) {
|
||||||
adapter->is_hs_configured = true;
|
adapter->is_hs_configured = true;
|
||||||
if (adapter->iface_type == MWIFIEX_USB ||
|
if (adapter->iface_type == MWIFIEX_USB ||
|
||||||
adapter->iface_type == MWIFIEX_PCIE)
|
adapter->iface_type == MWIFIEX_PCIE)
|
||||||
|
|
|
@ -376,10 +376,10 @@ enum P2P_MODES {
|
||||||
#define HostCmd_SCAN_RADIO_TYPE_BG 0
|
#define HostCmd_SCAN_RADIO_TYPE_BG 0
|
||||||
#define HostCmd_SCAN_RADIO_TYPE_A 1
|
#define HostCmd_SCAN_RADIO_TYPE_A 1
|
||||||
|
|
||||||
#define HOST_SLEEP_CFG_CANCEL 0xffffffff
|
#define HS_CFG_CANCEL 0xffffffff
|
||||||
#define HOST_SLEEP_CFG_COND_DEF 0x00000000
|
#define HS_CFG_COND_DEF 0x00000000
|
||||||
#define HOST_SLEEP_CFG_GPIO_DEF 0xff
|
#define HS_CFG_GPIO_DEF 0xff
|
||||||
#define HOST_SLEEP_CFG_GAP_DEF 0
|
#define HS_CFG_GAP_DEF 0
|
||||||
|
|
||||||
#define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
|
#define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
|
||||||
#define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
|
#define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
|
||||||
|
|
|
@ -318,9 +318,9 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
|
||||||
adapter->curr_tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K;
|
adapter->curr_tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K;
|
||||||
|
|
||||||
adapter->is_hs_configured = false;
|
adapter->is_hs_configured = false;
|
||||||
adapter->hs_cfg.conditions = cpu_to_le32(HOST_SLEEP_CFG_COND_DEF);
|
adapter->hs_cfg.conditions = cpu_to_le32(HS_CFG_COND_DEF);
|
||||||
adapter->hs_cfg.gpio = HOST_SLEEP_CFG_GPIO_DEF;
|
adapter->hs_cfg.gpio = HS_CFG_GPIO_DEF;
|
||||||
adapter->hs_cfg.gap = HOST_SLEEP_CFG_GAP_DEF;
|
adapter->hs_cfg.gap = HS_CFG_GAP_DEF;
|
||||||
adapter->hs_activated = false;
|
adapter->hs_activated = false;
|
||||||
|
|
||||||
memset(adapter->event_body, 0, sizeof(adapter->event_body));
|
memset(adapter->event_body, 0, sizeof(adapter->event_body));
|
||||||
|
|
|
@ -334,7 +334,7 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv,
|
||||||
cmd->command = cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH);
|
cmd->command = cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH);
|
||||||
|
|
||||||
if (!hs_activate &&
|
if (!hs_activate &&
|
||||||
(hscfg_param->conditions != cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) &&
|
(hscfg_param->conditions != cpu_to_le32(HS_CFG_CANCEL)) &&
|
||||||
((adapter->arp_filter_size > 0) &&
|
((adapter->arp_filter_size > 0) &&
|
||||||
(adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
|
(adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
|
||||||
dev_dbg(adapter->dev,
|
dev_dbg(adapter->dev,
|
||||||
|
|
|
@ -388,7 +388,7 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (hs_cfg->is_invoke_hostcmd) {
|
if (hs_cfg->is_invoke_hostcmd) {
|
||||||
if (hs_cfg->conditions == HOST_SLEEP_CFG_CANCEL) {
|
if (hs_cfg->conditions == HS_CFG_CANCEL) {
|
||||||
if (!adapter->is_hs_configured)
|
if (!adapter->is_hs_configured)
|
||||||
/* Already cancelled */
|
/* Already cancelled */
|
||||||
break;
|
break;
|
||||||
|
@ -403,8 +403,8 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
|
||||||
adapter->hs_cfg.gpio = (u8)hs_cfg->gpio;
|
adapter->hs_cfg.gpio = (u8)hs_cfg->gpio;
|
||||||
if (hs_cfg->gap)
|
if (hs_cfg->gap)
|
||||||
adapter->hs_cfg.gap = (u8)hs_cfg->gap;
|
adapter->hs_cfg.gap = (u8)hs_cfg->gap;
|
||||||
} else if (adapter->hs_cfg.conditions
|
} else if (adapter->hs_cfg.conditions ==
|
||||||
== cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) {
|
cpu_to_le32(HS_CFG_CANCEL)) {
|
||||||
/* Return failure if no parameters for HS
|
/* Return failure if no parameters for HS
|
||||||
enable */
|
enable */
|
||||||
status = -1;
|
status = -1;
|
||||||
|
@ -420,7 +420,7 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
|
||||||
HostCmd_CMD_802_11_HS_CFG_ENH,
|
HostCmd_CMD_802_11_HS_CFG_ENH,
|
||||||
HostCmd_ACT_GEN_SET, 0,
|
HostCmd_ACT_GEN_SET, 0,
|
||||||
&adapter->hs_cfg);
|
&adapter->hs_cfg);
|
||||||
if (hs_cfg->conditions == HOST_SLEEP_CFG_CANCEL)
|
if (hs_cfg->conditions == HS_CFG_CANCEL)
|
||||||
/* Restore previous condition */
|
/* Restore previous condition */
|
||||||
adapter->hs_cfg.conditions =
|
adapter->hs_cfg.conditions =
|
||||||
cpu_to_le32(prev_cond);
|
cpu_to_le32(prev_cond);
|
||||||
|
@ -454,7 +454,7 @@ int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type)
|
||||||
{
|
{
|
||||||
struct mwifiex_ds_hs_cfg hscfg;
|
struct mwifiex_ds_hs_cfg hscfg;
|
||||||
|
|
||||||
hscfg.conditions = HOST_SLEEP_CFG_CANCEL;
|
hscfg.conditions = HS_CFG_CANCEL;
|
||||||
hscfg.is_invoke_hostcmd = true;
|
hscfg.is_invoke_hostcmd = true;
|
||||||
|
|
||||||
return mwifiex_set_hs_params(priv, HostCmd_ACT_GEN_SET,
|
return mwifiex_set_hs_params(priv, HostCmd_ACT_GEN_SET,
|
||||||
|
|
Loading…
Reference in New Issue