qcacld-3.0: Replace typedef tSirSupportedRates

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 tSirSupportedRates typedef does
not meet any of those criteria, so replace it (and the "tp" variant)
with a reference to the underlying struct.

Further note the Linux Coding Style frowns upon mixed-case names
and so-called Hungarian notation, so in conjunction rename the
underlying struct to be in compliance.

Change-Id: I5007379a50223b6de85830e7ae389e65cdb8e4d3
CRs-Fixed: 2392398
Bu işleme şunda yer alıyor:
Jeff Johnson
2019-02-01 19:36:34 -08:00
işlemeyi yapan: nshrivas
ebeveyn a961081111
işleme ecd4f21b4a
10 değiştirilmiş dosya ile 127 ekleme ve 112 silme

Dosyayı Görüntüle

@@ -292,9 +292,10 @@ struct rrm_config_param {
};
/*
* although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
* bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
* correct basic rates for setting response rates.
* although in struct supported_rates each IE is 16bit but PE only
* passes IEs in 8 bits with MSB=1 for basic rates. change the mask
* for bit0-7 only so HAL gets correct basic rates for setting
* response rates.
*/
#define IERATE_BASICRATE_MASK 0x80
#define IERATE_RATE_MASK 0x7f
@@ -302,7 +303,7 @@ struct rrm_config_param {
const char *lim_bss_type_to_string(const uint16_t bss_type);
/**
* struct sSirSupportedRates - stores rates/MCS supported
* struct supported_rates - stores rates/MCS supported
* @llbRates: 11b rates in unit of 500kbps
* @llaRates: 11a rates in unit of 500kbps
* @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
@@ -324,7 +325,7 @@ const char *lim_bss_type_to_string(const uint16_t bss_type);
* @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
* number of spacial streams
*/
typedef struct sSirSupportedRates {
struct supported_rates {
uint16_t llbRates[SIR_NUM_11B_RATES];
uint16_t llaRates[SIR_NUM_11A_RATES];
uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
@@ -341,7 +342,7 @@ typedef struct sSirSupportedRates {
uint16_t rx_he_mcs_map_80_80;
uint16_t tx_he_mcs_map_80_80;
#endif
} tSirSupportedRates, *tpSirSupportedRates;
};
typedef struct sSirRegisterMgmtFrame {
uint16_t messageType;

Dosyayı Görüntüle

@@ -134,7 +134,7 @@ typedef struct sDphHashNode {
/*
* All the legacy and airgo supported rates.
*/
tSirSupportedRates supportedRates;
struct supported_rates supportedRates;
/* MIMO Power Save */
tSirMacHTMIMOPowerSaveState htMIMOPSState;
uint8_t htGreenfield:1;

Dosyayı Görüntüle

@@ -1320,22 +1320,11 @@ lim_decide_short_slot(struct mac_context *mac_ctx, tpDphHashNode sta_ds,
}
}
/**
* lim_populate_vht_mcs_set - function to populate vht mcs rate set
* @mac_ctx: pointer to global mac structure
* @rates: pointer to supported rate set
* @peer_vht_caps: pointer to peer vht capabilities
* @session_entry: pe session entry
*
* Populates vht mcs rate set based on peer and self capabilities
*
* Return: QDF_STATUS_SUCCESS on success else QDF_STATUS_E_FAILURE
*/
QDF_STATUS lim_populate_vht_mcs_set(struct mac_context *mac_ctx,
tpSirSupportedRates rates,
tDot11fIEVHTCaps *peer_vht_caps,
struct pe_session *session_entry,
uint8_t nss)
struct supported_rates *rates,
tDot11fIEVHTCaps *peer_vht_caps,
struct pe_session *session_entry,
uint8_t nss)
{
uint32_t self_sta_dot11mode = 0;
uint16_t mcs_map_mask = MCSMAPMASK1x1;
@@ -1454,34 +1443,13 @@ QDF_STATUS lim_populate_vht_mcs_set(struct mac_context *mac_ctx,
return QDF_STATUS_SUCCESS;
}
/**
* lim_populate_own_rate_set() - comprises the basic and extended rates read
* from CFG
* @mac_ctx: pointer to global mac structure
* @rates: pointer to supported rates
* @supported_mcs_set: pointer to supported mcs rates
* @basic_only: update only basic rates if set true
* @session_entry: pe session entry
* @vht_caps: pointer to vht capability
*
* This function is called by limProcessAssocRsp() or
* lim_add_staInIBSS()
* - It creates a combined rate set of 12 rates max which
* comprises the basic and extended rates read from CFG
* - It sorts the combined rate Set and copy it in the
* rate array of the pSTA descriptor
* - It sets the erpEnabled bit of the STA descriptor
* ERP bit is set iff the dph PHY mode is 11G and there is at least
* an A rate in the supported or extended rate sets
*
* Return: QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE.
*/
QDF_STATUS
lim_populate_own_rate_set(struct mac_context *mac_ctx,
tpSirSupportedRates rates, uint8_t *supported_mcs_set,
uint8_t basic_only, struct pe_session *session_entry,
struct sDot11fIEVHTCaps *vht_caps,
struct sDot11fIEhe_cap *he_caps)
QDF_STATUS lim_populate_own_rate_set(struct mac_context *mac_ctx,
struct supported_rates *rates,
uint8_t *supported_mcs_set,
uint8_t basic_only,
struct pe_session *session_entry,
struct sDot11fIEVHTCaps *vht_caps,
struct sDot11fIEhe_cap *he_caps)
{
tSirMacRateSet temp_rate_set;
tSirMacRateSet temp_rate_set2;
@@ -1543,7 +1511,7 @@ lim_populate_own_rate_set(struct mac_context *mac_ctx,
* put the result in pSupportedRates
*/
qdf_mem_zero((uint8_t *) rates, sizeof(tSirSupportedRates));
qdf_mem_zero(rates, sizeof(*rates));
for (i = 0; i < temp_rate_set.numRates; i++) {
min = 0;
val = 0xff;
@@ -1616,21 +1584,25 @@ lim_populate_own_rate_set(struct mac_context *mac_ctx,
*
* Return: None
*/
static void lim_calculate_he_nss(tpSirSupportedRates rates, struct pe_session *session)
static void lim_calculate_he_nss(struct supported_rates *rates,
struct pe_session *session)
{
HE_GET_NSS(rates->rx_he_mcs_map_lt_80, session->nss);
}
#else
static void lim_calculate_he_nss(tpSirSupportedRates rates, struct pe_session *session)
static void lim_calculate_he_nss(struct supported_rates *rates,
struct pe_session *session)
{
}
#endif
QDF_STATUS
lim_populate_peer_rate_set(struct mac_context *mac,
tpSirSupportedRates pRates, uint8_t *pSupportedMCSSet,
uint8_t basicOnly, struct pe_session *pe_session,
tDot11fIEVHTCaps *pVHTCaps, tDot11fIEhe_cap *he_caps)
QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
struct supported_rates *pRates,
uint8_t *pSupportedMCSSet,
uint8_t basicOnly,
struct pe_session *pe_session,
tDot11fIEVHTCaps *pVHTCaps,
tDot11fIEhe_cap *he_caps)
{
tSirMacRateSet tempRateSet;
tSirMacRateSet tempRateSet2;
@@ -1684,7 +1656,7 @@ lim_populate_peer_rate_set(struct mac_context *mac,
uint8_t aRateIndex = 0;
uint8_t bRateIndex = 0;
qdf_mem_zero((uint8_t *) pRates, sizeof(tSirSupportedRates));
qdf_mem_zero(pRates, sizeof(*pRates));
for (i = 0; i < tempRateSet.numRates; i++) {
min = 0;
val = 0xff;
@@ -1824,7 +1796,7 @@ QDF_STATUS lim_populate_matching_rate_set(struct mac_context *mac_ctx,
uint32_t i, j, val, min, is_arate;
uint32_t phy_mode;
uint8_t mcs_set[SIZE_OF_SUPPORTED_MCS_SET];
tpSirSupportedRates rates;
struct supported_rates *rates;
uint8_t a_rate_index = 0;
uint8_t b_rate_index = 0;
qdf_size_t val_len;
@@ -1943,7 +1915,7 @@ QDF_STATUS lim_populate_matching_rate_set(struct mac_context *mac_ctx,
}
rates = &sta_ds->supportedRates;
qdf_mem_zero((uint8_t *) rates, sizeof(tSirSupportedRates));
qdf_mem_zero(rates, sizeof(*rates));
for (i = 0; (i < temp_rate_set2.numRates &&
i < SIR_MAC_RATESET_EID_MAX); i++) {
for (j = 0; (j < temp_rate_set.numRates &&
@@ -2155,9 +2127,9 @@ lim_add_sta(struct mac_context *mac_ctx,
sizeof(add_sta_params->capab_info));
/* Copy legacy rates */
qdf_mem_copy((uint8_t *) &add_sta_params->supportedRates,
(uint8_t *) &sta_ds->supportedRates,
sizeof(tSirSupportedRates));
qdf_mem_copy(&add_sta_params->supportedRates,
&sta_ds->supportedRates,
sizeof(sta_ds->supportedRates));
add_sta_params->assocId = sta_ds->assocId;
@@ -3950,10 +3922,9 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
sta = dph_get_hash_entry(mac, DPH_STA_HASH_INDEX_PEER,
&pe_session->dph.dphHashTable);
if (sta != NULL) {
qdf_mem_copy((uint8_t *) &pAddBssParams->staContext.
supportedRates,
(uint8_t *)&sta->supportedRates,
sizeof(tSirSupportedRates));
qdf_mem_copy(&pAddBssParams->staContext.supportedRates,
&sta->supportedRates,
sizeof(sta->supportedRates));
} else
pe_err("could not Update the supported rates");
pAddBssParams->staContext.encryptType = pe_session->encryptType;
@@ -4704,15 +4675,6 @@ QDF_STATUS lim_is_dot11h_power_capabilities_in_range(struct mac_context *mac,
return QDF_STATUS_SUCCESS;
}
/** -------------------------------------------------------------
\fn lim_fill_rx_highest_supported_rate
\brief Fills in the Rx Highest Supported Data Rate field from
\ the 'supported MCS set' field in HT capability element.
\param struct mac_context * mac
\param tpSirSupportedRates pRates
\param uint8_t* pSupportedMCSSet
\return none
-------------------------------------------------------------*/
void lim_fill_rx_highest_supported_rate(struct mac_context *mac,
uint16_t *rxHighestRate,
uint8_t *pSupportedMCSSet)

Dosyayı Görüntüle

@@ -57,20 +57,43 @@ void lim_reject_association(struct mac_context *, tSirMacAddr, uint8_t,
enum eSirMacStatusCodes, struct pe_session *);
QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
tpSirSupportedRates pRates,
uint8_t *pSupportedMCSSet,
uint8_t basicOnly,
struct pe_session *pe_session,
tDot11fIEVHTCaps *pVHTCaps,
tDot11fIEhe_cap *he_caps);
struct supported_rates *pRates,
uint8_t *pSupportedMCSSet,
uint8_t basicOnly,
struct pe_session *pe_session,
tDot11fIEVHTCaps *pVHTCaps,
tDot11fIEhe_cap *he_caps);
QDF_STATUS lim_populate_own_rate_set(struct mac_context *mac,
tpSirSupportedRates pRates,
uint8_t *pSupportedMCSSet,
uint8_t basicOnly,
struct pe_session *pe_session,
tDot11fIEVHTCaps *pVHTCaps,
tDot11fIEhe_cap *he_caps);
/**
* lim_populate_own_rate_set() - comprises the basic and extended rates read
* from CFG
* @mac_ctx: pointer to global mac structure
* @rates: pointer to supported rates
* @supported_mcs_set: pointer to supported mcs rates
* @basic_only: update only basic rates if set true
* @session_entry: pe session entry
* @vht_caps: pointer to vht capability
* @he_caps: pointer to HE capability
*
* This function is called by limProcessAssocRsp() or
* lim_add_staInIBSS()
* - It creates a combined rate set of 12 rates max which
* comprises the basic and extended rates read from CFG
* - It sorts the combined rate Set and copy it in the
* rate array of the pSTA descriptor
* - It sets the erpEnabled bit of the STA descriptor
* ERP bit is set iff the dph PHY mode is 11G and there is at least
* an A rate in the supported or extended rate sets
*
* Return: QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE.
*/
QDF_STATUS lim_populate_own_rate_set(struct mac_context *mac_ctx,
struct supported_rates *rates,
uint8_t *supported_mcs_set,
uint8_t basic_only,
struct pe_session *session_entry,
struct sDot11fIEVHTCaps *vht_caps,
struct sDot11fIEhe_cap *he_caps);
QDF_STATUS lim_populate_matching_rate_set(struct mac_context *mac_ctx,
tpDphHashNode sta_ds,
@@ -190,7 +213,18 @@ QDF_STATUS lim_is_dot11h_supported_channels_valid(struct mac_context *mac,
QDF_STATUS lim_is_dot11h_power_capabilities_in_range(struct mac_context *mac,
tSirAssocReq *assoc,
struct pe_session *);
/* API to fill in RX Highest Supported data Rate */
/**
* lim_fill_rx_highest_supported_rate() - Fill highest rx rate
* @mac: Global MAC context
* @rxHighestRate: location to store the highest rate
* @pSupportedMCSSet: location of the 'supported MCS set' field in HT
* capability element
*
* Fills in the Rx Highest Supported Data Rate field from
* the 'supported MCS set' field in HT capability element.
*
* Return: void
*/
void lim_fill_rx_highest_supported_rate(struct mac_context *mac,
uint16_t *rxHighestRate,
uint8_t *pSupportedMCSSet);
@@ -211,10 +245,22 @@ static inline void lim_send_sme_tsm_ie_ind(struct mac_context *mac,
{}
#endif /* FEATURE_WLAN_ESE */
QDF_STATUS lim_populate_vht_mcs_set(struct mac_context *mac,
tpSirSupportedRates pRates,
tDot11fIEVHTCaps *pPeerVHTCaps,
struct pe_session *pe_session,
uint8_t nss);
/**
* lim_populate_vht_mcs_set - function to populate vht mcs rate set
* @mac_ctx: pointer to global mac structure
* @rates: pointer to supported rate set
* @peer_vht_caps: pointer to peer vht capabilities
* @session_entry: pe session entry
* @nss: number of spatial streams
*
* Populates vht mcs rate set based on peer and self capabilities
*
* Return: QDF_STATUS_SUCCESS on success else QDF_STATUS_E_FAILURE
*/
QDF_STATUS lim_populate_vht_mcs_set(struct mac_context *mac_ctx,
struct supported_rates *rates,
tDot11fIEVHTCaps *peer_vht_caps,
struct pe_session *session_entry,
uint8_t nss);
#endif /* __LIM_ASSOC_UTILS_H */

Dosyayı Görüntüle

@@ -2843,9 +2843,9 @@ static void lim_process_sme_get_assoc_sta_info(struct mac_context *mac_ctx,
assoc_sta_tmp->assocId = (uint8_t) sta_ds->assocId;
assoc_sta_tmp->staId = (uint8_t) sta_ds->staIndex;
qdf_mem_copy((uint8_t *)&assoc_sta_tmp->supportedRates,
(uint8_t *)&sta_ds->supportedRates,
sizeof(tSirSupportedRates));
qdf_mem_copy(&assoc_sta_tmp->supportedRates,
&sta_ds->supportedRates,
sizeof(sta_ds->supportedRates));
assoc_sta_tmp->ShortGI40Mhz = sta_ds->htShortGI40Mhz;
assoc_sta_tmp->ShortGI20Mhz = sta_ds->htShortGI20Mhz;
assoc_sta_tmp->Support40Mhz =

Dosyayı Görüntüle

@@ -2225,7 +2225,8 @@ lim_tdls_populate_dot11f_vht_caps(struct mac_context *mac,
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure.
*/
static QDF_STATUS
lim_tdls_populate_matching_rate_set(struct mac_context *mac_ctx, tpDphHashNode stads,
lim_tdls_populate_matching_rate_set(struct mac_context *mac_ctx,
tpDphHashNode stads,
uint8_t *supp_rate_set,
uint8_t supp_rates_len,
uint8_t *supp_mcs_set,
@@ -2237,7 +2238,7 @@ lim_tdls_populate_matching_rate_set(struct mac_context *mac_ctx, tpDphHashNode s
tSirMacRateSet temp_rate_set2;
uint32_t phymode;
uint8_t mcsSet[SIZE_OF_SUPPORTED_MCS_SET];
tpSirSupportedRates rates;
struct supported_rates *rates;
uint8_t a_rateindex = 0;
uint8_t b_rateindex = 0;
uint8_t nss;
@@ -2328,7 +2329,7 @@ lim_tdls_populate_matching_rate_set(struct mac_context *mac_ctx, tpDphHashNode s
temp_rate_set.numRates = supp_rates_len;
rates = &stads->supportedRates;
qdf_mem_zero((uint8_t *) rates, sizeof(tSirSupportedRates));
qdf_mem_zero(rates, sizeof(*rates));
for (i = 0; i < temp_rate_set2.numRates; i++) {
for (j = 0; j < temp_rate_set.numRates; j++) {

Dosyayı Görüntüle

@@ -7455,7 +7455,7 @@ static QDF_STATUS lim_populate_he_mcs_per_bw(struct mac_context *mac_ctx,
}
QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx,
tpSirSupportedRates rates,
struct supported_rates *rates,
tDot11fIEhe_cap *peer_he_caps,
struct pe_session *session_entry, uint8_t nss)
{

Dosyayı Görüntüle

@@ -1126,19 +1126,22 @@ QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, struct pe_session *s
uint8_t vdev_id);
/**
* lim_populate_he_mcs_set - function to populate HE mcs rate set
* lim_populate_he_mcs_set() - function to populate HE mcs rate set
* @mac_ctx: pointer to global mac structure
* @rates: pointer to supported rate set
* @peer_vht_caps: pointer to peer HE capabilities
* @session_entry: pe session entry
* @nss: number of spatial streams
*
* Populates HE mcs rate set based on peer and self capabilities
*
* Return: QDF_STATUS
*/
QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx,
tpSirSupportedRates rates, tDot11fIEhe_cap *peer_he_caps,
struct pe_session *session_entry, uint8_t nss);
struct supported_rates *rates,
tDot11fIEhe_cap *peer_he_caps,
struct pe_session *session_entry,
uint8_t nss);
#else
static inline void lim_add_he_cap(tpAddStaParams add_sta_params,
@@ -1263,10 +1266,12 @@ static inline QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx,
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx,
tpSirSupportedRates rates,
tDot11fIEhe_cap *peer_he_caps,
struct pe_session *session_entry, uint8_t nss)
static inline
QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx,
struct supported_rates *rates,
tDot11fIEhe_cap *peer_he_caps,
struct pe_session *session_entry,
uint8_t nss)
{
return QDF_STATUS_SUCCESS;
}

Dosyayı Görüntüle

@@ -320,7 +320,7 @@ typedef struct sap_AssocMacAddr_s {
uint8_t ShortGI40Mhz;
uint8_t ShortGI20Mhz;
uint8_t Support40Mhz;
tSirSupportedRates supportedRates;
struct supported_rates supportedRates;
} tSap_AssocMacAddr, *tpSap_AssocMacAddr;
/*struct corresponding to SAP_ASSOC_STA_CALLBACK_EVENT */

Dosyayı Görüntüle

@@ -242,7 +242,7 @@ typedef struct {
uint8_t fDsssCckMode40Mhz;
uint8_t fShortGI40Mhz;
uint8_t fShortGI20Mhz;
tSirSupportedRates supportedRates;
struct supported_rates supportedRates;
/*
* Following parameters are for returning status and station index from
* HAL to PE via response message. HAL does not read them.