Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: brcm80211: s/int16/s16/

Use the kernel types, don't invent your own.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+270 -275
+1 -1
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
··· 182 182 struct wl_cfg80211_bss_info { 183 183 u16 band; 184 184 u16 channel; 185 - int16 rssi; 185 + s16 rssi; 186 186 u16 frame_len; 187 187 u8 frame_buf[1]; 188 188 };
+1 -1
drivers/staging/brcm80211/include/bcmutils.h
··· 324 324 "bool", \ 325 325 "s8", \ 326 326 "u8", \ 327 - "int16", \ 327 + "s16", \ 328 328 "u16", \ 329 329 "int32", \ 330 330 "uint32", \
+21 -21
drivers/staging/brcm80211/include/qmath.h
··· 19 19 20 20 #include <typedefs.h> 21 21 22 - int16 qm_sat32(int32 op); 22 + s16 qm_sat32(int32 op); 23 23 24 - int32 qm_mul321616(int16 op1, int16 op2); 24 + int32 qm_mul321616(s16 op1, s16 op2); 25 25 26 - int16 qm_mul16(int16 op1, int16 op2); 26 + s16 qm_mul16(s16 op1, s16 op2); 27 27 28 - int32 qm_muls321616(int16 op1, int16 op2); 28 + int32 qm_muls321616(s16 op1, s16 op2); 29 29 30 30 u16 qm_mulu16(u16 op1, u16 op2); 31 31 32 - int16 qm_muls16(int16 op1, int16 op2); 32 + s16 qm_muls16(s16 op1, s16 op2); 33 33 34 34 int32 qm_add32(int32 op1, int32 op2); 35 35 36 - int16 qm_add16(int16 op1, int16 op2); 36 + s16 qm_add16(s16 op1, s16 op2); 37 37 38 - int16 qm_sub16(int16 op1, int16 op2); 38 + s16 qm_sub16(s16 op1, s16 op2); 39 39 40 40 int32 qm_sub32(int32 op1, int32 op2); 41 41 42 - int32 qm_mac321616(int32 acc, int16 op1, int16 op2); 42 + int32 qm_mac321616(int32 acc, s16 op1, s16 op2); 43 43 44 44 int32 qm_shl32(int32 op, int shift); 45 45 46 46 int32 qm_shr32(int32 op, int shift); 47 47 48 - int16 qm_shl16(int16 op, int shift); 48 + s16 qm_shl16(s16 op, int shift); 49 49 50 - int16 qm_shr16(int16 op, int shift); 50 + s16 qm_shr16(s16 op, int shift); 51 51 52 - int16 qm_norm16(int16 op); 52 + s16 qm_norm16(s16 op); 53 53 54 - int16 qm_norm32(int32 op); 54 + s16 qm_norm32(int32 op); 55 55 56 - int16 qm_div_s(int16 num, int16 denom); 56 + s16 qm_div_s(s16 num, s16 denom); 57 57 58 - int16 qm_abs16(int16 op); 58 + s16 qm_abs16(s16 op); 59 59 60 - int16 qm_div16(int16 num, int16 denom, int16 *qQuotient); 60 + s16 qm_div16(s16 num, s16 denom, s16 *qQuotient); 61 61 62 62 int32 qm_abs32(int32 op); 63 63 64 - int16 qm_div163232(int32 num, int32 denom, int16 *qquotient); 64 + s16 qm_div163232(int32 num, int32 denom, s16 *qquotient); 65 65 66 - int32 qm_mul323216(int32 op1, int16 op2); 66 + int32 qm_mul323216(int32 op1, s16 op2); 67 67 68 - int32 qm_mulsu321616(int16 op1, u16 op2); 68 + int32 qm_mulsu321616(s16 op1, u16 op2); 69 69 70 - int32 qm_muls323216(int32 op1, int16 op2); 70 + int32 qm_muls323216(int32 op1, s16 op2); 71 71 72 72 int32 qm_mul32(int32 a, int32 b); 73 73 74 74 int32 qm_muls32(int32 a, int32 b); 75 75 76 - void qm_log10(int32 N, int16 qN, int16 *log10N, int16 *qLog10N); 76 + void qm_log10(int32 N, s16 qN, s16 *log10N, s16 *qLog10N); 77 77 78 - void qm_1byN(int32 N, int16 qN, int32 *result, int16 *qResult); 78 + void qm_1byN(int32 N, s16 qN, int32 *result, s16 *qResult); 79 79 80 80 #endif /* #ifndef __QMATH_H__ */
+1 -6
drivers/staging/brcm80211/include/typedefs.h
··· 42 42 typedef unsigned int uint; 43 43 #endif 44 44 45 - /* define [u]int16/32/64, uintptr */ 45 + /* define [u]int32/64, uintptr */ 46 46 47 47 #ifndef TYPEDEF_UINT32 48 48 typedef unsigned int uint32; ··· 50 50 51 51 #ifndef TYPEDEF_UINTPTR 52 52 typedef unsigned int uintptr; 53 - #endif 54 - 55 - #ifndef TYPEDEF_INT16 56 - typedef signed short int16; 57 53 #endif 58 54 59 55 #ifndef TYPEDEF_INT32 ··· 79 83 #undef TYPEDEF_UINT 80 84 #undef TYPEDEF_UINT32 81 85 #undef TYPEDEF_UINTPTR 82 - #undef TYPEDEF_INT16 83 86 #undef TYPEDEF_INT32 84 87 85 88 /*
+4 -4
drivers/staging/brcm80211/include/wlioctl.h
··· 55 55 u8 channel; /* Channel no. */ 56 56 u16 atim_window; /* units are Kusec */ 57 57 u8 dtim_period; /* DTIM period */ 58 - int16 RSSI; /* receive signal strength (in dBm) */ 58 + s16 RSSI; /* receive signal strength (in dBm) */ 59 59 s8 phy_noise; /* noise (in dBm) */ 60 60 uint32 ie_length; /* byte length of Information Elements */ 61 61 /* variable length Information Elements */ ··· 88 88 chanspec_t chanspec; /* chanspec for bss */ 89 89 u16 atim_window; /* units are Kusec */ 90 90 u8 dtim_period; /* DTIM period */ 91 - int16 RSSI; /* receive signal strength (in dBm) */ 91 + s16 RSSI; /* receive signal strength (in dBm) */ 92 92 s8 phy_noise; /* noise (in dBm) */ 93 93 94 94 u8 n_cap; /* BSS is 802.11N Capable */ ··· 132 132 chanspec_t chanspec; /* chanspec for bss */ 133 133 u16 atim_window; /* units are Kusec */ 134 134 u8 dtim_period; /* DTIM period */ 135 - int16 RSSI; /* receive signal strength (in dBm) */ 135 + s16 RSSI; /* receive signal strength (in dBm) */ 136 136 s8 phy_noise; /* noise (in dBm) */ 137 137 138 138 u8 n_cap; /* BSS is 802.11N Capable */ ··· 145 145 146 146 u16 ie_offset; /* offset at which IEs start, from beginning */ 147 147 uint32 ie_length; /* byte length of Information Elements */ 148 - int16 SNR; /* average SNR of during frame reception */ 148 + s16 SNR; /* average SNR of during frame reception */ 149 149 /* Add new fields here */ 150 150 /* variable length Information Elements */ 151 151 } wl_bss_info_t;
+5 -5
drivers/staging/brcm80211/phy/wlc_phy_cmn.c
··· 2274 2274 2275 2275 static uint32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi) 2276 2276 { 2277 - int16 tx0_status, tx1_status; 2277 + s16 tx0_status, tx1_status; 2278 2278 u16 estPower1, estPower2; 2279 2279 u8 pwr0, pwr1, adj_pwr0, adj_pwr1; 2280 2280 uint32 est_pwr; ··· 3119 3119 3120 3120 void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason) 3121 3121 { 3122 - int16 nphy_currtemp = 0; 3123 - int16 delta_temp = 0; 3122 + s16 nphy_currtemp = 0; 3123 + s16 delta_temp = 0; 3124 3124 bool do_periodic_cal = TRUE; 3125 3125 phy_info_t *pi = (phy_info_t *) pih; 3126 3126 ··· 3171 3171 nphy_currtemp - pi->nphy_lastcal_temp : 3172 3172 pi->nphy_lastcal_temp - nphy_currtemp; 3173 3173 3174 - if ((delta_temp < (int16) pi->phycal_tempdelta) && 3174 + if ((delta_temp < (s16) pi->phycal_tempdelta) && 3175 3175 (pi->nphy_txiqlocal_chanspec == 3176 3176 pi->radio_chanspec)) { 3177 3177 do_periodic_cal = FALSE; ··· 3271 3271 3272 3272 u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih) 3273 3273 { 3274 - int16 nphy_currtemp; 3274 + s16 nphy_currtemp; 3275 3275 u8 active_bitmap; 3276 3276 phy_info_t *pi = (phy_info_t *) pih; 3277 3277
+43 -43
drivers/staging/brcm80211/phy/wlc_phy_int.h
··· 345 345 u16 badplcp_ma_total; 346 346 u16 badplcp_ma_list[MA_WINDOW_SZ]; 347 347 int badplcp_ma_index; 348 - int16 pre_badplcp_cnt; 349 - int16 bphy_pre_badplcp_cnt; 348 + s16 pre_badplcp_cnt; 349 + s16 bphy_pre_badplcp_cnt; 350 350 351 351 u16 init_gain_core1; 352 352 u16 init_gain_core2; ··· 358 358 u16 crsminpwrl0; 359 359 u16 crsminpwru0; 360 360 361 - int16 crsminpwr_index; 361 + s16 crsminpwr_index; 362 362 363 363 u16 radio_2057_core1_rssi_wb1a_gc_stored; 364 364 u16 radio_2057_core2_rssi_wb1a_gc_stored; ··· 413 413 } lo_complex_abgphy_info_t; 414 414 415 415 typedef struct _nphy_iq_comp { 416 - int16 a0; 417 - int16 b0; 418 - int16 a1; 419 - int16 b1; 416 + s16 a0; 417 + s16 b0; 418 + s16 a1; 419 + s16 b1; 420 420 } nphy_iq_comp_t; 421 421 422 422 typedef struct _nphy_txpwrindex { ··· 446 446 typedef struct _nphy_pwrctrl { 447 447 s8 max_pwr_2g; 448 448 s8 idle_targ_2g; 449 - int16 pwrdet_2g_a1; 450 - int16 pwrdet_2g_b0; 451 - int16 pwrdet_2g_b1; 449 + s16 pwrdet_2g_a1; 450 + s16 pwrdet_2g_b0; 451 + s16 pwrdet_2g_b1; 452 452 s8 max_pwr_5gm; 453 453 s8 idle_targ_5gm; 454 454 s8 max_pwr_5gh; 455 455 s8 max_pwr_5gl; 456 - int16 pwrdet_5gm_a1; 457 - int16 pwrdet_5gm_b0; 458 - int16 pwrdet_5gm_b1; 459 - int16 pwrdet_5gl_a1; 460 - int16 pwrdet_5gl_b0; 461 - int16 pwrdet_5gl_b1; 462 - int16 pwrdet_5gh_a1; 463 - int16 pwrdet_5gh_b0; 464 - int16 pwrdet_5gh_b1; 456 + s16 pwrdet_5gm_a1; 457 + s16 pwrdet_5gm_b0; 458 + s16 pwrdet_5gm_b1; 459 + s16 pwrdet_5gl_a1; 460 + s16 pwrdet_5gl_b0; 461 + s16 pwrdet_5gl_b1; 462 + s16 pwrdet_5gh_a1; 463 + s16 pwrdet_5gh_b0; 464 + s16 pwrdet_5gh_b1; 465 465 s8 idle_targ_5gl; 466 466 s8 idle_targ_5gh; 467 467 s8 idle_tssi_2g; 468 468 s8 idle_tssi_5g; 469 469 s8 idle_tssi; 470 - int16 a1; 471 - int16 b0; 472 - int16 b1; 470 + s16 a1; 471 + s16 b0; 472 + s16 b1; 473 473 } phy_pwrctrl_t; 474 474 475 475 typedef struct _nphy_txgains { ··· 634 634 bool disable_percal; 635 635 mbool measure_hold; 636 636 637 - int16 txpa_2g[PWRTBL_NUM_COEFF]; 638 - int16 txpa_2g_low_temp[PWRTBL_NUM_COEFF]; 639 - int16 txpa_2g_high_temp[PWRTBL_NUM_COEFF]; 640 - int16 txpa_5g_low[PWRTBL_NUM_COEFF]; 641 - int16 txpa_5g_mid[PWRTBL_NUM_COEFF]; 642 - int16 txpa_5g_hi[PWRTBL_NUM_COEFF]; 637 + s16 txpa_2g[PWRTBL_NUM_COEFF]; 638 + s16 txpa_2g_low_temp[PWRTBL_NUM_COEFF]; 639 + s16 txpa_2g_high_temp[PWRTBL_NUM_COEFF]; 640 + s16 txpa_5g_low[PWRTBL_NUM_COEFF]; 641 + s16 txpa_5g_mid[PWRTBL_NUM_COEFF]; 642 + s16 txpa_5g_hi[PWRTBL_NUM_COEFF]; 643 643 644 644 u8 tx_srom_max_2g; 645 645 u8 tx_srom_max_5g_low; ··· 682 682 683 683 bool txpwroverride; 684 684 bool txpwridx_override_aphy; 685 - int16 radiopwr_override; 685 + s16 radiopwr_override; 686 686 u16 hwpwr_txcur; 687 687 u8 saved_txpwr_idx; 688 688 ··· 691 691 uint32 tr_R_gain_val; 692 692 uint32 tr_T_gain_val; 693 693 694 - int16 ofdm_analog_filt_bw_override; 695 - int16 cck_analog_filt_bw_override; 696 - int16 ofdm_rccal_override; 697 - int16 cck_rccal_override; 694 + s16 ofdm_analog_filt_bw_override; 695 + s16 cck_analog_filt_bw_override; 696 + s16 ofdm_rccal_override; 697 + s16 cck_rccal_override; 698 698 u16 extlna_type; 699 699 700 700 uint interference_mode_crs_time; ··· 714 714 s8 phy_scraminit; 715 715 u8 phy_gpiosel; 716 716 717 - int16 phy_txcore_disable_temp; 718 - int16 phy_txcore_enable_temp; 717 + s16 phy_txcore_disable_temp; 718 + s16 phy_txcore_enable_temp; 719 719 s8 phy_tempsense_offset; 720 720 bool phy_txcore_heatedup; 721 721 ··· 729 729 s8 stats_11b_txpower[STATIC_NUM_RF][STATIC_NUM_BB]; 730 730 u16 gain_table[TX_GAIN_TABLE_LENGTH]; 731 731 bool loopback_gain; 732 - int16 max_lpback_gain_hdB; 733 - int16 trsw_rx_gain_hdB; 732 + s16 max_lpback_gain_hdB; 733 + s16 trsw_rx_gain_hdB; 734 734 u8 power_vec[8]; 735 735 736 736 u16 rc_cal; ··· 820 820 u8 nphy_papd_skip; 821 821 u8 nphy_tssi_slope; 822 822 823 - int16 nphy_noise_win[PHY_CORE_MAX][PHY_NOISE_WINDOW_SZ]; 823 + s16 nphy_noise_win[PHY_CORE_MAX][PHY_NOISE_WINDOW_SZ]; 824 824 u8 nphy_noise_index; 825 825 826 826 u8 nphy_txpid2g[PHY_CORE_NUM_2]; ··· 851 851 struct wlapi_timer *phycal_timer; 852 852 bool use_int_tx_iqlo_cal_nphy; 853 853 bool internal_tx_iqlo_cal_tapoff_intpa_nphy; 854 - int16 nphy_lastcal_temp; 854 + s16 nphy_lastcal_temp; 855 855 856 856 txiqcal_cache_t calibration_cache; 857 857 rssical_cache_t rssical_cache; ··· 861 861 uint nphy_papd_last_cal; 862 862 u16 nphy_papd_tx_gain_at_last_cal[2]; 863 863 u8 nphy_papd_cal_gain_index[2]; 864 - int16 nphy_papd_epsilon_offset[2]; 864 + s16 nphy_papd_epsilon_offset[2]; 865 865 bool nphy_papd_recal_enable; 866 866 uint32 nphy_papd_recal_counter; 867 867 bool nphy_force_papd_cal; ··· 912 912 u16 crsminpwr0; 913 913 u16 crsminpwrl0; 914 914 u16 crsminpwru0; 915 - int16 noise_crsminpwr_index; 915 + s16 noise_crsminpwr_index; 916 916 u16 init_gain_core1; 917 917 u16 init_gain_core2; 918 918 u16 init_gainb_core1; ··· 1085 1085 u8 rate_mcs_start); 1086 1086 1087 1087 extern u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode); 1088 - extern int16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode); 1088 + extern s16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode); 1089 1089 extern s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode); 1090 1090 extern s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode); 1091 1091 extern void wlc_phy_carrier_suppress_lcnphy(phy_info_t *pi); ··· 1171 1171 extern void wlc_phy_stf_chain_upd_nphy(phy_info_t *pi); 1172 1172 1173 1173 extern void wlc_phy_force_rfseq_nphy(phy_info_t *pi, u8 cmd); 1174 - extern int16 wlc_phy_tempsense_nphy(phy_info_t *pi); 1174 + extern s16 wlc_phy_tempsense_nphy(phy_info_t *pi); 1175 1175 1176 1176 extern u16 wlc_phy_classifier_nphy(phy_info_t *pi, u16 mask, u16 val); 1177 1177
+45 -45
drivers/staging/brcm80211/phy/wlc_phy_lcn.c
··· 165 165 166 166 typedef struct { 167 167 u8 chan; 168 - int16 a; 169 - int16 b; 168 + s16 a; 169 + s16 b; 170 170 } lcnphy_rx_iqcomp_t; 171 171 172 172 typedef struct { 173 - int16 re; 174 - int16 im; 173 + s16 re; 174 + s16 im; 175 175 } lcnphy_spb_tone_t; 176 176 177 177 typedef struct { ··· 974 974 975 975 #define LCNPHY_IQLOCC_READ(val) ((u8)(-(s8)(((val) & 0xf0) >> 4) + (s8)((val) & 0x0f))) 976 976 #define FIXED_TXPWR 78 977 - #define LCNPHY_TEMPSENSE(val) ((int16)((val > 255) ? (val - 512) : val)) 977 + #define LCNPHY_TEMPSENSE(val) ((s16)((val > 255) ? (val - 512) : val)) 978 978 979 979 static uint32 wlc_lcnphy_qdiv_roundup(uint32 divident, uint32 divisor, 980 980 u8 precision); ··· 1010 1010 const lcnphy_tx_gain_tbl_entry *g); 1011 1011 1012 1012 static void wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, 1013 - u16 thresh, int16 *ptr, int mode); 1014 - static int wlc_lcnphy_calc_floor(int16 coeff, int type); 1013 + u16 thresh, s16 *ptr, int mode); 1014 + static int wlc_lcnphy_calc_floor(s16 coeff, int type); 1015 1015 static void wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi, 1016 1016 u16 *values_to_save); 1017 1017 static void wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi, 1018 1018 u16 *values_to_save); 1019 - static void wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, int16 coeff_x, 1020 - int16 coeff_y); 1019 + static void wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x, 1020 + s16 coeff_y); 1021 1021 static lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type); 1022 1022 static void wlc_lcnphy_a1(phy_info_t *pi, int cal_type, 1023 1023 int num_levels, int step_size_lg2); ··· 1034 1034 static void wlc_lcnphy_rcal(phy_info_t *pi); 1035 1035 static void wlc_lcnphy_txrx_spur_avoidance_mode(phy_info_t *pi, bool enable); 1036 1036 static int wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm, 1037 - int16 filt_type); 1037 + s16 filt_type); 1038 1038 static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b); 1039 1039 1040 1040 void wlc_lcnphy_write_table(phy_info_t *pi, const phytbl_info_t *pti) ··· 1104 1104 return quotient; 1105 1105 } 1106 1106 1107 - static int wlc_lcnphy_calc_floor(int16 coeff_x, int type) 1107 + static int wlc_lcnphy_calc_floor(s16 coeff_x, int type) 1108 1108 { 1109 1109 int k; 1110 1110 k = 0; ··· 1699 1699 static s8 wlc_lcnphy_tempcompensated_txpwrctrl(phy_info_t *pi) 1700 1700 { 1701 1701 s8 index, delta_brd, delta_temp, new_index, tempcorrx; 1702 - int16 manp, meas_temp, temp_diff; 1702 + s16 manp, meas_temp, temp_diff; 1703 1703 bool neg = 0; 1704 1704 u16 temp; 1705 1705 phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy; ··· 2795 2795 2796 2796 void wlc_lcnphy_stop_tx_tone(phy_info_t *pi) 2797 2797 { 2798 - int16 playback_status; 2798 + s16 playback_status; 2799 2799 phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy; 2800 2800 2801 2801 pi->phy_tx_tone_freq = 0; ··· 2975 2975 wlc_lcnphy_set_tx_pwr_by_index(pi, SAVE_txpwrindex); 2976 2976 } 2977 2977 2978 - int16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode) 2978 + s16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode) 2979 2979 { 2980 2980 u16 tempsenseval1, tempsenseval2; 2981 - int16 avg = 0; 2981 + s16 avg = 0; 2982 2982 bool suspend = 0; 2983 2983 2984 2984 if (NORADIO_ENAB(pi->pubpi)) ··· 2996 2996 tempsenseval2 = read_phy_reg(pi, 0x477) & 0x1FF; 2997 2997 2998 2998 if (tempsenseval1 > 255) 2999 - avg = (int16) (tempsenseval1 - 512); 2999 + avg = (s16) (tempsenseval1 - 512); 3000 3000 else 3001 - avg = (int16) tempsenseval1; 3001 + avg = (s16) tempsenseval1; 3002 3002 3003 3003 if (tempsenseval2 > 255) 3004 - avg += (int16) (tempsenseval2 - 512); 3004 + avg += (s16) (tempsenseval2 - 512); 3005 3005 else 3006 - avg += (int16) tempsenseval2; 3006 + avg += (s16) tempsenseval2; 3007 3007 3008 3008 avg /= 2; 3009 3009 ··· 3194 3194 u16 a0_new, b0_new; 3195 3195 lcnphy_iq_est_t iq_est = { 0, 0, 0 }; 3196 3196 int32 a, b, temp; 3197 - int16 iq_nbits, qq_nbits, arsh, brsh; 3197 + s16 iq_nbits, qq_nbits, arsh, brsh; 3198 3198 int32 iq; 3199 3199 uint32 ii, qq; 3200 3200 phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy; ··· 3289 3289 uint32 received_power, rx_pwr_threshold; 3290 3290 u16 old_sslpnCalibClkEnCtrl, old_sslpnRxFeClkEnCtrl; 3291 3291 u16 values_to_save[11]; 3292 - int16 *ptr; 3292 + s16 *ptr; 3293 3293 phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy; 3294 3294 3295 - ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131); 3295 + ptr = MALLOC(pi->sh->osh, sizeof(s16) * 131); 3296 3296 if (NULL == ptr) { 3297 3297 return FALSE; 3298 3298 } ··· 3440 3440 } 3441 3441 3442 3442 cal_done: 3443 - MFREE(pi->sh->osh, ptr, 131 * sizeof(int16)); 3443 + MFREE(pi->sh->osh, ptr, 131 * sizeof(s16)); 3444 3444 return result; 3445 3445 } 3446 3446 ··· 3852 3852 3853 3853 static void 3854 3854 wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, u16 thresh, 3855 - int16 *ptr, int mode) 3855 + s16 *ptr, int mode) 3856 3856 { 3857 3857 uint32 curval1, curval2, stpptr, curptr, strptr, val; 3858 3858 u16 sslpnCalibClkEnCtrl, timer; 3859 3859 u16 old_sslpnCalibClkEnCtrl; 3860 - int16 imag, real; 3860 + s16 imag, real; 3861 3861 phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy; 3862 3862 3863 3863 timer = 0; ··· 3950 3950 } 3951 3951 3952 3952 static void 3953 - wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, int16 coeff_x, int16 coeff_y) 3953 + wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x, s16 coeff_y) 3954 3954 { 3955 3955 u16 di0dq0; 3956 3956 u16 x, y, data_rf; ··· 4036 4036 lcnphy_unsign16_struct phy_c3; 4037 4037 int phy_c4, phy_c5, k, l, j, phy_c6; 4038 4038 u16 phy_c7, phy_c8, phy_c9; 4039 - int16 phy_c10, phy_c11, phy_c12, phy_c13, phy_c14, phy_c15, phy_c16; 4040 - int16 *ptr, phy_c17; 4039 + s16 phy_c10, phy_c11, phy_c12, phy_c13, phy_c14, phy_c15, phy_c16; 4040 + s16 *ptr, phy_c17; 4041 4041 int32 phy_c18, phy_c19; 4042 4042 uint32 phy_c20, phy_c21; 4043 4043 bool phy_c22, phy_c23, phy_c24, phy_c25; ··· 4047 4047 u16 *phy_c32; 4048 4048 phy_c21 = 0; 4049 4049 phy_c10 = phy_c13 = phy_c14 = phy_c8 = 0; 4050 - ptr = MALLOC(pi->sh->osh, sizeof(int16) * 131); 4050 + ptr = MALLOC(pi->sh->osh, sizeof(s16) * 131); 4051 4051 if (NULL == ptr) { 4052 4052 return; 4053 4053 } ··· 4098 4098 4099 4099 phy_c7 = (1 << step_size_lg2); 4100 4100 phy_c3 = wlc_lcnphy_get_cc(pi, cal_type); 4101 - phy_c15 = (int16) phy_c3.re; 4102 - phy_c16 = (int16) phy_c3.im; 4101 + phy_c15 = (s16) phy_c3.re; 4102 + phy_c16 = (s16) phy_c3.im; 4103 4103 if (cal_type == 2) { 4104 4104 if (phy_c3.re > 127) 4105 4105 phy_c15 = phy_c3.re - 256; ··· 4222 4222 write_radio_reg(pi, RADIO_2064_REG026, phy_c31); 4223 4223 4224 4224 MFREE(pi->sh->osh, phy_c32, 20 * sizeof(u16)); 4225 - MFREE(pi->sh->osh, ptr, 131 * sizeof(int16)); 4225 + MFREE(pi->sh->osh, ptr, 131 * sizeof(s16)); 4226 4226 } 4227 4227 4228 4228 static void ··· 4283 4283 uint32 val, bbmult, rfgain; 4284 4284 u8 index; 4285 4285 u8 scale_factor = 1; 4286 - int16 temp, temp1, temp2, qQ, qQ1, qQ2, shift; 4286 + s16 temp, temp1, temp2, qQ, qQ1, qQ2, shift; 4287 4287 4288 4288 tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL; 4289 4289 tab.tbl_width = 32; ··· 4479 4479 4480 4480 static void wlc_lcnphy_agc_temp_init(phy_info_t *pi) 4481 4481 { 4482 - int16 temp; 4482 + s16 temp; 4483 4483 phytbl_info_t tab; 4484 4484 uint32 tableBuffer[2]; 4485 4485 phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy; ··· 4487 4487 if (NORADIO_ENAB(pi->pubpi)) 4488 4488 return; 4489 4489 4490 - temp = (int16) read_phy_reg(pi, 0x4df); 4490 + temp = (s16) read_phy_reg(pi, 0x4df); 4491 4491 pi_lcn->lcnphy_ofdmgainidxtableoffset = (temp & (0xff << 0)) >> 0; 4492 4492 4493 4493 if (pi_lcn->lcnphy_ofdmgainidxtableoffset > 127) ··· 4513 4513 tableBuffer[1] -= 128; 4514 4514 pi_lcn->lcnphy_tr_T_gain_val = tableBuffer[1]; 4515 4515 4516 - temp = (int16) (read_phy_reg(pi, 0x434) 4516 + temp = (s16) (read_phy_reg(pi, 0x434) 4517 4517 & (0xff << 0)); 4518 4518 if (temp > 127) 4519 4519 temp -= 256; ··· 4742 4742 pi_lcn->lcnphy_rx_power_offset = 4743 4743 (u8) PHY_GETINTVAR(pi, "rxpo2g"); 4744 4744 4745 - pi->txpa_2g[0] = (int16) PHY_GETINTVAR(pi, "pa0b0"); 4746 - pi->txpa_2g[1] = (int16) PHY_GETINTVAR(pi, "pa0b1"); 4747 - pi->txpa_2g[2] = (int16) PHY_GETINTVAR(pi, "pa0b2"); 4745 + pi->txpa_2g[0] = (s16) PHY_GETINTVAR(pi, "pa0b0"); 4746 + pi->txpa_2g[1] = (s16) PHY_GETINTVAR(pi, "pa0b1"); 4747 + pi->txpa_2g[2] = (s16) PHY_GETINTVAR(pi, "pa0b2"); 4748 4748 4749 4749 pi_lcn->lcnphy_rssi_vf = (u8) PHY_GETINTVAR(pi, "rssismf2g"); 4750 4750 pi_lcn->lcnphy_rssi_vc = (u8) PHY_GETINTVAR(pi, "rssismc2g"); ··· 4838 4838 } 4839 4839 pi_lcn->lcnphy_cck_dig_filt_type = -1; 4840 4840 if (PHY_GETVAR(pi, "cckdigfilttype")) { 4841 - int16 temp; 4842 - temp = (int16) PHY_GETINTVAR(pi, "cckdigfilttype"); 4841 + s16 temp; 4842 + temp = (s16) PHY_GETINTVAR(pi, "cckdigfilttype"); 4843 4843 if (temp >= 0) { 4844 4844 pi_lcn->lcnphy_cck_dig_filt_type = temp; 4845 4845 } ··· 5249 5249 } 5250 5250 5251 5251 static int 5252 - wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm, int16 filt_type) 5252 + wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm, s16 filt_type) 5253 5253 { 5254 - int16 filt_index = -1; 5254 + s16 filt_index = -1; 5255 5255 int j; 5256 5256 5257 5257 u16 addr[] = { ··· 5295 5295 if (!is_ofdm) { 5296 5296 for (j = 0; j < LCNPHY_NUM_TX_DIG_FILTERS_CCK; j++) { 5297 5297 if (filt_type == LCNPHY_txdigfiltcoeffs_cck[j][0]) { 5298 - filt_index = (int16) j; 5298 + filt_index = (s16) j; 5299 5299 break; 5300 5300 } 5301 5301 } ··· 5312 5312 } else { 5313 5313 for (j = 0; j < LCNPHY_NUM_TX_DIG_FILTERS_OFDM; j++) { 5314 5314 if (filt_type == LCNPHY_txdigfiltcoeffs_ofdm[j][0]) { 5315 - filt_index = (int16) j; 5315 + filt_index = (s16) j; 5316 5316 break; 5317 5317 } 5318 5318 }
+7 -7
drivers/staging/brcm80211/phy/wlc_phy_lcn.h
··· 47 47 u8 lcnphy_rssi_vc_hightemp; 48 48 u8 lcnphy_rssi_gs_hightemp; 49 49 50 - int16 lcnphy_pa0b0; 51 - int16 lcnphy_pa0b1; 52 - int16 lcnphy_pa0b2; 50 + s16 lcnphy_pa0b0; 51 + s16 lcnphy_pa0b1; 52 + s16 lcnphy_pa0b2; 53 53 54 54 u16 lcnphy_rawtempsense; 55 55 u8 lcnphy_measPower; ··· 76 76 uint32 lcnphy_gain_idx_14_hiword; 77 77 uint32 lcnphy_gain_idx_27_lowword; 78 78 uint32 lcnphy_gain_idx_27_hiword; 79 - int16 lcnphy_ofdmgainidxtableoffset; 80 - int16 lcnphy_dsssgainidxtableoffset; 79 + s16 lcnphy_ofdmgainidxtableoffset; 80 + s16 lcnphy_dsssgainidxtableoffset; 81 81 uint32 lcnphy_tr_R_gain_val; 82 82 uint32 lcnphy_tr_T_gain_val; 83 83 s8 lcnphy_input_pwr_offset_db; ··· 98 98 u16 lcnphy_extstxctrl4; 99 99 u16 lcnphy_extstxctrl0; 100 100 u16 lcnphy_extstxctrl1; 101 - int16 lcnphy_cck_dig_filt_type; 102 - int16 lcnphy_ofdm_dig_filt_type; 101 + s16 lcnphy_cck_dig_filt_type; 102 + s16 lcnphy_ofdm_dig_filt_type; 103 103 lcnphy_cal_results_t lcnphy_cal_results; 104 104 105 105 u8 lcnphy_psat_pwr;
+69 -69
drivers/staging/brcm80211/phy/wlc_phy_n.c
··· 13280 13280 {0xFFFF, 0, 0} 13281 13281 }; 13282 13282 13283 - static int16 nphy_def_lnagains[] = { -2, 10, 19, 25 }; 13283 + static s16 nphy_def_lnagains[] = { -2, 10, 19, 25 }; 13284 13284 13285 13285 static int32 nphy_lnagain_est0[] = { -315, 40370 }; 13286 13286 static int32 nphy_lnagain_est1[] = { -224, 23242 }; ··· 13724 13724 -48, -41, -33, -25, -19, -12, -6, 0 13725 13725 }; 13726 13726 13727 - static int16 nphy_papd_padgain_dlt_2g_2057rev3n4[] = { 13727 + static s16 nphy_papd_padgain_dlt_2g_2057rev3n4[] = { 13728 13728 -159, -113, -86, -72, -62, -54, -48, -43, 13729 13729 -39, -35, -31, -28, -25, -23, -20, -18, 13730 13730 -17, -15, -13, -11, -10, -8, -7, -6, 13731 13731 -5, -4, -3, -3, -2, -1, -1, 0 13732 13732 }; 13733 13733 13734 - static int16 nphy_papd_padgain_dlt_2g_2057rev5[] = { 13734 + static s16 nphy_papd_padgain_dlt_2g_2057rev5[] = { 13735 13735 -109, -109, -82, -68, -58, -50, -44, -39, 13736 13736 -35, -31, -28, -26, -23, -21, -19, -17, 13737 13737 -16, -14, -13, -11, -10, -9, -8, -7, 13738 13738 -5, -5, -4, -3, -2, -1, -1, 0 13739 13739 }; 13740 13740 13741 - static int16 nphy_papd_padgain_dlt_2g_2057rev7[] = { 13741 + static s16 nphy_papd_padgain_dlt_2g_2057rev7[] = { 13742 13742 -122, -122, -95, -80, -69, -61, -54, -49, 13743 13743 -43, -39, -35, -32, -28, -26, -23, -21, 13744 13744 -18, -16, -15, -13, -11, -10, -8, -7, ··· 14706 14706 if (NREV_GE(pi->pubpi.phy_rev, 3)) { 14707 14707 uint32 *tx_pwrctrl_tbl = NULL; 14708 14708 u16 idx; 14709 - int16 pga_gn = 0; 14710 - int16 pad_gn = 0; 14709 + s16 pga_gn = 0; 14710 + s16 pad_gn = 0; 14711 14711 int32 rfpwr_offset = 0; 14712 14712 14713 14713 if (PHY_IPA(pi)) { ··· 14769 14769 if ((pi->pubpi.radiorev == 3) || 14770 14770 (pi->pubpi.radiorev == 4) || 14771 14771 (pi->pubpi.radiorev == 6)) { 14772 - rfpwr_offset = (int16) 14772 + rfpwr_offset = (s16) 14773 14773 nphy_papd_padgain_dlt_2g_2057rev3n4 14774 14774 [pad_gn]; 14775 14775 } else if (pi->pubpi.radiorev == 5) { 14776 - rfpwr_offset = (int16) 14776 + rfpwr_offset = (s16) 14777 14777 nphy_papd_padgain_dlt_2g_2057rev5 14778 14778 [pad_gn]; 14779 14779 } else if ((pi->pubpi.radiorev == 7) 14780 14780 || (pi->pubpi.radiorev == 14781 14781 8)) { 14782 - rfpwr_offset = (int16) 14782 + rfpwr_offset = (s16) 14783 14783 nphy_papd_padgain_dlt_2g_2057rev7 14784 14784 [pad_gn]; 14785 14785 } else { ··· 14790 14790 if ((pi->pubpi.radiorev == 3) || 14791 14791 (pi->pubpi.radiorev == 4) || 14792 14792 (pi->pubpi.radiorev == 6)) { 14793 - rfpwr_offset = (int16) 14793 + rfpwr_offset = (s16) 14794 14794 nphy_papd_pgagain_dlt_5g_2057 14795 14795 [pga_gn]; 14796 14796 } else if ((pi->pubpi.radiorev == 7) 14797 14797 || (pi->pubpi.radiorev == 14798 14798 8)) { 14799 - rfpwr_offset = (int16) 14799 + rfpwr_offset = (s16) 14800 14800 nphy_papd_pgagain_dlt_5g_2057rev7 14801 14801 [pga_gn]; 14802 14802 } else { ··· 14817 14817 for (idx = 0; idx < 128; idx++) { 14818 14818 pga_gn = (tx_pwrctrl_tbl[idx] >> 24) & 0xf; 14819 14819 if (CHSPEC_IS2G(pi->radio_chanspec)) { 14820 - rfpwr_offset = (int16) 14820 + rfpwr_offset = (s16) 14821 14821 nphy_papd_pga_gain_delta_ipa_2g 14822 14822 [pga_gn]; 14823 14823 } else { 14824 - rfpwr_offset = (int16) 14824 + rfpwr_offset = (s16) 14825 14825 nphy_papd_pga_gain_delta_ipa_5g 14826 14826 [pga_gn]; 14827 14827 } ··· 15329 15329 u8 rfseq_rx2tx_dlys_rev3_ipa[] = { 8, 6, 6, 4, 4, 16, 43, 1, 1 }; 15330 15330 u16 rfseq_rx2tx_dacbufpu_rev7[] = { 0x10f, 0x10f }; 15331 15331 15332 - int16 alpha0, alpha1, alpha2; 15333 - int16 beta0, beta1, beta2; 15332 + s16 alpha0, alpha1, alpha2; 15333 + s16 beta0, beta1, beta2; 15334 15334 uint32 leg_data_weights, ht_data_weights, nss1_data_weights, 15335 15335 stbc_data_weights; 15336 15336 u8 chan_freq_range = 0; ··· 17231 17231 { 17232 17232 uint core; 17233 17233 int ctr; 17234 - int16 gain_delta[2]; 17234 + s16 gain_delta[2]; 17235 17235 u8 curr_channel; 17236 17236 u16 minmax_gain[2]; 17237 17237 u16 regval[4]; ··· 17248 17248 17249 17249 curr_channel = CHSPEC_CHANNEL(pi->radio_chanspec); 17250 17250 gain_delta[0] = 17251 - (int16) 17251 + (s16) 17252 17252 PHY_HW_ROUND(((nphy_lnagain_est0[0] * 17253 17253 curr_channel) + 17254 17254 nphy_lnagain_est0[1]), 13); 17255 17255 gain_delta[1] = 17256 - (int16) 17256 + (s16) 17257 17257 PHY_HW_ROUND(((nphy_lnagain_est1[0] * 17258 17258 curr_channel) + 17259 17259 nphy_lnagain_est1[1]), 13); ··· 20813 20813 wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type, int32 *rssi_buf, 20814 20814 u8 nsamps) 20815 20815 { 20816 - int16 rssi0, rssi1; 20816 + s16 rssi0, rssi1; 20817 20817 u16 afectrlCore1_save = 0; 20818 20818 u16 afectrlCore2_save = 0; 20819 20819 u16 afectrlOverride1_save = 0; ··· 20909 20909 return rssi_out_val; 20910 20910 } 20911 20911 20912 - int16 wlc_phy_tempsense_nphy(phy_info_t *pi) 20912 + s16 wlc_phy_tempsense_nphy(phy_info_t *pi) 20913 20913 { 20914 20914 u16 core1_txrf_iqcal1_save, core1_txrf_iqcal2_save; 20915 20915 u16 core2_txrf_iqcal1_save, core2_txrf_iqcal2_save; ··· 20924 20924 int32 radio_temp[4]; 20925 20925 int32 radio_temp2[4]; 20926 20926 u16 syn_tempprocsense_save; 20927 - int16 offset = 0; 20927 + s16 offset = 0; 20928 20928 20929 20929 if (NREV_GE(pi->pubpi.phy_rev, 7)) { 20930 20930 u16 auxADC_Vmid, auxADC_Av, auxADC_Vmid_save, auxADC_Av_save; ··· 21077 21077 128) / 256; 21078 21078 } 21079 21079 21080 - offset = (int16) pi->phy_tempsense_offset; 21080 + offset = (s16) pi->phy_tempsense_offset; 21081 21081 21082 21082 } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { 21083 21083 syn_tempprocsense_save = ··· 21116 21116 write_phy_reg(pi, 0x8f, afectrlOverride_save); 21117 21117 write_phy_reg(pi, 0xa5, afectrlOverride2_save); 21118 21118 21119 - offset = (int16) pi->phy_tempsense_offset; 21119 + offset = (s16) pi->phy_tempsense_offset; 21120 21120 } else { 21121 21121 21122 21122 pwrdet_rxtx_core1_save = ··· 21189 21189 write_phy_reg(pi, 0xa5, afectrlOverride_save); 21190 21190 } 21191 21191 21192 - return (int16) radio_temp[0] + offset; 21192 + return (s16) radio_temp[0] + offset; 21193 21193 } 21194 21194 21195 21195 static void ··· 21470 21470 wlc_phy_rssi_compute_nphy(phy_info_t *pi, wlc_d11rxhdr_t *wlc_rxh) 21471 21471 { 21472 21472 d11rxhdr_t *rxh = &wlc_rxh->rxhdr; 21473 - int16 rxpwr, rxpwr0, rxpwr1; 21474 - int16 phyRx0_l, phyRx2_l; 21473 + s16 rxpwr, rxpwr0, rxpwr1; 21474 + s16 phyRx0_l, phyRx2_l; 21475 21475 21476 21476 rxpwr = 0; 21477 21477 rxpwr0 = ltoh16(rxh->PhyRxStatus_1) & PRXS1_nphy_PWR0_MASK; ··· 24571 24571 nphy_iq_comp_t old_comp, new_comp; 24572 24572 int32 iq = 0; 24573 24573 uint32 ii = 0, qq = 0; 24574 - int16 iq_nbits, qq_nbits, brsh, arsh; 24574 + s16 iq_nbits, qq_nbits, brsh, arsh; 24575 24575 int32 a, b, temp; 24576 24576 int bcmerror = BCME_OK; 24577 24577 uint cal_retry = 0; ··· 24652 24652 24653 24653 if ((curr_core == PHY_CORE_0) && (core_mask & 0x1)) { 24654 24654 if (NREV_GE(pi->pubpi.phy_rev, 3)) { 24655 - new_comp.a0 = (int16) a & 0x3ff; 24656 - new_comp.b0 = (int16) b & 0x3ff; 24655 + new_comp.a0 = (s16) a & 0x3ff; 24656 + new_comp.b0 = (s16) b & 0x3ff; 24657 24657 } else { 24658 24658 24659 - new_comp.a0 = (int16) b & 0x3ff; 24660 - new_comp.b0 = (int16) a & 0x3ff; 24659 + new_comp.a0 = (s16) b & 0x3ff; 24660 + new_comp.b0 = (s16) a & 0x3ff; 24661 24661 } 24662 24662 } 24663 24663 if ((curr_core == PHY_CORE_1) && (core_mask & 0x2)) { 24664 24664 if (NREV_GE(pi->pubpi.phy_rev, 3)) { 24665 - new_comp.a1 = (int16) a & 0x3ff; 24666 - new_comp.b1 = (int16) b & 0x3ff; 24665 + new_comp.a1 = (s16) a & 0x3ff; 24666 + new_comp.b1 = (s16) b & 0x3ff; 24667 24667 } else { 24668 24668 24669 - new_comp.a1 = (int16) b & 0x3ff; 24670 - new_comp.b1 = (int16) a & 0x3ff; 24669 + new_comp.a1 = (s16) b & 0x3ff; 24670 + new_comp.b1 = (s16) a & 0x3ff; 24671 24671 } 24672 24672 } 24673 24673 } ··· 25318 25318 nphy_iq_comp_t save_comp, zero_comp; 25319 25319 uint32 i_pwr, q_pwr, curr_pwr, optim_pwr = 0, prev_pwr = 0, thresh_pwr = 25320 25320 10000; 25321 - int16 desired_log2_pwr, actual_log2_pwr, delta_pwr; 25321 + s16 desired_log2_pwr, actual_log2_pwr, delta_pwr; 25322 25322 bool gainctrl_done = FALSE; 25323 25323 u8 mix_tia_gain = 3; 25324 25324 s8 optim_gaintbl_index = 0, prev_gaintbl_index = 0; ··· 25326 25326 u8 gainctrl_dirn = NPHY_RXCAL_GAIN_INIT; 25327 25327 nphy_ipa_txrxgain_t *nphy_rxcal_gaintbl; 25328 25328 u16 hpvga, lpf_biq1, lpf_biq0, lna2, lna1; 25329 - int16 fine_gain_idx; 25329 + s16 fine_gain_idx; 25330 25330 s8 txpwrindex; 25331 25331 u16 nphy_rxcal_txgain[2]; 25332 25332 ··· 25929 25929 u16 lna_vals[] = { 0x3, 0x3, 0x1 }; 25930 25930 u16 hpf1_vals[] = { 0x7, 0x2, 0x0 }; 25931 25931 u16 hpf2_vals[] = { 0x2, 0x0, 0x0 }; 25932 - int16 curr_hpf1, curr_hpf2, curr_hpf, curr_lna; 25933 - int16 desired_log2_pwr, actual_log2_pwr, hpf_change; 25932 + s16 curr_hpf1, curr_hpf2, curr_hpf, curr_lna; 25933 + s16 desired_log2_pwr, actual_log2_pwr, hpf_change; 25934 25934 u16 orig_RfseqCoreActv, orig_AfectrlCore, orig_AfectrlOverride; 25935 25935 u16 orig_RfctrlIntcRx, orig_RfctrlIntcTx; 25936 25936 u16 num_samps; ··· 27241 27241 bool phy_b3; 27242 27242 u8 phy_b4; 27243 27243 u8 phy_b5; 27244 - int16 phy_b6, phy_b7, phy_b8; 27244 + s16 phy_b6, phy_b7, phy_b8; 27245 27245 u16 phy_b9; 27246 - int16 phy_b10, phy_b11, phy_b12; 27246 + s16 phy_b10, phy_b11, phy_b12; 27247 27247 27248 27248 phy_b11 = 0; 27249 27249 phy_b12 = 0; ··· 27672 27672 27673 27673 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : 27674 27674 0x29b, (0x1ff << 4), 27675 - ((int16) rfpwr_offset) << 4); 27675 + ((s16) rfpwr_offset) << 4); 27676 27676 27677 27677 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : 27678 27678 0x29b, (0x1 << 2), (1) << 2); ··· 27988 27988 pi->nphy_pwrctrl_info[PHY_CORE_1].max_pwr_2g = 27989 27989 (s8) PHY_GETINTVAR(pi, "maxp2ga1"); 27990 27990 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_2g_a1 = 27991 - (int16) PHY_GETINTVAR(pi, "pa2gw0a0"); 27991 + (s16) PHY_GETINTVAR(pi, "pa2gw0a0"); 27992 27992 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_2g_a1 = 27993 - (int16) PHY_GETINTVAR(pi, "pa2gw0a1"); 27993 + (s16) PHY_GETINTVAR(pi, "pa2gw0a1"); 27994 27994 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_2g_b0 = 27995 - (int16) PHY_GETINTVAR(pi, "pa2gw1a0"); 27995 + (s16) PHY_GETINTVAR(pi, "pa2gw1a0"); 27996 27996 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_2g_b0 = 27997 - (int16) PHY_GETINTVAR(pi, "pa2gw1a1"); 27997 + (s16) PHY_GETINTVAR(pi, "pa2gw1a1"); 27998 27998 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_2g_b1 = 27999 - (int16) PHY_GETINTVAR(pi, "pa2gw2a0"); 27999 + (s16) PHY_GETINTVAR(pi, "pa2gw2a0"); 28000 28000 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_2g_b1 = 28001 - (int16) PHY_GETINTVAR(pi, "pa2gw2a1"); 28001 + (s16) PHY_GETINTVAR(pi, "pa2gw2a1"); 28002 28002 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_targ_2g = 28003 28003 (s8) PHY_GETINTVAR(pi, "itt2ga0"); 28004 28004 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_targ_2g = ··· 28028 28028 pi->nphy_pwrctrl_info[PHY_CORE_1].max_pwr_5gm = 28029 28029 (s8) PHY_GETINTVAR(pi, "maxp5ga1"); 28030 28030 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_5gm_a1 = 28031 - (int16) PHY_GETINTVAR(pi, "pa5gw0a0"); 28031 + (s16) PHY_GETINTVAR(pi, "pa5gw0a0"); 28032 28032 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_5gm_a1 = 28033 - (int16) PHY_GETINTVAR(pi, "pa5gw0a1"); 28033 + (s16) PHY_GETINTVAR(pi, "pa5gw0a1"); 28034 28034 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_5gm_b0 = 28035 - (int16) PHY_GETINTVAR(pi, "pa5gw1a0"); 28035 + (s16) PHY_GETINTVAR(pi, "pa5gw1a0"); 28036 28036 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_5gm_b0 = 28037 - (int16) PHY_GETINTVAR(pi, "pa5gw1a1"); 28037 + (s16) PHY_GETINTVAR(pi, "pa5gw1a1"); 28038 28038 pi->nphy_pwrctrl_info[PHY_CORE_0].pwrdet_5gm_b1 = 28039 - (int16) PHY_GETINTVAR(pi, "pa5gw2a0"); 28039 + (s16) PHY_GETINTVAR(pi, "pa5gw2a0"); 28040 28040 pi->nphy_pwrctrl_info[PHY_CORE_1].pwrdet_5gm_b1 = 28041 - (int16) PHY_GETINTVAR(pi, "pa5gw2a1"); 28041 + (s16) PHY_GETINTVAR(pi, "pa5gw2a1"); 28042 28042 pi->nphy_pwrctrl_info[PHY_CORE_0].idle_targ_5gm = 28043 28043 (s8) PHY_GETINTVAR(pi, "itt5ga0"); 28044 28044 pi->nphy_pwrctrl_info[PHY_CORE_1].idle_targ_5gm = ··· 28066 28066 pi->nphy_pwrctrl_info[1].max_pwr_5gl = 28067 28067 (s8) PHY_GETINTVAR(pi, "maxp5gla1"); 28068 28068 pi->nphy_pwrctrl_info[0].pwrdet_5gl_a1 = 28069 - (int16) PHY_GETINTVAR(pi, "pa5glw0a0"); 28069 + (s16) PHY_GETINTVAR(pi, "pa5glw0a0"); 28070 28070 pi->nphy_pwrctrl_info[1].pwrdet_5gl_a1 = 28071 - (int16) PHY_GETINTVAR(pi, "pa5glw0a1"); 28071 + (s16) PHY_GETINTVAR(pi, "pa5glw0a1"); 28072 28072 pi->nphy_pwrctrl_info[0].pwrdet_5gl_b0 = 28073 - (int16) PHY_GETINTVAR(pi, "pa5glw1a0"); 28073 + (s16) PHY_GETINTVAR(pi, "pa5glw1a0"); 28074 28074 pi->nphy_pwrctrl_info[1].pwrdet_5gl_b0 = 28075 - (int16) PHY_GETINTVAR(pi, "pa5glw1a1"); 28075 + (s16) PHY_GETINTVAR(pi, "pa5glw1a1"); 28076 28076 pi->nphy_pwrctrl_info[0].pwrdet_5gl_b1 = 28077 - (int16) PHY_GETINTVAR(pi, "pa5glw2a0"); 28077 + (s16) PHY_GETINTVAR(pi, "pa5glw2a0"); 28078 28078 pi->nphy_pwrctrl_info[1].pwrdet_5gl_b1 = 28079 - (int16) PHY_GETINTVAR(pi, "pa5glw2a1"); 28079 + (s16) PHY_GETINTVAR(pi, "pa5glw2a1"); 28080 28080 pi->nphy_pwrctrl_info[0].idle_targ_5gl = 0; 28081 28081 pi->nphy_pwrctrl_info[1].idle_targ_5gl = 0; 28082 28082 ··· 28110 28110 pi->nphy_pwrctrl_info[1].max_pwr_5gh = 28111 28111 (s8) PHY_GETINTVAR(pi, "maxp5gha1"); 28112 28112 pi->nphy_pwrctrl_info[0].pwrdet_5gh_a1 = 28113 - (int16) PHY_GETINTVAR(pi, "pa5ghw0a0"); 28113 + (s16) PHY_GETINTVAR(pi, "pa5ghw0a0"); 28114 28114 pi->nphy_pwrctrl_info[1].pwrdet_5gh_a1 = 28115 - (int16) PHY_GETINTVAR(pi, "pa5ghw0a1"); 28115 + (s16) PHY_GETINTVAR(pi, "pa5ghw0a1"); 28116 28116 pi->nphy_pwrctrl_info[0].pwrdet_5gh_b0 = 28117 - (int16) PHY_GETINTVAR(pi, "pa5ghw1a0"); 28117 + (s16) PHY_GETINTVAR(pi, "pa5ghw1a0"); 28118 28118 pi->nphy_pwrctrl_info[1].pwrdet_5gh_b0 = 28119 - (int16) PHY_GETINTVAR(pi, "pa5ghw1a1"); 28119 + (s16) PHY_GETINTVAR(pi, "pa5ghw1a1"); 28120 28120 pi->nphy_pwrctrl_info[0].pwrdet_5gh_b1 = 28121 - (int16) PHY_GETINTVAR(pi, "pa5ghw2a0"); 28121 + (s16) PHY_GETINTVAR(pi, "pa5ghw2a0"); 28122 28122 pi->nphy_pwrctrl_info[1].pwrdet_5gh_b1 = 28123 - (int16) PHY_GETINTVAR(pi, "pa5ghw2a1"); 28123 + (s16) PHY_GETINTVAR(pi, "pa5ghw2a1"); 28124 28124 pi->nphy_pwrctrl_info[0].idle_targ_5gh = 0; 28125 28125 pi->nphy_pwrctrl_info[1].idle_targ_5gh = 0; 28126 28126 ··· 28178 28178 28179 28179 wlc_phy_txpower_ipa_upd(pi); 28180 28180 28181 - pi->phy_txcore_disable_temp = (int16) PHY_GETINTVAR(pi, "tempthresh"); 28181 + pi->phy_txcore_disable_temp = (s16) PHY_GETINTVAR(pi, "tempthresh"); 28182 28182 if (pi->phy_txcore_disable_temp == 0) { 28183 28183 pi->phy_txcore_disable_temp = PHY_CHAIN_TX_DISABLE_TEMP; 28184 28184 } ··· 28479 28479 static void wlc_phy_txpwrctrl_pwr_setup_nphy(phy_info_t *pi) 28480 28480 { 28481 28481 uint32 idx; 28482 - int16 a1[2], b0[2], b1[2]; 28482 + s16 a1[2], b0[2], b1[2]; 28483 28483 s8 target_pwr_qtrdbm[2]; 28484 28484 int32 num, den, pwr_est; 28485 28485 u8 chan_freq_range; ··· 29142 29142 29143 29143 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : 29144 29144 0x29b, (0x1ff << 4), 29145 - ((int16) rfpwr_offset) << 4); 29145 + ((s16) rfpwr_offset) << 4); 29146 29146 29147 29147 mod_phy_reg(pi, (core == PHY_CORE_0) ? 0x297 : 29148 29148 0x29b, (0x1 << 2), (1) << 2);
+2 -2
drivers/staging/brcm80211/sys/wlc_bsscfg.h
··· 74 74 75 75 /* security */ 76 76 uint32 wsec; /* wireless security bitvec */ 77 - int16 auth; /* 802.11 authentication: Open, Shared Key, WPA */ 78 - int16 openshared; /* try Open auth first, then Shared Key */ 77 + s16 auth; /* 802.11 authentication: Open, Shared Key, WPA */ 78 + s16 openshared; /* try Open auth first, then Shared Key */ 79 79 bool wsec_restrict; /* drop unencrypted packets if wsec is enabled */ 80 80 bool eap_restrict; /* restrict data until 802.1X auth succeeds */ 81 81 u16 WPA_auth; /* WPA: authenticated key management */
+2 -2
drivers/staging/brcm80211/sys/wlc_mac80211.c
··· 790 790 static u8 wlc_local_constraint_qdbm(wlc_info_t *wlc) 791 791 { 792 792 u8 local; 793 - int16 local_max; 793 + s16 local_max; 794 794 795 795 local = WLC_TXPWR_MAX; 796 796 if (wlc->pub->associated && ··· 5795 5795 /* 0 = 1Mbps; 1 = 2Mbps; 2 = 5.5Mbps; 3 = 11Mbps */ 5796 5796 phyctl1 = (bw | (RSPEC_STF(rspec) << PHY_TXC1_MODE_SHIFT)); 5797 5797 } else { /* legacy OFDM/CCK */ 5798 - int16 phycfg; 5798 + s16 phycfg; 5799 5799 /* get the phyctl byte from rate phycfg table */ 5800 5800 phycfg = wlc_rate_legacy_phyctl(RSPEC2RATE(rspec)); 5801 5801 if (phycfg == -1) {
+1 -1
drivers/staging/brcm80211/sys/wlc_mac80211.h
··· 317 317 318 318 /* fifo */ 319 319 uint *txavail[NFIFO]; /* # tx descriptors available */ 320 - int16 txpktpend[NFIFO]; /* tx admission control */ 320 + s16 txpktpend[NFIFO]; /* tx admission control */ 321 321 #endif /* WLC_LOW */ 322 322 323 323 macstat_t *macstat_snapshot; /* mac hw prev read values */
+2 -2
drivers/staging/brcm80211/sys/wlc_pub.h
··· 169 169 u16 flags; /* flags for internal attributes */ 170 170 u8 SSID_len; /* the length of SSID */ 171 171 u8 SSID[32]; /* SSID string */ 172 - int16 RSSI; /* receive signal strength (in dBm) */ 173 - int16 SNR; /* receive signal SNR in dB */ 172 + s16 RSSI; /* receive signal strength (in dBm) */ 173 + s16 SNR; /* receive signal SNR in dB */ 174 174 u16 beacon_period; /* units are Kusec */ 175 175 u16 atim_window; /* units are Kusec */ 176 176 chanspec_t chanspec; /* Channel num, bw, ctrl_sb and band */
+1 -1
drivers/staging/brcm80211/sys/wlc_rate.c
··· 467 467 mcsallow ? txstreams : 1); 468 468 } 469 469 470 - int16 BCMFASTPATH wlc_rate_legacy_phyctl(uint rate) 470 + s16 BCMFASTPATH wlc_rate_legacy_phyctl(uint rate) 471 471 { 472 472 uint i; 473 473 for (i = 0; i < LEGACY_PHYCFG_TABLE_SIZE; i++)
+1 -1
drivers/staging/brcm80211/sys/wlc_rate.h
··· 160 160 const struct wlc_rateset *rs_hw, uint phy_type, 161 161 int bandtype, bool cck_only, uint rate_mask, 162 162 bool mcsallow, u8 bw, u8 txstreams); 163 - extern int16 wlc_rate_legacy_phyctl(uint rate); 163 + extern s16 wlc_rate_legacy_phyctl(uint rate); 164 164 165 165 extern void wlc_rateset_mcs_upd(struct wlc_rateset *rs, u8 txstreams); 166 166 extern void wlc_rateset_mcs_clear(struct wlc_rateset *rateset);
+1 -1
drivers/staging/brcm80211/util/linux_osl.c
··· 75 75 /* Global ASSERT type flag */ 76 76 uint32 g_assert_type; 77 77 78 - static int16 linuxbcmerrormap[] = { 0, /* 0 */ 78 + static s16 linuxbcmerrormap[] = { 0, /* 0 */ 79 79 -EINVAL, /* BCME_ERROR */ 80 80 -EINVAL, /* BCME_BADARG */ 81 81 -EINVAL, /* BCME_BADOPTION */
+63 -63
drivers/staging/brcm80211/util/qmath.c
··· 22 22 else if input number is less than 0xffff8000 then output is saturated to 0xffff8000 23 23 else output is same as input. 24 24 */ 25 - int16 qm_sat32(int32 op) 25 + s16 qm_sat32(int32 op) 26 26 { 27 - int16 result; 27 + s16 result; 28 28 if (op > (int32) 0x7fff) { 29 29 result = 0x7fff; 30 30 } else if (op < (int32) 0xffff8000) { 31 - result = (int16) (0x8000); 31 + result = (s16) (0x8000); 32 32 } else { 33 - result = (int16) op; 33 + result = (s16) op; 34 34 } 35 35 return result; 36 36 } ··· 41 41 16 bit multiplication on the processor platform is cheaper than 32 bit multiplication (as 42 42 the most of qmath functions can be replaced with processor intrinsic instructions). 43 43 */ 44 - int32 qm_mul321616(int16 op1, int16 op2) 44 + int32 qm_mul321616(s16 op1, s16 op2) 45 45 { 46 46 return (int32) (op1) * (int32) (op2); 47 47 } ··· 51 51 To fit the result into 16 bits the 32 bit multiplication result is right 52 52 shifted by 16 bits. 53 53 */ 54 - int16 qm_mul16(int16 op1, int16 op2) 54 + s16 qm_mul16(s16 op1, s16 op2) 55 55 { 56 56 int32 result; 57 57 result = ((int32) (op1) * (int32) (op2)); 58 - return (int16) (result >> 16); 58 + return (s16) (result >> 16); 59 59 } 60 60 61 61 /* ··· 65 65 twice that of compiler multiplication. (i.e. qm_muls321616(2,3)=12). 66 66 When both input 16 bit numbers are 0x8000, then the result is saturated to 0x7fffffff. 67 67 */ 68 - int32 qm_muls321616(int16 op1, int16 op2) 68 + int32 qm_muls321616(s16 op1, s16 op2) 69 69 { 70 70 int32 result; 71 - if (op1 == (int16) (0x8000) && op2 == (int16) (0x8000)) { 71 + if (op1 == (s16) (0x8000) && op2 == (s16) (0x8000)) { 72 72 result = 0x7fffffff; 73 73 } else { 74 74 result = ((int32) (op1) * (int32) (op2)); ··· 93 93 due to the multiplication. 94 94 When both the 16bit inputs are 0x8000 then the output is saturated to 0x7fffffff. 95 95 */ 96 - int16 qm_muls16(int16 op1, int16 op2) 96 + s16 qm_muls16(s16 op1, s16 op2) 97 97 { 98 98 int32 result; 99 - if (op1 == (int16) 0x8000 && op2 == (int16) 0x8000) { 99 + if (op1 == (s16) 0x8000 && op2 == (s16) 0x8000) { 100 100 result = 0x7fffffff; 101 101 } else { 102 102 result = ((int32) (op1) * (int32) (op2)); 103 103 } 104 - return (int16) (result >> 15); 104 + return (s16) (result >> 15); 105 105 } 106 106 107 107 /* ··· 124 124 Description: This function add two 16 bit numbers and return the 16bit result. 125 125 If the result overflow 16 bits, the output will be saturated to 16bits. 126 126 */ 127 - int16 qm_add16(int16 op1, int16 op2) 127 + s16 qm_add16(s16 op1, s16 op2) 128 128 { 129 - int16 result; 129 + s16 result; 130 130 int32 temp = (int32) op1 + (int32) op2; 131 131 if (temp > (int32) 0x7fff) { 132 - result = (int16) 0x7fff; 132 + result = (s16) 0x7fff; 133 133 } else if (temp < (int32) 0xffff8000) { 134 - result = (int16) 0xffff8000; 134 + result = (s16) 0xffff8000; 135 135 } else { 136 - result = (int16) temp; 136 + result = (s16) temp; 137 137 } 138 138 return result; 139 139 } ··· 142 142 Description: This function make 16 bit subtraction and return the 16bit result. 143 143 If the result overflow 16 bits, the output will be saturated to 16bits. 144 144 */ 145 - int16 qm_sub16(int16 op1, int16 op2) 145 + s16 qm_sub16(s16 op1, s16 op2) 146 146 { 147 - int16 result; 147 + s16 result; 148 148 int32 temp = (int32) op1 - (int32) op2; 149 149 if (temp > (int32) 0x7fff) { 150 - result = (int16) 0x7fff; 150 + result = (s16) 0x7fff; 151 151 } else if (temp < (int32) 0xffff8000) { 152 - result = (int16) 0xffff8000; 152 + result = (s16) 0xffff8000; 153 153 } else { 154 - result = (int16) temp; 154 + result = (s16) temp; 155 155 } 156 156 return result; 157 157 } ··· 177 177 into the input 32 bit number and return the 32 bit accumulated result. 178 178 If the accumulation result in overflow, then the output will be saturated. 179 179 */ 180 - int32 qm_mac321616(int32 acc, int16 op1, int16 op2) 180 + int32 qm_mac321616(int32 acc, s16 op1, s16 op2) 181 181 { 182 182 int32 result; 183 183 result = qm_add32(acc, qm_mul321616(op1, op2)); ··· 223 223 is +ve. This function will make a 16 bit right shift when the specified shift is -ve. 224 224 This function return the result after shifting operation. 225 225 */ 226 - int16 qm_shl16(int16 op, int shift) 226 + s16 qm_shl16(s16 op, int shift) 227 227 { 228 228 int i; 229 - int16 result; 229 + s16 result; 230 230 result = op; 231 231 if (shift > 15) 232 232 shift = 15; ··· 247 247 This function make a 16 bit saturated left shift when shift is -ve. This function 248 248 return the result of the shift operation. 249 249 */ 250 - int16 qm_shr16(int16 op, int shift) 250 + s16 qm_shr16(s16 op, int shift) 251 251 { 252 252 return qm_shl16(op, -shift); 253 253 } ··· 256 256 Description: This function return the number of redundant sign bits in a 16 bit number. 257 257 Example: qm_norm16(0x0080) = 7. 258 258 */ 259 - int16 qm_norm16(int16 op) 259 + s16 qm_norm16(s16 op) 260 260 { 261 261 u16 u16extraSignBits; 262 262 if (op == 0) { ··· 275 275 Description: This function return the number of redundant sign bits in a 32 bit number. 276 276 Example: qm_norm32(0x00000080) = 23 277 277 */ 278 - int16 qm_norm32(int32 op) 278 + s16 qm_norm32(int32 op) 279 279 { 280 280 u16 u16extraSignBits; 281 281 if (op == 0) { ··· 295 295 The numerator should be less than denominator. So the quotient is always less than 1. 296 296 This function return the quotient in q.15 format. 297 297 */ 298 - int16 qm_div_s(int16 num, int16 denom) 298 + s16 qm_div_s(s16 num, s16 denom) 299 299 { 300 - int16 var_out; 301 - int16 iteration; 300 + s16 var_out; 301 + s16 iteration; 302 302 int32 L_num; 303 303 int32 L_denom; 304 304 L_num = (num) << 15; ··· 310 310 L_num = qm_add32(L_num, 1); 311 311 } 312 312 } 313 - var_out = (int16) (L_num & 0x7fff); 313 + var_out = (s16) (L_num & 0x7fff); 314 314 return var_out; 315 315 } 316 316 317 317 /* 318 318 Description: This function compute the absolute value of a 16 bit number. 319 319 */ 320 - int16 qm_abs16(int16 op) 320 + s16 qm_abs16(s16 op) 321 321 { 322 322 if (op < 0) { 323 - if (op == (int16) 0xffff8000) { 323 + if (op == (s16) 0xffff8000) { 324 324 return 0x7fff; 325 325 } else { 326 326 return -op; ··· 337 337 to this function. The qformat of quotient is adjusted appropriately such that 338 338 the quotient occupies all 16 bits. 339 339 */ 340 - int16 qm_div16(int16 num, int16 denom, int16 *qQuotient) 340 + s16 qm_div16(s16 num, s16 denom, s16 *qQuotient) 341 341 { 342 - int16 sign; 343 - int16 nNum, nDenom; 342 + s16 sign; 343 + s16 nNum, nDenom; 344 344 sign = num ^ denom; 345 345 num = qm_abs16(num); 346 346 denom = qm_abs16(denom); ··· 380 380 to this function. The qformat of quotient is adjusted appropriately such that 381 381 the quotient occupies all 16 bits. 382 382 */ 383 - int16 qm_div163232(int32 num, int32 denom, int16 *qquotient) 383 + s16 qm_div163232(int32 num, int32 denom, s16 *qquotient) 384 384 { 385 385 int32 sign; 386 - int16 nNum, nDenom; 386 + s16 nNum, nDenom; 387 387 sign = num ^ denom; 388 388 num = qm_abs32(num); 389 389 denom = qm_abs32(denom); ··· 393 393 denom = qm_shl32(denom, nDenom); 394 394 *qquotient = nNum - 1 - nDenom + 15; 395 395 if (sign >= 0) { 396 - return qm_div_s((int16) (num >> 16), (int16) (denom >> 16)); 396 + return qm_div_s((s16) (num >> 16), (s16) (denom >> 16)); 397 397 } else { 398 - return -qm_div_s((int16) (num >> 16), (int16) (denom >> 16)); 398 + return -qm_div_s((s16) (num >> 16), (s16) (denom >> 16)); 399 399 } 400 400 } 401 401 ··· 404 404 The multiplicaton result is right shifted by 16 bits to fit the result 405 405 into 32 bit output. 406 406 */ 407 - int32 qm_mul323216(int32 op1, int16 op2) 407 + int32 qm_mul323216(int32 op1, s16 op2) 408 408 { 409 - int16 hi; 409 + s16 hi; 410 410 u16 lo; 411 411 int32 result; 412 412 hi = op1 >> 16; 413 - lo = (int16) (op1 & 0xffff); 413 + lo = (s16) (op1 & 0xffff); 414 414 result = qm_mul321616(hi, op2); 415 415 result = result + (qm_mulsu321616(op2, lo) >> 16); 416 416 return result; ··· 420 420 Description: This function multiply signed 16 bit number with unsigned 16 bit number and return 421 421 the result in 32 bits. 422 422 */ 423 - int32 qm_mulsu321616(int16 op1, u16 op2) 423 + int32 qm_mulsu321616(s16 op1, u16 op2) 424 424 { 425 425 return (int32) (op1) * op2; 426 426 } ··· 431 431 16 bits is done to remove the extra sign bit formed by multiplication from the return value. 432 432 When the input numbers are 0x80000000, 0x8000 the return value is saturated to 0x7fffffff. 433 433 */ 434 - int32 qm_muls323216(int32 op1, int16 op2) 434 + int32 qm_muls323216(int32 op1, s16 op2) 435 435 { 436 - int16 hi; 436 + s16 hi; 437 437 u16 lo; 438 438 int32 result; 439 439 hi = op1 >> 16; 440 - lo = (int16) (op1 & 0xffff); 440 + lo = (s16) (op1 & 0xffff); 441 441 result = qm_muls321616(hi, op2); 442 442 result = qm_add32(result, (qm_mulsu321616(op2, lo) >> 15)); 443 443 return result; ··· 450 450 */ 451 451 int32 qm_mul32(int32 a, int32 b) 452 452 { 453 - int16 hi1, hi2; 453 + s16 hi1, hi2; 454 454 u16 lo1, lo2; 455 455 int32 result; 456 456 hi1 = a >> 16; ··· 473 473 */ 474 474 int32 qm_muls32(int32 a, int32 b) 475 475 { 476 - int16 hi1, hi2; 476 + s16 hi1, hi2; 477 477 u16 lo1, lo2; 478 478 int32 result; 479 479 hi1 = a >> 16; ··· 488 488 } 489 489 490 490 /* This table is log2(1+(i/32)) where i=[0:1:31], in q.15 format */ 491 - static const int16 log_table[] = { 491 + static const s16 log_table[] = { 492 492 0, 493 493 1455, 494 494 2866, ··· 545 545 Note/Problem: 546 546 For accurate results input should be in normalized or near normalized form. 547 547 */ 548 - void qm_log10(int32 N, int16 qN, int16 *log10N, int16 *qLog10N) 548 + void qm_log10(int32 N, s16 qN, s16 *log10N, s16 *qLog10N) 549 549 { 550 - int16 s16norm, s16tableIndex, s16errorApproximation; 550 + s16 s16norm, s16tableIndex, s16errorApproximation; 551 551 u16 u16offset; 552 552 int32 s32log; 553 553 ··· 569 569 qN = qN + s16norm - 30; 570 570 571 571 /* take the table index as the LOG2_OF_LOG_TABLE_SIZE bits right of the MSB */ 572 - s16tableIndex = (int16) (N >> (32 - (2 + LOG2_LOG_TABLE_SIZE))); 572 + s16tableIndex = (s16) (N >> (32 - (2 + LOG2_LOG_TABLE_SIZE))); 573 573 574 574 /* remove the MSB. the MSB is always 1 after normalization. */ 575 575 s16tableIndex = 576 - s16tableIndex & (int16) ((1 << LOG2_LOG_TABLE_SIZE) - 1); 576 + s16tableIndex & (s16) ((1 << LOG2_LOG_TABLE_SIZE) - 1); 577 577 578 578 /* remove the (1+LOG2_OF_LOG_TABLE_SIZE) MSBs in the N. */ 579 579 N = N & ((1 << (32 - (2 + LOG2_LOG_TABLE_SIZE))) - 1); ··· 586 586 s32log = log_table[s16tableIndex]; /* q.15 format */ 587 587 588 588 /* interpolate using the offset. */ 589 - s16errorApproximation = (int16) qm_mulu16(u16offset, (u16) (log_table[s16tableIndex + 1] - log_table[s16tableIndex])); /* q.15 */ 589 + s16errorApproximation = (s16) qm_mulu16(u16offset, (u16) (log_table[s16tableIndex + 1] - log_table[s16tableIndex])); /* q.15 */ 590 590 591 - s32log = qm_add16((int16) s32log, s16errorApproximation); /* q.15 format */ 591 + s32log = qm_add16((s16) s32log, s16errorApproximation); /* q.15 format */ 592 592 593 593 /* adjust for the qformat of the N as 594 594 * log2(mag * 2^x) = log2(mag) + x ··· 605 605 * as log10(mag * 2^x) = log2(mag * 2^x) * log10(2) 606 606 * log10N in q.15+s16norm-16+1 (LOG10_2 is in q.16) 607 607 */ 608 - *log10N = qm_muls16((int16) s32log, (int16) LOG10_2); 608 + *log10N = qm_muls16((s16) s32log, (s16) LOG10_2); 609 609 610 610 /* write the q format of the result. */ 611 611 *qLog10N = 15 + s16norm - 16 + 1; ··· 631 631 qsqrtN - address where q format of 1/N has to be written. 632 632 */ 633 633 #define qx 29 634 - void qm_1byN(int32 N, int16 qN, int32 *result, int16 *qResult) 634 + void qm_1byN(int32 N, s16 qN, int32 *result, s16 *qResult) 635 635 { 636 - int16 normN; 636 + s16 normN; 637 637 int32 s32firstTerm, s32secondTerm, x; 638 638 int i; 639 639 ··· 657 657 for (i = 0; i < 4; i++) { 658 658 s32firstTerm = qm_shl32(x, 1); /* s32firstTerm = 2*x in q.29 */ 659 659 s32secondTerm = 660 - qm_muls321616((int16) (s32firstTerm >> 16), 661 - (int16) (s32firstTerm >> 16)); 660 + qm_muls321616((s16) (s32firstTerm >> 16), 661 + (s16) (s32firstTerm >> 16)); 662 662 /* s32secondTerm = x*x in q.(29+1-16)*2+1 */ 663 663 s32secondTerm = 664 - qm_muls321616((int16) (s32secondTerm >> 16), (int16) N); 664 + qm_muls321616((s16) (s32secondTerm >> 16), (s16) N); 665 665 /* s32secondTerm = N*x*x in q.((29+1-16)*2+1)-16+15+1 i.e. in q.29 */ 666 666 x = qm_sub32(s32firstTerm, s32secondTerm); 667 667 /* can be added directly as both are in q.29 */