Merge "qca-wifi: Smart Antenna WMI support for 11bit ratecode"
diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c
index ce23fce..5a26492 100644
--- a/wmi/src/wmi_unified_non_tlv.c
+++ b/wmi/src/wmi_unified_non_tlv.c
@@ -3230,6 +3230,7 @@
wmi_buf_t buf;
int len = 0;
int ret;
+ uint8_t rs = 0, irs = 0;
len = sizeof(wmi_peer_sant_set_train_antenna_cmd);
buf = wmi_buf_alloc(wmi_handle, len);
@@ -3241,10 +3242,16 @@
cmd = (wmi_peer_sant_set_train_antenna_cmd *)wmi_buf_data(buf);
cmd->vdev_id = param->vdev_id;
WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
- qdf_mem_copy(&cmd->train_rate_series[0], ¶m->rate_array[0],
- (sizeof(uint32_t)*SMART_ANT_MAX_RATE_SERIES));
qdf_mem_copy(&cmd->train_antenna_series[0], ¶m->antenna_array[0],
(sizeof(uint32_t)*SMART_ANT_MAX_RATE_SERIES));
+ for (rs = 0; rs < SMART_ANT_MAX_RATE_SERIES; rs++) {
+ cmd->train_rate_series[rs] =
+ ((param->rate_array[irs] & SA_MASK_BYTE) |
+ ((param->rate_array[irs] & SA_MASK_BYTE3) >> 8) |
+ ((param->rate_array[irs + 1] & SA_MASK_BYTE) << 16) |
+ (param->rate_array[irs + 1] & SA_MASK_BYTE3));
+ irs += 2;
+ }
cmd->num_pkts = param->numpkts;
ret = wmi_unified_cmd_send(wmi_handle,
buf,
diff --git a/wmi/src/wmi_unified_smart_ant_tlv.c b/wmi/src/wmi_unified_smart_ant_tlv.c
index 64b5c3b..cb8dd34 100644
--- a/wmi/src/wmi_unified_smart_ant_tlv.c
+++ b/wmi/src/wmi_unified_smart_ant_tlv.c
@@ -334,7 +334,7 @@
uint8_t *buf_ptr;
int32_t len = 0;
QDF_STATUS ret;
- int loop;
+ uint8_t loop = 0, itr = 0;
len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
len += (WMI_SMART_ANT_MAX_RATE_SERIES) *
@@ -372,7 +372,13 @@
WMITLV_TAG_STRUC_wmi_peer_smart_ant_set_train_antenna_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_peer_smart_ant_set_train_antenna_param));
- train_param->train_rate_series = param->rate_array[loop];
+ train_param->train_rate_series_lo =
+ ((param->rate_array[itr] & SA_MASK_RCODE) |
+ (param->rate_array[itr] & (SA_MASK_RCODE << 16)));
+ train_param->train_rate_series_hi =
+ ((param->rate_array[itr + 1] & SA_MASK_RCODE) |
+ (param->rate_array[itr + 1] & (SA_MASK_RCODE << 16)));
+ itr += 2;
train_param->train_antenna_series = param->antenna_array[loop];
train_param->rc_flags = 0;
WMI_LOGI(FL("Series number:%d\n"), loop);
@@ -509,17 +515,18 @@
htindex = 0;
if (rate_cap->ratecount[0]) {
if (param_buf->num_ratecode_legacy >
- SA_MAX_LEGACY_RATE_DWORDS) {
+ SA_MAX_LEGACY_RATE_WORDS) {
WMI_LOGE("Invalid Number of ratecode_legacy %d",
param_buf->num_ratecode_legacy);
return QDF_STATUS_E_FAILURE;
}
+ ofdm_rate = param_buf->ratecode_legacy;
for (i = 0; i < param_buf->num_ratecode_legacy; i++) {
- ofdm_rate = param_buf->ratecode_legacy;
- for (j = 0; j < SA_BYTES_IN_DWORD; j++) {
+ for (j = 0; j < SA_WORDS_IN_DWORD; j++) {
+ shift = (SA_WORD_BITS_LEN * j);
rate_cap->ratecode_legacy[htindex] =
- ((ofdm_rate->ratecode_legacy >> (8*j)) &
- SA_MASK_BYTE);
+ ((ofdm_rate->ratecode_legacy >> shift) &
+ SA_MASK_RCODE);
htindex++;
}
ofdm_rate++;
@@ -527,21 +534,21 @@
}
htindex = 0;
- if (param_buf->num_ratecode_mcs > SA_MAX_HT_RATE_DWORDS) {
+ if (param_buf->num_ratecode_mcs > SA_MAX_HT_RATE_WORDS) {
WMI_LOGE("Invalid Number of ratecode_mcs %d",
param_buf->num_ratecode_mcs);
return QDF_STATUS_E_FAILURE;
}
+ mcs_rate = param_buf->ratecode_mcs;
for (i = 0; i < param_buf->num_ratecode_mcs; i++) {
- mcs_rate = param_buf->ratecode_mcs;
- for (j = 0; j < SA_BYTES_IN_DWORD; j++) {
- shift = (8*j);
+ for (j = 0; j < SA_WORDS_IN_DWORD; j++) {
+ shift = (SA_WORD_BITS_LEN * j);
rate_cap->ratecode_20[htindex] =
- ((mcs_rate->ratecode_20 >> (shift)) & SA_MASK_BYTE);
+ ((mcs_rate->ratecode_20 >> (shift)) & SA_MASK_RCODE);
rate_cap->ratecode_40[htindex] =
- ((mcs_rate->ratecode_40 >> (shift)) & SA_MASK_BYTE);
+ ((mcs_rate->ratecode_40 >> (shift)) & SA_MASK_RCODE);
rate_cap->ratecode_80[htindex] =
- ((mcs_rate->ratecode_80 >> (shift)) & SA_MASK_BYTE);
+ ((mcs_rate->ratecode_80 >> (shift)) & SA_MASK_RCODE);
htindex++;
}
mcs_rate++;