summaryrefslogtreecommitdiff
path: root/drivers/staging/brcm80211/brcmutil/wifi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/brcm80211/brcmutil/wifi.c')
-rw-r--r--drivers/staging/brcm80211/brcmutil/wifi.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/drivers/staging/brcm80211/brcmutil/wifi.c b/drivers/staging/brcm80211/brcmutil/wifi.c
index b9ffe86..636515c 100644
--- a/drivers/staging/brcm80211/brcmutil/wifi.c
+++ b/drivers/staging/brcm80211/brcmutil/wifi.c
@@ -21,7 +21,7 @@
* combination could be legal given any set of circumstances.
* RETURNS: true is the chanspec is malformed, false if it looks good.
*/
-bool brcmu_chspec_malformed(chanspec_t chanspec)
+bool brcmu_chspec_malformed(u16 chanspec)
{
/* must be 2G or 5G band */
if (!CHSPEC_IS5G(chanspec) && !CHSPEC_IS2G(chanspec))
@@ -34,9 +34,8 @@ bool brcmu_chspec_malformed(chanspec_t chanspec)
if (CHSPEC_IS20(chanspec)) {
if (!CHSPEC_SB_NONE(chanspec))
return true;
- } else {
- if (!CHSPEC_SB_UPPER(chanspec) && !CHSPEC_SB_LOWER(chanspec))
- return true;
+ } else if (!CHSPEC_SB_UPPER(chanspec) && !CHSPEC_SB_LOWER(chanspec)) {
+ return true;
}
return false;
@@ -44,11 +43,11 @@ bool brcmu_chspec_malformed(chanspec_t chanspec)
EXPORT_SYMBOL(brcmu_chspec_malformed);
/*
- * This function returns the channel number that control traffic is being sent on, for legacy
- * channels this is just the channel number, for 40MHZ channels it is the upper or lowre 20MHZ
- * sideband depending on the chanspec selected
+ * This function returns the channel number that control traffic is being sent
+ * on, for legacy channels this is just the channel number, for 40MHZ channels
+ * it is the upper or lower 20MHZ sideband depending on the chanspec selected.
*/
-u8 brcmu_chspec_ctlchan(chanspec_t chspec)
+u8 brcmu_chspec_ctlchan(u16 chspec)
{
u8 ctl_chan;
@@ -56,17 +55,23 @@ u8 brcmu_chspec_ctlchan(chanspec_t chspec)
if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_NONE) {
return CHSPEC_CHANNEL(chspec);
} else {
- /* we only support 40MHZ with sidebands */
- /* chanspec channel holds the centre frequency, use that and the
- * side band information to reconstruct the control channel number
+ /*
+ * we only support 40MHZ with sidebands. chanspec channel holds
+ * the centre frequency, use that and the side band information
+ * to reconstruct the control channel number
*/
- if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_UPPER) {
- /* control chan is the upper 20 MHZ SB of the 40MHZ channel */
+ if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_UPPER)
+ /*
+ * control chan is the upper 20 MHZ SB of the
+ * 40MHZ channel
+ */
ctl_chan = UPPER_20_SB(CHSPEC_CHANNEL(chspec));
- } else {
- /* control chan is the lower 20 MHZ SB of the 40MHZ channel */
+ else
+ /*
+ * control chan is the lower 20 MHZ SB of the
+ * 40MHZ channel
+ */
ctl_chan = LOWER_20_SB(CHSPEC_CHANNEL(chspec));
- }
}
return ctl_chan;