1*ca47d344SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2423e3ce3SKalle Valo /* 3423e3ce3SKalle Valo 4423e3ce3SKalle Valo Broadcom B43legacy wireless driver 5423e3ce3SKalle Valo 6423e3ce3SKalle Valo Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>, 7423e3ce3SKalle Valo Stefano Brivio <stefano.brivio@polimi.it> 8423e3ce3SKalle Valo Michael Buesch <m@bues.ch> 9423e3ce3SKalle Valo Danny van Dyk <kugelfang@gentoo.org> 10423e3ce3SKalle Valo Andreas Jaggi <andreas.jaggi@waterwave.ch> 11423e3ce3SKalle Valo 12423e3ce3SKalle Valo Some parts of the code in this file are derived from the ipw2200 13423e3ce3SKalle Valo driver Copyright(c) 2003 - 2004 Intel Corporation. 14423e3ce3SKalle Valo 15423e3ce3SKalle Valo 16423e3ce3SKalle Valo */ 17423e3ce3SKalle Valo 18423e3ce3SKalle Valo #ifndef B43legacy_RADIO_H_ 19423e3ce3SKalle Valo #define B43legacy_RADIO_H_ 20423e3ce3SKalle Valo 21423e3ce3SKalle Valo #include "b43legacy.h" 22423e3ce3SKalle Valo 23423e3ce3SKalle Valo 24423e3ce3SKalle Valo #define B43legacy_RADIO_DEFAULT_CHANNEL_BG 6 25423e3ce3SKalle Valo 26423e3ce3SKalle Valo /* Force antenna 0. */ 27423e3ce3SKalle Valo #define B43legacy_RADIO_TXANTENNA_0 0 28423e3ce3SKalle Valo /* Force antenna 1. */ 29423e3ce3SKalle Valo #define B43legacy_RADIO_TXANTENNA_1 1 30423e3ce3SKalle Valo /* Use the RX antenna, that was selected for the most recently 31423e3ce3SKalle Valo * received good PLCP header. 32423e3ce3SKalle Valo */ 33423e3ce3SKalle Valo #define B43legacy_RADIO_TXANTENNA_LASTPLCP 3 34423e3ce3SKalle Valo #define B43legacy_RADIO_TXANTENNA_DEFAULT B43legacy_RADIO_TXANTENNA_LASTPLCP 35423e3ce3SKalle Valo 36423e3ce3SKalle Valo #define B43legacy_RADIO_INTERFMODE_NONE 0 37423e3ce3SKalle Valo #define B43legacy_RADIO_INTERFMODE_NONWLAN 1 38423e3ce3SKalle Valo #define B43legacy_RADIO_INTERFMODE_MANUALWLAN 2 39423e3ce3SKalle Valo #define B43legacy_RADIO_INTERFMODE_AUTOWLAN 3 40423e3ce3SKalle Valo 41423e3ce3SKalle Valo 42423e3ce3SKalle Valo void b43legacy_radio_lock(struct b43legacy_wldev *dev); 43423e3ce3SKalle Valo void b43legacy_radio_unlock(struct b43legacy_wldev *dev); 44423e3ce3SKalle Valo 45423e3ce3SKalle Valo u16 b43legacy_radio_read16(struct b43legacy_wldev *dev, u16 offset); 46423e3ce3SKalle Valo void b43legacy_radio_write16(struct b43legacy_wldev *dev, u16 offset, u16 val); 47423e3ce3SKalle Valo 48423e3ce3SKalle Valo u16 b43legacy_radio_init2050(struct b43legacy_wldev *dev); 49423e3ce3SKalle Valo 50423e3ce3SKalle Valo void b43legacy_radio_turn_on(struct b43legacy_wldev *dev); 51423e3ce3SKalle Valo void b43legacy_radio_turn_off(struct b43legacy_wldev *dev, bool force); 52423e3ce3SKalle Valo 53423e3ce3SKalle Valo int b43legacy_radio_selectchannel(struct b43legacy_wldev *dev, u8 channel, 54423e3ce3SKalle Valo int synthetic_pu_workaround); 55423e3ce3SKalle Valo 56423e3ce3SKalle Valo void b43legacy_radio_set_txpower_a(struct b43legacy_wldev *dev, u16 txpower); 57423e3ce3SKalle Valo void b43legacy_radio_set_txpower_bg(struct b43legacy_wldev *dev, 58423e3ce3SKalle Valo u16 baseband_attenuation, u16 attenuation, 59423e3ce3SKalle Valo u16 txpower); 60423e3ce3SKalle Valo 61423e3ce3SKalle Valo u16 b43legacy_default_baseband_attenuation(struct b43legacy_wldev *dev); 62423e3ce3SKalle Valo u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev); 63423e3ce3SKalle Valo u16 b43legacy_default_txctl1(struct b43legacy_wldev *dev); 64423e3ce3SKalle Valo 65423e3ce3SKalle Valo void b43legacy_radio_set_txantenna(struct b43legacy_wldev *dev, u32 val); 66423e3ce3SKalle Valo 67423e3ce3SKalle Valo void b43legacy_radio_clear_tssi(struct b43legacy_wldev *dev); 68423e3ce3SKalle Valo 69423e3ce3SKalle Valo u8 b43legacy_radio_aci_detect(struct b43legacy_wldev *dev, u8 channel); 70423e3ce3SKalle Valo u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev); 71423e3ce3SKalle Valo 72423e3ce3SKalle Valo int b43legacy_radio_set_interference_mitigation(struct b43legacy_wldev *dev, 73423e3ce3SKalle Valo int mode); 74423e3ce3SKalle Valo 75423e3ce3SKalle Valo void b43legacy_calc_nrssi_slope(struct b43legacy_wldev *dev); 76423e3ce3SKalle Valo void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev); 77423e3ce3SKalle Valo s16 b43legacy_nrssi_hw_read(struct b43legacy_wldev *dev, u16 offset); 78423e3ce3SKalle Valo void b43legacy_nrssi_hw_write(struct b43legacy_wldev *dev, u16 offset, s16 val); 79423e3ce3SKalle Valo void b43legacy_nrssi_hw_update(struct b43legacy_wldev *dev, u16 val); 80423e3ce3SKalle Valo void b43legacy_nrssi_mem_update(struct b43legacy_wldev *dev); 81423e3ce3SKalle Valo 82423e3ce3SKalle Valo u16 b43legacy_radio_calibrationvalue(struct b43legacy_wldev *dev); 83423e3ce3SKalle Valo 84423e3ce3SKalle Valo #endif /* B43legacy_RADIO_H_ */ 85