mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
qcacld-3.0: Add chload param in LL radio stats event
chload is to indicate channel load condition and it is added in LL radio stats vendor event. Change-Id: I9371bf69f69ed62cc9dc97b6b2903e631b748ed4 CRs-Fixed: 2990982
This commit is contained in:
parent
8d7ac7ecf0
commit
e3bfec065b
1 changed files with 34 additions and 0 deletions
|
|
@ -931,6 +931,33 @@ hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter,
|
|||
cfg80211_vendor_cmd_reply(vendor_event);
|
||||
}
|
||||
|
||||
/**
|
||||
* put_channel_stats_chload - put chload of channel stats
|
||||
* @vendor_event: vendor event
|
||||
* @channel_stats: Pointer to channel stats
|
||||
*
|
||||
* Return: bool
|
||||
*/
|
||||
static bool put_channel_stats_chload(struct sk_buff *vendor_event,
|
||||
struct wifi_channel_stats *channel_stats)
|
||||
{
|
||||
uint64_t txrx_time;
|
||||
uint32_t chload;
|
||||
|
||||
if (!channel_stats->on_time)
|
||||
return true;
|
||||
|
||||
txrx_time = (channel_stats->tx_time + channel_stats->rx_time) * 100;
|
||||
chload = qdf_do_div(txrx_time, channel_stats->on_time);
|
||||
|
||||
if (nla_put_u8(vendor_event,
|
||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_LOAD_PERCENTAGE,
|
||||
chload))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_llstats_radio_fill_channels() - radio stats fill channels
|
||||
* @adapter: Pointer to device adapter
|
||||
|
|
@ -1005,6 +1032,13 @@ static int hdd_llstats_radio_fill_channels(struct hdd_adapter *adapter,
|
|||
radiostat->num_channels, i);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!put_channel_stats_chload(vendor_event,
|
||||
channel_stats)) {
|
||||
hdd_err("nla_put failed for chload (%u, %d)",
|
||||
radiostat->num_channels, i);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
nla_nest_end(vendor_event, chinfo);
|
||||
|
|
|
|||
Loading…
Reference in a new issue