PageRenderTime 33ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/BusAccess/Shm_Common/shmBus.h

http://github.com/CyanogenMod/cm-kernel
C Header | 139 lines | 73 code | 15 blank | 51 comment | 0 complexity | fcd400c458af3861fbb2f5e44833245c 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. *
  37. * MODULE: shmBus.h
  38. * PURPOSE: Shared memory Bus access object
  39. *
  40. ****************************************************************************/
  41. #ifndef _WHAL_SHM_BUS_H
  42. #define _WHAL_SHM_BUS_H
  43. #include "whalHwEeprom.h"
  44. #include "whalBus_Api.h"
  45. #include "TNETWIF.h"
  46. #include "whalTrace.h"
  47. /*
  48. * Use this flag to optimize FW download.
  49. * By default this flag is disabled, because the
  50. * FW image may be stored at ROM addresses
  51. */
  52. #undef USE_NO_CHUNK_COPY
  53. /* Firmware image load chunk size */
  54. #define CHUNK_SIZE 512
  55. /* CLASS whalBus */
  56. typedef struct _whalBus_T
  57. {
  58. TI_HANDLE hTNETWIF;
  59. TI_HANDLE hTnetwDrv;
  60. HwEeprom_T *pHwEeprom;
  61. WhalTrace_T *pTrc;
  62. TI_HANDLE hOs;
  63. TI_HANDLE hReport;
  64. TI_HANDLE hWhalCtrl;
  65. UINT8 *pFwBuf; /* Firmware image ptr */
  66. UINT32 uFwLastAddr; /* Firmware image length */
  67. UINT8 *pEEPROMBuf; /* EEPROM image ptr */
  68. UINT32 uEEPROMLen; /* EEPROM image length */
  69. UINT8 *pEEPROMCurPtr;
  70. UINT32 uEEPROMCurLen;
  71. BootAttr_T BootAttr;
  72. TI_HANDLE hHwCtrl;
  73. TI_STATUS DownloadStatus;
  74. fnotify_t fCb; /* Upper module callback for the init stage */
  75. TI_HANDLE hCb; /* Upper module handle for the init stage */
  76. UINT32 uInitStage; /* Init stage */
  77. UINT32 uResetStage; /* Reset statge */
  78. UINT32 uEEPROMStage; /* EEPROM burst stage */
  79. UINT32 uInitData; /* Init state machine temporary data */
  80. UINT32 uElpCmd; /* ELP command image */
  81. UINT32 uChipId; /* Chip ID */
  82. UINT32 uBootData; /* Boot state machine temporary data */
  83. UINT32 uSelfClearTime;
  84. UINT8 uEEPROMBurstLen;
  85. UINT8 uEEPROMBurstLoop;
  86. UINT32 uEEPROMRegAddr;
  87. TI_STATUS uEEPROMStatus;
  88. UINT32 uNVSStartAddr;
  89. UINT32 uNVSNumChar;
  90. UINT32 uNVSNumByte;
  91. /* use a struct to write buffers on the bus - used for extra bytes reserving */
  92. PADDING (UINT32 uNVSTempWord)
  93. TI_STATUS uNVSStatus;
  94. UINT32 uScrPad6;
  95. UINT32 uRefFreq;
  96. UINT32 uInitSeqStage;
  97. TI_STATUS uInitSeqStatus;
  98. UINT32 uLoadStage;
  99. UINT32 uChunkNum;
  100. UINT32 uPartitionLimit;
  101. UINT32 uFinStage;
  102. UINT32 uFinData;
  103. UINT32 uFinLoop;
  104. /* Temporary buffer for FW chunk storage */
  105. #ifdef USE_NO_CHUNK_COPY
  106. UINT8 auFwTmpBuf [TNETWIF_WRITE_OFFSET_BYTES];
  107. #else
  108. UINT8 auFwTmpBuf [TNETWIF_WRITE_OFFSET_BYTES + CHUNK_SIZE];
  109. #endif
  110. /* size of the Fw image, retrieved from the image itself */
  111. UINT32 uFwDataLen;
  112. BOOL recoveryProcess;
  113. } whalBus_T;
  114. /* Debug */
  115. void shmDebug_registerDump(TI_HANDLE hWhalBus);
  116. int shmDebug_PrintRxRegs(TI_HANDLE hWhalBus);
  117. int shmDebug_PrintTxRegs(TI_HANDLE hWhalBus);
  118. int shmDebug_PrintScrPadRegs(TI_HANDLE hWhalBus);
  119. int shmDebug_PrintListRegs(TI_HANDLE hWhalBus, UINT32 RegAddr);
  120. void shmDebug_MemPrint(TI_HANDLE hWhalBus, UINT32 MemAddr);
  121. void whalBus_MemCopyFrom (TI_HANDLE hWhalBus, UINT8 *Dest, char *SrcOffset, int Len);
  122. void shmDebug_macRegisterDump(TI_HANDLE hWhalBus);
  123. void shmDebug_phyRegisterDump(TI_HANDLE hWhalBus);
  124. #endif /* _WHAL_SHM_BUS_H */