From 17ba70aefbb9d5a9c3e3dec7327afc18246277f3 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sat, 30 Mar 2019 08:34:14 -0700 Subject: [PATCH] qcacld-3.0: Replace typedef tSirWifiChannelInfo 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 tSirWifiChannelInfo 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: I2c0647cc48d0ed805974dd9ea399ca742aabc17f CRs-Fixed: 2427171 --- core/hdd/src/wlan_hdd_debugfs_llstat.c | 6 +++--- core/hdd/src/wlan_hdd_stats.c | 6 +++--- core/mac/inc/sir_api.h | 24 +++++++++++++----------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c index bca4c4b3db..261de57142 100644 --- a/core/hdd/src/wlan_hdd_debugfs_llstat.c +++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c @@ -281,9 +281,9 @@ void hdd_debugfs_process_radio_stats(struct hdd_adapter *adapter, DEBUGFS_LLSTATS_BUF_SIZE - ll_stats.len, "\nChan width: %u, center_freq: %u, center_freq0: %u, center_freq1: %u, on_time: %u, cca_busy_time: %u", chan_stat->channel.width, - chan_stat->channel.centerFreq, - chan_stat->channel.centerFreq0, - chan_stat->channel.centerFreq1, + chan_stat->channel.center_freq, + chan_stat->channel.center_freq0, + chan_stat->channel.center_freq1, chan_stat->onTime, chan_stat->ccaBusyTime); } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index e44be46064..b6afff52f5 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -813,13 +813,13 @@ static int hdd_llstats_radio_fill_channels(struct hdd_adapter *adapter, channel_stats->channel.width) || nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ, - channel_stats->channel.centerFreq) || + channel_stats->channel.center_freq) || nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ0, - channel_stats->channel.centerFreq0) || + channel_stats->channel.center_freq0) || nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ1, - channel_stats->channel.centerFreq1) || + channel_stats->channel.center_freq1) || nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_ON_TIME, channel_stats->onTime) || diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 997d359cd9..3e1424348e 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3563,17 +3563,19 @@ struct wifi_interface_info { uint8_t countryStr[CFG_COUNTRY_CODE_LEN]; }; -/* channel information */ -typedef struct { - /* channel width (20, 40, 80, 80+80, 160) */ +/** + * struct wifi_channel_info - channel information + * @width: channel width (20, 40, 80, 80+80, 160) + * @center_freq: primary 20 MHz channel + * @center_freq0: center frequency (MHz) first segment + * @center_freq1: center frequency (MHz) second segment + */ +struct wifi_channel_info { enum phy_ch_width width; - /* primary 20 MHz channel */ - uint32_t centerFreq; - /* center frequency (MHz) first segment */ - uint32_t centerFreq0; - /* center frequency (MHz) second segment */ - uint32_t centerFreq1; -} tSirWifiChannelInfo, *tpSirWifiChannelInfo; + uint32_t center_freq; + uint32_t center_freq0; + uint32_t center_freq1; +}; /* wifi rate info */ typedef struct { @@ -3595,7 +3597,7 @@ typedef struct { /* channel statistics */ typedef struct { /* channel */ - tSirWifiChannelInfo channel; + struct wifi_channel_info channel; /* msecs the radio is awake (32 bits number accruing over time) */ uint32_t onTime; /* msecs the CCA register is busy (32 bits number accruing over time) */