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
1b18d4c1
Commit
1b18d4c1
authored
Nov 13, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://gkernel.bkbits.net/libata-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
83fa22d6
54673088
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
141 additions
and
99 deletions
+141
-99
drivers/scsi/Kconfig
drivers/scsi/Kconfig
+7
-7
drivers/scsi/ahci.c
drivers/scsi/ahci.c
+8
-8
drivers/scsi/ata_piix.c
drivers/scsi/ata_piix.c
+9
-7
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+40
-31
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+1
-1
drivers/scsi/libata.h
drivers/scsi/libata.h
+1
-1
drivers/scsi/sata_nv.c
drivers/scsi/sata_nv.c
+8
-5
drivers/scsi/sata_promise.c
drivers/scsi/sata_promise.c
+7
-6
drivers/scsi/sata_sil.c
drivers/scsi/sata_sil.c
+3
-2
drivers/scsi/sata_sis.c
drivers/scsi/sata_sis.c
+6
-3
drivers/scsi/sata_svw.c
drivers/scsi/sata_svw.c
+3
-2
drivers/scsi/sata_sx4.c
drivers/scsi/sata_sx4.c
+7
-6
drivers/scsi/sata_uli.c
drivers/scsi/sata_uli.c
+6
-3
drivers/scsi/sata_via.c
drivers/scsi/sata_via.c
+2
-1
drivers/scsi/sata_vsc.c
drivers/scsi/sata_vsc.c
+3
-2
include/linux/libata.h
include/linux/libata.h
+30
-14
No files found.
drivers/scsi/Kconfig
View file @
1b18d4c1
...
...
@@ -399,7 +399,7 @@ source "drivers/scsi/megaraid/Kconfig.megaraid"
config SCSI_SATA
bool "Serial ATA (SATA) support"
depends on SCSI
&& EXPERIMENTAL
depends on SCSI
help
This driver family supports Serial ATA host controllers
and devices.
...
...
@@ -408,15 +408,15 @@ config SCSI_SATA
config SCSI_SATA_AHCI
tristate "AHCI SATA support"
depends on SCSI_SATA && PCI
&& EXPERIMENTAL
depends on SCSI_SATA && PCI
help
This option enables support for AHCI Serial ATA.
If unsure, say N.
config SCSI_SATA_SVW
tristate "ServerWorks Frodo / Apple K2 SATA support
(EXPERIMENTAL)
"
depends on SCSI_SATA && PCI
&& EXPERIMENTAL
tristate "ServerWorks Frodo / Apple K2 SATA support"
depends on SCSI_SATA && PCI
help
This option enables support for Broadcom/Serverworks/Apple K2
SATA support.
...
...
@@ -467,7 +467,7 @@ config SCSI_SATA_SIL
config SCSI_SATA_SIS
tristate "SiS 964/180 SATA support"
depends on SCSI_SATA && PCI
depends on SCSI_SATA && PCI
&& EXPERIMENTAL
help
This option enables support for SiS Serial ATA 964/180.
...
...
@@ -483,7 +483,7 @@ config SCSI_SATA_ULI
config SCSI_SATA_VIA
tristate "VIA SATA support"
depends on SCSI_SATA && PCI
&& EXPERIMENTAL
depends on SCSI_SATA && PCI
help
This option enables support for VIA Serial ATA.
...
...
@@ -491,7 +491,7 @@ config SCSI_SATA_VIA
config SCSI_SATA_VITESSE
tristate "VITESSE VSC-7174 SATA support"
depends on SCSI_SATA && PCI
&& EXPERIMENTAL
depends on SCSI_SATA && PCI
help
This option enables support for Vitesse VSC7174 Serial ATA.
...
...
drivers/scsi/ahci.c
View file @
1b18d4c1
...
...
@@ -270,7 +270,7 @@ static void ahci_host_stop(struct ata_host_set *host_set)
static
int
ahci_port_start
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
struct
ahci_host_priv
*
hpriv
=
ap
->
host_set
->
private_data
;
struct
ahci_port_priv
*
pp
;
int
rc
;
...
...
@@ -289,7 +289,7 @@ static int ahci_port_start(struct ata_port *ap)
}
memset
(
pp
,
0
,
sizeof
(
*
pp
));
mem
=
pci_alloc_consistent
(
pdev
,
AHCI_PORT_PRIV_DMA_SZ
,
&
mem_dma
);
mem
=
dma_alloc_coherent
(
dev
,
AHCI_PORT_PRIV_DMA_SZ
,
&
mem_dma
,
GFP_KERNEL
);
if
(
!
mem
)
{
rc
=
-
ENOMEM
;
goto
err_out_kfree
;
...
...
@@ -353,7 +353,7 @@ static int ahci_port_start(struct ata_port *ap)
static
void
ahci_port_stop
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
struct
ahci_port_priv
*
pp
=
ap
->
private_data
;
void
*
mmio
=
ap
->
host_set
->
mmio_base
;
void
*
port_mmio
=
ahci_port_base
(
mmio
,
ap
->
port_no
);
...
...
@@ -370,8 +370,8 @@ static void ahci_port_stop(struct ata_port *ap)
msleep
(
500
);
ap
->
private_data
=
NULL
;
pci_free_consistent
(
p
dev
,
AHCI_PORT_PRIV_DMA_SZ
,
pp
->
cmd_slot
,
pp
->
cmd_slot_dma
);
dma_free_coherent
(
dev
,
AHCI_PORT_PRIV_DMA_SZ
,
pp
->
cmd_slot
,
pp
->
cmd_slot_dma
);
kfree
(
pp
);
ata_port_stop
(
ap
);
}
...
...
@@ -703,7 +703,7 @@ static void ahci_setup_port(struct ata_ioports *port, unsigned long base,
static
int
ahci_host_init
(
struct
ata_probe_ent
*
probe_ent
)
{
struct
ahci_host_priv
*
hpriv
=
probe_ent
->
private_data
;
struct
pci_dev
*
pdev
=
probe_ent
->
pdev
;
struct
pci_dev
*
pdev
=
to_pci_dev
(
probe_ent
->
dev
)
;
void
__iomem
*
mmio
=
probe_ent
->
mmio_base
;
u32
tmp
,
cap_save
;
u16
tmp16
;
...
...
@@ -861,7 +861,7 @@ static void pci_enable_intx(struct pci_dev *pdev)
static
void
ahci_print_info
(
struct
ata_probe_ent
*
probe_ent
)
{
struct
ahci_host_priv
*
hpriv
=
probe_ent
->
private_data
;
struct
pci_dev
*
pdev
=
probe_ent
->
pdev
;
struct
pci_dev
*
pdev
=
to_pci_dev
(
probe_ent
->
dev
)
;
void
*
mmio
=
probe_ent
->
mmio_base
;
u32
vers
,
cap
,
impl
,
speed
;
const
char
*
speed_s
;
...
...
@@ -965,7 +965,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
}
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
probe_ent
->
pdev
=
pdev
;
probe_ent
->
dev
=
pci_dev_to_dev
(
pdev
)
;
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
mmio_base
=
ioremap
(
pci_resource_start
(
pdev
,
AHCI_PCI_BAR
),
...
...
drivers/scsi/ata_piix.c
View file @
1b18d4c1
...
...
@@ -32,7 +32,7 @@
#include <linux/libata.h>
#define DRV_NAME "ata_piix"
#define DRV_VERSION "1.0
2
"
#define DRV_VERSION "1.0
3
"
enum
{
PIIX_IOCFG
=
0x54
,
/* IDE I/O configuration register */
...
...
@@ -247,6 +247,7 @@ MODULE_AUTHOR("Andre Hedrick, Alan Cox, Andrzej Krzysztofowicz, Jeff Garzik");
MODULE_DESCRIPTION
(
"SCSI low-level driver for Intel PIIX/ICH ATA controllers"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
piix_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
/**
* piix_pata_cbl_detect - Probe host controller cable detect info
...
...
@@ -260,7 +261,7 @@ MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
*/
static
void
piix_pata_cbl_detect
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
pdev
;
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
)
;
u8
tmp
,
mask
;
/* no 80c support in host controller? */
...
...
@@ -293,8 +294,9 @@ static void piix_pata_cbl_detect(struct ata_port *ap)
static
void
piix_pata_phy_reset
(
struct
ata_port
*
ap
)
{
if
(
!
pci_test_config_bits
(
ap
->
host_set
->
pdev
,
&
piix_enable_bits
[
ap
->
hard_port_no
]))
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
if
(
!
pci_test_config_bits
(
pdev
,
&
piix_enable_bits
[
ap
->
hard_port_no
]))
{
ata_port_disable
(
ap
);
printk
(
KERN_INFO
"ata%u: port disabled. ignoring.
\n
"
,
ap
->
id
);
return
;
...
...
@@ -322,7 +324,7 @@ static void piix_pata_phy_reset(struct ata_port *ap)
*/
static
int
piix_sata_probe
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
pdev
;
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
)
;
int
combined
=
(
ap
->
flags
&
ATA_FLAG_SLAVE_POSS
);
int
orig_mask
,
mask
,
i
;
u8
pcs
;
...
...
@@ -392,7 +394,7 @@ static void piix_sata_phy_reset(struct ata_port *ap)
static
void
piix_set_piomode
(
struct
ata_port
*
ap
,
struct
ata_device
*
adev
)
{
unsigned
int
pio
=
adev
->
pio_mode
-
XFER_PIO_0
;
struct
pci_dev
*
dev
=
ap
->
host_set
->
pdev
;
struct
pci_dev
*
dev
=
to_pci_dev
(
ap
->
host_set
->
dev
)
;
unsigned
int
is_slave
=
(
adev
->
devno
!=
0
);
unsigned
int
master_port
=
ap
->
hard_port_no
?
0x42
:
0x40
;
unsigned
int
slave_port
=
0x44
;
...
...
@@ -444,7 +446,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
static
void
piix_set_dmamode
(
struct
ata_port
*
ap
,
struct
ata_device
*
adev
)
{
unsigned
int
udma
=
adev
->
dma_mode
;
/* FIXME: MWDMA too */
struct
pci_dev
*
dev
=
ap
->
host_set
->
pdev
;
struct
pci_dev
*
dev
=
to_pci_dev
(
ap
->
host_set
->
dev
)
;
u8
maslave
=
ap
->
hard_port_no
?
0x42
:
0x40
;
u8
speed
=
udma
;
unsigned
int
drive_dn
=
(
ap
->
hard_port_no
?
2
:
0
)
+
adev
->
devno
;
...
...
drivers/scsi/libata-core.c
View file @
1b18d4c1
...
...
@@ -67,6 +67,7 @@ static struct workqueue_struct *ata_wq;
MODULE_AUTHOR
(
"Jeff Garzik"
);
MODULE_DESCRIPTION
(
"Library module for ATA devices"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_VERSION
(
DRV_VERSION
);
/**
* ata_tf_load - send taskfile registers to host controller
...
...
@@ -1017,7 +1018,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
BUG_ON
(
qc
==
NULL
);
ata_sg_init_one
(
qc
,
dev
->
id
,
sizeof
(
dev
->
id
));
qc
->
pci_dma_dir
=
PCI_DMA_FROM
DEVICE
;
qc
->
dma_dir
=
DMA_FROM_
DEVICE
;
qc
->
tf
.
protocol
=
ATA_PROT_PIO
;
qc
->
nsect
=
1
;
...
...
@@ -1849,7 +1850,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
{
struct
ata_port
*
ap
=
qc
->
ap
;
struct
scatterlist
*
sg
=
qc
->
sg
;
int
dir
=
qc
->
pci_
dma_dir
;
int
dir
=
qc
->
dma_dir
;
assert
(
qc
->
flags
&
ATA_QCFLAG_DMAMAP
);
assert
(
sg
!=
NULL
);
...
...
@@ -1860,9 +1861,9 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
DPRINTK
(
"unmapping %u sg elements
\n
"
,
qc
->
n_elem
);
if
(
qc
->
flags
&
ATA_QCFLAG_SG
)
pci_unmap_sg
(
ap
->
host_set
->
p
dev
,
sg
,
qc
->
n_elem
,
dir
);
dma_unmap_sg
(
ap
->
host_set
->
dev
,
sg
,
qc
->
n_elem
,
dir
);
else
pci_unmap_single
(
ap
->
host_set
->
p
dev
,
sg_dma_address
(
&
sg
[
0
]),
dma_unmap_single
(
ap
->
host_set
->
dev
,
sg_dma_address
(
&
sg
[
0
]),
sg_dma_len
(
&
sg
[
0
]),
dir
);
qc
->
flags
&=
~
ATA_QCFLAG_DMAMAP
;
...
...
@@ -1973,13 +1974,13 @@ void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
static
int
ata_sg_setup_one
(
struct
ata_queued_cmd
*
qc
)
{
struct
ata_port
*
ap
=
qc
->
ap
;
int
dir
=
qc
->
pci_
dma_dir
;
int
dir
=
qc
->
dma_dir
;
struct
scatterlist
*
sg
=
qc
->
sg
;
dma_addr_t
dma_address
;
dma_address
=
pci_map_single
(
ap
->
host_set
->
p
dev
,
qc
->
buf_virt
,
dma_address
=
dma_map_single
(
ap
->
host_set
->
dev
,
qc
->
buf_virt
,
sg_dma_len
(
sg
),
dir
);
if
(
pci_
dma_mapping_error
(
dma_address
))
if
(
dma_mapping_error
(
dma_address
))
return
-
1
;
sg_dma_address
(
sg
)
=
dma_address
;
...
...
@@ -2010,8 +2011,8 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
VPRINTK
(
"ENTER, ata%u
\n
"
,
ap
->
id
);
assert
(
qc
->
flags
&
ATA_QCFLAG_SG
);
dir
=
qc
->
pci_
dma_dir
;
n_elem
=
pci_map_sg
(
ap
->
host_set
->
p
dev
,
sg
,
qc
->
n_elem
,
dir
);
dir
=
qc
->
dma_dir
;
n_elem
=
dma_map_sg
(
ap
->
host_set
->
dev
,
sg
,
qc
->
n_elem
,
dir
);
if
(
n_elem
<
1
)
return
-
1
;
...
...
@@ -2416,7 +2417,7 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
memset
(
cmd
->
sense_buffer
,
0
,
sizeof
(
cmd
->
sense_buffer
));
ata_sg_init_one
(
qc
,
cmd
->
sense_buffer
,
sizeof
(
cmd
->
sense_buffer
));
qc
->
pci_dma_dir
=
PCI_DMA_FROM
DEVICE
;
qc
->
dma_dir
=
DMA_FROM_
DEVICE
;
memset
(
&
qc
->
cdb
,
0
,
sizeof
(
ap
->
cdb_len
));
qc
->
cdb
[
0
]
=
REQUEST_SENSE
;
...
...
@@ -3104,9 +3105,9 @@ static void atapi_packet_task(void *_data)
int
ata_port_start
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
ap
->
prd
=
pci_alloc_consistent
(
pdev
,
ATA_PRD_TBL_SZ
,
&
ap
->
prd_dma
);
ap
->
prd
=
dma_alloc_coherent
(
dev
,
ATA_PRD_TBL_SZ
,
&
ap
->
prd_dma
,
GFP_KERNEL
);
if
(
!
ap
->
prd
)
return
-
ENOMEM
;
...
...
@@ -3117,9 +3118,9 @@ int ata_port_start (struct ata_port *ap)
void
ata_port_stop
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
pci_free_consistent
(
p
dev
,
ATA_PRD_TBL_SZ
,
ap
->
prd
,
ap
->
prd_dma
);
dma_free_coherent
(
dev
,
ATA_PRD_TBL_SZ
,
ap
->
prd
,
ap
->
prd_dma
);
}
/**
...
...
@@ -3165,7 +3166,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
host
->
max_channel
=
1
;
host
->
unique_id
=
ata_unique_id
++
;
host
->
max_cmd_len
=
12
;
scsi_set_device
(
host
,
&
ent
->
pdev
->
dev
);
scsi_set_device
(
host
,
ent
->
dev
);
scsi_assign_lock
(
host
,
&
host_set
->
lock
);
ap
->
flags
=
ATA_FLAG_PORT_DISABLED
;
...
...
@@ -3252,7 +3253,7 @@ static struct ata_port * ata_host_add(struct ata_probe_ent *ent,
int
ata_device_add
(
struct
ata_probe_ent
*
ent
)
{
unsigned
int
count
=
0
,
i
;
struct
pci_dev
*
pdev
=
ent
->
p
dev
;
struct
device
*
dev
=
ent
->
dev
;
struct
ata_host_set
*
host_set
;
DPRINTK
(
"ENTER
\n
"
);
...
...
@@ -3264,7 +3265,7 @@ int ata_device_add(struct ata_probe_ent *ent)
memset
(
host_set
,
0
,
sizeof
(
struct
ata_host_set
)
+
(
ent
->
n_ports
*
sizeof
(
void
*
)));
spin_lock_init
(
&
host_set
->
lock
);
host_set
->
pdev
=
p
dev
;
host_set
->
dev
=
dev
;
host_set
->
n_ports
=
ent
->
n_ports
;
host_set
->
irq
=
ent
->
irq
;
host_set
->
mmio_base
=
ent
->
mmio_base
;
...
...
@@ -3332,7 +3333,7 @@ int ata_device_add(struct ata_probe_ent *ent)
*/
}
rc
=
scsi_add_host
(
ap
->
host
,
&
pdev
->
dev
);
rc
=
scsi_add_host
(
ap
->
host
,
dev
);
if
(
rc
)
{
printk
(
KERN_ERR
"ata%u: scsi_add_host failed
\n
"
,
ap
->
id
);
...
...
@@ -3352,7 +3353,7 @@ int ata_device_add(struct ata_probe_ent *ent)
scsi_scan_host
(
ap
->
host
);
}
pci_set_drvdata
(
p
dev
,
host_set
);
dev_set_drvdata
(
dev
,
host_set
);
VPRINTK
(
"EXIT, returning %u
\n
"
,
ent
->
n_ports
);
return
ent
->
n_ports
;
/* success */
...
...
@@ -3413,7 +3414,7 @@ void ata_std_ports(struct ata_ioports *ioaddr)
}
static
struct
ata_probe_ent
*
ata_probe_ent_alloc
(
int
n
,
struct
pci_dev
*
p
dev
,
struct
ata_port_info
**
port
)
ata_probe_ent_alloc
(
int
n
,
struct
device
*
dev
,
struct
ata_port_info
**
port
)
{
struct
ata_probe_ent
*
probe_ent
;
int
i
;
...
...
@@ -3421,7 +3422,7 @@ ata_probe_ent_alloc(int n, struct pci_dev *pdev, struct ata_port_info **port)
probe_ent
=
kmalloc
(
sizeof
(
*
probe_ent
)
*
n
,
GFP_KERNEL
);
if
(
!
probe_ent
)
{
printk
(
KERN_ERR
DRV_NAME
"(%s): out of memory
\n
"
,
pci_name
(
pdev
));
kobject_name
(
&
(
dev
->
kobj
)
));
return
NULL
;
}
...
...
@@ -3429,7 +3430,7 @@ ata_probe_ent_alloc(int n, struct pci_dev *pdev, struct ata_port_info **port)
for
(
i
=
0
;
i
<
n
;
i
++
)
{
INIT_LIST_HEAD
(
&
probe_ent
[
i
].
node
);
probe_ent
[
i
].
pdev
=
p
dev
;
probe_ent
[
i
].
dev
=
dev
;
probe_ent
[
i
].
sht
=
port
[
i
]
->
sht
;
probe_ent
[
i
].
host_flags
=
port
[
i
]
->
host_flags
;
...
...
@@ -3443,10 +3444,12 @@ ata_probe_ent_alloc(int n, struct pci_dev *pdev, struct ata_port_info **port)
return
probe_ent
;
}
#ifdef CONFIG_PCI
struct
ata_probe_ent
*
ata_pci_init_native_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
)
{
struct
ata_probe_ent
*
probe_ent
=
ata_probe_ent_alloc
(
1
,
pdev
,
port
);
struct
ata_probe_ent
*
probe_ent
=
ata_probe_ent_alloc
(
1
,
pci_dev_to_dev
(
pdev
),
port
);
if
(
!
probe_ent
)
return
NULL
;
...
...
@@ -3475,7 +3478,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
struct
ata_probe_ent
*
ata_pci_init_legacy_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
)
{
struct
ata_probe_ent
*
probe_ent
=
ata_probe_ent_alloc
(
2
,
pdev
,
port
);
struct
ata_probe_ent
*
probe_ent
=
ata_probe_ent_alloc
(
2
,
pci_dev_to_dev
(
pdev
),
port
);
if
(
!
probe_ent
)
return
NULL
;
...
...
@@ -3651,7 +3655,8 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
void
ata_pci_remove_one
(
struct
pci_dev
*
pdev
)
{
struct
ata_host_set
*
host_set
=
pci_get_drvdata
(
pdev
);
struct
device
*
dev
=
pci_dev_to_dev
(
pdev
);
struct
ata_host_set
*
host_set
=
dev_get_drvdata
(
dev
);
struct
ata_port
*
ap
;
unsigned
int
i
;
...
...
@@ -3692,7 +3697,7 @@ void ata_pci_remove_one (struct pci_dev *pdev)
kfree
(
host_set
);
pci_disable_device
(
pdev
);
pci_set_drvdata
(
p
dev
,
NULL
);
dev_set_drvdata
(
dev
,
NULL
);
}
/* move to PCI subsystem */
...
...
@@ -3728,6 +3733,7 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
return
(
tmp
==
bits
->
val
)
?
1
:
0
;
}
#endif
/* CONFIG_PCI */
/**
...
...
@@ -3764,7 +3770,6 @@ module_exit(ata_exit);
* Do not depend on ABI/API stability.
*/
EXPORT_SYMBOL_GPL
(
pci_test_config_bits
);
EXPORT_SYMBOL_GPL
(
ata_std_bios_param
);
EXPORT_SYMBOL_GPL
(
ata_std_ports
);
EXPORT_SYMBOL_GPL
(
ata_device_add
);
...
...
@@ -3779,8 +3784,6 @@ EXPORT_SYMBOL_GPL(ata_noop_dev_select);
EXPORT_SYMBOL_GPL
(
ata_std_dev_select
);
EXPORT_SYMBOL_GPL
(
ata_tf_to_fis
);
EXPORT_SYMBOL_GPL
(
ata_tf_from_fis
);
EXPORT_SYMBOL_GPL
(
ata_pci_init_legacy_mode
);
EXPORT_SYMBOL_GPL
(
ata_pci_init_native_mode
);
EXPORT_SYMBOL_GPL
(
ata_check_status
);
EXPORT_SYMBOL_GPL
(
ata_exec_command
);
EXPORT_SYMBOL_GPL
(
ata_port_start
);
...
...
@@ -3795,8 +3798,6 @@ EXPORT_SYMBOL_GPL(sata_phy_reset);
EXPORT_SYMBOL_GPL
(
__sata_phy_reset
);
EXPORT_SYMBOL_GPL
(
ata_bus_reset
);
EXPORT_SYMBOL_GPL
(
ata_port_disable
);
EXPORT_SYMBOL_GPL
(
ata_pci_init_one
);
EXPORT_SYMBOL_GPL
(
ata_pci_remove_one
);
EXPORT_SYMBOL_GPL
(
ata_scsi_ioctl
);
EXPORT_SYMBOL_GPL
(
ata_scsi_queuecmd
);
EXPORT_SYMBOL_GPL
(
ata_scsi_error
);
...
...
@@ -3806,3 +3807,11 @@ EXPORT_SYMBOL_GPL(ata_host_intr);
EXPORT_SYMBOL_GPL
(
ata_dev_classify
);
EXPORT_SYMBOL_GPL
(
ata_dev_id_string
);
EXPORT_SYMBOL_GPL
(
ata_scsi_simulate
);
#ifdef CONFIG_PCI
EXPORT_SYMBOL_GPL
(
pci_test_config_bits
);
EXPORT_SYMBOL_GPL
(
ata_pci_init_legacy_mode
);
EXPORT_SYMBOL_GPL
(
ata_pci_init_native_mode
);
EXPORT_SYMBOL_GPL
(
ata_pci_init_one
);
EXPORT_SYMBOL_GPL
(
ata_pci_remove_one
);
#endif
/* CONFIG_PCI */
drivers/scsi/libata-scsi.c
View file @
1b18d4c1
...
...
@@ -678,7 +678,7 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
ata_sg_init_one
(
qc
,
cmd
->
request_buffer
,
cmd
->
request_bufflen
);
qc
->
pci_dma_dir
=
scsi_to_pci_dma_dir
(
cmd
->
sc_data_direction
)
;
qc
->
dma_dir
=
cmd
->
sc_data_direction
;
}
qc
->
complete_fn
=
ata_scsi_qc_complete
;
...
...
drivers/scsi/libata.h
View file @
1b18d4c1
...
...
@@ -26,7 +26,7 @@
#define __LIBATA_H__
#define DRV_NAME "libata"
#define DRV_VERSION "1.
02
"
/* must be exactly four chars */
#define DRV_VERSION "1.
10
"
/* must be exactly four chars */
struct
ata_scsi_args
{
u16
*
id
;
...
...
drivers/scsi/sata_nv.c
View file @
1b18d4c1
...
...
@@ -44,7 +44,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_nv"
#define DRV_VERSION "0.
03
"
#define DRV_VERSION "0.
5
"
#define NV_PORTS 2
#define NV_PIO_MASK 0x1f
...
...
@@ -234,6 +234,7 @@ MODULE_AUTHOR("NVIDIA");
MODULE_DESCRIPTION
(
"low-level driver for NVIDIA nForce SATA controller"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
nv_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
irqreturn_t
nv_interrupt
(
int
irq
,
void
*
dev_instance
,
struct
pt_regs
*
regs
)
{
...
...
@@ -454,12 +455,13 @@ static void nv_check_hotplug(struct ata_host_set *host_set)
static
void
nv_enable_hotplug_ck804
(
struct
ata_probe_ent
*
probe_ent
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
probe_ent
->
dev
);
u8
intr_mask
;
u8
regval
;
pci_read_config_byte
(
p
robe_ent
->
p
dev
,
NV_MCP_SATA_CFG_20
,
&
regval
);
pci_read_config_byte
(
pdev
,
NV_MCP_SATA_CFG_20
,
&
regval
);
regval
|=
NV_MCP_SATA_CFG_20_SATA_SPACE_EN
;
pci_write_config_byte
(
p
robe_ent
->
p
dev
,
NV_MCP_SATA_CFG_20
,
regval
);
pci_write_config_byte
(
pdev
,
NV_MCP_SATA_CFG_20
,
regval
);
writeb
(
NV_INT_STATUS_HOTPLUG
,
probe_ent
->
mmio_base
+
NV_INT_STATUS_CK804
);
...
...
@@ -471,6 +473,7 @@ static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent)
static
void
nv_disable_hotplug_ck804
(
struct
ata_host_set
*
host_set
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
host_set
->
dev
);
u8
intr_mask
;
u8
regval
;
...
...
@@ -480,9 +483,9 @@ static void nv_disable_hotplug_ck804(struct ata_host_set *host_set)
writeb
(
intr_mask
,
host_set
->
mmio_base
+
NV_INT_ENABLE_CK804
);
pci_read_config_byte
(
host_set
->
pdev
,
NV_MCP_SATA_CFG_20
,
&
regval
);
pci_read_config_byte
(
pdev
,
NV_MCP_SATA_CFG_20
,
&
regval
);
regval
&=
~
NV_MCP_SATA_CFG_20_SATA_SPACE_EN
;
pci_write_config_byte
(
host_set
->
pdev
,
NV_MCP_SATA_CFG_20
,
regval
);
pci_write_config_byte
(
pdev
,
NV_MCP_SATA_CFG_20
,
regval
);
}
static
void
nv_check_hotplug_ck804
(
struct
ata_host_set
*
host_set
)
...
...
drivers/scsi/sata_promise.c
View file @
1b18d4c1
...
...
@@ -40,7 +40,7 @@
#include "sata_promise.h"
#define DRV_NAME "sata_promise"
#define DRV_VERSION "1.0
0
"
#define DRV_VERSION "1.0
1
"
enum
{
...
...
@@ -174,7 +174,7 @@ static struct pci_driver pdc_ata_pci_driver = {
static
int
pdc_port_start
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
struct
pdc_port_priv
*
pp
;
int
rc
;
...
...
@@ -189,7 +189,7 @@ static int pdc_port_start(struct ata_port *ap)
}
memset
(
pp
,
0
,
sizeof
(
*
pp
));
pp
->
pkt
=
pci_alloc_consistent
(
pdev
,
128
,
&
pp
->
pkt_dma
);
pp
->
pkt
=
dma_alloc_coherent
(
dev
,
128
,
&
pp
->
pkt_dma
,
GFP_KERNEL
);
if
(
!
pp
->
pkt
)
{
rc
=
-
ENOMEM
;
goto
err_out_kfree
;
...
...
@@ -209,11 +209,11 @@ static int pdc_port_start(struct ata_port *ap)
static
void
pdc_port_stop
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
struct
pdc_port_priv
*
pp
=
ap
->
private_data
;
ap
->
private_data
=
NULL
;
pci_free_consistent
(
p
dev
,
128
,
pp
->
pkt
,
pp
->
pkt_dma
);
dma_free_coherent
(
dev
,
128
,
pp
->
pkt
,
pp
->
pkt_dma
);
kfree
(
pp
);
ata_port_stop
(
ap
);
}
...
...
@@ -577,7 +577,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
}
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
probe_ent
->
pdev
=
pdev
;
probe_ent
->
dev
=
pci_dev_to_dev
(
pdev
)
;
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
mmio_base
=
ioremap
(
pci_resource_start
(
pdev
,
3
),
...
...
@@ -661,6 +661,7 @@ MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION
(
"Promise SATA TX2/TX4 low-level driver"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
pdc_ata_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
module_init
(
pdc_ata_init
);
module_exit
(
pdc_ata_exit
);
drivers/scsi/sata_sil.c
View file @
1b18d4c1
...
...
@@ -38,7 +38,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_sil"
#define DRV_VERSION "0.
54
"
#define DRV_VERSION "0.
8
"
enum
{
sil_3112
=
0
,
...
...
@@ -190,6 +190,7 @@ MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION
(
"low-level driver for Silicon Image SATA controller"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
sil_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
static
void
sil_post_set_mode
(
struct
ata_port
*
ap
)
{
...
...
@@ -363,7 +364,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
probe_ent
->
pdev
=
pdev
;
probe_ent
->
dev
=
pci_dev_to_dev
(
pdev
)
;
probe_ent
->
port_ops
=
sil_port_info
[
ent
->
driver_data
].
port_ops
;
probe_ent
->
sht
=
sil_port_info
[
ent
->
driver_data
].
sht
;
probe_ent
->
n_ports
=
(
ent
->
driver_data
==
sil_3114
)
?
4
:
2
;
...
...
drivers/scsi/sata_sis.c
View file @
1b18d4c1
...
...
@@ -38,7 +38,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_sis"
#define DRV_VERSION "0.
10
"
#define DRV_VERSION "0.
5
"
enum
{
sis_180
=
0
,
...
...
@@ -128,6 +128,7 @@ MODULE_AUTHOR("Uwe Koziolek");
MODULE_DESCRIPTION
(
"low-level driver for Silicon Integratad Systems SATA controller"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
sis_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
static
unsigned
int
get_scr_cfg_addr
(
unsigned
int
port_no
,
unsigned
int
sc_reg
)
{
...
...
@@ -140,22 +141,24 @@ static unsigned int get_scr_cfg_addr(unsigned int port_no, unsigned int sc_reg)
static
u32
sis_scr_cfg_read
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
unsigned
int
cfg_addr
=
get_scr_cfg_addr
(
ap
->
port_no
,
sc_reg
);
u32
val
;
if
(
sc_reg
==
SCR_ERROR
)
/* doesn't exist in PCI cfg space */
return
0xffffffff
;
pci_read_config_dword
(
ap
->
host_set
->
pdev
,
cfg_addr
,
&
val
);
pci_read_config_dword
(
pdev
,
cfg_addr
,
&
val
);
return
val
;
}
static
void
sis_scr_cfg_write
(
struct
ata_port
*
ap
,
unsigned
int
scr
,
u32
val
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
unsigned
int
cfg_addr
=
get_scr_cfg_addr
(
ap
->
port_no
,
scr
);
if
(
scr
==
SCR_ERROR
)
/* doesn't exist in PCI cfg space */
return
;
pci_write_config_dword
(
ap
->
host_set
->
pdev
,
cfg_addr
,
val
);
pci_write_config_dword
(
pdev
,
cfg_addr
,
val
);
}
static
u32
sis_scr_read
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
)
...
...
drivers/scsi/sata_svw.c
View file @
1b18d4c1
...
...
@@ -49,7 +49,7 @@
#endif
/* CONFIG_PPC_OF */
#define DRV_NAME "sata_svw"
#define DRV_VERSION "1.0
4
"
#define DRV_VERSION "1.0
5
"
/* Taskfile registers offsets */
#define K2_SATA_TF_CMD_OFFSET 0x00
...
...
@@ -376,7 +376,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
}
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
probe_ent
->
pdev
=
pdev
;
probe_ent
->
dev
=
pci_dev_to_dev
(
pdev
)
;
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
mmio_base
=
ioremap
(
pci_resource_start
(
pdev
,
5
),
...
...
@@ -470,6 +470,7 @@ MODULE_AUTHOR("Benjamin Herrenschmidt");
MODULE_DESCRIPTION
(
"low-level driver for K2 SATA controller"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
k2_sata_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
module_init
(
k2_sata_init
);
module_exit
(
k2_sata_exit
);
drivers/scsi/sata_sx4.c
View file @
1b18d4c1
...
...
@@ -40,7 +40,7 @@
#include "sata_promise.h"
#define DRV_NAME "sata_sx4"
#define DRV_VERSION "0.
50
"
#define DRV_VERSION "0.
7
"
enum
{
...
...
@@ -248,7 +248,7 @@ static void pdc20621_host_stop(struct ata_host_set *host_set)
static
int
pdc_port_start
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
struct
pdc_port_priv
*
pp
;
int
rc
;
...
...
@@ -263,7 +263,7 @@ static int pdc_port_start(struct ata_port *ap)
}
memset
(
pp
,
0
,
sizeof
(
*
pp
));
pp
->
pkt
=
pci_alloc_consistent
(
pdev
,
128
,
&
pp
->
pkt_dma
);
pp
->
pkt
=
dma_alloc_coherent
(
dev
,
128
,
&
pp
->
pkt_dma
,
GFP_KERNEL
);
if
(
!
pp
->
pkt
)
{
rc
=
-
ENOMEM
;
goto
err_out_kfree
;
...
...
@@ -283,11 +283,11 @@ static int pdc_port_start(struct ata_port *ap)
static
void
pdc_port_stop
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
ap
->
host_set
->
p
dev
;
struct
device
*
dev
=
ap
->
host_set
->
dev
;
struct
pdc_port_priv
*
pp
=
ap
->
private_data
;
ap
->
private_data
=
NULL
;
pci_free_consistent
(
p
dev
,
128
,
pp
->
pkt
,
pp
->
pkt_dma
);
dma_free_coherent
(
dev
,
128
,
pp
->
pkt
,
pp
->
pkt_dma
);
kfree
(
pp
);
ata_port_stop
(
ap
);
}
...
...
@@ -1397,7 +1397,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
}
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
probe_ent
->
pdev
=
pdev
;
probe_ent
->
dev
=
pci_dev_to_dev
(
pdev
)
;
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
mmio_base
=
ioremap
(
pci_resource_start
(
pdev
,
3
),
...
...
@@ -1492,6 +1492,7 @@ MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION
(
"Promise SATA low-level driver"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
pdc_sata_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
module_init
(
pdc_sata_init
);
module_exit
(
pdc_sata_exit
);
drivers/scsi/sata_uli.c
View file @
1b18d4c1
...
...
@@ -32,7 +32,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_uli"
#define DRV_VERSION "0.
11
"
#define DRV_VERSION "0.
2
"
enum
{
uli_5289
=
0
,
...
...
@@ -123,6 +123,7 @@ MODULE_AUTHOR("Peer Chen");
MODULE_DESCRIPTION
(
"low-level driver for ULi Electronics SATA controller"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
uli_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
static
unsigned
int
get_scr_cfg_addr
(
unsigned
int
port_no
,
unsigned
int
sc_reg
)
{
...
...
@@ -149,18 +150,20 @@ static unsigned int get_scr_cfg_addr(unsigned int port_no, unsigned int sc_reg)
static
u32
uli_scr_cfg_read
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
unsigned
int
cfg_addr
=
get_scr_cfg_addr
(
ap
->
port_no
,
sc_reg
);
u32
val
;
pci_read_config_dword
(
ap
->
host_set
->
pdev
,
cfg_addr
,
&
val
);
pci_read_config_dword
(
pdev
,
cfg_addr
,
&
val
);
return
val
;
}
static
void
uli_scr_cfg_write
(
struct
ata_port
*
ap
,
unsigned
int
scr
,
u32
val
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
unsigned
int
cfg_addr
=
get_scr_cfg_addr
(
ap
->
port_no
,
scr
);
pci_write_config_dword
(
ap
->
host_set
->
pdev
,
cfg_addr
,
val
);
pci_write_config_dword
(
pdev
,
cfg_addr
,
val
);
}
static
u32
uli_scr_read
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
)
...
...
drivers/scsi/sata_via.c
View file @
1b18d4c1
...
...
@@ -38,7 +38,7 @@
#include <asm/io.h>
#define DRV_NAME "sata_via"
#define DRV_VERSION "
0.2
0"
#define DRV_VERSION "
1.
0"
enum
{
via_sata
=
0
,
...
...
@@ -138,6 +138,7 @@ MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION
(
"SCSI low-level driver for VIA SATA controllers"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
svia_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
static
u32
svia_scr_read
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
)
{
...
...
drivers/scsi/sata_vsc.c
View file @
1b18d4c1
...
...
@@ -26,7 +26,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_vsc"
#define DRV_VERSION "
0.01
"
#define DRV_VERSION "
1.0
"
/* Interrupt register offsets (from chip base address) */
#define VSC_SATA_INT_STAT_OFFSET 0x00
...
...
@@ -293,7 +293,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
goto
err_out_regions
;
}
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
probe_ent
->
pdev
=
pdev
;
probe_ent
->
dev
=
pci_dev_to_dev
(
pdev
)
;
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
mmio_base
=
ioremap
(
pci_resource_start
(
pdev
,
0
),
...
...
@@ -393,6 +393,7 @@ MODULE_AUTHOR("Jeremy Higdon");
MODULE_DESCRIPTION
(
"low-level driver for Vitesse VSC7174 SATA controller"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DEVICE_TABLE
(
pci
,
vsc_sata_pci_tbl
);
MODULE_VERSION
(
DRV_VERSION
);
module_init
(
vsc_sata_init
);
module_exit
(
vsc_sata_exit
);
include/linux/libata.h
View file @
1b18d4c1
...
...
@@ -25,6 +25,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <asm/io.h>
#include <linux/ata.h>
#include <linux/workqueue.h>
...
...
@@ -68,6 +69,12 @@
/* defines only for the constants which don't work well as enums */
#define ATA_TAG_POISON 0xfafbfcfdU
/* move to PCI layer? */
static
inline
struct
device
*
pci_dev_to_dev
(
struct
pci_dev
*
pdev
)
{
return
&
pdev
->
dev
;
}
enum
{
/* various global constants */
LIBATA_MAX_PRD
=
ATA_MAX_PRD
/
2
,
...
...
@@ -184,7 +191,7 @@ struct ata_ioports {
struct
ata_probe_ent
{
struct
list_head
node
;
struct
pci_dev
*
p
dev
;
struct
device
*
dev
;
struct
ata_port_operations
*
port_ops
;
Scsi_Host_Template
*
sht
;
struct
ata_ioports
port
[
ATA_MAX_PORTS
];
...
...
@@ -203,7 +210,7 @@ struct ata_probe_ent {
struct
ata_host_set
{
spinlock_t
lock
;
struct
pci_dev
*
p
dev
;
struct
device
*
dev
;
unsigned
long
irq
;
void
__iomem
*
mmio_base
;
unsigned
int
n_ports
;
...
...
@@ -226,7 +233,7 @@ struct ata_queued_cmd {
unsigned
int
tag
;
unsigned
int
n_elem
;
int
pci_
dma_dir
;
int
dma_dir
;
unsigned
int
nsect
;
unsigned
int
cursect
;
...
...
@@ -361,12 +368,6 @@ struct ata_port_info {
struct
ata_port_operations
*
port_ops
;
};
struct
pci_bits
{
unsigned
int
reg
;
/* PCI config register to read */
unsigned
int
width
;
/* 1 (8 bit), 2 (16 bit), 4 (32 bit) */
unsigned
long
mask
;
unsigned
long
val
;
};
extern
void
ata_port_probe
(
struct
ata_port
*
);
extern
void
__sata_phy_reset
(
struct
ata_port
*
ap
);
...
...
@@ -374,9 +375,11 @@ extern void sata_phy_reset(struct ata_port *ap);
extern
void
ata_bus_reset
(
struct
ata_port
*
ap
);
extern
void
ata_port_disable
(
struct
ata_port
*
);
extern
void
ata_std_ports
(
struct
ata_ioports
*
ioaddr
);
#ifdef CONFIG_PCI
extern
int
ata_pci_init_one
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port_info
,
unsigned
int
n_ports
);
extern
void
ata_pci_remove_one
(
struct
pci_dev
*
pdev
);
#endif
/* CONFIG_PCI */
extern
int
ata_device_add
(
struct
ata_probe_ent
*
ent
);
extern
int
ata_scsi_detect
(
Scsi_Host_Template
*
sht
);
extern
int
ata_scsi_ioctl
(
struct
scsi_device
*
dev
,
int
cmd
,
void
__user
*
arg
);
...
...
@@ -398,10 +401,6 @@ extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf);
extern
int
ata_port_start
(
struct
ata_port
*
ap
);
extern
void
ata_port_stop
(
struct
ata_port
*
ap
);
extern
irqreturn_t
ata_interrupt
(
int
irq
,
void
*
dev_instance
,
struct
pt_regs
*
regs
);
extern
struct
ata_probe_ent
*
ata_pci_init_native_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
);
extern
struct
ata_probe_ent
*
ata_pci_init_legacy_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
);
extern
void
ata_qc_prep
(
struct
ata_queued_cmd
*
qc
);
extern
int
ata_qc_issue_prot
(
struct
ata_queued_cmd
*
qc
);
extern
void
ata_sg_init_one
(
struct
ata_queued_cmd
*
qc
,
void
*
buf
,
...
...
@@ -414,7 +413,6 @@ extern void ata_dev_id_string(u16 *id, unsigned char *s,
extern
void
ata_bmdma_setup
(
struct
ata_queued_cmd
*
qc
);
extern
void
ata_bmdma_start
(
struct
ata_queued_cmd
*
qc
);
extern
void
ata_bmdma_irq_clear
(
struct
ata_port
*
ap
);
extern
int
pci_test_config_bits
(
struct
pci_dev
*
pdev
,
struct
pci_bits
*
bits
);
extern
void
ata_qc_complete
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
extern
void
ata_eng_timeout
(
struct
ata_port
*
ap
);
extern
void
ata_scsi_simulate
(
u16
*
id
,
struct
scsi_cmnd
*
cmd
,
...
...
@@ -424,6 +422,24 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
sector_t
capacity
,
int
geom
[]);
extern
int
ata_scsi_slave_config
(
struct
scsi_device
*
sdev
);
#ifdef CONFIG_PCI
struct
pci_bits
{
unsigned
int
reg
;
/* PCI config register to read */
unsigned
int
width
;
/* 1 (8 bit), 2 (16 bit), 4 (32 bit) */
unsigned
long
mask
;
unsigned
long
val
;
};
extern
struct
ata_probe_ent
*
ata_pci_init_native_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
);
extern
struct
ata_probe_ent
*
ata_pci_init_legacy_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
);
extern
int
pci_test_config_bits
(
struct
pci_dev
*
pdev
,
struct
pci_bits
*
bits
);
#endif
/* CONFIG_PCI */
static
inline
unsigned
int
ata_tag_valid
(
unsigned
int
tag
)
{
return
(
tag
<
ATA_MAX_QUEUE
)
?
1
:
0
;
...
...
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