card.h 3.1 KB

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