X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fscsi%2Fscsi_host.h;h=191b8fced8ac658b455ffe957b7051d20b2d4e5e;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=84a7065995dc914bbec71972bf76acb526cdbe0b;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 84a706599..191b8fced 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -30,6 +30,12 @@ struct scsi_transport_template; #define DISABLE_CLUSTERING 0 #define ENABLE_CLUSTERING 1 +enum scsi_eh_timer_return { + EH_NOT_HANDLED, + EH_HANDLED, + EH_RESET_TIMER, +}; + struct scsi_host_template { struct module *module; @@ -64,8 +70,19 @@ struct scsi_host_template { * * Status: OPTIONAL */ - int (* ioctl)(struct scsi_device *dev, int cmd, void *arg); - + int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg); + + +#ifdef CONFIG_COMPAT + /* + * Compat handler. Handle 32bit ABI. + * When unknown ioctl is passed return -ENOIOCTLCMD. + * + * Status: OPTIONAL + */ + int (* compat_ioctl)(struct scsi_device *dev, int cmd, void __user *arg); +#endif + /* * The queuecommand function is used to queue up a scsi * command block to the LLDD. When the driver finished @@ -126,13 +143,18 @@ struct scsi_host_template { int (* eh_host_reset_handler)(struct scsi_cmnd *); /* - * Old EH handlers, no longer used. Make them warn the user of old - * drivers by using a wrong type + * This is an optional routine to notify the host that the scsi + * timer just fired. The returns tell the timer routine what to + * do about this: * - * Status: MORE THAN OBSOLETE + * EH_HANDLED: I fixed the error, please complete the command + * EH_RESET_TIMER: I need more time, reset the timer and + * begin counting again + * EH_NOT_HANDLED Begin normal error recovery + * + * Status: OPTIONAL */ - int (* abort)(int); - int (* reset)(int, int); + enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); /* * Before the mid layer attempts to scan for a new device where none @@ -151,7 +173,7 @@ struct scsi_host_template { * here then you will get a call to slave_configure(), then the * device will be used for however long it is kept around, then when * the device is removed from the system (or * possibly at reboot - * time), you will then get a call to slave_detach(). This is + * time), you will then get a call to slave_destroy(). This is * assuming you implement slave_configure and slave_destroy. * However, if you allocate memory and hang it off the device struct, * then you must implement the slave_destroy() routine at a minimum @@ -185,7 +207,7 @@ struct scsi_host_template { * specific setup basis... * 6. Return 0 on success, non-0 on error. The device will be marked * as offline on error so that no access will occur. If you return - * non-0, your slave_detach routine will never get called for this + * non-0, your slave_destroy routine will never get called for this * device, so don't leave any loose memory hanging around, clean * up after yourself before returning non-0 * @@ -204,14 +226,36 @@ struct scsi_host_template { */ void (* slave_destroy)(struct scsi_device *); + /* + * fill in this function to allow the queue depth of this host + * to be changeable (on a per device basis). returns either + * the current queue depth setting (may be different from what + * was passed in) or an error. An error should only be + * returned if the requested depth is legal but the driver was + * unable to set it. If the requested depth is illegal, the + * driver should set and return the closest legal queue depth. + * + */ + int (* change_queue_depth)(struct scsi_device *, int); + + /* + * fill in this function to allow the changing of tag types + * (this also allows the enabling/disabling of tag command + * queueing). An error should only be returned if something + * went wrong in the driver while trying to set the tag type. + * If the driver doesn't support the requested tag type, then + * it should set the closest type it does support without + * returning an error. Returns the actual tag type set. + */ + int (* change_queue_type)(struct scsi_device *, int); + /* * This function determines the bios parameters for a given * harddisk. These tend to be numbers that are made up by * the host adapter. Parameters: * size, device, list (heads, sectors, cylinders) * - * Status: OPTIONAL - */ + * Status: OPTIONAL */ int (* bios_param)(struct scsi_device *, struct block_device *, sector_t, int []); @@ -313,6 +357,11 @@ struct scsi_host_template { */ unsigned emulated:1; + /* + * True if the low-level driver performs its own reset-settle delays. + */ + unsigned skip_settle_delay:1; + /* * Countdown for host blocking with no commands outstanding */ @@ -485,6 +534,12 @@ struct Scsi_Host { */ struct list_head sht_legacy_list; + /* + * Points to the transport data (if any) which is allocated + * separately + */ + void *shost_data; + /* * We should ensure that this is aligned, both for better performance * and also because some compilers (m68k) don't automatically force @@ -498,9 +553,13 @@ struct Scsi_Host { #define class_to_shost(d) \ container_of(d, struct Scsi_Host, shost_classdev) + extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int); -extern int scsi_add_host(struct Scsi_Host *, struct device *); +extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *); extern void scsi_scan_host(struct Scsi_Host *); +extern void scsi_scan_single_target(struct Scsi_Host *, unsigned int, + unsigned int); +extern void scsi_rescan_device(struct device *); extern void scsi_remove_host(struct Scsi_Host *); extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); extern void scsi_host_put(struct Scsi_Host *t); @@ -527,6 +586,7 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) extern void scsi_unblock_requests(struct Scsi_Host *); extern void scsi_block_requests(struct Scsi_Host *); +struct class_container; /* * These two functions are used to allocate and free a pseudo device * which will connect to the host adapter itself rather than any @@ -536,6 +596,8 @@ extern void scsi_block_requests(struct Scsi_Host *); */ extern void scsi_free_host_dev(struct scsi_device *); extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *); +int scsi_is_host_device(const struct device *); + /* legacy interfaces */ extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);