mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	mwifiex: Disable adhoc feature based on firmware capability
We will read fw_cap_info filled by firmware to check whether to skip ADHOC related commands or not. Also, IBSS_COALESCING_STATUS command has been moved from init path to adhoc network creation path. Signed-off-by: Karthik D A <karthida@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
		
							parent
							
								
									13e1349aff
								
							
						
					
					
						commit
						e267e71e68
					
				
					 3 changed files with 36 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -2143,6 +2143,16 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len,
 | 
			
		|||
	ret = mwifiex_set_encode(priv, NULL, NULL, 0, 0, NULL, 1);
 | 
			
		||||
 | 
			
		||||
	if (mode == NL80211_IFTYPE_ADHOC) {
 | 
			
		||||
		u16 enable = true;
 | 
			
		||||
 | 
			
		||||
		/* set ibss coalescing_status */
 | 
			
		||||
		ret = mwifiex_send_cmd(
 | 
			
		||||
				priv,
 | 
			
		||||
				HostCmd_CMD_802_11_IBSS_COALESCING_STATUS,
 | 
			
		||||
				HostCmd_ACT_GEN_SET, 0, &enable, true);
 | 
			
		||||
		if (ret)
 | 
			
		||||
			return ret;
 | 
			
		||||
 | 
			
		||||
		/* "privacy" is set only for ad-hoc mode */
 | 
			
		||||
		if (privacy) {
 | 
			
		||||
			/*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -219,6 +219,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 | 
			
		|||
#define ISSUPP_TDLS_ENABLED(FwCapInfo) (FwCapInfo & BIT(14))
 | 
			
		||||
#define ISSUPP_DRCS_ENABLED(FwCapInfo) (FwCapInfo & BIT(15))
 | 
			
		||||
#define ISSUPP_SDIO_SPA_ENABLED(FwCapInfo) (FwCapInfo & BIT(16))
 | 
			
		||||
#define ISSUPP_ADHOC_ENABLED(FwCapInfo) (FwCapInfo & BIT(25))
 | 
			
		||||
 | 
			
		||||
#define MWIFIEX_DEF_HT_CAP	(IEEE80211_HT_CAP_DSSSCCK40 | \
 | 
			
		||||
				 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1902,6 +1902,24 @@ static int mwifiex_cmd_get_wakeup_reason(struct mwifiex_private *priv,
 | 
			
		|||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This function check if the command is supported by firmware */
 | 
			
		||||
static int mwifiex_is_cmd_supported(struct mwifiex_private *priv, u16 cmd_no)
 | 
			
		||||
{
 | 
			
		||||
	if (!ISSUPP_ADHOC_ENABLED(priv->adapter->fw_cap_info)) {
 | 
			
		||||
		switch (cmd_no) {
 | 
			
		||||
		case HostCmd_CMD_802_11_IBSS_COALESCING_STATUS:
 | 
			
		||||
		case HostCmd_CMD_802_11_AD_HOC_START:
 | 
			
		||||
		case HostCmd_CMD_802_11_AD_HOC_JOIN:
 | 
			
		||||
		case HostCmd_CMD_802_11_AD_HOC_STOP:
 | 
			
		||||
			return -EOPNOTSUPP;
 | 
			
		||||
		default:
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This function prepares the commands before sending them to the firmware.
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			@ -1915,6 +1933,13 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
 | 
			
		|||
	struct host_cmd_ds_command *cmd_ptr = cmd_buf;
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
 | 
			
		||||
	if (mwifiex_is_cmd_supported(priv, cmd_no)) {
 | 
			
		||||
		mwifiex_dbg(priv->adapter, ERROR,
 | 
			
		||||
			    "0x%x command not supported by firmware\n",
 | 
			
		||||
			    cmd_no);
 | 
			
		||||
			return -EOPNOTSUPP;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* Prepare command */
 | 
			
		||||
	switch (cmd_no) {
 | 
			
		||||
	case HostCmd_CMD_GET_HW_SPEC:
 | 
			
		||||
| 
						 | 
				
			
			@ -2208,7 +2233,6 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
 | 
			
		|||
{
 | 
			
		||||
	struct mwifiex_adapter *adapter = priv->adapter;
 | 
			
		||||
	int ret;
 | 
			
		||||
	u16 enable = true;
 | 
			
		||||
	struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
 | 
			
		||||
	struct mwifiex_ds_auto_ds auto_ds;
 | 
			
		||||
	enum state_11d_t state_11d;
 | 
			
		||||
| 
						 | 
				
			
			@ -2321,16 +2345,6 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
 | 
			
		|||
	if (ret)
 | 
			
		||||
		return -1;
 | 
			
		||||
 | 
			
		||||
	if (priv->bss_type == MWIFIEX_BSS_TYPE_STA) {
 | 
			
		||||
		/* set ibss coalescing_status */
 | 
			
		||||
		ret = mwifiex_send_cmd(
 | 
			
		||||
				priv,
 | 
			
		||||
				HostCmd_CMD_802_11_IBSS_COALESCING_STATUS,
 | 
			
		||||
				HostCmd_ACT_GEN_SET, 0, &enable, true);
 | 
			
		||||
		if (ret)
 | 
			
		||||
			return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	memset(&amsdu_aggr_ctrl, 0, sizeof(amsdu_aggr_ctrl));
 | 
			
		||||
	amsdu_aggr_ctrl.enable = true;
 | 
			
		||||
	/* Send request to firmware */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue