diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-01-11 01:52:48 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-23 12:29:22 -0500 |
commit | 13815c8344a238c204e4f4339b22dc4833c6df0f (patch) | |
tree | 207bb747f79221499c79a4eb29419921521ecb56 /drivers/scsi/lpfc/lpfc_attr.c | |
parent | fa61a54e48efc8e5c7a6d4680ad8ceb74a5fca84 (diff) |
[SCSI] lpfc 8.2.4 : Add parameters to enable and disable heartbeat and hba resets
Add parameters to enable and disable heartbeat and hba resets
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index e1b041d8f6d5..68e92be1ef5b 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -342,6 +342,9 @@ lpfc_selective_reset(struct lpfc_hba *phba) | |||
342 | struct completion online_compl; | 342 | struct completion online_compl; |
343 | int status = 0; | 343 | int status = 0; |
344 | 344 | ||
345 | if (!phba->cfg_enable_hba_reset) | ||
346 | return -EIO; | ||
347 | |||
345 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); | 348 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); |
346 | 349 | ||
347 | if (status != 0) | 350 | if (status != 0) |
@@ -415,6 +418,8 @@ lpfc_board_mode_store(struct class_device *cdev, const char *buf, size_t count) | |||
415 | struct completion online_compl; | 418 | struct completion online_compl; |
416 | int status=0; | 419 | int status=0; |
417 | 420 | ||
421 | if (!phba->cfg_enable_hba_reset) | ||
422 | return -EACCES; | ||
418 | init_completion(&online_compl); | 423 | init_completion(&online_compl); |
419 | 424 | ||
420 | if(strncmp(buf, "online", sizeof("online") - 1) == 0) { | 425 | if(strncmp(buf, "online", sizeof("online") - 1) == 0) { |
@@ -979,6 +984,8 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count) | |||
979 | unsigned int i, j, cnt=count; | 984 | unsigned int i, j, cnt=count; |
980 | u8 wwpn[8]; | 985 | u8 wwpn[8]; |
981 | 986 | ||
987 | if (!phba->cfg_enable_hba_reset) | ||
988 | return -EACCES; | ||
982 | spin_lock_irq(&phba->hbalock); | 989 | spin_lock_irq(&phba->hbalock); |
983 | if (phba->over_temp_state == HBA_OVER_TEMP) { | 990 | if (phba->over_temp_state == HBA_OVER_TEMP) { |
984 | spin_unlock_irq(&phba->hbalock); | 991 | spin_unlock_irq(&phba->hbalock); |
@@ -1506,7 +1513,21 @@ LPFC_ATTR_RW(poll_tmo, 10, 1, 255, | |||
1506 | */ | 1513 | */ |
1507 | LPFC_ATTR_R(use_msi, 0, 0, 1, "Use Message Signaled Interrupts, if possible"); | 1514 | LPFC_ATTR_R(use_msi, 0, 0, 1, "Use Message Signaled Interrupts, if possible"); |
1508 | 1515 | ||
1516 | /* | ||
1517 | # lpfc_enable_hba_reset: Allow or prevent HBA resets to the hardware. | ||
1518 | # 0 = HBA resets disabled | ||
1519 | # 1 = HBA resets enabled (default) | ||
1520 | # Value range is [0,1]. Default value is 1. | ||
1521 | */ | ||
1522 | LPFC_ATTR_R(enable_hba_reset, 1, 0, 1, "Enable HBA resets from the driver."); | ||
1509 | 1523 | ||
1524 | /* | ||
1525 | # lpfc_enable_hba_heartbeat: Enable HBA heartbeat timer.. | ||
1526 | # 0 = HBA Heartbeat disabled | ||
1527 | # 1 = HBA Heartbeat enabled (default) | ||
1528 | # Value range is [0,1]. Default value is 1. | ||
1529 | */ | ||
1530 | LPFC_ATTR_R(enable_hba_heartbeat, 1, 0, 1, "Enable HBA Heartbeat."); | ||
1510 | 1531 | ||
1511 | struct class_device_attribute *lpfc_hba_attrs[] = { | 1532 | struct class_device_attribute *lpfc_hba_attrs[] = { |
1512 | &class_device_attr_info, | 1533 | &class_device_attr_info, |
@@ -1558,6 +1579,8 @@ struct class_device_attribute *lpfc_hba_attrs[] = { | |||
1558 | &class_device_attr_lpfc_soft_wwnn, | 1579 | &class_device_attr_lpfc_soft_wwnn, |
1559 | &class_device_attr_lpfc_soft_wwpn, | 1580 | &class_device_attr_lpfc_soft_wwpn, |
1560 | &class_device_attr_lpfc_soft_wwn_enable, | 1581 | &class_device_attr_lpfc_soft_wwn_enable, |
1582 | &class_device_attr_lpfc_enable_hba_reset, | ||
1583 | &class_device_attr_lpfc_enable_hba_heartbeat, | ||
1561 | NULL, | 1584 | NULL, |
1562 | }; | 1585 | }; |
1563 | 1586 | ||
@@ -2448,6 +2471,8 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) | |||
2448 | lpfc_poll_tmo_init(phba, lpfc_poll_tmo); | 2471 | lpfc_poll_tmo_init(phba, lpfc_poll_tmo); |
2449 | lpfc_enable_npiv_init(phba, lpfc_enable_npiv); | 2472 | lpfc_enable_npiv_init(phba, lpfc_enable_npiv); |
2450 | lpfc_use_msi_init(phba, lpfc_use_msi); | 2473 | lpfc_use_msi_init(phba, lpfc_use_msi); |
2474 | lpfc_enable_hba_reset_init(phba, lpfc_enable_hba_reset); | ||
2475 | lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat); | ||
2451 | phba->cfg_poll = lpfc_poll; | 2476 | phba->cfg_poll = lpfc_poll; |
2452 | phba->cfg_soft_wwnn = 0L; | 2477 | phba->cfg_soft_wwnn = 0L; |
2453 | phba->cfg_soft_wwpn = 0L; | 2478 | phba->cfg_soft_wwpn = 0L; |