aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/brcm80211/sys/wlc_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/brcm80211/sys/wlc_channel.c')
-rw-r--r--drivers/staging/brcm80211/sys/wlc_channel.c102
1 files changed, 56 insertions, 46 deletions
diff --git a/drivers/staging/brcm80211/sys/wlc_channel.c b/drivers/staging/brcm80211/sys/wlc_channel.c
index 509280337e3..a35c1521488 100644
--- a/drivers/staging/brcm80211/sys/wlc_channel.c
+++ b/drivers/staging/brcm80211/sys/wlc_channel.c
@@ -19,16 +19,21 @@
19#include <bcmdefs.h> 19#include <bcmdefs.h>
20#include <wlc_cfg.h> 20#include <wlc_cfg.h>
21#include <osl.h> 21#include <osl.h>
22#include <linuxver.h> 22#include <linux/module.h>
23#include <linux/pci.h>
23#include <bcmutils.h> 24#include <bcmutils.h>
24#include <siutils.h> 25#include <siutils.h>
26#include <sbhndpio.h>
27#include <sbhnddma.h>
25#include <wlioctl.h> 28#include <wlioctl.h>
26#include <wlc_pub.h> 29#include <wlc_pub.h>
27#include <wlc_key.h> 30#include <wlc_key.h>
31#include <wlc_event.h>
28#include <wlc_mac80211.h> 32#include <wlc_mac80211.h>
29#include <wlc_bmac.h> 33#include <wlc_bmac.h>
30#include <wlc_stf.h> 34#include <wlc_stf.h>
31#include <wlc_channel.h> 35#include <wlc_channel.h>
36#include <wl_dbg.h>
32 37
33typedef struct wlc_cm_band { 38typedef struct wlc_cm_band {
34 u8 locale_flags; /* locale_info_t flags */ 39 u8 locale_flags; /* locale_info_t flags */
@@ -39,8 +44,8 @@ typedef struct wlc_cm_band {
39} wlc_cm_band_t; 44} wlc_cm_band_t;
40 45
41struct wlc_cm_info { 46struct wlc_cm_info {
42 wlc_pub_t *pub; 47 struct wlc_pub *pub;
43 wlc_info_t *wlc; 48 struct wlc_info *wlc;
44 char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */ 49 char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */
45 uint srom_regrev; /* Regulatory Rev for the SROM ccode */ 50 uint srom_regrev; /* Regulatory Rev for the SROM ccode */
46 const country_info_t *country; /* current country def */ 51 const country_info_t *country; /* current country def */
@@ -377,7 +382,7 @@ void wlc_locale_get_channels(const locale_info_t *locale, chanvec_t *channels)
377{ 382{
378 u8 i; 383 u8 i;
379 384
380 bzero(channels, sizeof(chanvec_t)); 385 memset(channels, 0, sizeof(chanvec_t));
381 386
382 for (i = 0; i < ARRAY_SIZE(g_table_locale_base); i++) { 387 for (i = 0; i < ARRAY_SIZE(g_table_locale_base); i++) {
383 if (locale->valid_channels & (1 << i)) { 388 if (locale->valid_channels & (1 << i)) {
@@ -562,8 +567,8 @@ struct chan20_info chan20_info[] = {
562const locale_info_t *wlc_get_locale_2g(u8 locale_idx) 567const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
563{ 568{
564 if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) { 569 if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) {
565 WL_ERROR(("%s: locale 2g index size out of range %d\n", 570 WL_ERROR("%s: locale 2g index size out of range %d\n",
566 __func__, locale_idx)); 571 __func__, locale_idx);
567 ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table)); 572 ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table));
568 return NULL; 573 return NULL;
569 } 574 }
@@ -573,8 +578,8 @@ const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
573const locale_info_t *wlc_get_locale_5g(u8 locale_idx) 578const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
574{ 579{
575 if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) { 580 if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) {
576 WL_ERROR(("%s: locale 5g index size out of range %d\n", 581 WL_ERROR("%s: locale 5g index size out of range %d\n",
577 __func__, locale_idx)); 582 __func__, locale_idx);
578 ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table)); 583 ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table));
579 return NULL; 584 return NULL;
580 } 585 }
@@ -584,8 +589,8 @@ const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
584const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx) 589const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx)
585{ 590{
586 if (locale_idx >= ARRAY_SIZE(g_mimo_2g_table)) { 591 if (locale_idx >= ARRAY_SIZE(g_mimo_2g_table)) {
587 WL_ERROR(("%s: mimo 2g index size out of range %d\n", __func__, 592 WL_ERROR("%s: mimo 2g index size out of range %d\n",
588 locale_idx)); 593 __func__, locale_idx);
589 return NULL; 594 return NULL;
590 } 595 }
591 return g_mimo_2g_table[locale_idx]; 596 return g_mimo_2g_table[locale_idx];
@@ -594,26 +599,26 @@ const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx)
594const locale_mimo_info_t *wlc_get_mimo_5g(u8 locale_idx) 599const locale_mimo_info_t *wlc_get_mimo_5g(u8 locale_idx)
595{ 600{
596 if (locale_idx >= ARRAY_SIZE(g_mimo_5g_table)) { 601 if (locale_idx >= ARRAY_SIZE(g_mimo_5g_table)) {
597 WL_ERROR(("%s: mimo 5g index size out of range %d\n", __func__, 602 WL_ERROR("%s: mimo 5g index size out of range %d\n",
598 locale_idx)); 603 __func__, locale_idx);
599 return NULL; 604 return NULL;
600 } 605 }
601 return g_mimo_5g_table[locale_idx]; 606 return g_mimo_5g_table[locale_idx];
602} 607}
603 608
604wlc_cm_info_t *wlc_channel_mgr_attach(wlc_info_t *wlc) 609wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
605{ 610{
606 wlc_cm_info_t *wlc_cm; 611 wlc_cm_info_t *wlc_cm;
607 char country_abbrev[WLC_CNTRY_BUF_SZ]; 612 char country_abbrev[WLC_CNTRY_BUF_SZ];
608 const country_info_t *country; 613 const country_info_t *country;
609 wlc_pub_t *pub = wlc->pub; 614 struct wlc_pub *pub = wlc->pub;
610 char *ccode; 615 char *ccode;
611 616
612 WL_TRACE(("wl%d: wlc_channel_mgr_attach\n", wlc->pub->unit)); 617 WL_TRACE("wl%d: wlc_channel_mgr_attach\n", wlc->pub->unit);
613 618
614 wlc_cm = kzalloc(sizeof(wlc_cm_info_t), GFP_ATOMIC); 619 wlc_cm = kzalloc(sizeof(wlc_cm_info_t), GFP_ATOMIC);
615 if (wlc_cm == NULL) { 620 if (wlc_cm == NULL) {
616 WL_ERROR(("wl%d: %s: out of memory", pub->unit, __func__)); 621 WL_ERROR("wl%d: %s: out of memory", pub->unit, __func__);
617 return NULL; 622 return NULL;
618 } 623 }
619 wlc_cm->pub = pub; 624 wlc_cm->pub = pub;
@@ -624,12 +629,13 @@ wlc_cm_info_t *wlc_channel_mgr_attach(wlc_info_t *wlc)
624 ccode = getvar(wlc->pub->vars, "ccode"); 629 ccode = getvar(wlc->pub->vars, "ccode");
625 if (ccode) { 630 if (ccode) {
626 strncpy(wlc->pub->srom_ccode, ccode, WLC_CNTRY_BUF_SZ - 1); 631 strncpy(wlc->pub->srom_ccode, ccode, WLC_CNTRY_BUF_SZ - 1);
627 WL_NONE(("%s: SROM country code is %c%c\n", __func__, 632 WL_NONE("%s: SROM country code is %c%c\n",
628 wlc->pub->srom_ccode[0], wlc->pub->srom_ccode[1])); 633 __func__,
634 wlc->pub->srom_ccode[0], wlc->pub->srom_ccode[1]);
629 } 635 }
630 636
631 /* internal country information which must match regulatory constraints in firmware */ 637 /* internal country information which must match regulatory constraints in firmware */
632 bzero(country_abbrev, WLC_CNTRY_BUF_SZ); 638 memset(country_abbrev, 0, WLC_CNTRY_BUF_SZ);
633 strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1); 639 strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1);
634 country = wlc_country_lookup(wlc, country_abbrev); 640 country = wlc_country_lookup(wlc, country_abbrev);
635 641
@@ -659,7 +665,7 @@ const char *wlc_channel_country_abbrev(wlc_cm_info_t *wlc_cm)
659 665
660u8 wlc_channel_locale_flags(wlc_cm_info_t *wlc_cm) 666u8 wlc_channel_locale_flags(wlc_cm_info_t *wlc_cm)
661{ 667{
662 wlc_info_t *wlc = wlc_cm->wlc; 668 struct wlc_info *wlc = wlc_cm->wlc;
663 669
664 return wlc_cm->bandstate[wlc->band->bandunit].locale_flags; 670 return wlc_cm->bandstate[wlc->band->bandunit].locale_flags;
665} 671}
@@ -711,7 +717,9 @@ wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
711 char mapped_ccode[WLC_CNTRY_BUF_SZ]; 717 char mapped_ccode[WLC_CNTRY_BUF_SZ];
712 uint mapped_regrev; 718 uint mapped_regrev;
713 719
714 WL_NONE(("%s: (country_abbrev \"%s\", ccode \"%s\", regrev %d) SPROM \"%s\"/%u\n", __func__, country_abbrev, ccode, regrev, wlc_cm->srom_ccode, wlc_cm->srom_regrev)); 720 WL_NONE("%s: (country_abbrev \"%s\", ccode \"%s\", regrev %d) SPROM \"%s\"/%u\n",
721 __func__, country_abbrev, ccode, regrev,
722 wlc_cm->srom_ccode, wlc_cm->srom_regrev);
715 723
716 /* if regrev is -1, lookup the mapped country code, 724 /* if regrev is -1, lookup the mapped country code,
717 * otherwise use the ccode and regrev directly 725 * otherwise use the ccode and regrev directly
@@ -750,7 +758,7 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
750{ 758{
751 const locale_mimo_info_t *li_mimo; 759 const locale_mimo_info_t *li_mimo;
752 const locale_info_t *locale; 760 const locale_info_t *locale;
753 wlc_info_t *wlc = wlc_cm->wlc; 761 struct wlc_info *wlc = wlc_cm->wlc;
754 char prev_country_abbrev[WLC_CNTRY_BUF_SZ]; 762 char prev_country_abbrev[WLC_CNTRY_BUF_SZ];
755 763
756 ASSERT(country != NULL); 764 ASSERT(country != NULL);
@@ -758,7 +766,7 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
758 /* save current country state */ 766 /* save current country state */
759 wlc_cm->country = country; 767 wlc_cm->country = country;
760 768
761 bzero(&prev_country_abbrev, WLC_CNTRY_BUF_SZ); 769 memset(&prev_country_abbrev, 0, WLC_CNTRY_BUF_SZ);
762 strncpy(prev_country_abbrev, wlc_cm->country_abbrev, 770 strncpy(prev_country_abbrev, wlc_cm->country_abbrev,
763 WLC_CNTRY_BUF_SZ - 1); 771 WLC_CNTRY_BUF_SZ - 1);
764 772
@@ -814,7 +822,7 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
814 char *mapped_ccode, 822 char *mapped_ccode,
815 uint *mapped_regrev) 823 uint *mapped_regrev)
816{ 824{
817 wlc_info_t *wlc = wlc_cm->wlc; 825 struct wlc_info *wlc = wlc_cm->wlc;
818 const country_info_t *country; 826 const country_info_t *country;
819 uint srom_regrev = wlc_cm->srom_regrev; 827 uint srom_regrev = wlc_cm->srom_regrev;
820 const char *srom_ccode = wlc_cm->srom_ccode; 828 const char *srom_ccode = wlc_cm->srom_ccode;
@@ -822,8 +830,8 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
822 830
823 /* check for currently supported ccode size */ 831 /* check for currently supported ccode size */
824 if (strlen(ccode) > (WLC_CNTRY_BUF_SZ - 1)) { 832 if (strlen(ccode) > (WLC_CNTRY_BUF_SZ - 1)) {
825 WL_ERROR(("wl%d: %s: ccode \"%s\" too long for match\n", 833 WL_ERROR("wl%d: %s: ccode \"%s\" too long for match\n",
826 wlc->pub->unit, __func__, ccode)); 834 wlc->pub->unit, __func__, ccode);
827 return NULL; 835 return NULL;
828 } 836 }
829 837
@@ -838,7 +846,7 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
838 if (!strcmp(srom_ccode, ccode)) { 846 if (!strcmp(srom_ccode, ccode)) {
839 *mapped_regrev = srom_regrev; 847 *mapped_regrev = srom_regrev;
840 mapped = 0; 848 mapped = 0;
841 WL_ERROR(("srom_code == ccode %s\n", __func__)); 849 WL_ERROR("srom_code == ccode %s\n", __func__);
842 ASSERT(0); 850 ASSERT(0);
843 } else { 851 } else {
844 mapped = 852 mapped =
@@ -890,7 +898,7 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode,
890 } 898 }
891 } 899 }
892 900
893 WL_ERROR(("%s: Returning NULL\n", __func__)); 901 WL_ERROR("%s: Returning NULL\n", __func__);
894 ASSERT(0); 902 ASSERT(0);
895 return NULL; 903 return NULL;
896} 904}
@@ -898,9 +906,9 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode,
898static int 906static int
899wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country) 907wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
900{ 908{
901 wlc_info_t *wlc = wlc_cm->wlc; 909 struct wlc_info *wlc = wlc_cm->wlc;
902 uint i, j; 910 uint i, j;
903 wlcband_t *band; 911 struct wlcband *band;
904 const locale_info_t *li; 912 const locale_info_t *li;
905 chanvec_t sup_chan; 913 chanvec_t sup_chan;
906 const locale_mimo_info_t *li_mimo; 914 const locale_mimo_info_t *li_mimo;
@@ -952,7 +960,7 @@ wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
952 */ 960 */
953static void wlc_channels_commit(wlc_cm_info_t *wlc_cm) 961static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
954{ 962{
955 wlc_info_t *wlc = wlc_cm->wlc; 963 struct wlc_info *wlc = wlc_cm->wlc;
956 uint chan; 964 uint chan;
957 struct txpwr_limits txpwr; 965 struct txpwr_limits txpwr;
958 966
@@ -969,7 +977,9 @@ static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
969 if (chan == INVCHANNEL) { 977 if (chan == INVCHANNEL) {
970 /* country/locale with no valid channels, set the radio disable bit */ 978 /* country/locale with no valid channels, set the radio disable bit */
971 mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE); 979 mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
972 WL_ERROR(("wl%d: %s: no valid channel for \"%s\" nbands %d bandlocked %d\n", wlc->pub->unit, __func__, wlc_cm->country_abbrev, NBANDS(wlc), wlc->bandlocked)); 980 WL_ERROR("wl%d: %s: no valid channel for \"%s\" nbands %d bandlocked %d\n",
981 wlc->pub->unit, __func__,
982 wlc_cm->country_abbrev, NBANDS(wlc), wlc->bandlocked);
973 } else 983 } else
974 if (mboolisset(wlc->pub->radio_disabled, 984 if (mboolisset(wlc->pub->radio_disabled,
975 WL_RADIO_COUNTRY_DISABLE)) { 985 WL_RADIO_COUNTRY_DISABLE)) {
@@ -998,12 +1008,12 @@ static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
998/* reset the quiet channels vector to the union of the restricted and radar channel sets */ 1008/* reset the quiet channels vector to the union of the restricted and radar channel sets */
999void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm) 1009void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm)
1000{ 1010{
1001 wlc_info_t *wlc = wlc_cm->wlc; 1011 struct wlc_info *wlc = wlc_cm->wlc;
1002 uint i, j; 1012 uint i, j;
1003 wlcband_t *band; 1013 struct wlcband *band;
1004 const chanvec_t *chanvec; 1014 const chanvec_t *chanvec;
1005 1015
1006 bzero(&wlc_cm->quiet_channels, sizeof(chanvec_t)); 1016 memset(&wlc_cm->quiet_channels, 0, sizeof(chanvec_t));
1007 1017
1008 band = wlc->band; 1018 band = wlc->band;
1009 for (i = 0; i < NBANDS(wlc); 1019 for (i = 0; i < NBANDS(wlc);
@@ -1036,7 +1046,7 @@ bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
1036 */ 1046 */
1037bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val) 1047bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val)
1038{ 1048{
1039 wlc_info_t *wlc = wlc_cm->wlc; 1049 struct wlc_info *wlc = wlc_cm->wlc;
1040 1050
1041 return VALID_CHANNEL20(wlc, val) || 1051 return VALID_CHANNEL20(wlc, val) ||
1042 (!wlc->bandlocked 1052 (!wlc->bandlocked
@@ -1054,7 +1064,7 @@ wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit, uint val)
1054/* Is the channel valid for the current locale and current band? */ 1064/* Is the channel valid for the current locale and current band? */
1055bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val) 1065bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val)
1056{ 1066{
1057 wlc_info_t *wlc = wlc_cm->wlc; 1067 struct wlc_info *wlc = wlc_cm->wlc;
1058 1068
1059 return ((val < MAXCHANNEL) && 1069 return ((val < MAXCHANNEL) &&
1060 isset(wlc_cm->bandstate[wlc->band->bandunit].valid_channels.vec, 1070 isset(wlc_cm->bandstate[wlc->band->bandunit].valid_channels.vec,
@@ -1064,7 +1074,7 @@ bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val)
1064/* Is the 40 MHz allowed for the current locale and specified band? */ 1074/* Is the 40 MHz allowed for the current locale and specified band? */
1065bool wlc_valid_40chanspec_in_band(wlc_cm_info_t *wlc_cm, uint bandunit) 1075bool wlc_valid_40chanspec_in_band(wlc_cm_info_t *wlc_cm, uint bandunit)
1066{ 1076{
1067 wlc_info_t *wlc = wlc_cm->wlc; 1077 struct wlc_info *wlc = wlc_cm->wlc;
1068 1078
1069 return (((wlc_cm->bandstate[bandunit]. 1079 return (((wlc_cm->bandstate[bandunit].
1070 locale_flags & (WLC_NO_MIMO | WLC_NO_40MHZ)) == 0) 1080 locale_flags & (WLC_NO_MIMO | WLC_NO_40MHZ)) == 0)
@@ -1162,7 +1172,7 @@ void
1162wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chanspec, 1172wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
1163 u8 local_constraint_qdbm) 1173 u8 local_constraint_qdbm)
1164{ 1174{
1165 wlc_info_t *wlc = wlc_cm->wlc; 1175 struct wlc_info *wlc = wlc_cm->wlc;
1166 struct txpwr_limits txpwr; 1176 struct txpwr_limits txpwr;
1167 1177
1168 wlc_channel_reg_limits(wlc_cm, chanspec, &txpwr); 1178 wlc_channel_reg_limits(wlc_cm, chanspec, &txpwr);
@@ -1179,7 +1189,7 @@ int
1179wlc_channel_set_txpower_limit(wlc_cm_info_t *wlc_cm, 1189wlc_channel_set_txpower_limit(wlc_cm_info_t *wlc_cm,
1180 u8 local_constraint_qdbm) 1190 u8 local_constraint_qdbm)
1181{ 1191{
1182 wlc_info_t *wlc = wlc_cm->wlc; 1192 struct wlc_info *wlc = wlc_cm->wlc;
1183 struct txpwr_limits txpwr; 1193 struct txpwr_limits txpwr;
1184 1194
1185 wlc_channel_reg_limits(wlc_cm, wlc->chanspec, &txpwr); 1195 wlc_channel_reg_limits(wlc_cm, wlc->chanspec, &txpwr);
@@ -1299,13 +1309,13 @@ void
1299wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec, 1309wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
1300 txpwr_limits_t *txpwr) 1310 txpwr_limits_t *txpwr)
1301{ 1311{
1302 wlc_info_t *wlc = wlc_cm->wlc; 1312 struct wlc_info *wlc = wlc_cm->wlc;
1303 uint i; 1313 uint i;
1304 uint chan; 1314 uint chan;
1305 int maxpwr; 1315 int maxpwr;
1306 int delta; 1316 int delta;
1307 const country_info_t *country; 1317 const country_info_t *country;
1308 wlcband_t *band; 1318 struct wlcband *band;
1309 const locale_info_t *li; 1319 const locale_info_t *li;
1310 int conducted_max; 1320 int conducted_max;
1311 int conducted_ofdm_max; 1321 int conducted_ofdm_max;
@@ -1314,7 +1324,7 @@ wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
1314 int maxpwr_idx; 1324 int maxpwr_idx;
1315 uint j; 1325 uint j;
1316 1326
1317 bzero(txpwr, sizeof(txpwr_limits_t)); 1327 memset(txpwr, 0, sizeof(txpwr_limits_t));
1318 1328
1319 if (!wlc_valid_chanspec_db(wlc_cm, chanspec)) { 1329 if (!wlc_valid_chanspec_db(wlc_cm, chanspec)) {
1320 country = wlc_country_lookup(wlc, wlc->autocountry_default); 1330 country = wlc_country_lookup(wlc, wlc->autocountry_default);
@@ -1528,13 +1538,13 @@ static bool wlc_japan_ccode(const char *ccode)
1528static bool 1538static bool
1529wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband) 1539wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband)
1530{ 1540{
1531 wlc_info_t *wlc = wlc_cm->wlc; 1541 struct wlc_info *wlc = wlc_cm->wlc;
1532 u8 channel = CHSPEC_CHANNEL(chspec); 1542 u8 channel = CHSPEC_CHANNEL(chspec);
1533 1543
1534 /* check the chanspec */ 1544 /* check the chanspec */
1535 if (wf_chspec_malformed(chspec)) { 1545 if (wf_chspec_malformed(chspec)) {
1536 WL_ERROR(("wl%d: malformed chanspec 0x%x\n", wlc->pub->unit, 1546 WL_ERROR("wl%d: malformed chanspec 0x%x\n",
1537 chspec)); 1547 wlc->pub->unit, chspec);
1538 ASSERT(0); 1548 ASSERT(0);
1539 return false; 1549 return false;
1540 } 1550 }