Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2010 Broadcom Corporation
0003  *
0004  * Permission to use, copy, modify, and/or distribute this software for any
0005  * purpose with or without fee is hereby granted, provided that the above
0006  * copyright notice and this permission notice appear in all copies.
0007  *
0008  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
0009  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
0010  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
0011  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0012  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
0013  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
0014  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0015  */
0016 
0017 #ifndef _BRCM_SCB_H_
0018 #define _BRCM_SCB_H_
0019 
0020 #include <linux/if_ether.h>
0021 #include <brcmu_utils.h>
0022 #include <defs.h>
0023 #include "types.h"
0024 
0025 #define AMPDU_TX_BA_MAX_WSIZE   64  /* max Tx ba window size (in pdu) */
0026 
0027 #define AMPDU_MAX_SCB_TID   NUMPRIO
0028 
0029 /* scb flags */
0030 #define SCB_WMECAP      0x0040
0031 #define SCB_HTCAP       0x10000 /* HT (MIMO) capable device */
0032 #define SCB_IS40        0x80000 /* 40MHz capable */
0033 #define SCB_STBCCAP     0x40000000  /* STBC Capable */
0034 
0035 #define SCB_MAGIC   0xbeefcafe
0036 
0037 /* structure to store per-tid state for the ampdu initiator */
0038 struct scb_ampdu_tid_ini {
0039     u8 tid;       /* initiator tid for easy lookup */
0040     /* tx retry count; indexed by seq modulo */
0041     u8 txretry[AMPDU_TX_BA_MAX_WSIZE];
0042     struct scb *scb;  /* backptr for easy lookup */
0043     u8 ba_wsize;      /* negotiated ba window size (in pdu) */
0044 };
0045 
0046 struct scb_ampdu {
0047     struct scb *scb;    /* back pointer for easy reference */
0048     u8 mpdu_density;    /* mpdu density */
0049     u8 max_pdu;     /* max pdus allowed in ampdu */
0050     u8 release;     /* # of mpdus released at a time */
0051     u16 min_len;        /* min mpdu len to support the density */
0052     u32 max_rx_ampdu_bytes; /* max ampdu rcv length; 8k, 16k, 32k, 64k */
0053 
0054     /*
0055      * This could easily be a ini[] pointer and we keep this info in wl
0056      * itself instead of having mac80211 hold it for us. Also could be made
0057      * dynamic per tid instead of static.
0058      */
0059     /* initiator info - per tid (NUMPRIO): */
0060     struct scb_ampdu_tid_ini ini[AMPDU_MAX_SCB_TID];
0061 };
0062 
0063 /* station control block - one per remote MAC address */
0064 struct scb {
0065     u32 magic;
0066     u32 flags;  /* various bit flags as defined below */
0067     u32 flags2; /* various bit flags2 as defined below */
0068     u8 state;   /* current state bitfield of auth/assoc process */
0069     u8 ea[ETH_ALEN];    /* station address */
0070     uint fragresid[NUMPRIO];/* #bytes unused in frag buffer per prio */
0071 
0072     u16 seqctl[NUMPRIO];    /* seqctl of last received frame (for dups) */
0073     /* seqctl of last received frame (for dups) for non-QoS data and
0074      * management */
0075     u16 seqctl_nonqos;
0076     u16 seqnum[NUMPRIO];/* WME: driver maintained sw seqnum per priority */
0077 
0078     struct scb_ampdu scb_ampdu; /* AMPDU state including per tid info */
0079 };
0080 
0081 #endif              /* _BRCM_SCB_H_ */