Commit | Line | Data |
---|---|---|
51ba902a AK |
1 | /* |
2 | * Huawei HiNIC PCI Express Linux driver | |
3 | * Copyright(c) 2017 Huawei Technologies Co., Ltd | |
4 | * | |
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. | |
8 | * | |
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 | |
12 | * for more details. | |
13 | * | |
14 | */ | |
15 | ||
16 | #ifndef HINIC_DEV_H | |
17 | #define HINIC_DEV_H | |
18 | ||
19 | #include <linux/netdevice.h> | |
20 | #include <linux/types.h> | |
25a3ba61 | 21 | #include <linux/semaphore.h> |
c4d06d2d AK |
22 | #include <linux/workqueue.h> |
23 | #include <linux/bitops.h> | |
51ba902a AK |
24 | |
25 | #include "hinic_hw_dev.h" | |
c3e79baf AK |
26 | #include "hinic_tx.h" |
27 | #include "hinic_rx.h" | |
51ba902a AK |
28 | |
29 | #define HINIC_DRV_NAME "hinic" | |
30 | ||
c4d06d2d AK |
31 | enum hinic_flags { |
32 | HINIC_LINK_UP = BIT(0), | |
33 | HINIC_INTF_UP = BIT(1), | |
34 | }; | |
35 | ||
36 | struct hinic_rx_mode_work { | |
37 | struct work_struct work; | |
38 | u32 rx_mode; | |
39 | }; | |
40 | ||
51ba902a AK |
41 | struct hinic_dev { |
42 | struct net_device *netdev; | |
43 | struct hinic_hwdev *hwdev; | |
44 | ||
45 | u32 msg_enable; | |
00e57a6d | 46 | unsigned int tx_weight; |
e2585ea7 | 47 | unsigned int rx_weight; |
25a3ba61 | 48 | |
c4d06d2d AK |
49 | unsigned int flags; |
50 | ||
25a3ba61 AK |
51 | struct semaphore mgmt_lock; |
52 | unsigned long *vlan_bitmap; | |
c4d06d2d AK |
53 | |
54 | struct hinic_rx_mode_work rx_mode_work; | |
55 | struct workqueue_struct *workq; | |
c3e79baf AK |
56 | |
57 | struct hinic_txq *txqs; | |
58 | struct hinic_rxq *rxqs; | |
edd384f6 AK |
59 | |
60 | struct hinic_txq_stats tx_stats; | |
61 | struct hinic_rxq_stats rx_stats; | |
51ba902a AK |
62 | }; |
63 | ||
64 | #endif |