| .. | .. |
|---|
| 49 | 49 | tx_agc[RF_PATH_B] = 0x3f3f3f3f; |
|---|
| 50 | 50 | for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) { |
|---|
| 51 | 51 | tx_agc[idx1] = powerlevel[idx1] | |
|---|
| 52 | | - (powerlevel[idx1]<<8) | |
|---|
| 53 | | - (powerlevel[idx1]<<16) | |
|---|
| 54 | | - (powerlevel[idx1]<<24); |
|---|
| 52 | + (powerlevel[idx1] << 8) | |
|---|
| 53 | + (powerlevel[idx1] << 16) | |
|---|
| 54 | + (powerlevel[idx1] << 24); |
|---|
| 55 | 55 | } |
|---|
| 56 | 56 | } else { |
|---|
| 57 | 57 | if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) { |
|---|
| .. | .. |
|---|
| 63 | 63 | } else { |
|---|
| 64 | 64 | for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) { |
|---|
| 65 | 65 | tx_agc[idx1] = powerlevel[idx1] | |
|---|
| 66 | | - (powerlevel[idx1]<<8) | |
|---|
| 67 | | - (powerlevel[idx1]<<16) | |
|---|
| 68 | | - (powerlevel[idx1]<<24); |
|---|
| 66 | + (powerlevel[idx1] << 8) | |
|---|
| 67 | + (powerlevel[idx1] << 16) | |
|---|
| 68 | + (powerlevel[idx1] << 24); |
|---|
| 69 | 69 | } |
|---|
| 70 | 70 | if (hal_data->EEPROMRegulatory == 0) { |
|---|
| 71 | 71 | tmpval = hal_data->MCSTxPowerLevelOriginalOffset[0][6] + |
|---|
| 72 | | - (hal_data->MCSTxPowerLevelOriginalOffset[0][7]<<8); |
|---|
| 72 | + (hal_data->MCSTxPowerLevelOriginalOffset[0][7] << 8); |
|---|
| 73 | 73 | tx_agc[RF_PATH_A] += tmpval; |
|---|
| 74 | 74 | |
|---|
| 75 | 75 | tmpval = hal_data->MCSTxPowerLevelOriginalOffset[0][14] + |
|---|
| 76 | | - (hal_data->MCSTxPowerLevelOriginalOffset[0][15]<<24); |
|---|
| 76 | + (hal_data->MCSTxPowerLevelOriginalOffset[0][15] << 24); |
|---|
| 77 | 77 | tx_agc[RF_PATH_B] += tmpval; |
|---|
| 78 | 78 | } |
|---|
| 79 | 79 | } |
|---|
| 80 | 80 | } |
|---|
| 81 | 81 | for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) { |
|---|
| 82 | | - ptr = (u8 *)(&(tx_agc[idx1])); |
|---|
| 82 | + ptr = (u8 *)(&tx_agc[idx1]); |
|---|
| 83 | 83 | for (idx2 = 0; idx2 < 4; idx2++) { |
|---|
| 84 | 84 | if (*ptr > RF6052_MAX_TX_PWR) |
|---|
| 85 | 85 | *ptr = RF6052_MAX_TX_PWR; |
|---|
| .. | .. |
|---|
| 100 | 100 | } |
|---|
| 101 | 101 | |
|---|
| 102 | 102 | /* rf-A cck tx power */ |
|---|
| 103 | | - tmpval = tx_agc[RF_PATH_A]&0xff; |
|---|
| 103 | + tmpval = tx_agc[RF_PATH_A] & 0xff; |
|---|
| 104 | 104 | phy_set_bb_reg(adapt, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval); |
|---|
| 105 | | - tmpval = tx_agc[RF_PATH_A]>>8; |
|---|
| 105 | + tmpval = tx_agc[RF_PATH_A] >> 8; |
|---|
| 106 | 106 | phy_set_bb_reg(adapt, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval); |
|---|
| 107 | 107 | |
|---|
| 108 | 108 | /* rf-B cck tx power */ |
|---|
| 109 | | - tmpval = tx_agc[RF_PATH_B]>>24; |
|---|
| 109 | + tmpval = tx_agc[RF_PATH_B] >> 24; |
|---|
| 110 | 110 | phy_set_bb_reg(adapt, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval); |
|---|
| 111 | | - tmpval = tx_agc[RF_PATH_B]&0x00ffffff; |
|---|
| 111 | + tmpval = tx_agc[RF_PATH_B] & 0x00ffffff; |
|---|
| 112 | 112 | phy_set_bb_reg(adapt, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval); |
|---|
| 113 | 113 | } |
|---|
| 114 | 114 | |
|---|
| .. | .. |
|---|
| 124 | 124 | for (i = 0; i < 2; i++) { |
|---|
| 125 | 125 | powerbase0 = pwr_level_ofdm[i]; |
|---|
| 126 | 126 | |
|---|
| 127 | | - powerbase0 = (powerbase0<<24) | (powerbase0<<16) | |
|---|
| 128 | | - (powerbase0<<8) | powerbase0; |
|---|
| 129 | | - *(ofdmbase+i) = powerbase0; |
|---|
| 127 | + powerbase0 = (powerbase0 << 24) | (powerbase0 << 16) | |
|---|
| 128 | + (powerbase0 << 8) | powerbase0; |
|---|
| 129 | + *(ofdmbase + i) = powerbase0; |
|---|
| 130 | 130 | } |
|---|
| 131 | 131 | /* Check HT20 to HT40 diff */ |
|---|
| 132 | 132 | if (adapt->HalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20) |
|---|
| .. | .. |
|---|
| 134 | 134 | else |
|---|
| 135 | 135 | powerlevel[0] = pwr_level_bw40[0]; |
|---|
| 136 | 136 | powerbase1 = powerlevel[0]; |
|---|
| 137 | | - powerbase1 = (powerbase1<<24) | (powerbase1<<16) | |
|---|
| 138 | | - (powerbase1<<8) | powerbase1; |
|---|
| 137 | + powerbase1 = (powerbase1 << 24) | (powerbase1 << 16) | |
|---|
| 138 | + (powerbase1 << 8) | powerbase1; |
|---|
| 139 | 139 | *mcs_base = powerbase1; |
|---|
| 140 | 140 | } |
|---|
| 141 | + |
|---|
| 141 | 142 | static void get_rx_power_val_by_reg(struct adapter *adapt, u8 channel, |
|---|
| 142 | 143 | u8 index, u32 *powerbase0, u32 *powerbase1, |
|---|
| 143 | 144 | u32 *out_val) |
|---|
| .. | .. |
|---|
| 157 | 158 | switch (regulatory) { |
|---|
| 158 | 159 | case 0: |
|---|
| 159 | 160 | chnlGroup = 0; |
|---|
| 160 | | - write_val = hal_data->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf ? 8 : 0)] + |
|---|
| 161 | + write_val = hal_data->MCSTxPowerLevelOriginalOffset[chnlGroup][index + (rf ? 8 : 0)] + |
|---|
| 161 | 162 | ((index < 2) ? powerbase0[rf] : powerbase1[rf]); |
|---|
| 162 | 163 | break; |
|---|
| 163 | 164 | case 1: /* Realtek regulatory */ |
|---|
| 164 | 165 | /* increase power diff defined by Realtek for regulatory */ |
|---|
| 165 | 166 | if (hal_data->pwrGroupCnt == 1) |
|---|
| 166 | 167 | chnlGroup = 0; |
|---|
| 167 | | - if (hal_data->pwrGroupCnt >= hal_data->PGMaxGroup) { |
|---|
| 168 | | - if (channel < 3) |
|---|
| 169 | | - chnlGroup = 0; |
|---|
| 170 | | - else if (channel < 6) |
|---|
| 171 | | - chnlGroup = 1; |
|---|
| 172 | | - else if (channel < 9) |
|---|
| 173 | | - chnlGroup = 2; |
|---|
| 174 | | - else if (channel < 12) |
|---|
| 175 | | - chnlGroup = 3; |
|---|
| 176 | | - else if (channel < 14) |
|---|
| 177 | | - chnlGroup = 4; |
|---|
| 178 | | - else if (channel == 14) |
|---|
| 179 | | - chnlGroup = 5; |
|---|
| 180 | | - } |
|---|
| 181 | | - write_val = hal_data->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf ? 8 : 0)] + |
|---|
| 168 | + if (hal_data->pwrGroupCnt >= hal_data->PGMaxGroup) |
|---|
| 169 | + Hal_GetChnlGroup88E(channel, &chnlGroup); |
|---|
| 170 | + |
|---|
| 171 | + write_val = hal_data->MCSTxPowerLevelOriginalOffset[chnlGroup][index + (rf ? 8 : 0)] + |
|---|
| 182 | 172 | ((index < 2) ? powerbase0[rf] : powerbase1[rf]); |
|---|
| 183 | 173 | break; |
|---|
| 184 | 174 | case 2: /* Better regulatory */ |
|---|
| .. | .. |
|---|
| 190 | 180 | chnlGroup = 0; |
|---|
| 191 | 181 | |
|---|
| 192 | 182 | if (index < 2) |
|---|
| 193 | | - pwr_diff = hal_data->TxPwrLegacyHtDiff[rf][channel-1]; |
|---|
| 183 | + pwr_diff = hal_data->TxPwrLegacyHtDiff[rf][channel - 1]; |
|---|
| 194 | 184 | else if (hal_data->CurrentChannelBW == HT_CHANNEL_WIDTH_20) |
|---|
| 195 | | - pwr_diff = hal_data->TxPwrHt20Diff[rf][channel-1]; |
|---|
| 185 | + pwr_diff = hal_data->TxPwrHt20Diff[rf][channel - 1]; |
|---|
| 196 | 186 | |
|---|
| 197 | 187 | if (hal_data->CurrentChannelBW == HT_CHANNEL_WIDTH_40) |
|---|
| 198 | | - customer_pwr_limit = hal_data->PwrGroupHT40[rf][channel-1]; |
|---|
| 188 | + customer_pwr_limit = hal_data->PwrGroupHT40[rf][channel - 1]; |
|---|
| 199 | 189 | else |
|---|
| 200 | | - customer_pwr_limit = hal_data->PwrGroupHT20[rf][channel-1]; |
|---|
| 190 | + customer_pwr_limit = hal_data->PwrGroupHT20[rf][channel - 1]; |
|---|
| 201 | 191 | |
|---|
| 202 | 192 | if (pwr_diff >= customer_pwr_limit) |
|---|
| 203 | 193 | pwr_diff = 0; |
|---|
| .. | .. |
|---|
| 211 | 201 | if (pwr_diff_limit[i] > pwr_diff) |
|---|
| 212 | 202 | pwr_diff_limit[i] = pwr_diff; |
|---|
| 213 | 203 | } |
|---|
| 214 | | - customer_limit = (pwr_diff_limit[3]<<24) | |
|---|
| 215 | | - (pwr_diff_limit[2]<<16) | |
|---|
| 216 | | - (pwr_diff_limit[1]<<8) | |
|---|
| 204 | + customer_limit = (pwr_diff_limit[3] << 24) | |
|---|
| 205 | + (pwr_diff_limit[2] << 16) | |
|---|
| 206 | + (pwr_diff_limit[1] << 8) | |
|---|
| 217 | 207 | (pwr_diff_limit[0]); |
|---|
| 218 | 208 | write_val = customer_limit + ((index < 2) ? powerbase0[rf] : powerbase1[rf]); |
|---|
| 219 | 209 | break; |
|---|
| .. | .. |
|---|
| 232 | 222 | else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2) |
|---|
| 233 | 223 | write_val = 0x00000000; |
|---|
| 234 | 224 | |
|---|
| 235 | | - *(out_val+rf) = write_val; |
|---|
| 225 | + *(out_val + rf) = write_val; |
|---|
| 236 | 226 | } |
|---|
| 237 | 227 | } |
|---|
| 238 | 228 | |
|---|
| .. | .. |
|---|
| 251 | 241 | for (rf = 0; rf < 2; rf++) { |
|---|
| 252 | 242 | write_val = pvalue[rf]; |
|---|
| 253 | 243 | for (i = 0; i < 4; i++) { |
|---|
| 254 | | - pwr_val[i] = (u8)((write_val & (0x7f<<(i*8)))>>(i*8)); |
|---|
| 244 | + pwr_val[i] = (u8)((write_val & (0x7f << (i * 8))) >> (i * 8)); |
|---|
| 255 | 245 | if (pwr_val[i] > RF6052_MAX_TX_PWR) |
|---|
| 256 | 246 | pwr_val[i] = RF6052_MAX_TX_PWR; |
|---|
| 257 | 247 | } |
|---|
| 258 | | - write_val = (pwr_val[3]<<24) | (pwr_val[2]<<16) | |
|---|
| 259 | | - (pwr_val[1]<<8) | pwr_val[0]; |
|---|
| 248 | + write_val = (pwr_val[3] << 24) | (pwr_val[2] << 16) | |
|---|
| 249 | + (pwr_val[1] << 8) | pwr_val[0]; |
|---|
| 260 | 250 | |
|---|
| 261 | 251 | if (rf == 0) |
|---|
| 262 | 252 | regoffset = regoffset_a[index]; |
|---|