Commit cf992025 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] rename struct SHT to something sensible

namely struct scsi_host_template and make the scsi core use this
instead of the typedef everywhere.
parent 92905e51
......@@ -75,7 +75,7 @@ int scsi_remove_host(struct Scsi_Host *shost)
**/
int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
{
Scsi_Host_Template *sht = shost->hostt;
struct scsi_host_template *sht = shost->hostt;
int error;
printk(KERN_INFO "scsi%d : %s\n", shost->host_no,
......@@ -123,7 +123,7 @@ void scsi_free_shost(struct Scsi_Host *shost)
* Return value:
* Pointer to a new Scsi_Host
**/
struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *sht, int privsize)
struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
{
struct Scsi_Host *shost;
int gfp_mask = GFP_KERNEL, rval;
......@@ -219,7 +219,7 @@ struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *sht, int privsize)
return NULL;
}
struct Scsi_Host *scsi_register(Scsi_Host_Template *sht, int privsize)
struct Scsi_Host *scsi_register(struct scsi_host_template *sht, int privsize)
{
struct Scsi_Host *shost = scsi_host_alloc(sht, privsize);
......
......@@ -49,14 +49,7 @@ struct scsi_host_cmd_pool;
* used in one scatter-gather request.
*/
/*
* The Scsi_Host_Template type has all that is needed to interface with a SCSI
* host in a device independent matter. There is one entry for each different
* type of host adapter that is supported on the system.
*/
typedef struct SHT
{
struct scsi_host_template {
/* Used with loadable modules so that we know when it is safe to unload */
struct module * module;
......@@ -91,7 +84,7 @@ typedef struct SHT
* passed to scsi.c in the processing of the command. Note
* especially that scsi_malloc/scsi_free must not be called.
*/
int (* detect)(struct SHT *);
int (* detect)(struct scsi_host_template *);
/* Used with loadable modules to unload the host structures. Note:
* there is a default action built into the modules code which may
......@@ -374,16 +367,9 @@ typedef struct SHT
* module_init/module_exit.
*/
struct list_head legacy_hosts;
} Scsi_Host_Template;
};
/*
* The scsi_hosts array is the array containing the data for all
* possible <supported> scsi hosts. This is similar to the
* Scsi_Host_Template, except that we have one entry for each
* actual physical host adapter on the system, stored as a linked
* list. Note that if there are 2 aha1542 boards, then there will
* be two Scsi_Host entries, but only 1 Scsi_Host_Template entry.
*/
typedef struct scsi_host_template Scsi_Host_Template;
struct Scsi_Host
{
......@@ -413,7 +399,7 @@ struct Scsi_Host
this is true. */
unsigned int eh_kill:1; /* set when killing the eh thread */
wait_queue_head_t host_wait;
Scsi_Host_Template * hostt;
struct scsi_host_template *hostt;
volatile unsigned short host_busy; /* commands actually active on low-level */
volatile unsigned short host_failed; /* commands that failed. */
......@@ -577,7 +563,7 @@ extern int scsi_register_interface(struct class_interface *);
class_interface_unregister(intf)
extern struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *, int);
extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
extern int scsi_add_host(struct Scsi_Host *, struct device *);
extern int scsi_remove_host(struct Scsi_Host *);
extern void scsi_host_get(struct Scsi_Host *);
......@@ -585,7 +571,7 @@ extern void scsi_host_put(struct Scsi_Host *t);
extern struct Scsi_Host *scsi_host_lookup(unsigned short);
/* legacy interfaces */
extern struct Scsi_Host *scsi_register(Scsi_Host_Template *, int);
extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
extern void scsi_unregister(struct Scsi_Host *);
/**
......@@ -606,6 +592,6 @@ static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost,
return NULL;
}
extern void scsi_sysfs_release_attributes(struct SHT *hostt);
extern void scsi_sysfs_release_attributes(struct scsi_host_template *hostt);
#endif
......@@ -17,7 +17,7 @@
static int __init init_this_scsi_driver(void)
{
Scsi_Host_Template *sht = &driver_template;
struct scsi_host_template *sht = &driver_template;
struct Scsi_Host *shost;
struct list_head *l;
int error;
......@@ -51,7 +51,7 @@ static int __init init_this_scsi_driver(void)
static void __exit exit_this_scsi_driver(void)
{
Scsi_Host_Template *sht = &driver_template;
struct scsi_host_template *sht = &driver_template;
struct Scsi_Host *shost, *s;
list_for_each_entry(shost, &sht->legacy_hosts, sht_legacy_list)
......
......@@ -79,7 +79,7 @@ static int proc_scsi_write_proc(struct file *file, const char *buf,
void scsi_proc_host_add(struct Scsi_Host *shost)
{
Scsi_Host_Template *sht = shost->hostt;
struct scsi_host_template *sht = shost->hostt;
struct proc_dir_entry *p;
char name[10];
......@@ -112,7 +112,7 @@ void scsi_proc_host_add(struct Scsi_Host *shost)
void scsi_proc_host_rm(struct Scsi_Host *shost)
{
Scsi_Host_Template *sht = shost->hostt;
struct scsi_host_template *sht = shost->hostt;
char name[10];
if (sht->proc_info) {
......
......@@ -487,7 +487,7 @@ int scsi_sysfs_modify_sdev_attribute(struct device_attribute ***dev_attrs,
}
EXPORT_SYMBOL(scsi_sysfs_modify_sdev_attribute);
void scsi_sysfs_release_attributes(struct SHT *hostt)
void scsi_sysfs_release_attributes(struct scsi_host_template *hostt)
{
if(hostt->sdev_attrs != scsi_sysfs_sdev_attrs)
kfree(hostt->sdev_attrs);
......
......@@ -360,7 +360,7 @@ static int usb_storage_proc_info (struct Scsi_Host *hostptr, char *buffer, char
* this defines our host template, with which we'll allocate hosts
*/
struct SHT usb_stor_host_template = {
struct scsi_host_template usb_stor_host_template = {
/* basic userland interface stuff */
.name = "usb-storage",
.proc_name = "usb-storage",
......
......@@ -47,7 +47,7 @@
extern unsigned char usb_stor_sense_notready[18];
extern unsigned char usb_stor_sense_invalidCDB[18];
extern struct SHT usb_stor_host_template;
extern struct scsi_host_template usb_stor_host_template;
extern int usb_stor_scsiSense10to6(Scsi_Cmnd*);
extern int usb_stor_scsiSense6to10(Scsi_Cmnd*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment