aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_core.h
diff options
context:
space:
mode:
authorDouglas Thompson <dougthompson@xmission.com>2007-07-19 04:50:10 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:55 -0400
commit42a8e397a80c277afb2aeb22232bc70114035bb1 (patch)
treeb178b3379d2de5607b5ddb29a2def3472e9d99fe /drivers/edac/edac_core.h
parent456a2f9552e7849475f4aea1a9aa4c0e54b3ddda (diff)
drivers/edac: add device sysfs attributes
Added new controls for the edac_device and edac_mc sysfs folder. These can be initialized by the low level driver to provide misc controls into the low level driver for its use Signed-off-by: Douglas Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_core.h')
-rw-r--r--drivers/edac/edac_core.h52
1 files changed, 50 insertions, 2 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index b955c58672e2..8c114572b722 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -326,6 +326,18 @@ struct csrow_info {
326 struct channel_info *channels; 326 struct channel_info *channels;
327}; 327};
328 328
329/* mcidev_sysfs_attribute structure
330 * used for driver sysfs attributes and in mem_ctl_info
331 * sysfs top level entries
332 */
333struct mcidev_sysfs_attribute {
334 struct attribute attr;
335 ssize_t (*show)(struct mem_ctl_info *,char *);
336 ssize_t (*store)(struct mem_ctl_info *, const char *,size_t);
337};
338
339/* MEMORY controller information structure
340 */
329struct mem_ctl_info { 341struct mem_ctl_info {
330 struct list_head link; /* for global list of mem_ctl_info structs */ 342 struct list_head link; /* for global list of mem_ctl_info structs */
331 unsigned long mtype_cap; /* memory types supported by mc */ 343 unsigned long mtype_cap; /* memory types supported by mc */
@@ -353,6 +365,7 @@ struct mem_ctl_info {
353 */ 365 */
354 int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci, u32 * bw); 366 int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci, u32 * bw);
355 367
368
356 /* pointer to edac checking routine */ 369 /* pointer to edac checking routine */
357 void (*edac_check) (struct mem_ctl_info * mci); 370 void (*edac_check) (struct mem_ctl_info * mci);
358 371
@@ -394,6 +407,18 @@ struct mem_ctl_info {
394 struct kobject edac_mci_kobj; 407 struct kobject edac_mci_kobj;
395 struct completion kobj_complete; 408 struct completion kobj_complete;
396 409
410 /* Additional top controller level attributes, but specified
411 * by the low level driver.
412 *
413 * Set by the low level driver to provide attributes at the
414 * controller level, same level as 'ue_count' and 'ce_count' above.
415 * An array of structures, NULL terminated
416 *
417 * If attributes are desired, then set to array of attributes
418 * If no attributes are desired, leave NULL
419 */
420 struct mcidev_sysfs_attribute *mc_driver_sysfs_attributes;
421
397 /* work struct for this MC */ 422 /* work struct for this MC */
398 struct delayed_work work; 423 struct delayed_work work;
399 424
@@ -402,7 +427,7 @@ struct mem_ctl_info {
402}; 427};
403 428
404/* 429/*
405 * The following are the structures to provide for a generice 430 * The following are the structures to provide for a generic
406 * or abstract 'edac_device'. This set of structures and the 431 * or abstract 'edac_device'. This set of structures and the
407 * code that implements the APIs for the same, provide for 432 * code that implements the APIs for the same, provide for
408 * registering EDAC type devices which are NOT standard memory. 433 * registering EDAC type devices which are NOT standard memory.
@@ -505,6 +530,16 @@ struct edac_device_instance {
505 struct completion kobj_complete; 530 struct completion kobj_complete;
506}; 531};
507 532
533/* edac_dev_sysfs_attribute structure
534 * used for driver sysfs attributes and in mem_ctl_info
535 * sysfs top level entries
536 */
537struct edac_dev_sysfs_attribute {
538 struct attribute attr;
539 ssize_t (*show)(struct edac_device_ctl_info *,char *);
540 ssize_t (*store)(struct edac_device_ctl_info *, const char *,size_t);
541};
542
508/* 543/*
509 * Abstract edac_device control info structure 544 * Abstract edac_device control info structure
510 * 545 *
@@ -522,7 +557,20 @@ struct edac_device_ctl_info {
522 unsigned poll_msec; /* number of milliseconds to poll interval */ 557 unsigned poll_msec; /* number of milliseconds to poll interval */
523 unsigned long delay; /* number of jiffies for poll_msec */ 558 unsigned long delay; /* number of jiffies for poll_msec */
524 559
525 struct sysdev_class *edac_class; /* pointer to class */ 560 /* Additional top controller level attributes, but specified
561 * by the low level driver.
562 *
563 * Set by the low level driver to provide attributes at the
564 * controller level, same level as 'ue_count' and 'ce_count' above.
565 * An array of structures, NULL terminated
566 *
567 * If attributes are desired, then set to array of attributes
568 * If no attributes are desired, leave NULL
569 */
570 struct edac_dev_sysfs_attribute *sysfs_attributes;
571
572 /* pointer to main 'edac' class in sysfs */
573 struct sysdev_class *edac_class;
526 574
527 /* the internal state of this controller instance */ 575 /* the internal state of this controller instance */
528 int op_state; 576 int op_state;