aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_mbx.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2012-02-27 06:08:54 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-29 17:59:19 -0500
commitfca9f04d460bf7c6af397dd994f1d81a3037f9dc (patch)
tree5daa8c66f56c49d189e698511e067df795b915b2 /drivers/scsi/qla4xxx/ql4_mbx.c
parent30534952743f73f1de3c6c056400d7249f5c7f75 (diff)
[SCSI] qla4xxx: Export CHAP index as sysfs attribute
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index eaf21852887c..71331e3b4404 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1426,8 +1426,8 @@ exit_set_chap:
1426 * match is found. If a match is not found then add the entry in FLASH and 1426 * match is found. If a match is not found then add the entry in FLASH and
1427 * return the index at which entry is written in the FLASH. 1427 * return the index at which entry is written in the FLASH.
1428 **/ 1428 **/
1429static int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username, 1429int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,
1430 char *password, int bidi, uint16_t *chap_index) 1430 char *password, int bidi, uint16_t *chap_index)
1431{ 1431{
1432 int i, rval; 1432 int i, rval;
1433 int free_index = -1; 1433 int free_index = -1;
@@ -1446,6 +1446,11 @@ static int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,
1446 return QLA_ERROR; 1446 return QLA_ERROR;
1447 } 1447 }
1448 1448
1449 if (!username || !password) {
1450 ql4_printk(KERN_ERR, ha, "Do not have username and psw\n");
1451 return QLA_ERROR;
1452 }
1453
1449 mutex_lock(&ha->chap_sem); 1454 mutex_lock(&ha->chap_sem);
1450 for (i = 0; i < max_chap_entries; i++) { 1455 for (i = 0; i < max_chap_entries; i++) {
1451 chap_table = (struct ql4_chap_table *)ha->chap_list + i; 1456 chap_table = (struct ql4_chap_table *)ha->chap_list + i;