diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index adf97320574b..1dd8591bd5c2 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -428,6 +428,19 @@ qla2x00_sysfs_read_sfp(struct kobject *kobj, | |||
428 | if (!capable(CAP_SYS_ADMIN) || off != 0 || count != SFP_DEV_SIZE * 2) | 428 | if (!capable(CAP_SYS_ADMIN) || off != 0 || count != SFP_DEV_SIZE * 2) |
429 | return 0; | 429 | return 0; |
430 | 430 | ||
431 | if (ha->sfp_data) | ||
432 | goto do_read; | ||
433 | |||
434 | ha->sfp_data = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, | ||
435 | &ha->sfp_data_dma); | ||
436 | if (!ha->sfp_data) { | ||
437 | qla_printk(KERN_WARNING, ha, | ||
438 | "Unable to allocate memory for SFP read-data.\n"); | ||
439 | return 0; | ||
440 | } | ||
441 | |||
442 | do_read: | ||
443 | memset(ha->sfp_data, 0, SFP_BLOCK_SIZE); | ||
431 | addr = 0xa0; | 444 | addr = 0xa0; |
432 | for (iter = 0, offset = 0; iter < (SFP_DEV_SIZE * 2) / SFP_BLOCK_SIZE; | 445 | for (iter = 0, offset = 0; iter < (SFP_DEV_SIZE * 2) / SFP_BLOCK_SIZE; |
433 | iter++, offset += SFP_BLOCK_SIZE) { | 446 | iter++, offset += SFP_BLOCK_SIZE) { |