Lines Matching refs:ch
41 static void brcmu_d11n_encchspec(struct brcmu_chan *ch) in brcmu_d11n_encchspec() argument
43 if (ch->bw == BRCMU_CHAN_BW_20) in brcmu_d11n_encchspec()
44 ch->sb = BRCMU_CHAN_SB_NONE; in brcmu_d11n_encchspec()
46 ch->chspec = 0; in brcmu_d11n_encchspec()
47 brcmu_maskset16(&ch->chspec, BRCMU_CHSPEC_CH_MASK, in brcmu_d11n_encchspec()
48 BRCMU_CHSPEC_CH_SHIFT, ch->chnum); in brcmu_d11n_encchspec()
49 brcmu_maskset16(&ch->chspec, BRCMU_CHSPEC_D11N_SB_MASK, in brcmu_d11n_encchspec()
50 0, d11n_sb(ch->sb)); in brcmu_d11n_encchspec()
51 brcmu_maskset16(&ch->chspec, BRCMU_CHSPEC_D11N_BW_MASK, in brcmu_d11n_encchspec()
52 0, d11n_bw(ch->bw)); in brcmu_d11n_encchspec()
54 if (ch->chnum <= CH_MAX_2G_CHANNEL) in brcmu_d11n_encchspec()
55 ch->chspec |= BRCMU_CHSPEC_D11N_BND_2G; in brcmu_d11n_encchspec()
57 ch->chspec |= BRCMU_CHSPEC_D11N_BND_5G; in brcmu_d11n_encchspec()
77 static void brcmu_d11ac_encchspec(struct brcmu_chan *ch) in brcmu_d11ac_encchspec() argument
79 if (ch->bw == BRCMU_CHAN_BW_20 || ch->sb == BRCMU_CHAN_SB_NONE) in brcmu_d11ac_encchspec()
80 ch->sb = BRCMU_CHAN_SB_L; in brcmu_d11ac_encchspec()
82 brcmu_maskset16(&ch->chspec, BRCMU_CHSPEC_CH_MASK, in brcmu_d11ac_encchspec()
83 BRCMU_CHSPEC_CH_SHIFT, ch->chnum); in brcmu_d11ac_encchspec()
84 brcmu_maskset16(&ch->chspec, BRCMU_CHSPEC_D11AC_SB_MASK, in brcmu_d11ac_encchspec()
85 BRCMU_CHSPEC_D11AC_SB_SHIFT, ch->sb); in brcmu_d11ac_encchspec()
86 brcmu_maskset16(&ch->chspec, BRCMU_CHSPEC_D11AC_BW_MASK, in brcmu_d11ac_encchspec()
87 0, d11ac_bw(ch->bw)); in brcmu_d11ac_encchspec()
89 ch->chspec &= ~BRCMU_CHSPEC_D11AC_BND_MASK; in brcmu_d11ac_encchspec()
90 if (ch->chnum <= CH_MAX_2G_CHANNEL) in brcmu_d11ac_encchspec()
91 ch->chspec |= BRCMU_CHSPEC_D11AC_BND_2G; in brcmu_d11ac_encchspec()
93 ch->chspec |= BRCMU_CHSPEC_D11AC_BND_5G; in brcmu_d11ac_encchspec()
96 static void brcmu_d11n_decchspec(struct brcmu_chan *ch) in brcmu_d11n_decchspec() argument
100 ch->chnum = (u8)(ch->chspec & BRCMU_CHSPEC_CH_MASK); in brcmu_d11n_decchspec()
101 ch->control_ch_num = ch->chnum; in brcmu_d11n_decchspec()
103 switch (ch->chspec & BRCMU_CHSPEC_D11N_BW_MASK) { in brcmu_d11n_decchspec()
105 ch->bw = BRCMU_CHAN_BW_20; in brcmu_d11n_decchspec()
106 ch->sb = BRCMU_CHAN_SB_NONE; in brcmu_d11n_decchspec()
109 ch->bw = BRCMU_CHAN_BW_40; in brcmu_d11n_decchspec()
110 val = ch->chspec & BRCMU_CHSPEC_D11N_SB_MASK; in brcmu_d11n_decchspec()
112 ch->sb = BRCMU_CHAN_SB_L; in brcmu_d11n_decchspec()
113 ch->control_ch_num -= CH_10MHZ_APART; in brcmu_d11n_decchspec()
115 ch->sb = BRCMU_CHAN_SB_U; in brcmu_d11n_decchspec()
116 ch->control_ch_num += CH_10MHZ_APART; in brcmu_d11n_decchspec()
120 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11n_decchspec()
124 switch (ch->chspec & BRCMU_CHSPEC_D11N_BND_MASK) { in brcmu_d11n_decchspec()
126 ch->band = BRCMU_CHAN_BAND_5G; in brcmu_d11n_decchspec()
129 ch->band = BRCMU_CHAN_BAND_2G; in brcmu_d11n_decchspec()
132 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11n_decchspec()
137 static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) in brcmu_d11ac_decchspec() argument
141 ch->chnum = (u8)(ch->chspec & BRCMU_CHSPEC_CH_MASK); in brcmu_d11ac_decchspec()
142 ch->control_ch_num = ch->chnum; in brcmu_d11ac_decchspec()
144 switch (ch->chspec & BRCMU_CHSPEC_D11AC_BW_MASK) { in brcmu_d11ac_decchspec()
146 ch->bw = BRCMU_CHAN_BW_20; in brcmu_d11ac_decchspec()
147 ch->sb = BRCMU_CHAN_SB_NONE; in brcmu_d11ac_decchspec()
150 ch->bw = BRCMU_CHAN_BW_40; in brcmu_d11ac_decchspec()
151 val = ch->chspec & BRCMU_CHSPEC_D11AC_SB_MASK; in brcmu_d11ac_decchspec()
153 ch->sb = BRCMU_CHAN_SB_L; in brcmu_d11ac_decchspec()
154 ch->control_ch_num -= CH_10MHZ_APART; in brcmu_d11ac_decchspec()
156 ch->sb = BRCMU_CHAN_SB_U; in brcmu_d11ac_decchspec()
157 ch->control_ch_num += CH_10MHZ_APART; in brcmu_d11ac_decchspec()
159 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11ac_decchspec()
163 ch->bw = BRCMU_CHAN_BW_80; in brcmu_d11ac_decchspec()
164 ch->sb = brcmu_maskget16(ch->chspec, BRCMU_CHSPEC_D11AC_SB_MASK, in brcmu_d11ac_decchspec()
166 switch (ch->sb) { in brcmu_d11ac_decchspec()
168 ch->control_ch_num -= CH_30MHZ_APART; in brcmu_d11ac_decchspec()
171 ch->control_ch_num -= CH_10MHZ_APART; in brcmu_d11ac_decchspec()
174 ch->control_ch_num += CH_10MHZ_APART; in brcmu_d11ac_decchspec()
177 ch->control_ch_num += CH_30MHZ_APART; in brcmu_d11ac_decchspec()
180 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11ac_decchspec()
185 ch->bw = BRCMU_CHAN_BW_160; in brcmu_d11ac_decchspec()
186 ch->sb = brcmu_maskget16(ch->chspec, BRCMU_CHSPEC_D11AC_SB_MASK, in brcmu_d11ac_decchspec()
188 switch (ch->sb) { in brcmu_d11ac_decchspec()
190 ch->control_ch_num -= CH_70MHZ_APART; in brcmu_d11ac_decchspec()
193 ch->control_ch_num -= CH_50MHZ_APART; in brcmu_d11ac_decchspec()
196 ch->control_ch_num -= CH_30MHZ_APART; in brcmu_d11ac_decchspec()
199 ch->control_ch_num -= CH_10MHZ_APART; in brcmu_d11ac_decchspec()
202 ch->control_ch_num += CH_10MHZ_APART; in brcmu_d11ac_decchspec()
205 ch->control_ch_num += CH_30MHZ_APART; in brcmu_d11ac_decchspec()
208 ch->control_ch_num += CH_50MHZ_APART; in brcmu_d11ac_decchspec()
211 ch->control_ch_num += CH_70MHZ_APART; in brcmu_d11ac_decchspec()
214 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11ac_decchspec()
220 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11ac_decchspec()
224 switch (ch->chspec & BRCMU_CHSPEC_D11AC_BND_MASK) { in brcmu_d11ac_decchspec()
226 ch->band = BRCMU_CHAN_BAND_5G; in brcmu_d11ac_decchspec()
229 ch->band = BRCMU_CHAN_BAND_2G; in brcmu_d11ac_decchspec()
232 WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); in brcmu_d11ac_decchspec()