qcacld-3.0: DP Component Add bus bandwidth manager API

Add bus bandwidth manager API to DP component

Change-Id: I7e37b2687ec8092c5d437fb4d4bee5b1cda1670c
CRs-Fixed: 3164998
This commit is contained in:
Amit Mehta
2022-03-16 23:54:42 -07:00
committed by Madan Koyyalamudi
parent ed6a29b31c
commit e52153adec
8 changed files with 746 additions and 25 deletions

View File

@@ -28,6 +28,156 @@
#include "wlan_objmgr_global_obj.h"
#include "qdf_status.h"
#include <wlan_nlink_common.h>
#include <qca_vendor.h>
/**
* typedef hdd_cb_handle - HDD Handle
*
* Handle to the HDD. The HDD handle is given to the DP component from the
* HDD during start modules. The HDD handle is an input to all HDD function
* calls and represents an opaque handle to the HDD instance that is
* tied to the DP context
*
* The HDD must be able to derive it's internal instance structure
* pointer through this handle.
*/
/*
* NOTE WELL: struct opaque_hdd_callback_handle is not defined anywhere. This
* reference is used to help ensure that a hdd_cb_handle is never used
* where a different handle type is expected
*/
struct opaque_hdd_callback_handle;
typedef struct opaque_hdd_callback_handle *hdd_cb_handle;
/**
* enum bus_bw_level - bus bandwidth vote levels
*
* @BUS_BW_LEVEL_NONE: No vote for bus bandwidth
* @BUS_BW_LEVEL_1: vote for level-1 bus bandwidth
* @BUS_BW_LEVEL_2: vote for level-2 bus bandwidth
* @BUS_BW_LEVEL_3: vote for level-3 bus bandwidth
* @BUS_BW_LEVEL_4: vote for level-4 bus bandwidth
* @BUS_BW_LEVEL_5: vote for level-5 bus bandwidth
* @BUS_BW_LEVEL_6: vote for level-6 bus bandwidth
* @BUS_BW_LEVEL_7: vote for level-7 bus bandwidth
*/
enum bus_bw_level {
BUS_BW_LEVEL_NONE,
BUS_BW_LEVEL_1,
BUS_BW_LEVEL_2,
BUS_BW_LEVEL_3,
BUS_BW_LEVEL_4,
BUS_BW_LEVEL_5,
BUS_BW_LEVEL_6,
BUS_BW_LEVEL_7,
BUS_BW_LEVEL_8,
BUS_BW_LEVEL_MAX,
};
#define BUS_BW_LEVEL_RESUME BUS_BW_LEVEL_3
/**
* enum tput_level - throughput levels
*
* @TPUT_LEVEL_NONE: No throughput
* @TPUT_LEVEL_IDLE: idle throughtput level
* @TPUT_LEVEL_LOW: low throughput level
* @TPUT_LEVEL_MEDIUM: medium throughtput level
* @TPUT_LEVEL_HIGH: high throughput level
* @TPUT_LEVEL_VERY_HIGH: very high throughput level
* @TPUT_LEVEL_ULTRA_HIGH: ultra high throughput level
* @TPUT_LEVEL_SUPER_HIGH: super high throughput level
*/
enum tput_level {
TPUT_LEVEL_NONE,
TPUT_LEVEL_IDLE,
TPUT_LEVEL_LOW,
TPUT_LEVEL_MEDIUM,
TPUT_LEVEL_HIGH,
TPUT_LEVEL_VERY_HIGH,
TPUT_LEVEL_ULTRA_HIGH,
TPUT_LEVEL_SUPER_HIGH,
TPUT_LEVEL_MAX,
};
/**
* enum bbm_non_per_flag - Non persistent policy related flag
*
* @BBM_APPS_RESUME: system resume flag
* @BBM_APPS_SUSPEND: system suspend flag
*/
enum bbm_non_per_flag {
BBM_APPS_RESUME,
BBM_APPS_SUSPEND,
BBM_FLAG_MAX,
};
/**
* enum bbm_policy - BBM policy
*
* @BBM_DRIVER_MODE_POLICY: driver mode policy
* @BBM_TPUT_POLICY: throughput policy
* @BBM_USER_POLICY: user policy
* @BBM_NON_PERSISTENT_POLICY: non persistent policy. For example, bus resume
* sets the bus bw level to LEVEL_3 if any adapter is connected but
* this is only a one time setting and is not persistent. This bus bw level
* is set without taking other policy vote levels into consideration.
* @BBM_SELECT_TABLE_POLICY: policy where bus bw table is selected based on
* the latency level.
*/
enum bbm_policy {
BBM_DRIVER_MODE_POLICY,
BBM_TPUT_POLICY,
BBM_USER_POLICY,
BBM_NON_PERSISTENT_POLICY,
BBM_SELECT_TABLE_POLICY,
BBM_MAX_POLICY,
};
/**
* enum wlm_ll_level - WLM latency levels
*
* @WLM_LL_NORMAL: normal latency level
* @WLM_LL_LOW: low latency level
*/
enum wlm_ll_level {
WLM_LL_NORMAL,
WLM_LL_LOW,
WLM_LL_MAX,
};
/**
* union bbm_policy_info - BBM policy specific info. Only one of the value
* would be valid based on the BBM policy.
*
* @driver_mode: global driver mode. valid for BBM_DRIVER_MODE_POLICY.
* @flag: BBM non persistent flag. valid for BBM_NON_PERSISTENT_POLICY.
* @tput_level: throughput level. valid for BBM_TPUT_POLICY.
* @wlm_level: latency level. valid for BBM_WLM_POLICY.
* @user_level: user bus bandwidth vote. valid for BBM_USER_POLICY.
* @set: set or reset user level. valid for BBM_USER_POLICY.
*/
union bbm_policy_info {
enum QDF_GLOBAL_MODE driver_mode;
enum bbm_non_per_flag flag;
enum tput_level tput_level;
enum wlm_ll_level wlm_level;
struct {
enum bus_bw_level user_level;
bool set;
} usr;
};
/**
* struct bbm_params - BBM params
*
* @policy: BBM policy
* @policy_info: policy related info
*/
struct bbm_params {
enum bbm_policy policy;
union bbm_policy_info policy_info;
};
/**
* wlan_tp_data : union of TCP msg for Tx and Rx Dir
@@ -41,10 +191,32 @@ union wlan_tp_data {
* struct wlan_dp_psoc_callbacks - struct containing callback
* to non-converged driver
* @os_if_dp_gro_rx: OS IF Callback to handle GRO packet to n/w stack
* @callback_ctx : Opaque callback context
* @wlan_dp_sta_get_dot11mode: Callback to get dot11 mode
* @wlan_dp_get_ap_client_count: Callback to get client count connected to AP
* @wlan_dp_sta_ndi_connected: Callback to get NDI connected status
* @dp_any_adapter_connected: Callback to check if any adapter is connected
* @osif_dp_send_tcp_param_update_event: OS IF callback to send TCP param
*/
struct wlan_dp_psoc_callbacks {
void (*os_if_dp_gro_rx)(struct sk_buff *skb, uint8_t napi_to_use,
bool flush_gro);
hdd_cb_handle callback_ctx;
bool
(*wlan_dp_sta_get_dot11mode)(hdd_cb_handle context, uint8_t vdev_id,
enum qca_wlan_802_11_mode *dot11_mode);
bool (*wlan_dp_get_ap_client_count)(hdd_cb_handle context,
uint8_t vdev_id,
uint16_t *client_count);
bool (*wlan_dp_sta_ndi_connected)(hdd_cb_handle context,
uint8_t vdev_id);
bool (*dp_any_adapter_connected)(hdd_cb_handle context);
void
(*osif_dp_send_tcp_param_update_event)(struct wlan_objmgr_psoc *psoc,
union wlan_tp_data *data,
uint8_t dir);
};
/**

View File

@@ -129,4 +129,43 @@ ucfg_dp_update_config(struct wlan_objmgr_psoc *psoc,
uint64_t
ucfg_dp_get_rx_softirq_yield_duration(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_dp_bbm_context_init() - Initialize BBM context
* @psoc: psoc handle
*
* Returns: error code
*/
int ucfg_dp_bbm_context_init(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_dp_bbm_context_deinit() - De-initialize BBM context
* @psoc: psoc handle
*
* Returns: None
*/
void ucfg_dp_bbm_context_deinit(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_dp_bbm_apply_independent_policy() - Apply independent policies
* to set the bus bw level
* @psoc: psoc handle
* @params: BBM policy related params
*
* The function applies BBM related policies and appropriately sets the bus
* bandwidth level.
*
* Returns: None
*/
void ucfg_dp_bbm_apply_independent_policy(struct wlan_objmgr_psoc *psoc,
struct bbm_params *params);
/**
* ucfg_dp_register_hdd_callbacks() - Resiter HDD callbacks with DP component
* @psoc: psoc handle
* @cb_obj: Callback object
*
* Returns: None
*/
void ucfg_dp_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
struct wlan_dp_psoc_callbacks *cb_obj);
#endif