Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only
0002  *
0003  * Copyright (c) 2021, MediaTek Inc.
0004  * Copyright (c) 2021-2022, Intel Corporation.
0005  *
0006  * Authors:
0007  *  Haijun Liu <haijun.liu@mediatek.com>
0008  *  Moises Veleta <moises.veleta@intel.com>
0009  *
0010  * Contributors:
0011  *  Amir Hanania <amir.hanania@intel.com>
0012  *  Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
0013  *  Ricardo Martinez <ricardo.martinez@linux.intel.com>
0014  */
0015 
0016 #ifndef __T7XX_NETDEV_H__
0017 #define __T7XX_NETDEV_H__
0018 
0019 #include <linux/bits.h>
0020 #include <linux/netdevice.h>
0021 #include <linux/types.h>
0022 
0023 #include "t7xx_hif_dpmaif.h"
0024 #include "t7xx_pci.h"
0025 #include "t7xx_state_monitor.h"
0026 
0027 #define RXQ_NUM             DPMAIF_RXQ_NUM
0028 #define NIC_DEV_MAX         21
0029 #define NIC_DEV_DEFAULT         2
0030 
0031 #define CCMNI_NETDEV_WDT_TO     (1 * HZ)
0032 #define CCMNI_MTU_MAX           3000
0033 
0034 struct t7xx_ccmni {
0035     u8              index;
0036     atomic_t            usage;
0037     struct net_device       *dev;
0038     struct t7xx_ccmni_ctrl      *ctlb;
0039 };
0040 
0041 struct t7xx_ccmni_ctrl {
0042     struct t7xx_pci_dev     *t7xx_dev;
0043     struct dpmaif_ctrl      *hif_ctrl;
0044     struct t7xx_ccmni       *ccmni_inst[NIC_DEV_MAX];
0045     struct dpmaif_callbacks     callbacks;
0046     unsigned int            nic_dev_num;
0047     unsigned int            md_sta;
0048     struct t7xx_fsm_notifier    md_status_notify;
0049     bool                wwan_is_registered;
0050 };
0051 
0052 int t7xx_ccmni_init(struct t7xx_pci_dev *t7xx_dev);
0053 void t7xx_ccmni_exit(struct t7xx_pci_dev *t7xx_dev);
0054 
0055 #endif /* __T7XX_NETDEV_H__ */