Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
060b54e2
Commit
060b54e2
authored
Mar 16, 2004
by
James Bottomley
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
49ccf84d
2e4420fa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
29 deletions
+46
-29
drivers/scsi/scsi_devinfo.c
drivers/scsi/scsi_devinfo.c
+1
-1
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_scan.c
+3
-0
drivers/scsi/sd.c
drivers/scsi/sd.c
+24
-18
drivers/usb/storage/scsiglue.c
drivers/usb/storage/scsiglue.c
+12
-4
include/scsi/scsi_device.h
include/scsi/scsi_device.h
+5
-0
include/scsi/scsi_devinfo.h
include/scsi/scsi_devinfo.h
+1
-0
include/scsi/scsi_host.h
include/scsi/scsi_host.h
+0
-6
No files found.
drivers/scsi/scsi_devinfo.c
View file @
060b54e2
...
...
@@ -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_b
flags
;
if
(
!
bflags
)
bflags
=
scsi_default_dev_flags
;
...
...
drivers/scsi/scsi_scan.c
View file @
060b54e2
...
...
@@ -646,6 +646,9 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
* may do I/O */
scsi_device_set_state
(
sdev
,
SDEV_RUNNING
);
if
(
*
bflags
&
BLIST_MS_192_BYTES_FOR_3F
)
sdev
->
use_192_bytes_for_3f
=
1
;
if
(
sdev
->
host
->
hostt
->
slave_configure
)
sdev
->
host
->
hostt
->
slave_configure
(
sdev
);
...
...
drivers/scsi/sd.c
View file @
060b54e2
...
...
@@ -1122,26 +1122,32 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, char *diskname,
return
;
}
/*
* First attempt: ask for all pages (0x3F), but only 4 bytes.
* We have to start carefully: some devices hang if we ask
* for more than is available.
*/
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0x3F
,
buffer
,
4
,
&
data
);
if
(
sdkp
->
device
->
use_192_bytes_for_3f
)
{
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0x3F
,
buffer
,
192
,
&
data
);
}
else
{
/*
* First attempt: ask for all pages (0x3F), but only 4 bytes.
* We have to start carefully: some devices hang if we ask
* for more than is available.
*/
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0x3F
,
buffer
,
4
,
&
data
);
/*
* Second attempt: ask for page 0
* When only page 0 is implemented, a request for page 3F may return
* Sense Key 5: Illegal Request, Sense Code 24: Invalid field in CDB.
*/
if
(
!
scsi_status_is_good
(
res
))
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0
,
buffer
,
4
,
&
data
);
/*
* Second attempt: ask for page 0 When only page 0 is
* implemented, a request for page 3F may return Sense Key
* 5: Illegal Request, Sense Code 24: Invalid field in
* CDB.
*/
if
(
!
scsi_status_is_good
(
res
))
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0
,
buffer
,
4
,
&
data
);
/*
* Third attempt: ask 255 bytes, as we did earlier.
*/
if
(
!
scsi_status_is_good
(
res
))
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0x3F
,
buffer
,
255
,
&
data
);
/*
* Third attempt: ask 255 bytes, as we did earlier.
*/
if
(
!
scsi_status_is_good
(
res
))
res
=
sd_do_mode_sense
(
SRpnt
,
0
,
0x3F
,
buffer
,
255
,
&
data
);
}
if
(
!
scsi_status_is_good
(
res
))
{
printk
(
KERN_WARNING
...
...
drivers/usb/storage/scsiglue.c
View file @
060b54e2
...
...
@@ -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
};
...
...
include/scsi/scsi_device.h
View file @
060b54e2
...
...
@@ -71,6 +71,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
writeable
:
1
;
unsigned
removable
:
1
;
unsigned
changed
:
1
;
/* Data invalid due to media change */
...
...
@@ -98,6 +102,7 @@ struct scsi_device {
unsigned
use_10_for_ms
:
1
;
/* first try 10-byte mode sense/select */
unsigned
skip_ms_page_8
:
1
;
/* do not use MODE SENSE page 0x08 */
unsigned
skip_ms_page_3f
:
1
;
/* do not use MODE SENSE page 0x3f */
unsigned
use_192_bytes_for_3f
:
1
;
/* ask for 192 bytes from page 0x3f */
unsigned
no_start_on_add
:
1
;
/* do not issue start on add */
unsigned
allow_restart
:
1
;
/* issue START_UNIT in error handler */
...
...
include/scsi/scsi_devinfo.h
View file @
060b54e2
...
...
@@ -19,4 +19,5 @@
#define BLIST_MS_SKIP_PAGE_08 0x2000
/* do not send ms page 0x08 */
#define BLIST_MS_SKIP_PAGE_3F 0x4000
/* do not send ms page 0x3f */
#define BLIST_USE_10_BYTE_MS 0x8000
/* use 10 byte ms before 6 byte ms */
#define BLIST_MS_192_BYTES_FOR_3F 0x10000
/* 192 byte ms page 0x3f request */
#endif
include/scsi/scsi_host.h
View file @
060b54e2
...
...
@@ -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
;
};
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment