dhd_proto.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Header file describing the internal (inter-module) DHD interfaces.
  3. *
  4. * Provides type definitions and function prototypes used to link the
  5. * DHD OS, bus, and protocol modules.
  6. *
  7. * Copyright (C) 1999-2014, Broadcom Corporation
  8. *
  9. * Unless you and Broadcom execute a separate written software license
  10. * agreement governing use of this software, this software is licensed to you
  11. * under the terms of the GNU General Public License version 2 (the "GPL"),
  12. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  13. * following added to such license:
  14. *
  15. * As a special exception, the copyright holders of this software give you
  16. * permission to link this software with independent modules, and to copy and
  17. * distribute the resulting executable under terms of your choice, provided that
  18. * you also meet, for each linked independent module, the terms and conditions of
  19. * the license of that module. An independent module is a module which is not
  20. * derived from this software. The special exception does not apply to any
  21. * modifications of the software.
  22. *
  23. * Notwithstanding the above, under no circumstances may you combine this
  24. * software in any way with any other Broadcom software provided under a license
  25. * other than the GPL, without Broadcom's express prior written consent.
  26. *
  27. * $Id: dhd_proto.h 455951 2014-02-17 10:52:22Z $
  28. */
  29. #ifndef _dhd_proto_h_
  30. #define _dhd_proto_h_
  31. #include <dhdioctl.h>
  32. #include <wlioctl.h>
  33. #ifndef IOCTL_RESP_TIMEOUT
  34. #define IOCTL_RESP_TIMEOUT 2000 /* In milli second default value for Production FW */
  35. #endif /* IOCTL_RESP_TIMEOUT */
  36. #ifndef MFG_IOCTL_RESP_TIMEOUT
  37. #define MFG_IOCTL_RESP_TIMEOUT 20000 /* In milli second default value for MFG FW */
  38. #endif /* MFG_IOCTL_RESP_TIMEOUT */
  39. /*
  40. * Exported from the dhd protocol module (dhd_cdc, dhd_rndis)
  41. */
  42. /* Linkage, sets prot link and updates hdrlen in pub */
  43. extern int dhd_prot_attach(dhd_pub_t *dhdp);
  44. /* Unlink, frees allocated protocol memory (including dhd_prot) */
  45. extern void dhd_prot_detach(dhd_pub_t *dhdp);
  46. /* Initialize protocol: sync w/dongle state.
  47. * Sets dongle media info (iswl, drv_version, mac address).
  48. */
  49. extern int dhd_prot_init(dhd_pub_t *dhdp);
  50. /* Stop protocol: sync w/dongle state. */
  51. extern void dhd_prot_stop(dhd_pub_t *dhdp);
  52. /* Add any protocol-specific data header.
  53. * Caller must reserve prot_hdrlen prepend space.
  54. */
  55. extern void dhd_prot_hdrpush(dhd_pub_t *, int ifidx, void *txp);
  56. /* Remove any protocol-specific data header. */
  57. extern int dhd_prot_hdrpull(dhd_pub_t *, int *ifidx, void *rxp, uchar *buf, uint *len);
  58. /* Use protocol to issue ioctl to dongle */
  59. extern int dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len);
  60. /* Handles a protocol control response asynchronously */
  61. extern int dhd_prot_ctl_complete(dhd_pub_t *dhd);
  62. /* Check for and handle local prot-specific iovar commands */
  63. extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
  64. void *params, int plen, void *arg, int len, bool set);
  65. /* Add prot dump output to a buffer */
  66. extern void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
  67. /* Update local copy of dongle statistics */
  68. extern void dhd_prot_dstats(dhd_pub_t *dhdp);
  69. extern int dhd_ioctl(dhd_pub_t * dhd_pub, dhd_ioctl_t *ioc, void * buf, uint buflen);
  70. extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
  71. extern int dhd_process_pkt_reorder_info(dhd_pub_t *dhd, uchar *reorder_info_buf,
  72. uint reorder_info_len, void **pkt, uint32 *free_buf_count);
  73. #ifdef BCMPCIE
  74. extern int dhd_prot_process_msgbuf(dhd_pub_t *dhd);
  75. extern int dhd_prot_process_ctrlbuf(dhd_pub_t * dhd);
  76. extern bool dhd_prot_dtohsplit(dhd_pub_t * dhd);
  77. extern int dhd_post_dummy_msg(dhd_pub_t *dhd);
  78. extern int dhdmsgbuf_lpbk_req(dhd_pub_t *dhd, uint len);
  79. extern void dhd_prot_rx_dataoffset(dhd_pub_t *dhd, uint32 offset);
  80. extern int dhd_prot_txdata(dhd_pub_t *dhd, void *p, uint8 ifidx);
  81. extern int dhdmsgbuf_dmaxfer_req(dhd_pub_t *dhd, uint len, uint srcdelay, uint destdelay);
  82. #endif
  83. /********************************
  84. * For version-string expansion *
  85. */
  86. #if defined(BDC)
  87. #define DHD_PROTOCOL "bdc"
  88. #elif defined(CDC)
  89. #define DHD_PROTOCOL "cdc"
  90. #else
  91. #define DHD_PROTOCOL "unknown"
  92. #endif /* proto */
  93. #endif /* _dhd_proto_h_ */