2 * Huawei HiNIC PCI Express Linux driver
3 * Copyright(c) 2017 Huawei Technologies Co., Ltd
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 #include <linux/netdevice.h>
20 #include <linux/types.h>
21 #include <linux/semaphore.h>
22 #include <linux/workqueue.h>
23 #include <linux/bitops.h>
25 #include "hinic_hw_dev.h"
29 #define HINIC_DRV_NAME "hinic"
32 HINIC_LINK_UP = BIT(0),
33 HINIC_INTF_UP = BIT(1),
36 struct hinic_rx_mode_work {
37 struct work_struct work;
42 struct net_device *netdev;
43 struct hinic_hwdev *hwdev;
46 unsigned int tx_weight;
47 unsigned int rx_weight;
51 struct semaphore mgmt_lock;
52 unsigned long *vlan_bitmap;
54 struct hinic_rx_mode_work rx_mode_work;
55 struct workqueue_struct *workq;
57 struct hinic_txq *txqs;
58 struct hinic_rxq *rxqs;
60 struct hinic_txq_stats tx_stats;
61 struct hinic_rxq_stats rx_stats;