From: Patrick Mansfield <patmans@us.ibm.com>
To: stern@rowland.harvard.edu, mdharm-usb@one-eyed-alien.net,
James Bottomley <James.Bottomley@steeleye.com>,
linux-scsi@vger.kernel.org, usb-storage@lists.one-eyed-alien.net
Subject: [PATCH] Replace scsi_host flags with scsi_device sdev_bflags
Date: Sat, 13 Mar 2004 17:49:06 -0800 [thread overview]
Message-ID: <20040313174906.A3101@beaverton.ibm.com> (raw)
In-Reply-To: <20040313174651.A3054@beaverton.ibm.com>; from patmans@us.ibm.com on Sat, Mar 13, 2004 at 05:46:51PM -0800
Replace the scsi_host flags with scsi_device sdev_bflags. Change USB to
set sdev_bflags in its new slave_alloc function.
diff -uprN -X /home/patman/dontdiff base-2.6/drivers/scsi/scsi_devinfo.c add_sdev_bflags-2.6/drivers/scsi/scsi_devinfo.c
--- base-2.6/drivers/scsi/scsi_devinfo.c Fri Mar 12 16:07:10 2004
+++ add_sdev_bflags-2.6/drivers/scsi/scsi_devinfo.c Fri Mar 12 16:16:47 2004
@@ -329,7 +329,7 @@ int scsi_get_device_flags(struct scsi_de
struct scsi_dev_info_list *devinfo;
unsigned int bflags;
- bflags = sdev->host->hostt->flags;
+ bflags = sdev->sdev_bflags;
if (!bflags)
bflags = scsi_default_dev_flags;
diff -uprN -X /home/patman/dontdiff base-2.6/drivers/usb/storage/scsiglue.c add_sdev_bflags-2.6/drivers/usb/storage/scsiglue.c
--- base-2.6/drivers/usb/storage/scsiglue.c Thu Mar 11 11:23:05 2004
+++ add_sdev_bflags-2.6/drivers/usb/storage/scsiglue.c Fri Mar 12 16:16:47 2004
@@ -64,6 +64,17 @@ static const char* host_info(struct Scsi
return "SCSI emulation for USB Mass Storage devices";
}
+static int slave_alloc (struct scsi_device *sdev)
+{
+ /*
+ * Set default bflags. These can be overridden for individual
+ * models and vendors via the scsi devinfo mechanism.
+ */
+ sdev->sdev_bflags = (BLIST_MS_SKIP_PAGE_08 | BLIST_MS_SKIP_PAGE_3F |
+ BLIST_USE_10_BYTE_MS);
+ return 0;
+}
+
static int slave_configure (struct scsi_device *sdev)
{
/* Scatter-gather buffers (all but the last) must have a length
@@ -365,6 +376,7 @@ struct scsi_host_template usb_stor_host_
/* unknown initiator id */
.this_id = -1,
+ .slave_alloc = slave_alloc,
.slave_configure = slave_configure,
/* lots of sg segments can be handled */
@@ -384,10 +396,6 @@ struct scsi_host_template usb_stor_host_
/* sysfs device attributes */
.sdev_attrs = sysfs_device_attr_list,
-
- /* modify scsi_device bits on probe */
- .flags = (BLIST_MS_SKIP_PAGE_08 | BLIST_MS_SKIP_PAGE_3F |
- BLIST_USE_10_BYTE_MS),
/* module management */
.module = THIS_MODULE
diff -uprN -X /home/patman/dontdiff base-2.6/include/scsi/scsi_device.h add_sdev_bflags-2.6/include/scsi/scsi_device.h
--- base-2.6/include/scsi/scsi_device.h Fri Mar 12 16:07:11 2004
+++ add_sdev_bflags-2.6/include/scsi/scsi_device.h Fri Mar 12 16:16:47 2004
@@ -64,6 +64,10 @@ struct scsi_device {
unsigned char current_tag; /* current tag */
struct scsi_target *sdev_target; /* used only for single_lun */
+ unsigned int sdev_bflags; /* black/white flags as also found in
+ * scsi_devinfo.[hc]. For now used only to
+ * pass settings from slave_alloc to scsi
+ * core. */
unsigned online:1;
unsigned writeable:1;
diff -uprN -X /home/patman/dontdiff base-2.6/include/scsi/scsi_host.h add_sdev_bflags-2.6/include/scsi/scsi_host.h
--- base-2.6/include/scsi/scsi_host.h Fri Mar 12 16:07:11 2004
+++ add_sdev_bflags-2.6/include/scsi/scsi_host.h Fri Mar 12 16:16:47 2004
@@ -345,12 +345,6 @@ struct scsi_host_template {
* module_init/module_exit.
*/
struct list_head legacy_hosts;
-
- /*
- * Default flags settings, these modify the setting of scsi_device
- * bits.
- */
- unsigned int flags;
};
/*
next prev parent reply other threads:[~2004-03-14 1:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-14 1:46 adding flag for 192 byte mode sense Patrick Mansfield
2004-03-14 1:49 ` Patrick Mansfield [this message]
2004-03-14 1:50 ` [PATCH] Add 192 byte MODE SENSE flag Patrick Mansfield
2004-03-16 17:25 ` adding flag for 192 byte mode sense Alan Stern
2004-03-16 18:02 ` Matthew Dharm
2004-03-16 20:08 ` Alan Stern
2004-03-16 20:27 ` [usb-storage] " Pat LaVarre
2004-03-22 16:16 ` Alan Stern
2004-03-22 16:31 ` James Bottomley
2004-03-22 17:28 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040313174906.A3101@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=stern@rowland.harvard.edu \
--cc=usb-storage@lists.one-eyed-alien.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox