Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
51cf2249
Commit
51cf2249
authored
Jul 16, 2007
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aha1542: convert to use the data buffer accessors
Signed-off-by:
Jens Axboe
<
jens.axboe@oracle.com
>
parent
d274a987
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
drivers/scsi/aha1542.c
drivers/scsi/aha1542.c
+15
-17
No files found.
drivers/scsi/aha1542.c
View file @
51cf2249
...
@@ -61,15 +61,15 @@ static void BAD_DMA(void *address, unsigned int length)
...
@@ -61,15 +61,15 @@ static void BAD_DMA(void *address, unsigned int length)
}
}
static
void
BAD_SG_DMA
(
Scsi_Cmnd
*
SCpnt
,
static
void
BAD_SG_DMA
(
Scsi_Cmnd
*
SCpnt
,
struct
scatterlist
*
sgp
nt
,
struct
scatterlist
*
sgp
,
int
nseg
,
int
nseg
,
int
badseg
)
int
badseg
)
{
{
printk
(
KERN_CRIT
"sgpnt[%d:%d] page %p/0x%llx length %u
\n
"
,
printk
(
KERN_CRIT
"sgpnt[%d:%d] page %p/0x%llx length %u
\n
"
,
badseg
,
nseg
,
badseg
,
nseg
,
page_address
(
sgp
nt
[
badseg
].
page
)
+
sgpnt
[
badseg
].
offset
,
page_address
(
sgp
->
page
)
+
sgp
->
offset
,
(
unsigned
long
long
)
SCSI_SG_PA
(
&
sgpnt
[
badseg
]
),
(
unsigned
long
long
)
SCSI_SG_PA
(
sgp
),
sgp
nt
[
badseg
].
length
);
sgp
->
length
);
/*
/*
* Not safe to continue.
* Not safe to continue.
...
@@ -691,7 +691,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
...
@@ -691,7 +691,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
memcpy
(
ccb
[
mbo
].
cdb
,
cmd
,
ccb
[
mbo
].
cdblen
);
memcpy
(
ccb
[
mbo
].
cdb
,
cmd
,
ccb
[
mbo
].
cdblen
);
if
(
SCpnt
->
use_sg
)
{
if
(
SCpnt
->
use_sg
)
{
struct
scatterlist
*
sg
pnt
;
struct
scatterlist
*
sg
;
struct
chain
*
cptr
;
struct
chain
*
cptr
;
#ifdef DEBUG
#ifdef DEBUG
unsigned
char
*
ptr
;
unsigned
char
*
ptr
;
...
@@ -699,23 +699,21 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
...
@@ -699,23 +699,21 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
int
i
;
int
i
;
ccb
[
mbo
].
op
=
2
;
/* SCSI Initiator Command w/scatter-gather */
ccb
[
mbo
].
op
=
2
;
/* SCSI Initiator Command w/scatter-gather */
SCpnt
->
host_scribble
=
kmalloc
(
512
,
GFP_KERNEL
|
GFP_DMA
);
SCpnt
->
host_scribble
=
kmalloc
(
512
,
GFP_KERNEL
|
GFP_DMA
);
sgpnt
=
(
struct
scatterlist
*
)
SCpnt
->
request_buffer
;
cptr
=
(
struct
chain
*
)
SCpnt
->
host_scribble
;
cptr
=
(
struct
chain
*
)
SCpnt
->
host_scribble
;
if
(
cptr
==
NULL
)
{
if
(
cptr
==
NULL
)
{
/* free the claimed mailbox slot */
/* free the claimed mailbox slot */
HOSTDATA
(
SCpnt
->
device
->
host
)
->
SCint
[
mbo
]
=
NULL
;
HOSTDATA
(
SCpnt
->
device
->
host
)
->
SCint
[
mbo
]
=
NULL
;
return
SCSI_MLQUEUE_HOST_BUSY
;
return
SCSI_MLQUEUE_HOST_BUSY
;
}
}
for
(
i
=
0
;
i
<
SCpnt
->
use_sg
;
i
++
)
{
scsi_for_each_sg
(
SCpnt
,
sg
,
SCpnt
->
use_sg
,
i
)
{
if
(
sg
pnt
[
i
].
length
==
0
||
SCpnt
->
use_sg
>
16
||
if
(
sg
->
length
==
0
||
SCpnt
->
use_sg
>
16
||
(((
int
)
sg
pnt
[
i
].
offset
)
&
1
)
||
(
sgpnt
[
i
].
length
&
1
))
{
(((
int
)
sg
->
offset
)
&
1
)
||
(
sg
->
length
&
1
))
{
unsigned
char
*
ptr
;
unsigned
char
*
ptr
;
printk
(
KERN_CRIT
"Bad segment list supplied to aha1542.c (%d, %d)
\n
"
,
SCpnt
->
use_sg
,
i
);
printk
(
KERN_CRIT
"Bad segment list supplied to aha1542.c (%d, %d)
\n
"
,
SCpnt
->
use_sg
,
i
);
for
(
i
=
0
;
i
<
SCpnt
->
use_sg
;
i
++
)
{
scsi_for_each_sg
(
SCpnt
,
sg
,
SCpnt
->
use_sg
,
i
)
{
printk
(
KERN_CRIT
"%d: %p %d
\n
"
,
i
,
printk
(
KERN_CRIT
"%d: %p %d
\n
"
,
i
,
(
page_address
(
sgpnt
[
i
].
page
)
+
(
page_address
(
sg
->
page
)
+
sgpnt
[
i
].
offset
),
sg
->
offset
),
sg
->
length
);
sgpnt
[
i
].
length
);
};
};
printk
(
KERN_CRIT
"cptr %x: "
,
(
unsigned
int
)
cptr
);
printk
(
KERN_CRIT
"cptr %x: "
,
(
unsigned
int
)
cptr
);
ptr
=
(
unsigned
char
*
)
&
cptr
[
i
];
ptr
=
(
unsigned
char
*
)
&
cptr
[
i
];
...
@@ -723,10 +721,10 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
...
@@ -723,10 +721,10 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
printk
(
"%02x "
,
ptr
[
i
]);
printk
(
"%02x "
,
ptr
[
i
]);
panic
(
"Foooooooood fight!"
);
panic
(
"Foooooooood fight!"
);
};
};
any2scsi
(
cptr
[
i
].
dataptr
,
SCSI_SG_PA
(
&
sgpnt
[
i
]
));
any2scsi
(
cptr
[
i
].
dataptr
,
SCSI_SG_PA
(
sg
));
if
(
SCSI_SG_PA
(
&
sgpnt
[
i
])
+
sgpnt
[
i
].
length
-
1
>
ISA_DMA_THRESHOLD
)
if
(
SCSI_SG_PA
(
sg
)
+
sg
->
length
-
1
>
ISA_DMA_THRESHOLD
)
BAD_SG_DMA
(
SCpnt
,
sg
pnt
,
SCpnt
->
use_sg
,
i
);
BAD_SG_DMA
(
SCpnt
,
sg
,
SCpnt
->
use_sg
,
i
);
any2scsi
(
cptr
[
i
].
datalen
,
sg
pnt
[
i
].
length
);
any2scsi
(
cptr
[
i
].
datalen
,
sg
->
length
);
};
};
any2scsi
(
ccb
[
mbo
].
datalen
,
SCpnt
->
use_sg
*
sizeof
(
struct
chain
));
any2scsi
(
ccb
[
mbo
].
datalen
,
SCpnt
->
use_sg
*
sizeof
(
struct
chain
));
any2scsi
(
ccb
[
mbo
].
dataptr
,
SCSI_BUF_PA
(
cptr
));
any2scsi
(
ccb
[
mbo
].
dataptr
,
SCSI_BUF_PA
(
cptr
));
...
...
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