Linux-libre 4.14.132-gnu
[librecmc/linux-libre.git] / drivers / staging / rtlwifi / halmac / halmac_88xx / halmac_api_88xx_pcie.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2016  Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * The full GNU General Public License is included in this distribution in the
15  * file called LICENSE.
16  *
17  * Contact Information:
18  * wlanfae <wlanfae@realtek.com>
19  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20  * Hsinchu 300, Taiwan.
21  *
22  * Larry Finger <Larry.Finger@lwfinger.net>
23  *
24  *****************************************************************************/
25 #ifndef _HALMAC_API_88XX_PCIE_H_
26 #define _HALMAC_API_88XX_PCIE_H_
27
28 #include "../halmac_2_platform.h"
29 #include "../halmac_type.h"
30
31 #define LINK_CTRL2_REG_OFFSET 0xA0
32 #define GEN2_CTRL_OFFSET 0x80C
33 #define LINK_STATUS_REG_OFFSET 0x82
34 #define GEN1_SPEED 0x01
35 #define GEN2_SPEED 0x02
36
37 enum halmac_ret_status
38 halmac_init_pcie_cfg_88xx(struct halmac_adapter *halmac_adapter);
39
40 enum halmac_ret_status
41 halmac_deinit_pcie_cfg_88xx(struct halmac_adapter *halmac_adapter);
42
43 enum halmac_ret_status
44 halmac_cfg_rx_aggregation_88xx_pcie(struct halmac_adapter *halmac_adapter,
45                                     struct halmac_rxagg_cfg *phalmac_rxagg_cfg);
46
47 u8 halmac_reg_read_8_pcie_88xx(struct halmac_adapter *halmac_adapter,
48                                u32 halmac_offset);
49
50 enum halmac_ret_status
51 halmac_reg_write_8_pcie_88xx(struct halmac_adapter *halmac_adapter,
52                              u32 halmac_offset, u8 halmac_data);
53
54 u16 halmac_reg_read_16_pcie_88xx(struct halmac_adapter *halmac_adapter,
55                                  u32 halmac_offset);
56
57 enum halmac_ret_status
58 halmac_reg_write_16_pcie_88xx(struct halmac_adapter *halmac_adapter,
59                               u32 halmac_offset, u16 halmac_data);
60
61 u32 halmac_reg_read_32_pcie_88xx(struct halmac_adapter *halmac_adapter,
62                                  u32 halmac_offset);
63
64 enum halmac_ret_status
65 halmac_reg_write_32_pcie_88xx(struct halmac_adapter *halmac_adapter,
66                               u32 halmac_offset, u32 halmac_data);
67
68 enum halmac_ret_status halmac_cfg_tx_agg_align_pcie_not_support_88xx(
69         struct halmac_adapter *halmac_adapter, u8 enable, u16 align_size);
70
71 #endif /* _HALMAC_API_88XX_PCIE_H_ */