| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * QLogic Fibre Channel HBA Driver |
|---|
| 3 | 4 | * Copyright (c) 2003-2014 QLogic Corporation |
|---|
| 4 | | - * |
|---|
| 5 | | - * See LICENSE.qla2xxx for copyright and licensing details. |
|---|
| 6 | 5 | */ |
|---|
| 7 | 6 | #ifndef __QLA_GBL_H |
|---|
| 8 | 7 | #define __QLA_GBL_H |
|---|
| .. | .. |
|---|
| 18 | 17 | extern int qla2300_pci_config(struct scsi_qla_host *); |
|---|
| 19 | 18 | extern int qla24xx_pci_config(scsi_qla_host_t *); |
|---|
| 20 | 19 | extern int qla25xx_pci_config(scsi_qla_host_t *); |
|---|
| 21 | | -extern void qla2x00_reset_chip(struct scsi_qla_host *); |
|---|
| 22 | | -extern void qla24xx_reset_chip(struct scsi_qla_host *); |
|---|
| 20 | +extern int qla2x00_reset_chip(struct scsi_qla_host *); |
|---|
| 21 | +extern int qla24xx_reset_chip(struct scsi_qla_host *); |
|---|
| 23 | 22 | extern int qla2x00_chip_diag(struct scsi_qla_host *); |
|---|
| 24 | 23 | extern int qla24xx_chip_diag(struct scsi_qla_host *); |
|---|
| 25 | 24 | extern void qla2x00_config_rings(struct scsi_qla_host *); |
|---|
| 26 | 25 | extern void qla24xx_config_rings(struct scsi_qla_host *); |
|---|
| 27 | | -extern void qla2x00_reset_adapter(struct scsi_qla_host *); |
|---|
| 28 | | -extern void qla24xx_reset_adapter(struct scsi_qla_host *); |
|---|
| 26 | +extern int qla2x00_reset_adapter(struct scsi_qla_host *); |
|---|
| 27 | +extern int qla24xx_reset_adapter(struct scsi_qla_host *); |
|---|
| 29 | 28 | extern int qla2x00_nvram_config(struct scsi_qla_host *); |
|---|
| 30 | 29 | extern int qla24xx_nvram_config(struct scsi_qla_host *); |
|---|
| 31 | 30 | extern int qla81xx_nvram_config(struct scsi_qla_host *); |
|---|
| 32 | 31 | extern void qla2x00_update_fw_options(struct scsi_qla_host *); |
|---|
| 33 | 32 | extern void qla24xx_update_fw_options(scsi_qla_host_t *); |
|---|
| 34 | | -extern void qla81xx_update_fw_options(scsi_qla_host_t *); |
|---|
| 33 | + |
|---|
| 35 | 34 | extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *); |
|---|
| 36 | 35 | extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *); |
|---|
| 37 | 36 | extern int qla81xx_load_risc(scsi_qla_host_t *, uint32_t *); |
|---|
| 38 | 37 | |
|---|
| 39 | 38 | extern int qla2x00_perform_loop_resync(scsi_qla_host_t *); |
|---|
| 40 | 39 | extern int qla2x00_loop_resync(scsi_qla_host_t *); |
|---|
| 41 | | - |
|---|
| 42 | | -extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *); |
|---|
| 40 | +extern void qla2x00_clear_loop_id(fc_port_t *fcport); |
|---|
| 43 | 41 | |
|---|
| 44 | 42 | extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); |
|---|
| 45 | 43 | extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); |
|---|
| 46 | 44 | |
|---|
| 47 | 45 | extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t); |
|---|
| 48 | 46 | extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, bool); |
|---|
| 47 | +extern void qla2x00_els_dcmd2_free(scsi_qla_host_t *vha, |
|---|
| 48 | + struct els_plogi *els_plogi); |
|---|
| 49 | 49 | |
|---|
| 50 | 50 | extern void qla2x00_update_fcports(scsi_qla_host_t *); |
|---|
| 51 | 51 | |
|---|
| .. | .. |
|---|
| 71 | 71 | extern int qla2x00_async_tm_cmd(fc_port_t *, uint32_t, uint32_t, uint32_t); |
|---|
| 72 | 72 | extern void qla2x00_async_login_done(struct scsi_qla_host *, fc_port_t *, |
|---|
| 73 | 73 | uint16_t *); |
|---|
| 74 | | -extern void qla2x00_async_logout_done(struct scsi_qla_host *, fc_port_t *, |
|---|
| 75 | | - uint16_t *); |
|---|
| 76 | | -extern void qla2x00_async_adisc_done(struct scsi_qla_host *, fc_port_t *, |
|---|
| 77 | | - uint16_t *); |
|---|
| 78 | 74 | struct qla_work_evt *qla2x00_alloc_work(struct scsi_qla_host *, |
|---|
| 79 | 75 | enum qla_work_type); |
|---|
| 80 | 76 | extern int qla24xx_async_gnl(struct scsi_qla_host *, fc_port_t *); |
|---|
| 81 | 77 | int qla2x00_post_work(struct scsi_qla_host *vha, struct qla_work_evt *e); |
|---|
| 82 | 78 | extern void *qla2x00_alloc_iocbs_ready(struct qla_qpair *, srb_t *); |
|---|
| 83 | 79 | extern int qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *, fc_port_t *); |
|---|
| 80 | +extern int qla24xx_async_abort_cmd(srb_t *, bool); |
|---|
| 84 | 81 | |
|---|
| 82 | +extern void qla2x00_set_fcport_state(fc_port_t *fcport, int state); |
|---|
| 85 | 83 | extern fc_port_t * |
|---|
| 86 | 84 | qla2x00_alloc_fcport(scsi_qla_host_t *, gfp_t ); |
|---|
| 87 | 85 | |
|---|
| .. | .. |
|---|
| 95 | 93 | extern int |
|---|
| 96 | 94 | qla2x00_alloc_outstanding_cmds(struct qla_hw_data *, struct req_que *); |
|---|
| 97 | 95 | extern int qla2x00_init_rings(scsi_qla_host_t *); |
|---|
| 98 | | -extern uint8_t qla27xx_find_valid_image(struct scsi_qla_host *); |
|---|
| 99 | 96 | extern struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *, |
|---|
| 100 | 97 | int, int, bool); |
|---|
| 101 | 98 | extern int qla2xxx_delete_qpair(struct scsi_qla_host *, struct qla_qpair *); |
|---|
| 102 | | -void qla2x00_fcport_event_handler(scsi_qla_host_t *, struct event_arg *); |
|---|
| 99 | +void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea); |
|---|
| 100 | +void qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, |
|---|
| 101 | + struct event_arg *ea); |
|---|
| 102 | +void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, |
|---|
| 103 | + struct event_arg *ea); |
|---|
| 103 | 104 | int qla24xx_async_gpdb(struct scsi_qla_host *, fc_port_t *, u8); |
|---|
| 104 | 105 | int qla24xx_async_prli(struct scsi_qla_host *, fc_port_t *); |
|---|
| 105 | 106 | int qla24xx_async_notify_ack(scsi_qla_host_t *, fc_port_t *, |
|---|
| .. | .. |
|---|
| 107 | 108 | int qla24xx_post_newsess_work(struct scsi_qla_host *, port_id_t *, u8 *, u8*, |
|---|
| 108 | 109 | void *, u8); |
|---|
| 109 | 110 | int qla24xx_fcport_handle_login(struct scsi_qla_host *, fc_port_t *); |
|---|
| 110 | | -int qla24xx_detect_sfp(scsi_qla_host_t *vha); |
|---|
| 111 | +int qla24xx_detect_sfp(scsi_qla_host_t *); |
|---|
| 111 | 112 | int qla24xx_post_gpdb_work(struct scsi_qla_host *, fc_port_t *, u8); |
|---|
| 113 | + |
|---|
| 114 | +extern void qla28xx_get_aux_images(struct scsi_qla_host *, |
|---|
| 115 | + struct active_regions *); |
|---|
| 116 | +extern void qla27xx_get_active_image(struct scsi_qla_host *, |
|---|
| 117 | + struct active_regions *); |
|---|
| 112 | 118 | |
|---|
| 113 | 119 | void qla2x00_async_prlo_done(struct scsi_qla_host *, fc_port_t *, |
|---|
| 114 | 120 | uint16_t *); |
|---|
| .. | .. |
|---|
| 119 | 125 | int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); |
|---|
| 120 | 126 | void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); |
|---|
| 121 | 127 | int qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *); |
|---|
| 128 | +void qla_rscn_replay(fc_port_t *fcport); |
|---|
| 129 | +void qla24xx_free_purex_item(struct purex_item *item); |
|---|
| 130 | +extern bool qla24xx_risc_firmware_invalid(uint32_t *); |
|---|
| 131 | +void qla_init_iocb_limit(scsi_qla_host_t *); |
|---|
| 132 | + |
|---|
| 133 | + |
|---|
| 122 | 134 | /* |
|---|
| 123 | 135 | * Global Data in qla_os.c source file. |
|---|
| 124 | 136 | */ |
|---|
| .. | .. |
|---|
| 132 | 144 | extern int ql2xplogiabsentdevice; |
|---|
| 133 | 145 | extern int ql2xloginretrycount; |
|---|
| 134 | 146 | extern int ql2xfdmienable; |
|---|
| 147 | +extern int ql2xrdpenable; |
|---|
| 148 | +extern int ql2xsmartsan; |
|---|
| 135 | 149 | extern int ql2xallocfwdump; |
|---|
| 136 | 150 | extern int ql2xextended_error_logging; |
|---|
| 137 | 151 | extern int ql2xiidmaenable; |
|---|
| .. | .. |
|---|
| 158 | 172 | extern int ql2xautodetectsfp; |
|---|
| 159 | 173 | extern int ql2xenablemsix; |
|---|
| 160 | 174 | extern int qla2xuseresexchforels; |
|---|
| 175 | +extern int ql2xexlogins; |
|---|
| 176 | +extern int ql2xdifbundlinginternalbuffers; |
|---|
| 177 | +extern int ql2xfulldump_on_mpifail; |
|---|
| 178 | +extern int ql2xenforce_iocb_limit; |
|---|
| 161 | 179 | |
|---|
| 162 | 180 | extern int qla2x00_loop_reset(scsi_qla_host_t *); |
|---|
| 163 | 181 | extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int); |
|---|
| .. | .. |
|---|
| 168 | 186 | uint16_t *); |
|---|
| 169 | 187 | extern int qla2x00_post_async_logout_work(struct scsi_qla_host *, fc_port_t *, |
|---|
| 170 | 188 | uint16_t *); |
|---|
| 171 | | -extern int qla2x00_post_async_logout_done_work(struct scsi_qla_host *, |
|---|
| 172 | | - fc_port_t *, uint16_t *); |
|---|
| 173 | 189 | extern int qla2x00_post_async_adisc_work(struct scsi_qla_host *, fc_port_t *, |
|---|
| 174 | 190 | uint16_t *); |
|---|
| 175 | 191 | extern int qla2x00_post_async_adisc_done_work(struct scsi_qla_host *, |
|---|
| .. | .. |
|---|
| 187 | 203 | extern void qla2x00_relogin(struct scsi_qla_host *); |
|---|
| 188 | 204 | extern void qla2x00_do_work(struct scsi_qla_host *); |
|---|
| 189 | 205 | extern void qla2x00_free_fcports(struct scsi_qla_host *); |
|---|
| 206 | +extern void qla2x00_free_fcport(fc_port_t *); |
|---|
| 190 | 207 | |
|---|
| 191 | 208 | extern void qla83xx_schedule_work(scsi_qla_host_t *, int); |
|---|
| 192 | 209 | extern void qla83xx_service_idc_aen(struct work_struct *); |
|---|
| .. | .. |
|---|
| 205 | 222 | |
|---|
| 206 | 223 | extern int qla2x00_post_uevent_work(struct scsi_qla_host *, u32); |
|---|
| 207 | 224 | extern void qla2x00_disable_board_on_pci_error(struct work_struct *); |
|---|
| 208 | | -extern void qla2x00_sp_compl(void *, int); |
|---|
| 209 | | -extern void qla2xxx_qpair_sp_free_dma(void *); |
|---|
| 210 | | -extern void qla2xxx_qpair_sp_compl(void *, int); |
|---|
| 225 | +extern void qla_eeh_work(struct work_struct *); |
|---|
| 226 | +extern void qla2x00_sp_compl(srb_t *sp, int); |
|---|
| 227 | +extern void qla2xxx_qpair_sp_free_dma(srb_t *sp); |
|---|
| 228 | +extern void qla2xxx_qpair_sp_compl(srb_t *sp, int); |
|---|
| 211 | 229 | extern void qla24xx_sched_upd_fcport(fc_port_t *); |
|---|
| 212 | 230 | void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, |
|---|
| 213 | 231 | uint16_t *); |
|---|
| 214 | 232 | int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *); |
|---|
| 215 | | -int qla24xx_async_abort_cmd(srb_t *, bool); |
|---|
| 216 | 233 | int qla24xx_post_relogin_work(struct scsi_qla_host *vha); |
|---|
| 217 | 234 | void qla2x00_wait_for_sess_deletion(scsi_qla_host_t *); |
|---|
| 235 | +void qla24xx_process_purex_rdp(struct scsi_qla_host *vha, |
|---|
| 236 | + struct purex_item *pkt); |
|---|
| 237 | +void qla_pci_set_eeh_busy(struct scsi_qla_host *); |
|---|
| 238 | +void qla_schedule_eeh_work(struct scsi_qla_host *); |
|---|
| 218 | 239 | |
|---|
| 219 | 240 | /* |
|---|
| 220 | 241 | * Global Functions in qla_mid.c source file. |
|---|
| .. | .. |
|---|
| 235 | 256 | struct vp_rpt_id_entry_24xx *); |
|---|
| 236 | 257 | extern void qla2x00_do_dpc_all_vps(scsi_qla_host_t *); |
|---|
| 237 | 258 | extern int qla24xx_vport_create_req_sanity_check(struct fc_vport *); |
|---|
| 238 | | -extern scsi_qla_host_t * qla24xx_create_vhost(struct fc_vport *); |
|---|
| 259 | +extern scsi_qla_host_t *qla24xx_create_vhost(struct fc_vport *); |
|---|
| 239 | 260 | |
|---|
| 240 | | -extern void qla2x00_sp_free_dma(void *); |
|---|
| 261 | +extern void qla2x00_sp_free_dma(srb_t *sp); |
|---|
| 241 | 262 | extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); |
|---|
| 242 | 263 | |
|---|
| 243 | | -extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); |
|---|
| 244 | | -extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int); |
|---|
| 264 | +extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int); |
|---|
| 265 | +extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *); |
|---|
| 266 | +extern int qla24xx_async_abort_cmd(srb_t *, bool); |
|---|
| 245 | 267 | |
|---|
| 246 | 268 | extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *); |
|---|
| 247 | 269 | |
|---|
| .. | .. |
|---|
| 265 | 287 | extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t); |
|---|
| 266 | 288 | extern void qla24xx_build_scsi_iocbs(srb_t *, struct cmd_type_7 *, |
|---|
| 267 | 289 | uint16_t, struct req_que *); |
|---|
| 290 | +extern uint32_t qla2xxx_get_next_handle(struct req_que *req); |
|---|
| 268 | 291 | extern int qla2x00_start_scsi(srb_t *sp); |
|---|
| 269 | 292 | extern int qla24xx_start_scsi(srb_t *sp); |
|---|
| 270 | | -int qla2x00_marker(struct scsi_qla_host *, struct req_que *, struct rsp_que *, |
|---|
| 271 | | - uint16_t, uint64_t, uint8_t); |
|---|
| 293 | +int qla2x00_marker(struct scsi_qla_host *, struct qla_qpair *, |
|---|
| 294 | + uint16_t, uint64_t, uint8_t); |
|---|
| 272 | 295 | extern int qla2x00_start_sp(srb_t *); |
|---|
| 273 | 296 | extern int qla24xx_dif_start_scsi(srb_t *); |
|---|
| 274 | 297 | extern int qla2x00_start_bidir(srb_t *, struct scsi_qla_host *, uint32_t); |
|---|
| 275 | 298 | extern int qla2xxx_dif_start_scsi_mq(srb_t *); |
|---|
| 299 | +extern void qla2x00_init_timer(srb_t *sp, unsigned long tmo); |
|---|
| 276 | 300 | extern unsigned long qla2x00_get_async_timeout(struct scsi_qla_host *); |
|---|
| 277 | 301 | |
|---|
| 278 | 302 | extern void *qla2x00_alloc_iocbs(struct scsi_qla_host *, srb_t *); |
|---|
| 279 | 303 | extern void *__qla2x00_alloc_iocbs(struct qla_qpair *, srb_t *); |
|---|
| 280 | 304 | extern int qla2x00_issue_marker(scsi_qla_host_t *, int); |
|---|
| 281 | 305 | extern int qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *, srb_t *, |
|---|
| 282 | | - uint32_t *, uint16_t, struct qla_tc_param *); |
|---|
| 306 | + struct dsd64 *, uint16_t, struct qla_tc_param *); |
|---|
| 283 | 307 | extern int qla24xx_walk_and_build_sglist(struct qla_hw_data *, srb_t *, |
|---|
| 284 | | - uint32_t *, uint16_t, struct qla_tc_param *); |
|---|
| 308 | + struct dsd64 *, uint16_t, struct qla_tc_param *); |
|---|
| 285 | 309 | extern int qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *, srb_t *, |
|---|
| 286 | | - uint32_t *, uint16_t, struct qla_tc_param *); |
|---|
| 310 | + struct dsd64 *, uint16_t, struct qla_tgt_cmd *); |
|---|
| 287 | 311 | extern int qla24xx_get_one_block_sg(uint32_t, struct qla2_sgx *, uint32_t *); |
|---|
| 288 | 312 | extern int qla24xx_configure_prot_mode(srb_t *, uint16_t *); |
|---|
| 289 | | -extern int qla24xx_build_scsi_crc_2_iocbs(srb_t *, |
|---|
| 290 | | - struct cmd_type_crc_2 *, uint16_t, uint16_t, uint16_t); |
|---|
| 291 | 313 | |
|---|
| 292 | 314 | /* |
|---|
| 293 | 315 | * Global Function Prototypes in qla_mbx.c source file. |
|---|
| .. | .. |
|---|
| 342 | 364 | qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t); |
|---|
| 343 | 365 | |
|---|
| 344 | 366 | extern int |
|---|
| 367 | +qla24xx_get_port_database(scsi_qla_host_t *, u16, struct port_database_24xx *); |
|---|
| 368 | + |
|---|
| 369 | +extern int |
|---|
| 345 | 370 | qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *); |
|---|
| 346 | 371 | |
|---|
| 347 | 372 | extern int |
|---|
| .. | .. |
|---|
| 383 | 408 | qla2x00_get_resource_cnts(scsi_qla_host_t *); |
|---|
| 384 | 409 | |
|---|
| 385 | 410 | extern int |
|---|
| 386 | | -qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); |
|---|
| 411 | +qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map, |
|---|
| 412 | + u8 *num_entries); |
|---|
| 387 | 413 | |
|---|
| 388 | 414 | extern int |
|---|
| 389 | 415 | qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, struct link_statistics *, |
|---|
| .. | .. |
|---|
| 440 | 466 | qla25xx_set_driver_version(scsi_qla_host_t *, char *); |
|---|
| 441 | 467 | |
|---|
| 442 | 468 | extern int |
|---|
| 469 | +qla25xx_set_els_cmds_supported(scsi_qla_host_t *); |
|---|
| 470 | + |
|---|
| 471 | +extern int |
|---|
| 472 | +qla24xx_get_buffer_credits(scsi_qla_host_t *, struct buffer_credit_24xx *, |
|---|
| 473 | + dma_addr_t); |
|---|
| 474 | + |
|---|
| 475 | +extern int |
|---|
| 443 | 476 | qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *, |
|---|
| 444 | 477 | uint16_t, uint16_t, uint16_t, uint16_t); |
|---|
| 445 | 478 | |
|---|
| .. | .. |
|---|
| 462 | 495 | |
|---|
| 463 | 496 | extern int |
|---|
| 464 | 497 | qla81xx_fac_erase_sector(scsi_qla_host_t *, uint32_t, uint32_t); |
|---|
| 498 | + |
|---|
| 499 | +extern int qla81xx_fac_semaphore_access(scsi_qla_host_t *, int); |
|---|
| 465 | 500 | |
|---|
| 466 | 501 | extern int |
|---|
| 467 | 502 | qla2x00_get_xgmac_stats(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t *); |
|---|
| .. | .. |
|---|
| 508 | 543 | extern int qla27xx_set_zio_threshold(scsi_qla_host_t *, uint16_t); |
|---|
| 509 | 544 | int qla24xx_res_count_wait(struct scsi_qla_host *, uint16_t *, int); |
|---|
| 510 | 545 | |
|---|
| 546 | +extern int qla28xx_secure_flash_update(scsi_qla_host_t *, uint16_t, uint16_t, |
|---|
| 547 | + uint32_t, dma_addr_t, uint32_t); |
|---|
| 548 | + |
|---|
| 549 | +extern int qla2xxx_read_remote_register(scsi_qla_host_t *, uint32_t, |
|---|
| 550 | + uint32_t *); |
|---|
| 551 | +extern int qla2xxx_write_remote_register(scsi_qla_host_t *, uint32_t, |
|---|
| 552 | + uint32_t); |
|---|
| 553 | + |
|---|
| 511 | 554 | /* |
|---|
| 512 | 555 | * Global Function Prototypes in qla_isr.c source file. |
|---|
| 513 | 556 | */ |
|---|
| .. | .. |
|---|
| 530 | 573 | uint32_t); |
|---|
| 531 | 574 | extern irqreturn_t |
|---|
| 532 | 575 | qla2xxx_msix_rsp_q(int irq, void *dev_id); |
|---|
| 576 | +extern irqreturn_t |
|---|
| 577 | +qla2xxx_msix_rsp_q_hs(int irq, void *dev_id); |
|---|
| 533 | 578 | fc_port_t *qla2x00_find_fcport_by_loopid(scsi_qla_host_t *, uint16_t); |
|---|
| 534 | 579 | fc_port_t *qla2x00_find_fcport_by_wwpn(scsi_qla_host_t *, u8 *, u8); |
|---|
| 535 | 580 | fc_port_t *qla2x00_find_fcport_by_nportid(scsi_qla_host_t *, port_id_t *, u8); |
|---|
| .. | .. |
|---|
| 538 | 583 | * Global Function Prototypes in qla_sup.c source file. |
|---|
| 539 | 584 | */ |
|---|
| 540 | 585 | extern void qla2x00_release_nvram_protection(scsi_qla_host_t *); |
|---|
| 541 | | -extern uint32_t *qla24xx_read_flash_data(scsi_qla_host_t *, uint32_t *, |
|---|
| 542 | | - uint32_t, uint32_t); |
|---|
| 543 | | -extern uint8_t *qla2x00_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t, |
|---|
| 544 | | - uint32_t); |
|---|
| 545 | | -extern uint8_t *qla24xx_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t, |
|---|
| 546 | | - uint32_t); |
|---|
| 547 | | -extern int qla2x00_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t, |
|---|
| 548 | | - uint32_t); |
|---|
| 549 | | -extern int qla24xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t, |
|---|
| 550 | | - uint32_t); |
|---|
| 551 | | -extern uint8_t *qla25xx_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t, |
|---|
| 552 | | - uint32_t); |
|---|
| 553 | | -extern int qla25xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t, |
|---|
| 554 | | - uint32_t); |
|---|
| 586 | +extern int qla24xx_read_flash_data(scsi_qla_host_t *, uint32_t *, |
|---|
| 587 | + uint32_t, uint32_t); |
|---|
| 588 | +extern uint8_t *qla2x00_read_nvram_data(scsi_qla_host_t *, void *, uint32_t, |
|---|
| 589 | + uint32_t); |
|---|
| 590 | +extern uint8_t *qla24xx_read_nvram_data(scsi_qla_host_t *, void *, uint32_t, |
|---|
| 591 | + uint32_t); |
|---|
| 592 | +extern int qla2x00_write_nvram_data(scsi_qla_host_t *, void *, uint32_t, |
|---|
| 593 | + uint32_t); |
|---|
| 594 | +extern int qla24xx_write_nvram_data(scsi_qla_host_t *, void *, uint32_t, |
|---|
| 595 | + uint32_t); |
|---|
| 596 | +extern uint8_t *qla25xx_read_nvram_data(scsi_qla_host_t *, void *, uint32_t, |
|---|
| 597 | + uint32_t); |
|---|
| 598 | +extern int qla25xx_write_nvram_data(scsi_qla_host_t *, void *, uint32_t, |
|---|
| 599 | + uint32_t); |
|---|
| 600 | + |
|---|
| 555 | 601 | extern int qla2x00_is_a_vp_did(scsi_qla_host_t *, uint32_t); |
|---|
| 556 | 602 | bool qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *, uint32_t); |
|---|
| 557 | 603 | bool qla2x00_check_reg16_for_disconnect(scsi_qla_host_t *, uint16_t); |
|---|
| .. | .. |
|---|
| 571 | 617 | extern int qla83xx_access_control(scsi_qla_host_t *, uint16_t, uint32_t, |
|---|
| 572 | 618 | uint32_t, uint16_t *); |
|---|
| 573 | 619 | |
|---|
| 574 | | -extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 620 | +extern void *qla2x00_read_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 575 | 621 | uint32_t, uint32_t); |
|---|
| 576 | | -extern int qla2x00_write_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 622 | +extern int qla2x00_write_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 577 | 623 | uint32_t, uint32_t); |
|---|
| 578 | | -extern uint8_t *qla24xx_read_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 624 | +extern void *qla24xx_read_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 579 | 625 | uint32_t, uint32_t); |
|---|
| 580 | | -extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 626 | +extern int qla24xx_write_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 581 | 627 | uint32_t, uint32_t); |
|---|
| 582 | | -extern uint8_t *qla25xx_read_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 628 | +extern void *qla25xx_read_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 583 | 629 | uint32_t, uint32_t); |
|---|
| 584 | | -extern uint8_t *qla8044_read_optrom_data(struct scsi_qla_host *, |
|---|
| 585 | | - uint8_t *, uint32_t, uint32_t); |
|---|
| 630 | +extern void *qla8044_read_optrom_data(struct scsi_qla_host *, |
|---|
| 631 | + void *, uint32_t, uint32_t); |
|---|
| 586 | 632 | extern void qla8044_watchdog(struct scsi_qla_host *vha); |
|---|
| 587 | 633 | |
|---|
| 588 | 634 | extern int qla2x00_get_flash_version(scsi_qla_host_t *, void *); |
|---|
| .. | .. |
|---|
| 598 | 644 | /* |
|---|
| 599 | 645 | * Global Function Prototypes in qla_dbg.c source file. |
|---|
| 600 | 646 | */ |
|---|
| 601 | | -extern void qla2100_fw_dump(scsi_qla_host_t *, int); |
|---|
| 602 | | -extern void qla2300_fw_dump(scsi_qla_host_t *, int); |
|---|
| 603 | | -extern void qla24xx_fw_dump(scsi_qla_host_t *, int); |
|---|
| 604 | | -extern void qla25xx_fw_dump(scsi_qla_host_t *, int); |
|---|
| 605 | | -extern void qla81xx_fw_dump(scsi_qla_host_t *, int); |
|---|
| 606 | | -extern void qla82xx_fw_dump(scsi_qla_host_t *, int); |
|---|
| 607 | | -extern void qla8044_fw_dump(scsi_qla_host_t *, int); |
|---|
| 647 | +void qla2xxx_dump_fw(scsi_qla_host_t *vha); |
|---|
| 648 | +void qla2100_fw_dump(scsi_qla_host_t *vha); |
|---|
| 649 | +void qla2300_fw_dump(scsi_qla_host_t *vha); |
|---|
| 650 | +void qla24xx_fw_dump(scsi_qla_host_t *vha); |
|---|
| 651 | +void qla25xx_fw_dump(scsi_qla_host_t *vha); |
|---|
| 652 | +void qla81xx_fw_dump(scsi_qla_host_t *vha); |
|---|
| 653 | +void qla82xx_fw_dump(scsi_qla_host_t *vha); |
|---|
| 654 | +void qla8044_fw_dump(scsi_qla_host_t *vha); |
|---|
| 608 | 655 | |
|---|
| 609 | | -extern void qla27xx_fwdump(scsi_qla_host_t *, int); |
|---|
| 610 | | -extern ulong qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *); |
|---|
| 656 | +void qla27xx_fwdump(scsi_qla_host_t *vha); |
|---|
| 657 | +extern void qla27xx_mpi_fwdump(scsi_qla_host_t *, int); |
|---|
| 658 | +extern ulong qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *, void *); |
|---|
| 611 | 659 | extern int qla27xx_fwdt_template_valid(void *); |
|---|
| 612 | 660 | extern ulong qla27xx_fwdt_template_size(void *); |
|---|
| 613 | | -extern const void *qla27xx_fwdt_template_default(void); |
|---|
| 614 | | -extern ulong qla27xx_fwdt_template_default_size(void); |
|---|
| 615 | 661 | |
|---|
| 616 | | -extern void qla2x00_dump_regs(scsi_qla_host_t *); |
|---|
| 617 | | -extern void qla2x00_dump_buffer(uint8_t *, uint32_t); |
|---|
| 618 | | -extern void qla2x00_dump_buffer_zipped(uint8_t *, uint32_t); |
|---|
| 619 | | -extern void ql_dump_regs(uint32_t, scsi_qla_host_t *, int32_t); |
|---|
| 620 | | -extern void ql_dump_buffer(uint32_t, scsi_qla_host_t *, int32_t, |
|---|
| 621 | | - uint8_t *, uint32_t); |
|---|
| 622 | 662 | extern void qla2xxx_dump_post_process(scsi_qla_host_t *, int); |
|---|
| 623 | | - |
|---|
| 663 | +extern void ql_dump_regs(uint, scsi_qla_host_t *, uint); |
|---|
| 664 | +extern void ql_dump_buffer(uint, scsi_qla_host_t *, uint, const void *, uint); |
|---|
| 624 | 665 | /* |
|---|
| 625 | 666 | * Global Function Prototypes in qla_gs.c source file. |
|---|
| 626 | 667 | */ |
|---|
| .. | .. |
|---|
| 640 | 681 | extern int qla2x00_fdmi_register(scsi_qla_host_t *); |
|---|
| 641 | 682 | extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *); |
|---|
| 642 | 683 | extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *); |
|---|
| 643 | | -extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *, size_t); |
|---|
| 684 | +extern size_t qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *, size_t); |
|---|
| 644 | 685 | extern int qla2x00_chk_ms_status(scsi_qla_host_t *, ms_iocb_entry_t *, |
|---|
| 645 | 686 | struct ct_sns_rsp *, const char *); |
|---|
| 646 | 687 | extern void qla2x00_async_iocb_timeout(void *data); |
|---|
| 647 | | -extern int qla24xx_async_gidpn(scsi_qla_host_t *, fc_port_t *); |
|---|
| 648 | | -int qla24xx_post_gidpn_work(struct scsi_qla_host *, fc_port_t *); |
|---|
| 649 | | -void qla24xx_handle_gidpn_event(scsi_qla_host_t *, struct event_arg *); |
|---|
| 650 | 688 | |
|---|
| 651 | 689 | extern void qla2x00_free_fcport(fc_port_t *); |
|---|
| 652 | 690 | |
|---|
| .. | .. |
|---|
| 671 | 709 | void qla24xx_handle_gfpnid_event(scsi_qla_host_t *, struct event_arg *); |
|---|
| 672 | 710 | void qla24xx_sp_unmap(scsi_qla_host_t *, srb_t *); |
|---|
| 673 | 711 | void qla_scan_work_fn(struct work_struct *); |
|---|
| 712 | +uint qla25xx_fdmi_port_speed_capability(struct qla_hw_data *); |
|---|
| 713 | +uint qla25xx_fdmi_port_speed_currently(struct qla_hw_data *); |
|---|
| 674 | 714 | |
|---|
| 675 | 715 | /* |
|---|
| 676 | 716 | * Global Function Prototypes in qla_attr.c source file. |
|---|
| 677 | 717 | */ |
|---|
| 678 | 718 | struct device_attribute; |
|---|
| 679 | 719 | extern struct device_attribute *qla2x00_host_attrs[]; |
|---|
| 720 | +extern struct device_attribute *qla2x00_host_attrs_dm[]; |
|---|
| 680 | 721 | struct fc_function_template; |
|---|
| 681 | 722 | extern struct fc_function_template qla2xxx_transport_functions; |
|---|
| 682 | 723 | extern struct fc_function_template qla2xxx_transport_vport_functions; |
|---|
| .. | .. |
|---|
| 690 | 731 | extern int qla24xx_update_all_fcp_prio(scsi_qla_host_t *); |
|---|
| 691 | 732 | extern int qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *, |
|---|
| 692 | 733 | struct qla_fcp_prio_cfg *, uint8_t); |
|---|
| 693 | | - |
|---|
| 734 | +void qla_insert_tgt_attrs(void); |
|---|
| 694 | 735 | /* |
|---|
| 695 | 736 | * Global Function Prototypes in qla_dfs.c source file. |
|---|
| 696 | 737 | */ |
|---|
| .. | .. |
|---|
| 721 | 762 | /* qlafx00 related functions */ |
|---|
| 722 | 763 | extern int qlafx00_pci_config(struct scsi_qla_host *); |
|---|
| 723 | 764 | extern int qlafx00_initialize_adapter(struct scsi_qla_host *); |
|---|
| 724 | | -extern void qlafx00_soft_reset(scsi_qla_host_t *); |
|---|
| 765 | +extern int qlafx00_soft_reset(scsi_qla_host_t *); |
|---|
| 725 | 766 | extern int qlafx00_chip_diag(scsi_qla_host_t *); |
|---|
| 726 | 767 | extern void qlafx00_config_rings(struct scsi_qla_host *); |
|---|
| 727 | | -extern char *qlafx00_pci_info_str(struct scsi_qla_host *, char *); |
|---|
| 768 | +extern char *qlafx00_pci_info_str(struct scsi_qla_host *, char *, size_t); |
|---|
| 728 | 769 | extern char *qlafx00_fw_version_str(struct scsi_qla_host *, char *, size_t); |
|---|
| 729 | 770 | extern irqreturn_t qlafx00_intr_handler(int, void *); |
|---|
| 730 | 771 | extern void qlafx00_enable_intrs(struct qla_hw_data *); |
|---|
| .. | .. |
|---|
| 740 | 781 | extern int qlafx00_configure_devices(scsi_qla_host_t *); |
|---|
| 741 | 782 | extern int qlafx00_reset_initialize(scsi_qla_host_t *); |
|---|
| 742 | 783 | extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint16_t); |
|---|
| 743 | | -extern int qlafx00_process_aen(struct scsi_qla_host *, struct qla_work_evt *); |
|---|
| 784 | +extern void qlafx00_process_aen(struct scsi_qla_host *, struct qla_work_evt *); |
|---|
| 744 | 785 | extern int qlafx00_post_aenfx_work(struct scsi_qla_host *, uint32_t, |
|---|
| 745 | 786 | uint32_t *, int); |
|---|
| 746 | 787 | extern uint32_t qlafx00_fw_state_show(struct device *, |
|---|
| .. | .. |
|---|
| 763 | 804 | extern int qla82xx_iospace_config(struct qla_hw_data *); |
|---|
| 764 | 805 | |
|---|
| 765 | 806 | /* Initialization related functions */ |
|---|
| 766 | | -extern void qla82xx_reset_chip(struct scsi_qla_host *); |
|---|
| 807 | +extern int qla82xx_reset_chip(struct scsi_qla_host *); |
|---|
| 767 | 808 | extern void qla82xx_config_rings(struct scsi_qla_host *); |
|---|
| 768 | 809 | extern void qla82xx_watchdog(scsi_qla_host_t *); |
|---|
| 769 | 810 | extern int qla82xx_start_firmware(scsi_qla_host_t *); |
|---|
| 770 | 811 | |
|---|
| 771 | 812 | /* Firmware and flash related functions */ |
|---|
| 772 | 813 | extern int qla82xx_load_risc(scsi_qla_host_t *, uint32_t *); |
|---|
| 773 | | -extern uint8_t *qla82xx_read_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 814 | +extern void *qla82xx_read_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 774 | 815 | uint32_t, uint32_t); |
|---|
| 775 | | -extern int qla82xx_write_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 816 | +extern int qla82xx_write_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 776 | 817 | uint32_t, uint32_t); |
|---|
| 777 | 818 | |
|---|
| 778 | 819 | /* Mailbox related functions */ |
|---|
| .. | .. |
|---|
| 781 | 822 | |
|---|
| 782 | 823 | /* IOCB related functions */ |
|---|
| 783 | 824 | extern int qla82xx_start_scsi(srb_t *); |
|---|
| 784 | | -extern void qla2x00_sp_free(void *); |
|---|
| 825 | +extern void qla2x00_sp_free(srb_t *sp); |
|---|
| 785 | 826 | extern void qla2x00_sp_timeout(struct timer_list *); |
|---|
| 786 | | -extern void qla2x00_bsg_job_done(void *, int); |
|---|
| 787 | | -extern void qla2x00_bsg_sp_free(void *); |
|---|
| 827 | +extern void qla2x00_bsg_job_done(srb_t *sp, int); |
|---|
| 828 | +extern void qla2x00_bsg_sp_free(srb_t *sp); |
|---|
| 788 | 829 | extern void qla2x00_start_iocbs(struct scsi_qla_host *, struct req_que *); |
|---|
| 789 | 830 | |
|---|
| 790 | 831 | /* Interrupt related */ |
|---|
| .. | .. |
|---|
| 813 | 854 | extern void qla8xxx_dev_failed_handler(scsi_qla_host_t *); |
|---|
| 814 | 855 | extern void qla82xx_clear_qsnt_ready(scsi_qla_host_t *); |
|---|
| 815 | 856 | |
|---|
| 816 | | -extern void qla2x00_set_model_info(scsi_qla_host_t *, uint8_t *, |
|---|
| 817 | | - size_t, char *); |
|---|
| 857 | +extern void qla2x00_set_model_info(scsi_qla_host_t *, uint8_t *, size_t, |
|---|
| 858 | + const char *); |
|---|
| 818 | 859 | extern int qla82xx_mbx_intr_enable(scsi_qla_host_t *); |
|---|
| 819 | 860 | extern int qla82xx_mbx_intr_disable(scsi_qla_host_t *); |
|---|
| 820 | 861 | extern void qla82xx_start_iocbs(scsi_qla_host_t *); |
|---|
| .. | .. |
|---|
| 829 | 870 | extern int qla82xx_read_temperature(scsi_qla_host_t *); |
|---|
| 830 | 871 | extern int qla8044_read_temperature(scsi_qla_host_t *); |
|---|
| 831 | 872 | extern int qla2x00_read_sfp_dev(struct scsi_qla_host *, char *, int); |
|---|
| 873 | +extern int ql26xx_led_config(scsi_qla_host_t *, uint16_t, uint16_t *); |
|---|
| 832 | 874 | |
|---|
| 833 | 875 | /* BSG related functions */ |
|---|
| 834 | 876 | extern int qla24xx_bsg_request(struct bsg_job *); |
|---|
| .. | .. |
|---|
| 840 | 882 | uint16_t *, uint16_t *); |
|---|
| 841 | 883 | |
|---|
| 842 | 884 | /* 83xx related functions */ |
|---|
| 843 | | -extern void qla83xx_fw_dump(scsi_qla_host_t *, int); |
|---|
| 885 | +void qla83xx_fw_dump(scsi_qla_host_t *vha); |
|---|
| 844 | 886 | |
|---|
| 845 | 887 | /* Minidump related functions */ |
|---|
| 846 | 888 | extern int qla82xx_md_get_template_size(scsi_qla_host_t *); |
|---|
| .. | .. |
|---|
| 868 | 910 | void qla8044_get_minidump(struct scsi_qla_host *vha); |
|---|
| 869 | 911 | int qla8044_collect_md_data(struct scsi_qla_host *vha); |
|---|
| 870 | 912 | extern int qla8044_md_get_template(scsi_qla_host_t *); |
|---|
| 871 | | -extern int qla8044_write_optrom_data(struct scsi_qla_host *, uint8_t *, |
|---|
| 913 | +extern int qla8044_write_optrom_data(struct scsi_qla_host *, void *, |
|---|
| 872 | 914 | uint32_t, uint32_t); |
|---|
| 873 | 915 | extern irqreturn_t qla8044_intr_handler(int, void *); |
|---|
| 874 | 916 | extern void qla82xx_mbx_completion(scsi_qla_host_t *, uint16_t); |
|---|
| .. | .. |
|---|
| 896 | 938 | void qlt_update_host_map(struct scsi_qla_host *, port_id_t); |
|---|
| 897 | 939 | void qlt_remove_target_resources(struct qla_hw_data *); |
|---|
| 898 | 940 | void qlt_clr_qp_table(struct scsi_qla_host *vha); |
|---|
| 941 | +void qlt_set_mode(struct scsi_qla_host *); |
|---|
| 942 | +int qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode); |
|---|
| 943 | +extern void qla24xx_process_purex_list(struct purex_list *); |
|---|
| 944 | +extern void qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp); |
|---|
| 945 | +extern void qla2x00_dfs_remove_rport(scsi_qla_host_t *vha, struct fc_port *fp); |
|---|
| 899 | 946 | |
|---|
| 947 | +/* nvme.c */ |
|---|
| 948 | +void qla_nvme_unregister_remote_port(struct fc_port *fcport); |
|---|
| 949 | +void qla_handle_els_plogi_done(scsi_qla_host_t *vha, struct event_arg *ea); |
|---|
| 900 | 950 | #endif /* _QLA_GBL_H */ |
|---|