diff options
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi.h')
| -rw-r--r-- | drivers/net/ethernet/sfc/mcdi.h | 120 |
1 files changed, 58 insertions, 62 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h index c34d0d4e10ee..656a3277c2b2 100644 --- a/drivers/net/ethernet/sfc/mcdi.h +++ b/drivers/net/ethernet/sfc/mcdi.h | |||
| @@ -108,38 +108,35 @@ static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx) | |||
| 108 | } | 108 | } |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | extern int efx_mcdi_init(struct efx_nic *efx); | 111 | int efx_mcdi_init(struct efx_nic *efx); |
| 112 | extern void efx_mcdi_fini(struct efx_nic *efx); | 112 | void efx_mcdi_fini(struct efx_nic *efx); |
| 113 | 113 | ||
| 114 | extern int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, | 114 | int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf, |
| 115 | const efx_dword_t *inbuf, size_t inlen, | 115 | size_t inlen, efx_dword_t *outbuf, size_t outlen, |
| 116 | size_t *outlen_actual); | ||
| 117 | |||
| 118 | int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, | ||
| 119 | const efx_dword_t *inbuf, size_t inlen); | ||
| 120 | int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, | ||
| 116 | efx_dword_t *outbuf, size_t outlen, | 121 | efx_dword_t *outbuf, size_t outlen, |
| 117 | size_t *outlen_actual); | 122 | size_t *outlen_actual); |
| 118 | 123 | ||
| 119 | extern int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, | ||
| 120 | const efx_dword_t *inbuf, size_t inlen); | ||
| 121 | extern int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, | ||
| 122 | efx_dword_t *outbuf, size_t outlen, | ||
| 123 | size_t *outlen_actual); | ||
| 124 | |||
| 125 | typedef void efx_mcdi_async_completer(struct efx_nic *efx, | 124 | typedef void efx_mcdi_async_completer(struct efx_nic *efx, |
| 126 | unsigned long cookie, int rc, | 125 | unsigned long cookie, int rc, |
| 127 | efx_dword_t *outbuf, | 126 | efx_dword_t *outbuf, |
| 128 | size_t outlen_actual); | 127 | size_t outlen_actual); |
| 129 | extern int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, | 128 | int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, |
| 130 | const efx_dword_t *inbuf, size_t inlen, | 129 | const efx_dword_t *inbuf, size_t inlen, size_t outlen, |
| 131 | size_t outlen, | 130 | efx_mcdi_async_completer *complete, |
| 132 | efx_mcdi_async_completer *complete, | 131 | unsigned long cookie); |
| 133 | unsigned long cookie); | ||
| 134 | 132 | ||
| 135 | extern int efx_mcdi_poll_reboot(struct efx_nic *efx); | 133 | int efx_mcdi_poll_reboot(struct efx_nic *efx); |
| 136 | extern void efx_mcdi_mode_poll(struct efx_nic *efx); | 134 | void efx_mcdi_mode_poll(struct efx_nic *efx); |
| 137 | extern void efx_mcdi_mode_event(struct efx_nic *efx); | 135 | void efx_mcdi_mode_event(struct efx_nic *efx); |
| 138 | extern void efx_mcdi_flush_async(struct efx_nic *efx); | 136 | void efx_mcdi_flush_async(struct efx_nic *efx); |
| 139 | 137 | ||
| 140 | extern void efx_mcdi_process_event(struct efx_channel *channel, | 138 | void efx_mcdi_process_event(struct efx_channel *channel, efx_qword_t *event); |
| 141 | efx_qword_t *event); | 139 | void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); |
| 142 | extern void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); | ||
| 143 | 140 | ||
| 144 | /* We expect that 16- and 32-bit fields in MCDI requests and responses | 141 | /* We expect that 16- and 32-bit fields in MCDI requests and responses |
| 145 | * are appropriately aligned, but 64-bit fields are only | 142 | * 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 | #define MCDI_EVENT_FIELD(_ev, _field) \ | 272 | #define MCDI_EVENT_FIELD(_ev, _field) \ |
| 276 | EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) | 273 | EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) |
| 277 | 274 | ||
| 278 | extern void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); | 275 | void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); |
| 279 | extern int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, | 276 | int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, |
| 280 | u16 *fw_subtype_list, u32 *capabilities); | 277 | u16 *fw_subtype_list, u32 *capabilities); |
| 281 | extern int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, | 278 | int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq); |
| 282 | u32 dest_evq); | 279 | int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out); |
| 283 | extern int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out); | 280 | int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, |
| 284 | extern int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, | 281 | size_t *size_out, size_t *erase_size_out, |
| 285 | size_t *size_out, size_t *erase_size_out, | 282 | bool *protected_out); |
| 286 | bool *protected_out); | 283 | int efx_mcdi_nvram_test_all(struct efx_nic *efx); |
| 287 | extern int efx_mcdi_nvram_test_all(struct efx_nic *efx); | 284 | int efx_mcdi_handle_assertion(struct efx_nic *efx); |
| 288 | extern int efx_mcdi_handle_assertion(struct efx_nic *efx); | 285 | void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); |
| 289 | extern void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); | 286 | int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac, |
| 290 | extern int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, | 287 | int *id_out); |
| 291 | const u8 *mac, int *id_out); | 288 | int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); |
| 292 | extern int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); | 289 | int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id); |
| 293 | extern int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id); | 290 | int efx_mcdi_wol_filter_reset(struct efx_nic *efx); |
| 294 | extern int efx_mcdi_wol_filter_reset(struct efx_nic *efx); | 291 | int efx_mcdi_flush_rxqs(struct efx_nic *efx); |
| 295 | extern int efx_mcdi_flush_rxqs(struct efx_nic *efx); | 292 | int efx_mcdi_port_probe(struct efx_nic *efx); |
| 296 | extern int efx_mcdi_port_probe(struct efx_nic *efx); | 293 | void efx_mcdi_port_remove(struct efx_nic *efx); |
| 297 | extern void efx_mcdi_port_remove(struct efx_nic *efx); | 294 | int efx_mcdi_port_reconfigure(struct efx_nic *efx); |
| 298 | extern int efx_mcdi_port_reconfigure(struct efx_nic *efx); | 295 | int efx_mcdi_port_get_number(struct efx_nic *efx); |
| 299 | extern int efx_mcdi_port_get_number(struct efx_nic *efx); | 296 | u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); |
| 300 | extern u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); | 297 | void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev); |
| 301 | extern void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev); | 298 | int efx_mcdi_set_mac(struct efx_nic *efx); |
| 302 | extern int efx_mcdi_set_mac(struct efx_nic *efx); | ||
| 303 | #define EFX_MC_STATS_GENERATION_INVALID ((__force __le64)(-1)) | 299 | #define EFX_MC_STATS_GENERATION_INVALID ((__force __le64)(-1)) |
| 304 | extern void efx_mcdi_mac_start_stats(struct efx_nic *efx); | 300 | void efx_mcdi_mac_start_stats(struct efx_nic *efx); |
| 305 | extern void efx_mcdi_mac_stop_stats(struct efx_nic *efx); | 301 | void efx_mcdi_mac_stop_stats(struct efx_nic *efx); |
| 306 | extern bool efx_mcdi_mac_check_fault(struct efx_nic *efx); | 302 | bool efx_mcdi_mac_check_fault(struct efx_nic *efx); |
| 307 | extern enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason); | 303 | enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason); |
| 308 | extern int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); | 304 | int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); |
| 309 | extern int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled); | 305 | int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled); |
| 310 | 306 | ||
| 311 | #ifdef CONFIG_SFC_MCDI_MON | 307 | #ifdef CONFIG_SFC_MCDI_MON |
| 312 | extern int efx_mcdi_mon_probe(struct efx_nic *efx); | 308 | int efx_mcdi_mon_probe(struct efx_nic *efx); |
| 313 | extern void efx_mcdi_mon_remove(struct efx_nic *efx); | 309 | void efx_mcdi_mon_remove(struct efx_nic *efx); |
| 314 | #else | 310 | #else |
| 315 | static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; } | 311 | static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; } |
| 316 | static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {} | 312 | static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {} |
| 317 | #endif | 313 | #endif |
| 318 | 314 | ||
| 319 | #ifdef CONFIG_SFC_MTD | 315 | #ifdef CONFIG_SFC_MTD |
| 320 | extern int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, | 316 | int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len, |
| 321 | size_t len, size_t *retlen, u8 *buffer); | 317 | size_t *retlen, u8 *buffer); |
| 322 | extern int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len); | 318 | int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len); |
| 323 | extern int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, | 319 | int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len, |
| 324 | size_t len, size_t *retlen, const u8 *buffer); | 320 | size_t *retlen, const u8 *buffer); |
| 325 | extern int efx_mcdi_mtd_sync(struct mtd_info *mtd); | 321 | int efx_mcdi_mtd_sync(struct mtd_info *mtd); |
| 326 | extern void efx_mcdi_mtd_rename(struct efx_mtd_partition *part); | 322 | void efx_mcdi_mtd_rename(struct efx_mtd_partition *part); |
| 327 | #endif | 323 | #endif |
| 328 | 324 | ||
| 329 | #endif /* EFX_MCDI_H */ | 325 | #endif /* EFX_MCDI_H */ |
