/drivers/staging/vt6655/baseband.h

https://github.com/psyke83/kernel_samsung_europa · C Header · 177 lines · 76 code · 31 blank · 70 comment · 0 complexity · 452d11cb7592f5f8edc71b5b7a6e0310 MD5 · raw file

  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. *
  20. * File: baseband.h
  21. *
  22. * Purpose: Implement functions to access baseband
  23. *
  24. * Author: Jerry Chen
  25. *
  26. * Date: Jun. 5, 2002
  27. *
  28. */
  29. #ifndef __BASEBAND_H__
  30. #define __BASEBAND_H__
  31. #include "ttype.h"
  32. #include "tether.h"
  33. #include "device.h"
  34. /*--------------------- Export Definitions -------------------------*/
  35. //
  36. // Registers in the BASEBAND
  37. //
  38. #define BB_MAX_CONTEXT_SIZE 256
  39. //
  40. // Baseband RF pair definition in eeprom (Bits 6..0)
  41. //
  42. /*
  43. #define RATE_1M 0
  44. #define RATE_2M 1
  45. #define RATE_5M 2
  46. #define RATE_11M 3
  47. #define RATE_6M 4
  48. #define RATE_9M 5
  49. #define RATE_12M 6
  50. #define RATE_18M 7
  51. #define RATE_24M 8
  52. #define RATE_36M 9
  53. #define RATE_48M 10
  54. #define RATE_54M 11
  55. #define RATE_AUTO 12
  56. #define MAX_RATE 12
  57. //0:11A 1:11B 2:11G
  58. #define BB_TYPE_11A 0
  59. #define BB_TYPE_11B 1
  60. #define BB_TYPE_11G 2
  61. //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
  62. #define PK_TYPE_11A 0
  63. #define PK_TYPE_11B 1
  64. #define PK_TYPE_11GB 2
  65. #define PK_TYPE_11GA 3
  66. */
  67. #define PREAMBLE_LONG 0
  68. #define PREAMBLE_SHORT 1
  69. #define F5G 0
  70. #define F2_4G 1
  71. #define TOP_RATE_54M 0x80000000
  72. #define TOP_RATE_48M 0x40000000
  73. #define TOP_RATE_36M 0x20000000
  74. #define TOP_RATE_24M 0x10000000
  75. #define TOP_RATE_18M 0x08000000
  76. #define TOP_RATE_12M 0x04000000
  77. #define TOP_RATE_11M 0x02000000
  78. #define TOP_RATE_9M 0x01000000
  79. #define TOP_RATE_6M 0x00800000
  80. #define TOP_RATE_55M 0x00400000
  81. #define TOP_RATE_2M 0x00200000
  82. #define TOP_RATE_1M 0x00100000
  83. /*--------------------- Export Types ------------------------------*/
  84. /*--------------------- Export Macros ------------------------------*/
  85. #define BBvClearFOE(dwIoBase) \
  86. { \
  87. BBbWriteEmbeded(dwIoBase, 0xB1, 0); \
  88. }
  89. #define BBvSetFOE(dwIoBase) \
  90. { \
  91. BBbWriteEmbeded(dwIoBase, 0xB1, 0x0C); \
  92. }
  93. /*--------------------- Export Classes ----------------------------*/
  94. /*--------------------- Export Variables --------------------------*/
  95. /*--------------------- Export Functions --------------------------*/
  96. UINT
  97. BBuGetFrameTime(
  98. IN BYTE byPreambleType,
  99. IN BYTE byPktType,
  100. IN UINT cbFrameLength,
  101. IN WORD wRate
  102. );
  103. VOID
  104. BBvCaculateParameter (
  105. IN PSDevice pDevice,
  106. IN UINT cbFrameLength,
  107. IN WORD wRate,
  108. IN BYTE byPacketType,
  109. OUT PWORD pwPhyLen,
  110. OUT PBYTE pbyPhySrv,
  111. OUT PBYTE pbyPhySgn
  112. );
  113. BOOL BBbReadEmbeded(DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData);
  114. BOOL BBbWriteEmbeded(DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData);
  115. VOID BBvReadAllRegs(DWORD_PTR dwIoBase, PBYTE pbyBBRegs);
  116. void BBvLoopbackOn(PSDevice pDevice);
  117. void BBvLoopbackOff(PSDevice pDevice);
  118. void BBvSetShortSlotTime(PSDevice pDevice);
  119. BOOL BBbIsRegBitsOn(DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits);
  120. BOOL BBbIsRegBitsOff(DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits);
  121. VOID BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData);
  122. // VT3253 Baseband
  123. BOOL BBbVT3253Init(PSDevice pDevice);
  124. VOID BBvSoftwareReset(DWORD_PTR dwIoBase);
  125. VOID BBvPowerSaveModeON(DWORD_PTR dwIoBase);
  126. VOID BBvPowerSaveModeOFF(DWORD_PTR dwIoBase);
  127. VOID BBvSetTxAntennaMode(DWORD_PTR dwIoBase, BYTE byAntennaMode);
  128. VOID BBvSetRxAntennaMode(DWORD_PTR dwIoBase, BYTE byAntennaMode);
  129. VOID BBvSetDeepSleep(DWORD_PTR dwIoBase, BYTE byLocalID);
  130. VOID BBvExitDeepSleep(DWORD_PTR dwIoBase, BYTE byLocalID);
  131. // timer for antenna diversity
  132. VOID
  133. TimerSQ3CallBack (
  134. IN HANDLE hDeviceContext
  135. );
  136. VOID
  137. TimerState1CallBack(
  138. IN HANDLE hDeviceContext
  139. );
  140. void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3);
  141. VOID
  142. BBvClearAntDivSQ3Value (PSDevice pDevice);
  143. #endif // __BASEBAND_H__