diff options
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_ctl.c')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_ctl.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index a04b4ff8c7f6..28b4e8139153 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c | |||
@@ -323,24 +323,17 @@ static ssize_t pm8001_ctl_ib_queue_log_show(struct device *cdev, | |||
323 | int offset; | 323 | int offset; |
324 | char *str = buf; | 324 | char *str = buf; |
325 | int start = 0; | 325 | int start = 0; |
326 | #define IB_MEMMAP(c) \ | 326 | #define IB_MEMMAP(c) \ |
327 | (*(u32 *)((u8 *)pm8001_ha-> \ | 327 | (*(u32 *)((u8 *)pm8001_ha-> \ |
328 | memoryMap.region[IB].virt_ptr + \ | 328 | memoryMap.region[IB].virt_ptr + \ |
329 | pm8001_ha->evtlog_ib_offset + (c))) | 329 | pm8001_ha->evtlog_ib_offset + (c))) |
330 | 330 | ||
331 | for (offset = 0; offset < IB_OB_READ_TIMES; offset++) { | 331 | for (offset = 0; offset < IB_OB_READ_TIMES; offset++) { |
332 | if (pm8001_ha->chip_id != chip_8001) | 332 | str += sprintf(str, "0x%08x\n", IB_MEMMAP(start)); |
333 | str += sprintf(str, "0x%08x\n", IB_MEMMAP(start)); | ||
334 | else | ||
335 | str += sprintf(str, "0x%08x\n", IB_MEMMAP(start)); | ||
336 | start = start + 4; | 333 | start = start + 4; |
337 | } | 334 | } |
338 | pm8001_ha->evtlog_ib_offset += SYSFS_OFFSET; | 335 | pm8001_ha->evtlog_ib_offset += SYSFS_OFFSET; |
339 | if ((((pm8001_ha->evtlog_ib_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) | 336 | if (((pm8001_ha->evtlog_ib_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) |
340 | && (pm8001_ha->chip_id != chip_8001)) | ||
341 | pm8001_ha->evtlog_ib_offset = 0; | ||
342 | if ((((pm8001_ha->evtlog_ib_offset) % (PM8001_IB_OB_QUEUE_SIZE)) == 0) | ||
343 | && (pm8001_ha->chip_id == chip_8001)) | ||
344 | pm8001_ha->evtlog_ib_offset = 0; | 337 | pm8001_ha->evtlog_ib_offset = 0; |
345 | 338 | ||
346 | return str - buf; | 339 | return str - buf; |
@@ -363,24 +356,17 @@ static ssize_t pm8001_ctl_ob_queue_log_show(struct device *cdev, | |||
363 | int offset; | 356 | int offset; |
364 | char *str = buf; | 357 | char *str = buf; |
365 | int start = 0; | 358 | int start = 0; |
366 | #define OB_MEMMAP(c) \ | 359 | #define OB_MEMMAP(c) \ |
367 | (*(u32 *)((u8 *)pm8001_ha-> \ | 360 | (*(u32 *)((u8 *)pm8001_ha-> \ |
368 | memoryMap.region[OB].virt_ptr + \ | 361 | memoryMap.region[OB].virt_ptr + \ |
369 | pm8001_ha->evtlog_ob_offset + (c))) | 362 | pm8001_ha->evtlog_ob_offset + (c))) |
370 | 363 | ||
371 | for (offset = 0; offset < IB_OB_READ_TIMES; offset++) { | 364 | for (offset = 0; offset < IB_OB_READ_TIMES; offset++) { |
372 | if (pm8001_ha->chip_id != chip_8001) | 365 | str += sprintf(str, "0x%08x\n", OB_MEMMAP(start)); |
373 | str += sprintf(str, "0x%08x\n", OB_MEMMAP(start)); | ||
374 | else | ||
375 | str += sprintf(str, "0x%08x\n", OB_MEMMAP(start)); | ||
376 | start = start + 4; | 366 | start = start + 4; |
377 | } | 367 | } |
378 | pm8001_ha->evtlog_ob_offset += SYSFS_OFFSET; | 368 | pm8001_ha->evtlog_ob_offset += SYSFS_OFFSET; |
379 | if ((((pm8001_ha->evtlog_ob_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) | 369 | if (((pm8001_ha->evtlog_ob_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) |
380 | && (pm8001_ha->chip_id != chip_8001)) | ||
381 | pm8001_ha->evtlog_ob_offset = 0; | ||
382 | if ((((pm8001_ha->evtlog_ob_offset) % (PM8001_IB_OB_QUEUE_SIZE)) == 0) | ||
383 | && (pm8001_ha->chip_id == chip_8001)) | ||
384 | pm8001_ha->evtlog_ob_offset = 0; | 370 | pm8001_ha->evtlog_ob_offset = 0; |
385 | 371 | ||
386 | return str - buf; | 372 | return str - buf; |
@@ -466,7 +452,7 @@ static DEVICE_ATTR(iop_log, S_IRUGO, pm8001_ctl_iop_log_show, NULL); | |||
466 | static ssize_t pm8001_ctl_fatal_log_show(struct device *cdev, | 452 | static ssize_t pm8001_ctl_fatal_log_show(struct device *cdev, |
467 | struct device_attribute *attr, char *buf) | 453 | struct device_attribute *attr, char *buf) |
468 | { | 454 | { |
469 | u32 count; | 455 | ssize_t count; |
470 | 456 | ||
471 | count = pm80xx_get_fatal_dump(cdev, attr, buf); | 457 | count = pm80xx_get_fatal_dump(cdev, attr, buf); |
472 | return count; | 458 | return count; |
@@ -484,7 +470,7 @@ static DEVICE_ATTR(fatal_log, S_IRUGO, pm8001_ctl_fatal_log_show, NULL); | |||
484 | static ssize_t pm8001_ctl_gsm_log_show(struct device *cdev, | 470 | static ssize_t pm8001_ctl_gsm_log_show(struct device *cdev, |
485 | struct device_attribute *attr, char *buf) | 471 | struct device_attribute *attr, char *buf) |
486 | { | 472 | { |
487 | u32 count; | 473 | ssize_t count; |
488 | 474 | ||
489 | count = pm8001_get_gsm_dump(cdev, SYSFS_OFFSET, buf); | 475 | count = pm8001_get_gsm_dump(cdev, SYSFS_OFFSET, buf); |
490 | return count; | 476 | return count; |