blob: 2dfc4195227188bf48f1473cc821051739f135da [file] [log] [blame]
Forest Bond5449c682009-04-25 10:30:44 -04001/*
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
Forest Bond5449c682009-04-25 10:30:44 -040029#ifndef __CARD_H__
30#define __CARD_H__
31
Charles Clément7b6a0012010-08-01 17:15:50 +020032#include <linux/types.h>
Malcolm Priestleya9873672014-08-30 22:25:49 +010033#include <linux/nl80211.h>
Forest Bond5449c682009-04-25 10:30:44 -040034
Nicky Chorley79bffc52014-10-26 06:30:29 +000035/*
36 * Loopback mode
37 *
38 * LOBYTE is MAC LB mode, HIBYTE is MII LB mode
39 */
Forest Bond5449c682009-04-25 10:30:44 -040040#define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
Nicky Chorley79bffc52014-10-26 06:30:29 +000041#define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0) /* PHY must ISO, avoid MAC loopback packet go out */
Forest Bond5449c682009-04-25 10:30:44 -040042#define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
43
Nicky Chorley79bffc52014-10-26 06:30:29 +000044#define DEFAULT_MSDU_LIFETIME 512 /* ms */
45#define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
Forest Bond5449c682009-04-25 10:30:44 -040046
Nicky Chorley79bffc52014-10-26 06:30:29 +000047#define DEFAULT_MGN_LIFETIME 8 /* ms */
48#define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
Forest Bond5449c682009-04-25 10:30:44 -040049
50#define CB_MAX_CHANNEL_24G 14
Igor Bezukh7745bd62014-07-25 18:34:23 +030051#define CB_MAX_CHANNEL_5G 42
Forest Bond5449c682009-04-25 10:30:44 -040052#define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
53
Forest Bond5449c682009-04-25 10:30:44 -040054typedef enum _CARD_PKT_TYPE {
Joe Perchesd4945f02013-03-18 10:44:40 -070055 PKT_TYPE_802_11_BCN,
56 PKT_TYPE_802_11_MNG,
57 PKT_TYPE_802_11_DATA,
58 PKT_TYPE_802_11_ALL
Forest Bond5449c682009-04-25 10:30:44 -040059} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
60
61typedef enum _CARD_STATUS_TYPE {
Joe Perchesd4945f02013-03-18 10:44:40 -070062 CARD_STATUS_MEDIA_CONNECT,
63 CARD_STATUS_MEDIA_DISCONNECT,
64 CARD_STATUS_PMKID
Forest Bond5449c682009-04-25 10:30:44 -040065} CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
66
Malcolm Priestleyd0522702014-08-10 15:46:57 +010067struct vnt_private;
68
Malcolm Priestley6e1d14a2014-11-07 19:06:03 +000069void CARDvSetRSPINF(struct vnt_private *, u8);
Malcolm Priestleyd0522702014-08-10 15:46:57 +010070void CARDvUpdateBasicTopRate(struct vnt_private *);
Malcolm Priestleyd0522702014-08-10 15:46:57 +010071bool CARDbIsOFDMinBasicRate(struct vnt_private *);
Malcolm Priestley738487f2014-11-12 21:11:09 +000072void CARDvSetLoopbackMode(struct vnt_private *, unsigned short wLoopbackMode);
Malcolm Priestleyd0522702014-08-10 15:46:57 +010073bool CARDbSoftwareReset(struct vnt_private *);
Malcolm Priestley738487f2014-11-12 21:11:09 +000074void CARDvSetFirstNextTBTT(struct vnt_private *, unsigned short wBeaconInterval);
75void CARDvUpdateNextTBTT(struct vnt_private *, u64 qwTSF, unsigned short wBeaconInterval);
76bool CARDbGetCurrentTSF(struct vnt_private *, u64 *pqwCurrTSF);
Malcolm Priestley0fc2a762014-08-10 12:21:58 +010077u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
78u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
Malcolm Priestleyd0522702014-08-10 15:46:57 +010079unsigned char CARDbyGetPktType(struct vnt_private *);
80void CARDvSafeResetTx(struct vnt_private *);
81void CARDvSafeResetRx(struct vnt_private *);
82bool CARDbRadioPowerOff(struct vnt_private *);
83bool CARDbRadioPowerOn(struct vnt_private *);
Malcolm Priestleybfb6c862014-11-07 19:06:06 +000084bool CARDbSetPhyParameter(struct vnt_private *, u8);
Malcolm Priestleyd0522702014-08-10 15:46:57 +010085bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate,
86 u64 qwBSSTimestamp, u64 qwLocalTSF);
Malcolm Priestleyd0522702014-08-10 15:46:57 +010087bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval);
Forest Bond5449c682009-04-25 10:30:44 -040088
Nicky Chorley79bffc52014-10-26 06:30:29 +000089#endif /* __CARD_H__ */