Commit 2160d142 authored by Patrick Mansfield's avatar Patrick Mansfield Committed by James Bottomley

[PATCH] Replace scsi_host flags with scsi_device sdev_bflags

Replace the scsi_host flags with scsi_device sdev_bflags. Change USB to
set sdev_bflags in its new slave_alloc function.
parent 998fe797
......@@ -333,7 +333,7 @@ int scsi_get_device_flags(struct scsi_device *sdev, unsigned char *vendor,
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;
......
......@@ -64,6 +64,17 @@ static const char* host_info(struct Scsi_Host *host)
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_template = {
/* unknown initiator id */
.this_id = -1,
.slave_alloc = slave_alloc,
.slave_configure = slave_configure,
/* lots of sg segments can be handled */
......@@ -385,10 +397,6 @@ struct scsi_host_template usb_stor_host_template = {
/* 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
};
......
......@@ -67,6 +67,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;
......
......@@ -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;
};
/*
......
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