card.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 <linux/types.h>
  31. #include <linux/nl80211.h>
  32. /*
  33. * Loopback mode
  34. *
  35. * LOBYTE is MAC LB mode, HIBYTE is MII LB mode
  36. */
  37. #define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
  38. /* PHY must ISO, avoid MAC loopback packet go out */
  39. #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0)
  40. #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
  41. #define DEFAULT_MSDU_LIFETIME 512 /* ms */
  42. #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
  43. #define DEFAULT_MGN_LIFETIME 8 /* ms */
  44. #define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
  45. #define CB_MAX_CHANNEL_24G 14
  46. #define CB_MAX_CHANNEL_5G 42
  47. #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
  48. typedef enum _CARD_PKT_TYPE {
  49. PKT_TYPE_802_11_BCN,
  50. PKT_TYPE_802_11_MNG,
  51. PKT_TYPE_802_11_DATA,
  52. PKT_TYPE_802_11_ALL
  53. } CARD_PKT_TYPE, *PCARD_PKT_TYPE;
  54. typedef enum _CARD_STATUS_TYPE {
  55. CARD_STATUS_MEDIA_CONNECT,
  56. CARD_STATUS_MEDIA_DISCONNECT,
  57. CARD_STATUS_PMKID
  58. } CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
  59. struct vnt_private;
  60. void CARDvSetRSPINF(struct vnt_private *, u8);
  61. void CARDvUpdateBasicTopRate(struct vnt_private *);
  62. bool CARDbIsOFDMinBasicRate(struct vnt_private *);
  63. void CARDvSetLoopbackMode(struct vnt_private *, unsigned short wLoopbackMode);
  64. bool CARDbSoftwareReset(struct vnt_private *);
  65. void CARDvSetFirstNextTBTT(struct vnt_private *,
  66. unsigned short wBeaconInterval);
  67. void CARDvUpdateNextTBTT(struct vnt_private *, u64 qwTSF,
  68. unsigned short wBeaconInterval);
  69. bool CARDbGetCurrentTSF(struct vnt_private *, u64 *pqwCurrTSF);
  70. u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
  71. u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
  72. unsigned char CARDbyGetPktType(struct vnt_private *);
  73. void CARDvSafeResetTx(struct vnt_private *);
  74. void CARDvSafeResetRx(struct vnt_private *);
  75. bool CARDbRadioPowerOff(struct vnt_private *);
  76. bool CARDbRadioPowerOn(struct vnt_private *);
  77. bool CARDbSetPhyParameter(struct vnt_private *, u8);
  78. bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate,
  79. u64 qwBSSTimestamp);
  80. bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval);
  81. #endif /* __CARD_H__ */