Lines Matching refs:rfatt

406 		lo->rfatt.array = rfatt0;  in bwn_phy_g_prepare_hw()
407 lo->rfatt.len = N(rfatt0); in bwn_phy_g_prepare_hw()
408 lo->rfatt.min = 0; in bwn_phy_g_prepare_hw()
409 lo->rfatt.max = 9; in bwn_phy_g_prepare_hw()
413 lo->rfatt.array = rfatt1; in bwn_phy_g_prepare_hw()
414 lo->rfatt.len = N(rfatt1); in bwn_phy_g_prepare_hw()
415 lo->rfatt.min = 0; in bwn_phy_g_prepare_hw()
416 lo->rfatt.max = 14; in bwn_phy_g_prepare_hw()
419 lo->rfatt.array = rfatt2; in bwn_phy_g_prepare_hw()
420 lo->rfatt.len = N(rfatt2); in bwn_phy_g_prepare_hw()
421 lo->rfatt.min = 0; in bwn_phy_g_prepare_hw()
422 lo->rfatt.max = 9; in bwn_phy_g_prepare_hw()
652 int rfatt, bbatt; in bwn_phy_g_recalc_txpwr() local
686 rfatt = -((power + 7) / 8); in bwn_phy_g_recalc_txpwr()
687 bbatt = (-(power / 2)) - (4 * rfatt); in bwn_phy_g_recalc_txpwr()
688 if ((rfatt == 0) && (bbatt == 0)) in bwn_phy_g_recalc_txpwr()
691 pg->pg_rfatt_delta = rfatt; in bwn_phy_g_recalc_txpwr()
701 int rfatt, bbatt; in bwn_phy_g_set_txpwr() local
710 rfatt = pg->pg_rfatt.att; in bwn_phy_g_set_txpwr()
711 rfatt += pg->pg_rfatt_delta; in bwn_phy_g_set_txpwr()
713 bwn_phy_g_setatt(mac, &bbatt, &rfatt); in bwn_phy_g_set_txpwr()
716 if (rfatt <= 1) { in bwn_phy_g_set_txpwr()
719 rfatt += 2; in bwn_phy_g_set_txpwr()
723 bbatt += 4 * (rfatt - 2); in bwn_phy_g_set_txpwr()
724 rfatt = 2; in bwn_phy_g_set_txpwr()
726 } else if (rfatt > 4 && txctl) { in bwn_phy_g_set_txpwr()
729 rfatt -= 3; in bwn_phy_g_set_txpwr()
732 rfatt -= 2; in bwn_phy_g_set_txpwr()
738 bwn_phy_g_setatt(mac, &bbatt, &rfatt); in bwn_phy_g_set_txpwr()
739 pg->pg_rfatt.att = rfatt; in bwn_phy_g_set_txpwr()
785 BWN_RFATTCMP(&cal->rfatt, &pg->pg_rfatt)) { in bwn_phy_g_task_15s()
791 cal->bbatt.att, cal->rfatt.att, cal->rfatt.padmix, in bwn_phy_g_task_15s()
2501 const struct bwn_bbatt *bbatt, const struct bwn_rfatt *rfatt) in bwn_lo_calibset() argument
2516 BWN_RF_SETMASK(mac, 0x43, 0xfff0, rfatt->att); in bwn_lo_calibset()
2517 BWN_RF_SETMASK(mac, reg, ~value, (rfatt->padmix ? value :0)); in bwn_lo_calibset()
2519 rxgain = (rfatt->att * 2) + (bbatt->att / 2); in bwn_lo_calibset()
2520 if (rfatt->padmix) in bwn_lo_calibset()
2537 memcpy(&cal->rfatt, rfatt, sizeof(*rfatt)); in bwn_lo_calibset()
2547 const struct bwn_rfatt *rfatt) in bwn_lo_get_calib() argument
2555 if (!BWN_RFATTCMP(&c->rfatt, rfatt)) in bwn_lo_get_calib()
2560 c = bwn_lo_calibset(mac, bbatt, rfatt); in bwn_lo_get_calib()
2575 const struct bwn_rfatt *rfatt; in bwn_phy_g_dc_lookup_init() local
2583 KASSERT(lo->rfatt.len * lo->bbatt.len <= 64, in bwn_phy_g_dc_lookup_init()
2599 bb_offset = i / lo->rfatt.len; in bwn_phy_g_dc_lookup_init()
2600 rf_offset = i % lo->rfatt.len; in bwn_phy_g_dc_lookup_init()
2602 rfatt = &(lo->rfatt.array[rf_offset]); in bwn_phy_g_dc_lookup_init()
2604 cal = bwn_lo_calibset(mac, bbatt, rfatt); in bwn_phy_g_dc_lookup_init()
3122 struct bwn_rfatt old_rfatt, rfatt; in bwn_phy_hwpctl_init() local
3151 rfatt.att = 15; in bwn_phy_hwpctl_init()
3152 rfatt.padmix = 1; in bwn_phy_hwpctl_init()
3154 rfatt.att = 9; in bwn_phy_hwpctl_init()
3155 rfatt.padmix = 0; in bwn_phy_hwpctl_init()
3157 bwn_phy_g_set_txpwr_sub(mac, &bbatt, &rfatt, 0); in bwn_phy_hwpctl_init()
3237 for (rf = 0; rf < lo->rfatt.len; rf++) { in bwn_hwpctl_init_gphy()
3247 tmp |= lo->rfatt.array[rf].att; in bwn_hwpctl_init_gphy()
3315 const struct bwn_rfatt *rfatt, uint8_t txctl) in bwn_phy_g_set_txpwr_sub() argument
3324 rf = rfatt->att; in bwn_phy_g_set_txpwr_sub()
3331 memmove(&pg->pg_rfatt, rfatt, sizeof(*rfatt)); in bwn_phy_g_set_txpwr_sub()
3540 int rfatt = *rfattp; in bwn_phy_g_setatt() local
3544 if (rfatt > lo->rfatt.max && bbatt > lo->bbatt.max - 4) in bwn_phy_g_setatt()
3546 if (rfatt < lo->rfatt.min && bbatt < lo->bbatt.min + 4) in bwn_phy_g_setatt()
3548 if (bbatt > lo->bbatt.max && rfatt > lo->rfatt.max - 1) in bwn_phy_g_setatt()
3550 if (bbatt < lo->bbatt.min && rfatt < lo->rfatt.min + 1) in bwn_phy_g_setatt()
3554 rfatt += 1; in bwn_phy_g_setatt()
3559 rfatt -= 1; in bwn_phy_g_setatt()
3562 if (rfatt > lo->rfatt.max) { in bwn_phy_g_setatt()
3563 rfatt -= 1; in bwn_phy_g_setatt()
3567 if (rfatt < lo->rfatt.min) { in bwn_phy_g_setatt()
3568 rfatt += 1; in bwn_phy_g_setatt()
3575 *rfattp = MIN(MAX(rfatt, lo->rfatt.min), lo->rfatt.max); in bwn_phy_g_setatt()