1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /****************************************************************************
3 * Driver for Solarflare network controllers and boards
4 * Copyright 2018 Solarflare Communications Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation, incorporated herein by reference.
14 int efx_init_io(struct efx_nic *efx, int bar, dma_addr_t dma_mask,
15 unsigned int mem_map_size);
16 void efx_fini_io(struct efx_nic *efx, int bar);
17 int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev,
18 struct net_device *net_dev);
19 void efx_fini_struct(struct efx_nic *efx);
21 void efx_start_all(struct efx_nic *efx);
22 void efx_stop_all(struct efx_nic *efx);
24 int efx_create_reset_workqueue(void);
25 void efx_queue_reset_work(struct efx_nic *efx);
26 void efx_flush_reset_workqueue(struct efx_nic *efx);
27 void efx_destroy_reset_workqueue(void);
29 void efx_start_monitor(struct efx_nic *efx);
31 int __efx_reconfigure_port(struct efx_nic *efx);
32 int efx_reconfigure_port(struct efx_nic *efx);
34 #define EFX_ASSERT_RESET_SERIALISED(efx) \
36 if ((efx->state == STATE_READY) || \
37 (efx->state == STATE_RECOVERY) || \
38 (efx->state == STATE_DISABLED)) \
42 int efx_try_recovery(struct efx_nic *efx);
43 void efx_reset_down(struct efx_nic *efx, enum reset_type method);
44 int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok);
45 int efx_reset(struct efx_nic *efx, enum reset_type method);
46 void efx_schedule_reset(struct efx_nic *efx, enum reset_type type);
48 static inline int efx_check_disabled(struct efx_nic *efx)
50 if (efx->state == STATE_DISABLED || efx->state == STATE_RECOVERY) {
51 netif_err(efx, drv, efx->net_dev,
52 "device is disabled due to earlier errors\n");
58 void efx_mac_reconfigure(struct efx_nic *efx);
59 void efx_link_status_changed(struct efx_nic *efx);