1 /* SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2021, MediaTek Inc.
4 * Copyright (c) 2021-2022, Intel Corporation.
16 #ifndef __T7XX_NETDEV_H__
17 #define __T7XX_NETDEV_H__
19 #include <linux/bits.h>
20 #include <linux/netdevice.h>
21 #include <linux/types.h>
23 #include "t7xx_hif_dpmaif.h"
25 #include "t7xx_state_monitor.h"
27 #define RXQ_NUM DPMAIF_RXQ_NUM
28 #define NIC_DEV_MAX 21
29 #define NIC_DEV_DEFAULT 2
31 #define CCMNI_NETDEV_WDT_TO (1 * HZ)
32 #define CCMNI_MTU_MAX 3000
33 #define NIC_NAPI_POLL_BUDGET 128
38 struct net_device *dev;
39 struct t7xx_ccmni_ctrl *ctlb;
42 struct t7xx_ccmni_ctrl {
43 struct t7xx_pci_dev *t7xx_dev;
44 struct dpmaif_ctrl *hif_ctrl;
45 struct t7xx_ccmni *ccmni_inst[NIC_DEV_MAX];
46 struct dpmaif_callbacks callbacks;
47 unsigned int nic_dev_num;
49 struct t7xx_fsm_notifier md_status_notify;
50 bool wwan_is_registered;
51 struct net_device dummy_dev;
52 struct napi_struct *napi[RXQ_NUM];
53 atomic_t napi_usr_refcnt;
57 int t7xx_ccmni_init(struct t7xx_pci_dev *t7xx_dev);
58 void t7xx_ccmni_exit(struct t7xx_pci_dev *t7xx_dev);
60 #endif /* __T7XX_NETDEV_H__ */