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
nexedi
linux
Commits
ff98f7ce
Commit
ff98f7ce
authored
Mar 31, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpt_i2o: switch to ->show_info()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8c986544
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
90 deletions
+12
-90
drivers/scsi/dpt_i2o.c
drivers/scsi/dpt_i2o.c
+12
-90
No files found.
drivers/scsi/dpt_i2o.c
View file @
ff98f7ce
...
...
@@ -553,36 +553,14 @@ static const char *adpt_info(struct Scsi_Host *host)
return
(
char
*
)
(
pHba
->
detail
);
}
static
int
adpt_proc_info
(
struct
Scsi_Host
*
host
,
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
int
inout
)
static
int
adpt_show_info
(
struct
seq_file
*
m
,
struct
Scsi_Host
*
host
)
{
struct
adpt_device
*
d
;
int
id
;
int
chan
;
int
len
=
0
;
int
begin
=
0
;
int
pos
=
0
;
adpt_hba
*
pHba
;
int
unit
;
*
start
=
buffer
;
if
(
inout
==
TRUE
)
{
/*
* The user has done a write and wants us to take the
* data in the buffer and do something with it.
* proc_scsiwrite calls us with inout = 1
*
* Read data from buffer (writing to us) - NOT SUPPORTED
*/
return
-
EINVAL
;
}
/*
* inout = 0 means the user has done a read and wants information
* returned, so we write information about the cards into the buffer
* proc_scsiread() calls us with inout = 0
*/
// Find HBA (host bus adapter) we are looking for
mutex_lock
(
&
adpt_configuration_lock
);
for
(
pHba
=
hba_chain
;
pHba
;
pHba
=
pHba
->
next
)
{
...
...
@@ -596,86 +574,30 @@ static int adpt_proc_info(struct Scsi_Host *host, char *buffer, char **start, of
}
host
=
pHba
->
host
;
len
=
sprintf
(
buffer
,
"Adaptec I2O RAID Driver Version: %s
\n\n
"
,
DPT_I2O_VERSION
);
len
+=
sprintf
(
buffer
+
len
,
"%s
\n
"
,
pHba
->
detail
);
len
+=
sprintf
(
buffer
+
len
,
"SCSI Host=scsi%d Control Node=/dev/%s irq=%d
\n
"
,
seq_printf
(
m
,
"Adaptec I2O RAID Driver Version: %s
\n\n
"
,
DPT_I2O_VERSION
);
seq_printf
(
m
,
"%s
\n
"
,
pHba
->
detail
);
seq_printf
(
m
,
"SCSI Host=scsi%d Control Node=/dev/%s irq=%d
\n
"
,
pHba
->
host
->
host_no
,
pHba
->
name
,
host
->
irq
);
len
+=
sprintf
(
buffer
+
len
,
"
\t
post fifo size = %d
\n\t
reply fifo size = %d
\n\t
sg table size = %d
\n\n
"
,
seq_printf
(
m
,
"
\t
post fifo size = %d
\n\t
reply fifo size = %d
\n\t
sg table size = %d
\n\n
"
,
host
->
can_queue
,
(
int
)
pHba
->
reply_fifo_size
,
host
->
sg_tablesize
);
pos
=
begin
+
len
;
/* CHECKPOINT */
if
(
pos
>
offset
+
length
)
{
goto
stop_output
;
}
if
(
pos
<=
offset
)
{
/*
* If we haven't even written to where we last left
* off (the last time we were called), reset the
* beginning pointer.
*/
len
=
0
;
begin
=
pos
;
}
len
+=
sprintf
(
buffer
+
len
,
"Devices:
\n
"
);
seq_printf
(
m
,
"Devices:
\n
"
);
for
(
chan
=
0
;
chan
<
MAX_CHANNEL
;
chan
++
)
{
for
(
id
=
0
;
id
<
MAX_ID
;
id
++
)
{
d
=
pHba
->
channel
[
chan
].
device
[
id
];
while
(
d
){
len
+=
sprintf
(
buffer
+
len
,
"
\t
%-24.24s"
,
d
->
pScsi_dev
->
vendor
);
len
+=
sprintf
(
buffer
+
len
,
" Rev: %-8.8s
\n
"
,
d
->
pScsi_dev
->
rev
);
pos
=
begin
+
len
;
/* CHECKPOINT */
if
(
pos
>
offset
+
length
)
{
goto
stop_output
;
}
if
(
pos
<=
offset
)
{
len
=
0
;
begin
=
pos
;
}
while
(
d
)
{
seq_printf
(
m
,
"
\t
%-24.24s"
,
d
->
pScsi_dev
->
vendor
);
seq_printf
(
m
,
" Rev: %-8.8s
\n
"
,
d
->
pScsi_dev
->
rev
);
unit
=
d
->
pI2o_dev
->
lct_data
.
tid
;
len
+=
sprintf
(
buffer
+
len
,
"
\t
TID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)
\n\n
"
,
seq_printf
(
m
,
"
\t
TID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)
\n\n
"
,
unit
,
(
int
)
d
->
scsi_channel
,
(
int
)
d
->
scsi_id
,
(
int
)
d
->
scsi_lun
,
scsi_device_online
(
d
->
pScsi_dev
)
?
"online"
:
"offline"
);
pos
=
begin
+
len
;
/* CHECKPOINT */
if
(
pos
>
offset
+
length
)
{
goto
stop_output
;
}
if
(
pos
<=
offset
)
{
len
=
0
;
begin
=
pos
;
}
d
=
d
->
next_lun
;
}
}
}
/*
* begin is where we last checked our position with regards to offset
* begin is always less than offset. len is relative to begin. It
* is the number of bytes written past begin
*
*/
stop_output:
/* stop the output and calculate the correct length */
*
(
buffer
+
len
)
=
'\0'
;
*
start
=
buffer
+
(
offset
-
begin
);
/* Start of wanted data */
len
-=
(
offset
-
begin
);
if
(
len
>
length
)
{
len
=
length
;
}
else
if
(
len
<
0
){
len
=
0
;
**
start
=
'\0'
;
}
return
len
;
return
0
;
}
/*
...
...
@@ -3639,7 +3561,7 @@ static struct scsi_host_template driver_template = {
.
module
=
THIS_MODULE
,
.
name
=
"dpt_i2o"
,
.
proc_name
=
"dpt_i2o"
,
.
proc_info
=
adpt_proc
_info
,
.
show_info
=
adpt_show
_info
,
.
info
=
adpt_info
,
.
queuecommand
=
adpt_queue
,
.
eh_abort_handler
=
adpt_abort
,
...
...
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