card.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. * File: card.h
  20. *
  21. * Purpose: Provide functions to setup NIC operation mode
  22. *
  23. * Author: Tevin Chen
  24. *
  25. * Date: May 21, 1996
  26. *
  27. */
  28. #ifndef __CARD_H__
  29. #define __CARD_H__
  30. #include "ttype.h"
  31. /*--------------------- Export Definitions -------------------------*/
  32. /*--------------------- Export Classes ----------------------------*/
  33. /* init card type */
  34. typedef enum _CARD_PHY_TYPE {
  35. PHY_TYPE_AUTO = 0,
  36. PHY_TYPE_11B,
  37. PHY_TYPE_11G,
  38. PHY_TYPE_11A
  39. } CARD_PHY_TYPE, *PCARD_PHY_TYPE;
  40. typedef enum _CARD_OP_MODE {
  41. OP_MODE_INFRASTRUCTURE = 0,
  42. OP_MODE_ADHOC,
  43. OP_MODE_AP,
  44. OP_MODE_UNKNOWN
  45. } CARD_OP_MODE, *PCARD_OP_MODE;
  46. #define CB_MAX_CHANNEL_24G 14
  47. /* #define CB_MAX_CHANNEL_5G 24 */
  48. #define CB_MAX_CHANNEL_5G 42 /* add channel9(5045MHz), 41==>42 */
  49. #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
  50. /*--------------------- Export Variables --------------------------*/
  51. /*--------------------- Export Functions --------------------------*/
  52. BOOL CARDbSetMediaChannel(void *pDeviceHandler,
  53. unsigned int uConnectionChannel);
  54. void CARDvSetRSPINF(void *pDeviceHandler, BYTE byBBType);
  55. void vUpdateIFS(void *pDeviceHandler);
  56. void CARDvUpdateBasicTopRate(void *pDeviceHandler);
  57. BOOL CARDbAddBasicRate(void *pDeviceHandler, WORD wRateIdx);
  58. BOOL CARDbIsOFDMinBasicRate(void *pDeviceHandler);
  59. void CARDvAdjustTSF(void *pDeviceHandler, BYTE byRxRate,
  60. QWORD qwBSSTimestamp, QWORD qwLocalTSF);
  61. BOOL CARDbGetCurrentTSF(void *pDeviceHandler, PQWORD pqwCurrTSF);
  62. BOOL CARDbClearCurrentTSF(void *pDeviceHandler);
  63. void CARDvSetFirstNextTBTT(void *pDeviceHandler, WORD wBeaconInterval);
  64. void CARDvUpdateNextTBTT(void *pDeviceHandler, QWORD qwTSF,
  65. WORD wBeaconInterval);
  66. QWORD CARDqGetNextTBTT(QWORD qwTSF, WORD wBeaconInterval);
  67. QWORD CARDqGetTSFOffset(BYTE byRxRate, QWORD qwTSF1, QWORD qwTSF2);
  68. BOOL CARDbRadioPowerOff(void *pDeviceHandler);
  69. BOOL CARDbRadioPowerOn(void *pDeviceHandler);
  70. BYTE CARDbyGetPktType(void *pDeviceHandler);
  71. void CARDvSetBSSMode(void *pDeviceHandler);
  72. BOOL CARDbChannelSwitch(void *pDeviceHandler,
  73. BYTE byMode,
  74. BYTE byNewChannel,
  75. BYTE byCount);
  76. #endif /* __CARD_H__ */