hpsa.c (a9a3a2739a44fc05dcaba0d4d36e52dc444c294f) | hpsa.c (745a7a25bc0f6dc77db72656b7bc8d17b6ee8e53) |
---|---|
1/* 2 * Disk Array driver for HP Smart Array SAS controllers 3 * Copyright 2000, 2009 Hewlett-Packard Development Company, L.P. 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * --- 147 unchanged lines hidden (view full) --- 156static ssize_t lunid_show(struct device *dev, 157 struct device_attribute *attr, char *buf); 158static ssize_t unique_id_show(struct device *dev, 159 struct device_attribute *attr, char *buf); 160static ssize_t host_show_firmware_revision(struct device *dev, 161 struct device_attribute *attr, char *buf); 162static ssize_t host_show_commands_outstanding(struct device *dev, 163 struct device_attribute *attr, char *buf); | 1/* 2 * Disk Array driver for HP Smart Array SAS controllers 3 * Copyright 2000, 2009 Hewlett-Packard Development Company, L.P. 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * --- 147 unchanged lines hidden (view full) --- 156static ssize_t lunid_show(struct device *dev, 157 struct device_attribute *attr, char *buf); 158static ssize_t unique_id_show(struct device *dev, 159 struct device_attribute *attr, char *buf); 160static ssize_t host_show_firmware_revision(struct device *dev, 161 struct device_attribute *attr, char *buf); 162static ssize_t host_show_commands_outstanding(struct device *dev, 163 struct device_attribute *attr, char *buf); |
164static ssize_t host_show_transport_mode(struct device *dev, 165 struct device_attribute *attr, char *buf); |
|
164static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); 165static ssize_t host_store_rescan(struct device *dev, 166 struct device_attribute *attr, const char *buf, size_t count); 167static int check_for_unit_attention(struct ctlr_info *h, 168 struct CommandList *c); 169static void check_ioctl_unit_attention(struct ctlr_info *h, 170 struct CommandList *c); 171/* performant mode helper functions */ --- 15 unchanged lines hidden (view full) --- 187static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL); 188static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL); 189static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL); 190static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan); 191static DEVICE_ATTR(firmware_revision, S_IRUGO, 192 host_show_firmware_revision, NULL); 193static DEVICE_ATTR(commands_outstanding, S_IRUGO, 194 host_show_commands_outstanding, NULL); | 166static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); 167static ssize_t host_store_rescan(struct device *dev, 168 struct device_attribute *attr, const char *buf, size_t count); 169static int check_for_unit_attention(struct ctlr_info *h, 170 struct CommandList *c); 171static void check_ioctl_unit_attention(struct ctlr_info *h, 172 struct CommandList *c); 173/* performant mode helper functions */ --- 15 unchanged lines hidden (view full) --- 189static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL); 190static DEVICE_ATTR(lunid, S_IRUGO, lunid_show, NULL); 191static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL); 192static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan); 193static DEVICE_ATTR(firmware_revision, S_IRUGO, 194 host_show_firmware_revision, NULL); 195static DEVICE_ATTR(commands_outstanding, S_IRUGO, 196 host_show_commands_outstanding, NULL); |
197static DEVICE_ATTR(transport_mode, S_IRUGO, 198 host_show_transport_mode, NULL); |
|
195 196static struct device_attribute *hpsa_sdev_attrs[] = { 197 &dev_attr_raid_level, 198 &dev_attr_lunid, 199 &dev_attr_unique_id, 200 NULL, 201}; 202 203static struct device_attribute *hpsa_shost_attrs[] = { 204 &dev_attr_rescan, 205 &dev_attr_firmware_revision, 206 &dev_attr_commands_outstanding, | 199 200static struct device_attribute *hpsa_sdev_attrs[] = { 201 &dev_attr_raid_level, 202 &dev_attr_lunid, 203 &dev_attr_unique_id, 204 NULL, 205}; 206 207static struct device_attribute *hpsa_shost_attrs[] = { 208 &dev_attr_rescan, 209 &dev_attr_firmware_revision, 210 &dev_attr_commands_outstanding, |
211 &dev_attr_transport_mode, |
|
207 NULL, 208}; 209 210static struct scsi_host_template hpsa_driver_template = { 211 .module = THIS_MODULE, 212 .name = "hpsa", 213 .proc_name = "hpsa", 214 .queuecommand = hpsa_scsi_queue_command, --- 93 unchanged lines hidden (view full) --- 308 struct device_attribute *attr, char *buf) 309{ 310 struct Scsi_Host *shost = class_to_shost(dev); 311 struct ctlr_info *h = shost_to_hba(shost); 312 313 return snprintf(buf, 20, "%d\n", h->commands_outstanding); 314} 315 | 212 NULL, 213}; 214 215static struct scsi_host_template hpsa_driver_template = { 216 .module = THIS_MODULE, 217 .name = "hpsa", 218 .proc_name = "hpsa", 219 .queuecommand = hpsa_scsi_queue_command, --- 93 unchanged lines hidden (view full) --- 313 struct device_attribute *attr, char *buf) 314{ 315 struct Scsi_Host *shost = class_to_shost(dev); 316 struct ctlr_info *h = shost_to_hba(shost); 317 318 return snprintf(buf, 20, "%d\n", h->commands_outstanding); 319} 320 |
321static ssize_t host_show_transport_mode(struct device *dev, 322 struct device_attribute *attr, char *buf) 323{ 324 struct ctlr_info *h; 325 struct Scsi_Host *shost = class_to_shost(dev); 326 327 h = shost_to_hba(shost); 328 return snprintf(buf, 20, "%s\n", 329 h->transMethod == CFGTBL_Trans_Performant ? 330 "performant" : "simple"); 331} 332 |
|
316/* Enqueuing and dequeuing functions for cmdlists. */ 317static inline void addQ(struct list_head *list, struct CommandList *c) 318{ 319 list_add_tail(&c->list, list); 320} 321 322static inline u32 next_command(struct ctlr_info *h) 323{ --- 3439 unchanged lines hidden (view full) --- 3763 BUILD_BUG_ON(sizeof(struct CommandList) % COMMANDLIST_ALIGNMENT); 3764 h = kzalloc(sizeof(*h), GFP_KERNEL); 3765 if (!h) 3766 return -ENOMEM; 3767 3768 h->pdev = pdev; 3769 h->busy_initializing = 1; 3770 h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT; | 333/* Enqueuing and dequeuing functions for cmdlists. */ 334static inline void addQ(struct list_head *list, struct CommandList *c) 335{ 336 list_add_tail(&c->list, list); 337} 338 339static inline u32 next_command(struct ctlr_info *h) 340{ --- 3439 unchanged lines hidden (view full) --- 3780 BUILD_BUG_ON(sizeof(struct CommandList) % COMMANDLIST_ALIGNMENT); 3781 h = kzalloc(sizeof(*h), GFP_KERNEL); 3782 if (!h) 3783 return -ENOMEM; 3784 3785 h->pdev = pdev; 3786 h->busy_initializing = 1; 3787 h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT; |
3771 printk(KERN_WARNING "hpsa_simple_mode is %d\n", hpsa_simple_mode); | |
3772 INIT_LIST_HEAD(&h->cmpQ); 3773 INIT_LIST_HEAD(&h->reqQ); 3774 spin_lock_init(&h->lock); 3775 spin_lock_init(&h->scan_lock); 3776 rc = hpsa_pci_init(h); 3777 if (rc != 0) 3778 goto clean1; 3779 --- 349 unchanged lines hidden --- | 3788 INIT_LIST_HEAD(&h->cmpQ); 3789 INIT_LIST_HEAD(&h->reqQ); 3790 spin_lock_init(&h->lock); 3791 spin_lock_init(&h->scan_lock); 3792 rc = hpsa_pci_init(h); 3793 if (rc != 0) 3794 goto clean1; 3795 --- 349 unchanged lines hidden --- |