scb.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2010 Broadcom Corporation
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _BRCM_SCB_H_
  17. #define _BRCM_SCB_H_
  18. #include <linux/if_ether.h>
  19. #include <brcmu_utils.h>
  20. #include <defs.h>
  21. #include "types.h"
  22. #define AMPDU_TX_BA_MAX_WSIZE 64 /* max Tx ba window size (in pdu) */
  23. #define AMPDU_MAX_SCB_TID NUMPRIO
  24. /* scb flags */
  25. #define SCB_WMECAP 0x0040
  26. #define SCB_HTCAP 0x10000 /* HT (MIMO) capable device */
  27. #define SCB_IS40 0x80000 /* 40MHz capable */
  28. #define SCB_STBCCAP 0x40000000 /* STBC Capable */
  29. #define SCB_MAGIC 0xbeefcafe
  30. /* structure to store per-tid state for the ampdu initiator */
  31. struct scb_ampdu_tid_ini {
  32. u8 tx_in_transit; /* number of pending mpdus in transit in driver */
  33. u8 tid; /* initiator tid for easy lookup */
  34. /* tx retry count; indexed by seq modulo */
  35. u8 txretry[AMPDU_TX_BA_MAX_WSIZE];
  36. struct scb *scb; /* backptr for easy lookup */
  37. u8 ba_wsize; /* negotiated ba window size (in pdu) */
  38. };
  39. struct scb_ampdu {
  40. struct scb *scb; /* back pointer for easy reference */
  41. u8 mpdu_density; /* mpdu density */
  42. u8 max_pdu; /* max pdus allowed in ampdu */
  43. u8 release; /* # of mpdus released at a time */
  44. u16 min_len; /* min mpdu len to support the density */
  45. u32 max_rx_ampdu_bytes; /* max ampdu rcv length; 8k, 16k, 32k, 64k */
  46. /*
  47. * This could easily be a ini[] pointer and we keep this info in wl
  48. * itself instead of having mac80211 hold it for us. Also could be made
  49. * dynamic per tid instead of static.
  50. */
  51. /* initiator info - per tid (NUMPRIO): */
  52. struct scb_ampdu_tid_ini ini[AMPDU_MAX_SCB_TID];
  53. };
  54. /* station control block - one per remote MAC address */
  55. struct scb {
  56. u32 magic;
  57. u32 flags; /* various bit flags as defined below */
  58. u32 flags2; /* various bit flags2 as defined below */
  59. u8 state; /* current state bitfield of auth/assoc process */
  60. u8 ea[ETH_ALEN]; /* station address */
  61. uint fragresid[NUMPRIO];/* #bytes unused in frag buffer per prio */
  62. u16 seqctl[NUMPRIO]; /* seqctl of last received frame (for dups) */
  63. /* seqctl of last received frame (for dups) for non-QoS data and
  64. * management */
  65. u16 seqctl_nonqos;
  66. u16 seqnum[NUMPRIO];/* WME: driver maintained sw seqnum per priority */
  67. struct scb_ampdu scb_ampdu; /* AMPDU state including per tid info */
  68. };
  69. #endif /* _BRCM_SCB_H_ */