aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-07-06 13:32:07 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-07-14 11:03:15 -0400
commitfa2a1ce53d4b869b74da9a770770c79f9af64914 (patch)
treeda350e79117d3177f51c2788c51aeba425afd4ca /drivers/scsi/qla2xxx/qla_os.c
parentba5140b48e35aa4e4b57eb6db5cface63d7bd712 (diff)
[SCSI] qla2xxx: Code scrubbing.
Code scrubbing. - Remove trailing whitespace from driver files. - Remove unused #defines and inlines. - Standardize on C comments (// -> /* */) Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 072906994bf5..fd7e730bb3ba 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -64,7 +64,7 @@ MODULE_PARM_DESC(ql2xplogiabsentdevice,
64int ql2xenablezio = 0; 64int ql2xenablezio = 0;
65module_param(ql2xenablezio, int, S_IRUGO|S_IRUSR); 65module_param(ql2xenablezio, int, S_IRUGO|S_IRUSR);
66MODULE_PARM_DESC(ql2xenablezio, 66MODULE_PARM_DESC(ql2xenablezio,
67 "Option to enable ZIO:If 1 then enable it otherwise" 67 "Option to enable ZIO:If 1 then enable it otherwise"
68 " use the default set in the NVRAM." 68 " use the default set in the NVRAM."
69 " Default is 0 : disabled"); 69 " Default is 0 : disabled");
70 70
@@ -89,7 +89,7 @@ static void qla2x00_free_device(scsi_qla_host_t *);
89static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); 89static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
90 90
91/* 91/*
92 * SCSI host template entry points 92 * SCSI host template entry points
93 */ 93 */
94static int qla2xxx_slave_configure(struct scsi_device * device); 94static int qla2xxx_slave_configure(struct scsi_device * device);
95static int qla2xxx_slave_alloc(struct scsi_device *); 95static int qla2xxx_slave_alloc(struct scsi_device *);
@@ -280,7 +280,7 @@ char *
280qla2x00_fw_version_str(struct scsi_qla_host *ha, char *str) 280qla2x00_fw_version_str(struct scsi_qla_host *ha, char *str)
281{ 281{
282 char un_str[10]; 282 char un_str[10];
283 283
284 sprintf(str, "%d.%02d.%02d ", ha->fw_major_version, 284 sprintf(str, "%d.%02d.%02d ", ha->fw_major_version,
285 ha->fw_minor_version, 285 ha->fw_minor_version,
286 ha->fw_subminor_version); 286 ha->fw_subminor_version);
@@ -504,14 +504,14 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
504 504
505/* 505/*
506 * qla2x00_wait_for_hba_online 506 * qla2x00_wait_for_hba_online
507 * Wait till the HBA is online after going through 507 * Wait till the HBA is online after going through
508 * <= MAX_RETRIES_OF_ISP_ABORT or 508 * <= MAX_RETRIES_OF_ISP_ABORT or
509 * finally HBA is disabled ie marked offline 509 * finally HBA is disabled ie marked offline
510 * 510 *
511 * Input: 511 * Input:
512 * ha - pointer to host adapter structure 512 * ha - pointer to host adapter structure
513 * 513 *
514 * Note: 514 * Note:
515 * Does context switching-Release SPIN_LOCK 515 * Does context switching-Release SPIN_LOCK
516 * (if any) before calling this routine. 516 * (if any) before calling this routine.
517 * 517 *
@@ -519,13 +519,13 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
519 * Success (Adapter is online) : 0 519 * Success (Adapter is online) : 0
520 * Failed (Adapter is offline/disabled) : 1 520 * Failed (Adapter is offline/disabled) : 1
521 */ 521 */
522static int 522static int
523qla2x00_wait_for_hba_online(scsi_qla_host_t *ha) 523qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
524{ 524{
525 int return_status; 525 int return_status;
526 unsigned long wait_online; 526 unsigned long wait_online;
527 527
528 wait_online = jiffies + (MAX_LOOP_TIMEOUT * HZ); 528 wait_online = jiffies + (MAX_LOOP_TIMEOUT * HZ);
529 while (((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) || 529 while (((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) ||
530 test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) || 530 test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) ||
531 test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) || 531 test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) ||
@@ -533,8 +533,8 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
533 533
534 msleep(1000); 534 msleep(1000);
535 } 535 }
536 if (ha->flags.online) 536 if (ha->flags.online)
537 return_status = QLA_SUCCESS; 537 return_status = QLA_SUCCESS;
538 else 538 else
539 return_status = QLA_FUNCTION_FAILED; 539 return_status = QLA_FUNCTION_FAILED;
540 540
@@ -546,27 +546,27 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
546/* 546/*
547 * qla2x00_wait_for_loop_ready 547 * qla2x00_wait_for_loop_ready
548 * Wait for MAX_LOOP_TIMEOUT(5 min) value for loop 548 * Wait for MAX_LOOP_TIMEOUT(5 min) value for loop
549 * to be in LOOP_READY state. 549 * to be in LOOP_READY state.
550 * Input: 550 * Input:
551 * ha - pointer to host adapter structure 551 * ha - pointer to host adapter structure
552 * 552 *
553 * Note: 553 * Note:
554 * Does context switching-Release SPIN_LOCK 554 * Does context switching-Release SPIN_LOCK
555 * (if any) before calling this routine. 555 * (if any) before calling this routine.
556 * 556 *
557 * 557 *
558 * Return: 558 * Return:
559 * Success (LOOP_READY) : 0 559 * Success (LOOP_READY) : 0
560 * Failed (LOOP_NOT_READY) : 1 560 * Failed (LOOP_NOT_READY) : 1
561 */ 561 */
562static inline int 562static inline int
563qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha) 563qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
564{ 564{
565 int return_status = QLA_SUCCESS; 565 int return_status = QLA_SUCCESS;
566 unsigned long loop_timeout ; 566 unsigned long loop_timeout ;
567 567
568 /* wait for 5 min at the max for loop to be ready */ 568 /* wait for 5 min at the max for loop to be ready */
569 loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ); 569 loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ);
570 570
571 while ((!atomic_read(&ha->loop_down_timer) && 571 while ((!atomic_read(&ha->loop_down_timer) &&
572 atomic_read(&ha->loop_state) == LOOP_DOWN) || 572 atomic_read(&ha->loop_state) == LOOP_DOWN) ||
@@ -577,7 +577,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
577 break; 577 break;
578 } 578 }
579 } 579 }
580 return (return_status); 580 return (return_status);
581} 581}
582 582
583/************************************************************************** 583/**************************************************************************
@@ -647,13 +647,13 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
647 /* Wait for the command to be returned. */ 647 /* Wait for the command to be returned. */
648 if (ret == SUCCESS) { 648 if (ret == SUCCESS) {
649 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 649 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
650 qla_printk(KERN_ERR, ha, 650 qla_printk(KERN_ERR, ha,
651 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 651 "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
652 "%x.\n", ha->host_no, id, lun, serial, ret); 652 "%x.\n", ha->host_no, id, lun, serial, ret);
653 } 653 }
654 } 654 }
655 655
656 qla_printk(KERN_INFO, ha, 656 qla_printk(KERN_INFO, ha,
657 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 657 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no,
658 id, lun, serial, ret); 658 id, lun, serial, ret);
659 659
@@ -668,7 +668,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
668* 668*
669* Input: 669* Input:
670* ha - pointer to scsi_qla_host structure. 670* ha - pointer to scsi_qla_host structure.
671* t - target 671* t - target
672* Returns: 672* Returns:
673* Either SUCCESS or FAILED. 673* Either SUCCESS or FAILED.
674* 674*
@@ -717,7 +717,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
717* executing commands. 717* executing commands.
718* 718*
719* NOTE: The use of SP is undefined within this context. Do *NOT* 719* NOTE: The use of SP is undefined within this context. Do *NOT*
720* attempt to use this value, even if you determine it is 720* attempt to use this value, even if you determine it is
721* non-null. 721* non-null.
722* 722*
723* Input: 723* Input:
@@ -793,7 +793,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
793 "commands\n", __func__, ha->host_no)); 793 "commands\n", __func__, ha->host_no));
794 qla_printk(KERN_INFO, ha, 794 qla_printk(KERN_INFO, ha,
795 "%s: failed while waiting for commands\n", 795 "%s: failed while waiting for commands\n",
796 __func__); 796 __func__);
797 797
798 goto eh_dev_reset_done; 798 goto eh_dev_reset_done;
799 } 799 }
@@ -959,7 +959,7 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
959 959
960 /* 960 /*
961 * Fixme-may be dpc thread is active and processing 961 * Fixme-may be dpc thread is active and processing
962 * loop_resync,so wait a while for it to 962 * loop_resync,so wait a while for it to
963 * be completed and then issue big hammer.Otherwise 963 * be completed and then issue big hammer.Otherwise
964 * it may cause I/O failure as big hammer marks the 964 * it may cause I/O failure as big hammer marks the
965 * devices as lost kicking of the port_down_timer 965 * devices as lost kicking of the port_down_timer
@@ -974,7 +974,7 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
974 974
975 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) 975 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
976 goto eh_host_reset_lock; 976 goto eh_host_reset_lock;
977 } 977 }
978 clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); 978 clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
979 979
980 /* Waiting for our command in done_queue to be returned to OS.*/ 980 /* Waiting for our command in done_queue to be returned to OS.*/
@@ -1020,7 +1020,7 @@ qla2x00_loop_reset(scsi_qla_host_t *ha)
1020 } 1020 }
1021 1021
1022 if (status == QLA_SUCCESS && 1022 if (status == QLA_SUCCESS &&
1023 ((!ha->flags.enable_target_reset && 1023 ((!ha->flags.enable_target_reset &&
1024 !ha->flags.enable_lip_reset) || 1024 !ha->flags.enable_lip_reset) ||
1025 ha->flags.enable_lip_full_login)) { 1025 ha->flags.enable_lip_full_login)) {
1026 1026
@@ -1139,7 +1139,7 @@ qla2x00_config_dma_addressing(scsi_qla_host_t *ha)
1139 1139
1140 if (pci_set_consistent_dma_mask(ha->pdev, 1140 if (pci_set_consistent_dma_mask(ha->pdev,
1141 DMA_64BIT_MASK)) { 1141 DMA_64BIT_MASK)) {
1142 qla_printk(KERN_DEBUG, ha, 1142 qla_printk(KERN_DEBUG, ha,
1143 "Failed to set 64 bit PCI consistent mask; " 1143 "Failed to set 64 bit PCI consistent mask; "
1144 "using 32 bit.\n"); 1144 "using 32 bit.\n");
1145 pci_set_consistent_dma_mask(ha->pdev, 1145 pci_set_consistent_dma_mask(ha->pdev,
@@ -1666,7 +1666,7 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *ha, fc_port_t *fcport,
1666{ 1666{
1667 if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport) 1667 if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport)
1668 fc_remote_port_block(fcport->rport); 1668 fc_remote_port_block(fcport->rport);
1669 /* 1669 /*
1670 * We may need to retry the login, so don't change the state of the 1670 * We may need to retry the login, so don't change the state of the
1671 * port but do the retries. 1671 * port but do the retries.
1672 */ 1672 */
@@ -1711,7 +1711,7 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *ha, fc_port_t *fcport,
1711 * Context: 1711 * Context:
1712 */ 1712 */
1713void 1713void
1714qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha) 1714qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha)
1715{ 1715{
1716 fc_port_t *fcport; 1716 fc_port_t *fcport;
1717 1717
@@ -2061,11 +2061,11 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
2061 * 2061 *
2062 * Context: 2062 * Context:
2063 * Kernel context. 2063 * Kernel context.
2064 * 2064 *
2065 * Note: Sets the ref_count for non Null sp to one. 2065 * Note: Sets the ref_count for non Null sp to one.
2066 */ 2066 */
2067static int 2067static int
2068qla2x00_allocate_sp_pool(scsi_qla_host_t *ha) 2068qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
2069{ 2069{
2070 int rval; 2070 int rval;
2071 2071
@@ -2081,10 +2081,10 @@ qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
2081 2081
2082/* 2082/*
2083 * This routine frees all adapter allocated memory. 2083 * This routine frees all adapter allocated memory.
2084 * 2084 *
2085 */ 2085 */
2086static void 2086static void
2087qla2x00_free_sp_pool( scsi_qla_host_t *ha) 2087qla2x00_free_sp_pool( scsi_qla_host_t *ha)
2088{ 2088{
2089 if (ha->srb_mempool) { 2089 if (ha->srb_mempool) {
2090 mempool_destroy(ha->srb_mempool); 2090 mempool_destroy(ha->srb_mempool);
@@ -2223,7 +2223,7 @@ qla2x00_do_dpc(void *data)
2223 2223
2224 DEBUG(printk("scsi(%ld): port login OK: logged in ID 0x%x\n", 2224 DEBUG(printk("scsi(%ld): port login OK: logged in ID 0x%x\n",
2225 ha->host_no, fcport->loop_id)); 2225 ha->host_no, fcport->loop_id));
2226 2226
2227 fcport->port_login_retry_count = 2227 fcport->port_login_retry_count =
2228 ha->port_down_retry_count * PORT_RETRY_TIME; 2228 ha->port_down_retry_count * PORT_RETRY_TIME;
2229 atomic_set(&fcport->state, FCS_ONLINE); 2229 atomic_set(&fcport->state, FCS_ONLINE);
@@ -2254,7 +2254,7 @@ qla2x00_do_dpc(void *data)
2254 clear_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags); 2254 clear_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags);
2255 DEBUG(printk("scsi(%ld): qla2x00_login_retry()\n", 2255 DEBUG(printk("scsi(%ld): qla2x00_login_retry()\n",
2256 ha->host_no)); 2256 ha->host_no));
2257 2257
2258 set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); 2258 set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
2259 2259
2260 DEBUG(printk("scsi(%ld): qla2x00_login_retry - end\n", 2260 DEBUG(printk("scsi(%ld): qla2x00_login_retry - end\n",
@@ -2315,7 +2315,7 @@ qla2x00_do_dpc(void *data)
2315* ha = adapter block pointer. 2315* ha = adapter block pointer.
2316*/ 2316*/
2317static void 2317static void
2318qla2x00_rst_aen(scsi_qla_host_t *ha) 2318qla2x00_rst_aen(scsi_qla_host_t *ha)
2319{ 2319{
2320 if (ha->flags.online && !ha->flags.reset_active && 2320 if (ha->flags.online && !ha->flags.reset_active &&
2321 !atomic_read(&ha->loop_down_timer) && 2321 !atomic_read(&ha->loop_down_timer) &&
@@ -2386,7 +2386,7 @@ qla2x00_timer(scsi_qla_host_t *ha)
2386 * 2386 *
2387 * Whenever, a port is in the LOST state we start decrementing its port 2387 * Whenever, a port is in the LOST state we start decrementing its port
2388 * down timer every second until it reaches zero. Once it reaches zero 2388 * down timer every second until it reaches zero. Once it reaches zero
2389 * the port it marked DEAD. 2389 * the port it marked DEAD.
2390 */ 2390 */
2391 t = 0; 2391 t = 0;
2392 list_for_each_entry(fcport, &ha->fcports, list) { 2392 list_for_each_entry(fcport, &ha->fcports, list) {
@@ -2398,9 +2398,9 @@ qla2x00_timer(scsi_qla_host_t *ha)
2398 if (atomic_read(&fcport->port_down_timer) == 0) 2398 if (atomic_read(&fcport->port_down_timer) == 0)
2399 continue; 2399 continue;
2400 2400
2401 if (atomic_dec_and_test(&fcport->port_down_timer) != 0) 2401 if (atomic_dec_and_test(&fcport->port_down_timer) != 0)
2402 atomic_set(&fcport->state, FCS_DEVICE_DEAD); 2402 atomic_set(&fcport->state, FCS_DEVICE_DEAD);
2403 2403
2404 DEBUG(printk("scsi(%ld): fcport-%d - port retry count: " 2404 DEBUG(printk("scsi(%ld): fcport-%d - port retry count: "
2405 "%d remaining\n", 2405 "%d remaining\n",
2406 ha->host_no, 2406 ha->host_no,
@@ -2422,7 +2422,7 @@ qla2x00_timer(scsi_qla_host_t *ha)
2422 ha->host_no)); 2422 ha->host_no));
2423 2423
2424 if (!IS_QLA2100(ha) && ha->link_down_timeout) 2424 if (!IS_QLA2100(ha) && ha->link_down_timeout)
2425 atomic_set(&ha->loop_state, LOOP_DEAD); 2425 atomic_set(&ha->loop_state, LOOP_DEAD);
2426 2426
2427 /* Schedule an ISP abort to return any tape commands. */ 2427 /* Schedule an ISP abort to return any tape commands. */
2428 spin_lock_irqsave(&ha->hardware_lock, cpu_flags); 2428 spin_lock_irqsave(&ha->hardware_lock, cpu_flags);