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

[SCSI] qla4xxx: ql4_mbx.c remove dead code bugfixes

All all inbound mbx registers for all mbx commands. Remove dead code.

Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

David C Somayajulu and committed by
James Bottomley
c0e344c9 401425b1

+104 -172
+104 -172
drivers/scsi/qla4xxx/ql4_mbx.c
··· 6 6 */ 7 7 8 8 #include "ql4_def.h" 9 + #include "ql4_glbl.h" 10 + #include "ql4_dbg.h" 11 + #include "ql4_inline.h" 9 12 10 13 11 14 /** ··· 172 169 return status; 173 170 } 174 171 175 - 176 - #if 0 177 - 178 - /** 179 - * qla4xxx_issue_iocb - issue mailbox iocb command 180 - * @ha: adapter state pointer. 181 - * @buffer: buffer pointer. 182 - * @phys_addr: physical address of buffer. 183 - * @size: size of buffer. 184 - * 185 - * Issues iocbs via mailbox commands. 186 - * TARGET_QUEUE_LOCK must be released. 187 - * ADAPTER_STATE_LOCK must be released. 188 - **/ 189 - int 190 - qla4xxx_issue_iocb(struct scsi_qla_host * ha, void *buffer, 191 - dma_addr_t phys_addr, size_t size) 192 - { 193 - uint32_t mbox_cmd[MBOX_REG_COUNT]; 194 - uint32_t mbox_sts[MBOX_REG_COUNT]; 195 - int status; 196 - 197 - memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 198 - memset(&mbox_sts, 0, sizeof(mbox_sts)); 199 - mbox_cmd[0] = MBOX_CMD_EXECUTE_IOCB_A64; 200 - mbox_cmd[1] = 0; 201 - mbox_cmd[2] = LSDW(phys_addr); 202 - mbox_cmd[3] = MSDW(phys_addr); 203 - status = qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]); 204 - return status; 205 - } 206 - 207 - int qla4xxx_conn_close_sess_logout(struct scsi_qla_host * ha, 208 - uint16_t fw_ddb_index, 209 - uint16_t connection_id, 210 - uint16_t option) 211 - { 212 - uint32_t mbox_cmd[MBOX_REG_COUNT]; 213 - uint32_t mbox_sts[MBOX_REG_COUNT]; 214 - 215 - memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 216 - memset(&mbox_sts, 0, sizeof(mbox_sts)); 217 - mbox_cmd[0] = MBOX_CMD_CONN_CLOSE_SESS_LOGOUT; 218 - mbox_cmd[1] = fw_ddb_index; 219 - mbox_cmd[2] = connection_id; 220 - mbox_cmd[3] = LOGOUT_OPTION_RELOGIN; 221 - if (qla4xxx_mailbox_command(ha, 4, 2, &mbox_cmd[0], &mbox_sts[0]) != 222 - QLA_SUCCESS) { 223 - DEBUG2(printk("scsi%ld: %s: MBOX_CMD_CONN_CLOSE_SESS_LOGOUT " 224 - "option %04x failed sts %04X %04X", 225 - ha->host_no, __func__, 226 - option, mbox_sts[0], mbox_sts[1])); 227 - if (mbox_sts[0] == 0x4005) 228 - DEBUG2(printk("%s reason %04X\n", __func__, 229 - mbox_sts[1])); 230 - } 231 - return QLA_SUCCESS; 232 - } 233 - 234 - int qla4xxx_clear_database_entry(struct scsi_qla_host * ha, 235 - uint16_t fw_ddb_index) 236 - { 237 - uint32_t mbox_cmd[MBOX_REG_COUNT]; 238 - uint32_t mbox_sts[MBOX_REG_COUNT]; 239 - 240 - memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 241 - memset(&mbox_sts, 0, sizeof(mbox_sts)); 242 - mbox_cmd[0] = MBOX_CMD_CLEAR_DATABASE_ENTRY; 243 - mbox_cmd[1] = fw_ddb_index; 244 - if (qla4xxx_mailbox_command(ha, 2, 5, &mbox_cmd[0], &mbox_sts[0]) != 245 - QLA_SUCCESS) 246 - return QLA_ERROR; 247 - 248 - return QLA_SUCCESS; 249 - } 250 - 251 - #endif /* 0 */ 252 - 253 172 /** 254 173 * qla4xxx_initialize_fw_cb - initializes firmware control block. 255 174 * @ha: Pointer to host adapter structure. ··· 197 272 /* Get Initialize Firmware Control Block. */ 198 273 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 199 274 memset(&mbox_sts, 0, sizeof(mbox_sts)); 275 + 200 276 mbox_cmd[0] = MBOX_CMD_GET_INIT_FW_CTRL_BLOCK; 201 277 mbox_cmd[2] = LSDW(init_fw_cb_dma); 202 278 mbox_cmd[3] = MSDW(init_fw_cb_dma); 203 - if (qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]) != 279 + mbox_cmd[4] = sizeof(struct init_fw_ctrl_blk); 280 + 281 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]) != 204 282 QLA_SUCCESS) { 205 283 dma_free_coherent(&ha->pdev->dev, 206 284 sizeof(struct init_fw_ctrl_blk), ··· 215 287 qla4xxx_init_rings(ha); 216 288 217 289 /* Fill in the request and response queue information. */ 218 - init_fw_cb->ReqQConsumerIndex = cpu_to_le16(ha->request_out); 219 - init_fw_cb->ComplQProducerIndex = cpu_to_le16(ha->response_in); 220 - init_fw_cb->ReqQLen = __constant_cpu_to_le16(REQUEST_QUEUE_DEPTH); 221 - init_fw_cb->ComplQLen = __constant_cpu_to_le16(RESPONSE_QUEUE_DEPTH); 222 - init_fw_cb->ReqQAddrLo = cpu_to_le32(LSDW(ha->request_dma)); 223 - init_fw_cb->ReqQAddrHi = cpu_to_le32(MSDW(ha->request_dma)); 224 - init_fw_cb->ComplQAddrLo = cpu_to_le32(LSDW(ha->response_dma)); 225 - init_fw_cb->ComplQAddrHi = cpu_to_le32(MSDW(ha->response_dma)); 226 - init_fw_cb->ShadowRegBufAddrLo = 290 + init_fw_cb->pri.rqq_consumer_idx = cpu_to_le16(ha->request_out); 291 + init_fw_cb->pri.compq_producer_idx = cpu_to_le16(ha->response_in); 292 + init_fw_cb->pri.rqq_len = __constant_cpu_to_le16(REQUEST_QUEUE_DEPTH); 293 + init_fw_cb->pri.compq_len = __constant_cpu_to_le16(RESPONSE_QUEUE_DEPTH); 294 + init_fw_cb->pri.rqq_addr_lo = cpu_to_le32(LSDW(ha->request_dma)); 295 + init_fw_cb->pri.rqq_addr_hi = cpu_to_le32(MSDW(ha->request_dma)); 296 + init_fw_cb->pri.compq_addr_lo = cpu_to_le32(LSDW(ha->response_dma)); 297 + init_fw_cb->pri.compq_addr_hi = cpu_to_le32(MSDW(ha->response_dma)); 298 + init_fw_cb->pri.shdwreg_addr_lo = 227 299 cpu_to_le32(LSDW(ha->shadow_regs_dma)); 228 - init_fw_cb->ShadowRegBufAddrHi = 300 + init_fw_cb->pri.shdwreg_addr_hi = 229 301 cpu_to_le32(MSDW(ha->shadow_regs_dma)); 230 302 231 303 /* Set up required options. */ 232 - init_fw_cb->FwOptions |= 304 + init_fw_cb->pri.fw_options |= 233 305 __constant_cpu_to_le16(FWOPT_SESSION_MODE | 234 306 FWOPT_INITIATOR_MODE); 235 - init_fw_cb->FwOptions &= __constant_cpu_to_le16(~FWOPT_TARGET_MODE); 307 + init_fw_cb->pri.fw_options &= __constant_cpu_to_le16(~FWOPT_TARGET_MODE); 236 308 237 309 /* Save some info in adapter structure. */ 238 - ha->firmware_options = le16_to_cpu(init_fw_cb->FwOptions); 239 - ha->tcp_options = le16_to_cpu(init_fw_cb->TCPOptions); 240 - ha->heartbeat_interval = init_fw_cb->HeartbeatInterval; 241 - memcpy(ha->ip_address, init_fw_cb->IPAddr, 242 - min(sizeof(ha->ip_address), sizeof(init_fw_cb->IPAddr))); 243 - memcpy(ha->subnet_mask, init_fw_cb->SubnetMask, 244 - min(sizeof(ha->subnet_mask), sizeof(init_fw_cb->SubnetMask))); 245 - memcpy(ha->gateway, init_fw_cb->GatewayIPAddr, 246 - min(sizeof(ha->gateway), sizeof(init_fw_cb->GatewayIPAddr))); 247 - memcpy(ha->name_string, init_fw_cb->iSCSINameString, 310 + ha->firmware_options = le16_to_cpu(init_fw_cb->pri.fw_options); 311 + ha->tcp_options = le16_to_cpu(init_fw_cb->pri.ipv4_tcp_opts); 312 + ha->heartbeat_interval = init_fw_cb->pri.hb_interval; 313 + memcpy(ha->ip_address, init_fw_cb->pri.ipv4_addr, 314 + min(sizeof(ha->ip_address), sizeof(init_fw_cb->pri.ipv4_addr))); 315 + memcpy(ha->subnet_mask, init_fw_cb->pri.ipv4_subnet, 316 + min(sizeof(ha->subnet_mask), sizeof(init_fw_cb->pri.ipv4_subnet))); 317 + memcpy(ha->gateway, init_fw_cb->pri.ipv4_gw_addr, 318 + min(sizeof(ha->gateway), sizeof(init_fw_cb->pri.ipv4_gw_addr))); 319 + memcpy(ha->name_string, init_fw_cb->pri.iscsi_name, 248 320 min(sizeof(ha->name_string), 249 - sizeof(init_fw_cb->iSCSINameString))); 250 - memcpy(ha->alias, init_fw_cb->Alias, 251 - min(sizeof(ha->alias), sizeof(init_fw_cb->Alias))); 321 + sizeof(init_fw_cb->pri.iscsi_name))); 322 + /*memcpy(ha->alias, init_fw_cb->Alias, 323 + min(sizeof(ha->alias), sizeof(init_fw_cb->Alias)));*/ 252 324 253 325 /* Save Command Line Paramater info */ 254 - ha->port_down_retry_count = le16_to_cpu(init_fw_cb->KeepAliveTimeout); 326 + ha->port_down_retry_count = le16_to_cpu(init_fw_cb->pri.conn_ka_timeout); 255 327 ha->discovery_wait = ql4xdiscoverywait; 256 328 257 329 /* Send Initialize Firmware Control Block. */ 330 + memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 331 + memset(&mbox_sts, 0, sizeof(mbox_sts)); 332 + 258 333 mbox_cmd[0] = MBOX_CMD_INITIALIZE_FIRMWARE; 259 334 mbox_cmd[1] = 0; 260 335 mbox_cmd[2] = LSDW(init_fw_cb_dma); 261 336 mbox_cmd[3] = MSDW(init_fw_cb_dma); 262 - if (qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]) == 337 + mbox_cmd[4] = sizeof(struct init_fw_ctrl_blk); 338 + 339 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]) == 263 340 QLA_SUCCESS) 264 341 status = QLA_SUCCESS; 265 342 else { ··· 301 368 /* Get Initialize Firmware Control Block. */ 302 369 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 303 370 memset(&mbox_sts, 0, sizeof(mbox_sts)); 371 + 304 372 memset(init_fw_cb, 0, sizeof(struct init_fw_ctrl_blk)); 305 373 mbox_cmd[0] = MBOX_CMD_GET_INIT_FW_CTRL_BLOCK; 306 374 mbox_cmd[2] = LSDW(init_fw_cb_dma); 307 375 mbox_cmd[3] = MSDW(init_fw_cb_dma); 376 + mbox_cmd[4] = sizeof(struct init_fw_ctrl_blk); 308 377 309 - if (qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]) != 378 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]) != 310 379 QLA_SUCCESS) { 311 380 DEBUG2(printk("scsi%ld: %s: Failed to get init_fw_ctrl_blk\n", 312 381 ha->host_no, __func__)); ··· 319 384 } 320 385 321 386 /* Save IP Address. */ 322 - memcpy(ha->ip_address, init_fw_cb->IPAddr, 323 - min(sizeof(ha->ip_address), sizeof(init_fw_cb->IPAddr))); 324 - memcpy(ha->subnet_mask, init_fw_cb->SubnetMask, 325 - min(sizeof(ha->subnet_mask), sizeof(init_fw_cb->SubnetMask))); 326 - memcpy(ha->gateway, init_fw_cb->GatewayIPAddr, 327 - min(sizeof(ha->gateway), sizeof(init_fw_cb->GatewayIPAddr))); 387 + memcpy(ha->ip_address, init_fw_cb->pri.ipv4_addr, 388 + min(sizeof(ha->ip_address), sizeof(init_fw_cb->pri.ipv4_addr))); 389 + memcpy(ha->subnet_mask, init_fw_cb->pri.ipv4_subnet, 390 + min(sizeof(ha->subnet_mask), sizeof(init_fw_cb->pri.ipv4_subnet))); 391 + memcpy(ha->gateway, init_fw_cb->pri.ipv4_gw_addr, 392 + min(sizeof(ha->gateway), sizeof(init_fw_cb->pri.ipv4_gw_addr))); 328 393 329 394 dma_free_coherent(&ha->pdev->dev, sizeof(struct init_fw_ctrl_blk), 330 395 init_fw_cb, init_fw_cb_dma); ··· 344 409 /* Get firmware version */ 345 410 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 346 411 memset(&mbox_sts, 0, sizeof(mbox_sts)); 412 + 347 413 mbox_cmd[0] = MBOX_CMD_GET_FW_STATE; 348 - if (qla4xxx_mailbox_command(ha, 1, 4, &mbox_cmd[0], &mbox_sts[0]) != 414 + 415 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 4, &mbox_cmd[0], &mbox_sts[0]) != 349 416 QLA_SUCCESS) { 350 417 DEBUG2(printk("scsi%ld: %s: MBOX_CMD_GET_FW_STATE failed w/ " 351 418 "status %04X\n", ha->host_no, __func__, ··· 375 438 /* Get firmware version */ 376 439 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 377 440 memset(&mbox_sts, 0, sizeof(mbox_sts)); 441 + 378 442 mbox_cmd[0] = MBOX_CMD_GET_FW_STATUS; 379 - if (qla4xxx_mailbox_command(ha, 1, 3, &mbox_cmd[0], &mbox_sts[0]) != 443 + 444 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 3, &mbox_cmd[0], &mbox_sts[0]) != 380 445 QLA_SUCCESS) { 381 446 DEBUG2(printk("scsi%ld: %s: MBOX_CMD_GET_FW_STATUS failed w/ " 382 447 "status %04X\n", ha->host_no, __func__, ··· 430 491 } 431 492 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 432 493 memset(&mbox_sts, 0, sizeof(mbox_sts)); 494 + 433 495 mbox_cmd[0] = MBOX_CMD_GET_DATABASE_ENTRY; 434 496 mbox_cmd[1] = (uint32_t) fw_ddb_index; 435 497 mbox_cmd[2] = LSDW(fw_ddb_entry_dma); 436 498 mbox_cmd[3] = MSDW(fw_ddb_entry_dma); 437 - if (qla4xxx_mailbox_command(ha, 4, 7, &mbox_cmd[0], &mbox_sts[0]) == 499 + mbox_cmd[4] = sizeof(struct dev_db_entry); 500 + 501 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 7, &mbox_cmd[0], &mbox_sts[0]) == 438 502 QLA_ERROR) { 439 503 DEBUG2(printk("scsi%ld: %s: MBOX_CMD_GET_DATABASE_ENTRY failed" 440 504 " with status 0x%04X\n", ha->host_no, __func__, ··· 454 512 dev_info(&ha->pdev->dev, "DDB[%d] MB0 %04x Tot %d Next %d " 455 513 "State %04x ConnErr %08x %d.%d.%d.%d:%04d \"%s\"\n", 456 514 fw_ddb_index, mbox_sts[0], mbox_sts[2], mbox_sts[3], 457 - mbox_sts[4], mbox_sts[5], fw_ddb_entry->ipAddr[0], 458 - fw_ddb_entry->ipAddr[1], fw_ddb_entry->ipAddr[2], 459 - fw_ddb_entry->ipAddr[3], 460 - le16_to_cpu(fw_ddb_entry->portNumber), 461 - fw_ddb_entry->iscsiName); 515 + mbox_sts[4], mbox_sts[5], fw_ddb_entry->ip_addr[0], 516 + fw_ddb_entry->ip_addr[1], fw_ddb_entry->ip_addr[2], 517 + fw_ddb_entry->ip_addr[3], 518 + le16_to_cpu(fw_ddb_entry->port), 519 + fw_ddb_entry->iscsi_name); 462 520 } 463 521 if (num_valid_ddb_entries) 464 522 *num_valid_ddb_entries = mbox_sts[2]; ··· 513 571 mbox_cmd[1] = (uint32_t) fw_ddb_index; 514 572 mbox_cmd[2] = LSDW(fw_ddb_entry_dma); 515 573 mbox_cmd[3] = MSDW(fw_ddb_entry_dma); 516 - return qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]); 574 + mbox_cmd[4] = sizeof(struct dev_db_entry); 575 + 576 + return qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]); 517 577 } 518 - 519 - #if 0 520 - int qla4xxx_conn_open_session_login(struct scsi_qla_host * ha, 521 - uint16_t fw_ddb_index) 522 - { 523 - int status = QLA_ERROR; 524 - uint32_t mbox_cmd[MBOX_REG_COUNT]; 525 - uint32_t mbox_sts[MBOX_REG_COUNT]; 526 - 527 - /* Do not wait for completion. The firmware will send us an 528 - * ASTS_DATABASE_CHANGED (0x8014) to notify us of the login status. 529 - */ 530 - memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 531 - memset(&mbox_sts, 0, sizeof(mbox_sts)); 532 - mbox_cmd[0] = MBOX_CMD_CONN_OPEN_SESS_LOGIN; 533 - mbox_cmd[1] = (uint32_t) fw_ddb_index; 534 - mbox_cmd[2] = 0; 535 - mbox_cmd[3] = 0; 536 - mbox_cmd[4] = 0; 537 - status = qla4xxx_mailbox_command(ha, 4, 0, &mbox_cmd[0], &mbox_sts[0]); 538 - DEBUG2(printk("%s fw_ddb_index=%d status=%d mbx0_1=0x%x :0x%x\n", 539 - __func__, fw_ddb_index, status, mbox_sts[0], 540 - mbox_sts[1]);) 541 - 542 - return status; 543 - } 544 - #endif /* 0 */ 545 578 546 579 /** 547 580 * qla4xxx_get_crash_record - retrieves crash record. ··· 531 614 struct crash_record *crash_record = NULL; 532 615 dma_addr_t crash_record_dma = 0; 533 616 uint32_t crash_record_size = 0; 617 + 534 618 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 535 619 memset(&mbox_sts, 0, sizeof(mbox_cmd)); 536 620 537 621 /* Get size of crash record. */ 538 622 mbox_cmd[0] = MBOX_CMD_GET_CRASH_RECORD; 539 - if (qla4xxx_mailbox_command(ha, 5, 5, &mbox_cmd[0], &mbox_sts[0]) != 623 + 624 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != 540 625 QLA_SUCCESS) { 541 626 DEBUG2(printk("scsi%ld: %s: ERROR: Unable to retrieve size!\n", 542 627 ha->host_no, __func__)); ··· 558 639 goto exit_get_crash_record; 559 640 560 641 /* Get Crash Record. */ 642 + memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 643 + memset(&mbox_sts, 0, sizeof(mbox_cmd)); 644 + 561 645 mbox_cmd[0] = MBOX_CMD_GET_CRASH_RECORD; 562 646 mbox_cmd[2] = LSDW(crash_record_dma); 563 647 mbox_cmd[3] = MSDW(crash_record_dma); 564 648 mbox_cmd[4] = crash_record_size; 565 - if (qla4xxx_mailbox_command(ha, 5, 5, &mbox_cmd[0], &mbox_sts[0]) != 649 + 650 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != 566 651 QLA_SUCCESS) 567 652 goto exit_get_crash_record; 568 653 ··· 578 655 crash_record, crash_record_dma); 579 656 } 580 657 581 - #if 0 582 658 /** 583 659 * qla4xxx_get_conn_event_log - retrieves connection event log 584 660 * @ha: Pointer to host adapter structure. ··· 600 678 601 679 /* Get size of crash record. */ 602 680 mbox_cmd[0] = MBOX_CMD_GET_CONN_EVENT_LOG; 603 - if (qla4xxx_mailbox_command(ha, 4, 5, &mbox_cmd[0], &mbox_sts[0]) != 681 + 682 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != 604 683 QLA_SUCCESS) 605 684 goto exit_get_event_log; 606 685 ··· 616 693 goto exit_get_event_log; 617 694 618 695 /* Get Crash Record. */ 696 + memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 697 + memset(&mbox_sts, 0, sizeof(mbox_cmd)); 698 + 619 699 mbox_cmd[0] = MBOX_CMD_GET_CONN_EVENT_LOG; 620 700 mbox_cmd[2] = LSDW(event_log_dma); 621 701 mbox_cmd[3] = MSDW(event_log_dma); 622 - if (qla4xxx_mailbox_command(ha, 4, 5, &mbox_cmd[0], &mbox_sts[0]) != 702 + 703 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != 623 704 QLA_SUCCESS) { 624 705 DEBUG2(printk("scsi%ld: %s: ERROR: Unable to retrieve event " 625 706 "log!\n", ha->host_no, __func__)); ··· 672 745 dma_free_coherent(&ha->pdev->dev, event_log_size, event_log, 673 746 event_log_dma); 674 747 } 675 - #endif /* 0 */ 676 748 677 749 /** 678 750 * qla4xxx_reset_lun - issues LUN Reset ··· 699 773 */ 700 774 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 701 775 memset(&mbox_sts, 0, sizeof(mbox_sts)); 776 + 702 777 mbox_cmd[0] = MBOX_CMD_LUN_RESET; 703 778 mbox_cmd[1] = ddb_entry->fw_ddb_index; 704 779 mbox_cmd[2] = lun << 8; 705 780 mbox_cmd[5] = 0x01; /* Immediate Command Enable */ 706 - qla4xxx_mailbox_command(ha, 6, 1, &mbox_cmd[0], &mbox_sts[0]); 781 + 782 + qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]); 707 783 if (mbox_sts[0] != MBOX_STS_COMMAND_COMPLETE && 708 784 mbox_sts[0] != MBOX_STS_COMMAND_ERROR) 709 785 status = QLA_ERROR; ··· 722 794 723 795 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 724 796 memset(&mbox_sts, 0, sizeof(mbox_sts)); 797 + 725 798 mbox_cmd[0] = MBOX_CMD_READ_FLASH; 726 799 mbox_cmd[1] = LSDW(dma_addr); 727 800 mbox_cmd[2] = MSDW(dma_addr); 728 801 mbox_cmd[3] = offset; 729 802 mbox_cmd[4] = len; 730 - if (qla4xxx_mailbox_command(ha, 5, 2, &mbox_cmd[0], &mbox_sts[0]) != 803 + 804 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, &mbox_cmd[0], &mbox_sts[0]) != 731 805 QLA_SUCCESS) { 732 806 DEBUG2(printk("scsi%ld: %s: MBOX_CMD_READ_FLASH, failed w/ " 733 807 "status %04X %04X, offset %08x, len %08x\n", ha->host_no, ··· 755 825 /* Get firmware version. */ 756 826 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 757 827 memset(&mbox_sts, 0, sizeof(mbox_sts)); 828 + 758 829 mbox_cmd[0] = MBOX_CMD_ABOUT_FW; 759 - if (qla4xxx_mailbox_command(ha, 4, 5, &mbox_cmd[0], &mbox_sts[0]) != 830 + 831 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) != 760 832 QLA_SUCCESS) { 761 833 DEBUG2(printk("scsi%ld: %s: MBOX_CMD_ABOUT_FW failed w/ " 762 834 "status %04X\n", ha->host_no, __func__, mbox_sts[0])); ··· 787 855 mbox_cmd[2] = LSDW(dma_addr); 788 856 mbox_cmd[3] = MSDW(dma_addr); 789 857 790 - if (qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]) != 858 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]) != 791 859 QLA_SUCCESS) { 792 860 DEBUG2(printk("scsi%ld: %s: failed status %04X\n", 793 861 ha->host_no, __func__, mbox_sts[0])); ··· 807 875 mbox_cmd[0] = MBOX_CMD_REQUEST_DATABASE_ENTRY; 808 876 mbox_cmd[1] = MAX_PRST_DEV_DB_ENTRIES; 809 877 810 - if (qla4xxx_mailbox_command(ha, 2, 3, &mbox_cmd[0], &mbox_sts[0]) != 878 + if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 3, &mbox_cmd[0], &mbox_sts[0]) != 811 879 QLA_SUCCESS) { 812 880 if (mbox_sts[0] == MBOX_STS_COMMAND_ERROR) { 813 881 *ddb_index = mbox_sts[2]; ··· 850 918 if (ret_val != QLA_SUCCESS) 851 919 goto qla4xxx_send_tgts_exit; 852 920 853 - memset((void *)fw_ddb_entry->iSCSIAlias, 0, 854 - sizeof(fw_ddb_entry->iSCSIAlias)); 921 + memset(fw_ddb_entry->iscsi_alias, 0, 922 + sizeof(fw_ddb_entry->iscsi_alias)); 855 923 856 - memset((void *)fw_ddb_entry->iscsiName, 0, 857 - sizeof(fw_ddb_entry->iscsiName)); 924 + memset(fw_ddb_entry->iscsi_name, 0, 925 + sizeof(fw_ddb_entry->iscsi_name)); 858 926 859 - memset((void *)fw_ddb_entry->ipAddr, 0, sizeof(fw_ddb_entry->ipAddr)); 860 - memset((void *)fw_ddb_entry->targetAddr, 0, 861 - sizeof(fw_ddb_entry->targetAddr)); 927 + memset(fw_ddb_entry->ip_addr, 0, sizeof(fw_ddb_entry->ip_addr)); 928 + memset(fw_ddb_entry->tgt_addr, 0, 929 + sizeof(fw_ddb_entry->tgt_addr)); 862 930 863 931 fw_ddb_entry->options = (DDB_OPT_DISC_SESSION | DDB_OPT_TARGET); 864 - fw_ddb_entry->portNumber = cpu_to_le16(ntohs(port)); 932 + fw_ddb_entry->port = cpu_to_le16(ntohs(port)); 865 933 866 - fw_ddb_entry->ipAddr[0] = *ip; 867 - fw_ddb_entry->ipAddr[1] = *(ip + 1); 868 - fw_ddb_entry->ipAddr[2] = *(ip + 2); 869 - fw_ddb_entry->ipAddr[3] = *(ip + 3); 934 + fw_ddb_entry->ip_addr[0] = *ip; 935 + fw_ddb_entry->ip_addr[1] = *(ip + 1); 936 + fw_ddb_entry->ip_addr[2] = *(ip + 2); 937 + fw_ddb_entry->ip_addr[3] = *(ip + 3); 870 938 871 939 ret_val = qla4xxx_set_ddb_entry(ha, ddb_index, fw_ddb_entry_dma); 872 940