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
e241138a
Commit
e241138a
authored
Dec 28, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://gkernel.bkbits.net/libata-2.5
into home.osdl.org:/home/torvalds/v2.5/linux
parents
7629bad2
a76a8a35
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
582 additions
and
102 deletions
+582
-102
drivers/scsi/ata_piix.c
drivers/scsi/ata_piix.c
+1
-0
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+17
-19
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+33
-10
drivers/scsi/libata.h
drivers/scsi/libata.h
+7
-7
drivers/scsi/sata_promise.c
drivers/scsi/sata_promise.c
+513
-61
drivers/scsi/sata_sil.c
drivers/scsi/sata_sil.c
+1
-0
drivers/scsi/sata_svw.c
drivers/scsi/sata_svw.c
+1
-0
drivers/scsi/sata_via.c
drivers/scsi/sata_via.c
+1
-0
include/linux/libata.h
include/linux/libata.h
+8
-5
No files found.
drivers/scsi/ata_piix.c
View file @
e241138a
...
...
@@ -97,6 +97,7 @@ static Scsi_Host_Template piix_sht = {
.
proc_name
=
DRV_NAME
,
.
dma_boundary
=
ATA_DMA_BOUNDARY
,
.
slave_configure
=
ata_scsi_slave_config
,
.
bios_param
=
ata_std_bios_param
,
};
static
struct
ata_port_operations
piix_pata_ops
=
{
...
...
drivers/scsi/libata-core.c
View file @
e241138a
...
...
@@ -1619,7 +1619,7 @@ static void ata_dev_set_pio(struct ata_port *ap, unsigned int device)
static
void
ata_sg_clean
(
struct
ata_queued_cmd
*
qc
)
{
struct
ata_port
*
ap
=
qc
->
ap
;
Scsi_C
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_c
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scatterlist
*
sg
=
qc
->
sg
;
int
dir
=
scsi_to_pci_dma_dir
(
cmd
->
sc_data_direction
);
...
...
@@ -1635,8 +1635,8 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
if
(
cmd
->
use_sg
)
pci_unmap_sg
(
ap
->
host_set
->
pdev
,
sg
,
qc
->
n_elem
,
dir
);
else
pci_unmap_single
(
ap
->
host_set
->
pdev
,
sg
[
0
].
dma_address
,
sg
[
0
].
length
,
dir
);
pci_unmap_single
(
ap
->
host_set
->
pdev
,
sg
_dma_address
(
&
sg
[
0
])
,
sg
_dma_len
(
&
sg
[
0
])
,
dir
);
qc
->
flags
&=
~
ATA_QCFLAG_SG
;
qc
->
sg
=
NULL
;
...
...
@@ -1659,8 +1659,8 @@ void ata_fill_sg(struct ata_queued_cmd *qc)
assert
(
qc
->
n_elem
>
0
);
for
(
i
=
0
;
i
<
qc
->
n_elem
;
i
++
)
{
ap
->
prd
[
i
].
addr
=
cpu_to_le32
(
sg
[
i
].
dma_address
);
ap
->
prd
[
i
].
flags_len
=
cpu_to_le32
(
sg
[
i
].
length
);
ap
->
prd
[
i
].
addr
=
cpu_to_le32
(
sg
_dma_address
(
&
sg
[
i
])
);
ap
->
prd
[
i
].
flags_len
=
cpu_to_le32
(
sg
_dma_len
(
&
sg
[
i
])
);
VPRINTK
(
"PRD[%u] = (0x%X, 0x%X)
\n
"
,
i
,
le32_to_cpu
(
ap
->
prd
[
i
].
addr
),
le32_to_cpu
(
ap
->
prd
[
i
].
flags_len
));
}
...
...
@@ -1681,7 +1681,7 @@ void ata_fill_sg(struct ata_queued_cmd *qc)
static
int
ata_sg_setup_one
(
struct
ata_queued_cmd
*
qc
)
{
struct
ata_port
*
ap
=
qc
->
ap
;
Scsi_C
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_c
mnd
*
cmd
=
qc
->
scsicmd
;
int
dir
=
scsi_to_pci_dma_dir
(
cmd
->
sc_data_direction
);
struct
scatterlist
*
sg
=
qc
->
sg
;
unsigned
int
have_sg
=
(
qc
->
flags
&
ATA_QCFLAG_SG
);
...
...
@@ -1691,12 +1691,12 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
sg
->
page
=
virt_to_page
(
cmd
->
request_buffer
);
sg
->
offset
=
(
unsigned
long
)
cmd
->
request_buffer
&
~
PAGE_MASK
;
sg
->
length
=
cmd
->
request_bufflen
;
sg
_dma_len
(
sg
)
=
cmd
->
request_bufflen
;
if
(
!
have_sg
)
return
0
;
sg
->
dma_address
=
pci_map_single
(
ap
->
host_set
->
pdev
,
sg
_dma_address
(
sg
)
=
pci_map_single
(
ap
->
host_set
->
pdev
,
cmd
->
request_buffer
,
cmd
->
request_bufflen
,
dir
);
...
...
@@ -1720,7 +1720,7 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
static
int
ata_sg_setup
(
struct
ata_queued_cmd
*
qc
)
{
struct
ata_port
*
ap
=
qc
->
ap
;
Scsi_C
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_c
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scatterlist
*
sg
;
int
n_elem
;
unsigned
int
have_sg
=
(
qc
->
flags
&
ATA_QCFLAG_SG
);
...
...
@@ -1872,7 +1872,7 @@ static void ata_pio_sector(struct ata_port *ap)
{
struct
ata_queued_cmd
*
qc
;
struct
scatterlist
*
sg
;
Scsi_C
mnd
*
cmd
;
struct
scsi_c
mnd
*
cmd
;
unsigned
char
*
buf
;
u8
status
;
...
...
@@ -1917,7 +1917,7 @@ static void ata_pio_sector(struct ata_port *ap)
qc
->
cursg_ofs
++
;
if
(
cmd
->
use_sg
)
if
((
qc
->
cursg_ofs
*
ATA_SECT_SIZE
)
==
sg
[
qc
->
cursg
].
length
)
{
if
((
qc
->
cursg_ofs
*
ATA_SECT_SIZE
)
==
sg
_dma_len
(
&
sg
[
qc
->
cursg
])
)
{
qc
->
cursg
++
;
qc
->
cursg_ofs
=
0
;
}
...
...
@@ -2092,7 +2092,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
void
ata_qc_complete
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
,
unsigned
int
done_late
)
{
struct
ata_port
*
ap
=
qc
->
ap
;
Scsi_C
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_c
mnd
*
cmd
=
qc
->
scsicmd
;
unsigned
int
tag
,
do_clear
=
0
;
assert
(
qc
!=
NULL
);
/* ata_qc_from_tag _might_ return NULL */
...
...
@@ -2163,7 +2163,7 @@ static void ata_qc_push (struct ata_queued_cmd *qc, unsigned int append)
int
ata_qc_issue
(
struct
ata_queued_cmd
*
qc
)
{
struct
ata_port
*
ap
=
qc
->
ap
;
Scsi_C
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_c
mnd
*
cmd
=
qc
->
scsicmd
;
unsigned
int
dma
=
qc
->
flags
&
ATA_QCFLAG_DMA
;
ata_dev_select
(
ap
,
qc
->
dev
->
devno
,
1
,
0
);
...
...
@@ -2719,7 +2719,7 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
DPRINTK
(
"ENTER
\n
"
);
if
(
do_unregister
)
scsi_remove_host
(
sh
);
/* FIXME: check return val */
scsi_remove_host
(
sh
);
ata_thread_kill
(
ap
);
/* FIXME: check return val */
...
...
@@ -3204,7 +3204,6 @@ void ata_pci_remove_one (struct pci_dev *pdev)
for
(
i
=
0
;
i
<
host_set
->
n_ports
;
i
++
)
{
ap
=
host_set
->
ports
[
i
];
/* FIXME: check return val */
scsi_remove_host
(
ap
->
host
);
}
...
...
@@ -3215,13 +3214,10 @@ void ata_pci_remove_one (struct pci_dev *pdev)
host_set
->
ports
[
0
]
->
ops
->
host_stop
(
host_set
);
for
(
i
=
0
;
i
<
host_set
->
n_ports
;
i
++
)
{
Scsi_Host_Template
*
sht
;
ap
=
host_set
->
ports
[
i
];
sht
=
ap
->
host
->
hostt
;
ata_scsi_release
(
ap
->
host
);
scsi_host_put
(
ap
->
host
);
/* FIXME: check return val */
scsi_host_put
(
ap
->
host
);
}
pci_release_regions
(
pdev
);
...
...
@@ -3279,6 +3275,7 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
return
(
tmp
==
bits
->
val
)
?
1
:
0
;
}
/**
* ata_init -
*
...
...
@@ -3304,6 +3301,7 @@ module_init(ata_init);
*/
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
);
EXPORT_SYMBOL_GPL
(
ata_qc_complete
);
...
...
drivers/scsi/libata-scsi.c
View file @
e241138a
...
...
@@ -32,10 +32,33 @@
#include "libata.h"
/**
* ata_std_bios_param - generic bios head/sector/cylinder calculator
* used by sd. Most BIOSes nowadays expect a XXX/255/16 (CHS)
* mapping. Some situations may arise where the disk is not
* bootable if this is not used.
*
* LOCKING:
*
* RETURNS:
*
*/
int
ata_std_bios_param
(
struct
scsi_device
*
sdev
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
geom
[])
{
geom
[
0
]
=
255
;
geom
[
1
]
=
63
;
geom
[
2
]
=
capacity
/
(
geom
[
0
]
*
geom
[
1
]);
return
0
;
}
struct
ata_queued_cmd
*
ata_scsi_qc_new
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
Scsi_C
mnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
))
struct
scsi_c
mnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
struct
ata_queued_cmd
*
qc
;
...
...
@@ -69,7 +92,7 @@ struct ata_queued_cmd *ata_scsi_qc_new(struct ata_port *ap,
void
ata_to_sense_error
(
struct
ata_queued_cmd
*
qc
)
{
Scsi_C
mnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_c
mnd
*
cmd
=
qc
->
scsicmd
;
cmd
->
result
=
SAM_STAT_CHECK_CONDITION
;
...
...
@@ -282,7 +305,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd,
*/
void
ata_scsi_rw_queue
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
),
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
),
unsigned
int
cmd_size
)
{
struct
ata_queued_cmd
*
qc
;
...
...
@@ -332,7 +355,7 @@ void ata_scsi_rw_queue(struct ata_port *ap, struct ata_device *dev,
* Length of response buffer.
*/
static
unsigned
int
ata_scsi_rbuf_get
(
Scsi_C
mnd
*
cmd
,
u8
**
buf_out
)
static
unsigned
int
ata_scsi_rbuf_get
(
struct
scsi_c
mnd
*
cmd
,
u8
**
buf_out
)
{
u8
*
buf
;
unsigned
int
buflen
;
...
...
@@ -363,7 +386,7 @@ static unsigned int ata_scsi_rbuf_get(Scsi_Cmnd *cmd, u8 **buf_out)
* spin_lock_irqsave(host_set lock)
*/
static
inline
void
ata_scsi_rbuf_put
(
Scsi_C
mnd
*
cmd
)
static
inline
void
ata_scsi_rbuf_put
(
struct
scsi_c
mnd
*
cmd
)
{
if
(
cmd
->
use_sg
)
{
struct
scatterlist
*
sg
;
...
...
@@ -394,7 +417,7 @@ void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
{
u8
*
rbuf
;
unsigned
int
buflen
,
rc
;
Scsi_C
mnd
*
cmd
=
args
->
cmd
;
struct
scsi_c
mnd
*
cmd
=
args
->
cmd
;
buflen
=
ata_scsi_rbuf_get
(
cmd
,
&
rbuf
);
rc
=
actor
(
args
,
rbuf
,
buflen
);
...
...
@@ -817,7 +840,7 @@ unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf,
* spin_lock_irqsave(host_set lock)
*/
void
ata_scsi_badcmd
(
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
),
u8
asc
,
u8
ascq
)
void
ata_scsi_badcmd
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
),
u8
asc
,
u8
ascq
)
{
DPRINTK
(
"ENTER
\n
"
);
cmd
->
result
=
SAM_STAT_CHECK_CONDITION
;
...
...
@@ -847,7 +870,7 @@ void ata_scsi_badcmd(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *), u8 asc, u8 ascq)
*/
static
void
atapi_scsi_queuecmd
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
))
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
struct
ata_queued_cmd
*
qc
;
u8
*
scsicmd
=
cmd
->
cmnd
,
status
;
...
...
@@ -958,7 +981,7 @@ static void atapi_scsi_queuecmd(struct ata_port *ap, struct ata_device *dev,
* Zero.
*/
int
ata_scsi_queuecmd
(
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
))
int
ata_scsi_queuecmd
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
u8
*
scsicmd
=
cmd
->
cmnd
;
struct
ata_port
*
ap
;
...
...
drivers/scsi/libata.h
View file @
e241138a
...
...
@@ -31,8 +31,8 @@
struct
ata_scsi_args
{
struct
ata_port
*
ap
;
struct
ata_device
*
dev
;
Scsi_C
mnd
*
cmd
;
void
(
*
done
)(
Scsi_C
mnd
*
);
struct
scsi_c
mnd
*
cmd
;
void
(
*
done
)(
struct
scsi_c
mnd
*
);
};
...
...
@@ -51,7 +51,7 @@ extern void ata_thread_wake(struct ata_port *ap, unsigned int thr_state);
/* libata-scsi.c */
extern
void
ata_to_sense_error
(
struct
ata_queued_cmd
*
qc
);
extern
void
ata_scsi_rw_queue
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
),
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
),
unsigned
int
cmd_size
);
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
unsigned
int
ata_scsiop_inq_std
(
struct
ata_scsi_args
*
args
,
u8
*
rbuf
,
...
...
@@ -74,19 +74,19 @@ extern unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
unsigned
int
buflen
);
extern
unsigned
int
ata_scsiop_report_luns
(
struct
ata_scsi_args
*
args
,
u8
*
rbuf
,
unsigned
int
buflen
);
extern
void
ata_scsi_badcmd
(
Scsi_C
mnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
),
extern
void
ata_scsi_badcmd
(
struct
scsi_c
mnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
),
u8
asc
,
u8
ascq
);
extern
void
ata_scsi_rbuf_fill
(
struct
ata_scsi_args
*
args
,
unsigned
int
(
*
actor
)
(
struct
ata_scsi_args
*
args
,
u8
*
rbuf
,
unsigned
int
buflen
));
static
inline
void
ata_bad_scsiop
(
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
))
static
inline
void
ata_bad_scsiop
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
ata_scsi_badcmd
(
cmd
,
done
,
0x20
,
0x00
);
}
static
inline
void
ata_bad_cdb
(
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
))
static
inline
void
ata_bad_cdb
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
ata_scsi_badcmd
(
cmd
,
done
,
0x24
,
0x00
);
}
...
...
drivers/scsi/sata_promise.c
View file @
e241138a
This diff is collapsed.
Click to expand it.
drivers/scsi/sata_sil.c
View file @
e241138a
...
...
@@ -87,6 +87,7 @@ static Scsi_Host_Template sil_sht = {
.
proc_name
=
DRV_NAME
,
.
dma_boundary
=
ATA_DMA_BOUNDARY
,
.
slave_configure
=
ata_scsi_slave_config
,
.
bios_param
=
ata_std_bios_param
,
};
static
struct
ata_port_operations
sil_ops
=
{
...
...
drivers/scsi/sata_svw.c
View file @
e241138a
...
...
@@ -219,6 +219,7 @@ static Scsi_Host_Template k2_sata_sht = {
#ifdef CONFIG_ALL_PPC
.
proc_info
=
k2_sata_proc_info
#endif
.
bios_param
=
ata_std_bios_param
,
};
...
...
drivers/scsi/sata_via.c
View file @
e241138a
...
...
@@ -78,6 +78,7 @@ static Scsi_Host_Template svia_sht = {
.
proc_name
=
DRV_NAME
,
.
dma_boundary
=
ATA_DMA_BOUNDARY
,
.
slave_configure
=
ata_scsi_slave_config
,
.
bios_param
=
ata_std_bios_param
,
};
static
struct
ata_port_operations
svia_sata_ops
=
{
...
...
include/linux/libata.h
View file @
e241138a
...
...
@@ -28,6 +28,7 @@
#include <asm/io.h>
#include <linux/ata.h>
/*
* compile-time options
*/
...
...
@@ -66,8 +67,6 @@
/* defines only for the constants which don't work well as enums */
#define ATA_TAG_POISON 0xfafbfcfdU
#define ATA_DMA_BOUNDARY 0xffffUL
#define ATA_DMA_MASK 0xffffffffULL
enum
{
/* various global constants */
...
...
@@ -171,6 +170,7 @@ enum {
};
/* forward declarations */
struct
scsi_device
;
struct
ata_port_operations
;
struct
ata_port
;
struct
ata_queued_cmd
;
...
...
@@ -247,8 +247,8 @@ struct ata_queued_cmd {
struct
ata_port
*
ap
;
struct
ata_device
*
dev
;
Scsi_C
mnd
*
scsicmd
;
void
(
*
scsidone
)(
Scsi_C
mnd
*
);
struct
scsi_c
mnd
*
scsicmd
;
void
(
*
scsidone
)(
struct
scsi_c
mnd
*
);
struct
list_head
node
;
unsigned
long
flags
;
/* ATA_QCFLAG_xxx */
...
...
@@ -403,7 +403,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
extern
void
ata_pci_remove_one
(
struct
pci_dev
*
pdev
);
extern
int
ata_device_add
(
struct
ata_probe_ent
*
ent
);
extern
int
ata_scsi_detect
(
Scsi_Host_Template
*
sht
);
extern
int
ata_scsi_queuecmd
(
Scsi_Cmnd
*
cmd
,
void
(
*
done
)(
Scsi_C
mnd
*
));
extern
int
ata_scsi_queuecmd
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_c
mnd
*
));
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_release
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_slave_config
(
struct
scsi_device
*
sdev
);
...
...
@@ -427,6 +427,9 @@ extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc);
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
,
unsigned
int
done_late
);
extern
void
ata_eng_timeout
(
struct
ata_port
*
ap
);
extern
int
ata_std_bios_param
(
struct
scsi_device
*
sdev
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
geom
[]);
static
inline
unsigned
long
msecs_to_jiffies
(
unsigned
long
msecs
)
...
...
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