Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.15 116 lines 4.0 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/**************************************************************************** 3 * Driver for Solarflare network controllers and boards 4 * Copyright 2018 Solarflare Communications Inc. 5 * 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. 9 */ 10 11#ifndef EFX_COMMON_H 12#define EFX_COMMON_H 13 14int efx_init_io(struct efx_nic *efx, int bar, dma_addr_t dma_mask, 15 unsigned int mem_map_size); 16void efx_fini_io(struct efx_nic *efx); 17int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev); 18void efx_fini_struct(struct efx_nic *efx); 19 20#define EFX_MAX_DMAQ_SIZE 4096UL 21#define EFX_DEFAULT_DMAQ_SIZE 1024UL 22#define EFX_MIN_DMAQ_SIZE 512UL 23 24#define EFX_MAX_EVQ_SIZE 16384UL 25#define EFX_MIN_EVQ_SIZE 512UL 26 27void efx_link_clear_advertising(struct efx_nic *efx); 28void efx_link_set_wanted_fc(struct efx_nic *efx, u8); 29 30void efx_start_all(struct efx_nic *efx); 31void efx_stop_all(struct efx_nic *efx); 32 33void efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats); 34 35int efx_create_reset_workqueue(void); 36void efx_queue_reset_work(struct efx_nic *efx); 37void efx_flush_reset_workqueue(struct efx_nic *efx); 38void efx_destroy_reset_workqueue(void); 39 40void efx_start_monitor(struct efx_nic *efx); 41 42int __efx_reconfigure_port(struct efx_nic *efx); 43 44#define EFX_ASSERT_RESET_SERIALISED(efx) \ 45 do { \ 46 if ((efx)->state != STATE_UNINIT && \ 47 (efx)->state != STATE_PROBED) \ 48 ASSERT_RTNL(); \ 49 } while (0) 50 51int efx_try_recovery(struct efx_nic *efx); 52void efx_reset_down(struct efx_nic *efx, enum reset_type method); 53void efx_watchdog(struct net_device *net_dev, unsigned int txqueue); 54int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok); 55int efx_reset(struct efx_nic *efx, enum reset_type method); 56void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); 57 58/* Dummy PHY ops for PHY drivers */ 59int efx_port_dummy_op_int(struct efx_nic *efx); 60void efx_port_dummy_op_void(struct efx_nic *efx); 61 62static inline int efx_check_disabled(struct efx_nic *efx) 63{ 64 if (efx->state == STATE_DISABLED || efx_recovering(efx->state)) { 65 netif_err(efx, drv, efx->net_dev, 66 "device is disabled due to earlier errors\n"); 67 return -EIO; 68 } 69 return 0; 70} 71 72static inline void efx_schedule_channel(struct efx_channel *channel) 73{ 74 netif_vdbg(channel->efx, intr, channel->efx->net_dev, 75 "channel %d scheduling NAPI poll on CPU%d\n", 76 channel->channel, raw_smp_processor_id()); 77 78 napi_schedule(&channel->napi_str); 79} 80 81static inline void efx_schedule_channel_irq(struct efx_channel *channel) 82{ 83 channel->event_test_cpu = raw_smp_processor_id(); 84 efx_schedule_channel(channel); 85} 86 87#ifdef CONFIG_SFC_MCDI_LOGGING 88void efx_init_mcdi_logging(struct efx_nic *efx); 89void efx_fini_mcdi_logging(struct efx_nic *efx); 90#else 91static inline void efx_init_mcdi_logging(struct efx_nic *efx) {} 92static inline void efx_fini_mcdi_logging(struct efx_nic *efx) {} 93#endif 94 95void efx_mac_reconfigure(struct efx_nic *efx, bool mtu_only); 96int efx_set_mac_address(struct net_device *net_dev, void *data); 97void efx_set_rx_mode(struct net_device *net_dev); 98int efx_set_features(struct net_device *net_dev, netdev_features_t data); 99void efx_link_status_changed(struct efx_nic *efx); 100unsigned int efx_xdp_max_mtu(struct efx_nic *efx); 101int efx_change_mtu(struct net_device *net_dev, int new_mtu); 102 103extern const struct pci_error_handlers efx_err_handlers; 104 105netdev_features_t efx_features_check(struct sk_buff *skb, struct net_device *dev, 106 netdev_features_t features); 107 108int efx_get_phys_port_id(struct net_device *net_dev, 109 struct netdev_phys_item_id *ppid); 110 111int efx_get_phys_port_name(struct net_device *net_dev, 112 char *name, size_t len); 113 114void efx_detach_reps(struct efx_nic *efx); 115void efx_attach_reps(struct efx_nic *efx); 116#endif