proto.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) 2013 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 BRCMFMAC_PROTO_H
  17. #define BRCMFMAC_PROTO_H
  18. struct brcmf_proto {
  19. int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
  20. struct sk_buff *skb);
  21. int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd,
  22. void *buf, uint len);
  23. int (*set_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf,
  24. uint len);
  25. int (*txdata)(struct brcmf_pub *drvr, int ifidx, u8 offset,
  26. struct sk_buff *skb);
  27. void *pd;
  28. };
  29. int brcmf_proto_attach(struct brcmf_pub *drvr);
  30. void brcmf_proto_detach(struct brcmf_pub *drvr);
  31. static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
  32. u8 *ifidx, struct sk_buff *skb)
  33. {
  34. return drvr->proto->hdrpull(drvr, do_fws, ifidx, skb);
  35. }
  36. static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx,
  37. uint cmd, void *buf, uint len)
  38. {
  39. return drvr->proto->query_dcmd(drvr, ifidx, cmd, buf, len);
  40. }
  41. static inline int brcmf_proto_set_dcmd(struct brcmf_pub *drvr, int ifidx,
  42. uint cmd, void *buf, uint len)
  43. {
  44. return drvr->proto->set_dcmd(drvr, ifidx, cmd, buf, len);
  45. }
  46. static inline int brcmf_proto_txdata(struct brcmf_pub *drvr, int ifidx,
  47. u8 offset, struct sk_buff *skb)
  48. {
  49. return drvr->proto->txdata(drvr, ifidx, offset, skb);
  50. }
  51. #endif /* BRCMFMAC_PROTO_H */