diff options
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index d35617376f87..fd3aa2619f42 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -3187,6 +3187,159 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
3187 | mptscsih_do_cmd(hd, &iocmd); | 3187 | mptscsih_do_cmd(hd, &iocmd); |
3188 | } | 3188 | } |
3189 | 3189 | ||
3190 | static ssize_t | ||
3191 | mptscsih_version_fw_show(struct class_device *cdev, char *buf) | ||
3192 | { | ||
3193 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3194 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3195 | MPT_ADAPTER *ioc = hd->ioc; | ||
3196 | |||
3197 | return snprintf(buf, PAGE_SIZE, "%02d.%02d.%02d.%02d\n", | ||
3198 | (ioc->facts.FWVersion.Word & 0xFF000000) >> 24, | ||
3199 | (ioc->facts.FWVersion.Word & 0x00FF0000) >> 16, | ||
3200 | (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8, | ||
3201 | ioc->facts.FWVersion.Word & 0x000000FF); | ||
3202 | } | ||
3203 | static CLASS_DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL); | ||
3204 | |||
3205 | static ssize_t | ||
3206 | mptscsih_version_bios_show(struct class_device *cdev, char *buf) | ||
3207 | { | ||
3208 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3209 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3210 | MPT_ADAPTER *ioc = hd->ioc; | ||
3211 | |||
3212 | return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x.%02x\n", | ||
3213 | (ioc->biosVersion & 0xFF000000) >> 24, | ||
3214 | (ioc->biosVersion & 0x00FF0000) >> 16, | ||
3215 | (ioc->biosVersion & 0x0000FF00) >> 8, | ||
3216 | ioc->biosVersion & 0x000000FF); | ||
3217 | } | ||
3218 | static CLASS_DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL); | ||
3219 | |||
3220 | static ssize_t | ||
3221 | mptscsih_version_mpi_show(struct class_device *cdev, char *buf) | ||
3222 | { | ||
3223 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3224 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3225 | MPT_ADAPTER *ioc = hd->ioc; | ||
3226 | |||
3227 | return snprintf(buf, PAGE_SIZE, "%03x\n", ioc->facts.MsgVersion); | ||
3228 | } | ||
3229 | static CLASS_DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL); | ||
3230 | |||
3231 | static ssize_t | ||
3232 | mptscsih_version_product_show(struct class_device *cdev, char *buf) | ||
3233 | { | ||
3234 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3235 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3236 | MPT_ADAPTER *ioc = hd->ioc; | ||
3237 | |||
3238 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name); | ||
3239 | } | ||
3240 | static CLASS_DEVICE_ATTR(version_product, S_IRUGO, | ||
3241 | mptscsih_version_product_show, NULL); | ||
3242 | |||
3243 | static ssize_t | ||
3244 | mptscsih_version_nvdata_persistent_show(struct class_device *cdev, char *buf) | ||
3245 | { | ||
3246 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3247 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3248 | MPT_ADAPTER *ioc = hd->ioc; | ||
3249 | |||
3250 | return snprintf(buf, PAGE_SIZE, "%02xh\n", | ||
3251 | ioc->nvdata_version_persistent); | ||
3252 | } | ||
3253 | static CLASS_DEVICE_ATTR(version_nvdata_persistent, S_IRUGO, | ||
3254 | mptscsih_version_nvdata_persistent_show, NULL); | ||
3255 | |||
3256 | static ssize_t | ||
3257 | mptscsih_version_nvdata_default_show(struct class_device *cdev, char *buf) | ||
3258 | { | ||
3259 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3260 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3261 | MPT_ADAPTER *ioc = hd->ioc; | ||
3262 | |||
3263 | return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default); | ||
3264 | } | ||
3265 | static CLASS_DEVICE_ATTR(version_nvdata_default, S_IRUGO, | ||
3266 | mptscsih_version_nvdata_default_show, NULL); | ||
3267 | |||
3268 | static ssize_t | ||
3269 | mptscsih_board_name_show(struct class_device *cdev, char *buf) | ||
3270 | { | ||
3271 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3272 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3273 | MPT_ADAPTER *ioc = hd->ioc; | ||
3274 | |||
3275 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name); | ||
3276 | } | ||
3277 | static CLASS_DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL); | ||
3278 | |||
3279 | static ssize_t | ||
3280 | mptscsih_board_assembly_show(struct class_device *cdev, char *buf) | ||
3281 | { | ||
3282 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3283 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3284 | MPT_ADAPTER *ioc = hd->ioc; | ||
3285 | |||
3286 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly); | ||
3287 | } | ||
3288 | static CLASS_DEVICE_ATTR(board_assembly, S_IRUGO, | ||
3289 | mptscsih_board_assembly_show, NULL); | ||
3290 | |||
3291 | static ssize_t | ||
3292 | mptscsih_board_tracer_show(struct class_device *cdev, char *buf) | ||
3293 | { | ||
3294 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3295 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3296 | MPT_ADAPTER *ioc = hd->ioc; | ||
3297 | |||
3298 | return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer); | ||
3299 | } | ||
3300 | static CLASS_DEVICE_ATTR(board_tracer, S_IRUGO, | ||
3301 | mptscsih_board_tracer_show, NULL); | ||
3302 | |||
3303 | static ssize_t | ||
3304 | mptscsih_io_delay_show(struct class_device *cdev, char *buf) | ||
3305 | { | ||
3306 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3307 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3308 | MPT_ADAPTER *ioc = hd->ioc; | ||
3309 | |||
3310 | return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay); | ||
3311 | } | ||
3312 | static CLASS_DEVICE_ATTR(io_delay, S_IRUGO, | ||
3313 | mptscsih_io_delay_show, NULL); | ||
3314 | |||
3315 | static ssize_t | ||
3316 | mptscsih_device_delay_show(struct class_device *cdev, char *buf) | ||
3317 | { | ||
3318 | struct Scsi_Host *host = class_to_shost(cdev); | ||
3319 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; | ||
3320 | MPT_ADAPTER *ioc = hd->ioc; | ||
3321 | |||
3322 | return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay); | ||
3323 | } | ||
3324 | static CLASS_DEVICE_ATTR(device_delay, S_IRUGO, | ||
3325 | mptscsih_device_delay_show, NULL); | ||
3326 | |||
3327 | struct class_device_attribute *mptscsih_host_attrs[] = { | ||
3328 | &class_device_attr_version_fw, | ||
3329 | &class_device_attr_version_bios, | ||
3330 | &class_device_attr_version_mpi, | ||
3331 | &class_device_attr_version_product, | ||
3332 | &class_device_attr_version_nvdata_persistent, | ||
3333 | &class_device_attr_version_nvdata_default, | ||
3334 | &class_device_attr_board_name, | ||
3335 | &class_device_attr_board_assembly, | ||
3336 | &class_device_attr_board_tracer, | ||
3337 | &class_device_attr_io_delay, | ||
3338 | &class_device_attr_device_delay, | ||
3339 | NULL, | ||
3340 | }; | ||
3341 | EXPORT_SYMBOL(mptscsih_host_attrs); | ||
3342 | |||
3190 | EXPORT_SYMBOL(mptscsih_remove); | 3343 | EXPORT_SYMBOL(mptscsih_remove); |
3191 | EXPORT_SYMBOL(mptscsih_shutdown); | 3344 | EXPORT_SYMBOL(mptscsih_shutdown); |
3192 | #ifdef CONFIG_PM | 3345 | #ifdef CONFIG_PM |