105491d2cSKalle Valo /*
205491d2cSKalle Valo  * Copyright (c) 2010 Broadcom Corporation
305491d2cSKalle Valo  *
405491d2cSKalle Valo  * Permission to use, copy, modify, and/or distribute this software for any
505491d2cSKalle Valo  * purpose with or without fee is hereby granted, provided that the above
605491d2cSKalle Valo  * copyright notice and this permission notice appear in all copies.
705491d2cSKalle Valo  *
805491d2cSKalle Valo  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
905491d2cSKalle Valo  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1005491d2cSKalle Valo  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
1105491d2cSKalle Valo  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1205491d2cSKalle Valo  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
1305491d2cSKalle Valo  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1405491d2cSKalle Valo  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1505491d2cSKalle Valo  */
1605491d2cSKalle Valo 
1705491d2cSKalle Valo #ifndef _BRCM_AMPDU_H_
1805491d2cSKalle Valo #define _BRCM_AMPDU_H_
1905491d2cSKalle Valo 
2005491d2cSKalle Valo /*
2105491d2cSKalle Valo  * Data structure representing an in-progress session for accumulating
2205491d2cSKalle Valo  * frames for AMPDU.
2305491d2cSKalle Valo  *
2405491d2cSKalle Valo  * wlc: pointer to common driver data
2505491d2cSKalle Valo  * skb_list: queue of skb's for AMPDU
2605491d2cSKalle Valo  * max_ampdu_len: maximum length for this AMPDU
2705491d2cSKalle Valo  * max_ampdu_frames: maximum number of frames for this AMPDU
2805491d2cSKalle Valo  * ampdu_len: total number of bytes accumulated for this AMPDU
2905491d2cSKalle Valo  * dma_len: DMA length of this AMPDU
3005491d2cSKalle Valo  */
3105491d2cSKalle Valo struct brcms_ampdu_session {
3205491d2cSKalle Valo 	struct brcms_c_info *wlc;
3305491d2cSKalle Valo 	struct sk_buff_head skb_list;
3405491d2cSKalle Valo 	unsigned max_ampdu_len;
3505491d2cSKalle Valo 	u16 max_ampdu_frames;
3605491d2cSKalle Valo 	u16 ampdu_len;
3705491d2cSKalle Valo 	u16 dma_len;
3805491d2cSKalle Valo };
3905491d2cSKalle Valo 
4005491d2cSKalle Valo void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
4105491d2cSKalle Valo 				 struct brcms_c_info *wlc);
4205491d2cSKalle Valo int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
4305491d2cSKalle Valo 			    struct sk_buff *p);
4405491d2cSKalle Valo void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
4505491d2cSKalle Valo 
4605491d2cSKalle Valo struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
4705491d2cSKalle Valo void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
4805491d2cSKalle Valo void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
4905491d2cSKalle Valo 			      struct sk_buff *p, struct tx_status *txs);
5005491d2cSKalle Valo void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
5105491d2cSKalle Valo void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
5205491d2cSKalle Valo 
5305491d2cSKalle Valo #endif				/* _BRCM_AMPDU_H_ */
54