aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cciss.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 4fb63b898798..a45268554e07 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -195,6 +195,7 @@ static int sendcmd_withirq_core(ctlr_info_t *h, CommandList_struct *c,
195static int process_sendcmd_error(ctlr_info_t *h, CommandList_struct *c); 195static int process_sendcmd_error(ctlr_info_t *h, CommandList_struct *c);
196 196
197static void fail_all_cmds(unsigned long ctlr); 197static void fail_all_cmds(unsigned long ctlr);
198static int add_to_scan_list(struct ctlr_info *h);
198static int scan_thread(void *data); 199static int scan_thread(void *data);
199static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c); 200static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c);
200 201
@@ -460,9 +461,19 @@ static void __devinit cciss_procinit(int i)
460#define to_hba(n) container_of(n, struct ctlr_info, dev) 461#define to_hba(n) container_of(n, struct ctlr_info, dev)
461#define to_drv(n) container_of(n, drive_info_struct, dev) 462#define to_drv(n) container_of(n, drive_info_struct, dev)
462 463
463static struct device_type cciss_host_type = { 464static ssize_t host_store_rescan(struct device *dev,
464 .name = "cciss_host", 465 struct device_attribute *attr,
465}; 466 const char *buf, size_t count)
467{
468 struct ctlr_info *h = to_hba(dev);
469
470 add_to_scan_list(h);
471 wake_up_process(cciss_scan_thread);
472 wait_for_completion_interruptible(&h->scan_wait);
473
474 return count;
475}
476DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
466 477
467static ssize_t dev_show_unique_id(struct device *dev, 478static ssize_t dev_show_unique_id(struct device *dev,
468 struct device_attribute *attr, 479 struct device_attribute *attr,
@@ -566,6 +577,25 @@ static ssize_t dev_show_rev(struct device *dev,
566} 577}
567DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL); 578DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL);
568 579
580static struct attribute *cciss_host_attrs[] = {
581 &dev_attr_rescan.attr,
582 NULL
583};
584
585static struct attribute_group cciss_host_attr_group = {
586 .attrs = cciss_host_attrs,
587};
588
589static struct attribute_group *cciss_host_attr_groups[] = {
590 &cciss_host_attr_group,
591 NULL
592};
593
594static struct device_type cciss_host_type = {
595 .name = "cciss_host",
596 .groups = cciss_host_attr_groups,
597};
598
569static struct attribute *cciss_dev_attrs[] = { 599static struct attribute *cciss_dev_attrs[] = {
570 &dev_attr_unique_id.attr, 600 &dev_attr_unique_id.attr,
571 &dev_attr_model.attr, 601 &dev_attr_model.attr,