From: Henry Ptasinski Date: Fri, 8 Oct 2010 02:52:10 +0000 (-0700) Subject: staging: brcm80211: Remove dead code from bcmwifi.c X-Git-Tag: firefly_0821_release~7613^2~3583^2~3^2~271 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=51c5651da4bf37f0cbb488d9c6f9044da659c367;p=firefly-linux-kernel-4.4.55.git staging: brcm80211: Remove dead code from bcmwifi.c Removed unused functions wf_chspec_ntoa() and wf_chspec_aton(). Signed-off-by: Henry Ptasinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/include/bcmwifi.h b/drivers/staging/brcm80211/include/bcmwifi.h index b85fea31f46a..20ae84e1bfa1 100644 --- a/drivers/staging/brcm80211/include/bcmwifi.h +++ b/drivers/staging/brcm80211/include/bcmwifi.h @@ -128,21 +128,6 @@ typedef u16 chanspec_t; #define WLC_2G_25MHZ_OFFSET 5 /* 2.4GHz band channel offset */ -/* - * Convert chanspec to ascii string - * @param chspec chanspec format - * @param buf ascii string of chanspec - * @return pointer to buf with room for at least CHANSPEC_STR_LEN bytes - */ -extern char *wf_chspec_ntoa(chanspec_t chspec, char *buf); - -/* - * Convert ascii string to chanspec - * @param a pointer to input string - * @return >= 0 if successful or 0 otherwise - */ -extern chanspec_t wf_chspec_aton(char *a); - /* * Verify the chanspec is using a legal set of parameters, i.e. that the * chanspec specified a band, bw, ctl_sb and channel and that the diff --git a/drivers/staging/brcm80211/util/bcmwifi.c b/drivers/staging/brcm80211/util/bcmwifi.c index 4e89867aa367..c51fea048a42 100644 --- a/drivers/staging/brcm80211/util/bcmwifi.c +++ b/drivers/staging/brcm80211/util/bcmwifi.c @@ -22,132 +22,6 @@ #include #include -/* Chanspec ASCII representation: - * - * digit [AB] [N] [UL] - * - * : channel number of the 10MHz or 20MHz channel, - * or control sideband channel of 40MHz channel. - * : A for 5GHz, B for 2.4GHz - * : N for 10MHz, nothing for 20MHz or 40MHz - * (ctl-sideband spec implies 40MHz) - * : U for upper, L for lower - * - * may be omitted on input, and will be assumed to be - * 2.4GHz if channel number <= 14. - * - * Examples: - * 8 -> 2.4GHz channel 8, 20MHz - * 8b -> 2.4GHz channel 8, 20MHz - * 8l -> 2.4GHz channel 8, 40MHz, lower ctl sideband - * 8a -> 5GHz channel 8 (low 5 GHz band), 20MHz - * 36 -> 5GHz channel 36, 20MHz - * 36l -> 5GHz channel 36, 40MHz, lower ctl sideband - * 40u -> 5GHz channel 40, 40MHz, upper ctl sideband - * 180n -> channel 180, 10MHz - */ - -/* given a chanspec and a string buffer, format the chanspec as a - * string, and return the original pointer a. - * Min buffer length must be CHANSPEC_STR_LEN. - * On error return NULL - */ -char *wf_chspec_ntoa(chanspec_t chspec, char *buf) -{ - const char *band, *bw, *sb; - uint channel; - - band = ""; - bw = ""; - sb = ""; - channel = CHSPEC_CHANNEL(chspec); - /* check for non-default band spec */ - if ((CHSPEC_IS2G(chspec) && channel > CH_MAX_2G_CHANNEL) || - (CHSPEC_IS5G(chspec) && channel <= CH_MAX_2G_CHANNEL)) - band = (CHSPEC_IS2G(chspec)) ? "b" : "a"; - if (CHSPEC_IS40(chspec)) { - if (CHSPEC_SB_UPPER(chspec)) { - sb = "u"; - channel += CH_10MHZ_APART; - } else { - sb = "l"; - channel -= CH_10MHZ_APART; - } - } else if (CHSPEC_IS10(chspec)) { - bw = "n"; - } - - /* Outputs a max of 6 chars including '\0' */ - snprintf(buf, 6, "%d%s%s%s", channel, band, bw, sb); - return buf; -} - -/* given a chanspec string, convert to a chanspec. - * On error return 0 - */ -chanspec_t wf_chspec_aton(char *a) -{ - char *endp = NULL; - uint channel, band, bw, ctl_sb; - char c; - - channel = simple_strtoul(a, &endp, 10); - - /* check for no digits parsed */ - if (endp == a) - return 0; - - if (channel > MAXCHANNEL) - return 0; - - band = - ((channel <= - CH_MAX_2G_CHANNEL) ? WL_CHANSPEC_BAND_2G : WL_CHANSPEC_BAND_5G); - bw = WL_CHANSPEC_BW_20; - ctl_sb = WL_CHANSPEC_CTL_SB_NONE; - - a = endp; - - c = tolower(a[0]); - if (c == '\0') - goto done; - - /* parse the optional ['A' | 'B'] band spec */ - if (c == 'a' || c == 'b') { - band = (c == 'a') ? WL_CHANSPEC_BAND_5G : WL_CHANSPEC_BAND_2G; - a++; - c = tolower(a[0]); - if (c == '\0') - goto done; - } - - /* parse bandwidth 'N' (10MHz) or 40MHz ctl sideband ['L' | 'U'] */ - if (c == 'n') { - bw = WL_CHANSPEC_BW_10; - } else if (c == 'l') { - bw = WL_CHANSPEC_BW_40; - ctl_sb = WL_CHANSPEC_CTL_SB_LOWER; - /* adjust channel to center of 40MHz band */ - if (channel <= (MAXCHANNEL - CH_20MHZ_APART)) - channel += CH_10MHZ_APART; - else - return 0; - } else if (c == 'u') { - bw = WL_CHANSPEC_BW_40; - ctl_sb = WL_CHANSPEC_CTL_SB_UPPER; - /* adjust channel to center of 40MHz band */ - if (channel > CH_20MHZ_APART) - channel -= CH_10MHZ_APART; - else - return 0; - } else { - return 0; - } - - done: - return channel | band | bw | ctl_sb; -} - /* * Verify the chanspec is using a legal set of parameters, i.e. that the * chanspec specified a band, bw, ctl_sb and channel and that the