qdf_status.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: qdf_status
  20. * QCA driver framework (QDF) status codes
  21. * Basic status codes/definitions used by QDF
  22. */
  23. #ifndef __QDF_STATUS_H
  24. #define __QDF_STATUS_H
  25. /**
  26. * typedef QDF_STATUS - QDF error codes
  27. * @QDF_STATUS_SUCCESS: success
  28. * @QDF_STATUS_E_RESOURCES: system resource(other than memory) not available
  29. * @QDF_STATUS_E_NOMEM: not enough memory
  30. * @QDF_STATUS_E_AGAIN: try again
  31. * @QDF_STATUS_E_INVAL: invalid request
  32. * @QDF_STATUS_E_FAULT: system fault
  33. * @QDF_STATUS_E_ALREADY: another request already in progress
  34. * @QDF_STATUS_E_BADMSG: bad message
  35. * @QDF_STATUS_E_BUSY: device or resource busy
  36. * @QDF_STATUS_E_CANCELED: request cancelled
  37. * @QDF_STATUS_E_ABORTED: request aborted
  38. * @QDF_STATUS_E_NOSUPPORT: request not supported
  39. * @QDF_STATUS_E_PERM: operation not permitted
  40. * @QDF_STATUS_E_EMPTY: empty condition
  41. * @QDF_STATUS_E_EXISTS: existence failure
  42. * @QDF_STATUS_E_TIMEOUT: operation timeout
  43. * @QDF_STATUS_E_FAILURE: unknown reason do not use unless nothign else applies
  44. * @QDF_STATUS_E_NOENT: No such file or directory
  45. * @QDF_STATUS_E_E2BIG: Arg list too long
  46. * @QDF_STATUS_E_NOSPC: no space left on device
  47. * @QDF_STATUS_E_ADDRNOTAVAIL: Cannot assign requested address
  48. * @QDF_STATUS_E_ENXIO: No such device or address
  49. * @QDF_STATUS_E_NETDOWN: network is down
  50. * @QDF_STATUS_E_IO: I/O Error
  51. * @QDF_STATUS_E_PENDING: pending status
  52. * @QDF_STATUS_E_NETRESET: Network dropped connection because of reset
  53. * @QDF_STATUS_E_SIG: Exit due to received SIGINT
  54. * @QDF_STATUS_E_PROTO: protocol error
  55. * @QDF_STATUS_NOT_INITIALIZED: resource not initialized
  56. * @QDF_STATUS_E_NULL_VALUE: request is null
  57. * @QDF_STATUS_PMC_PENDING: request pendign in pmc
  58. * @QDF_STATUS_PMC_DISABLED: pmc is disabled
  59. * @QDF_STATUS_PMC_NOT_NOW: pmc not ready now
  60. * @QDF_STATUS_PMC_AC_POWER: pmc ac power
  61. * @QDF_STATUS_PMC_SYS_ERROR: pmc system error
  62. * @QDF_STATUS_HEARTBEAT_TMOUT: hearbeat timeout error
  63. * @QDF_STATUS_NTH_BEACON_DELIVERY: Nth beacon delivery
  64. * @QDF_STATUS_CSR_WRONG_STATE: csr in wrong state
  65. * @QDF_STATUS_FT_PREAUTH_KEY_SUCCESS: ft preauth key success
  66. * @QDF_STATUS_FT_PREAUTH_KEY_FAILED: ft preauth key failed
  67. * @QDF_STATUS_CMD_NOT_QUEUED: command not queued
  68. * @QDF_STATUS_FW_MSG_TIMEDOUT: target message timeout
  69. * @QDF_STATUS_E_USB_ERROR: USB transaction error
  70. * @QDF_STATUS_MAXCOMP_FAIL: Component id is more than MAX UMAC components
  71. * @QDF_STATUS_COMP_DISABLED: UMAC Component is disabled
  72. * @QDF_STATUS_COMP_ASYNC: UMAC component runs in asynchronous communication
  73. * @QDF_STATUS_CRYPTO_PN_ERROR: PN ERROR in received frame
  74. * @QDF_STATUS_CRYPTO_MIC_FAILURE: MIC failure in received frame
  75. * @QDF_STATUS_CRYPTO_ENCRYPT_FAILED: encryption failed
  76. * @QDF_STATUS_CRYPTO_DECRYPT_FAILED: decryption failed
  77. * @QDF_STATUS_E_RANGE: result/parameter/operation was out of range
  78. * @QDF_STATUS_E_GRO_DROP: return code for GRO drop
  79. * @QDF_STATUS_MAX: not a realy value just a place holder for max
  80. */
  81. typedef enum {
  82. QDF_STATUS_SUCCESS,
  83. QDF_STATUS_E_RESOURCES,
  84. QDF_STATUS_E_NOMEM,
  85. QDF_STATUS_E_AGAIN,
  86. QDF_STATUS_E_INVAL,
  87. QDF_STATUS_E_FAULT,
  88. QDF_STATUS_E_ALREADY,
  89. QDF_STATUS_E_BADMSG,
  90. QDF_STATUS_E_BUSY,
  91. QDF_STATUS_E_CANCELED,
  92. QDF_STATUS_E_ABORTED,
  93. QDF_STATUS_E_NOSUPPORT,
  94. QDF_STATUS_E_PERM,
  95. QDF_STATUS_E_EMPTY,
  96. QDF_STATUS_E_EXISTS,
  97. QDF_STATUS_E_TIMEOUT,
  98. QDF_STATUS_E_FAILURE,
  99. QDF_STATUS_E_NOENT,
  100. QDF_STATUS_E_E2BIG,
  101. QDF_STATUS_E_NOSPC,
  102. QDF_STATUS_E_ADDRNOTAVAIL,
  103. QDF_STATUS_E_ENXIO,
  104. QDF_STATUS_E_NETDOWN,
  105. QDF_STATUS_E_IO,
  106. QDF_STATUS_E_PENDING,
  107. QDF_STATUS_E_NETRESET,
  108. QDF_STATUS_E_SIG,
  109. QDF_STATUS_E_PROTO,
  110. QDF_STATUS_NOT_INITIALIZED,
  111. QDF_STATUS_E_NULL_VALUE,
  112. QDF_STATUS_PMC_PENDING,
  113. QDF_STATUS_PMC_DISABLED,
  114. QDF_STATUS_PMC_NOT_NOW,
  115. QDF_STATUS_PMC_AC_POWER,
  116. QDF_STATUS_PMC_SYS_ERROR,
  117. QDF_STATUS_HEARTBEAT_TMOUT,
  118. QDF_STATUS_NTH_BEACON_DELIVERY,
  119. QDF_STATUS_CSR_WRONG_STATE,
  120. QDF_STATUS_FT_PREAUTH_KEY_SUCCESS,
  121. QDF_STATUS_FT_PREAUTH_KEY_FAILED,
  122. QDF_STATUS_CMD_NOT_QUEUED,
  123. QDF_STATUS_FW_MSG_TIMEDOUT,
  124. QDF_STATUS_E_USB_ERROR,
  125. QDF_STATUS_MAXCOMP_FAIL,
  126. QDF_STATUS_COMP_DISABLED,
  127. QDF_STATUS_COMP_ASYNC,
  128. QDF_STATUS_CRYPTO_PN_ERROR,
  129. QDF_STATUS_CRYPTO_MIC_FAILURE,
  130. QDF_STATUS_CRYPTO_ENCRYPT_FAILED,
  131. QDF_STATUS_CRYPTO_DECRYPT_FAILED,
  132. QDF_STATUS_E_DEFRAG_ERROR,
  133. QDF_STATUS_E_RANGE,
  134. QDF_STATUS_E_GRO_DROP,
  135. QDF_STATUS_MAX
  136. } QDF_STATUS;
  137. #define QDF_IS_STATUS_SUCCESS(status) (QDF_STATUS_SUCCESS == (status))
  138. #define QDF_IS_STATUS_ERROR(status) (QDF_STATUS_SUCCESS != (status))
  139. /**
  140. * qdf_status_to_os_return() - map a QDF_STATUS into an OS specific return code
  141. * @status: QDF_STATUS to map
  142. *
  143. * Return: an OS specific error code
  144. */
  145. int qdf_status_to_os_return(QDF_STATUS status);
  146. /**
  147. * qdf_status_from_os_return() - map an OS specific return code to a QDF_STATUS
  148. * @rc: the input return code to map
  149. *
  150. * Return: QDF_STATUS
  151. */
  152. QDF_STATUS qdf_status_from_os_return(int rc);
  153. #endif /* __QDF_STATUS_H */