ef100_nic.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2018 Solarflare Communications Inc.
  5. * Copyright 2019-2020 Xilinx Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published
  9. * by the Free Software Foundation, incorporated herein by reference.
  10. */
  11. #ifndef EFX_EF100_NIC_H
  12. #define EFX_EF100_NIC_H
  13. #include "net_driver.h"
  14. #include "nic_common.h"
  15. extern const struct efx_nic_type ef100_pf_nic_type;
  16. extern const struct efx_nic_type ef100_vf_nic_type;
  17. int ef100_probe_netdev_pf(struct efx_nic *efx);
  18. int ef100_probe_vf(struct efx_nic *efx);
  19. void ef100_remove(struct efx_nic *efx);
  20. enum {
  21. EF100_STAT_port_tx_bytes = GENERIC_STAT_COUNT,
  22. EF100_STAT_port_tx_packets,
  23. EF100_STAT_port_tx_pause,
  24. EF100_STAT_port_tx_unicast,
  25. EF100_STAT_port_tx_multicast,
  26. EF100_STAT_port_tx_broadcast,
  27. EF100_STAT_port_tx_lt64,
  28. EF100_STAT_port_tx_64,
  29. EF100_STAT_port_tx_65_to_127,
  30. EF100_STAT_port_tx_128_to_255,
  31. EF100_STAT_port_tx_256_to_511,
  32. EF100_STAT_port_tx_512_to_1023,
  33. EF100_STAT_port_tx_1024_to_15xx,
  34. EF100_STAT_port_tx_15xx_to_jumbo,
  35. EF100_STAT_port_rx_bytes,
  36. EF100_STAT_port_rx_packets,
  37. EF100_STAT_port_rx_good,
  38. EF100_STAT_port_rx_bad,
  39. EF100_STAT_port_rx_pause,
  40. EF100_STAT_port_rx_unicast,
  41. EF100_STAT_port_rx_multicast,
  42. EF100_STAT_port_rx_broadcast,
  43. EF100_STAT_port_rx_lt64,
  44. EF100_STAT_port_rx_64,
  45. EF100_STAT_port_rx_65_to_127,
  46. EF100_STAT_port_rx_128_to_255,
  47. EF100_STAT_port_rx_256_to_511,
  48. EF100_STAT_port_rx_512_to_1023,
  49. EF100_STAT_port_rx_1024_to_15xx,
  50. EF100_STAT_port_rx_15xx_to_jumbo,
  51. EF100_STAT_port_rx_gtjumbo,
  52. EF100_STAT_port_rx_bad_gtjumbo,
  53. EF100_STAT_port_rx_align_error,
  54. EF100_STAT_port_rx_length_error,
  55. EF100_STAT_port_rx_overflow,
  56. EF100_STAT_port_rx_nodesc_drops,
  57. EF100_STAT_COUNT
  58. };
  59. struct ef100_nic_data {
  60. struct efx_nic *efx;
  61. struct efx_buffer mcdi_buf;
  62. u32 datapath_caps;
  63. u32 datapath_caps2;
  64. u32 datapath_caps3;
  65. unsigned int pf_index;
  66. u16 warm_boot_count;
  67. u8 port_id[ETH_ALEN];
  68. DECLARE_BITMAP(evq_phases, EFX_MAX_CHANNELS);
  69. u64 stats[EF100_STAT_COUNT];
  70. u32 base_mport;
  71. bool have_mport; /* base_mport was populated successfully */
  72. bool grp_mae; /* MAE Privilege */
  73. u16 tso_max_hdr_len;
  74. u16 tso_max_payload_num_segs;
  75. u16 tso_max_frames;
  76. unsigned int tso_max_payload_len;
  77. };
  78. #define efx_ef100_has_cap(caps, flag) \
  79. (!!((caps) & BIT_ULL(MC_CMD_GET_CAPABILITIES_V4_OUT_ ## flag ## _LBN)))
  80. int efx_ef100_init_datapath_caps(struct efx_nic *efx);
  81. int ef100_phy_probe(struct efx_nic *efx);
  82. int ef100_filter_table_probe(struct efx_nic *efx);
  83. #endif /* EFX_EF100_NIC_H */