qcacld-3.0: Set Wi-Fi configurations - TX AMSDU, RX AMSDU
Add attributes in SET(GET)_WIFI_CONFIGURATION to dynamically configure capabilities - TX AMSDU, RX AMSDU. Change-Id: I17d3c5d32987e638805cdaf5fe48ba3036b3ff22 CRs-Fixed: 2687303
This commit is contained in:
@@ -6710,6 +6710,8 @@ const struct nla_policy wlan_hdd_wifi_config_policy[
|
||||
.type = NLA_BINARY,
|
||||
.len = SIR_MAC_MAX_ADD_IE_LENGTH + 2},
|
||||
[QCA_WLAN_VENDOR_ATTR_CONFIG_ROAM_REASON] = {.type = NLA_U8 },
|
||||
[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MSDU_AGGREGATION] = {.type = NLA_U8 },
|
||||
[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MSDU_AGGREGATION] = {.type = NLA_U8 },
|
||||
|
||||
};
|
||||
|
||||
@@ -7189,6 +7191,45 @@ static int hdd_config_mpdu_aggregation(struct hdd_adapter *adapter,
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
static int hdd_config_msdu_aggregation(struct hdd_adapter *adapter,
|
||||
struct nlattr *tb[])
|
||||
{
|
||||
struct nlattr *tx_attr =
|
||||
tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MSDU_AGGREGATION];
|
||||
struct nlattr *rx_attr =
|
||||
tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MSDU_AGGREGATION];
|
||||
uint8_t tx_size, rx_size;
|
||||
QDF_STATUS status;
|
||||
|
||||
/* nothing to do if neither attribute is present */
|
||||
if (!tx_attr && !rx_attr)
|
||||
return 0;
|
||||
|
||||
/* if one is present, both must be present */
|
||||
if (!tx_attr || !rx_attr) {
|
||||
hdd_err("Missing attribute for %s",
|
||||
tx_attr ? "RX" : "TX");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tx_size = nla_get_u8(tx_attr);
|
||||
rx_size = nla_get_u8(rx_attr);
|
||||
if (!cfg_in_range(CFG_TX_AGGREGATION_SIZE, tx_size) ||
|
||||
!cfg_in_range(CFG_RX_AGGREGATION_SIZE, rx_size)) {
|
||||
hdd_err("TX %d RX %d MSDU aggr size not in range",
|
||||
tx_size, rx_size);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wma_set_tx_rx_aggr_size(adapter->vdev_id,
|
||||
tx_size,
|
||||
rx_size,
|
||||
WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU);
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
static int hdd_config_ant_div_period(struct hdd_adapter *adapter,
|
||||
struct nlattr *tb[])
|
||||
{
|
||||
@@ -8132,6 +8173,126 @@ static int hdd_get_roam_reason_vsie_status(struct hdd_adapter *adapter,
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* hdd_get_tx_ampdu() - Get TX AMPDU
|
||||
* @adapter: Pointer to HDD adapter
|
||||
* @skb: sk buffer to hold nl80211 attributes
|
||||
* @attr: Pointer to struct nlattr
|
||||
*
|
||||
* Return: 0 on success; error number otherwise
|
||||
*/
|
||||
static int hdd_get_tx_ampdu(struct hdd_adapter *adapter,
|
||||
struct sk_buff *skb,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
int value;
|
||||
|
||||
value = wma_cli_get_command(adapter->vdev_id, GEN_VDEV_PARAM_TX_AMPDU,
|
||||
GEN_CMD);
|
||||
if (value < 0) {
|
||||
hdd_err("Failed to get tx_ampdu");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION,
|
||||
(uint8_t)value)) {
|
||||
hdd_err("nla_put failure");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_get_rx_ampdu() - Get RX AMPDU
|
||||
* @adapter: Pointer to HDD adapter
|
||||
* @skb: sk buffer to hold nl80211 attributes
|
||||
* @attr: Pointer to struct nlattr
|
||||
*
|
||||
* Return: 0 on success; error number otherwise
|
||||
*/
|
||||
static int hdd_get_rx_ampdu(struct hdd_adapter *adapter,
|
||||
struct sk_buff *skb,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
int value;
|
||||
|
||||
value = wma_cli_get_command(adapter->vdev_id, GEN_VDEV_PARAM_RX_AMPDU,
|
||||
GEN_CMD);
|
||||
if (value < 0) {
|
||||
hdd_err("Failed to get rx_ampdu");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION,
|
||||
(uint8_t)value)) {
|
||||
hdd_err("nla_put failure");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_get_tx_amsdu() - Get TX AMSDU
|
||||
* @adapter: Pointer to HDD adapter
|
||||
* @skb: sk buffer to hold nl80211 attributes
|
||||
* @attr: Pointer to struct nlattr
|
||||
*
|
||||
* Return: 0 on success; error number otherwise
|
||||
*/
|
||||
static int hdd_get_tx_amsdu(struct hdd_adapter *adapter,
|
||||
struct sk_buff *skb,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
int value;
|
||||
|
||||
value = wma_cli_get_command(adapter->vdev_id, GEN_VDEV_PARAM_TX_AMSDU,
|
||||
GEN_CMD);
|
||||
if (value < 0) {
|
||||
hdd_err("Failed to get tx_amsdu");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MSDU_AGGREGATION,
|
||||
(uint8_t)value)) {
|
||||
hdd_err("nla_put failure");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_get_rx_amsdu() - Get RX AMSDU
|
||||
* @adapter: Pointer to HDD adapter
|
||||
* @skb: sk buffer to hold nl80211 attributes
|
||||
* @attr: Pointer to struct nlattr
|
||||
*
|
||||
* Return: 0 on success; error number otherwise
|
||||
*/
|
||||
static int hdd_get_rx_amsdu(struct hdd_adapter *adapter,
|
||||
struct sk_buff *skb,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
int value;
|
||||
|
||||
value = wma_cli_get_command(adapter->vdev_id, GEN_VDEV_PARAM_RX_AMSDU,
|
||||
GEN_CMD);
|
||||
if (value < 0) {
|
||||
hdd_err("Failed to get rx_amsdu");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MSDU_AGGREGATION,
|
||||
(uint8_t)value)) {
|
||||
hdd_err("nla_put failure");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* typedef config_getter_fn - get configuration handler
|
||||
* @adapter: The adapter being configured
|
||||
@@ -8167,6 +8328,18 @@ static const struct config_getters config_getters[] = {
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_ROAM_REASON,
|
||||
sizeof(uint8_t),
|
||||
hdd_get_roam_reason_vsie_status},
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION,
|
||||
sizeof(uint8_t),
|
||||
hdd_get_tx_ampdu},
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION,
|
||||
sizeof(uint8_t),
|
||||
hdd_get_rx_ampdu},
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MSDU_AGGREGATION,
|
||||
sizeof(uint8_t),
|
||||
hdd_get_tx_amsdu},
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MSDU_AGGREGATION,
|
||||
sizeof(uint8_t),
|
||||
hdd_get_rx_amsdu},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -8287,6 +8460,7 @@ static const interdependent_setter_fn interdependent_setters[] = {
|
||||
hdd_config_ant_div_snr_weight,
|
||||
wlan_hdd_cfg80211_wifi_set_reorder_timeout,
|
||||
wlan_hdd_cfg80211_wifi_set_rx_blocksize,
|
||||
hdd_config_msdu_aggregation,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -585,6 +585,10 @@ typedef struct {
|
||||
* @gtx_info: GTX offload info
|
||||
* @dcm: DCM enable/disable
|
||||
* @range_ext: HE range extension enable/disable
|
||||
* @tx_ampdu: tx ampdu size
|
||||
* @rx_ampdu: rx ampdu size
|
||||
* @tx_amsdu: tx amsdu size
|
||||
* @rx_amsdu: rx amsdu size
|
||||
*
|
||||
* This structure stores vdev parameters.
|
||||
* Some of these parameters are set in fw and some
|
||||
@@ -615,6 +619,10 @@ typedef struct {
|
||||
uint8_t dcm;
|
||||
uint8_t range_ext;
|
||||
#endif
|
||||
uint32_t tx_ampdu;
|
||||
uint32_t rx_ampdu;
|
||||
uint32_t tx_amsdu;
|
||||
uint32_t rx_amsdu;
|
||||
} vdev_cli_config_t;
|
||||
|
||||
/**
|
||||
|
@@ -46,6 +46,10 @@ typedef void *WMA_HANDLE;
|
||||
* @GEN_PARAM_CAPTURE_TSF: read tsf
|
||||
* @GEN_PARAM_RESET_TSF_GPIO: reset tsf gpio
|
||||
* @GEN_VDEV_ROAM_SYNCH_DELAY: roam sync delay
|
||||
* @GEN_VDEV_PARAM_TX_AMPDU: Set tx ampdu size
|
||||
* @GEN_VDEV_PARAM_RX_AMPDU: Set rx ampdu size
|
||||
* @GEN_VDEV_PARAM_TX_AMSDU: Set tx amsdu size
|
||||
* @GEN_VDEV_PARAM_RX_AMSDU: Set rx amsdu size
|
||||
*/
|
||||
enum GEN_PARAM {
|
||||
GEN_VDEV_PARAM_AMPDU = 0x1,
|
||||
@@ -54,6 +58,10 @@ enum GEN_PARAM {
|
||||
GEN_PARAM_CAPTURE_TSF,
|
||||
GEN_PARAM_RESET_TSF_GPIO,
|
||||
GEN_VDEV_ROAM_SYNCH_DELAY,
|
||||
GEN_VDEV_PARAM_TX_AMPDU,
|
||||
GEN_VDEV_PARAM_RX_AMPDU,
|
||||
GEN_VDEV_PARAM_TX_AMSDU,
|
||||
GEN_VDEV_PARAM_RX_AMSDU,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -4003,6 +4003,7 @@ QDF_STATUS wma_set_tx_rx_aggr_size(uint8_t vdev_id,
|
||||
wmi_vdev_custom_aggr_type_t aggr_type)
|
||||
{
|
||||
tp_wma_handle wma_handle;
|
||||
struct wma_txrx_node *intr;
|
||||
wmi_vdev_set_custom_aggr_size_cmd_fixed_param *cmd;
|
||||
int32_t len;
|
||||
wmi_buf_t buf;
|
||||
@@ -4011,12 +4012,25 @@ QDF_STATUS wma_set_tx_rx_aggr_size(uint8_t vdev_id,
|
||||
|
||||
wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
|
||||
|
||||
|
||||
if (!wma_handle) {
|
||||
WMA_LOGE("%s: WMA context is invald!", __func__);
|
||||
WMA_LOGE("%s: WMA context is invalid!", __func__);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
intr = wma_handle->interfaces;
|
||||
if (!intr) {
|
||||
WMA_LOGE("%s: WMA interface is invalid!", __func__);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (aggr_type == WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU) {
|
||||
intr[vdev_id].config.tx_ampdu = tx_size;
|
||||
intr[vdev_id].config.rx_ampdu = rx_size;
|
||||
} else {
|
||||
intr[vdev_id].config.tx_amsdu = tx_size;
|
||||
intr[vdev_id].config.rx_amsdu = rx_size;
|
||||
}
|
||||
|
||||
len = sizeof(*cmd);
|
||||
buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
|
||||
if (!buf)
|
||||
|
@@ -485,6 +485,18 @@ int wma_cli_get_command(int vdev_id, int param_id, int vpdev)
|
||||
case GEN_VDEV_ROAM_SYNCH_DELAY:
|
||||
ret = intr[vdev_id].roam_synch_delay;
|
||||
break;
|
||||
case GEN_VDEV_PARAM_TX_AMPDU:
|
||||
ret = intr[vdev_id].config.tx_ampdu;
|
||||
break;
|
||||
case GEN_VDEV_PARAM_RX_AMPDU:
|
||||
ret = intr[vdev_id].config.rx_ampdu;
|
||||
break;
|
||||
case GEN_VDEV_PARAM_TX_AMSDU:
|
||||
ret = intr[vdev_id].config.tx_amsdu;
|
||||
break;
|
||||
case GEN_VDEV_PARAM_RX_AMSDU:
|
||||
ret = intr[vdev_id].config.rx_amsdu;
|
||||
break;
|
||||
default:
|
||||
WMA_LOGE("Invalid generic vdev command/Not yet implemented 0x%x",
|
||||
param_id);
|
||||
|
Reference in New Issue
Block a user