1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4  * All rights reserved.
5  *
6  * Purpose: Implement functions to access baseband
7  *
8  * Author: Jerry Chen
9  *
10  * Date: Jun. 5, 2002
11  *
12  */
13 
14 #ifndef __BASEBAND_H__
15 #define __BASEBAND_H__
16 
17 #include "device.h"
18 
19 /*
20  * Registers in the BASEBAND
21  */
22 #define BB_MAX_CONTEXT_SIZE 256
23 
24 /*
25  * Baseband RF pair definition in eeprom (Bits 6..0)
26  */
27 
28 #define PREAMBLE_LONG   0
29 #define PREAMBLE_SHORT  1
30 
31 #define F5G             0
32 #define F2_4G           1
33 
34 #define TOP_RATE_54M        0x80000000
35 #define TOP_RATE_48M        0x40000000
36 #define TOP_RATE_36M        0x20000000
37 #define TOP_RATE_24M        0x10000000
38 #define TOP_RATE_18M        0x08000000
39 #define TOP_RATE_12M        0x04000000
40 #define TOP_RATE_11M        0x02000000
41 #define TOP_RATE_9M         0x01000000
42 #define TOP_RATE_6M         0x00800000
43 #define TOP_RATE_55M        0x00400000
44 #define TOP_RATE_2M         0x00200000
45 #define TOP_RATE_1M         0x00100000
46 
47 unsigned int bb_get_frame_time(unsigned char preamble_type,
48 			       unsigned char by_pkt_type,
49 			       unsigned int cb_frame_length,
50 			       unsigned short w_rate);
51 
52 void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
53 		       u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);
54 
55 bool bb_read_embedded(struct vnt_private *priv, unsigned char by_bb_addr,
56 		      unsigned char *pby_data);
57 bool bb_write_embedded(struct vnt_private *priv, unsigned char by_bb_addr,
58 		       unsigned char by_data);
59 
60 void bb_set_short_slot_time(struct vnt_private *priv);
61 void bb_set_vga_gain_offset(struct vnt_private *priv, unsigned char by_data);
62 
63 /* VT3253 Baseband */
64 bool bb_vt3253_init(struct vnt_private *priv);
65 void bb_software_reset(struct vnt_private *priv);
66 void bb_set_tx_antenna_mode(struct vnt_private *priv,
67 			    unsigned char by_antenna_mode);
68 void bb_set_rx_antenna_mode(struct vnt_private *priv,
69 			    unsigned char by_antenna_mode);
70 void bb_set_deep_sleep(struct vnt_private *priv, unsigned char by_local_id);
71 
72 #endif /* __BASEBAND_H__ */
73