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
40ea4c83
Commit
40ea4c83
authored
Oct 17, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Plain Diff
Merge mulgrave.(none):/home/jejb/BK/53c700-2.5
into mulgrave.(none):/home/jejb/BK/scsi-for-linus-2.5
parents
60db5f20
3a0e045b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
12 deletions
+41
-12
drivers/scsi/53c700.c
drivers/scsi/53c700.c
+28
-5
drivers/scsi/53c700.h
drivers/scsi/53c700.h
+5
-0
drivers/scsi/scsi.h
drivers/scsi/scsi.h
+8
-7
No files found.
drivers/scsi/53c700.c
View file @
40ea4c83
...
@@ -170,6 +170,8 @@ STATIC int NCR_700_host_reset(Scsi_Cmnd * SCpnt);
...
@@ -170,6 +170,8 @@ STATIC int NCR_700_host_reset(Scsi_Cmnd * SCpnt);
STATIC
int
NCR_700_proc_directory_info
(
char
*
,
char
**
,
off_t
,
int
,
int
,
int
);
STATIC
int
NCR_700_proc_directory_info
(
char
*
,
char
**
,
off_t
,
int
,
int
,
int
);
STATIC
void
NCR_700_chip_setup
(
struct
Scsi_Host
*
host
);
STATIC
void
NCR_700_chip_setup
(
struct
Scsi_Host
*
host
);
STATIC
void
NCR_700_chip_reset
(
struct
Scsi_Host
*
host
);
STATIC
void
NCR_700_chip_reset
(
struct
Scsi_Host
*
host
);
STATIC
int
NCR_700_slave_attach
(
Scsi_Device
*
SDpnt
);
STATIC
void
NCR_700_slave_detach
(
Scsi_Device
*
SDpnt
);
static
char
*
NCR_700_phase
[]
=
{
static
char
*
NCR_700_phase
[]
=
{
""
,
""
,
...
@@ -280,9 +282,11 @@ NCR_700_detect(Scsi_Host_Template *tpnt,
...
@@ -280,9 +282,11 @@ NCR_700_detect(Scsi_Host_Template *tpnt,
tpnt
->
eh_host_reset_handler
=
NCR_700_host_reset
;
tpnt
->
eh_host_reset_handler
=
NCR_700_host_reset
;
tpnt
->
can_queue
=
NCR_700_COMMAND_SLOTS_PER_HOST
;
tpnt
->
can_queue
=
NCR_700_COMMAND_SLOTS_PER_HOST
;
tpnt
->
sg_tablesize
=
NCR_700_SG_SEGMENTS
;
tpnt
->
sg_tablesize
=
NCR_700_SG_SEGMENTS
;
tpnt
->
cmd_per_lun
=
NCR_700_
MAX_TAGS
;
tpnt
->
cmd_per_lun
=
NCR_700_
CMD_PER_LUN
;
tpnt
->
use_clustering
=
DISABLE_CLUSTERING
;
tpnt
->
use_clustering
=
DISABLE_CLUSTERING
;
tpnt
->
proc_info
=
NCR_700_proc_directory_info
;
tpnt
->
proc_info
=
NCR_700_proc_directory_info
;
tpnt
->
slave_attach
=
NCR_700_slave_attach
;
tpnt
->
slave_detach
=
NCR_700_slave_detach
;
tpnt
->
use_blk_tcq
=
1
;
tpnt
->
use_blk_tcq
=
1
;
tpnt
->
highmem_io
=
1
;
tpnt
->
highmem_io
=
1
;
...
@@ -891,8 +895,8 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata
...
@@ -891,8 +895,8 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata
printk
(
KERN_WARNING
"scsi%d (%d:%d) Rejected first tag queue attempt, turning off tag queueing
\n
"
,
host
->
host_no
,
pun
,
lun
);
printk
(
KERN_WARNING
"scsi%d (%d:%d) Rejected first tag queue attempt, turning off tag queueing
\n
"
,
host
->
host_no
,
pun
,
lun
);
NCR_700_clear_flag
(
SCp
->
device
,
NCR_700_DEV_BEGIN_TAG_QUEUEING
);
NCR_700_clear_flag
(
SCp
->
device
,
NCR_700_DEV_BEGIN_TAG_QUEUEING
);
hostdata
->
tag_negotiated
&=
~
(
1
<<
SCp
->
target
);
hostdata
->
tag_negotiated
&=
~
(
1
<<
SCp
->
target
);
SCp
->
device
->
tagged_queue
=
0
;
SCp
->
device
->
tagged_supported
=
0
;
SCp
->
device
->
tagged_supported
=
0
;
scsi_deactivate_tcq
(
SCp
->
device
);
}
else
{
}
else
{
printk
(
KERN_WARNING
"scsi%d (%d:%d) Unexpected REJECT Message %s
\n
"
,
printk
(
KERN_WARNING
"scsi%d (%d:%d) Unexpected REJECT Message %s
\n
"
,
host
->
host_no
,
pun
,
lun
,
host
->
host_no
,
pun
,
lun
,
...
@@ -1739,7 +1743,7 @@ NCR_700_proc_directory_info(char *proc_buf, char **startp,
...
@@ -1739,7 +1743,7 @@ NCR_700_proc_directory_info(char *proc_buf, char **startp,
Target Depth Active Next Tag
\n
\
Target Depth Active Next Tag
\n
\
====== ===== ====== ========
\n
"
);
====== ===== ====== ========
\n
"
);
for
(
SDp
=
host
->
host_queue
;
SDp
!=
NULL
;
SDp
=
SDp
->
next
)
{
for
(
SDp
=
host
->
host_queue
;
SDp
!=
NULL
;
SDp
=
SDp
->
next
)
{
len
+=
sprintf
(
&
buf
[
len
],
" %2d:%2d %4d %4d %4d
\n
"
,
SDp
->
id
,
SDp
->
lun
,
SDp
->
queue_depth
,
NCR_700_get_depth
(
SDp
),
SDp
->
current_tag
);
len
+=
sprintf
(
&
buf
[
len
],
" %2d:%2d %4d %4d %4d
\n
"
,
SDp
->
id
,
SDp
->
lun
,
SDp
->
current_
queue_depth
,
NCR_700_get_depth
(
SDp
),
SDp
->
current_tag
);
}
}
if
((
len
-=
offset
)
<=
0
)
if
((
len
-=
offset
)
<=
0
)
return
0
;
return
0
;
...
@@ -1776,13 +1780,13 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
...
@@ -1776,13 +1780,13 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
DEBUG
((
KERN_ERR
"scsi%d (%d:%d) has non zero depth %d
\n
"
,
DEBUG
((
KERN_ERR
"scsi%d (%d:%d) has non zero depth %d
\n
"
,
SCp
->
host
->
host_no
,
SCp
->
target
,
SCp
->
lun
,
SCp
->
host
->
host_no
,
SCp
->
target
,
SCp
->
lun
,
NCR_700_get_depth
(
SCp
->
device
)));
NCR_700_get_depth
(
SCp
->
device
)));
return
1
;
return
SCSI_MLQUEUE_DEVICE_BUSY
;
}
}
if
(
NCR_700_get_depth
(
SCp
->
device
)
>=
NCR_700_MAX_TAGS
)
{
if
(
NCR_700_get_depth
(
SCp
->
device
)
>=
NCR_700_MAX_TAGS
)
{
DEBUG
((
KERN_ERR
"scsi%d (%d:%d) has max tag depth %d
\n
"
,
DEBUG
((
KERN_ERR
"scsi%d (%d:%d) has max tag depth %d
\n
"
,
SCp
->
host
->
host_no
,
SCp
->
target
,
SCp
->
lun
,
SCp
->
host
->
host_no
,
SCp
->
target
,
SCp
->
lun
,
NCR_700_get_depth
(
SCp
->
device
)));
NCR_700_get_depth
(
SCp
->
device
)));
return
1
;
return
SCSI_MLQUEUE_DEVICE_BUSY
;
}
}
NCR_700_set_depth
(
SCp
->
device
,
NCR_700_get_depth
(
SCp
->
device
)
+
1
);
NCR_700_set_depth
(
SCp
->
device
,
NCR_700_get_depth
(
SCp
->
device
)
+
1
);
...
@@ -1998,6 +2002,25 @@ NCR_700_host_reset(Scsi_Cmnd * SCp)
...
@@ -1998,6 +2002,25 @@ NCR_700_host_reset(Scsi_Cmnd * SCp)
return
SUCCESS
;
return
SUCCESS
;
}
}
STATIC
int
NCR_700_slave_attach
(
Scsi_Device
*
SDp
)
{
/* to do here: allocate memory; build a queue_full list */
if
(
SDp
->
tagged_supported
)
{
/* do TCQ stuff here */
}
else
{
/* initialise to default depth */
scsi_adjust_queue_depth
(
SDp
,
0
,
SDp
->
host
->
cmd_per_lun
);
}
return
0
;
}
STATIC
void
NCR_700_slave_detach
(
Scsi_Device
*
SDp
)
{
/* to do here: deallocate memory */
}
EXPORT_SYMBOL
(
NCR_700_detect
);
EXPORT_SYMBOL
(
NCR_700_detect
);
EXPORT_SYMBOL
(
NCR_700_release
);
EXPORT_SYMBOL
(
NCR_700_release
);
EXPORT_SYMBOL
(
NCR_700_intr
);
EXPORT_SYMBOL
(
NCR_700_intr
);
drivers/scsi/53c700.h
View file @
40ea4c83
...
@@ -30,6 +30,11 @@
...
@@ -30,6 +30,11 @@
/* Alter this with care: too many tags won't give the elevator a chance to
/* Alter this with care: too many tags won't give the elevator a chance to
* work; too few will cause the device to operate less efficiently */
* work; too few will cause the device to operate less efficiently */
#define NCR_700_MAX_TAGS 16
#define NCR_700_MAX_TAGS 16
/* This is the default number of commands per LUN in the untagged case.
* two is a good value because it means we can have one command active and
* one command fully prepared and waiting
*/
#define NCR_700_CMD_PER_LUN 2
/* magic byte identifying an internally generated REQUEST_SENSE command */
/* magic byte identifying an internally generated REQUEST_SENSE command */
#define NCR_700_INTERNAL_SENSE_MAGIC 0x42
#define NCR_700_INTERNAL_SENSE_MAGIC 0x42
...
...
drivers/scsi/scsi.h
View file @
40ea4c83
...
@@ -877,6 +877,12 @@ struct scsi_cmnd {
...
@@ -877,6 +877,12 @@ struct scsi_cmnd {
extern
int
scsi_reset_provider
(
Scsi_Device
*
,
int
);
extern
int
scsi_reset_provider
(
Scsi_Device
*
,
int
);
#define MSG_SIMPLE_TAG 0x20
#define MSG_HEAD_TAG 0x21
#define MSG_ORDERED_TAG 0x22
#define SCSI_NO_TAG (-1)
/* identify no tag in use */
/**
/**
* scsi_activate_tcq - turn on tag command queueing
* scsi_activate_tcq - turn on tag command queueing
* @SDpnt: device to turn on TCQ for
* @SDpnt: device to turn on TCQ for
...
@@ -892,7 +898,7 @@ static inline void scsi_activate_tcq(Scsi_Device *SDpnt, int depth) {
...
@@ -892,7 +898,7 @@ static inline void scsi_activate_tcq(Scsi_Device *SDpnt, int depth) {
if
(
SDpnt
->
tagged_supported
&&
!
blk_queue_tagged
(
q
))
{
if
(
SDpnt
->
tagged_supported
&&
!
blk_queue_tagged
(
q
))
{
blk_queue_init_tags
(
q
,
depth
);
blk_queue_init_tags
(
q
,
depth
);
SDpnt
->
tagged_queue
=
1
;
scsi_adjust_queue_depth
(
SDpnt
,
MSG_ORDERED_TAG
,
depth
)
;
}
}
}
}
...
@@ -902,13 +908,8 @@ static inline void scsi_activate_tcq(Scsi_Device *SDpnt, int depth) {
...
@@ -902,13 +908,8 @@ static inline void scsi_activate_tcq(Scsi_Device *SDpnt, int depth) {
**/
**/
static
inline
void
scsi_deactivate_tcq
(
Scsi_Device
*
SDpnt
)
{
static
inline
void
scsi_deactivate_tcq
(
Scsi_Device
*
SDpnt
)
{
blk_queue_free_tags
(
&
SDpnt
->
request_queue
);
blk_queue_free_tags
(
&
SDpnt
->
request_queue
);
SDpnt
->
tagged_queue
=
0
;
scsi_adjust_queue_depth
(
SDpnt
,
0
,
2
)
;
}
}
#define MSG_SIMPLE_TAG 0x20
#define MSG_HEAD_TAG 0x21
#define MSG_ORDERED_TAG 0x22
#define SCSI_NO_TAG (-1)
/* identify no tag in use */
/**
/**
* scsi_populate_tag_msg - place a tag message in a buffer
* scsi_populate_tag_msg - place a tag message in a buffer
...
...
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