Commit 2c6d0ee3 authored by John Whitmore's avatar John Whitmore Committed by Greg Kroah-Hartman

staging:rtl8192u: Refactor struct HT_CAPABILITY_ELE - Style

The structure HT_CAPABILITY_ELE causes a number of checkpatch / coding
style issues. The structure uses a 'typedef' directive causing an
issue regarding defining new types in the code. The name of the
structure should be lowercase, and the '__packed' directive is prefered
over the attribute directive.

The typedef has been removed, structure renamed to ht_capability_ele
and the '__packed' directive used.

These are coding style changes and should not impact on runtime code
execution.
Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9ff6cdd3
...@@ -147,13 +147,13 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, ...@@ -147,13 +147,13 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
if (network->mode >= IEEE_N_24G)//add N rate here; if (network->mode >= IEEE_N_24G)//add N rate here;
{ {
PHT_CAPABILITY_ELE ht_cap = NULL; struct ht_capability_ele *ht_cap = NULL;
bool is40M = false, isShortGI = false; bool is40M = false, isShortGI = false;
u8 max_mcs = 0; u8 max_mcs = 0;
if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4)) if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4))
ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[4]; ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[4];
else else
ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[0]; ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0];
is40M = (ht_cap->ChlWidth)?1:0; is40M = (ht_cap->ChlWidth)?1:0;
isShortGI = (ht_cap->ChlWidth)? isShortGI = (ht_cap->ChlWidth)?
((ht_cap->ShortGI40Mhz)?1:0): ((ht_cap->ShortGI40Mhz)?1:0):
......
...@@ -37,7 +37,7 @@ enum ht_extension_chan_offset { ...@@ -37,7 +37,7 @@ enum ht_extension_chan_offset {
HT_EXTCHNL_OFFSET_LOWER = 3, HT_EXTCHNL_OFFSET_LOWER = 3,
}; };
typedef struct _HT_CAPABILITY_ELE { struct ht_capability_ele {
//HT capability info //HT capability info
u8 AdvCoding:1; u8 AdvCoding:1;
u8 ChlWidth:1; u8 ChlWidth:1;
...@@ -71,7 +71,7 @@ typedef struct _HT_CAPABILITY_ELE { ...@@ -71,7 +71,7 @@ typedef struct _HT_CAPABILITY_ELE {
//Antenna Selection Capabilities //Antenna Selection Capabilities
u8 ASCap; u8 ASCap;
} __attribute__ ((packed)) HT_CAPABILITY_ELE, *PHT_CAPABILITY_ELE; } __packed;
/* /*
* The HT Information element is present in beacons * The HT Information element is present in beacons
...@@ -140,7 +140,7 @@ typedef struct _RT_HIGH_THROUGHPUT { ...@@ -140,7 +140,7 @@ typedef struct _RT_HIGH_THROUGHPUT {
HT_SPEC_VER ePeerHTSpecVer; HT_SPEC_VER ePeerHTSpecVer;
// HT related information for "Self" // HT related information for "Self"
HT_CAPABILITY_ELE SelfHTCap; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities. struct ht_capability_ele SelfHTCap; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities.
HT_INFORMATION_ELE SelfHTInfo; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities. HT_INFORMATION_ELE SelfHTInfo; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities.
// HT related information for "Peer" // HT related information for "Peer"
...@@ -233,7 +233,7 @@ typedef struct _BSS_HT { ...@@ -233,7 +233,7 @@ typedef struct _BSS_HT {
u16 bdHTInfoLen; u16 bdHTInfoLen;
HT_SPEC_VER bdHTSpecVer; HT_SPEC_VER bdHTSpecVer;
//HT_CAPABILITY_ELE bdHTCapEle; //struct ht_capability_ele bdHTCapEle;
//HT_INFORMATION_ELE bdHTInfoEle; //HT_INFORMATION_ELE bdHTInfoEle;
u8 bdRT2RTAggregation; u8 bdRT2RTAggregation;
......
...@@ -130,15 +130,15 @@ void HTUpdateDefaultSetting(struct ieee80211_device *ieee) ...@@ -130,15 +130,15 @@ void HTUpdateDefaultSetting(struct ieee80211_device *ieee)
*/ */
void HTDebugHTCapability(u8 *CapIE, u8 *TitleString) void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
{ {
static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily
PHT_CAPABILITY_ELE pCapELE; struct ht_capability_ele *pCapELE;
if (!memcmp(CapIE, EWC11NHTCap, sizeof(EWC11NHTCap))) { if (!memcmp(CapIE, EWC11NHTCap, sizeof(EWC11NHTCap))) {
//EWC IE //EWC IE
IEEE80211_DEBUG(IEEE80211_DL_HT, "EWC IE in %s()\n", __func__); IEEE80211_DEBUG(IEEE80211_DL_HT, "EWC IE in %s()\n", __func__);
pCapELE = (PHT_CAPABILITY_ELE)(&CapIE[4]); pCapELE = (struct ht_capability_ele *)(&CapIE[4]);
} else { } else {
pCapELE = (PHT_CAPABILITY_ELE)(&CapIE[0]); pCapELE = (struct ht_capability_ele *)(&CapIE[0]);
} }
IEEE80211_DEBUG(IEEE80211_DL_HT, "<Log HT Capability>. Called by %s\n", TitleString); IEEE80211_DEBUG(IEEE80211_DL_HT, "<Log HT Capability>. Called by %s\n", TitleString);
...@@ -230,7 +230,7 @@ static bool IsHTHalfNmode40Bandwidth(struct ieee80211_device *ieee) ...@@ -230,7 +230,7 @@ static bool IsHTHalfNmode40Bandwidth(struct ieee80211_device *ieee)
retValue = false; retValue = false;
else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode
retValue = false; retValue = false;
else if (((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw else if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw
retValue = true; retValue = true;
else else
retValue = false; retValue = false;
...@@ -248,12 +248,12 @@ static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, bool is40MHz) ...@@ -248,12 +248,12 @@ static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, bool is40MHz)
else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode
retValue = false; retValue = false;
else if (is40MHz) { // ap support 40 bw else if (is40MHz) { // ap support 40 bw
if (((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI
retValue = true; retValue = true;
else else
retValue = false; retValue = false;
} else { } else {
if (((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI
retValue = true; retValue = true;
else else
retValue = false; retValue = false;
...@@ -530,7 +530,7 @@ void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo) ...@@ -530,7 +530,7 @@ void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo)
void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u8 *len, u8 IsEncrypt) void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u8 *len, u8 IsEncrypt)
{ {
PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo; PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo;
PHT_CAPABILITY_ELE pCapELE = NULL; struct ht_capability_ele *pCapELE = NULL;
//u8 bIsDeclareMCS13; //u8 bIsDeclareMCS13;
if (!posHTCap || !pHT) { if (!posHTCap || !pHT) {
...@@ -544,9 +544,9 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u ...@@ -544,9 +544,9 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily
memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap));
pCapELE = (PHT_CAPABILITY_ELE)&posHTCap[4]; pCapELE = (struct ht_capability_ele *)&posHTCap[4];
} else { } else {
pCapELE = (PHT_CAPABILITY_ELE)posHTCap; pCapELE = (struct ht_capability_ele *)posHTCap;
} }
//HT capability info //HT capability info
...@@ -898,7 +898,7 @@ void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Ban ...@@ -898,7 +898,7 @@ void HTSetConnectBwMode(struct ieee80211_device *ieee, enum ht_channel_width Ban
void HTOnAssocRsp(struct ieee80211_device *ieee) void HTOnAssocRsp(struct ieee80211_device *ieee)
{ {
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
PHT_CAPABILITY_ELE pPeerHTCap = NULL; struct ht_capability_ele *pPeerHTCap = NULL;
PHT_INFORMATION_ELE pPeerHTInfo = NULL; PHT_INFORMATION_ELE pPeerHTInfo = NULL;
u16 nMaxAMSDUSize = 0; u16 nMaxAMSDUSize = 0;
u8 *pMcsFilter = NULL; u8 *pMcsFilter = NULL;
...@@ -913,16 +913,16 @@ void HTOnAssocRsp(struct ieee80211_device *ieee) ...@@ -913,16 +913,16 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
return; return;
} }
IEEE80211_DEBUG(IEEE80211_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n"); IEEE80211_DEBUG(IEEE80211_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n");
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTCapBuf, sizeof(HT_CAPABILITY_ELE)); // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTCapBuf, sizeof(struct ht_capability_ele));
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTInfoBuf, sizeof(HT_INFORMATION_ELE)); // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTInfoBuf, sizeof(HT_INFORMATION_ELE));
// HTDebugHTCapability(pHTInfo->PeerHTCapBuf,"HTOnAssocRsp_wq"); // HTDebugHTCapability(pHTInfo->PeerHTCapBuf,"HTOnAssocRsp_wq");
// HTDebugHTInfo(pHTInfo->PeerHTInfoBuf,"HTOnAssocRsp_wq"); // HTDebugHTInfo(pHTInfo->PeerHTInfoBuf,"HTOnAssocRsp_wq");
// //
if (!memcmp(pHTInfo->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap))) if (!memcmp(pHTInfo->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap)))
pPeerHTCap = (PHT_CAPABILITY_ELE)(&pHTInfo->PeerHTCapBuf[4]); pPeerHTCap = (struct ht_capability_ele *)(&pHTInfo->PeerHTCapBuf[4]);
else else
pPeerHTCap = (PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf); pPeerHTCap = (struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf);
if (!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo))) if (!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo)))
pPeerHTInfo = (PHT_INFORMATION_ELE)(&pHTInfo->PeerHTInfoBuf[4]); pPeerHTInfo = (PHT_INFORMATION_ELE)(&pHTInfo->PeerHTInfoBuf[4]);
...@@ -932,7 +932,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee) ...@@ -932,7 +932,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Configurations: // Configurations:
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_HT, pPeerHTCap, sizeof(HT_CAPABILITY_ELE)); IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_HT, pPeerHTCap, sizeof(struct ht_capability_ele));
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTInfo, sizeof(HT_INFORMATION_ELE)); // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTInfo, sizeof(HT_INFORMATION_ELE));
// Config Supported Channel Width setting // Config Supported Channel Width setting
// //
...@@ -1176,7 +1176,7 @@ void HTResetSelfAndSavePeerSetting(struct ieee80211_device *ieee, struct ieee802 ...@@ -1176,7 +1176,7 @@ void HTResetSelfAndSavePeerSetting(struct ieee80211_device *ieee, struct ieee802
{ {
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
// u16 nMaxAMSDUSize; // u16 nMaxAMSDUSize;
// PHT_CAPABILITY_ELE pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf; // struct ht_capability_ele *pPeerHTCap = (struct ht_capability_ele *)pNetwork->bssht.bdHTCapBuf;
// PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf; // PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf;
// u8* pMcsFilter; // u8* pMcsFilter;
u8 bIOTAction = 0; u8 bIOTAction = 0;
...@@ -1249,8 +1249,8 @@ void HTResetSelfAndSavePeerSetting(struct ieee80211_device *ieee, struct ieee802 ...@@ -1249,8 +1249,8 @@ void HTResetSelfAndSavePeerSetting(struct ieee80211_device *ieee, struct ieee802
void HTUpdateSelfAndPeerSetting(struct ieee80211_device *ieee, struct ieee80211_network *pNetwork) void HTUpdateSelfAndPeerSetting(struct ieee80211_device *ieee, struct ieee80211_network *pNetwork)
{ {
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
// PHT_CAPABILITY_ELE pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf; // struct ht_capability_ele *pPeerHTCap = (struct ht_capability_ele *)pNetwork->bssht.bdHTCapBuf;
PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf; PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf;
if (pHTInfo->bCurrentHTSupport) { if (pHTInfo->bCurrentHTSupport) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment