3 * Copyright (c) 2004-2010 Atheros Communications Inc.
8 // Permission to use, copy, modify, and/or distribute this software for any
9 // purpose with or without fee is hereby granted, provided that the above
10 // copyright notice and this permission notice appear in all copies.
12 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 #ifndef __AGGR_RECV_API_H__
25 #define __AGGR_RECV_API_H__
31 typedef void (* RX_CALLBACK)(void * dev, void *osbuf);
33 typedef void (* ALLOC_NETBUFS)(A_NETBUF_QUEUE_T *q, u16 num);
37 * Initialises the data structures, allocates data queues and
38 * os buffers. Netbuf allocator is the input param, used by the
39 * aggr module for allocation of NETBUFs from driver context.
40 * These NETBUFs are used for AMSDU processing.
41 * Returns the context for the aggr module.
44 aggr_init(ALLOC_NETBUFS netbuf_allocator);
48 * aggr_register_rx_dispatcher:
49 * Registers OS call back function to deliver the
50 * frames to OS. This is generally the topmost layer of
51 * the driver context, after which the frames go to
52 * IP stack via the call back function.
53 * This dispatcher is active only when aggregation is ON.
56 aggr_register_rx_dispatcher(void *cntxt, void * dev, RX_CALLBACK fn);
61 * When target receives BAR, it communicates to host driver
62 * for modifying window parameters. Target indicates this via the
63 * event: WMI_ADDBA_REQ_EVENTID. Host will dequeue all frames
64 * up to the indicated sequence number.
67 aggr_process_bar(void *cntxt, u8 tid, u16 seq_no);
71 * aggr_recv_addba_req_evt:
72 * This event is to initiate/modify the receive side window.
73 * Target will send WMI_ADDBA_REQ_EVENTID event to host - to setup
74 * recv re-ordering queues. Target will negotiate ADDBA with peer,
75 * and indicate via this event after successfully completing the
76 * negotiation. This happens in two situations:
77 * 1. Initial setup of aggregation
78 * 2. Renegotiation of current recv window.
79 * Window size for re-ordering is limited by target buffer
80 * space, which is reflected in win_sz.
81 * (Re)Start the periodic timer to deliver long standing frames,
85 aggr_recv_addba_req_evt(void * cntxt, u8 tid, u16 seq_no, u8 win_sz);
89 * aggr_recv_delba_req_evt:
90 * Target indicates deletion of a BA window for a tid via the
91 * WMI_DELBA_EVENTID. Host would deliver all the frames in the
92 * hold_q, reset tid config and disable the periodic timer, if
93 * aggr is not enabled on any tid.
96 aggr_recv_delba_req_evt(void * cntxt, u8 tid);
101 * aggr_process_recv_frm:
102 * Called only for data frames. When aggr is ON for a tid, the buffer
103 * is always consumed, and osbuf would be NULL. For a non-aggr case,
104 * osbuf is not modified.
105 * AMSDU frames are consumed and are later freed. They are sliced and
106 * diced to individual frames and dispatched to stack.
107 * After consuming a osbuf(when aggr is ON), a previously registered
108 * callback may be called to deliver frames in order.
111 aggr_process_recv_frm(void *cntxt, u8 tid, u16 seq_no, bool is_amsdu, void **osbuf);
115 * aggr_module_destroy:
116 * Frees up all the queues and frames in them. Releases the cntxt to OS.
119 aggr_module_destroy(void *cntxt);
122 * Dumps the aggregation stats
125 aggr_dump_stats(void *cntxt, PACKET_LOG **log_buf);
128 * aggr_reset_state -- Called when it is deemed necessary to clear the aggregate
129 * hold Q state. Examples include when a Connect event or disconnect event is
133 aggr_reset_state(void *cntxt);
140 #endif /*__AGGR_RECV_API_H__ */