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
3403c090
Commit
3403c090
authored
Apr 24, 2004
by
Kurt Garloff
Committed by
James Bottomley
Apr 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] scsi: don't attach device if PQ indicates not connected
parent
3dca9ce9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
11 deletions
+15
-11
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_scan.c
+5
-10
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_sysfs.c
+2
-1
include/scsi/scsi.h
include/scsi/scsi.h
+7
-0
include/scsi/scsi_device.h
include/scsi/scsi_device.h
+1
-0
No files found.
drivers/scsi/scsi_scan.c
View file @
3403c090
...
@@ -543,17 +543,12 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
...
@@ -543,17 +543,12 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
* 011 the same. Stay compatible with previous code, and create a
* 011 the same. Stay compatible with previous code, and create a
* Scsi_Device for a PQ of 1
* Scsi_Device for a PQ of 1
*
*
* XXX Save the PQ field let the upper layers figure out if they
* Don't set the device offline here; rather let the upper
* want to attach or not to this device, do not set online FALSE;
* level drivers eval the PQ to decide whether they should
* otherwise, offline devices still get an sd allocated, and they
* attach. So remove ((inq_result[0] >> 5) & 7) == 1 check.
* use up an sd slot.
*/
*/
if
(((
inq_result
[
0
]
>>
5
)
&
7
)
==
1
)
{
SCSI_LOG_SCAN_BUS
(
3
,
printk
(
KERN_INFO
"scsi scan: peripheral"
" qualifier of 1, device offlined
\n
"
));
scsi_device_set_state
(
sdev
,
SDEV_OFFLINE
);
}
sdev
->
inq_periph_qual
=
(
inq_result
[
0
]
>>
5
)
&
7
;
sdev
->
removable
=
(
0x80
&
inq_result
[
1
])
>>
7
;
sdev
->
removable
=
(
0x80
&
inq_result
[
1
])
>>
7
;
sdev
->
lockable
=
sdev
->
removable
;
sdev
->
lockable
=
sdev
->
removable
;
sdev
->
soft_reset
=
(
inq_result
[
7
]
&
1
)
&&
((
inq_result
[
3
]
&
7
)
==
2
);
sdev
->
soft_reset
=
(
inq_result
[
7
]
&
1
)
&&
((
inq_result
[
3
]
&
7
)
==
2
);
...
...
drivers/scsi/scsi_sysfs.c
View file @
3403c090
...
@@ -181,7 +181,8 @@ struct class sdev_class = {
...
@@ -181,7 +181,8 @@ struct class sdev_class = {
/* all probing is done in the individual ->probe routines */
/* all probing is done in the individual ->probe routines */
static
int
scsi_bus_match
(
struct
device
*
dev
,
struct
device_driver
*
gendrv
)
static
int
scsi_bus_match
(
struct
device
*
dev
,
struct
device_driver
*
gendrv
)
{
{
return
1
;
struct
scsi_device
*
sdp
=
to_scsi_device
(
dev
);
return
(
sdp
->
inq_periph_qual
==
SCSI_INQ_PQ_CON
)
?
1
:
0
;
}
}
struct
bus_type
scsi_bus_type
=
{
struct
bus_type
scsi_bus_type
=
{
...
...
include/scsi/scsi.h
View file @
3403c090
...
@@ -362,6 +362,13 @@ struct scsi_lun {
...
@@ -362,6 +362,13 @@ struct scsi_lun {
#define SCSI_2 3
#define SCSI_2 3
#define SCSI_3 4
#define SCSI_3 4
/*
* INQ PERIPHERAL QUALIFIERS
*/
#define SCSI_INQ_PQ_CON 0x00
#define SCSI_INQ_PQ_NOT_CON 0x01
#define SCSI_INQ_PQ_NOT_CAP 0x03
/*
/*
* Here are some scsi specific ioctl commands which are sometimes useful.
* Here are some scsi specific ioctl commands which are sometimes useful.
...
...
include/scsi/scsi_device.h
View file @
3403c090
...
@@ -63,6 +63,7 @@ struct scsi_device {
...
@@ -63,6 +63,7 @@ struct scsi_device {
char
devfs_name
[
256
];
/* devfs junk */
char
devfs_name
[
256
];
/* devfs junk */
char
type
;
char
type
;
char
scsi_level
;
char
scsi_level
;
char
inq_periph_qual
;
/* PQ from INQUIRY data */
unsigned
char
inquiry_len
;
/* valid bytes in 'inquiry' */
unsigned
char
inquiry_len
;
/* valid bytes in 'inquiry' */
unsigned
char
*
inquiry
;
/* INQUIRY response data */
unsigned
char
*
inquiry
;
/* INQUIRY response data */
char
*
vendor
;
/* [back_compat] point into 'inquiry' ... */
char
*
vendor
;
/* [back_compat] point into 'inquiry' ... */
...
...
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