162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright (c) 2010 Broadcom Corporation 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 562306a36Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 662306a36Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 962306a36Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1062306a36Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 1162306a36Sopenharmony_ci * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1262306a36Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 1362306a36Sopenharmony_ci * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 1462306a36Sopenharmony_ci * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1562306a36Sopenharmony_ci */ 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#ifndef _BRCM_SCB_H_ 1862306a36Sopenharmony_ci#define _BRCM_SCB_H_ 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#include <linux/if_ether.h> 2162306a36Sopenharmony_ci#include <brcmu_utils.h> 2262306a36Sopenharmony_ci#include <defs.h> 2362306a36Sopenharmony_ci#include "types.h" 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci#define AMPDU_TX_BA_MAX_WSIZE 64 /* max Tx ba window size (in pdu) */ 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define AMPDU_MAX_SCB_TID NUMPRIO 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci/* scb flags */ 3062306a36Sopenharmony_ci#define SCB_WMECAP 0x0040 3162306a36Sopenharmony_ci#define SCB_HTCAP 0x10000 /* HT (MIMO) capable device */ 3262306a36Sopenharmony_ci#define SCB_IS40 0x80000 /* 40MHz capable */ 3362306a36Sopenharmony_ci#define SCB_STBCCAP 0x40000000 /* STBC Capable */ 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#define SCB_MAGIC 0xbeefcafe 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci/* structure to store per-tid state for the ampdu initiator */ 3862306a36Sopenharmony_cistruct scb_ampdu_tid_ini { 3962306a36Sopenharmony_ci /* tx retry count; indexed by seq modulo */ 4062306a36Sopenharmony_ci u8 txretry[AMPDU_TX_BA_MAX_WSIZE]; 4162306a36Sopenharmony_ci}; 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_cistruct scb_ampdu { 4462306a36Sopenharmony_ci u8 max_pdu; /* max pdus allowed in ampdu */ 4562306a36Sopenharmony_ci u8 release; /* # of mpdus released at a time */ 4662306a36Sopenharmony_ci u32 max_rx_ampdu_bytes; /* max ampdu rcv length; 8k, 16k, 32k, 64k */ 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci /* 4962306a36Sopenharmony_ci * This could easily be a ini[] pointer and we keep this info in wl 5062306a36Sopenharmony_ci * itself instead of having mac80211 hold it for us. Also could be made 5162306a36Sopenharmony_ci * dynamic per tid instead of static. 5262306a36Sopenharmony_ci */ 5362306a36Sopenharmony_ci /* initiator info - per tid (NUMPRIO): */ 5462306a36Sopenharmony_ci struct scb_ampdu_tid_ini ini[AMPDU_MAX_SCB_TID]; 5562306a36Sopenharmony_ci}; 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci/* station control block - one per remote MAC address */ 5862306a36Sopenharmony_cistruct scb { 5962306a36Sopenharmony_ci u32 magic; 6062306a36Sopenharmony_ci u32 flags; /* various bit flags as defined below */ 6162306a36Sopenharmony_ci u16 seqctl[NUMPRIO]; /* seqctl of last received frame (for dups) */ 6262306a36Sopenharmony_ci u16 seqnum[NUMPRIO];/* WME: driver maintained sw seqnum per priority */ 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci struct scb_ampdu scb_ampdu; /* AMPDU state including per tid info */ 6562306a36Sopenharmony_ci}; 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci#endif /* _BRCM_SCB_H_ */ 68