]> Pileus Git - ~andy/linux/blobdiff - drivers/edac/edac_core.h
drivers/edac: mod MC to use workq instead of kthread
[~andy/linux] / drivers / edac / edac_core.h
index a3e4b97fe4fe1857708f46f1ee07e5e928716d2d..b73d659a4bb2dfb13f2c430c5e5a626a81b62a95 100644 (file)
@@ -95,11 +95,7 @@ extern int edac_debug_level;
 #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \
        PCI_DEVICE_ID_ ## vend ## _ ## dev
 
-#if defined(CONFIG_X86) && defined(CONFIG_PCI)
-#define dev_name(dev) pci_name(to_pci_dev(dev))
-#else
-#define dev_name(dev) to_platform_device(dev)->name
-#endif
+#define dev_name(dev) (dev)->dev_name
 
 /* memory devices */
 enum dev_type {
@@ -194,12 +190,12 @@ enum scrub_type {
 };
 
 #define SCRUB_FLAG_SW_PROG     BIT(SCRUB_SW_PROG)
-#define SCRUB_FLAG_SW_SRC      BIT(SCRUB_SW_SRC_CORR)
-#define SCRUB_FLAG_SW_PROG_SRC BIT(SCRUB_SW_PROG_SRC_CORR)
+#define SCRUB_FLAG_SW_SRC      BIT(SCRUB_SW_SRC)
+#define SCRUB_FLAG_SW_PROG_SRC BIT(SCRUB_SW_PROG_SRC)
 #define SCRUB_FLAG_SW_TUN      BIT(SCRUB_SW_SCRUB_TUNABLE)
 #define SCRUB_FLAG_HW_PROG     BIT(SCRUB_HW_PROG)
-#define SCRUB_FLAG_HW_SRC      BIT(SCRUB_HW_SRC_CORR)
-#define SCRUB_FLAG_HW_PROG_SRC BIT(SCRUB_HW_PROG_SRC_CORR)
+#define SCRUB_FLAG_HW_SRC      BIT(SCRUB_HW_SRC)
+#define SCRUB_FLAG_HW_PROG_SRC BIT(SCRUB_HW_PROG_SRC)
 #define SCRUB_FLAG_HW_TUN      BIT(SCRUB_HW_TUNABLE)
 
 /* FIXME - should have notify capabilities: NMI, LOG, PROC, etc */
@@ -368,6 +364,7 @@ struct mem_ctl_info {
        const char *mod_name;
        const char *mod_ver;
        const char *ctl_name;
+       const char *dev_name;
        char proc_name[MC_PROC_NAME_MAX_LEN + 1];
        void *pvt_info;
        u32 ue_noinfo_count;    /* Uncorrectable Errors w/o info */
@@ -385,6 +382,15 @@ struct mem_ctl_info {
        /* edac sysfs device control */
        struct kobject edac_mci_kobj;
        struct completion kobj_complete;
+
+       /* work struct for this MC */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
+       struct delayed_work work;
+#else
+       struct work_struct work;
+#endif
+       /* the internal state of this controller instance */
+       int op_state;
 };
 
 /*
@@ -538,6 +544,7 @@ struct edac_device_ctl_info {
 
        const char *mod_name;   /* module name */
        const char *ctl_name;   /* edac controller  name */
+       const char *dev_name;   /* pci/platform/etc... name */
 
        void *pvt_info;         /* pointer to 'private driver' info */
 
@@ -575,6 +582,9 @@ struct edac_device_ctl_info {
 };
 
 /* To get from the instance's wq to the beginning of the ctl structure */
+#define to_edac_mem_ctl_work(w) \
+               container_of(w, struct mem_ctl_info, work)
+
 #define to_edac_device_ctl_work(w) \
                container_of(w,struct edac_device_ctl_info,work)
 
@@ -586,6 +596,8 @@ static inline void edac_device_calc_delay(
        edac_dev->delay = edac_dev->poll_msec * HZ / 1000;
 }
 
+#define edac_calc_delay(dev) dev->delay = dev->poll_msec * HZ / 1000;
+
 /*
  * The alloc() and free() functions for the 'edac_device' control info
  * structure. A MC driver will allocate one of these for each edac_device