PageRenderTime 36ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/pform/linux/inc/debug_module.h

http://github.com/CyanogenMod/cm-kernel
C Header | 114 lines | 49 code | 23 blank | 42 comment | 0 complexity | 6495ba21513c802a46f374bd60a24ec1 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  1. /****************************************************************************
  2. **+-----------------------------------------------------------------------+**
  3. **| |**
  4. **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
  5. **| All rights reserved. |**
  6. **| |**
  7. **| Redistribution and use in source and binary forms, with or without |**
  8. **| modification, are permitted provided that the following conditions |**
  9. **| are met: |**
  10. **| |**
  11. **| * Redistributions of source code must retain the above copyright |**
  12. **| notice, this list of conditions and the following disclaimer. |**
  13. **| * Redistributions in binary form must reproduce the above copyright |**
  14. **| notice, this list of conditions and the following disclaimer in |**
  15. **| the documentation and/or other materials provided with the |**
  16. **| distribution. |**
  17. **| * Neither the name Texas Instruments nor the names of its |**
  18. **| contributors may be used to endorse or promote products derived |**
  19. **| from this software without specific prior written permission. |**
  20. **| |**
  21. **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
  22. **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
  23. **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
  24. **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |**
  25. **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
  26. **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |**
  27. **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
  28. **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
  29. **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
  30. **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
  31. **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
  32. **| |**
  33. **+-----------------------------------------------------------------------+**
  34. ****************************************************************************/
  35. /**************************************************************************/
  36. #ifndef _DEBUG_MODULE_H
  37. #define _DEBUG_MODULE_H
  38. #include "osTIType.h"
  39. #include "debug_module_ioctl.h"
  40. /*****************************************************/
  41. /*****************************************************/
  42. /* Debug mode - use this define to debug this module */
  43. /* #define DEBUG_THIS_MODULE*/
  44. #ifdef DEBUG_THIS_MODULE
  45. #ifdef _WINDOWS
  46. #else /* ifdef __LINUX__ */
  47. #define DEBUG_MESSAGE(_msg) (report_d _msg)
  48. #endif
  49. #else /* DEBUG_THIS_MODULE */
  50. #define DEBUG_MESSAGE(_msg)
  51. #endif /* DEBUG_THIS_MODULE */
  52. /*****************************************************/
  53. /*****************************************************/
  54. #define MAX_CHAR_DRIVERS (2)
  55. #define MAX_CHAR_DRIVER_NAME (30)
  56. #define SPI_CHAR_DRIVER_NAME ("SPI_char_driver")
  57. #define DEBUG_MSG_CHAR_DRIVER_NAME ("Debug_messages_char_driver")
  58. #define SPI_CHAR_DRIVER (0)
  59. #define DEBUG_MSG_CHAR_DRIVER (1)
  60. #define ENQUEUE_MESSAGE_CONTROL_SIZE (1)
  61. #define CONTROL_CODE_TYPE_MESSAGE (0)
  62. #define REPORT_MESSAGE_PARAMS (3)
  63. #define REPORT_MESSAGE_LEN (sizeof(unsigned int) * REPORT_MESSAGE_PARAMS)
  64. #define DEBUG_MODULE_TRACE_QUEUE_ID (0)
  65. typedef struct
  66. {
  67. unsigned int read_pointer; /* Current read pointer */
  68. unsigned int write_pointer; /* Current write pointer */
  69. unsigned int used_size; /* The used data size */
  70. unsigned int size; /* Total size of the buffer */
  71. unsigned int overrun_count; /* Number of packets that were run over */
  72. tiBOOL waiting_for_data; /* TRUE if the user mode is pending */
  73. } t_queue_status;
  74. extern tiBOOL module_enable;
  75. extern int *buffers_default_size[MAX_CHAR_DRIVERS];
  76. extern UINT8 *buffers[MAX_CHAR_DRIVERS]; /* Pointer to the allocated buffder */
  77. void init_queue(UINT8 device_index);
  78. unsigned char get_message_from_queue(UINT8 device_index, t_ioctol1_format *ioctl_data);
  79. void get_queue_information(UINT8 device_index, unsigned int *report_msg);
  80. tiBOOL debug_module_enqueue_message(UINT8 queue_id, UINT8 param, void *p_msg, unsigned int len, UINT8 message_type);
  81. tiBOOL debug_module_logic_allocate_queue(UINT8 device_index, UINT8 size_in_k);
  82. void debug_module_logic_deallocate_queue(UINT8 device_index, UINT8 size_in_k);
  83. /* OS depended function prototypes */
  84. void os_cmd_spin_lock_irqsave(void);
  85. void os_cmd_spin_unlock_irqrestore(void);
  86. void os_cmd_up(void);
  87. void os_cmd_down_interruptible(void);
  88. void os_cmd_copy_to_user(void *destination, const void *source, unsigned int size);
  89. void *os_malloc (UINT32 size);
  90. void os_free (void *p, UINT32 size);
  91. #endif /* _DEBUG_MODULE_H */