|
@@ -13321,6 +13321,58 @@ static int hdd_get_optimized_power_config(struct wlan_hdd_link_info *link_info,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * hdd_get_sta_keepalive_interval() - Get keep alive interval
|
|
|
+ * @link_info: Link info pointer in 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_sta_keepalive_interval(struct wlan_hdd_link_info *link_info,
|
|
|
+ struct sk_buff *skb,
|
|
|
+ const struct nlattr *attr)
|
|
|
+{
|
|
|
+ struct hdd_adapter *adapter = link_info->adapter;
|
|
|
+ struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ enum QDF_OPMODE device_mode = adapter->device_mode;
|
|
|
+ uint32_t keep_alive_interval;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+
|
|
|
+ if (device_mode != QDF_STA_MODE) {
|
|
|
+ hdd_debug("This command is not supported for %s device mode",
|
|
|
+ device_mode_to_string(device_mode));
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!hdd_is_vdev_in_conn_state(link_info)) {
|
|
|
+ if (adapter->keep_alive_interval)
|
|
|
+ keep_alive_interval = adapter->keep_alive_interval;
|
|
|
+ else
|
|
|
+ ucfg_mlme_get_sta_keep_alive_period(
|
|
|
+ hdd_ctx->psoc,
|
|
|
+ &keep_alive_interval);
|
|
|
+ } else {
|
|
|
+ vdev = hdd_objmgr_get_vdev_by_user(link_info, WLAN_OSIF_CM_ID);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ keep_alive_interval = ucfg_mlme_get_keepalive_period(vdev);
|
|
|
+ hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_CM_ID);
|
|
|
+ }
|
|
|
+
|
|
|
+ hdd_debug("STA KEEPALIVE interval = %d", keep_alive_interval);
|
|
|
+ if (nla_put_u16(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_KEEP_ALIVE_INTERVAL,
|
|
|
+ keep_alive_interval)) {
|
|
|
+ hdd_err("nla_put failure");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* typedef config_getter_fn - get configuration handler
|
|
|
* @link_info: Link info pointer in HDD adapter
|
|
@@ -13408,6 +13460,9 @@ static const struct config_getters config_getters[] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_CONFIG_MLO_LINKS,
|
|
|
WLAN_MAX_ML_BSS_LINKS * sizeof(uint8_t) * 2,
|
|
|
hdd_get_mlo_max_band_info},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_CONFIG_KEEP_ALIVE_INTERVAL,
|
|
|
+ sizeof(uint16_t),
|
|
|
+ hdd_get_sta_keepalive_interval},
|
|
|
};
|
|
|
|
|
|
/**
|