| /freebsd/sys/compat/linuxkpi/common/include/linux/ |
| H A D | minmax.h | 66 #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) macro 68 #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
|
| /freebsd/sys/contrib/dev/rtw89/ |
| H A D | util.c | 140 db = clamp_t(s32, db, RTW89_MIN_DBM, RTW89_MAX_DBM); in rtw89_db_quarter_to_linear()
|
| H A D | rtw8852b_common.c | 653 tmp = clamp_t(s32, tmp << 2, S8_MIN, S8_MAX); in rtw8852bx_set_gain_offset() 667 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8852bx_set_gain_offset() 671 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8852bx_set_gain_offset() 683 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8852bx_set_gain_offset() 687 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8852bx_set_gain_offset() 692 tmp = clamp_t(s32, tmp, S8_MIN >> 1, S8_MAX >> 1); in rtw8852bx_set_gain_offset() 1220 rf_pwr_cw = clamp_t(s16, rf_pwr_cw, 15, 63); in rtw8852bx_bb_cal_txpwr_ref() 1877 return clamp_t(s8, val + 6, -100, 0) + 100; in __rtw8852bx_btc_get_bt_rssi()
|
| H A D | rtw8851b.c | 1058 tmp = clamp_t(s32, tmp << 2, S8_MIN, S8_MAX); in rtw8851b_set_gain_offset() 1071 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8851b_set_gain_offset() 1078 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8851b_set_gain_offset() 1082 tmp = clamp_t(s32, tmp, S8_MIN, S8_MAX); in rtw8851b_set_gain_offset() 1087 tmp = clamp_t(s32, tmp, S8_MIN >> 1, S8_MAX >> 1); in rtw8851b_set_gain_offset() 1773 rf_pwr_cw = clamp_t(s16, rf_pwr_cw, 15, 63); in rtw8851b_bb_cal_txpwr_ref() 2335 val = clamp_t(s8, val, -100, 0) + 100; in rtw8851b_btc_get_bt_rssi()
|
| H A D | acpi.c | 717 *val = clamp_t(s32, (*val) + delta, MIN_VAL_OF_RTW89_ACPI_SAR, max); in rtw89_acpi_geo_sar_load_by_hp() 728 *val = clamp_t(s32, (*val) + delta, MIN_VAL_OF_RTW89_ACPI_SAR, max); in rtw89_acpi_geo_sar_load_by_rt()
|
| H A D | rtw8852c.c | 1042 tmp = clamp_t(s32, (-offset_q0 << 3) + (offset_base_q4 >> 1), in rtw8852c_set_gain_offset() 1053 tmp = clamp_t(s32, -tmp, S8_MIN, S8_MAX); in rtw8852c_set_gain_offset() 1056 tmp = clamp_t(s32, offset_q0 << 4, S8_MIN, S8_MAX); in rtw8852c_set_gain_offset() 1998 rf_pwr_cw = clamp_t(s16, rf_pwr_cw, 15, 63); in rtw8852c_bb_cal_txpwr_ref() 2805 return clamp_t(s8, val + 6, -100, 0) + 100; in rtw8852c_btc_get_bt_rssi()
|
| H A D | rtw8922a.c | 1194 v1 = clamp_t(s32, value, S8_MIN, S8_MAX); in rtw8922a_set_rx_gain_normal_ofdm() 1196 v2 = clamp_t(s32, value, S8_MIN, S8_MAX); in rtw8922a_set_rx_gain_normal_ofdm() 1198 v3 = clamp_t(s32, value, S8_MIN, S8_MAX); in rtw8922a_set_rx_gain_normal_ofdm() 2449 return clamp_t(int, th, 0, U8_MAX); in rtw8922a_get_thermal() 2641 return clamp_t(s8, val, -100, 0) + 100; in rtw8922a_btc_get_bt_rssi()
|
| H A D | sar.c | 217 return (s8)clamp_t(s32, cfg_mac, in rtw89_txpwr_sar_to_mac()
|
| H A D | phy.h | 981 return clamp_t(s16, dbm << chip->txpwr_factor_mac, -64, 63); in rtw89_phy_txpwr_dbm_to_mac()
|
| H A D | rtw8852a.c | 1493 rf_pwr_cw = clamp_t(s16, rf_pwr_cw, 15, 63); in rtw8852a_bb_cal_txpwr_ref() 2001 return clamp_t(s8, val + 6, -100, 0) + 100; in rtw8852a_btc_get_bt_rssi()
|
| H A D | phy.c | 2212 clamp_t(s8, val, in rtw89_phy_ant_gain_init() 2221 clamp_t(s8, val, in rtw89_phy_ant_gain_init() 2232 clamp_t(s8, val, in rtw89_phy_ant_gain_init() 6180 weight_zero = clamp_t(u16, env->nhm_th[0] - RTW89_NHM_WEIGHT_OFFSET, 0, U8_MAX); in rtw89_nhm_weighted_avg() 6929 rxb_idx = clamp_t(s32, rxb_idx_tmp, RXB_IDX_MIN, RXB_IDX_MAX); in rtw89_phy_dig_rxb_idx_by_rssi() 7126 ofdm_cca_th = clamp_t(u8, final_rssi, PD_TH_MIN_RSSI + under_region, in __rtw89_phy_dig_dyn_pd_th()
|
| H A D | chan.c | 1511 dur_go = clamp_t(u16, role_go->duration, RTW89_MCC_MIN_GO_DURATION, in rtw89_mcc_set_duration_go_sta() 1625 bt_dur = clamp_t(u16, bt_dur, 1, data.available / 3); in rtw89_mcc_mod_duration_dual_2ghz_with_bt()
|
| H A D | rtw8851b_rfk.c | 2152 dbm = clamp_t(u8, dbm, 7, 24); in _dpk_kip_set_txagc()
|
| H A D | rtw8852c_rfk.c | 2221 dbm = clamp_t(u8, dbm, 7, 24); in _dpk_kip_set_txagc()
|
| /freebsd/sys/dev/ena/ |
| H A D | ena.h | 546 #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) macro 547 #define clamp_val(val, lo, hi) clamp_t(__typeof(val), val, lo, hi)
|
| /freebsd/sys/contrib/dev/rtw88/ |
| H A D | sar.c | 55 return (s8)clamp_t(s32, tmp, -max - 1, max) - base; in rtw_sar_to_phy()
|
| H A D | rtw8703b.c | 955 val_s8 = clamp_t(s8, -val_s8 >> 1, 0, 64); in query_phy_status_ofdm() 1501 ofdm_index = clamp_t(s8, ofdm_index, 0, RTW_OFDM_SWING_TABLE_SIZE - 1); in rtw8703b_set_iqk_matrix() 1552 swing_idx = clamp_t(s8, swing_idx, 0, RTW_CCK_SWING_TABLE_SIZE - 1); in rtw8703b_pwrtrack_set_cck_pwr()
|
| H A D | phy.c | 478 *lower = clamp_t(u8, min_rssi, dig_min, dig_mid); in rtw_phy_dig_get_boundary() 479 *upper = clamp_t(u8, *lower + DIG_RSSI_GAIN_OFFSET, dig_min, dig_max); in rtw_phy_dig_get_boundary() 579 cur_igi = clamp_t(u8, cur_igi, lower_bound, upper_bound); in rtw_phy_dig() 1641 pwr_limit = clamp_t(s8, pwr_limit, in rtw_phy_set_tx_power_limit()
|
| H A D | rtw8723x.c | 678 xtal_cap = clamp_t(s8, xtal_cap + pwrtrk_xtal[delta], 0, 0x3F); in __rtw8723x_pwrtrack_set_xtal()
|
| H A D | rtw8723d.c | 205 rx_evm = clamp_t(s8, -pkt_stat->rx_evm[RF_PATH_A] >> 1, 0, 64); in query_phy_status_page1()
|
| H A D | fw.c | 837 thold = clamp_t(s32, thold + rssi_offset, rssi_min, rssi_max); in rtw_fw_beacon_filter_config()
|
| H A D | rtw8822c.c | 4349 crystal_cap = clamp_t(s8, crystal_cap, 0, XCAP_MASK); in rtw8822c_cfo_track()
|
| /freebsd/sys/dev/bnxt/bnxt_en/ |
| H A D | bnxt_hwrm.c | 3268 max_buf = clamp_t(uint16_t, max_buf, 1, 63); in bnxt_hwrm_set_coal() 3269 max_buf_irq = clamp_t(uint16_t, softc->rx_coal_frames_irq, 1, 63); in bnxt_hwrm_set_coal() 3288 max_buf = clamp_t(uint16_t, softc->tx_coal_frames, 1, 63); in bnxt_hwrm_set_coal() 3289 max_buf_irq = clamp_t(uint16_t, softc->tx_coal_frames_irq, 1, 63); in bnxt_hwrm_set_coal()
|
| H A D | bnxt.h | 304 #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) macro
|
| H A D | if_bnxt.c | 1205 entries = clamp_t(u32, entries, ctxm->min_entries, ctxm->max_entries); in bnxt_setup_ctxm_pg_tbls()
|