From 86b87cde0b5581cdb1a7babeb9c4c387761f151b Mon Sep 17 00:00:00 2001 From: Stanislav Nijnikov Date: Thu, 15 Feb 2018 14:14:08 +0200 Subject: scsi: core: host template attribute groups The patch introduces an additional field in the scsi_host_template structure - struct attribute_group **sdev_group. This field allows to define groups of attributes. It will provide an ability to use binary attributes as well as device attributes and to group them under subfolders if necessary. Signed-off-by: Stanislav Nijnikov Reviewed-by: Greg Kroah-Hartman Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 1a1df0d21ee3..19317585ae48 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -476,6 +476,12 @@ struct scsi_host_template { */ struct device_attribute **sdev_attrs; + /* + * Pointer to the SCSI device attribute groups for this host, + * NULL terminated. + */ + const struct attribute_group **sdev_groups; + /* * List of hosts per template. * -- cgit From 1875ede02ed5e176a18dccbca84abc28d5b3e141 Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Tue, 6 Mar 2018 22:19:49 -0500 Subject: scsi: core: Make SCSI Status CONDITION MET equivalent to GOOD The SCSI PRE-FETCH (10 or 16) command is present both on hard disks and some SSDs. It is useful when the address of the next block(s) to be read is known but it is not following the LBA of the current READ (so read-ahead won't help). It returns two "good" SCSI Status values. If the requested blocks have fitted (or will most likely fit (when the IMMED bit is set)) into the disk's cache, it returns CONDITION MET. If it didn't (or will not) fit then it returns GOOD status. The goal of this patch is to stop the SCSI subsystem treating the CONDITION MET SCSI status as an error. The current state makes the PRE-FETCH command effectively unusable via pass-throughs. Signed-off-by: Douglas Gilbert Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- include/scsi/scsi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index cb85eddb47ea..eb7853c1a23b 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -47,6 +47,8 @@ static inline int scsi_status_is_good(int status) */ status &= 0xfe; return ((status == SAM_STAT_GOOD) || + (status == SAM_STAT_CONDITION_MET) || + /* Next two "intermediate" statuses are obsolete in SAM-4 */ (status == SAM_STAT_INTERMEDIATE) || (status == SAM_STAT_INTERMEDIATE_CONDITION_MET) || /* FIXME: this is obsolete in SAM-3 */ -- cgit From 83c9f08e6c6a6dc668384882de4dcf5ef4ae0ba7 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 19 Mar 2018 08:37:53 +0100 Subject: scsi: remove the old scsi_module.c initialization model After more than 15 years all users of this legacy interface are finally gone. Rest in peace! Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 19317585ae48..4e418fb539f8 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -51,21 +51,6 @@ struct scsi_host_template { struct module *module; const char *name; - /* - * Used to initialize old-style drivers. For new-style drivers - * just perform all work in your module initialization function. - * - * Status: OBSOLETE - */ - int (* detect)(struct scsi_host_template *); - - /* - * Used as unload callback for hosts with old-style drivers. - * - * Status: OBSOLETE - */ - int (* release)(struct Scsi_Host *); - /* * The info function will return whatever useful information the * developer sees fit. If not provided, then the name field will @@ -482,15 +467,6 @@ struct scsi_host_template { */ const struct attribute_group **sdev_groups; - /* - * List of hosts per template. - * - * This is only for use by scsi_module.c for legacy templates. - * For these access to it is synchronized implicitly by - * module_init/module_exit. - */ - struct list_head legacy_hosts; - /* * Vendor Identifier associated with the host * @@ -713,15 +689,6 @@ struct Scsi_Host { /* ldm bits */ struct device shost_gendev, shost_dev; - /* - * List of hosts per template. - * - * This is only for use by scsi_module.c for legacy templates. - * For these access to it is synchronized implicitly by - * module_init/module_exit. - */ - struct list_head sht_legacy_list; - /* * Points to the transport data (if any) which is allocated * separately @@ -922,9 +889,6 @@ static inline unsigned char scsi_host_get_guard(struct Scsi_Host *shost) return shost->prot_guard_type; } -/* legacy interfaces */ -extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); -extern void scsi_unregister(struct Scsi_Host *); extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state); #endif /* _SCSI_SCSI_HOST_H */ -- cgit