diff options
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 122 |
1 files changed, 68 insertions, 54 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 89c63147a15d..b109bd8a4d19 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -3300,9 +3300,10 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
3300 | } | 3300 | } |
3301 | 3301 | ||
3302 | static ssize_t | 3302 | static ssize_t |
3303 | mptscsih_version_fw_show(struct class_device *cdev, char *buf) | 3303 | mptscsih_version_fw_show(struct device *dev, struct device_attribute *attr, |
3304 | char *buf) | ||
3304 | { | 3305 | { |
3305 | struct Scsi_Host *host = class_to_shost(cdev); | 3306 | struct Scsi_Host *host = class_to_shost(dev); |
3306 | MPT_SCSI_HOST *hd = shost_priv(host); | 3307 | MPT_SCSI_HOST *hd = shost_priv(host); |
3307 | MPT_ADAPTER *ioc = hd->ioc; | 3308 | MPT_ADAPTER *ioc = hd->ioc; |
3308 | 3309 | ||
@@ -3312,12 +3313,13 @@ mptscsih_version_fw_show(struct class_device *cdev, char *buf) | |||
3312 | (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8, | 3313 | (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8, |
3313 | ioc->facts.FWVersion.Word & 0x000000FF); | 3314 | ioc->facts.FWVersion.Word & 0x000000FF); |
3314 | } | 3315 | } |
3315 | static CLASS_DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL); | 3316 | static DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL); |
3316 | 3317 | ||
3317 | static ssize_t | 3318 | static ssize_t |
3318 | mptscsih_version_bios_show(struct class_device *cdev, char *buf) | 3319 | mptscsih_version_bios_show(struct device *dev, struct device_attribute *attr, |
3320 | char *buf) | ||
3319 | { | 3321 | { |
3320 | struct Scsi_Host *host = class_to_shost(cdev); | 3322 | struct Scsi_Host *host = class_to_shost(dev); |
3321 | MPT_SCSI_HOST *hd = shost_priv(host); | 3323 | MPT_SCSI_HOST *hd = shost_priv(host); |
3322 | MPT_ADAPTER *ioc = hd->ioc; | 3324 | MPT_ADAPTER *ioc = hd->ioc; |
3323 | 3325 | ||
@@ -3327,129 +3329,141 @@ mptscsih_version_bios_show(struct class_device *cdev, char *buf) | |||
3327 | (ioc->biosVersion & 0x0000FF00) >> 8, | 3329 | (ioc->biosVersion & 0x0000FF00) >> 8, |
3328 | ioc->biosVersion & 0x000000FF); | 3330 | ioc->biosVersion & 0x000000FF); |
3329 | } | 3331 | } |
3330 | static CLASS_DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL); | 3332 | static DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL); |
3331 | 3333 | ||
3332 | static ssize_t | 3334 | static ssize_t |
3333 | mptscsih_version_mpi_show(struct class_device *cdev, char *buf) | 3335 | mptscsih_version_mpi_show(struct device *dev, struct device_attribute *attr, |
3336 | char *buf) | ||
3334 | { | 3337 | { |
3335 | struct Scsi_Host *host = class_to_shost(cdev); | 3338 | struct Scsi_Host *host = class_to_shost(dev); |
3336 | MPT_SCSI_HOST *hd = shost_priv(host); | 3339 | MPT_SCSI_HOST *hd = shost_priv(host); |
3337 | MPT_ADAPTER *ioc = hd->ioc; | 3340 | MPT_ADAPTER *ioc = hd->ioc; |
3338 | 3341 | ||
3339 | return snprintf(buf, PAGE_SIZE, "%03x\n", ioc->facts.MsgVersion); | 3342 | return snprintf(buf, PAGE_SIZE, "%03x\n", ioc->facts.MsgVersion); |
3340 | } | 3343 | } |
3341 | static CLASS_DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL); | 3344 | static DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL); |
3342 | 3345 | ||
3343 | static ssize_t | 3346 | static ssize_t |
3344 | mptscsih_version_product_show(struct class_device *cdev, char *buf) | 3347 | mptscsih_version_product_show(struct device *dev, |
3348 | struct device_attribute *attr, | ||
3349 | char *buf) | ||
3345 | { | 3350 | { |
3346 | struct Scsi_Host *host = class_to_shost(cdev); | 3351 | struct Scsi_Host *host = class_to_shost(dev); |
3347 | MPT_SCSI_HOST *hd = shost_priv(host); | 3352 | MPT_SCSI_HOST *hd = shost_priv(host); |
3348 | MPT_ADAPTER *ioc = hd->ioc; | 3353 | MPT_ADAPTER *ioc = hd->ioc; |
3349 | 3354 | ||
3350 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name); | 3355 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name); |
3351 | } | 3356 | } |
3352 | static CLASS_DEVICE_ATTR(version_product, S_IRUGO, | 3357 | static DEVICE_ATTR(version_product, S_IRUGO, |
3353 | mptscsih_version_product_show, NULL); | 3358 | mptscsih_version_product_show, NULL); |
3354 | 3359 | ||
3355 | static ssize_t | 3360 | static ssize_t |
3356 | mptscsih_version_nvdata_persistent_show(struct class_device *cdev, char *buf) | 3361 | mptscsih_version_nvdata_persistent_show(struct device *dev, |
3362 | struct device_attribute *attr, | ||
3363 | char *buf) | ||
3357 | { | 3364 | { |
3358 | struct Scsi_Host *host = class_to_shost(cdev); | 3365 | struct Scsi_Host *host = class_to_shost(dev); |
3359 | MPT_SCSI_HOST *hd = shost_priv(host); | 3366 | MPT_SCSI_HOST *hd = shost_priv(host); |
3360 | MPT_ADAPTER *ioc = hd->ioc; | 3367 | MPT_ADAPTER *ioc = hd->ioc; |
3361 | 3368 | ||
3362 | return snprintf(buf, PAGE_SIZE, "%02xh\n", | 3369 | return snprintf(buf, PAGE_SIZE, "%02xh\n", |
3363 | ioc->nvdata_version_persistent); | 3370 | ioc->nvdata_version_persistent); |
3364 | } | 3371 | } |
3365 | static CLASS_DEVICE_ATTR(version_nvdata_persistent, S_IRUGO, | 3372 | static DEVICE_ATTR(version_nvdata_persistent, S_IRUGO, |
3366 | mptscsih_version_nvdata_persistent_show, NULL); | 3373 | mptscsih_version_nvdata_persistent_show, NULL); |
3367 | 3374 | ||
3368 | static ssize_t | 3375 | static ssize_t |
3369 | mptscsih_version_nvdata_default_show(struct class_device *cdev, char *buf) | 3376 | mptscsih_version_nvdata_default_show(struct device *dev, |
3377 | struct device_attribute *attr, char *buf) | ||
3370 | { | 3378 | { |
3371 | struct Scsi_Host *host = class_to_shost(cdev); | 3379 | struct Scsi_Host *host = class_to_shost(dev); |
3372 | MPT_SCSI_HOST *hd = shost_priv(host); | 3380 | MPT_SCSI_HOST *hd = shost_priv(host); |
3373 | MPT_ADAPTER *ioc = hd->ioc; | 3381 | MPT_ADAPTER *ioc = hd->ioc; |
3374 | 3382 | ||
3375 | return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default); | 3383 | return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default); |
3376 | } | 3384 | } |
3377 | static CLASS_DEVICE_ATTR(version_nvdata_default, S_IRUGO, | 3385 | static DEVICE_ATTR(version_nvdata_default, S_IRUGO, |
3378 | mptscsih_version_nvdata_default_show, NULL); | 3386 | mptscsih_version_nvdata_default_show, NULL); |
3379 | 3387 | ||
3380 | static ssize_t | 3388 | static ssize_t |
3381 | mptscsih_board_name_show(struct class_device *cdev, char *buf) | 3389 | mptscsih_board_name_show(struct device *dev, struct device_attribute *attr, |
3390 | char *buf) | ||
3382 | { | 3391 | { |
3383 | struct Scsi_Host *host = class_to_shost(cdev); | 3392 | struct Scsi_Host *host = class_to_shost(dev); |
3384 | MPT_SCSI_HOST *hd = shost_priv(host); | 3393 | MPT_SCSI_HOST *hd = shost_priv(host); |
3385 | MPT_ADAPTER *ioc = hd->ioc; | 3394 | MPT_ADAPTER *ioc = hd->ioc; |
3386 | 3395 | ||
3387 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name); | 3396 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name); |
3388 | } | 3397 | } |
3389 | static CLASS_DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL); | 3398 | static DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL); |
3390 | 3399 | ||
3391 | static ssize_t | 3400 | static ssize_t |
3392 | mptscsih_board_assembly_show(struct class_device *cdev, char *buf) | 3401 | mptscsih_board_assembly_show(struct device *dev, |
3402 | struct device_attribute *attr, char *buf) | ||
3393 | { | 3403 | { |
3394 | struct Scsi_Host *host = class_to_shost(cdev); | 3404 | struct Scsi_Host *host = class_to_shost(dev); |
3395 | MPT_SCSI_HOST *hd = shost_priv(host); | 3405 | MPT_SCSI_HOST *hd = shost_priv(host); |
3396 | MPT_ADAPTER *ioc = hd->ioc; | 3406 | MPT_ADAPTER *ioc = hd->ioc; |
3397 | 3407 | ||
3398 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly); | 3408 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly); |
3399 | } | 3409 | } |
3400 | static CLASS_DEVICE_ATTR(board_assembly, S_IRUGO, | 3410 | static DEVICE_ATTR(board_assembly, S_IRUGO, |
3401 | mptscsih_board_assembly_show, NULL); | 3411 | mptscsih_board_assembly_show, NULL); |
3402 | 3412 | ||
3403 | static ssize_t | 3413 | static ssize_t |
3404 | mptscsih_board_tracer_show(struct class_device *cdev, char *buf) | 3414 | mptscsih_board_tracer_show(struct device *dev, struct device_attribute *attr, |
3415 | char *buf) | ||
3405 | { | 3416 | { |
3406 | struct Scsi_Host *host = class_to_shost(cdev); | 3417 | struct Scsi_Host *host = class_to_shost(dev); |
3407 | MPT_SCSI_HOST *hd = shost_priv(host); | 3418 | MPT_SCSI_HOST *hd = shost_priv(host); |
3408 | MPT_ADAPTER *ioc = hd->ioc; | 3419 | MPT_ADAPTER *ioc = hd->ioc; |
3409 | 3420 | ||
3410 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer); | 3421 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer); |
3411 | } | 3422 | } |
3412 | static CLASS_DEVICE_ATTR(board_tracer, S_IRUGO, | 3423 | static DEVICE_ATTR(board_tracer, S_IRUGO, |
3413 | mptscsih_board_tracer_show, NULL); | 3424 | mptscsih_board_tracer_show, NULL); |
3414 | 3425 | ||
3415 | static ssize_t | 3426 | static ssize_t |
3416 | mptscsih_io_delay_show(struct class_device *cdev, char *buf) | 3427 | mptscsih_io_delay_show(struct device *dev, struct device_attribute *attr, |
3428 | char *buf) | ||
3417 | { | 3429 | { |
3418 | struct Scsi_Host *host = class_to_shost(cdev); | 3430 | struct Scsi_Host *host = class_to_shost(dev); |
3419 | MPT_SCSI_HOST *hd = shost_priv(host); | 3431 | MPT_SCSI_HOST *hd = shost_priv(host); |
3420 | MPT_ADAPTER *ioc = hd->ioc; | 3432 | MPT_ADAPTER *ioc = hd->ioc; |
3421 | 3433 | ||
3422 | return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay); | 3434 | return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay); |
3423 | } | 3435 | } |
3424 | static CLASS_DEVICE_ATTR(io_delay, S_IRUGO, | 3436 | static DEVICE_ATTR(io_delay, S_IRUGO, |
3425 | mptscsih_io_delay_show, NULL); | 3437 | mptscsih_io_delay_show, NULL); |
3426 | 3438 | ||
3427 | static ssize_t | 3439 | static ssize_t |
3428 | mptscsih_device_delay_show(struct class_device *cdev, char *buf) | 3440 | mptscsih_device_delay_show(struct device *dev, struct device_attribute *attr, |
3441 | char *buf) | ||
3429 | { | 3442 | { |
3430 | struct Scsi_Host *host = class_to_shost(cdev); | 3443 | struct Scsi_Host *host = class_to_shost(dev); |
3431 | MPT_SCSI_HOST *hd = shost_priv(host); | 3444 | MPT_SCSI_HOST *hd = shost_priv(host); |
3432 | MPT_ADAPTER *ioc = hd->ioc; | 3445 | MPT_ADAPTER *ioc = hd->ioc; |
3433 | 3446 | ||
3434 | return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay); | 3447 | return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay); |
3435 | } | 3448 | } |
3436 | static CLASS_DEVICE_ATTR(device_delay, S_IRUGO, | 3449 | static DEVICE_ATTR(device_delay, S_IRUGO, |
3437 | mptscsih_device_delay_show, NULL); | 3450 | mptscsih_device_delay_show, NULL); |
3438 | 3451 | ||
3439 | static ssize_t | 3452 | static ssize_t |
3440 | mptscsih_debug_level_show(struct class_device *cdev, char *buf) | 3453 | mptscsih_debug_level_show(struct device *dev, struct device_attribute *attr, |
3454 | char *buf) | ||
3441 | { | 3455 | { |
3442 | struct Scsi_Host *host = class_to_shost(cdev); | 3456 | struct Scsi_Host *host = class_to_shost(dev); |
3443 | MPT_SCSI_HOST *hd = shost_priv(host); | 3457 | MPT_SCSI_HOST *hd = shost_priv(host); |
3444 | MPT_ADAPTER *ioc = hd->ioc; | 3458 | MPT_ADAPTER *ioc = hd->ioc; |
3445 | 3459 | ||
3446 | return snprintf(buf, PAGE_SIZE, "%08xh\n", ioc->debug_level); | 3460 | return snprintf(buf, PAGE_SIZE, "%08xh\n", ioc->debug_level); |
3447 | } | 3461 | } |
3448 | static ssize_t | 3462 | static ssize_t |
3449 | mptscsih_debug_level_store(struct class_device *cdev, const char *buf, | 3463 | mptscsih_debug_level_store(struct device *dev, struct device_attribute *attr, |
3450 | size_t count) | 3464 | const char *buf, size_t count) |
3451 | { | 3465 | { |
3452 | struct Scsi_Host *host = class_to_shost(cdev); | 3466 | struct Scsi_Host *host = class_to_shost(dev); |
3453 | MPT_SCSI_HOST *hd = shost_priv(host); | 3467 | MPT_SCSI_HOST *hd = shost_priv(host); |
3454 | MPT_ADAPTER *ioc = hd->ioc; | 3468 | MPT_ADAPTER *ioc = hd->ioc; |
3455 | int val = 0; | 3469 | int val = 0; |
@@ -3462,22 +3476,22 @@ mptscsih_debug_level_store(struct class_device *cdev, const char *buf, | |||
3462 | ioc->name, ioc->debug_level); | 3476 | ioc->name, ioc->debug_level); |
3463 | return strlen(buf); | 3477 | return strlen(buf); |
3464 | } | 3478 | } |
3465 | static CLASS_DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR, | 3479 | static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR, |
3466 | mptscsih_debug_level_show, mptscsih_debug_level_store); | 3480 | mptscsih_debug_level_show, mptscsih_debug_level_store); |
3467 | 3481 | ||
3468 | struct class_device_attribute *mptscsih_host_attrs[] = { | 3482 | struct device_attribute *mptscsih_host_attrs[] = { |
3469 | &class_device_attr_version_fw, | 3483 | &dev_attr_version_fw, |
3470 | &class_device_attr_version_bios, | 3484 | &dev_attr_version_bios, |
3471 | &class_device_attr_version_mpi, | 3485 | &dev_attr_version_mpi, |
3472 | &class_device_attr_version_product, | 3486 | &dev_attr_version_product, |
3473 | &class_device_attr_version_nvdata_persistent, | 3487 | &dev_attr_version_nvdata_persistent, |
3474 | &class_device_attr_version_nvdata_default, | 3488 | &dev_attr_version_nvdata_default, |
3475 | &class_device_attr_board_name, | 3489 | &dev_attr_board_name, |
3476 | &class_device_attr_board_assembly, | 3490 | &dev_attr_board_assembly, |
3477 | &class_device_attr_board_tracer, | 3491 | &dev_attr_board_tracer, |
3478 | &class_device_attr_io_delay, | 3492 | &dev_attr_io_delay, |
3479 | &class_device_attr_device_delay, | 3493 | &dev_attr_device_delay, |
3480 | &class_device_attr_debug_level, | 3494 | &dev_attr_debug_level, |
3481 | NULL, | 3495 | NULL, |
3482 | }; | 3496 | }; |
3483 | EXPORT_SYMBOL(mptscsih_host_attrs); | 3497 | EXPORT_SYMBOL(mptscsih_host_attrs); |