qtnfmac_pcie: separate platform-independent PCIe structure

Move platform-independent PCIe data structure to a separate header file
so it can be reused by different devices.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
此提交包含在:
Igor Mitsyanko
2018-09-24 15:15:09 -07:00
提交者 Kalle Valo
父節點 21077d09b4
當前提交 c9ff6c9157
共有 3 個檔案被更改,包括 286 行新增260 行删除

查看文件

@@ -0,0 +1,70 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/* Copyright (c) 2018 Quantenna Communications, Inc. All rights reserved. */
#ifndef _QTN_FMAC_PCIE_H_
#define _QTN_FMAC_PCIE_H_
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include "shm_ipc.h"
#define SKB_BUF_SIZE 2048
#define QTN_FW_DL_TIMEOUT_MS 3000
#define QTN_FW_QLINK_TIMEOUT_MS 30000
#define QTN_EP_RESET_WAIT_MS 1000
struct qtnf_pcie_bus_priv {
struct pci_dev *pdev;
spinlock_t tx_reclaim_lock;
spinlock_t tx_lock;
int mps;
struct workqueue_struct *workqueue;
struct tasklet_struct reclaim_tq;
void __iomem *sysctl_bar;
void __iomem *epmem_bar;
void __iomem *dmareg_bar;
struct qtnf_shm_ipc shm_ipc_ep_in;
struct qtnf_shm_ipc shm_ipc_ep_out;
u16 tx_bd_num;
u16 rx_bd_num;
struct sk_buff **tx_skb;
struct sk_buff **rx_skb;
u32 rx_bd_w_index;
u32 rx_bd_r_index;
u32 tx_bd_w_index;
u32 tx_bd_r_index;
/* diagnostics stats */
u32 pcie_irq_count;
u32 tx_full_count;
u32 tx_done_count;
u32 tx_reclaim_done;
u32 tx_reclaim_req;
u8 msi_enabled;
u8 tx_stopped;
};
static inline void qtnf_non_posted_write(u32 val, void __iomem *basereg)
{
writel(val, basereg);
/* flush posted write */
readl(basereg);
}
#endif /* _QTN_FMAC_PCIE_H_ */

檔案差異因為檔案過大而無法顯示 載入差異

查看文件

@@ -43,11 +43,6 @@
#define QTN_RC_FW_LOADRDY BIT(8)
#define QTN_RC_FW_SYNC BIT(9)
/* state transition timeouts */
#define QTN_FW_DL_TIMEOUT_MS 3000
#define QTN_FW_QLINK_TIMEOUT_MS 30000
#define QTN_EP_RESET_WAIT_MS 1000
#define PCIE_HDP_INT_RX_BITS (0 \
| PCIE_HDP_INT_EP_TXDMA \
| PCIE_HDP_INT_EP_TXEMPTY \
@@ -77,8 +72,6 @@
#define PCIE_BDA_NAMELEN 32
#define PCIE_HHBM_MAX_SIZE 2048
#define SKB_BUF_SIZE 2048
#define QTN_PCIE_BOARDFLG "PCIEQTN"
#define QTN_PCIE_FW_DLMASK 0xF
#define QTN_PCIE_FW_BUFSZ 2048