1 /******************************************************************************
3 * Copyright(c) 2016 Realtek Corporation.
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.
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
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
25 #ifndef _HALMAC_API_88XX_PCIE_H_
26 #define _HALMAC_API_88XX_PCIE_H_
28 #include "../halmac_2_platform.h"
29 #include "../halmac_type.h"
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
37 enum halmac_ret_status
38 halmac_init_pcie_cfg_88xx(struct halmac_adapter *halmac_adapter);
40 enum halmac_ret_status
41 halmac_deinit_pcie_cfg_88xx(struct halmac_adapter *halmac_adapter);
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);
47 u8 halmac_reg_read_8_pcie_88xx(struct halmac_adapter *halmac_adapter,
50 enum halmac_ret_status
51 halmac_reg_write_8_pcie_88xx(struct halmac_adapter *halmac_adapter,
52 u32 halmac_offset, u8 halmac_data);
54 u16 halmac_reg_read_16_pcie_88xx(struct halmac_adapter *halmac_adapter,
57 enum halmac_ret_status
58 halmac_reg_write_16_pcie_88xx(struct halmac_adapter *halmac_adapter,
59 u32 halmac_offset, u16 halmac_data);
61 u32 halmac_reg_read_32_pcie_88xx(struct halmac_adapter *halmac_adapter,
64 enum halmac_ret_status
65 halmac_reg_write_32_pcie_88xx(struct halmac_adapter *halmac_adapter,
66 u32 halmac_offset, u32 halmac_data);
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);
71 #endif /* _HALMAC_API_88XX_PCIE_H_ */