card.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  4. * All rights reserved.
  5. *
  6. * File: card.h
  7. *
  8. * Purpose: Provide functions to setup NIC operation mode
  9. *
  10. * Author: Tevin Chen
  11. *
  12. * Date: May 21, 1996
  13. *
  14. */
  15. #ifndef __CARD_H__
  16. #define __CARD_H__
  17. #include <linux/types.h>
  18. #include <linux/nl80211.h>
  19. /*
  20. * Loopback mode
  21. *
  22. * LOBYTE is MAC LB mode, HIBYTE is MII LB mode
  23. */
  24. #define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
  25. /* PHY must ISO, avoid MAC loopback packet go out */
  26. #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0)
  27. #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
  28. #define DEFAULT_MSDU_LIFETIME 512 /* ms */
  29. #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
  30. #define DEFAULT_MGN_LIFETIME 8 /* ms */
  31. #define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
  32. #define CB_MAX_CHANNEL_24G 14
  33. #define CB_MAX_CHANNEL_5G 42
  34. #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
  35. struct vnt_private;
  36. void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type);
  37. void CARDvUpdateBasicTopRate(struct vnt_private *priv);
  38. bool CARDbIsOFDMinBasicRate(struct vnt_private *priv);
  39. void CARDvSetLoopbackMode(struct vnt_private *priv, unsigned short wLoopbackMode);
  40. bool CARDbSoftwareReset(struct vnt_private *priv);
  41. void CARDvSetFirstNextTBTT(struct vnt_private *priv,
  42. unsigned short wBeaconInterval);
  43. void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
  44. unsigned short wBeaconInterval);
  45. bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF);
  46. u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
  47. u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
  48. unsigned char CARDbyGetPktType(struct vnt_private *priv);
  49. void CARDvSafeResetTx(struct vnt_private *priv);
  50. void CARDvSafeResetRx(struct vnt_private *priv);
  51. bool CARDbRadioPowerOff(struct vnt_private *priv);
  52. bool CARDbRadioPowerOn(struct vnt_private *priv);
  53. bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type);
  54. bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
  55. u64 qwBSSTimestamp);
  56. bool CARDbSetBeaconPeriod(struct vnt_private *priv, unsigned short wBeaconInterval);
  57. #endif /* __CARD_H__ */