提交 00aef986 编写于 作者: J Joe Perches

sfc: Remove extern from function prototypes

There are a mix of function prototypes with and without extern
in the kernel sources.  Standardize on not using extern for
function prototypes.

Function prototypes don't need to be written with extern.
extern is assumed by the compiler.  Its use is as unnecessary as
using auto to declare automatic/local variables in a block.
Signed-off-by: NJoe Perches <joe@perches.com>
上级 8a1a0ae1
...@@ -18,38 +18,36 @@ ...@@ -18,38 +18,36 @@
#define EFX_MEM_BAR 2 #define EFX_MEM_BAR 2
/* TX */ /* TX */
extern int efx_probe_tx_queue(struct efx_tx_queue *tx_queue); int efx_probe_tx_queue(struct efx_tx_queue *tx_queue);
extern void efx_remove_tx_queue(struct efx_tx_queue *tx_queue); void efx_remove_tx_queue(struct efx_tx_queue *tx_queue);
extern void efx_init_tx_queue(struct efx_tx_queue *tx_queue); void efx_init_tx_queue(struct efx_tx_queue *tx_queue);
extern void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue); void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue);
extern void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); void efx_fini_tx_queue(struct efx_tx_queue *tx_queue);
extern netdev_tx_t netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb,
efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev); struct net_device *net_dev);
extern netdev_tx_t netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb); void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
extern void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index); int efx_setup_tc(struct net_device *net_dev, u8 num_tc);
extern int efx_setup_tc(struct net_device *net_dev, u8 num_tc); unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);
extern unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);
extern unsigned int efx_piobuf_size; extern unsigned int efx_piobuf_size;
/* RX */ /* RX */
extern void efx_rx_config_page_split(struct efx_nic *efx); void efx_rx_config_page_split(struct efx_nic *efx);
extern int efx_probe_rx_queue(struct efx_rx_queue *rx_queue); int efx_probe_rx_queue(struct efx_rx_queue *rx_queue);
extern void efx_remove_rx_queue(struct efx_rx_queue *rx_queue); void efx_remove_rx_queue(struct efx_rx_queue *rx_queue);
extern void efx_init_rx_queue(struct efx_rx_queue *rx_queue); void efx_init_rx_queue(struct efx_rx_queue *rx_queue);
extern void efx_fini_rx_queue(struct efx_rx_queue *rx_queue); void efx_fini_rx_queue(struct efx_rx_queue *rx_queue);
extern void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue); void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue);
extern void efx_rx_slow_fill(unsigned long context); void efx_rx_slow_fill(unsigned long context);
extern void __efx_rx_packet(struct efx_channel *channel); void __efx_rx_packet(struct efx_channel *channel);
extern void efx_rx_packet(struct efx_rx_queue *rx_queue, void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
unsigned int index, unsigned int n_frags, unsigned int n_frags, unsigned int len, u16 flags);
unsigned int len, u16 flags);
static inline void efx_rx_flush_packet(struct efx_channel *channel) static inline void efx_rx_flush_packet(struct efx_channel *channel)
{ {
if (channel->rx_pkt_n_frags) if (channel->rx_pkt_n_frags)
__efx_rx_packet(channel); __efx_rx_packet(channel);
} }
extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue); void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue);
#define EFX_MAX_DMAQ_SIZE 4096UL #define EFX_MAX_DMAQ_SIZE 4096UL
#define EFX_DEFAULT_DMAQ_SIZE 1024UL #define EFX_DEFAULT_DMAQ_SIZE 1024UL
...@@ -163,9 +161,9 @@ static inline s32 efx_filter_get_rx_ids(struct efx_nic *efx, ...@@ -163,9 +161,9 @@ static inline s32 efx_filter_get_rx_ids(struct efx_nic *efx,
return efx->type->filter_get_rx_ids(efx, priority, buf, size); return efx->type->filter_get_rx_ids(efx, priority, buf, size);
} }
#ifdef CONFIG_RFS_ACCEL #ifdef CONFIG_RFS_ACCEL
extern int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
u16 rxq_index, u32 flow_id); u16 rxq_index, u32 flow_id);
extern bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned quota); bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned quota);
static inline void efx_filter_rfs_expire(struct efx_channel *channel) static inline void efx_filter_rfs_expire(struct efx_channel *channel)
{ {
if (channel->rfs_filters_added >= 60 && if (channel->rfs_filters_added >= 60 &&
...@@ -177,50 +175,48 @@ static inline void efx_filter_rfs_expire(struct efx_channel *channel) ...@@ -177,50 +175,48 @@ static inline void efx_filter_rfs_expire(struct efx_channel *channel)
static inline void efx_filter_rfs_expire(struct efx_channel *channel) {} static inline void efx_filter_rfs_expire(struct efx_channel *channel) {}
#define efx_filter_rfs_enabled() 0 #define efx_filter_rfs_enabled() 0
#endif #endif
extern bool efx_filter_is_mc_recipient(const struct efx_filter_spec *spec); bool efx_filter_is_mc_recipient(const struct efx_filter_spec *spec);
/* Channels */ /* Channels */
extern int efx_channel_dummy_op_int(struct efx_channel *channel); int efx_channel_dummy_op_int(struct efx_channel *channel);
extern void efx_channel_dummy_op_void(struct efx_channel *channel); void efx_channel_dummy_op_void(struct efx_channel *channel);
extern int int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries);
efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries);
/* Ports */ /* Ports */
extern int efx_reconfigure_port(struct efx_nic *efx); int efx_reconfigure_port(struct efx_nic *efx);
extern int __efx_reconfigure_port(struct efx_nic *efx); int __efx_reconfigure_port(struct efx_nic *efx);
/* Ethtool support */ /* Ethtool support */
extern const struct ethtool_ops efx_ethtool_ops; extern const struct ethtool_ops efx_ethtool_ops;
/* Reset handling */ /* Reset handling */
extern int efx_reset(struct efx_nic *efx, enum reset_type method); int efx_reset(struct efx_nic *efx, enum reset_type method);
extern void efx_reset_down(struct efx_nic *efx, enum reset_type method); void efx_reset_down(struct efx_nic *efx, enum reset_type method);
extern int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok); int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok);
extern int efx_try_recovery(struct efx_nic *efx); int efx_try_recovery(struct efx_nic *efx);
/* Global */ /* Global */
extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); void efx_schedule_reset(struct efx_nic *efx, enum reset_type type);
extern int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs, int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
unsigned int rx_usecs, bool rx_adaptive, unsigned int rx_usecs, bool rx_adaptive,
bool rx_may_override_tx); bool rx_may_override_tx);
extern void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs, void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
unsigned int *rx_usecs, bool *rx_adaptive); unsigned int *rx_usecs, bool *rx_adaptive);
/* Dummy PHY ops for PHY drivers */ /* Dummy PHY ops for PHY drivers */
extern int efx_port_dummy_op_int(struct efx_nic *efx); int efx_port_dummy_op_int(struct efx_nic *efx);
extern void efx_port_dummy_op_void(struct efx_nic *efx); void efx_port_dummy_op_void(struct efx_nic *efx);
/* MTD */ /* MTD */
#ifdef CONFIG_SFC_MTD #ifdef CONFIG_SFC_MTD
extern int efx_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts, int efx_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts,
size_t n_parts, size_t sizeof_part); size_t n_parts, size_t sizeof_part);
static inline int efx_mtd_probe(struct efx_nic *efx) static inline int efx_mtd_probe(struct efx_nic *efx)
{ {
return efx->type->mtd_probe(efx); return efx->type->mtd_probe(efx);
} }
extern void efx_mtd_rename(struct efx_nic *efx); void efx_mtd_rename(struct efx_nic *efx);
extern void efx_mtd_remove(struct efx_nic *efx); void efx_mtd_remove(struct efx_nic *efx);
#else #else
static inline int efx_mtd_probe(struct efx_nic *efx) { return 0; } static inline int efx_mtd_probe(struct efx_nic *efx) { return 0; }
static inline void efx_mtd_rename(struct efx_nic *efx) {} static inline void efx_mtd_rename(struct efx_nic *efx) {}
...@@ -242,9 +238,9 @@ static inline void efx_schedule_channel_irq(struct efx_channel *channel) ...@@ -242,9 +238,9 @@ static inline void efx_schedule_channel_irq(struct efx_channel *channel)
efx_schedule_channel(channel); efx_schedule_channel(channel);
} }
extern void efx_link_status_changed(struct efx_nic *efx); void efx_link_status_changed(struct efx_nic *efx);
extern void efx_link_set_advertising(struct efx_nic *efx, u32); void efx_link_set_advertising(struct efx_nic *efx, u32);
extern void efx_link_set_wanted_fc(struct efx_nic *efx, u8); void efx_link_set_wanted_fc(struct efx_nic *efx, u8);
static inline void efx_device_detach_sync(struct efx_nic *efx) static inline void efx_device_detach_sync(struct efx_nic *efx)
{ {
......
...@@ -108,38 +108,35 @@ static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx) ...@@ -108,38 +108,35 @@ static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx)
} }
#endif #endif
extern int efx_mcdi_init(struct efx_nic *efx); int efx_mcdi_init(struct efx_nic *efx);
extern void efx_mcdi_fini(struct efx_nic *efx); void efx_mcdi_fini(struct efx_nic *efx);
extern int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf,
const efx_dword_t *inbuf, size_t inlen, size_t inlen, efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen);
int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
efx_dword_t *outbuf, size_t outlen, efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual); size_t *outlen_actual);
extern int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen);
extern int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
efx_dword_t *outbuf, size_t outlen,
size_t *outlen_actual);
typedef void efx_mcdi_async_completer(struct efx_nic *efx, typedef void efx_mcdi_async_completer(struct efx_nic *efx,
unsigned long cookie, int rc, unsigned long cookie, int rc,
efx_dword_t *outbuf, efx_dword_t *outbuf,
size_t outlen_actual); size_t outlen_actual);
extern int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
const efx_dword_t *inbuf, size_t inlen, const efx_dword_t *inbuf, size_t inlen, size_t outlen,
size_t outlen, efx_mcdi_async_completer *complete,
efx_mcdi_async_completer *complete, unsigned long cookie);
unsigned long cookie);
extern int efx_mcdi_poll_reboot(struct efx_nic *efx); int efx_mcdi_poll_reboot(struct efx_nic *efx);
extern void efx_mcdi_mode_poll(struct efx_nic *efx); void efx_mcdi_mode_poll(struct efx_nic *efx);
extern void efx_mcdi_mode_event(struct efx_nic *efx); void efx_mcdi_mode_event(struct efx_nic *efx);
extern void efx_mcdi_flush_async(struct efx_nic *efx); void efx_mcdi_flush_async(struct efx_nic *efx);
extern void efx_mcdi_process_event(struct efx_channel *channel, void efx_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event);
efx_qword_t *event); void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
extern void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
/* We expect that 16- and 32-bit fields in MCDI requests and responses /* We expect that 16- and 32-bit fields in MCDI requests and responses
* are appropriately aligned, but 64-bit fields are only * are appropriately aligned, but 64-bit fields are only
...@@ -275,55 +272,54 @@ extern void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); ...@@ -275,55 +272,54 @@ extern void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
#define MCDI_EVENT_FIELD(_ev, _field) \ #define MCDI_EVENT_FIELD(_ev, _field) \
EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
extern void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
extern int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address,
u16 *fw_subtype_list, u32 *capabilities); u16 *fw_subtype_list, u32 *capabilities);
extern int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq);
u32 dest_evq); int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out);
extern int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out); int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
extern int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, size_t *size_out, size_t *erase_size_out,
size_t *size_out, size_t *erase_size_out, bool *protected_out);
bool *protected_out); int efx_mcdi_nvram_test_all(struct efx_nic *efx);
extern int efx_mcdi_nvram_test_all(struct efx_nic *efx); int efx_mcdi_handle_assertion(struct efx_nic *efx);
extern int efx_mcdi_handle_assertion(struct efx_nic *efx); void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
extern void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
extern int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, int *id_out);
const u8 *mac, int *id_out); int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
extern int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
extern int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id); int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
extern int efx_mcdi_wol_filter_reset(struct efx_nic *efx); int efx_mcdi_flush_rxqs(struct efx_nic *efx);
extern int efx_mcdi_flush_rxqs(struct efx_nic *efx); int efx_mcdi_port_probe(struct efx_nic *efx);
extern int efx_mcdi_port_probe(struct efx_nic *efx); void efx_mcdi_port_remove(struct efx_nic *efx);
extern void efx_mcdi_port_remove(struct efx_nic *efx); int efx_mcdi_port_reconfigure(struct efx_nic *efx);
extern int efx_mcdi_port_reconfigure(struct efx_nic *efx); int efx_mcdi_port_get_number(struct efx_nic *efx);
extern int efx_mcdi_port_get_number(struct efx_nic *efx); u32 efx_mcdi_phy_get_caps(struct efx_nic *efx);
extern u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
extern void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev); int efx_mcdi_set_mac(struct efx_nic *efx);
extern int efx_mcdi_set_mac(struct efx_nic *efx);
#define EFX_MC_STATS_GENERATION_INVALID ((__force __le64)(-1)) #define EFX_MC_STATS_GENERATION_INVALID ((__force __le64)(-1))
extern void efx_mcdi_mac_start_stats(struct efx_nic *efx); void efx_mcdi_mac_start_stats(struct efx_nic *efx);
extern void efx_mcdi_mac_stop_stats(struct efx_nic *efx); void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
extern bool efx_mcdi_mac_check_fault(struct efx_nic *efx); bool efx_mcdi_mac_check_fault(struct efx_nic *efx);
extern enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason); enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
extern int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
extern int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled); int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled);
#ifdef CONFIG_SFC_MCDI_MON #ifdef CONFIG_SFC_MCDI_MON
extern int efx_mcdi_mon_probe(struct efx_nic *efx); int efx_mcdi_mon_probe(struct efx_nic *efx);
extern void efx_mcdi_mon_remove(struct efx_nic *efx); void efx_mcdi_mon_remove(struct efx_nic *efx);
#else #else
static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; } static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {} static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {}
#endif #endif
#ifdef CONFIG_SFC_MTD #ifdef CONFIG_SFC_MTD
extern int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
size_t len, size_t *retlen, u8 *buffer); size_t *retlen, u8 *buffer);
extern int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len); int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
extern int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
size_t len, size_t *retlen, const u8 *buffer); size_t *retlen, const u8 *buffer);
extern int efx_mcdi_mtd_sync(struct mtd_info *mtd); int efx_mcdi_mtd_sync(struct mtd_info *mtd);
extern void efx_mcdi_mtd_rename(struct efx_mtd_partition *part); void efx_mcdi_mtd_rename(struct efx_mtd_partition *part);
#endif #endif
#endif /* EFX_MCDI_H */ #endif /* EFX_MCDI_H */
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
static inline unsigned efx_mdio_id_rev(u32 id) { return id & 0xf; } static inline unsigned efx_mdio_id_rev(u32 id) { return id & 0xf; }
static inline unsigned efx_mdio_id_model(u32 id) { return (id >> 4) & 0x3f; } static inline unsigned efx_mdio_id_model(u32 id) { return (id >> 4) & 0x3f; }
extern unsigned efx_mdio_id_oui(u32 id); unsigned efx_mdio_id_oui(u32 id);
static inline int efx_mdio_read(struct efx_nic *efx, int devad, int addr) static inline int efx_mdio_read(struct efx_nic *efx, int devad, int addr)
{ {
...@@ -56,7 +56,7 @@ static inline bool efx_mdio_phyxgxs_lane_sync(struct efx_nic *efx) ...@@ -56,7 +56,7 @@ static inline bool efx_mdio_phyxgxs_lane_sync(struct efx_nic *efx)
return sync; return sync;
} }
extern const char *efx_mdio_mmd_name(int mmd); const char *efx_mdio_mmd_name(int mmd);
/* /*
* Reset a specific MMD and wait for reset to clear. * Reset a specific MMD and wait for reset to clear.
...@@ -64,30 +64,29 @@ extern const char *efx_mdio_mmd_name(int mmd); ...@@ -64,30 +64,29 @@ extern const char *efx_mdio_mmd_name(int mmd);
* *
* This function will sleep * This function will sleep
*/ */
extern int efx_mdio_reset_mmd(struct efx_nic *efx, int mmd, int efx_mdio_reset_mmd(struct efx_nic *efx, int mmd, int spins, int spintime);
int spins, int spintime);
/* As efx_mdio_check_mmd but for multiple MMDs */ /* As efx_mdio_check_mmd but for multiple MMDs */
int efx_mdio_check_mmds(struct efx_nic *efx, unsigned int mmd_mask); int efx_mdio_check_mmds(struct efx_nic *efx, unsigned int mmd_mask);
/* Check the link status of specified mmds in bit mask */ /* Check the link status of specified mmds in bit mask */
extern bool efx_mdio_links_ok(struct efx_nic *efx, unsigned int mmd_mask); bool efx_mdio_links_ok(struct efx_nic *efx, unsigned int mmd_mask);
/* Generic transmit disable support though PMAPMD */ /* Generic transmit disable support though PMAPMD */
extern void efx_mdio_transmit_disable(struct efx_nic *efx); void efx_mdio_transmit_disable(struct efx_nic *efx);
/* Generic part of reconfigure: set/clear loopback bits */ /* Generic part of reconfigure: set/clear loopback bits */
extern void efx_mdio_phy_reconfigure(struct efx_nic *efx); void efx_mdio_phy_reconfigure(struct efx_nic *efx);
/* Set the power state of the specified MMDs */ /* Set the power state of the specified MMDs */
extern void efx_mdio_set_mmds_lpower(struct efx_nic *efx, void efx_mdio_set_mmds_lpower(struct efx_nic *efx, int low_power,
int low_power, unsigned int mmd_mask); unsigned int mmd_mask);
/* Set (some of) the PHY settings over MDIO */ /* Set (some of) the PHY settings over MDIO */
extern int efx_mdio_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd); int efx_mdio_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd);
/* Push advertising flags and restart autonegotiation */ /* Push advertising flags and restart autonegotiation */
extern void efx_mdio_an_reconfigure(struct efx_nic *efx); void efx_mdio_an_reconfigure(struct efx_nic *efx);
/* Get pause parameters from AN if available (otherwise return /* Get pause parameters from AN if available (otherwise return
* requested pause parameters) * requested pause parameters)
...@@ -95,8 +94,7 @@ extern void efx_mdio_an_reconfigure(struct efx_nic *efx); ...@@ -95,8 +94,7 @@ extern void efx_mdio_an_reconfigure(struct efx_nic *efx);
u8 efx_mdio_get_pause(struct efx_nic *efx); u8 efx_mdio_get_pause(struct efx_nic *efx);
/* Wait for specified MMDs to exit reset within a timeout */ /* Wait for specified MMDs to exit reset within a timeout */
extern int efx_mdio_wait_reset_mmds(struct efx_nic *efx, int efx_mdio_wait_reset_mmds(struct efx_nic *efx, unsigned int mmd_mask);
unsigned int mmd_mask);
/* Set or clear flag, debouncing */ /* Set or clear flag, debouncing */
static inline void static inline void
...@@ -107,6 +105,6 @@ efx_mdio_set_flag(struct efx_nic *efx, int devad, int addr, ...@@ -107,6 +105,6 @@ efx_mdio_set_flag(struct efx_nic *efx, int devad, int addr,
} }
/* Liveness self-test for MDIO PHYs */ /* Liveness self-test for MDIO PHYs */
extern int efx_mdio_test_alive(struct efx_nic *efx); int efx_mdio_test_alive(struct efx_nic *efx);
#endif /* EFX_MDIO_10G_H */ #endif /* EFX_MDIO_10G_H */
...@@ -30,7 +30,7 @@ static inline int efx_nic_rev(struct efx_nic *efx) ...@@ -30,7 +30,7 @@ static inline int efx_nic_rev(struct efx_nic *efx)
return efx->type->revision; return efx->type->revision;
} }
extern u32 efx_farch_fpga_ver(struct efx_nic *efx); u32 efx_farch_fpga_ver(struct efx_nic *efx);
/* NIC has two interlinked PCI functions for the same port. */ /* NIC has two interlinked PCI functions for the same port. */
static inline bool efx_nic_is_dual_func(struct efx_nic *efx) static inline bool efx_nic_is_dual_func(struct efx_nic *efx)
...@@ -497,18 +497,18 @@ static inline unsigned int efx_vf_size(struct efx_nic *efx) ...@@ -497,18 +497,18 @@ static inline unsigned int efx_vf_size(struct efx_nic *efx)
return 1 << efx->vi_scale; return 1 << efx->vi_scale;
} }
extern int efx_init_sriov(void); int efx_init_sriov(void);
extern void efx_sriov_probe(struct efx_nic *efx); void efx_sriov_probe(struct efx_nic *efx);
extern int efx_sriov_init(struct efx_nic *efx); int efx_sriov_init(struct efx_nic *efx);
extern void efx_sriov_mac_address_changed(struct efx_nic *efx); void efx_sriov_mac_address_changed(struct efx_nic *efx);
extern void efx_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event); void efx_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event);
extern void efx_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event); void efx_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event);
extern void efx_sriov_event(struct efx_channel *channel, efx_qword_t *event); void efx_sriov_event(struct efx_channel *channel, efx_qword_t *event);
extern void efx_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq); void efx_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq);
extern void efx_sriov_flr(struct efx_nic *efx, unsigned flr); void efx_sriov_flr(struct efx_nic *efx, unsigned flr);
extern void efx_sriov_reset(struct efx_nic *efx); void efx_sriov_reset(struct efx_nic *efx);
extern void efx_sriov_fini(struct efx_nic *efx); void efx_sriov_fini(struct efx_nic *efx);
extern void efx_fini_sriov(void); void efx_fini_sriov(void);
#else #else
...@@ -534,22 +534,20 @@ static inline void efx_fini_sriov(void) {} ...@@ -534,22 +534,20 @@ static inline void efx_fini_sriov(void) {}
#endif #endif
extern int efx_sriov_set_vf_mac(struct net_device *dev, int vf, u8 *mac); int efx_sriov_set_vf_mac(struct net_device *dev, int vf, u8 *mac);
extern int efx_sriov_set_vf_vlan(struct net_device *dev, int vf, int efx_sriov_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos);
u16 vlan, u8 qos); int efx_sriov_get_vf_config(struct net_device *dev, int vf,
extern int efx_sriov_get_vf_config(struct net_device *dev, int vf, struct ifla_vf_info *ivf);
struct ifla_vf_info *ivf); int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf,
extern int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf, bool spoofchk);
bool spoofchk);
struct ethtool_ts_info; struct ethtool_ts_info;
extern void efx_ptp_probe(struct efx_nic *efx); void efx_ptp_probe(struct efx_nic *efx);
extern int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd); int efx_ptp_ioctl(struct efx_nic *efx, struct ifreq *ifr, int cmd);
extern void efx_ptp_get_ts_info(struct efx_nic *efx, void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info);
struct ethtool_ts_info *ts_info); bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
extern bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
extern int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
extern void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
extern const struct efx_nic_type falcon_a1_nic_type; extern const struct efx_nic_type falcon_a1_nic_type;
extern const struct efx_nic_type falcon_b0_nic_type; extern const struct efx_nic_type falcon_b0_nic_type;
...@@ -563,7 +561,7 @@ extern const struct efx_nic_type efx_hunt_a0_nic_type; ...@@ -563,7 +561,7 @@ extern const struct efx_nic_type efx_hunt_a0_nic_type;
************************************************************************** **************************************************************************
*/ */
extern int falcon_probe_board(struct efx_nic *efx, u16 revision_info); int falcon_probe_board(struct efx_nic *efx, u16 revision_info);
/* TX data path */ /* TX data path */
static inline int efx_nic_probe_tx(struct efx_tx_queue *tx_queue) static inline int efx_nic_probe_tx(struct efx_tx_queue *tx_queue)
...@@ -631,58 +629,58 @@ static inline void efx_nic_eventq_read_ack(struct efx_channel *channel) ...@@ -631,58 +629,58 @@ static inline void efx_nic_eventq_read_ack(struct efx_channel *channel)
{ {
channel->efx->type->ev_read_ack(channel); channel->efx->type->ev_read_ack(channel);
} }
extern void efx_nic_event_test_start(struct efx_channel *channel); void efx_nic_event_test_start(struct efx_channel *channel);
/* Falcon/Siena queue operations */ /* Falcon/Siena queue operations */
extern int efx_farch_tx_probe(struct efx_tx_queue *tx_queue); int efx_farch_tx_probe(struct efx_tx_queue *tx_queue);
extern void efx_farch_tx_init(struct efx_tx_queue *tx_queue); void efx_farch_tx_init(struct efx_tx_queue *tx_queue);
extern void efx_farch_tx_fini(struct efx_tx_queue *tx_queue); void efx_farch_tx_fini(struct efx_tx_queue *tx_queue);
extern void efx_farch_tx_remove(struct efx_tx_queue *tx_queue); void efx_farch_tx_remove(struct efx_tx_queue *tx_queue);
extern void efx_farch_tx_write(struct efx_tx_queue *tx_queue); void efx_farch_tx_write(struct efx_tx_queue *tx_queue);
extern int efx_farch_rx_probe(struct efx_rx_queue *rx_queue); int efx_farch_rx_probe(struct efx_rx_queue *rx_queue);
extern void efx_farch_rx_init(struct efx_rx_queue *rx_queue); void efx_farch_rx_init(struct efx_rx_queue *rx_queue);
extern void efx_farch_rx_fini(struct efx_rx_queue *rx_queue); void efx_farch_rx_fini(struct efx_rx_queue *rx_queue);
extern void efx_farch_rx_remove(struct efx_rx_queue *rx_queue); void efx_farch_rx_remove(struct efx_rx_queue *rx_queue);
extern void efx_farch_rx_write(struct efx_rx_queue *rx_queue); void efx_farch_rx_write(struct efx_rx_queue *rx_queue);
extern void efx_farch_rx_defer_refill(struct efx_rx_queue *rx_queue); void efx_farch_rx_defer_refill(struct efx_rx_queue *rx_queue);
extern int efx_farch_ev_probe(struct efx_channel *channel); int efx_farch_ev_probe(struct efx_channel *channel);
extern int efx_farch_ev_init(struct efx_channel *channel); int efx_farch_ev_init(struct efx_channel *channel);
extern void efx_farch_ev_fini(struct efx_channel *channel); void efx_farch_ev_fini(struct efx_channel *channel);
extern void efx_farch_ev_remove(struct efx_channel *channel); void efx_farch_ev_remove(struct efx_channel *channel);
extern int efx_farch_ev_process(struct efx_channel *channel, int quota); int efx_farch_ev_process(struct efx_channel *channel, int quota);
extern void efx_farch_ev_read_ack(struct efx_channel *channel); void efx_farch_ev_read_ack(struct efx_channel *channel);
extern void efx_farch_ev_test_generate(struct efx_channel *channel); void efx_farch_ev_test_generate(struct efx_channel *channel);
/* Falcon/Siena filter operations */ /* Falcon/Siena filter operations */
extern int efx_farch_filter_table_probe(struct efx_nic *efx); int efx_farch_filter_table_probe(struct efx_nic *efx);
extern void efx_farch_filter_table_restore(struct efx_nic *efx); void efx_farch_filter_table_restore(struct efx_nic *efx);
extern void efx_farch_filter_table_remove(struct efx_nic *efx); void efx_farch_filter_table_remove(struct efx_nic *efx);
extern void efx_farch_filter_update_rx_scatter(struct efx_nic *efx); void efx_farch_filter_update_rx_scatter(struct efx_nic *efx);
extern s32 efx_farch_filter_insert(struct efx_nic *efx, s32 efx_farch_filter_insert(struct efx_nic *efx, struct efx_filter_spec *spec,
struct efx_filter_spec *spec, bool replace); bool replace);
extern int efx_farch_filter_remove_safe(struct efx_nic *efx, int efx_farch_filter_remove_safe(struct efx_nic *efx,
enum efx_filter_priority priority, enum efx_filter_priority priority,
u32 filter_id); u32 filter_id);
extern int efx_farch_filter_get_safe(struct efx_nic *efx, int efx_farch_filter_get_safe(struct efx_nic *efx,
enum efx_filter_priority priority, enum efx_filter_priority priority, u32 filter_id,
u32 filter_id, struct efx_filter_spec *); struct efx_filter_spec *);
extern void efx_farch_filter_clear_rx(struct efx_nic *efx, void efx_farch_filter_clear_rx(struct efx_nic *efx,
enum efx_filter_priority priority); enum efx_filter_priority priority);
extern u32 efx_farch_filter_count_rx_used(struct efx_nic *efx, u32 efx_farch_filter_count_rx_used(struct efx_nic *efx,
enum efx_filter_priority priority); enum efx_filter_priority priority);
extern u32 efx_farch_filter_get_rx_id_limit(struct efx_nic *efx); u32 efx_farch_filter_get_rx_id_limit(struct efx_nic *efx);
extern s32 efx_farch_filter_get_rx_ids(struct efx_nic *efx, s32 efx_farch_filter_get_rx_ids(struct efx_nic *efx,
enum efx_filter_priority priority, enum efx_filter_priority priority, u32 *buf,
u32 *buf, u32 size); u32 size);
#ifdef CONFIG_RFS_ACCEL #ifdef CONFIG_RFS_ACCEL
extern s32 efx_farch_filter_rfs_insert(struct efx_nic *efx, s32 efx_farch_filter_rfs_insert(struct efx_nic *efx,
struct efx_filter_spec *spec); struct efx_filter_spec *spec);
extern bool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id, bool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id,
unsigned int index); unsigned int index);
#endif #endif
extern void efx_farch_filter_sync_rx_mode(struct efx_nic *efx); void efx_farch_filter_sync_rx_mode(struct efx_nic *efx);
extern bool efx_nic_event_present(struct efx_channel *channel); bool efx_nic_event_present(struct efx_channel *channel);
/* Some statistics are computed as A - B where A and B each increase /* Some statistics are computed as A - B where A and B each increase
* linearly with some hardware counter(s) and the counters are read * linearly with some hardware counter(s) and the counters are read
...@@ -703,17 +701,17 @@ static inline void efx_update_diff_stat(u64 *stat, u64 diff) ...@@ -703,17 +701,17 @@ static inline void efx_update_diff_stat(u64 *stat, u64 diff)
} }
/* Interrupts */ /* Interrupts */
extern int efx_nic_init_interrupt(struct efx_nic *efx); int efx_nic_init_interrupt(struct efx_nic *efx);
extern void efx_nic_irq_test_start(struct efx_nic *efx); void efx_nic_irq_test_start(struct efx_nic *efx);
extern void efx_nic_fini_interrupt(struct efx_nic *efx); void efx_nic_fini_interrupt(struct efx_nic *efx);
/* Falcon/Siena interrupts */ /* Falcon/Siena interrupts */
extern void efx_farch_irq_enable_master(struct efx_nic *efx); void efx_farch_irq_enable_master(struct efx_nic *efx);
extern void efx_farch_irq_test_generate(struct efx_nic *efx); void efx_farch_irq_test_generate(struct efx_nic *efx);
extern void efx_farch_irq_disable_master(struct efx_nic *efx); void efx_farch_irq_disable_master(struct efx_nic *efx);
extern irqreturn_t efx_farch_msi_interrupt(int irq, void *dev_id); irqreturn_t efx_farch_msi_interrupt(int irq, void *dev_id);
extern irqreturn_t efx_farch_legacy_interrupt(int irq, void *dev_id); irqreturn_t efx_farch_legacy_interrupt(int irq, void *dev_id);
extern irqreturn_t efx_farch_fatal_interrupt(struct efx_nic *efx); irqreturn_t efx_farch_fatal_interrupt(struct efx_nic *efx);
static inline int efx_nic_event_test_irq_cpu(struct efx_channel *channel) static inline int efx_nic_event_test_irq_cpu(struct efx_channel *channel)
{ {
...@@ -725,21 +723,21 @@ static inline int efx_nic_irq_test_irq_cpu(struct efx_nic *efx) ...@@ -725,21 +723,21 @@ static inline int efx_nic_irq_test_irq_cpu(struct efx_nic *efx)
} }
/* Global Resources */ /* Global Resources */
extern int efx_nic_flush_queues(struct efx_nic *efx); int efx_nic_flush_queues(struct efx_nic *efx);
extern void siena_prepare_flush(struct efx_nic *efx); void siena_prepare_flush(struct efx_nic *efx);
extern int efx_farch_fini_dmaq(struct efx_nic *efx); int efx_farch_fini_dmaq(struct efx_nic *efx);
extern void siena_finish_flush(struct efx_nic *efx); void siena_finish_flush(struct efx_nic *efx);
extern void falcon_start_nic_stats(struct efx_nic *efx); void falcon_start_nic_stats(struct efx_nic *efx);
extern void falcon_stop_nic_stats(struct efx_nic *efx); void falcon_stop_nic_stats(struct efx_nic *efx);
extern int falcon_reset_xaui(struct efx_nic *efx); int falcon_reset_xaui(struct efx_nic *efx);
extern void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw); void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw);
extern void efx_farch_init_common(struct efx_nic *efx); void efx_farch_init_common(struct efx_nic *efx);
extern void efx_ef10_handle_drain_event(struct efx_nic *efx); void efx_ef10_handle_drain_event(struct efx_nic *efx);
static inline void efx_nic_push_rx_indir_table(struct efx_nic *efx) static inline void efx_nic_push_rx_indir_table(struct efx_nic *efx)
{ {
efx->type->rx_push_indir_table(efx); efx->type->rx_push_indir_table(efx);
} }
extern void efx_farch_rx_push_indir_table(struct efx_nic *efx); void efx_farch_rx_push_indir_table(struct efx_nic *efx);
int efx_nic_alloc_buffer(struct efx_nic *efx, struct efx_buffer *buffer, int efx_nic_alloc_buffer(struct efx_nic *efx, struct efx_buffer *buffer,
unsigned int len, gfp_t gfp_flags); unsigned int len, gfp_t gfp_flags);
...@@ -750,24 +748,22 @@ struct efx_farch_register_test { ...@@ -750,24 +748,22 @@ struct efx_farch_register_test {
unsigned address; unsigned address;
efx_oword_t mask; efx_oword_t mask;
}; };
extern int efx_farch_test_registers(struct efx_nic *efx, int efx_farch_test_registers(struct efx_nic *efx,
const struct efx_farch_register_test *regs, const struct efx_farch_register_test *regs,
size_t n_regs); size_t n_regs);
extern size_t efx_nic_get_regs_len(struct efx_nic *efx); size_t efx_nic_get_regs_len(struct efx_nic *efx);
extern void efx_nic_get_regs(struct efx_nic *efx, void *buf); void efx_nic_get_regs(struct efx_nic *efx, void *buf);
extern size_t size_t efx_nic_describe_stats(const struct efx_hw_stat_desc *desc, size_t count,
efx_nic_describe_stats(const struct efx_hw_stat_desc *desc, size_t count, const unsigned long *mask, u8 *names);
const unsigned long *mask, u8 *names); void efx_nic_update_stats(const struct efx_hw_stat_desc *desc, size_t count,
extern void const unsigned long *mask, u64 *stats,
efx_nic_update_stats(const struct efx_hw_stat_desc *desc, size_t count, const void *dma_buf, bool accumulate);
const unsigned long *mask,
u64 *stats, const void *dma_buf, bool accumulate);
#define EFX_MAX_FLUSH_TIME 5000 #define EFX_MAX_FLUSH_TIME 5000
extern void efx_farch_generate_event(struct efx_nic *efx, unsigned int evq, void efx_farch_generate_event(struct efx_nic *efx, unsigned int evq,
efx_qword_t *event); efx_qword_t *event);
#endif /* EFX_NIC_H */ #endif /* EFX_NIC_H */
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
extern const struct efx_phy_operations falcon_sfx7101_phy_ops; extern const struct efx_phy_operations falcon_sfx7101_phy_ops;
extern void tenxpress_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); void tenxpress_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
/**************************************************************************** /****************************************************************************
* AMCC/Quake QT202x PHYs * AMCC/Quake QT202x PHYs
...@@ -34,7 +34,7 @@ extern const struct efx_phy_operations falcon_qt202x_phy_ops; ...@@ -34,7 +34,7 @@ extern const struct efx_phy_operations falcon_qt202x_phy_ops;
#define QUAKE_LED_TXLINK (0) #define QUAKE_LED_TXLINK (0)
#define QUAKE_LED_RXLINK (8) #define QUAKE_LED_RXLINK (8)
extern void falcon_qt202x_set_led(struct efx_nic *p, int led, int state); void falcon_qt202x_set_led(struct efx_nic *p, int led, int state);
/**************************************************************************** /****************************************************************************
* Transwitch CX4 retimer * Transwitch CX4 retimer
...@@ -44,7 +44,7 @@ extern const struct efx_phy_operations falcon_txc_phy_ops; ...@@ -44,7 +44,7 @@ extern const struct efx_phy_operations falcon_txc_phy_ops;
#define TXC_GPIO_DIR_INPUT 0 #define TXC_GPIO_DIR_INPUT 0
#define TXC_GPIO_DIR_OUTPUT 1 #define TXC_GPIO_DIR_OUTPUT 1
extern void falcon_txc_set_gpio_dir(struct efx_nic *efx, int pin, int dir); void falcon_txc_set_gpio_dir(struct efx_nic *efx, int pin, int dir);
extern void falcon_txc_set_gpio_val(struct efx_nic *efx, int pin, int val); void falcon_txc_set_gpio_val(struct efx_nic *efx, int pin, int val);
#endif #endif
...@@ -43,13 +43,12 @@ struct efx_self_tests { ...@@ -43,13 +43,12 @@ struct efx_self_tests {
struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1]; struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
}; };
extern void efx_loopback_rx_packet(struct efx_nic *efx, void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
const char *buf_ptr, int pkt_len); int pkt_len);
extern int efx_selftest(struct efx_nic *efx, int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
struct efx_self_tests *tests, unsigned flags);
unsigned flags); void efx_selftest_async_start(struct efx_nic *efx);
extern void efx_selftest_async_start(struct efx_nic *efx); void efx_selftest_async_cancel(struct efx_nic *efx);
extern void efx_selftest_async_cancel(struct efx_nic *efx); void efx_selftest_async_work(struct work_struct *data);
extern void efx_selftest_async_work(struct work_struct *data);
#endif /* EFX_SELFTEST_H */ #endif /* EFX_SELFTEST_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册