qcacld-3.0: Replace typedef tSirWifiRateStat
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 tSirWifiRateStat typedef does not meet any of those criteria, so replace it (and the "tp" variant) with a properly named struct. In addition the Linux Coding Style frowns upon mixed-case names so rename the members which are currently not compliant. Change-Id: Iff54772fda084fee932f6669ab937e136ab2cf66 CRs-Fixed: 2427166
This commit is contained in:
parent
8fec61d333
commit
d3b3b11104
@ -156,7 +156,7 @@ void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter, void *data)
|
|||||||
{
|
{
|
||||||
tpSirWifiPeerStat peer_stat;
|
tpSirWifiPeerStat peer_stat;
|
||||||
tpSirWifiPeerInfo peer_info;
|
tpSirWifiPeerInfo peer_info;
|
||||||
tpSirWifiRateStat rate_stat;
|
struct wifi_rate_stat *rate_stat;
|
||||||
int i, j, num_rate;
|
int i, j, num_rate;
|
||||||
ssize_t len = 0;
|
ssize_t len = 0;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
@ -191,9 +191,7 @@ void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter, void *data)
|
|||||||
|
|
||||||
num_rate = peer_info->numRate;
|
num_rate = peer_info->numRate;
|
||||||
for (j = 0; j < num_rate; j++) {
|
for (j = 0; j < num_rate; j++) {
|
||||||
rate_stat = (tpSirWifiRateStat) ((uint8_t *)
|
rate_stat = &peer_info->rateStats[j];
|
||||||
peer_info->rateStats + (j *
|
|
||||||
sizeof(tSirWifiRateStat)));
|
|
||||||
buffer += len;
|
buffer += len;
|
||||||
ll_stats.len += len;
|
ll_stats.len += len;
|
||||||
len = scnprintf(buffer,
|
len = scnprintf(buffer,
|
||||||
@ -201,15 +199,15 @@ void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter, void *data)
|
|||||||
"\npreamble: %0x, nss: %0x, bw: %0x, mcs: %0x, bitrate: %0x, txmpdu: %u, rxmpdu: %u, mpdu_lost: %u, retries: %u, retries_short: %u, retries_long: %u",
|
"\npreamble: %0x, nss: %0x, bw: %0x, mcs: %0x, bitrate: %0x, txmpdu: %u, rxmpdu: %u, mpdu_lost: %u, retries: %u, retries_short: %u, retries_long: %u",
|
||||||
rate_stat->rate.preamble, rate_stat->rate.nss,
|
rate_stat->rate.preamble, rate_stat->rate.nss,
|
||||||
rate_stat->rate.bw, rate_stat->rate.rateMcsIdx,
|
rate_stat->rate.bw, rate_stat->rate.rateMcsIdx,
|
||||||
rate_stat->rate.bitrate, rate_stat->txMpdu,
|
rate_stat->rate.bitrate, rate_stat->tx_mpdu,
|
||||||
rate_stat->rxMpdu, rate_stat->mpduLost,
|
rate_stat->rx_mpdu, rate_stat->mpdu_lost,
|
||||||
rate_stat->retries, rate_stat->retriesShort,
|
rate_stat->retries, rate_stat->retries_short,
|
||||||
rate_stat->retriesLong);
|
rate_stat->retries_long);
|
||||||
}
|
}
|
||||||
peer_info = (tpSirWifiPeerInfo) ((uint8_t *)
|
peer_info = (tpSirWifiPeerInfo) ((uint8_t *)
|
||||||
peer_stat->peerInfo + (i *
|
peer_stat->peerInfo + (i *
|
||||||
sizeof(tSirWifiPeerInfo)) +
|
sizeof(tSirWifiPeerInfo)) +
|
||||||
(num_rate * sizeof(tSirWifiRateStat)));
|
(num_rate * sizeof(struct wifi_rate_stat)));
|
||||||
}
|
}
|
||||||
ll_stats.len += len;
|
ll_stats.len += len;
|
||||||
mutex_unlock(&llstats_mutex);
|
mutex_unlock(&llstats_mutex);
|
||||||
|
@ -193,7 +193,7 @@ struct hdd_ll_stats_priv {
|
|||||||
*
|
*
|
||||||
* Return: bool
|
* Return: bool
|
||||||
*/
|
*/
|
||||||
static bool put_wifi_rate_stat(tpSirWifiRateStat stats,
|
static bool put_wifi_rate_stat(struct wifi_rate_stat *stats,
|
||||||
struct sk_buff *vendor_event)
|
struct sk_buff *vendor_event)
|
||||||
{
|
{
|
||||||
if (nla_put_u8(vendor_event,
|
if (nla_put_u8(vendor_event,
|
||||||
@ -213,22 +213,22 @@ static bool put_wifi_rate_stat(tpSirWifiRateStat stats,
|
|||||||
stats->rate.bitrate) ||
|
stats->rate.bitrate) ||
|
||||||
nla_put_u32(vendor_event,
|
nla_put_u32(vendor_event,
|
||||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_TX_MPDU,
|
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_TX_MPDU,
|
||||||
stats->txMpdu) ||
|
stats->tx_mpdu) ||
|
||||||
nla_put_u32(vendor_event,
|
nla_put_u32(vendor_event,
|
||||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RX_MPDU,
|
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RX_MPDU,
|
||||||
stats->rxMpdu) ||
|
stats->rx_mpdu) ||
|
||||||
nla_put_u32(vendor_event,
|
nla_put_u32(vendor_event,
|
||||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MPDU_LOST,
|
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MPDU_LOST,
|
||||||
stats->mpduLost) ||
|
stats->mpdu_lost) ||
|
||||||
nla_put_u32(vendor_event,
|
nla_put_u32(vendor_event,
|
||||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES,
|
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES,
|
||||||
stats->retries) ||
|
stats->retries) ||
|
||||||
nla_put_u32(vendor_event,
|
nla_put_u32(vendor_event,
|
||||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_SHORT,
|
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_SHORT,
|
||||||
stats->retriesShort) ||
|
stats->retries_short) ||
|
||||||
nla_put_u32(vendor_event,
|
nla_put_u32(vendor_event,
|
||||||
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_LONG,
|
QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_LONG,
|
||||||
stats->retriesLong)) {
|
stats->retries_long)) {
|
||||||
hdd_err("QCA_WLAN_VENDOR_ATTR put fail");
|
hdd_err("QCA_WLAN_VENDOR_ATTR put fail");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ static bool put_wifi_peer_rates(tpSirWifiPeerInfo stats,
|
|||||||
struct sk_buff *vendor_event)
|
struct sk_buff *vendor_event)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
tpSirWifiRateStat rate_stat;
|
struct wifi_rate_stat *rate_stat;
|
||||||
int nest_id;
|
int nest_id;
|
||||||
struct nlattr *info;
|
struct nlattr *info;
|
||||||
struct nlattr *rates;
|
struct nlattr *rates;
|
||||||
@ -640,10 +640,10 @@ static void hdd_link_layer_process_peer_stats(struct hdd_adapter *adapter,
|
|||||||
/*
|
/*
|
||||||
* Allocate a size of 4096 for the peer stats comprising
|
* Allocate a size of 4096 for the peer stats comprising
|
||||||
* each of size = sizeof (tSirWifiPeerInfo) + numRate *
|
* each of size = sizeof (tSirWifiPeerInfo) + numRate *
|
||||||
* sizeof (tSirWifiRateStat).Each field is put with an
|
* sizeof (struct wifi_rate_stat).Each field is put with an
|
||||||
* NL attribute.The size of 4096 is considered assuming
|
* NL attribute.The size of 4096 is considered assuming
|
||||||
* that number of rates shall not exceed beyond 50 with
|
* that number of rates shall not exceed beyond 50 with
|
||||||
* the sizeof (tSirWifiRateStat) being 32.
|
* the sizeof (struct wifi_rate_stat) being 32.
|
||||||
*/
|
*/
|
||||||
vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy,
|
vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy,
|
||||||
LL_STATS_EVENT_BUF_SIZE);
|
LL_STATS_EVENT_BUF_SIZE);
|
||||||
@ -698,16 +698,10 @@ static void hdd_link_layer_process_peer_stats(struct hdd_adapter *adapter,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
peer_info = (tpSirWifiPeerInfo) ((uint8_t *)
|
peer_info = (tpSirWifiPeerInfo)
|
||||||
peer_stat->
|
((uint8_t *)peer_stat->peerInfo +
|
||||||
peerInfo +
|
(i * sizeof(tSirWifiPeerInfo)) +
|
||||||
(i *
|
(numRate * sizeof(struct wifi_rate_stat)));
|
||||||
sizeof
|
|
||||||
(tSirWifiPeerInfo))
|
|
||||||
+
|
|
||||||
(numRate *
|
|
||||||
sizeof
|
|
||||||
(tSirWifiRateStat)));
|
|
||||||
nla_nest_end(vendor_event, peers);
|
nla_nest_end(vendor_event, peers);
|
||||||
}
|
}
|
||||||
nla_nest_end(vendor_event, peerInfo);
|
nla_nest_end(vendor_event, peerInfo);
|
||||||
|
@ -3671,23 +3671,25 @@ typedef struct {
|
|||||||
tSirWifiChannelStats *channels;
|
tSirWifiChannelStats *channels;
|
||||||
} tSirWifiRadioStat, *tpSirWifiRadioStat;
|
} tSirWifiRadioStat, *tpSirWifiRadioStat;
|
||||||
|
|
||||||
/* per rate statistics */
|
/**
|
||||||
typedef struct {
|
* struct wifi_rate_stat - per rate statistics
|
||||||
/* rate information */
|
* @rate: rate information
|
||||||
|
* @tx_mpdu: number of successfully transmitted data pkts (ACK rcvd)
|
||||||
|
* @rx_mpdu: number of received data pkts
|
||||||
|
* @mpdu_lost: number of data packet losses (no ACK)
|
||||||
|
* @retries: total number of data pkt retries *
|
||||||
|
* @retries_short: number of short data pkt retries
|
||||||
|
* @retries_long: number of long data pkt retries
|
||||||
|
*/
|
||||||
|
struct wifi_rate_stat {
|
||||||
tSirWifiRate rate;
|
tSirWifiRate rate;
|
||||||
/* number of successfully transmitted data pkts (ACK rcvd) */
|
uint32_t tx_mpdu;
|
||||||
uint32_t txMpdu;
|
uint32_t rx_mpdu;
|
||||||
/* number of received data pkts */
|
uint32_t mpdu_lost;
|
||||||
uint32_t rxMpdu;
|
|
||||||
/* number of data packet losses (no ACK) */
|
|
||||||
uint32_t mpduLost;
|
|
||||||
/* total number of data pkt retries * */
|
|
||||||
uint32_t retries;
|
uint32_t retries;
|
||||||
/* number of short data pkt retries */
|
uint32_t retries_short;
|
||||||
uint32_t retriesShort;
|
uint32_t retries_long;
|
||||||
/* number of long data pkt retries */
|
};
|
||||||
uint32_t retriesLong;
|
|
||||||
} tSirWifiRateStat, *tpSirWifiRateStat;
|
|
||||||
|
|
||||||
/* wifi peer type */
|
/* wifi peer type */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -3715,7 +3717,7 @@ typedef struct {
|
|||||||
uint32_t numRate;
|
uint32_t numRate;
|
||||||
};
|
};
|
||||||
/* per rate statistics, number of entries = num_rate */
|
/* per rate statistics, number of entries = num_rate */
|
||||||
tSirWifiRateStat rateStats[0];
|
struct wifi_rate_stat rateStats[0];
|
||||||
} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
|
} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
|
||||||
|
|
||||||
/* Interface statistics - corresponding to 2nd most
|
/* Interface statistics - corresponding to 2nd most
|
||||||
|
@ -1394,7 +1394,7 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
|
|||||||
|
|
||||||
peer_stats_size = sizeof(tSirWifiPeerStat);
|
peer_stats_size = sizeof(tSirWifiPeerStat);
|
||||||
peer_info_size = sizeof(tSirWifiPeerInfo);
|
peer_info_size = sizeof(tSirWifiPeerInfo);
|
||||||
rate_stats_size = sizeof(tSirWifiRateStat);
|
rate_stats_size = sizeof(struct wifi_rate_stat);
|
||||||
link_stats_results_size =
|
link_stats_results_size =
|
||||||
sizeof(*link_stats_results) + peer_stats_size +
|
sizeof(*link_stats_results) + peer_stats_size +
|
||||||
(fixed_param->num_peers * peer_info_size) +
|
(fixed_param->num_peers * peer_info_size) +
|
||||||
|
Loading…
Reference in New Issue
Block a user