pcie_bus_priv.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright (c) 2015-2016 Quantenna Communications, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #ifndef _QTN_FMAC_PCIE_H_
  17. #define _QTN_FMAC_PCIE_H_
  18. #include <linux/dma-mapping.h>
  19. #include <linux/io.h>
  20. #include "pcie_regs_pearl.h"
  21. #include "pcie_ipc.h"
  22. #include "shm_ipc.h"
  23. struct bus;
  24. struct qtnf_pcie_bus_priv {
  25. struct pci_dev *pdev;
  26. /* lock for irq configuration changes */
  27. spinlock_t irq_lock;
  28. /* lock for tx reclaim operations */
  29. spinlock_t tx_reclaim_lock;
  30. /* lock for tx0 operations */
  31. spinlock_t tx0_lock;
  32. u8 msi_enabled;
  33. u8 tx_stopped;
  34. int mps;
  35. struct workqueue_struct *workqueue;
  36. struct tasklet_struct reclaim_tq;
  37. void __iomem *sysctl_bar;
  38. void __iomem *epmem_bar;
  39. void __iomem *dmareg_bar;
  40. struct qtnf_shm_ipc shm_ipc_ep_in;
  41. struct qtnf_shm_ipc shm_ipc_ep_out;
  42. struct qtnf_pcie_bda __iomem *bda;
  43. void __iomem *pcie_reg_base;
  44. u16 tx_bd_num;
  45. u16 rx_bd_num;
  46. struct sk_buff **tx_skb;
  47. struct sk_buff **rx_skb;
  48. struct qtnf_tx_bd *tx_bd_vbase;
  49. dma_addr_t tx_bd_pbase;
  50. struct qtnf_rx_bd *rx_bd_vbase;
  51. dma_addr_t rx_bd_pbase;
  52. dma_addr_t bd_table_paddr;
  53. void *bd_table_vaddr;
  54. u32 bd_table_len;
  55. u32 rx_bd_w_index;
  56. u32 rx_bd_r_index;
  57. u32 tx_bd_w_index;
  58. u32 tx_bd_r_index;
  59. u32 pcie_irq_mask;
  60. /* diagnostics stats */
  61. u32 pcie_irq_count;
  62. u32 pcie_irq_rx_count;
  63. u32 pcie_irq_tx_count;
  64. u32 pcie_irq_uf_count;
  65. u32 tx_full_count;
  66. u32 tx_done_count;
  67. u32 tx_reclaim_done;
  68. u32 tx_reclaim_req;
  69. };
  70. #endif /* _QTN_FMAC_PCIE_H_ */