Lines Matching full:gphy

73 	/* APHY.rev < 5 || GPHY.rev < 6 */  in generate_rfatt_list()
208 struct b43_phy_g *gphy = phy->g; in b43_set_txpower_g() local
209 struct b43_txpower_lo_control *lo = gphy->lo_control; in b43_set_txpower_g()
221 * to pass &gphy->rfatt as rfatt pointer argument. Same for bbatt. */ in b43_set_txpower_g()
222 gphy->tx_control = tx_control; in b43_set_txpower_g()
223 memmove(&gphy->rfatt, rfatt, sizeof(*rfatt)); in b43_set_txpower_g()
224 gphy->rfatt.with_padmix = !!(tx_control & B43_TXCTL_TXMIX); in b43_set_txpower_g()
225 memmove(&gphy->bbatt, bbatt, sizeof(*bbatt)); in b43_set_txpower_g()
254 struct b43_phy_g *gphy = dev->phy.g; in b43_gphy_tssi_power_lt_init() local
259 b43_ofdmtab_write16(dev, 0x3C20, i, gphy->tssi2dbm[i]); in b43_gphy_tssi_power_lt_init()
261 b43_ofdmtab_write16(dev, 0x3C00, i - 32, gphy->tssi2dbm[i]); in b43_gphy_tssi_power_lt_init()
263 value = (u16) gphy->tssi2dbm[i]; in b43_gphy_tssi_power_lt_init()
264 value |= ((u16) gphy->tssi2dbm[i + 1]) << 8; in b43_gphy_tssi_power_lt_init()
273 struct b43_phy_g *gphy = phy->g; in b43_gphy_gain_lt_init() local
274 struct b43_txpower_lo_control *lo = gphy->lo_control; in b43_gphy_gain_lt_init()
395 struct b43_phy_g *gphy = dev->phy.g; in b43_nrssi_mem_update() local
399 delta = 0x1F - gphy->nrssi[0]; in b43_nrssi_mem_update()
401 tmp = (i - delta) * gphy->nrssislope; in b43_nrssi_mem_update()
405 gphy->nrssi_lt[i] = tmp; in b43_nrssi_mem_update()
559 struct b43_phy_g *gphy = phy->g; in b43_calc_nrssi_slope() local
656 gphy->nrssislope = 0x00010000; in b43_calc_nrssi_slope()
658 gphy->nrssislope = 0x00400000 / (nrssi0 - nrssi1); in b43_calc_nrssi_slope()
660 gphy->nrssi[0] = nrssi1; in b43_calc_nrssi_slope()
661 gphy->nrssi[1] = nrssi0; in b43_calc_nrssi_slope()
701 struct b43_phy_g *gphy = phy->g; in b43_calc_nrssi_threshold() local
719 if (gphy->interfmode == B43_INTERFMODE_NONWLAN) { in b43_calc_nrssi_threshold()
722 } else if (!gphy->aci_wlan_automatic && gphy->aci_enable) { in b43_calc_nrssi_threshold()
730 a = a * (gphy->nrssi[1] - gphy->nrssi[0]); in b43_calc_nrssi_threshold()
731 a += (gphy->nrssi[0] << 6); in b43_calc_nrssi_threshold()
739 b = b * (gphy->nrssi[1] - gphy->nrssi[0]); in b43_calc_nrssi_threshold()
740 b += (gphy->nrssi[0] << 6); in b43_calc_nrssi_threshold()
829 struct b43_phy_g *gphy = phy->g; in b43_radio_interference_mitigation_enable() local
832 u32 *stack = gphy->interfstack; in b43_radio_interference_mitigation_enable()
888 gphy->aci_enable = true; in b43_radio_interference_mitigation_enable()
995 struct b43_phy_g *gphy = phy->g; in b43_radio_interference_mitigation_disable() local
996 u32 *stack = gphy->interfstack; in b43_radio_interference_mitigation_disable()
1029 gphy->aci_enable = false; in b43_radio_interference_mitigation_disable()
1104 struct b43_phy_g *gphy = phy->g; in radio2050_rfover_val() local
1111 int max_lb_gain = gphy->max_lb_gain; in radio2050_rfover_val()
1483 struct b43_phy_g *gphy = phy->g; in b43_phy_initb5() local
1570 b43_set_txpower_g(dev, &gphy->bbatt, &gphy->rfatt, gphy->tx_control); in b43_phy_initb5()
1582 struct b43_phy_g *gphy = phy->g; in b43_phy_initb6() local
1677 b43_set_txpower_g(dev, &gphy->bbatt, &gphy->rfatt, gphy->tx_control); in b43_phy_initb6()
1698 struct b43_phy_g *gphy = phy->g; in b43_calc_loopback_gain() local
1724 backup_bband = gphy->bbatt.att; in b43_calc_loopback_gain()
1844 gphy->max_lb_gain = in b43_calc_loopback_gain()
1846 gphy->trsw_rx_gain = trsw_rx * 2; in b43_calc_loopback_gain()
1883 struct b43_phy_g *gphy = phy->g; in b43_hardware_pctl_init_gphy() local
1891 b43_phy_maskset(dev, 0x0036, 0xFFC0, (gphy->tgt_idle_tssi - gphy->cur_idle_tssi)); in b43_hardware_pctl_init_gphy()
1892 b43_phy_maskset(dev, 0x0478, 0xFF00, (gphy->tgt_idle_tssi - gphy->cur_idle_tssi)); in b43_hardware_pctl_init_gphy()
1913 struct b43_phy_g *gphy = phy->g; in b43_phy_init_pctl() local
1933 if (gphy->cur_idle_tssi == 0) { in b43_phy_init_pctl()
1940 memcpy(&old_rfatt, &gphy->rfatt, sizeof(old_rfatt)); in b43_phy_init_pctl()
1941 memcpy(&old_bbatt, &gphy->bbatt, sizeof(old_bbatt)); in b43_phy_init_pctl()
1942 old_tx_control = gphy->tx_control; in b43_phy_init_pctl()
1955 gphy->cur_idle_tssi = b43_phy_read(dev, B43_PHY_ITSSI); in b43_phy_init_pctl()
1958 if (abs(gphy->cur_idle_tssi - gphy->tgt_idle_tssi) >= 20) { in b43_phy_init_pctl()
1962 "adjustment.\n", gphy->cur_idle_tssi, in b43_phy_init_pctl()
1963 gphy->tgt_idle_tssi); in b43_phy_init_pctl()
1964 gphy->cur_idle_tssi = 0; in b43_phy_init_pctl()
2000 struct b43_phy_g *gphy = phy->g; in b43_phy_initg() local
2044 if (gphy->initval == 0xFFFF) in b43_phy_initg()
2045 gphy->initval = b43_radio_init2050(dev); in b43_phy_initg()
2047 b43_radio_write16(dev, 0x0078, gphy->initval); in b43_phy_initg()
2053 | gphy->lo_control->tx_bias | gphy-> in b43_phy_initg()
2056 b43_radio_maskset(dev, 0x52, 0xFFF0, gphy->lo_control->tx_bias); in b43_phy_initg()
2059 b43_phy_maskset(dev, B43_PHY_CCK(0x36), 0x0FFF, (gphy->lo_control->tx_bias << 12)); in b43_phy_initg()
2084 if (gphy->nrssi[0] == -1000) { in b43_phy_initg()
2085 B43_WARN_ON(gphy->nrssi[1] != -1000); in b43_phy_initg()
2255 struct b43_phy_g *gphy = phy->g; in b43_gphy_aci_detect() local
2263 if (gphy->aci_hw_rssi) in b43_gphy_aci_detect()
2384 struct b43_phy_g *gphy = phy->g; in b43_gphy_init_tssi2dbm_table() local
2394 gphy->dyn_tssi_tbl = false; in b43_gphy_init_tssi2dbm_table()
2401 gphy->tgt_idle_tssi = in b43_gphy_init_tssi2dbm_table()
2404 gphy->tgt_idle_tssi = 62; in b43_gphy_init_tssi2dbm_table()
2405 gphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0, in b43_gphy_init_tssi2dbm_table()
2407 if (!gphy->tssi2dbm) in b43_gphy_init_tssi2dbm_table()
2409 gphy->dyn_tssi_tbl = true; in b43_gphy_init_tssi2dbm_table()
2412 gphy->tgt_idle_tssi = 52; in b43_gphy_init_tssi2dbm_table()
2413 gphy->tssi2dbm = b43_tssi2dbm_g_table; in b43_gphy_init_tssi2dbm_table()
2421 struct b43_phy_g *gphy; in b43_gphy_op_allocate() local
2425 gphy = kzalloc(sizeof(*gphy), GFP_KERNEL); in b43_gphy_op_allocate()
2426 if (!gphy) { in b43_gphy_op_allocate()
2430 dev->phy.g = gphy; in b43_gphy_op_allocate()
2437 gphy->lo_control = lo; in b43_gphy_op_allocate()
2448 kfree(gphy); in b43_gphy_op_allocate()
2456 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_prepare_structs() local
2464 tssi2dbm = gphy->tssi2dbm; in b43_gphy_op_prepare_structs()
2465 tgt_idle_tssi = gphy->tgt_idle_tssi; in b43_gphy_op_prepare_structs()
2467 lo = gphy->lo_control; in b43_gphy_op_prepare_structs()
2470 memset(gphy, 0, sizeof(*gphy)); in b43_gphy_op_prepare_structs()
2473 gphy->tssi2dbm = tssi2dbm; in b43_gphy_op_prepare_structs()
2474 gphy->tgt_idle_tssi = tgt_idle_tssi; in b43_gphy_op_prepare_structs()
2475 gphy->lo_control = lo; in b43_gphy_op_prepare_structs()
2477 memset(gphy->minlowsig, 0xFF, sizeof(gphy->minlowsig)); in b43_gphy_op_prepare_structs()
2480 for (i = 0; i < ARRAY_SIZE(gphy->nrssi); i++) in b43_gphy_op_prepare_structs()
2481 gphy->nrssi[i] = -1000; in b43_gphy_op_prepare_structs()
2482 for (i = 0; i < ARRAY_SIZE(gphy->nrssi_lt); i++) in b43_gphy_op_prepare_structs()
2483 gphy->nrssi_lt[i] = i; in b43_gphy_op_prepare_structs()
2485 gphy->lofcal = 0xFFFF; in b43_gphy_op_prepare_structs()
2486 gphy->initval = 0xFFFF; in b43_gphy_op_prepare_structs()
2488 gphy->interfmode = B43_INTERFMODE_NONE; in b43_gphy_op_prepare_structs()
2491 gphy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_UNKNOWN; in b43_gphy_op_prepare_structs()
2493 gphy->average_tssi = 0xFF; in b43_gphy_op_prepare_structs()
2503 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_free() local
2505 kfree(gphy->lo_control); in b43_gphy_op_free()
2507 if (gphy->dyn_tssi_tbl) in b43_gphy_op_free()
2508 kfree(gphy->tssi2dbm); in b43_gphy_op_free()
2509 gphy->dyn_tssi_tbl = false; in b43_gphy_op_free()
2510 gphy->tssi2dbm = NULL; in b43_gphy_op_free()
2512 kfree(gphy); in b43_gphy_op_free()
2519 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_prepare_hardware() local
2520 struct b43_txpower_lo_control *lo = gphy->lo_control; in b43_gphy_op_prepare_hardware()
2524 default_baseband_attenuation(dev, &gphy->bbatt); in b43_gphy_op_prepare_hardware()
2525 default_radio_attenuation(dev, &gphy->rfatt); in b43_gphy_op_prepare_hardware()
2526 gphy->tx_control = (default_tx_control(dev) << 4); in b43_gphy_op_prepare_hardware()
2599 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_software_rfkill() local
2612 if (gphy->radio_off_context.valid) { in b43_gphy_op_software_rfkill()
2615 gphy->radio_off_context.rfover); in b43_gphy_op_software_rfkill()
2617 gphy->radio_off_context.rfoverval); in b43_gphy_op_software_rfkill()
2618 gphy->radio_off_context.valid = false; in b43_gphy_op_software_rfkill()
2629 gphy->radio_off_context.rfover = rfover; in b43_gphy_op_software_rfkill()
2630 gphy->radio_off_context.rfoverval = rfoverval; in b43_gphy_op_software_rfkill()
2631 gphy->radio_off_context.valid = true; in b43_gphy_op_software_rfkill()
2709 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_interf_mitigation() local
2716 gphy->aci_wlan_automatic = false; in b43_gphy_op_interf_mitigation()
2719 gphy->aci_wlan_automatic = true; in b43_gphy_op_interf_mitigation()
2720 if (gphy->aci_enable) in b43_gphy_op_interf_mitigation()
2733 currentmode = gphy->interfmode; in b43_gphy_op_interf_mitigation()
2740 gphy->aci_enable = false; in b43_gphy_op_interf_mitigation()
2741 gphy->aci_hw_rssi = false; in b43_gphy_op_interf_mitigation()
2744 gphy->interfmode = mode; in b43_gphy_op_interf_mitigation()
2754 struct b43_phy_g *gphy = dev->phy.g; in b43_gphy_estimate_power_out() local
2758 tmp = (gphy->tgt_idle_tssi - gphy->cur_idle_tssi + tssi); in b43_gphy_estimate_power_out()
2760 dbm = gphy->tssi2dbm[tmp]; in b43_gphy_estimate_power_out()
2821 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_adjust_txpower() local
2828 bbatt = gphy->bbatt.att; in b43_gphy_op_adjust_txpower()
2829 bbatt += gphy->bbatt_delta; in b43_gphy_op_adjust_txpower()
2830 rfatt = gphy->rfatt.att; in b43_gphy_op_adjust_txpower()
2831 rfatt += gphy->rfatt_delta; in b43_gphy_op_adjust_txpower()
2834 tx_control = gphy->tx_control; in b43_gphy_op_adjust_txpower()
2861 gphy->tx_control = tx_control; in b43_gphy_op_adjust_txpower()
2863 gphy->rfatt.att = rfatt; in b43_gphy_op_adjust_txpower()
2864 gphy->bbatt.att = bbatt; in b43_gphy_op_adjust_txpower()
2872 b43_set_txpower_g(dev, &gphy->bbatt, &gphy->rfatt, in b43_gphy_op_adjust_txpower()
2873 gphy->tx_control); in b43_gphy_op_adjust_txpower()
2884 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_recalc_txpower() local
2908 if (likely(gphy->average_tssi != 0xFF)) in b43_gphy_op_recalc_txpower()
2909 average_tssi = (average_tssi + gphy->average_tssi) / 2; in b43_gphy_op_recalc_txpower()
2910 gphy->average_tssi = average_tssi; in b43_gphy_op_recalc_txpower()
2978 gphy->bbatt_delta = bbatt_delta; in b43_gphy_op_recalc_txpower()
2979 gphy->rfatt_delta = rfatt_delta; in b43_gphy_op_recalc_txpower()
2991 struct b43_phy_g *gphy = phy->g; in b43_gphy_op_pwork_15sec() local
2995 if (gphy->aci_enable && gphy->aci_wlan_automatic) { in b43_gphy_op_pwork_15sec()
2996 if (!gphy->aci_enable && 1 /*TODO: not scanning? */ ) { in b43_gphy_op_pwork_15sec()
3005 } else if (gphy->interfmode == B43_INTERFMODE_NONWLAN && in b43_gphy_op_pwork_15sec()