hinic_tx.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_TX_H
  16. #define HINIC_TX_H
  17. #include <linux/types.h>
  18. #include <linux/netdevice.h>
  19. #include <linux/skbuff.h>
  20. #include <linux/u64_stats_sync.h>
  21. #include "hinic_common.h"
  22. #include "hinic_hw_qp.h"
  23. struct hinic_txq_stats {
  24. u64 pkts;
  25. u64 bytes;
  26. u64 tx_busy;
  27. u64 tx_wake;
  28. u64 tx_dropped;
  29. struct u64_stats_sync syncp;
  30. };
  31. struct hinic_txq {
  32. struct net_device *netdev;
  33. struct hinic_sq *sq;
  34. struct hinic_txq_stats txq_stats;
  35. int max_sges;
  36. struct hinic_sge *sges;
  37. struct hinic_sge *free_sges;
  38. char *irq_name;
  39. struct napi_struct napi;
  40. };
  41. void hinic_txq_clean_stats(struct hinic_txq *txq);
  42. void hinic_txq_get_stats(struct hinic_txq *txq, struct hinic_txq_stats *stats);
  43. netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
  44. int hinic_init_txq(struct hinic_txq *txq, struct hinic_sq *sq,
  45. struct net_device *netdev);
  46. void hinic_clean_txq(struct hinic_txq *txq);
  47. #endif