efx_channels.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2018 Solarflare Communications Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation, incorporated herein by reference.
  9. */
  10. #ifndef EFX_CHANNELS_H
  11. #define EFX_CHANNELS_H
  12. extern unsigned int efx_interrupt_mode;
  13. extern unsigned int rss_cpus;
  14. int efx_probe_interrupts(struct efx_nic *efx);
  15. void efx_remove_interrupts(struct efx_nic *efx);
  16. int efx_soft_enable_interrupts(struct efx_nic *efx);
  17. void efx_soft_disable_interrupts(struct efx_nic *efx);
  18. int efx_enable_interrupts(struct efx_nic *efx);
  19. void efx_disable_interrupts(struct efx_nic *efx);
  20. void efx_set_interrupt_affinity(struct efx_nic *efx);
  21. void efx_clear_interrupt_affinity(struct efx_nic *efx);
  22. int efx_probe_eventq(struct efx_channel *channel);
  23. int efx_init_eventq(struct efx_channel *channel);
  24. void efx_start_eventq(struct efx_channel *channel);
  25. void efx_stop_eventq(struct efx_channel *channel);
  26. void efx_fini_eventq(struct efx_channel *channel);
  27. void efx_remove_eventq(struct efx_channel *channel);
  28. int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries);
  29. void efx_set_channel_names(struct efx_nic *efx);
  30. int efx_init_channels(struct efx_nic *efx);
  31. int efx_probe_channels(struct efx_nic *efx);
  32. int efx_set_channels(struct efx_nic *efx);
  33. void efx_remove_channel(struct efx_channel *channel);
  34. void efx_remove_channels(struct efx_nic *efx);
  35. void efx_fini_channels(struct efx_nic *efx);
  36. struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel);
  37. void efx_start_channels(struct efx_nic *efx);
  38. void efx_stop_channels(struct efx_nic *efx);
  39. static inline u64 efx_get_queue_stat_rx_hw_drops(struct efx_channel *channel)
  40. {
  41. return channel->n_rx_eth_crc_err + channel->n_rx_frm_trunc +
  42. channel->n_rx_overlength + channel->n_rx_nodesc_trunc +
  43. channel->n_rx_mport_bad;
  44. }
  45. void efx_init_napi_channel(struct efx_channel *channel);
  46. void efx_init_napi(struct efx_nic *efx);
  47. void efx_fini_napi_channel(struct efx_channel *channel);
  48. void efx_fini_napi(struct efx_nic *efx);
  49. void efx_channel_dummy_op_void(struct efx_channel *channel);
  50. #endif