hinic_dev.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #ifndef HINIC_DEV_H
  16. #define HINIC_DEV_H
  17. #include <linux/netdevice.h>
  18. #include <linux/types.h>
  19. #include <linux/semaphore.h>
  20. #include <linux/workqueue.h>
  21. #include <linux/bitops.h>
  22. #include "hinic_hw_dev.h"
  23. #include "hinic_tx.h"
  24. #include "hinic_rx.h"
  25. #define HINIC_DRV_NAME "hinic"
  26. enum hinic_flags {
  27. HINIC_LINK_UP = BIT(0),
  28. HINIC_INTF_UP = BIT(1),
  29. };
  30. struct hinic_rx_mode_work {
  31. struct work_struct work;
  32. u32 rx_mode;
  33. };
  34. struct hinic_dev {
  35. struct net_device *netdev;
  36. struct hinic_hwdev *hwdev;
  37. u32 msg_enable;
  38. unsigned int tx_weight;
  39. unsigned int rx_weight;
  40. unsigned int flags;
  41. struct semaphore mgmt_lock;
  42. unsigned long *vlan_bitmap;
  43. struct hinic_rx_mode_work rx_mode_work;
  44. struct workqueue_struct *workq;
  45. struct hinic_txq *txqs;
  46. struct hinic_rxq *rxqs;
  47. struct hinic_txq_stats tx_stats;
  48. struct hinic_rxq_stats rx_stats;
  49. };
  50. #endif