2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
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.
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.
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.
21 * Purpose: Provide functions to setup NIC operation mode
33 #include <linux/types.h>
34 #include <linux/nl80211.h>
39 * LOBYTE is MAC LB mode, HIBYTE is MII LB mode
41 #define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
42 #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0) /* PHY must ISO, avoid MAC loopback packet go out */
43 #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
45 #define DEFAULT_MSDU_LIFETIME 512 /* ms */
46 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
48 #define DEFAULT_MGN_LIFETIME 8 /* ms */
49 #define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
51 #define CB_MAX_CHANNEL_24G 14
52 #define CB_MAX_CHANNEL_5G 42
53 #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
55 typedef enum _CARD_PHY_TYPE {
60 } CARD_PHY_TYPE, *PCARD_PHY_TYPE;
62 typedef enum _CARD_PKT_TYPE {
67 } CARD_PKT_TYPE, *PCARD_PKT_TYPE;
69 typedef enum _CARD_STATUS_TYPE {
70 CARD_STATUS_MEDIA_CONNECT,
71 CARD_STATUS_MEDIA_DISCONNECT,
73 } CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
77 void CARDvSetRSPINF(struct vnt_private *, CARD_PHY_TYPE ePHYType);
78 void vUpdateIFS(struct vnt_private *);
79 void CARDvUpdateBasicTopRate(struct vnt_private *);
80 bool CARDbAddBasicRate(struct vnt_private *, unsigned short wRateIdx);
81 bool CARDbIsOFDMinBasicRate(struct vnt_private *);
82 void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short wLoopbackMode);
83 bool CARDbSoftwareReset(struct vnt_private *);
84 void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short wBeaconInterval);
85 void CARDvUpdateNextTBTT(void __iomem *dwIoBase, u64 qwTSF, unsigned short wBeaconInterval);
86 bool CARDbGetCurrentTSF(void __iomem *dwIoBase, u64 *pqwCurrTSF);
87 u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
88 u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
89 unsigned char CARDbyGetPktType(struct vnt_private *);
90 void CARDvSafeResetTx(struct vnt_private *);
91 void CARDvSafeResetRx(struct vnt_private *);
92 bool CARDbRadioPowerOff(struct vnt_private *);
93 bool CARDbRadioPowerOn(struct vnt_private *);
94 bool CARDbSetPhyParameter(struct vnt_private *, CARD_PHY_TYPE ePHYType,
95 unsigned short wCapInfo, unsigned char byERPField,
96 void *pvSupportRateIEs, void *pvExtSupportRateIEs);
97 bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate,
98 u64 qwBSSTimestamp, u64 qwLocalTSF);
99 bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval);
101 #endif /* __CARD_H__ */