/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2013 Adrian Chadd <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer,11* without modification.12* 2. Redistributions in binary form must reproduce at minimum a disclaimer13* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any14* redistribution must be conditioned upon including a substantially15* similar Disclaimer requirement for further binary redistribution.16*17* NO WARRANTY18* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY21* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL22* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,23* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF24* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS25* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER26* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)27* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF28* THE POSSIBILITY OF SUCH DAMAGES.29*/30#ifndef __IF_ATH_LNA_DIV_H__31#define __IF_ATH_LNA_DIV_H__3233#define ATH_ANT_RX_CURRENT_SHIFT 434#define ATH_ANT_RX_MAIN_SHIFT 235#define ATH_ANT_RX_MASK 0x33637#define ATH_ANT_DIV_COMB_SHORT_SCAN_INTR 5038#define ATH_ANT_DIV_COMB_SHORT_SCAN_PKTCOUNT 0x10039#define ATH_ANT_DIV_COMB_MAX_PKTCOUNT 0x20040#define ATH_ANT_DIV_COMB_INIT_COUNT 9541#define ATH_ANT_DIV_COMB_MAX_COUNT 10042#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO 3043#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 204445#define ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA -146#define ATH_ANT_DIV_COMB_LNA1_DELTA_HI -447#define ATH_ANT_DIV_COMB_LNA1_DELTA_MID -248#define ATH_ANT_DIV_COMB_LNA1_DELTA_LOW 24950struct if_ath_ant_comb_state {51uint16_t count;52uint16_t total_pkt_count;53HAL_BOOL scan;54HAL_BOOL scan_not_start;55int main_total_rssi;56int alt_total_rssi;57int alt_recv_cnt;58int main_recv_cnt;59int rssi_lna1;60int rssi_lna2;61int rssi_add;62int rssi_sub;63int rssi_first;64int rssi_second;65int rssi_third;66HAL_BOOL alt_good;67int quick_scan_cnt;68int main_conf;69HAL_ANT_DIV_COMB_LNA_CONF first_quick_scan_conf;70HAL_ANT_DIV_COMB_LNA_CONF second_quick_scan_conf;71int first_bias;72int second_bias;73HAL_BOOL first_ratio;74HAL_BOOL second_ratio;75unsigned long scan_start_time;76int lna1_lna2_delta;77};7879extern int ath_lna_div_attach(struct ath_softc *sc);80extern int ath_lna_div_detach(struct ath_softc *sc);81extern int ath_lna_div_ioctl(struct ath_softc *sc, struct ath_diag *ad);82extern int ath_lna_div_enable(struct ath_softc *sc,83const struct ieee80211_channel *ch);8485extern void ath_lna_rx_comb_scan(struct ath_softc *sc,86struct ath_rx_status *rs, unsigned long ticks, int hz);8788#endif /* __IF_ATH_LNA_DIV_H__ */899091