You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

efx_hunt.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**************************************************************************
  2. *
  3. * GPL net driver for Solarflare network cards
  4. *
  5. * Written by Shradha Shah <sshah@solarflare.com>
  6. *
  7. * Copyright 2012-2017 Solarflare Communications Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of the
  12. * License, or any later version.
  13. *
  14. * You can also choose to distribute this program under the terms of
  15. * the Unmodified Binary Distribution Licence (as given in the file
  16. * COPYING.UBDL), provided that you have satisfied its requirements.
  17. *
  18. ***************************************************************************/
  19. #ifndef EFX_HUNT_H
  20. #define EFX_HUNT_H
  21. #include "efx_common.h"
  22. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  23. /**************************************************************************
  24. *
  25. * Hardware data structures and sizing
  26. *
  27. ***************************************************************************/
  28. #define EFX_EV_SIZE(_nevs) ((_nevs) * sizeof(efx_qword_t))
  29. #define EFX_EVQ_NBUFS(_nevs) (EFX_EV_SIZE(_nevs) / EFX_BUF_ALIGN)
  30. #define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof(efx_qword_t))
  31. #define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
  32. #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof(efx_qword_t))
  33. #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_ALIGN)
  34. /** MCDI request structure */
  35. struct efx_mcdi_req_s {
  36. unsigned int emr_cmd;
  37. efx_dword_t *emr_in_buf;
  38. size_t emr_in_length;
  39. int emr_rc;
  40. efx_dword_t *emr_out_buf;
  41. size_t emr_out_length;
  42. size_t emr_out_length_used;
  43. };
  44. /*******************************************************************************
  45. *
  46. *
  47. * Hardware API
  48. *
  49. *
  50. ******************************************************************************/
  51. extern void efx_hunt_free_special_buffer(void *buf, int bytes);
  52. /* Data path entry points */
  53. extern int efx_hunt_transmit(struct net_device *netdev, struct io_buffer *iob);
  54. extern void efx_hunt_poll(struct net_device *netdev);
  55. extern void efx_hunt_irq(struct net_device *netdev, int enable);
  56. /* Initialisation */
  57. extern int efx_hunt_ev_init(struct net_device *netdev, dma_addr_t *dma_addr);
  58. extern int efx_hunt_rx_init(struct net_device *netdev, dma_addr_t *dma_addr);
  59. extern int efx_hunt_tx_init(struct net_device *netdev, dma_addr_t *dma_addr);
  60. extern int efx_hunt_open(struct net_device *netdev);
  61. extern void efx_hunt_close(struct net_device *netdev);
  62. #endif /* EFX_HUNT_H */