mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
qcacld-3.0: Replace typedef tSirWifiIfaceStat
The Linux Coding Style enumerates a few special cases where typedefs are useful, but stresses "NEVER EVER use a typedef unless you can clearly match one of those rules." The tSirWifiIfaceStat typedef does not meet any of those criteria, so replace it (and the "tp" variant) with a properly named struct. Change-Id: I70f0e8c038d061cb201b52ce07097c68bcb93346 CRs-Fixed: 2428989
This commit is contained in:
parent
d969848189
commit
af5452884b
4 changed files with 37 additions and 30 deletions
|
|
@ -41,7 +41,7 @@ static DEFINE_MUTEX(llstats_mutex);
|
|||
void hdd_debugfs_process_iface_stats(struct hdd_adapter *adapter,
|
||||
void *data, uint32_t num_peers)
|
||||
{
|
||||
tpSirWifiIfaceStat iface_stat;
|
||||
struct wifi_interface_stats *iface_stat;
|
||||
struct wifi_interface_info *iface_info;
|
||||
wmi_iface_link_stats *link_stats;
|
||||
wmi_wmm_ac_stats *ac_stats;
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ static bool put_wifi_interface_info(struct wifi_interface_info *stats,
|
|||
*
|
||||
* Return: bool
|
||||
*/
|
||||
static bool put_wifi_iface_stats(tpSirWifiIfaceStat if_stat,
|
||||
static bool put_wifi_iface_stats(struct wifi_interface_stats *if_stat,
|
||||
u32 num_peers, struct sk_buff *vendor_event)
|
||||
{
|
||||
int i = 0;
|
||||
|
|
@ -716,9 +716,10 @@ static void hdd_link_layer_process_peer_stats(struct hdd_adapter *adapter,
|
|||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter,
|
||||
tpSirWifiIfaceStat if_stat,
|
||||
u32 num_peers)
|
||||
static void
|
||||
hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter,
|
||||
struct wifi_interface_stats *if_stat,
|
||||
u32 num_peers)
|
||||
{
|
||||
struct sk_buff *vendor_event;
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
|
@ -732,7 +733,7 @@ static void hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter,
|
|||
|
||||
/*
|
||||
* Allocate a size of 4096 for the interface stats comprising
|
||||
* sizeof (tpSirWifiIfaceStat).The size of 4096 is considered
|
||||
* sizeof (struct wifi_interface_stats *).The size of 4096 is considered
|
||||
* assuming that all these fit with in the limit.Please take
|
||||
* a call on the limit based on the data requirements on
|
||||
* interface statistics.
|
||||
|
|
@ -1041,14 +1042,13 @@ static void hdd_ll_process_radio_stats(struct hdd_adapter *adapter,
|
|||
* Return: None
|
||||
*/
|
||||
static void hdd_ll_process_iface_stats(struct hdd_adapter *adapter,
|
||||
void *data, uint32_t num_peers, uint32_t resp_id)
|
||||
void *data, uint32_t num_peers,
|
||||
uint32_t resp_id)
|
||||
{
|
||||
if (DEBUGFS_LLSTATS_REQID == resp_id)
|
||||
hdd_debugfs_process_iface_stats(adapter,
|
||||
(tpSirWifiIfaceStat) data, num_peers);
|
||||
hdd_debugfs_process_iface_stats(adapter, data, num_peers);
|
||||
else
|
||||
hdd_link_layer_process_iface_stats(adapter,
|
||||
(tpSirWifiIfaceStat) data, num_peers);
|
||||
hdd_link_layer_process_iface_stats(adapter, data, num_peers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3696,27 +3696,32 @@ struct wifi_peer_info {
|
|||
struct wifi_rate_stat rate_stats[0];
|
||||
};
|
||||
|
||||
/* Interface statistics - corresponding to 2nd most
|
||||
* LSB in wifi statistics bitmap for getting statistics
|
||||
/**
|
||||
* struct wifi_interface_stats - Interface statistics
|
||||
* @info: struct containing the current state of the interface
|
||||
* @rts_succ_cnt: number of RTS/CTS sequence success
|
||||
* @rts_fail_cnt: number of RTS/CTS sequence failures
|
||||
* @ppdu_succ_cnt: number of PPDUs transmitted
|
||||
* @ppdu_fail_cnt: number of PPDUs that failed to transmit
|
||||
* @link_stats: link-level statistics
|
||||
* @ac_stats: per-Access Category statistics
|
||||
* @num_offload_stats: @offload_stats record count
|
||||
* @offload_stats: per-offload statistics
|
||||
*
|
||||
* Statistics corresponding to 2nd most LSB in wifi statistics bitmap
|
||||
* for getting statistics
|
||||
*/
|
||||
typedef struct {
|
||||
/* current state of the interface */
|
||||
struct wifi_interface_stats {
|
||||
struct wifi_interface_info info;
|
||||
|
||||
uint32_t rts_succ_cnt;
|
||||
uint32_t rts_fail_cnt;
|
||||
uint32_t ppdu_succ_cnt;
|
||||
uint32_t ppdu_fail_cnt;
|
||||
|
||||
/* link statistics */
|
||||
wmi_iface_link_stats link_stats;
|
||||
|
||||
/* per ac data packet statistics */
|
||||
wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
|
||||
|
||||
uint32_t num_offload_stats;
|
||||
wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
|
||||
} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wifi_peer_stat - peer statistics
|
||||
|
|
@ -3916,7 +3921,7 @@ struct sir_wifi_ll_ext_wmm_ac_stats {
|
|||
* struct sir_wifi_ll_ext_peer_stats - per peer stats
|
||||
* @peer_id: peer ID
|
||||
* @vdev_id: VDEV ID
|
||||
* mac_address: MAC address
|
||||
* @mac_address: MAC address
|
||||
* @sta_ps_inds: how many times STAs go to sleep
|
||||
* @sta_ps_durs: total sleep time of STAs (units in ms)
|
||||
* @rx_probe_reqs: number of probe requests received
|
||||
|
|
|
|||
|
|
@ -2149,7 +2149,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle,
|
|||
wmi_wmm_ac_stats *ac_stats, *iface_ac_stats;
|
||||
wmi_iface_offload_stats *offload_stats, *iface_offload_stats;
|
||||
tSirLLStatsResults *link_stats_results;
|
||||
tSirWifiIfaceStat *iface_stat;
|
||||
struct wifi_interface_stats *iface_stat;
|
||||
uint32_t count;
|
||||
size_t link_stats_size, ac_stats_size, iface_info_size;
|
||||
size_t link_stats_results_size, offload_stats_size;
|
||||
|
|
@ -2205,7 +2205,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
link_stats_size = sizeof(tSirWifiIfaceStat);
|
||||
link_stats_size = sizeof(struct wifi_interface_stats);
|
||||
iface_info_size = sizeof(struct wifi_interface_info);
|
||||
|
||||
ac_stats_size = sizeof(wmi_wmm_ac_stats);
|
||||
|
|
@ -2213,7 +2213,8 @@ int wma_unified_link_iface_stats_event_handler(void *handle,
|
|||
|
||||
total_ac_size = ac_stats_size * WIFI_AC_MAX;
|
||||
total_offload_size = offload_stats_size * WMI_OFFLOAD_STATS_TYPE_MAX +
|
||||
member_size(tSirWifiIfaceStat, num_offload_stats);
|
||||
member_size(struct wifi_interface_stats,
|
||||
num_offload_stats);
|
||||
|
||||
link_stats_results_size = sizeof(*link_stats_results) + link_stats_size;
|
||||
|
||||
|
|
@ -2230,17 +2231,18 @@ int wma_unified_link_iface_stats_event_handler(void *handle,
|
|||
link_stats_results->peer_event_number = 0;
|
||||
link_stats_results->moreResultToFollow = 0;
|
||||
|
||||
/* results is copied to tSirWifiIfaceStat in upper layer
|
||||
* tSirWifiIfaceStat
|
||||
/* results is copied to struct wifi_interface_stats in upper layer
|
||||
* struct wifi_interface_stats
|
||||
* - struct wifi_interface_info (all fields except roaming is
|
||||
* filled by host in the upper layer)
|
||||
* - various members of tSirWifiIfaceStat (from wmi_iface_link_stats)
|
||||
* - various members of struct wifi_interface_stats (from
|
||||
* wmi_iface_link_stats)
|
||||
* - ACs information (from wmi_wmm_ac_stats)
|
||||
* - num_offload_stats (from fixed param)
|
||||
* - offload stats (from wmi_iface_offload_stats)
|
||||
*/
|
||||
|
||||
iface_stat = (tSirWifiIfaceStat *)link_stats_results->results;
|
||||
iface_stat = (struct wifi_interface_stats *)link_stats_results->results;
|
||||
|
||||
iface_link_stats = &iface_stat->link_stats;
|
||||
*iface_link_stats = *link_stats;
|
||||
|
|
|
|||
Loading…
Reference in a new issue