18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/****************************************************************************
38c2ecf20Sopenharmony_ci * Driver for Solarflare network controllers and boards
48c2ecf20Sopenharmony_ci * Copyright 2005-2006 Fen Systems Ltd.
58c2ecf20Sopenharmony_ci * Copyright 2006-2013 Solarflare Communications Inc.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef EFX_NIC_H
98c2ecf20Sopenharmony_ci#define EFX_NIC_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include "nic_common.h"
128c2ecf20Sopenharmony_ci#include "efx.h"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciu32 efx_farch_fpga_ver(struct efx_nic *efx);
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cienum {
178c2ecf20Sopenharmony_ci	PHY_TYPE_NONE = 0,
188c2ecf20Sopenharmony_ci	PHY_TYPE_TXC43128 = 1,
198c2ecf20Sopenharmony_ci	PHY_TYPE_88E1111 = 2,
208c2ecf20Sopenharmony_ci	PHY_TYPE_SFX7101 = 3,
218c2ecf20Sopenharmony_ci	PHY_TYPE_QT2022C2 = 4,
228c2ecf20Sopenharmony_ci	PHY_TYPE_PM8358 = 6,
238c2ecf20Sopenharmony_ci	PHY_TYPE_SFT9001A = 8,
248c2ecf20Sopenharmony_ci	PHY_TYPE_QT2025C = 9,
258c2ecf20Sopenharmony_ci	PHY_TYPE_SFT9001B = 10,
268c2ecf20Sopenharmony_ci};
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_cienum {
298c2ecf20Sopenharmony_ci	SIENA_STAT_tx_bytes = GENERIC_STAT_COUNT,
308c2ecf20Sopenharmony_ci	SIENA_STAT_tx_good_bytes,
318c2ecf20Sopenharmony_ci	SIENA_STAT_tx_bad_bytes,
328c2ecf20Sopenharmony_ci	SIENA_STAT_tx_packets,
338c2ecf20Sopenharmony_ci	SIENA_STAT_tx_bad,
348c2ecf20Sopenharmony_ci	SIENA_STAT_tx_pause,
358c2ecf20Sopenharmony_ci	SIENA_STAT_tx_control,
368c2ecf20Sopenharmony_ci	SIENA_STAT_tx_unicast,
378c2ecf20Sopenharmony_ci	SIENA_STAT_tx_multicast,
388c2ecf20Sopenharmony_ci	SIENA_STAT_tx_broadcast,
398c2ecf20Sopenharmony_ci	SIENA_STAT_tx_lt64,
408c2ecf20Sopenharmony_ci	SIENA_STAT_tx_64,
418c2ecf20Sopenharmony_ci	SIENA_STAT_tx_65_to_127,
428c2ecf20Sopenharmony_ci	SIENA_STAT_tx_128_to_255,
438c2ecf20Sopenharmony_ci	SIENA_STAT_tx_256_to_511,
448c2ecf20Sopenharmony_ci	SIENA_STAT_tx_512_to_1023,
458c2ecf20Sopenharmony_ci	SIENA_STAT_tx_1024_to_15xx,
468c2ecf20Sopenharmony_ci	SIENA_STAT_tx_15xx_to_jumbo,
478c2ecf20Sopenharmony_ci	SIENA_STAT_tx_gtjumbo,
488c2ecf20Sopenharmony_ci	SIENA_STAT_tx_collision,
498c2ecf20Sopenharmony_ci	SIENA_STAT_tx_single_collision,
508c2ecf20Sopenharmony_ci	SIENA_STAT_tx_multiple_collision,
518c2ecf20Sopenharmony_ci	SIENA_STAT_tx_excessive_collision,
528c2ecf20Sopenharmony_ci	SIENA_STAT_tx_deferred,
538c2ecf20Sopenharmony_ci	SIENA_STAT_tx_late_collision,
548c2ecf20Sopenharmony_ci	SIENA_STAT_tx_excessive_deferred,
558c2ecf20Sopenharmony_ci	SIENA_STAT_tx_non_tcpudp,
568c2ecf20Sopenharmony_ci	SIENA_STAT_tx_mac_src_error,
578c2ecf20Sopenharmony_ci	SIENA_STAT_tx_ip_src_error,
588c2ecf20Sopenharmony_ci	SIENA_STAT_rx_bytes,
598c2ecf20Sopenharmony_ci	SIENA_STAT_rx_good_bytes,
608c2ecf20Sopenharmony_ci	SIENA_STAT_rx_bad_bytes,
618c2ecf20Sopenharmony_ci	SIENA_STAT_rx_packets,
628c2ecf20Sopenharmony_ci	SIENA_STAT_rx_good,
638c2ecf20Sopenharmony_ci	SIENA_STAT_rx_bad,
648c2ecf20Sopenharmony_ci	SIENA_STAT_rx_pause,
658c2ecf20Sopenharmony_ci	SIENA_STAT_rx_control,
668c2ecf20Sopenharmony_ci	SIENA_STAT_rx_unicast,
678c2ecf20Sopenharmony_ci	SIENA_STAT_rx_multicast,
688c2ecf20Sopenharmony_ci	SIENA_STAT_rx_broadcast,
698c2ecf20Sopenharmony_ci	SIENA_STAT_rx_lt64,
708c2ecf20Sopenharmony_ci	SIENA_STAT_rx_64,
718c2ecf20Sopenharmony_ci	SIENA_STAT_rx_65_to_127,
728c2ecf20Sopenharmony_ci	SIENA_STAT_rx_128_to_255,
738c2ecf20Sopenharmony_ci	SIENA_STAT_rx_256_to_511,
748c2ecf20Sopenharmony_ci	SIENA_STAT_rx_512_to_1023,
758c2ecf20Sopenharmony_ci	SIENA_STAT_rx_1024_to_15xx,
768c2ecf20Sopenharmony_ci	SIENA_STAT_rx_15xx_to_jumbo,
778c2ecf20Sopenharmony_ci	SIENA_STAT_rx_gtjumbo,
788c2ecf20Sopenharmony_ci	SIENA_STAT_rx_bad_gtjumbo,
798c2ecf20Sopenharmony_ci	SIENA_STAT_rx_overflow,
808c2ecf20Sopenharmony_ci	SIENA_STAT_rx_false_carrier,
818c2ecf20Sopenharmony_ci	SIENA_STAT_rx_symbol_error,
828c2ecf20Sopenharmony_ci	SIENA_STAT_rx_align_error,
838c2ecf20Sopenharmony_ci	SIENA_STAT_rx_length_error,
848c2ecf20Sopenharmony_ci	SIENA_STAT_rx_internal_error,
858c2ecf20Sopenharmony_ci	SIENA_STAT_rx_nodesc_drop_cnt,
868c2ecf20Sopenharmony_ci	SIENA_STAT_COUNT
878c2ecf20Sopenharmony_ci};
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/**
908c2ecf20Sopenharmony_ci * struct siena_nic_data - Siena NIC state
918c2ecf20Sopenharmony_ci * @efx: Pointer back to main interface structure
928c2ecf20Sopenharmony_ci * @wol_filter_id: Wake-on-LAN packet filter id
938c2ecf20Sopenharmony_ci * @stats: Hardware statistics
948c2ecf20Sopenharmony_ci * @vf: Array of &struct siena_vf objects
958c2ecf20Sopenharmony_ci * @vf_buftbl_base: The zeroth buffer table index used to back VF queues.
968c2ecf20Sopenharmony_ci * @vfdi_status: Common VFDI status page to be dmad to VF address space.
978c2ecf20Sopenharmony_ci * @local_addr_list: List of local addresses. Protected by %local_lock.
988c2ecf20Sopenharmony_ci * @local_page_list: List of DMA addressable pages used to broadcast
998c2ecf20Sopenharmony_ci *	%local_addr_list. Protected by %local_lock.
1008c2ecf20Sopenharmony_ci * @local_lock: Mutex protecting %local_addr_list and %local_page_list.
1018c2ecf20Sopenharmony_ci * @peer_work: Work item to broadcast peer addresses to VMs.
1028c2ecf20Sopenharmony_ci */
1038c2ecf20Sopenharmony_cistruct siena_nic_data {
1048c2ecf20Sopenharmony_ci	struct efx_nic *efx;
1058c2ecf20Sopenharmony_ci	int wol_filter_id;
1068c2ecf20Sopenharmony_ci	u64 stats[SIENA_STAT_COUNT];
1078c2ecf20Sopenharmony_ci#ifdef CONFIG_SFC_SRIOV
1088c2ecf20Sopenharmony_ci	struct siena_vf *vf;
1098c2ecf20Sopenharmony_ci	struct efx_channel *vfdi_channel;
1108c2ecf20Sopenharmony_ci	unsigned vf_buftbl_base;
1118c2ecf20Sopenharmony_ci	struct efx_buffer vfdi_status;
1128c2ecf20Sopenharmony_ci	struct list_head local_addr_list;
1138c2ecf20Sopenharmony_ci	struct list_head local_page_list;
1148c2ecf20Sopenharmony_ci	struct mutex local_lock;
1158c2ecf20Sopenharmony_ci	struct work_struct peer_work;
1168c2ecf20Sopenharmony_ci#endif
1178c2ecf20Sopenharmony_ci};
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_cienum {
1208c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_bytes = GENERIC_STAT_COUNT,
1218c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_packets,
1228c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_pause,
1238c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_control,
1248c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_unicast,
1258c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_multicast,
1268c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_broadcast,
1278c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_lt64,
1288c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_64,
1298c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_65_to_127,
1308c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_128_to_255,
1318c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_256_to_511,
1328c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_512_to_1023,
1338c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_1024_to_15xx,
1348c2ecf20Sopenharmony_ci	EF10_STAT_port_tx_15xx_to_jumbo,
1358c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_bytes,
1368c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_bytes_minus_good_bytes,
1378c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_good_bytes,
1388c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_bad_bytes,
1398c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_packets,
1408c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_good,
1418c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_bad,
1428c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pause,
1438c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_control,
1448c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_unicast,
1458c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_multicast,
1468c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_broadcast,
1478c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_lt64,
1488c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_64,
1498c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_65_to_127,
1508c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_128_to_255,
1518c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_256_to_511,
1528c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_512_to_1023,
1538c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_1024_to_15xx,
1548c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_15xx_to_jumbo,
1558c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_gtjumbo,
1568c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_bad_gtjumbo,
1578c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_overflow,
1588c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_align_error,
1598c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_length_error,
1608c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_nodesc_drops,
1618c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_trunc_bb_overflow,
1628c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_discard_bb_overflow,
1638c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_trunc_vfifo_full,
1648c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_discard_vfifo_full,
1658c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_trunc_qbb,
1668c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_discard_qbb,
1678c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_pm_discard_mapping,
1688c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_dp_q_disabled_packets,
1698c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_dp_di_dropped_packets,
1708c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_dp_streaming_packets,
1718c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_dp_hlb_fetch,
1728c2ecf20Sopenharmony_ci	EF10_STAT_port_rx_dp_hlb_wait,
1738c2ecf20Sopenharmony_ci	EF10_STAT_rx_unicast,
1748c2ecf20Sopenharmony_ci	EF10_STAT_rx_unicast_bytes,
1758c2ecf20Sopenharmony_ci	EF10_STAT_rx_multicast,
1768c2ecf20Sopenharmony_ci	EF10_STAT_rx_multicast_bytes,
1778c2ecf20Sopenharmony_ci	EF10_STAT_rx_broadcast,
1788c2ecf20Sopenharmony_ci	EF10_STAT_rx_broadcast_bytes,
1798c2ecf20Sopenharmony_ci	EF10_STAT_rx_bad,
1808c2ecf20Sopenharmony_ci	EF10_STAT_rx_bad_bytes,
1818c2ecf20Sopenharmony_ci	EF10_STAT_rx_overflow,
1828c2ecf20Sopenharmony_ci	EF10_STAT_tx_unicast,
1838c2ecf20Sopenharmony_ci	EF10_STAT_tx_unicast_bytes,
1848c2ecf20Sopenharmony_ci	EF10_STAT_tx_multicast,
1858c2ecf20Sopenharmony_ci	EF10_STAT_tx_multicast_bytes,
1868c2ecf20Sopenharmony_ci	EF10_STAT_tx_broadcast,
1878c2ecf20Sopenharmony_ci	EF10_STAT_tx_broadcast_bytes,
1888c2ecf20Sopenharmony_ci	EF10_STAT_tx_bad,
1898c2ecf20Sopenharmony_ci	EF10_STAT_tx_bad_bytes,
1908c2ecf20Sopenharmony_ci	EF10_STAT_tx_overflow,
1918c2ecf20Sopenharmony_ci	EF10_STAT_V1_COUNT,
1928c2ecf20Sopenharmony_ci	EF10_STAT_fec_uncorrected_errors = EF10_STAT_V1_COUNT,
1938c2ecf20Sopenharmony_ci	EF10_STAT_fec_corrected_errors,
1948c2ecf20Sopenharmony_ci	EF10_STAT_fec_corrected_symbols_lane0,
1958c2ecf20Sopenharmony_ci	EF10_STAT_fec_corrected_symbols_lane1,
1968c2ecf20Sopenharmony_ci	EF10_STAT_fec_corrected_symbols_lane2,
1978c2ecf20Sopenharmony_ci	EF10_STAT_fec_corrected_symbols_lane3,
1988c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_vi_busy_fallback,
1998c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_long_write_success,
2008c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_missing_dbell_fail,
2018c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_overflow_fail,
2028c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_underflow_fail,
2038c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_timeout_fail,
2048c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_noncontig_wr_fail,
2058c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_frm_clobber_fail,
2068c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_invalid_wr_fail,
2078c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_vi_clobber_fallback,
2088c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_unqualified_fallback,
2098c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_runt_fallback,
2108c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_success,
2118c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_fallback,
2128c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_poison,
2138c2ecf20Sopenharmony_ci	EF10_STAT_ctpio_erase,
2148c2ecf20Sopenharmony_ci	EF10_STAT_COUNT
2158c2ecf20Sopenharmony_ci};
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/* Maximum number of TX PIO buffers we may allocate to a function.
2188c2ecf20Sopenharmony_ci * This matches the total number of buffers on each SFC9100-family
2198c2ecf20Sopenharmony_ci * controller.
2208c2ecf20Sopenharmony_ci */
2218c2ecf20Sopenharmony_ci#define EF10_TX_PIOBUF_COUNT 16
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci/**
2248c2ecf20Sopenharmony_ci * struct efx_ef10_nic_data - EF10 architecture NIC state
2258c2ecf20Sopenharmony_ci * @mcdi_buf: DMA buffer for MCDI
2268c2ecf20Sopenharmony_ci * @warm_boot_count: Last seen MC warm boot count
2278c2ecf20Sopenharmony_ci * @vi_base: Absolute index of first VI in this function
2288c2ecf20Sopenharmony_ci * @n_allocated_vis: Number of VIs allocated to this function
2298c2ecf20Sopenharmony_ci * @n_piobufs: Number of PIO buffers allocated to this function
2308c2ecf20Sopenharmony_ci * @wc_membase: Base address of write-combining mapping of the memory BAR
2318c2ecf20Sopenharmony_ci * @pio_write_base: Base address for writing PIO buffers
2328c2ecf20Sopenharmony_ci * @pio_write_vi_base: Relative VI number for @pio_write_base
2338c2ecf20Sopenharmony_ci * @piobuf_handle: Handle of each PIO buffer allocated
2348c2ecf20Sopenharmony_ci * @piobuf_size: size of a single PIO buffer
2358c2ecf20Sopenharmony_ci * @must_restore_piobufs: Flag: PIO buffers have yet to be restored after MC
2368c2ecf20Sopenharmony_ci *	reboot
2378c2ecf20Sopenharmony_ci * @mc_stats: Scratch buffer for converting statistics to the kernel's format
2388c2ecf20Sopenharmony_ci * @stats: Hardware statistics
2398c2ecf20Sopenharmony_ci * @workaround_35388: Flag: firmware supports workaround for bug 35388
2408c2ecf20Sopenharmony_ci * @workaround_26807: Flag: firmware supports workaround for bug 26807
2418c2ecf20Sopenharmony_ci * @workaround_61265: Flag: firmware supports workaround for bug 61265
2428c2ecf20Sopenharmony_ci * @must_check_datapath_caps: Flag: @datapath_caps needs to be revalidated
2438c2ecf20Sopenharmony_ci *	after MC reboot
2448c2ecf20Sopenharmony_ci * @datapath_caps: Capabilities of datapath firmware (FLAGS1 field of
2458c2ecf20Sopenharmony_ci *	%MC_CMD_GET_CAPABILITIES response)
2468c2ecf20Sopenharmony_ci * @datapath_caps2: Further Capabilities of datapath firmware (FLAGS2 field of
2478c2ecf20Sopenharmony_ci * %MC_CMD_GET_CAPABILITIES response)
2488c2ecf20Sopenharmony_ci * @rx_dpcpu_fw_id: Firmware ID of the RxDPCPU
2498c2ecf20Sopenharmony_ci * @tx_dpcpu_fw_id: Firmware ID of the TxDPCPU
2508c2ecf20Sopenharmony_ci * @must_probe_vswitching: Flag: vswitching has yet to be setup after MC reboot
2518c2ecf20Sopenharmony_ci * @pf_index: The number for this PF, or the parent PF if this is a VF
2528c2ecf20Sopenharmony_ci#ifdef CONFIG_SFC_SRIOV
2538c2ecf20Sopenharmony_ci * @vf: Pointer to VF data structure
2548c2ecf20Sopenharmony_ci#endif
2558c2ecf20Sopenharmony_ci * @vport_mac: The MAC address on the vport, only for PFs; VFs will be zero
2568c2ecf20Sopenharmony_ci * @vlan_list: List of VLANs added over the interface. Serialised by vlan_lock.
2578c2ecf20Sopenharmony_ci * @vlan_lock: Lock to serialize access to vlan_list.
2588c2ecf20Sopenharmony_ci * @udp_tunnels: UDP tunnel port numbers and types.
2598c2ecf20Sopenharmony_ci * @udp_tunnels_dirty: flag indicating a reboot occurred while pushing
2608c2ecf20Sopenharmony_ci *	@udp_tunnels to hardware and thus the push must be re-done.
2618c2ecf20Sopenharmony_ci * @udp_tunnels_lock: Serialises writes to @udp_tunnels and @udp_tunnels_dirty.
2628c2ecf20Sopenharmony_ci */
2638c2ecf20Sopenharmony_cistruct efx_ef10_nic_data {
2648c2ecf20Sopenharmony_ci	struct efx_buffer mcdi_buf;
2658c2ecf20Sopenharmony_ci	u16 warm_boot_count;
2668c2ecf20Sopenharmony_ci	unsigned int vi_base;
2678c2ecf20Sopenharmony_ci	unsigned int n_allocated_vis;
2688c2ecf20Sopenharmony_ci	unsigned int n_piobufs;
2698c2ecf20Sopenharmony_ci	void __iomem *wc_membase, *pio_write_base;
2708c2ecf20Sopenharmony_ci	unsigned int pio_write_vi_base;
2718c2ecf20Sopenharmony_ci	unsigned int piobuf_handle[EF10_TX_PIOBUF_COUNT];
2728c2ecf20Sopenharmony_ci	u16 piobuf_size;
2738c2ecf20Sopenharmony_ci	bool must_restore_piobufs;
2748c2ecf20Sopenharmony_ci	__le64 *mc_stats;
2758c2ecf20Sopenharmony_ci	u64 stats[EF10_STAT_COUNT];
2768c2ecf20Sopenharmony_ci	bool workaround_35388;
2778c2ecf20Sopenharmony_ci	bool workaround_26807;
2788c2ecf20Sopenharmony_ci	bool workaround_61265;
2798c2ecf20Sopenharmony_ci	bool must_check_datapath_caps;
2808c2ecf20Sopenharmony_ci	u32 datapath_caps;
2818c2ecf20Sopenharmony_ci	u32 datapath_caps2;
2828c2ecf20Sopenharmony_ci	unsigned int rx_dpcpu_fw_id;
2838c2ecf20Sopenharmony_ci	unsigned int tx_dpcpu_fw_id;
2848c2ecf20Sopenharmony_ci	bool must_probe_vswitching;
2858c2ecf20Sopenharmony_ci	unsigned int pf_index;
2868c2ecf20Sopenharmony_ci	u8 port_id[ETH_ALEN];
2878c2ecf20Sopenharmony_ci#ifdef CONFIG_SFC_SRIOV
2888c2ecf20Sopenharmony_ci	unsigned int vf_index;
2898c2ecf20Sopenharmony_ci	struct ef10_vf *vf;
2908c2ecf20Sopenharmony_ci#endif
2918c2ecf20Sopenharmony_ci	u8 vport_mac[ETH_ALEN];
2928c2ecf20Sopenharmony_ci	struct list_head vlan_list;
2938c2ecf20Sopenharmony_ci	struct mutex vlan_lock;
2948c2ecf20Sopenharmony_ci	struct efx_udp_tunnel udp_tunnels[16];
2958c2ecf20Sopenharmony_ci	bool udp_tunnels_dirty;
2968c2ecf20Sopenharmony_ci	struct mutex udp_tunnels_lock;
2978c2ecf20Sopenharmony_ci	u64 licensed_features;
2988c2ecf20Sopenharmony_ci};
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci/* TSOv2 */
3018c2ecf20Sopenharmony_ciint efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue, struct sk_buff *skb,
3028c2ecf20Sopenharmony_ci			 bool *data_mapped);
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ciint efx_init_sriov(void);
3058c2ecf20Sopenharmony_civoid efx_fini_sriov(void);
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ciextern const struct efx_nic_type siena_a0_nic_type;
3088c2ecf20Sopenharmony_ciextern const struct efx_nic_type efx_hunt_a0_nic_type;
3098c2ecf20Sopenharmony_ciextern const struct efx_nic_type efx_hunt_a0_vf_nic_type;
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ciint falcon_probe_board(struct efx_nic *efx, u16 revision_info);
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci/* Falcon/Siena queue operations */
3148c2ecf20Sopenharmony_ciint efx_farch_tx_probe(struct efx_tx_queue *tx_queue);
3158c2ecf20Sopenharmony_civoid efx_farch_tx_init(struct efx_tx_queue *tx_queue);
3168c2ecf20Sopenharmony_civoid efx_farch_tx_fini(struct efx_tx_queue *tx_queue);
3178c2ecf20Sopenharmony_civoid efx_farch_tx_remove(struct efx_tx_queue *tx_queue);
3188c2ecf20Sopenharmony_civoid efx_farch_tx_write(struct efx_tx_queue *tx_queue);
3198c2ecf20Sopenharmony_ciunsigned int efx_farch_tx_limit_len(struct efx_tx_queue *tx_queue,
3208c2ecf20Sopenharmony_ci				    dma_addr_t dma_addr, unsigned int len);
3218c2ecf20Sopenharmony_ciint efx_farch_rx_probe(struct efx_rx_queue *rx_queue);
3228c2ecf20Sopenharmony_civoid efx_farch_rx_init(struct efx_rx_queue *rx_queue);
3238c2ecf20Sopenharmony_civoid efx_farch_rx_fini(struct efx_rx_queue *rx_queue);
3248c2ecf20Sopenharmony_civoid efx_farch_rx_remove(struct efx_rx_queue *rx_queue);
3258c2ecf20Sopenharmony_civoid efx_farch_rx_write(struct efx_rx_queue *rx_queue);
3268c2ecf20Sopenharmony_civoid efx_farch_rx_defer_refill(struct efx_rx_queue *rx_queue);
3278c2ecf20Sopenharmony_ciint efx_farch_ev_probe(struct efx_channel *channel);
3288c2ecf20Sopenharmony_ciint efx_farch_ev_init(struct efx_channel *channel);
3298c2ecf20Sopenharmony_civoid efx_farch_ev_fini(struct efx_channel *channel);
3308c2ecf20Sopenharmony_civoid efx_farch_ev_remove(struct efx_channel *channel);
3318c2ecf20Sopenharmony_ciint efx_farch_ev_process(struct efx_channel *channel, int quota);
3328c2ecf20Sopenharmony_civoid efx_farch_ev_read_ack(struct efx_channel *channel);
3338c2ecf20Sopenharmony_civoid efx_farch_ev_test_generate(struct efx_channel *channel);
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ci/* Falcon/Siena filter operations */
3368c2ecf20Sopenharmony_ciint efx_farch_filter_table_probe(struct efx_nic *efx);
3378c2ecf20Sopenharmony_civoid efx_farch_filter_table_restore(struct efx_nic *efx);
3388c2ecf20Sopenharmony_civoid efx_farch_filter_table_remove(struct efx_nic *efx);
3398c2ecf20Sopenharmony_civoid efx_farch_filter_update_rx_scatter(struct efx_nic *efx);
3408c2ecf20Sopenharmony_cis32 efx_farch_filter_insert(struct efx_nic *efx, struct efx_filter_spec *spec,
3418c2ecf20Sopenharmony_ci			    bool replace);
3428c2ecf20Sopenharmony_ciint efx_farch_filter_remove_safe(struct efx_nic *efx,
3438c2ecf20Sopenharmony_ci				 enum efx_filter_priority priority,
3448c2ecf20Sopenharmony_ci				 u32 filter_id);
3458c2ecf20Sopenharmony_ciint efx_farch_filter_get_safe(struct efx_nic *efx,
3468c2ecf20Sopenharmony_ci			      enum efx_filter_priority priority, u32 filter_id,
3478c2ecf20Sopenharmony_ci			      struct efx_filter_spec *);
3488c2ecf20Sopenharmony_ciint efx_farch_filter_clear_rx(struct efx_nic *efx,
3498c2ecf20Sopenharmony_ci			      enum efx_filter_priority priority);
3508c2ecf20Sopenharmony_ciu32 efx_farch_filter_count_rx_used(struct efx_nic *efx,
3518c2ecf20Sopenharmony_ci				   enum efx_filter_priority priority);
3528c2ecf20Sopenharmony_ciu32 efx_farch_filter_get_rx_id_limit(struct efx_nic *efx);
3538c2ecf20Sopenharmony_cis32 efx_farch_filter_get_rx_ids(struct efx_nic *efx,
3548c2ecf20Sopenharmony_ci				enum efx_filter_priority priority, u32 *buf,
3558c2ecf20Sopenharmony_ci				u32 size);
3568c2ecf20Sopenharmony_ci#ifdef CONFIG_RFS_ACCEL
3578c2ecf20Sopenharmony_cibool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id,
3588c2ecf20Sopenharmony_ci				     unsigned int index);
3598c2ecf20Sopenharmony_ci#endif
3608c2ecf20Sopenharmony_civoid efx_farch_filter_sync_rx_mode(struct efx_nic *efx);
3618c2ecf20Sopenharmony_ci
3628c2ecf20Sopenharmony_ci/* Falcon/Siena interrupts */
3638c2ecf20Sopenharmony_civoid efx_farch_irq_enable_master(struct efx_nic *efx);
3648c2ecf20Sopenharmony_ciint efx_farch_irq_test_generate(struct efx_nic *efx);
3658c2ecf20Sopenharmony_civoid efx_farch_irq_disable_master(struct efx_nic *efx);
3668c2ecf20Sopenharmony_ciirqreturn_t efx_farch_msi_interrupt(int irq, void *dev_id);
3678c2ecf20Sopenharmony_ciirqreturn_t efx_farch_legacy_interrupt(int irq, void *dev_id);
3688c2ecf20Sopenharmony_ciirqreturn_t efx_farch_fatal_interrupt(struct efx_nic *efx);
3698c2ecf20Sopenharmony_ci
3708c2ecf20Sopenharmony_ci/* Global Resources */
3718c2ecf20Sopenharmony_civoid siena_prepare_flush(struct efx_nic *efx);
3728c2ecf20Sopenharmony_ciint efx_farch_fini_dmaq(struct efx_nic *efx);
3738c2ecf20Sopenharmony_civoid efx_farch_finish_flr(struct efx_nic *efx);
3748c2ecf20Sopenharmony_civoid siena_finish_flush(struct efx_nic *efx);
3758c2ecf20Sopenharmony_civoid falcon_start_nic_stats(struct efx_nic *efx);
3768c2ecf20Sopenharmony_civoid falcon_stop_nic_stats(struct efx_nic *efx);
3778c2ecf20Sopenharmony_ciint falcon_reset_xaui(struct efx_nic *efx);
3788c2ecf20Sopenharmony_civoid efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw);
3798c2ecf20Sopenharmony_civoid efx_farch_init_common(struct efx_nic *efx);
3808c2ecf20Sopenharmony_civoid efx_farch_rx_push_indir_table(struct efx_nic *efx);
3818c2ecf20Sopenharmony_civoid efx_farch_rx_pull_indir_table(struct efx_nic *efx);
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci/* Tests */
3848c2ecf20Sopenharmony_cistruct efx_farch_register_test {
3858c2ecf20Sopenharmony_ci	unsigned address;
3868c2ecf20Sopenharmony_ci	efx_oword_t mask;
3878c2ecf20Sopenharmony_ci};
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ciint efx_farch_test_registers(struct efx_nic *efx,
3908c2ecf20Sopenharmony_ci			     const struct efx_farch_register_test *regs,
3918c2ecf20Sopenharmony_ci			     size_t n_regs);
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_civoid efx_farch_generate_event(struct efx_nic *efx, unsigned int evq,
3948c2ecf20Sopenharmony_ci			      efx_qword_t *event);
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci#endif /* EFX_NIC_H */
397