hinic_rx.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_RX_H
  16. #define HINIC_RX_H
  17. #include <linux/types.h>
  18. #include <linux/netdevice.h>
  19. #include <linux/u64_stats_sync.h>
  20. #include <linux/interrupt.h>
  21. #include "hinic_hw_qp.h"
  22. struct hinic_rxq_stats {
  23. u64 pkts;
  24. u64 bytes;
  25. struct u64_stats_sync syncp;
  26. };
  27. struct hinic_rxq {
  28. struct net_device *netdev;
  29. struct hinic_rq *rq;
  30. struct hinic_rxq_stats rxq_stats;
  31. char *irq_name;
  32. struct tasklet_struct rx_task;
  33. struct napi_struct napi;
  34. };
  35. void hinic_rxq_clean_stats(struct hinic_rxq *rxq);
  36. void hinic_rxq_get_stats(struct hinic_rxq *rxq, struct hinic_rxq_stats *stats);
  37. int hinic_init_rxq(struct hinic_rxq *rxq, struct hinic_rq *rq,
  38. struct net_device *netdev);
  39. void hinic_clean_rxq(struct hinic_rxq *rxq);
  40. #endif