PageRenderTime 50ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/pform/common/inc/cli_cu_common.h

http://github.com/CyanogenMod/cm-kernel
C Header | 116 lines | 61 code | 21 blank | 34 comment | 1 complexity | 9d203a94e2cc93abf168e87674f09af1 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. #ifndef common_h
  36. #define common_h
  37. #include "osTIType.h"
  38. #ifdef _WINDOWS
  39. #endif
  40. #ifndef TIWLAN_DRV_NAME
  41. #define TIWLAN_DRV_NAME DRV_NAME
  42. #endif
  43. #define IN /* input parameter */
  44. #define OUT /* output parameter */
  45. #define INOUT /* input & output parameter */
  46. #ifndef TRUE
  47. #define TRUE 1
  48. #endif
  49. #ifndef FALSE
  50. #define FALSE 0
  51. #endif
  52. #ifndef NULL
  53. # define NULL 0L
  54. #endif
  55. #ifndef UNUSED
  56. # define UNUSED(p) ((void)p)
  57. #endif
  58. #ifndef _WINDOWS
  59. #ifndef print
  60. # define print(fmt, arg...) fprintf(stdout, fmt, ##arg)
  61. #endif
  62. #ifndef print_err
  63. # define print_err(fmt, arg...) fprintf(stderr, fmt, ##arg)
  64. #endif
  65. #ifndef print_deb
  66. # ifdef DEBUG_MESSAGES
  67. # define print_deb(fmt, arg...) fprintf(stdout, fmt, ##arg)
  68. # else
  69. # define print_deb(fmt, arg...)
  70. # endif /* DEBUG_MESSAGES */
  71. #endif /* print_deb */
  72. #endif /* __LINUX__ */
  73. #ifndef SIZE_ARR
  74. # define SIZE_ARR(a) (sizeof(a)/sizeof(a[0]) )
  75. #endif
  76. #ifndef min
  77. # define min(a, b) (((a)<(b)) ? (a) : (b))
  78. #endif
  79. #ifndef max
  80. # define max(a, b) (((a)>(b)) ? (a) : (b))
  81. #endif
  82. typedef struct
  83. {
  84. tiUINT32 value;
  85. char *name;
  86. } named_value_t;
  87. #ifdef _WINDOWS
  88. #else
  89. #define print_available_values(arr) \
  90. { int i; for(i=0; i<SIZE_ARR(arr); i++) \
  91. print("%d - %s%s", arr[i].value, arr[i].name, (i>=SIZE_ARR(arr)-1) ? "\n" : ", " ); \
  92. }
  93. #endif
  94. void print_memory_dump(char *addr, int size );
  95. #endif /* common_h */