ef100_nic.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. u32 own_mport;
  73. u32 local_mae_intf; /* interface_idx that corresponds to us, in mport enumerate */
  74. bool have_own_mport; /* own_mport was populated successfully */
  75. bool have_local_intf; /* local_mae_intf was populated successfully */
  76. bool grp_mae; /* MAE Privilege */
  77. u16 tso_max_hdr_len;
  78. u16 tso_max_payload_num_segs;
  79. u16 tso_max_frames;
  80. unsigned int tso_max_payload_len;
  81. };
  82. #define efx_ef100_has_cap(caps, flag) \
  83. (!!((caps) & BIT_ULL(MC_CMD_GET_CAPABILITIES_V4_OUT_ ## flag ## _LBN)))
  84. int efx_ef100_init_datapath_caps(struct efx_nic *efx);
  85. int ef100_phy_probe(struct efx_nic *efx);
  86. int ef100_filter_table_probe(struct efx_nic *efx);
  87. int ef100_get_mac_address(struct efx_nic *efx, u8 *mac_address,
  88. int client_handle, bool empty_ok);
  89. int efx_ef100_lookup_client_id(struct efx_nic *efx, efx_qword_t pciefn, u32 *id);
  90. #endif /* EFX_EF100_NIC_H */