2020-07-27 04:55:55 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/****************************************************************************
|
|
|
|
* Driver for Solarflare network controllers and boards
|
|
|
|
* Copyright 2018 Solarflare Communications Inc.
|
|
|
|
* Copyright 2019-2020 Xilinx Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
|
|
* by the Free Software Foundation, incorporated herein by reference.
|
|
|
|
*/
|
2022-06-28 07:00:47 -07:00
|
|
|
#ifndef EFX_EF100_NIC_H
|
|
|
|
#define EFX_EF100_NIC_H
|
2020-07-27 04:55:55 -07:00
|
|
|
|
|
|
|
#include "net_driver.h"
|
|
|
|
#include "nic_common.h"
|
|
|
|
|
|
|
|
extern const struct efx_nic_type ef100_pf_nic_type;
|
2020-08-03 13:40:01 -07:00
|
|
|
extern const struct efx_nic_type ef100_vf_nic_type;
|
2020-07-27 04:55:55 -07:00
|
|
|
|
2022-06-28 07:00:47 -07:00
|
|
|
int ef100_probe_netdev_pf(struct efx_nic *efx);
|
2020-08-03 13:40:01 -07:00
|
|
|
int ef100_probe_vf(struct efx_nic *efx);
|
2020-07-27 04:55:55 -07:00
|
|
|
void ef100_remove(struct efx_nic *efx);
|
|
|
|
|
2020-08-03 13:37:20 -07:00
|
|
|
enum {
|
|
|
|
EF100_STAT_port_tx_bytes = GENERIC_STAT_COUNT,
|
|
|
|
EF100_STAT_port_tx_packets,
|
|
|
|
EF100_STAT_port_tx_pause,
|
|
|
|
EF100_STAT_port_tx_unicast,
|
|
|
|
EF100_STAT_port_tx_multicast,
|
|
|
|
EF100_STAT_port_tx_broadcast,
|
|
|
|
EF100_STAT_port_tx_lt64,
|
|
|
|
EF100_STAT_port_tx_64,
|
|
|
|
EF100_STAT_port_tx_65_to_127,
|
|
|
|
EF100_STAT_port_tx_128_to_255,
|
|
|
|
EF100_STAT_port_tx_256_to_511,
|
|
|
|
EF100_STAT_port_tx_512_to_1023,
|
|
|
|
EF100_STAT_port_tx_1024_to_15xx,
|
|
|
|
EF100_STAT_port_tx_15xx_to_jumbo,
|
|
|
|
EF100_STAT_port_rx_bytes,
|
|
|
|
EF100_STAT_port_rx_packets,
|
|
|
|
EF100_STAT_port_rx_good,
|
|
|
|
EF100_STAT_port_rx_bad,
|
|
|
|
EF100_STAT_port_rx_pause,
|
|
|
|
EF100_STAT_port_rx_unicast,
|
|
|
|
EF100_STAT_port_rx_multicast,
|
|
|
|
EF100_STAT_port_rx_broadcast,
|
|
|
|
EF100_STAT_port_rx_lt64,
|
|
|
|
EF100_STAT_port_rx_64,
|
|
|
|
EF100_STAT_port_rx_65_to_127,
|
|
|
|
EF100_STAT_port_rx_128_to_255,
|
|
|
|
EF100_STAT_port_rx_256_to_511,
|
|
|
|
EF100_STAT_port_rx_512_to_1023,
|
|
|
|
EF100_STAT_port_rx_1024_to_15xx,
|
|
|
|
EF100_STAT_port_rx_15xx_to_jumbo,
|
|
|
|
EF100_STAT_port_rx_gtjumbo,
|
|
|
|
EF100_STAT_port_rx_bad_gtjumbo,
|
|
|
|
EF100_STAT_port_rx_align_error,
|
|
|
|
EF100_STAT_port_rx_length_error,
|
|
|
|
EF100_STAT_port_rx_overflow,
|
|
|
|
EF100_STAT_port_rx_nodesc_drops,
|
|
|
|
EF100_STAT_COUNT
|
|
|
|
};
|
|
|
|
|
2020-07-27 04:55:55 -07:00
|
|
|
struct ef100_nic_data {
|
|
|
|
struct efx_nic *efx;
|
2020-07-27 04:57:09 -07:00
|
|
|
struct efx_buffer mcdi_buf;
|
2020-07-27 04:58:26 -07:00
|
|
|
u32 datapath_caps;
|
|
|
|
u32 datapath_caps2;
|
2020-07-27 04:59:18 -07:00
|
|
|
u32 datapath_caps3;
|
2020-08-03 13:38:49 -07:00
|
|
|
unsigned int pf_index;
|
2020-07-27 04:55:55 -07:00
|
|
|
u16 warm_boot_count;
|
2020-07-27 05:05:31 -07:00
|
|
|
u8 port_id[ETH_ALEN];
|
2020-07-27 04:57:34 -07:00
|
|
|
DECLARE_BITMAP(evq_phases, EFX_MAX_CHANNELS);
|
2020-08-03 13:37:20 -07:00
|
|
|
u64 stats[EF100_STAT_COUNT];
|
2022-07-28 11:57:46 -07:00
|
|
|
u32 base_mport;
|
|
|
|
bool have_mport; /* base_mport was populated successfully */
|
2023-02-15 02:08:23 -07:00
|
|
|
u32 own_mport;
|
|
|
|
u32 local_mae_intf; /* interface_idx that corresponds to us, in mport enumerate */
|
|
|
|
bool have_own_mport; /* own_mport was populated successfully */
|
|
|
|
bool have_local_intf; /* local_mae_intf was populated successfully */
|
2022-07-20 11:29:26 -07:00
|
|
|
bool grp_mae; /* MAE Privilege */
|
2020-08-03 13:33:20 -07:00
|
|
|
u16 tso_max_hdr_len;
|
|
|
|
u16 tso_max_payload_num_segs;
|
|
|
|
u16 tso_max_frames;
|
|
|
|
unsigned int tso_max_payload_len;
|
2020-07-27 04:55:55 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#define efx_ef100_has_cap(caps, flag) \
|
|
|
|
(!!((caps) & BIT_ULL(MC_CMD_GET_CAPABILITIES_V4_OUT_ ## flag ## _LBN)))
|
2022-06-28 07:00:47 -07:00
|
|
|
|
|
|
|
int efx_ef100_init_datapath_caps(struct efx_nic *efx);
|
|
|
|
int ef100_phy_probe(struct efx_nic *efx);
|
|
|
|
int ef100_filter_table_probe(struct efx_nic *efx);
|
|
|
|
|
2023-02-15 02:08:26 -07:00
|
|
|
int ef100_get_mac_address(struct efx_nic *efx, u8 *mac_address,
|
|
|
|
int client_handle, bool empty_ok);
|
2023-02-15 02:08:27 -07:00
|
|
|
int efx_ef100_lookup_client_id(struct efx_nic *efx, efx_qword_t pciefn, u32 *id);
|
2022-06-28 07:00:47 -07:00
|
|
|
#endif /* EFX_EF100_NIC_H */
|