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
3ca1a0bb
Commit
3ca1a0bb
authored
Oct 06, 2002
by
Alan Cox
Committed by
Linus Torvalds
Oct 06, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Fix stupid scsi setup bug in 53c406, fix addressing
parent
98fb18b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
drivers/scsi/NCR53c406a.c
drivers/scsi/NCR53c406a.c
+21
-20
No files found.
drivers/scsi/NCR53c406a.c
View file @
3ca1a0bb
...
@@ -459,7 +459,7 @@ static __inline__ int NCR53c406a_pio_write(unsigned char *request,
...
@@ -459,7 +459,7 @@ static __inline__ int NCR53c406a_pio_write(unsigned char *request,
int
__init
int
__init
NCR53c406a_detect
(
Scsi_Host_Template
*
tpnt
){
NCR53c406a_detect
(
Scsi_Host_Template
*
tpnt
){
struct
Scsi_Host
*
shpnt
;
struct
Scsi_Host
*
shpnt
=
NULL
;
#ifndef PORT_BASE
#ifndef PORT_BASE
int
i
;
int
i
;
#endif
#endif
...
@@ -535,11 +535,20 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
...
@@ -535,11 +535,20 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
#endif
#endif
DEB
(
printk
(
"NCR53c406a: using port_base %x
\n
"
,
port_base
));
DEB
(
printk
(
"NCR53c406a: using port_base %x
\n
"
,
port_base
));
tpnt
->
present
=
1
;
tpnt
->
proc_name
=
"NCR53c406a"
;
shpnt
=
scsi_register
(
tpnt
,
0
);
if
(
!
shpnt
)
{
printk
(
"NCR53c406a: Unable to register host, giving up.
\n
"
);
goto
err_release
;
}
if
(
irq_level
>
0
)
{
if
(
irq_level
>
0
)
{
if
(
request_irq
(
irq_level
,
do_NCR53c406a_intr
,
0
,
"NCR53c406a"
,
shpnt
)){
if
(
request_irq
(
irq_level
,
do_NCR53c406a_intr
,
0
,
"NCR53c406a"
,
shpnt
)){
printk
(
"NCR53c406a: unable to allocate IRQ %d
\n
"
,
irq_level
);
printk
(
"NCR53c406a: unable to allocate IRQ %d
\n
"
,
irq_level
);
goto
err_
release
;
goto
err_
free_scsi
;
}
}
tpnt
->
can_queue
=
1
;
tpnt
->
can_queue
=
1
;
DEB
(
printk
(
"NCR53c406a: allocated IRQ %d
\n
"
,
irq_level
));
DEB
(
printk
(
"NCR53c406a: allocated IRQ %d
\n
"
,
irq_level
));
...
@@ -549,32 +558,24 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
...
@@ -549,32 +558,24 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
DEB
(
printk
(
"NCR53c406a: No interrupts detected
\n
"
));
DEB
(
printk
(
"NCR53c406a: No interrupts detected
\n
"
));
#if USE_DMA
#if USE_DMA
printk
(
"NCR53c406a: No interrupts found and DMA mode defined. Giving up.
\n
"
);
printk
(
"NCR53c406a: No interrupts found and DMA mode defined. Giving up.
\n
"
);
goto
err_
release
;
goto
err_
free_scsi
;
#endif
/* USE_DMA */
#endif
/* USE_DMA */
}
}
else
{
else
{
DEB
(
printk
(
"NCR53c406a: Shouldn't get here!
\n
"
));
DEB
(
printk
(
"NCR53c406a: Shouldn't get here!
\n
"
));
goto
err_free_
irq
;
goto
err_free_
scsi
;
}
}
#if USE_DMA
#if USE_DMA
dma_chan
=
DMA_CHAN
;
dma_chan
=
DMA_CHAN
;
if
(
request_dma
(
dma_chan
,
"NCR53c406a"
)
!=
0
){
if
(
request_dma
(
dma_chan
,
"NCR53c406a"
)
!=
0
){
printk
(
"NCR53c406a: unable to allocate DMA channel %d
\n
"
,
dma_chan
);
printk
(
"NCR53c406a: unable to allocate DMA channel %d
\n
"
,
dma_chan
);
goto
err_
release
;
goto
err_
free_irq
;
}
}
DEB
(
printk
(
"Allocated DMA channel %d
\n
"
,
dma_chan
));
DEB
(
printk
(
"Allocated DMA channel %d
\n
"
,
dma_chan
));
#endif
/* USE_DMA */
#endif
/* USE_DMA */
tpnt
->
present
=
1
;
tpnt
->
proc_name
=
"NCR53c406a"
;
shpnt
=
scsi_register
(
tpnt
,
0
);
if
(
!
shpnt
)
{
printk
(
"NCR53c406a: Unable to register host, giving up.
\n
"
);
goto
err_free_dma
;
}
shpnt
->
irq
=
irq_level
;
shpnt
->
irq
=
irq_level
;
shpnt
->
io_port
=
port_base
;
shpnt
->
io_port
=
port_base
;
shpnt
->
n_io_port
=
0x10
;
shpnt
->
n_io_port
=
0x10
;
...
@@ -592,13 +593,13 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
...
@@ -592,13 +593,13 @@ NCR53c406a_detect(Scsi_Host_Template * tpnt){
return
(
tpnt
->
present
);
return
(
tpnt
->
present
);
err_free_dma:
#if USE_DMA
#if USE_DMA
free_dma
(
dma_chan
);
#endif
err_free_irq:
err_free_irq:
free_irq
(
irq_level
,
do_NCR53c406a_intr
);
if
(
irq_level
)
free_irq
(
irq_level
,
shpnt
);
#endif
err_free_scsi:
scsi_unregister
(
shpnt
);
err_release:
err_release:
release_region
(
port_base
,
0x10
);
release_region
(
port_base
,
0x10
);
return
0
;
return
0
;
...
@@ -896,7 +897,7 @@ NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs){
...
@@ -896,7 +897,7 @@ NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs){
sgcount
=
current_SC
->
use_sg
;
sgcount
=
current_SC
->
use_sg
;
sglist
=
current_SC
->
request_buffer
;
sglist
=
current_SC
->
request_buffer
;
while
(
sgcount
--
)
{
while
(
sgcount
--
)
{
NCR53c406a_pio_write
(
sglist
->
address
,
sglist
->
length
);
NCR53c406a_pio_write
(
page_address
(
sglist
->
page
)
+
sglist
->
offset
,
sglist
->
length
);
sglist
++
;
sglist
++
;
}
}
}
}
...
@@ -925,7 +926,7 @@ NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs){
...
@@ -925,7 +926,7 @@ NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs){
sgcount
=
current_SC
->
use_sg
;
sgcount
=
current_SC
->
use_sg
;
sglist
=
current_SC
->
request_buffer
;
sglist
=
current_SC
->
request_buffer
;
while
(
sgcount
--
)
{
while
(
sgcount
--
)
{
NCR53c406a_pio_read
(
sglist
->
address
,
sglist
->
length
);
NCR53c406a_pio_read
(
page_address
(
sglist
->
page
)
+
sglist
->
offset
,
sglist
->
length
);
sglist
++
;
sglist
++
;
}
}
}
}
...
...
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