hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/sfc/mcdi.h
....@@ -1,10 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /****************************************************************************
23 * Driver for Solarflare network controllers and boards
34 * Copyright 2008-2013 Solarflare Communications Inc.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License version 2 as published
7
- * by the Free Software Foundation, incorporated herein by reference.
85 */
96
107 #ifndef EFX_MCDI_H
....@@ -193,6 +190,7 @@
193190 * 32-bit-aligned. Also, on Siena we must copy to the MC shared
194191 * memory strictly 32 bits at a time, so add any necessary padding.
195192 */
193
+#define MCDI_TX_BUF_LEN(_len) DIV_ROUND_UP((_len), 4)
196194 #define _MCDI_DECLARE_BUF(_name, _len) \
197195 efx_dword_t _name[DIV_ROUND_UP(_len, 4)]
198196 #define MCDI_DECLARE_BUF(_name, _len) \
....@@ -329,6 +327,17 @@
329327 #define MCDI_EVENT_FIELD(_ev, _field) \
330328 EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
331329
330
+#define MCDI_CAPABILITY(field) \
331
+ MC_CMD_GET_CAPABILITIES_V8_OUT_ ## field ## _LBN
332
+
333
+#define MCDI_CAPABILITY_OFST(field) \
334
+ MC_CMD_GET_CAPABILITIES_V8_OUT_ ## field ## _OFST
335
+
336
+#define efx_has_cap(efx, field) \
337
+ efx->type->check_caps(efx, \
338
+ MCDI_CAPABILITY(field), \
339
+ MCDI_CAPABILITY_OFST(field))
340
+
332341 void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
333342 int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,
334343 u16 *fw_subtype_list, u32 *capabilities);
....@@ -337,27 +346,20 @@
337346 int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
338347 size_t *size_out, size_t *erase_size_out,
339348 bool *protected_out);
349
+int efx_new_mcdi_nvram_test_all(struct efx_nic *efx);
340350 int efx_mcdi_nvram_test_all(struct efx_nic *efx);
341351 int efx_mcdi_handle_assertion(struct efx_nic *efx);
342
-void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
352
+int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
343353 int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
344354 int *id_out);
345355 int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
346356 int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
347357 int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
348358 int efx_mcdi_flush_rxqs(struct efx_nic *efx);
349
-int efx_mcdi_port_probe(struct efx_nic *efx);
350
-void efx_mcdi_port_remove(struct efx_nic *efx);
351
-int efx_mcdi_port_reconfigure(struct efx_nic *efx);
352
-int efx_mcdi_port_get_number(struct efx_nic *efx);
353
-u32 efx_mcdi_phy_get_caps(struct efx_nic *efx);
354359 void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
355
-int efx_mcdi_set_mac(struct efx_nic *efx);
356
-#define EFX_MC_STATS_GENERATION_INVALID ((__force __le64)(-1))
357360 void efx_mcdi_mac_start_stats(struct efx_nic *efx);
358361 void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
359362 void efx_mcdi_mac_pull_stats(struct efx_nic *efx);
360
-bool efx_mcdi_mac_check_fault(struct efx_nic *efx);
361363 enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
362364 int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
363365 int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled,