Lines Matching +full:j +full:- +full:to +full:- +full:k

1 /*-
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
63 struct r12a_softc *rs = sc->sc_priv; in r12a_parse_rom_common()
65 int i, j, k; in r12a_parse_rom_common() local
67 sc->thermal_meter = rom->thermal_meter; in r12a_parse_rom_common()
68 rs->crystalcap = RTWN_GET_ROM_VAR(rom->crystalcap, in r12a_parse_rom_common()
70 rs->tx_bbswing_2g = RTWN_GET_ROM_VAR(rom->tx_bbswing_2g, 0); in r12a_parse_rom_common()
71 rs->tx_bbswing_5g = RTWN_GET_ROM_VAR(rom->tx_bbswing_5g, 0); in r12a_parse_rom_common()
73 for (i = 0; i < sc->ntxchains; i++) { in r12a_parse_rom_common()
74 struct r12a_tx_pwr_2g *pwr_2g = &rom->tx_pwr[i].pwr_2g; in r12a_parse_rom_common()
75 struct r12a_tx_pwr_5g *pwr_5g = &rom->tx_pwr[i].pwr_5g; in r12a_parse_rom_common()
77 &rom->tx_pwr[i].pwr_diff_2g; in r12a_parse_rom_common()
79 &rom->tx_pwr[i].pwr_diff_5g; in r12a_parse_rom_common()
81 for (j = 0; j < R12A_GROUP_2G - 1; j++) { in r12a_parse_rom_common()
82 rs->cck_tx_pwr[i][j] = in r12a_parse_rom_common()
83 RTWN_GET_ROM_VAR(pwr_2g->cck[j], in r12a_parse_rom_common()
85 rs->ht40_tx_pwr_2g[i][j] = in r12a_parse_rom_common()
86 RTWN_GET_ROM_VAR(pwr_2g->ht40[j], in r12a_parse_rom_common()
89 rs->cck_tx_pwr[i][j] = RTWN_GET_ROM_VAR(pwr_2g->cck[j], in r12a_parse_rom_common()
92 rs->cck_tx_pwr_diff_2g[i][0] = 0; in r12a_parse_rom_common()
93 rs->ofdm_tx_pwr_diff_2g[i][0] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
94 MS(pwr_diff_2g->ht20_ofdm, LOW_PART)); in r12a_parse_rom_common()
95 rs->bw20_tx_pwr_diff_2g[i][0] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
96 MS(pwr_diff_2g->ht20_ofdm, HIGH_PART)); in r12a_parse_rom_common()
97 rs->bw40_tx_pwr_diff_2g[i][0] = 0; in r12a_parse_rom_common()
99 for (j = 1, k = 0; k < nitems(pwr_diff_2g->diff123); j++, k++) { in r12a_parse_rom_common()
100 rs->cck_tx_pwr_diff_2g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
101 MS(pwr_diff_2g->diff123[k].ofdm_cck, LOW_PART)); in r12a_parse_rom_common()
102 rs->ofdm_tx_pwr_diff_2g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
103 MS(pwr_diff_2g->diff123[k].ofdm_cck, HIGH_PART)); in r12a_parse_rom_common()
104 rs->bw20_tx_pwr_diff_2g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
105 MS(pwr_diff_2g->diff123[k].ht40_ht20, LOW_PART)); in r12a_parse_rom_common()
106 rs->bw40_tx_pwr_diff_2g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
107 MS(pwr_diff_2g->diff123[k].ht40_ht20, HIGH_PART)); in r12a_parse_rom_common()
110 for (j = 0; j < R12A_GROUP_5G; j++) { in r12a_parse_rom_common()
111 rs->ht40_tx_pwr_5g[i][j] = in r12a_parse_rom_common()
112 RTWN_GET_ROM_VAR(pwr_5g->ht40[j], in r12a_parse_rom_common()
116 rs->ofdm_tx_pwr_diff_5g[i][0] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
117 MS(pwr_diff_5g->ht20_ofdm, LOW_PART)); in r12a_parse_rom_common()
118 rs->ofdm_tx_pwr_diff_5g[i][1] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
119 MS(pwr_diff_5g->ofdm_ofdm[0], HIGH_PART)); in r12a_parse_rom_common()
120 rs->ofdm_tx_pwr_diff_5g[i][2] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
121 MS(pwr_diff_5g->ofdm_ofdm[0], LOW_PART)); in r12a_parse_rom_common()
122 rs->ofdm_tx_pwr_diff_5g[i][3] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
123 MS(pwr_diff_5g->ofdm_ofdm[1], LOW_PART)); in r12a_parse_rom_common()
125 rs->bw20_tx_pwr_diff_5g[i][0] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
126 MS(pwr_diff_5g->ht20_ofdm, HIGH_PART)); in r12a_parse_rom_common()
127 rs->bw40_tx_pwr_diff_5g[i][0] = 0; in r12a_parse_rom_common()
128 for (j = 1, k = 0; k < nitems(pwr_diff_5g->ht40_ht20); in r12a_parse_rom_common()
129 j++, k++) { in r12a_parse_rom_common()
130 rs->bw20_tx_pwr_diff_5g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
131 MS(pwr_diff_5g->ht40_ht20[k], LOW_PART)); in r12a_parse_rom_common()
132 rs->bw40_tx_pwr_diff_5g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
133 MS(pwr_diff_5g->ht40_ht20[k], HIGH_PART)); in r12a_parse_rom_common()
136 for (j = 0; j < nitems(pwr_diff_5g->ht80_ht160); j++) { in r12a_parse_rom_common()
137 rs->bw80_tx_pwr_diff_5g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
138 MS(pwr_diff_5g->ht80_ht160[j], HIGH_PART)); in r12a_parse_rom_common()
139 rs->bw160_tx_pwr_diff_5g[i][j] = RTWN_SIGN4TO8( in r12a_parse_rom_common()
140 MS(pwr_diff_5g->ht80_ht160[j], LOW_PART)); in r12a_parse_rom_common()
144 rs->regulatory = MS(rom->rf_board_opt, R92C_ROM_RF1_REGULATORY); in r12a_parse_rom_common()
145 rs->board_type = in r12a_parse_rom_common()
146 MS(RTWN_GET_ROM_VAR(rom->rf_board_opt, R92C_BOARD_TYPE_DONGLE), in r12a_parse_rom_common()
149 __func__, rs->regulatory); in r12a_parse_rom_common()
155 struct r12a_softc *rs = sc->sc_priv; in r12a_parse_rom()
160 pa_type = RTWN_GET_ROM_VAR(rom->pa_type, 0); in r12a_parse_rom()
161 lna_type_2g = RTWN_GET_ROM_VAR(rom->lna_type_2g, 0); in r12a_parse_rom()
162 lna_type_5g = RTWN_GET_ROM_VAR(rom->lna_type_5g, 0); in r12a_parse_rom()
164 rs->ext_pa_2g = R12A_ROM_IS_PA_EXT_2GHZ(pa_type); in r12a_parse_rom()
165 rs->ext_pa_5g = R12A_ROM_IS_PA_EXT_5GHZ(pa_type); in r12a_parse_rom()
166 rs->ext_lna_2g = R21A_ROM_IS_LNA_EXT(lna_type_2g); in r12a_parse_rom()
167 rs->ext_lna_5g = R21A_ROM_IS_LNA_EXT(lna_type_5g); in r12a_parse_rom()
168 rs->bt_coex = (MS(rom->rf_board_opt, R92C_ROM_RF1_BOARD_TYPE) == in r12a_parse_rom()
170 rs->bt_ant_num = (rom->rf_bt_opt & R12A_RF_BT_OPT_ANT_NUM); in r12a_parse_rom()
172 if (rs->ext_pa_2g) { in r12a_parse_rom()
173 rs->type_pa_2g = in r12a_parse_rom()
177 if (rs->ext_pa_5g) { in r12a_parse_rom()
178 rs->type_pa_5g = in r12a_parse_rom()
182 if (rs->ext_lna_2g) { in r12a_parse_rom()
183 rs->type_lna_2g = in r12a_parse_rom()
187 if (rs->ext_lna_5g) { in r12a_parse_rom()
188 rs->type_lna_5g = in r12a_parse_rom()
193 if (rom->rfe_option & 0x80) { in r12a_parse_rom()
194 if (rs->ext_lna_5g) { in r12a_parse_rom()
195 if (rs->ext_pa_5g) { in r12a_parse_rom()
196 if (rs->ext_pa_2g && rs->ext_lna_2g) in r12a_parse_rom()
197 rs->rfe_type = 3; in r12a_parse_rom()
199 rs->rfe_type = 0; in r12a_parse_rom()
201 rs->rfe_type = 2; in r12a_parse_rom()
203 rs->rfe_type = 4; in r12a_parse_rom()
205 rs->rfe_type = rom->rfe_option & 0x3f; in r12a_parse_rom()
208 if (rs->rfe_type == 4 && in r12a_parse_rom()
209 rs->ext_pa_2g && rs->ext_lna_2g && in r12a_parse_rom()
210 rs->ext_pa_5g && rs->ext_lna_5g) in r12a_parse_rom()
211 rs->rfe_type = 0; in r12a_parse_rom()
215 IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr_12a); in r12a_parse_rom()