xref: /freebsd/sys/dev/ath/if_ath_rx.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1e60c4fc2SAdrian Chadd /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
4e60c4fc2SAdrian Chadd  * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5e60c4fc2SAdrian Chadd  * All rights reserved.
6e60c4fc2SAdrian Chadd  *
7e60c4fc2SAdrian Chadd  * Redistribution and use in source and binary forms, with or without
8e60c4fc2SAdrian Chadd  * modification, are permitted provided that the following conditions
9e60c4fc2SAdrian Chadd  * are met:
10e60c4fc2SAdrian Chadd  * 1. Redistributions of source code must retain the above copyright
11e60c4fc2SAdrian Chadd  *    notice, this list of conditions and the following disclaimer,
12e60c4fc2SAdrian Chadd  *    without modification.
13e60c4fc2SAdrian Chadd  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14e60c4fc2SAdrian Chadd  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
15e60c4fc2SAdrian Chadd  *    redistribution must be conditioned upon including a substantially
16e60c4fc2SAdrian Chadd  *    similar Disclaimer requirement for further binary redistribution.
17e60c4fc2SAdrian Chadd  *
18e60c4fc2SAdrian Chadd  * NO WARRANTY
19e60c4fc2SAdrian Chadd  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20e60c4fc2SAdrian Chadd  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21e60c4fc2SAdrian Chadd  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
22e60c4fc2SAdrian Chadd  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23e60c4fc2SAdrian Chadd  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
24e60c4fc2SAdrian Chadd  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25e60c4fc2SAdrian Chadd  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26e60c4fc2SAdrian Chadd  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
27e60c4fc2SAdrian Chadd  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28e60c4fc2SAdrian Chadd  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29e60c4fc2SAdrian Chadd  * THE POSSIBILITY OF SUCH DAMAGES.
30e60c4fc2SAdrian Chadd  */
31e60c4fc2SAdrian Chadd #ifndef	__IF_ATH_RX_H__
32e60c4fc2SAdrian Chadd #define	__IF_ATH_RX_H__
33e60c4fc2SAdrian Chadd 
34e60c4fc2SAdrian Chadd extern	u_int32_t ath_calcrxfilter(struct ath_softc *sc);
35e60c4fc2SAdrian Chadd extern	void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
36c79f192cSAdrian Chadd 	    int subtype, const struct ieee80211_rx_stats *rxs,
37c79f192cSAdrian Chadd 	    int rssi, int nf);
38f8cc9b09SAdrian Chadd 
39f8cc9b09SAdrian Chadd #define	ath_stoprecv(_sc, _dodelay)		\
40f8cc9b09SAdrian Chadd 	    (_sc)->sc_rx.recv_stop((_sc), (_dodelay))
41f8cc9b09SAdrian Chadd #define	ath_startrecv(_sc)			\
42f8cc9b09SAdrian Chadd 	    (_sc)->sc_rx.recv_start((_sc))
43f8cc9b09SAdrian Chadd #define	ath_rx_flush(_sc)			\
44f8cc9b09SAdrian Chadd 	    (_sc)->sc_rx.recv_flush((_sc))
45f8cc9b09SAdrian Chadd #define	ath_rxbuf_init(_sc, _bf)		\
46f8cc9b09SAdrian Chadd 	    (_sc)->sc_rx.recv_rxbuf_init((_sc), (_bf))
473d184db2SAdrian Chadd #define	ath_rxdma_setup(_sc)			\
483d184db2SAdrian Chadd 	    (_sc)->sc_rx.recv_setup(_sc)
493d184db2SAdrian Chadd #define	ath_rxdma_teardown(_sc)			\
503d184db2SAdrian Chadd 	    (_sc)->sc_rx.recv_teardown(_sc)
51f8cc9b09SAdrian Chadd 
52f8cc9b09SAdrian Chadd #if 0
53f8cc9b09SAdrian Chadd extern	int ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf);
54e60c4fc2SAdrian Chadd extern	void ath_rx_tasklet(void *arg, int npending);
55e60c4fc2SAdrian Chadd extern	void ath_rx_proc(struct ath_softc *sc, int resched);
56e60c4fc2SAdrian Chadd extern	void ath_stoprecv(struct ath_softc *sc, int dodelay);
57e60c4fc2SAdrian Chadd extern	int ath_startrecv(struct ath_softc *sc);
58f8cc9b09SAdrian Chadd #endif
59f8cc9b09SAdrian Chadd 
60d434a377SAdrian Chadd extern	int ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs,
61d434a377SAdrian Chadd 	    HAL_STATUS status, uint64_t tsf, int nf, HAL_RX_QUEUE qtype,
628cc724d9SAdrian Chadd 	    struct ath_buf *bf, struct mbuf *m);
63d434a377SAdrian Chadd 
64f8cc9b09SAdrian Chadd extern	void ath_recv_setup_legacy(struct ath_softc *sc);
65e60c4fc2SAdrian Chadd 
66e60c4fc2SAdrian Chadd #endif
67