msgbuf.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Copyright (c) 2014 Broadcom Corporation
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef BRCMFMAC_MSGBUF_H
  16. #define BRCMFMAC_MSGBUF_H
  17. #ifdef CONFIG_BRCMFMAC_PROTO_MSGBUF
  18. #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM 64
  19. #define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM 512
  20. #define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM 64
  21. #define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM 1024
  22. #define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM 512
  23. #define BRCMF_H2D_TXFLOWRING_MAX_ITEM 512
  24. #define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE 40
  25. #define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_ITEMSIZE 32
  26. #define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_ITEMSIZE 24
  27. #define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE_PRE_V7 16
  28. #define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE 24
  29. #define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE_PRE_V7 32
  30. #define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE 40
  31. #define BRCMF_H2D_TXFLOWRING_ITEMSIZE 48
  32. struct msgbuf_buf_addr {
  33. __le32 low_addr;
  34. __le32 high_addr;
  35. };
  36. int brcmf_proto_msgbuf_rx_trigger(struct device *dev);
  37. void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u16 flowid);
  38. int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr);
  39. void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr);
  40. #else
  41. static inline int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
  42. {
  43. return 0;
  44. }
  45. static inline void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr) {}
  46. #endif
  47. #endif /* BRCMFMAC_MSGBUF_H */