blob: 568a2ddd6588ea331acc5f50a0e9a2bb7d77b917 [file] [log] [blame]
Madhumitha Prabakaranba451342019-02-27 15:39:12 -06001/* SPDX-License-Identifier: GPL-2.0+ */
Forest Bond5449c682009-04-25 10:30:44 -04002/*
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4 * All rights reserved.
5 *
Forest Bond5449c682009-04-25 10:30:44 -04006 * 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
Forest Bond5449c682009-04-25 10:30:44 -040016#ifndef __CARD_H__
17#define __CARD_H__
18
Charles Clément7b6a0012010-08-01 17:15:50 +020019#include <linux/types.h>
Malcolm Priestleya9873672014-08-30 22:25:49 +010020#include <linux/nl80211.h>
Forest Bond5449c682009-04-25 10:30:44 -040021
Nicky Chorley79bffc52014-10-26 06:30:29 +000022/*
23 * Loopback mode
24 *
25 * LOBYTE is MAC LB mode, HIBYTE is MII LB mode
26 */
Forest Bond5449c682009-04-25 10:30:44 -040027#define CARD_LB_NONE MAKEWORD(MAC_LB_NONE, 0)
Kathryn Hampton5150d012016-03-15 18:16:24 -070028/* PHY must ISO, avoid MAC loopback packet go out */
29#define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0)
Forest Bond5449c682009-04-25 10:30:44 -040030#define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0)
31
Nicky Chorley79bffc52014-10-26 06:30:29 +000032#define DEFAULT_MSDU_LIFETIME 512 /* ms */
33#define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
Forest Bond5449c682009-04-25 10:30:44 -040034
Nicky Chorley79bffc52014-10-26 06:30:29 +000035#define DEFAULT_MGN_LIFETIME 8 /* ms */
36#define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
Forest Bond5449c682009-04-25 10:30:44 -040037
38#define CB_MAX_CHANNEL_24G 14
Igor Bezukh7745bd62014-07-25 18:34:23 +030039#define CB_MAX_CHANNEL_5G 42
Varsha Raobee80f22016-10-14 00:17:22 +053040#define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
Forest Bond5449c682009-04-25 10:30:44 -040041
Malcolm Priestleyd0522702014-08-10 15:46:57 +010042struct vnt_private;
43
Sucha Supittayapornponge0f6aae2017-05-12 10:55:58 -070044void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type);
Derek Robson24c8bd82017-06-25 13:38:17 +120045void CARDvUpdateBasicTopRate(struct vnt_private *priv);
46bool CARDbIsOFDMinBasicRate(struct vnt_private *priv);
Derek Robson24c8bd82017-06-25 13:38:17 +120047void CARDvSetFirstNextTBTT(struct vnt_private *priv,
Kathryn Hampton5150d012016-03-15 18:16:24 -070048 unsigned short wBeaconInterval);
Derek Robson24c8bd82017-06-25 13:38:17 +120049void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
Kathryn Hampton5150d012016-03-15 18:16:24 -070050 unsigned short wBeaconInterval);
Derek Robson24c8bd82017-06-25 13:38:17 +120051bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF);
Malcolm Priestley0fc2a762014-08-10 12:21:58 +010052u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
53u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
Derek Robson24c8bd82017-06-25 13:38:17 +120054unsigned char CARDbyGetPktType(struct vnt_private *priv);
55void CARDvSafeResetTx(struct vnt_private *priv);
56void CARDvSafeResetRx(struct vnt_private *priv);
Nishka Dasguptad7255ba2019-05-31 23:02:26 +053057void CARDbRadioPowerOff(struct vnt_private *priv);
Derek Robson24c8bd82017-06-25 13:38:17 +120058bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type);
59bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
Malcolm Priestley032ed342015-04-21 22:33:01 +010060 u64 qwBSSTimestamp);
Branden Bonaby256ab3e2019-03-11 09:31:57 -040061bool CARDbSetBeaconPeriod(struct vnt_private *priv,
Payal Kshirsagara632b9f2020-03-09 22:39:27 +053062 unsigned short wBeaconInterval);
Forest Bond5449c682009-04-25 10:30:44 -040063
Nicky Chorley79bffc52014-10-26 06:30:29 +000064#endif /* __CARD_H__ */