mwifiex/mxm_wifiex/wlan_src/mlinux/moal_pcie.h

166 lines
5.6 KiB
C
Raw Normal View History

/** @file moal_pcie.h
*
* @brief This file contains definitions for PCIE interface.
* driver.
*
*
* Copyright 2008-2021 NXP
*
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
/********************************************************
Change log:
02/01/2012: initial version
********************************************************/
#ifndef _MOAL_PCIE_H_
#define _MOAL_PCIE_H_
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#define PCIE_VENDOR_ID_MRVL (0x11ab)
#define PCIE_VENDOR_ID_V2_MRVL (0x1b4b)
#define PCIE_VENDOR_ID_NXP (0x1131)
#ifdef PCIE8997
/** PCIE device ID for 8997 card */
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#define PCIE_DEVICE_ID_88W8997P (0x2b42)
#endif
#ifdef PCIE8897
/** PCIE device ID for 8897 card */
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#define PCIE_DEVICE_ID_88W8897P (0x2b38)
#endif
#ifdef PCIE9097
/** PCIE device ID for 9097 card */
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#define PCIE_DEVICE_ID_88W9097 (0x2b56)
#endif
#ifdef PCIE9098
/** PCIE device ID for 9098 card FN0 */
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#define PCIE_DEVICE_ID_88W9098P_FN0 (0x2b43)
/** PCIE device ID for 9098 card FN1 */
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#define PCIE_DEVICE_ID_88W9098P_FN1 (0x2b44)
#endif
#ifdef PCIENW62X
/** PCIE device ID for NW62X card FN0 */
#define PCIE_DEVICE_ID_88WNW62X (0x3000)
#endif
#include <linux/version.h>
#include <linux/pci.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
#include <linux/pcieport_if.h>
#endif
#include <linux/interrupt.h>
#include "moal_main.h"
/** Default firmware name */
#ifdef PCIE8997
#define PCIE8997_DEFAULT_COMBO_FW_NAME "nxp/pcieusb8997_combo_v4.bin"
#define PCIEUART8997_DEFAULT_COMBO_FW_NAME "nxp/pcieuart8997_combo_v4.bin"
#define PCIEUSB8997_DEFAULT_COMBO_FW_NAME "nxp/pcieusb8997_combo_v4.bin"
#define PCIE8997_DEFAULT_WLAN_FW_NAME "nxp/pcie8997_wlan_v4.bin"
/** PCIE8997 chip revision ID */
#define PCIE8997_A0 0x10
#define PCIE8997_A1 0x11
#endif /* PCIE8997 */
#ifdef PCIE8897
#define PCIE8897_DEFAULT_COMBO_FW_NAME "nxp/pcie8897_uapsta.bin"
#define PCIE8897_DEFAULT_WLAN_FW_NAME "nxp/pcie8897_wlan.bin"
#endif /* PCIE8897*/
#ifdef PCIE9098
#define PCIE9098_Z1Z2 0x00
#define PCIE9098_A0 0x01
#define PCIE9098_A1 0x02
#define PCIE9098_A2 0x03
#define PCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEUART9098_DEFAULT_COMBO_FW_NAME "nxp/pcieuart9098_combo.bin"
#define PCIEUSB9098_DEFAULT_COMBO_FW_NAME "nxp/pcieusb9098_combo.bin"
#define PCIEPCIE9098_DEFAULT_COMBO_FW_NAME "nxp/pciepcie9098_combo.bin"
#define PCIEUART9098_COMBO_V1_FW_NAME "nxp/pcieuart9098_combo_v1.bin"
#define PCIEUSB9098_COMBO_V1_FW_NAME "nxp/pcieusb9098_combo_v1.bin"
#define PCIEPCIE9098_COMBO_V1_FW_NAME "nxp/pciepcie9098_combo_v1.bin"
#define PCIE9098_DEFAULT_WLAN_FW_NAME "nxp/pcie9098_wlan.bin"
#define PCIE9098_WLAN_V1_FW_NAME "nxp/pcie9098_wlan_v1.bin"
#endif /* PCIE9098 */
#ifdef PCIE9097
#define PCIE9097_A0 0x00
#define PCIE9097_B0 0x01
#define PCIE9097_B1 0x02
#define PCIE9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw620_combo.bin"
#define PCIEUART9097_DEFAULT_COMBO_FW_NAME "nxp/pcieuartiw620_combo.bin"
#define PCIEUSB9097_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw620_combo.bin"
#define PCIEUART9097_COMBO_V1_FW_NAME "nxp/pcieuartiw620_combo_v1.bin"
#define PCIEUSB9097_COMBO_V1_FW_NAME "nxp/pcieusbiw620_combo_v1.bin"
#define PCIE9097_DEFAULT_WLAN_FW_NAME "nxp/pcieiw620_wlan.bin"
#define PCIE9097_WLAN_V1_FW_NAME "nxp/pcieiw620_wlan_v1.bin"
#endif /* PCIE9097 */
mxm_wifiex: update to mxm5x17322 release New Additions/Removals/Improvements: ------------------------------------ 1. WSW-18868: Improve FW download time after suspend/resume cycle 2. WSFD-484: WIFI 6E support 3. WSW-17954: Enable turbo mode command for mlanutl 4. WSW-19363: Add debug prints to WLAN driver regarding WPA_supplicant 5. WSW-19307: Support robust btc related commands [0x00e0] in mlanutl 6. WSW-16429: Disabling of WEP/TKIP on all V16 devices 7. Use CFG80211_VERSION_CODE to control cfg80211 related code 8. Enabled these new commands for mlanutl: min_ba_threshold, stop_su and ed_mac_ctrl_v3 9. WSFD-386: FW and VHAL Implementation for WOWLAN by adding code for MDNS wakeup Driver Bug Fixes: ----------------- 1. WSW-18708: Setting domain info fails for W8801 Murata M.2 Module (2DS) 2. WSW-18541: Debug logs not seen if drvdbg is part of wifi_mod_para.conf 3. WSW-19136: Command 0x107 timeout is seen radomly during connect-disconnect test 4. WSW-18865: VHT80 TCP-tx throughput only run about 170Mbps, both STA and MMH mode 5. WSW-17923: 4K Video Stoppage Issue, Wi-Fi throughput drops to lower than 20Mbps without recovery 6. WSW-17925: NO_IR flags are not cleared for ch 12,13 and 14 if country is changed to JP in runtime 7. WCSWREL-251: There is "mlan0: Failed to initialize driver interface" during stress load/unload testing 8. WSW-18431: UAP beacon (in 1x1 mode) not reporting correct values for tx_highest_rate and rx_highest_rate in VhtCap IE 9. WSW-18116: TCP Keep alive packets are not seen after starting cloud keep alive 10. WSW-18690: STAUT is advertising support of MCS-0 to 9 only in HE-IE in Probe Request 11. WCSWREL-266: Fix L5.16 build errors and warnings Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-04-19 06:46:37 +00:00
#ifdef PCIENW62X
#define PCIENW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieusbnw62x_combo.bin"
#define PCIEUARTNW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieuartnw62x_combo.bin"
#define PCIEUSBNW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieusbnw62x_combo.bin"
#define PCIENW62X_DEFAULT_WLAN_FW_NAME "nxp/pcienw62x_wlan.bin"
#endif /* PCIE8997 */
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
#define PCIE_NUM_MSIX_VECTORS 32
#else
#define PCIE_NUM_MSIX_VECTORS 4
#endif
typedef struct _msix_context {
/** pci_dev structure pointer */
struct pci_dev *dev;
/** message id related to msix vector */
t_u16 msg_id;
} msix_context;
/** Structure: PCIE service card */
typedef struct _pcie_service_card {
/** pci_dev structure pointer */
struct pci_dev *dev;
/** moal_handle structure pointer */
moal_handle *handle;
/** I/O memory regions pointer to the bus */
void __iomem *pci_mmap;
/** I/O memory regions pointer to the bus */
void __iomem *pci_mmap1;
#if defined(PCIE)
struct msix_entry msix_entries[PCIE_NUM_MSIX_VECTORS];
msix_context msix_contexts[PCIE_NUM_MSIX_VECTORS];
#endif
} pcie_service_card, *ppcie_service_card;
/** Register to bus driver function */
mlan_status woal_pcie_bus_register(void);
/** Unregister from bus driver function */
void woal_pcie_bus_unregister(void);
#endif /* _MOAL_PCIE_H_ */