Commit 1533f976 authored by Siva Rebbagondla's avatar Siva Rebbagondla Committed by Kalle Valo
Browse files

rsi: send new tx command frame wlan9116 features



For 9116 device, we have introduced w9116 features frame, which shall be
send when radio capabilities confirm is received.

Signed-off-by: default avatarSiva Rebbagondla <siva8118@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent f911c861
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
@@ -288,6 +288,14 @@ static void rsi_set_default_parameters(struct rsi_common *common)
	common->obm_ant_sel_val = 2;
	common->beacon_interval = RSI_BEACON_INTERVAL;
	common->dtim_cnt = RSI_DTIM_COUNT;
	common->w9116_features.pll_mode = 0x0;
	common->w9116_features.rf_type = 1;
	common->w9116_features.wireless_mode = 0;
	common->w9116_features.enable_ppe = 0;
	common->w9116_features.afe_type = 1;
	common->w9116_features.dpd = 0;
	common->w9116_features.sifs_tx_enable = 0;
	common->w9116_features.ps_options = 0;
}

void init_bgscan_params(struct rsi_common *common)
@@ -1646,6 +1654,47 @@ int rsi_send_ps_request(struct rsi_hw *adapter, bool enable,
	return rsi_send_internal_mgmt_frame(common, skb);
}

static int rsi_send_w9116_features(struct rsi_common *common)
{
	struct rsi_wlan_9116_features *w9116_features;
	u16 frame_len = sizeof(struct rsi_wlan_9116_features);
	struct sk_buff *skb;

	rsi_dbg(MGMT_TX_ZONE,
		"%s: Sending wlan 9116 features\n", __func__);

	skb = dev_alloc_skb(frame_len);
	if (!skb)
		return -ENOMEM;
	memset(skb->data, 0, frame_len);

	w9116_features = (struct rsi_wlan_9116_features *)skb->data;

	w9116_features->pll_mode = common->w9116_features.pll_mode;
	w9116_features->rf_type = common->w9116_features.rf_type;
	w9116_features->wireless_mode = common->w9116_features.wireless_mode;
	w9116_features->enable_ppe = common->w9116_features.enable_ppe;
	w9116_features->afe_type = common->w9116_features.afe_type;
	if (common->w9116_features.dpd)
		w9116_features->feature_enable |= cpu_to_le32(RSI_DPD);
	if (common->w9116_features.sifs_tx_enable)
		w9116_features->feature_enable |=
			cpu_to_le32(RSI_SIFS_TX_ENABLE);
	if (common->w9116_features.ps_options & RSI_DUTY_CYCLING)
		w9116_features->feature_enable |= cpu_to_le32(RSI_DUTY_CYCLING);
	if (common->w9116_features.ps_options & RSI_END_OF_FRAME)
		w9116_features->feature_enable |= cpu_to_le32(RSI_END_OF_FRAME);
	w9116_features->feature_enable |=
		cpu_to_le32((common->w9116_features.ps_options & ~0x3) << 2);

	rsi_set_len_qno(&w9116_features->desc.desc_dword0.len_qno,
			frame_len - FRAME_DESC_SZ, RSI_WIFI_MGMT_Q);
	w9116_features->desc.desc_dword0.frame_type = FEATURES_ENABLE;
	skb_put(skb, frame_len);

	return rsi_send_internal_mgmt_frame(common, skb);
}

/**
 * rsi_set_antenna() - This function send antenna configuration request
 *		       to device
@@ -1964,6 +2013,12 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
	case RADIO_CAPABILITIES:
		if (common->fsm_state == FSM_RADIO_CAPS_SENT) {
			common->rf_reset = 1;
			if (adapter->device_model == RSI_DEV_9116 &&
			    rsi_send_w9116_features(common)) {
				rsi_dbg(ERR_ZONE,
					"Failed to send 9116 features\n");
				goto out;
			}
			if (rsi_program_bb_rf(common)) {
				goto out;
			} else {
+12 −0
Original line number Diff line number Diff line
@@ -219,6 +219,17 @@ enum rsi_dfs_regions {
	RSI_REGION_WORLD
};

struct rsi_9116_features {
	u8 pll_mode;
	u8 rf_type;
	u8 wireless_mode;
	u8 afe_type;
	u8 enable_ppe;
	u8 dpd;
	u32 sifs_tx_enable;
	u32 ps_options;
};

struct rsi_common {
	struct rsi_hw *priv;
	struct vif_priv vif_info[RSI_MAX_VIFS];
@@ -314,6 +325,7 @@ struct rsi_common {

	struct cfg80211_scan_request *hwscan;
	struct rsi_bgscan_params bgscan;
	struct rsi_9116_features w9116_features;
	u8 bgscan_en;
	u8 mac_ops_resumed;
};
+17 −0
Original line number Diff line number Diff line
@@ -294,6 +294,7 @@ enum cmd_frame_type {
	COMMON_DEV_CONFIG = 0x28,
	RADIO_PARAMS_UPDATE = 0x29,
	WOWLAN_CONFIG_PARAMS = 0x2B,
	FEATURES_ENABLE = 0x33,
	WOWLAN_WAKEUP_REASON = 0xc5
};

@@ -663,6 +664,22 @@ struct rsi_bgscan_probe {
	__le16 probe_req_length;
} __packed;

#define RSI_DUTY_CYCLING	BIT(0)
#define RSI_END_OF_FRAME	BIT(1)
#define RSI_SIFS_TX_ENABLE	BIT(2)
#define RSI_DPD			BIT(3)
struct rsi_wlan_9116_features {
	struct rsi_cmd_desc desc;
	u8 pll_mode;
	u8 rf_type;
	u8 wireless_mode;
	u8 enable_ppe;
	u8 afe_type;
	u8 reserved1;
	__le16 reserved2;
	__le32 feature_enable;
};

static inline u32 rsi_get_queueno(u8 *addr, u16 offset)
{
	return (le16_to_cpu(*(__le16 *)&addr[offset]) & 0x7000) >> 12;