Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
0004  * All rights reserved.
0005  *
0006  * Purpose: Provide functions to setup NIC operation mode
0007  *
0008  * Author: Tevin Chen
0009  *
0010  * Date: May 21, 1996
0011  *
0012  */
0013 
0014 #ifndef __CARD_H__
0015 #define __CARD_H__
0016 
0017 #include <linux/types.h>
0018 #include <linux/nl80211.h>
0019 
0020 /*
0021  * Loopback mode
0022  *
0023  * LOBYTE is MAC LB mode, HIBYTE is MII LB mode
0024  */
0025 #define CARD_LB_NONE            MAKEWORD(MAC_LB_NONE, 0)
0026 /* PHY must ISO, avoid MAC loopback packet go out */
0027 #define CARD_LB_MAC             MAKEWORD(MAC_LB_INTERNAL, 0)
0028 #define CARD_LB_PHY             MAKEWORD(MAC_LB_EXT, 0)
0029 
0030 #define DEFAULT_MSDU_LIFETIME           512  /* ms */
0031 #define DEFAULT_MSDU_LIFETIME_RES_64us  8000 /* 64us */
0032 
0033 #define DEFAULT_MGN_LIFETIME            8    /* ms */
0034 #define DEFAULT_MGN_LIFETIME_RES_64us   125  /* 64us */
0035 
0036 #define CB_MAX_CHANNEL_24G      14
0037 #define CB_MAX_CHANNEL_5G       42
0038 #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
0039 
0040 struct vnt_private;
0041 
0042 void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type);
0043 void CARDvUpdateBasicTopRate(struct vnt_private *priv);
0044 bool CARDbIsOFDMinBasicRate(struct vnt_private *priv);
0045 void CARDvSetFirstNextTBTT(struct vnt_private *priv,
0046                unsigned short wBeaconInterval);
0047 void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
0048              unsigned short wBeaconInterval);
0049 u64 vt6655_get_current_tsf(struct vnt_private *priv);
0050 u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
0051 u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
0052 unsigned char CARDbyGetPktType(struct vnt_private *priv);
0053 void CARDvSafeResetTx(struct vnt_private *priv);
0054 void CARDvSafeResetRx(struct vnt_private *priv);
0055 void CARDbRadioPowerOff(struct vnt_private *priv);
0056 bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type);
0057 bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
0058             u64 qwBSSTimestamp);
0059 bool CARDbSetBeaconPeriod(struct vnt_private *priv,
0060               unsigned short wBeaconInterval);
0061 
0062 #endif /* __CARD_H__ */