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
7097014c
Commit
7097014c
authored
Mar 10, 2004
by
Aristeu Sergio Rozanski Filho
Committed by
James Bottomley
Mar 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] qlogic_cs: use own detect and release functions
parent
2fc6d6a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
10 deletions
+78
-10
drivers/scsi/pcmcia/qlogic_stub.c
drivers/scsi/pcmcia/qlogic_stub.c
+78
-10
No files found.
drivers/scsi/pcmcia/qlogic_stub.c
View file @
7097014c
...
...
@@ -43,9 +43,11 @@
#include <linux/major.h>
#include <linux/blkdev.h>
#include <scsi/scsi_ioctl.h>
#include <linux/interrupt.h>
#include "scsi.h"
#include "hosts.h"
#include "../qlogicfas.h"
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
...
...
@@ -57,8 +59,8 @@
extern
Scsi_Host_Template
qlogicfas_driver_template
;
extern
void
qlogicfas_preset
(
int
port
,
int
irq
);
extern
struct
Scsi_Host
*
__qlogicfas_detect
(
Scsi_Host_Template
*
);
extern
int
qlogicfas_bus_reset
(
Scsi_Cmnd
*
);
extern
irqreturn_t
do_ql_ihandl
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
static
char
*
qlogic_name
=
"qlogic_cs"
;
...
...
@@ -102,6 +104,71 @@ static dev_link_t *dev_list = NULL;
static
dev_info_t
dev_info
=
"qlogic_cs"
;
static
struct
Scsi_Host
*
qlogic_detect
(
Scsi_Host_Template
*
host
,
dev_link_t
*
link
,
int
qbase
,
int
qlirq
)
{
int
qltyp
;
/* type of chip */
int
qinitid
;
struct
Scsi_Host
*
shost
;
/* registered host structure */
qlogicfas_priv_t
priv
;
qltyp
=
inb
(
qbase
+
0xe
)
&
0xf8
;
qinitid
=
host
->
this_id
;
if
(
qinitid
<
0
)
qinitid
=
7
;
/* if no ID, use 7 */
outb
(
1
,
qbase
+
8
);
/* set for PIO pseudo DMA */
REG0
;
outb
(
0x40
|
qlcfg8
|
qinitid
,
qbase
+
8
);
/* (ini) bus id, disable scsi rst */
outb
(
qlcfg5
,
qbase
+
5
);
/* select timer */
outb
(
qlcfg9
,
qbase
+
9
);
/* prescaler */
#if QL_RESET_AT_START
outb
(
3
,
qbase
+
3
);
REG1
;
/* FIXME: timeout */
while
(
inb
(
qbase
+
0xf
)
&
4
)
cpu_relax
();
REG0
;
#endif
host
->
name
=
qlogic_name
;
shost
=
scsi_host_alloc
(
host
,
sizeof
(
struct
qlogicfas_priv
));
if
(
!
shost
)
goto
err
;
shost
->
io_port
=
qbase
;
shost
->
n_io_port
=
16
;
shost
->
dma_channel
=
-
1
;
if
(
qlirq
!=
-
1
)
shost
->
irq
=
qlirq
;
priv
=
(
qlogicfas_priv_t
)
&
(
shost
->
hostdata
[
0
]);
priv
->
qlirq
=
qlirq
;
priv
->
qbase
=
qbase
;
priv
->
qinitid
=
qinitid
;
if
(
request_irq
(
qlirq
,
do_ql_ihandl
,
0
,
qlogic_name
,
shost
))
goto
free_scsi_host
;
sprintf
(
priv
->
qinfo
,
"Qlogicfas Driver version 0.46, chip %02X at %03X, IRQ %d, TPdma:%d"
,
qltyp
,
qbase
,
qlirq
,
QL_TURBO_PDMA
);
if
(
scsi_add_host
(
shost
,
NULL
))
goto
free_interrupt
;
scsi_scan_host
(
shost
);
return
shost
;
free_interrupt:
free_irq
(
qlirq
,
shost
);
free_scsi_host:
scsi_host_put
(
shost
);
err:
return
NULL
;
}
static
dev_link_t
*
qlogic_attach
(
void
)
{
scsi_info_t
*
info
;
...
...
@@ -240,15 +307,17 @@ static void qlogic_config(dev_link_t * link)
outb
(
0x04
,
link
->
io
.
BasePort1
+
0xd
);
}
qlogicfas_driver_template
.
name
=
qlogic_name
;
qlogicfas_driver_template
.
proc_name
=
qlogic_name
;
/* The KXL-810AN has a bigger IO port window */
if
(
link
->
io
.
NumPorts1
==
32
)
qlogicfas_preset
(
link
->
io
.
BasePort1
+
16
,
link
->
irq
.
AssignedIRQ
);
host
=
qlogic_detect
(
&
qlogicfas_driver_template
,
link
,
link
->
io
.
BasePort1
+
16
,
link
->
irq
.
AssignedIRQ
);
else
qlogicfas_preset
(
link
->
io
.
BasePort1
,
link
->
irq
.
AssignedIRQ
);
host
=
qlogic_detect
(
&
qlogicfas_driver_template
,
link
,
link
->
io
.
BasePort1
,
link
->
irq
.
AssignedIRQ
);
qlogicfas_driver_template
.
name
=
qlogic_name
;
qlogicfas_driver_template
.
proc_name
=
qlogic_name
;
host
=
__qlogicfas_detect
(
&
qlogicfas_driver_template
);
if
(
!
host
)
{
printk
(
KERN_INFO
"%s: no SCSI devices found
\n
"
,
qlogic_name
);
goto
out
;
...
...
@@ -258,9 +327,6 @@ static void qlogic_config(dev_link_t * link)
link
->
dev
=
&
info
->
node
;
info
->
host
=
host
;
scsi_add_host
(
host
,
NULL
);
/* XXX handle failure */
scsi_scan_host
(
host
);
out:
link
->
state
&=
~
DEV_CONFIG_PENDING
;
return
;
...
...
@@ -283,6 +349,8 @@ static void qlogic_release(dev_link_t *link)
scsi_remove_host
(
info
->
host
);
link
->
dev
=
NULL
;
free_irq
(
link
->
irq
.
AssignedIRQ
,
info
->
host
);
pcmcia_release_configuration
(
link
->
handle
);
pcmcia_release_io
(
link
->
handle
,
&
link
->
io
);
pcmcia_release_irq
(
link
->
handle
,
&
link
->
irq
);
...
...
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