1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Huawei HiNIC PCI Express Linux driver 4 * Copyright(c) 2017 Huawei Technologies Co., Ltd 5 */ 6 7 #ifndef HINIC_DEV_H 8 #define HINIC_DEV_H 9 10 #include <linux/netdevice.h> 11 #include <linux/types.h> 12 #include <linux/semaphore.h> 13 #include <linux/workqueue.h> 14 #include <linux/bitops.h> 15 16 #include "hinic_hw_dev.h" 17 #include "hinic_tx.h" 18 #include "hinic_rx.h" 19 20 #define HINIC_DRV_NAME "hinic" 21 22 enum hinic_flags { 23 HINIC_LINK_UP = BIT(0), 24 HINIC_INTF_UP = BIT(1), 25 }; 26 27 struct hinic_rx_mode_work { 28 struct work_struct work; 29 u32 rx_mode; 30 }; 31 32 struct hinic_dev { 33 struct net_device *netdev; 34 struct hinic_hwdev *hwdev; 35 36 u32 msg_enable; 37 unsigned int tx_weight; 38 unsigned int rx_weight; 39 40 unsigned int flags; 41 42 struct semaphore mgmt_lock; 43 unsigned long *vlan_bitmap; 44 45 struct hinic_rx_mode_work rx_mode_work; 46 struct workqueue_struct *workq; 47 48 struct hinic_txq *txqs; 49 struct hinic_rxq *rxqs; 50 51 struct hinic_txq_stats tx_stats; 52 struct hinic_rxq_stats rx_stats; 53 }; 54 55 #endif 56