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
nexedi
linux
Commits
bd7b6c43
Commit
bd7b6c43
authored
May 16, 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
b3e0153f
e9c8846e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
15 deletions
+38
-15
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+10
-2
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+25
-13
include/linux/ata.h
include/linux/ata.h
+2
-0
include/linux/libata.h
include/linux/libata.h
+1
-0
No files found.
drivers/scsi/libata-core.c
View file @
bd7b6c43
...
...
@@ -2677,6 +2677,7 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
handled
=
1
;
break
;
case
ATA_PROT_ATAPI
:
case
ATA_PROT_NODATA
:
/* command completion, but no data xfer */
status
=
ata_busy_wait
(
ap
,
ATA_BUSY
|
ATA_DRQ
,
1000
);
DPRINTK
(
"BUS_NODATA (drv_stat 0x%X)
\n
"
,
status
);
...
...
@@ -2837,9 +2838,16 @@ static void atapi_packet_task(void *_data)
qc
->
scsicmd
->
cmnd
,
ap
->
host
->
max_cmd_len
/
4
);
/* if we are DMA'ing, irq handler takes over from here */
if
(
qc
->
tf
.
protocol
==
ATA_PROT_ATAPI_DMA
)
{
if
(
qc
->
tf
.
protocol
==
ATA_PROT_ATAPI_DMA
)
ap
->
ops
->
bmdma_start
(
qc
);
/* initiate bmdma */
}
else
{
/* non-data commands are also handled via irq */
else
if
(
qc
->
scsicmd
->
sc_data_direction
==
SCSI_DATA_NONE
)
{
/* do nothing */
}
/* PIO commands are handled by polling */
else
{
ap
->
pio_task_state
=
PIO_ST
;
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
}
...
...
drivers/scsi/libata-scsi.c
View file @
bd7b6c43
...
...
@@ -46,8 +46,8 @@ static void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
* @geom: location to which geometry will be output
*
* 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
* 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:
...
...
@@ -57,7 +57,7 @@ static void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
* Zero.
*/
int
ata_std_bios_param
(
struct
scsi_device
*
sdev
,
struct
block_device
*
bdev
,
sector_t
capacity
,
int
geom
[])
sector_t
capacity
,
int
geom
[])
{
geom
[
0
]
=
255
;
geom
[
1
]
=
63
;
...
...
@@ -362,19 +362,20 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
VPRINTK
(
"ENTER
\n
"
);
if
(
unlikely
(
cmd
->
request_bufflen
<
1
))
{
printk
(
KERN_WARNING
"ata%u(%u): empty request buffer
\n
"
,
ap
->
id
,
dev
->
devno
);
goto
err_out
;
}
qc
=
ata_scsi_qc_new
(
ap
,
dev
,
cmd
,
done
);
if
(
!
qc
)
return
;
if
(
cmd
->
sc_data_direction
==
SCSI_DATA_READ
||
cmd
->
sc_data_direction
==
SCSI_DATA_WRITE
)
cmd
->
sc_data_direction
==
SCSI_DATA_WRITE
)
{
if
(
unlikely
(
cmd
->
request_bufflen
<
1
))
{
printk
(
KERN_WARNING
"ata%u(%u): WARNING: zero len r/w req
\n
"
,
ap
->
id
,
dev
->
devno
);
goto
err_out
;
}
qc
->
flags
|=
ATA_QCFLAG_SG
;
/* data is present; dma-map it */
}
if
(
xlat_func
(
qc
,
scsicmd
))
goto
err_out
;
...
...
@@ -910,16 +911,27 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
qc
->
tf
.
command
=
ATA_CMD_PACKET
;
if
((
cmd
->
sc_data_direction
==
SCSI_DATA_NONE
)
||
((
qc
->
flags
&
ATA_QCFLAG_DMA
)
==
0
))
{
/* no data - interrupt-driven */
if
(
cmd
->
sc_data_direction
==
SCSI_DATA_NONE
)
qc
->
tf
.
protocol
=
ATA_PROT_ATAPI
;
/* PIO data xfer - polling */
else
if
((
qc
->
flags
&
ATA_QCFLAG_DMA
)
==
0
)
{
ata_qc_set_polling
(
qc
);
qc
->
tf
.
protocol
=
ATA_PROT_ATAPI
;
qc
->
tf
.
lbam
=
(
8
*
1024
)
&
0xff
;
qc
->
tf
.
lbah
=
(
8
*
1024
)
>>
8
;
/* DMA data xfer - interrupt-driven */
}
else
{
qc
->
flags
|=
ATA_QCFLAG_SG
;
/* data is present; dma-map it */
qc
->
tf
.
protocol
=
ATA_PROT_ATAPI_DMA
;
qc
->
tf
.
feature
|=
ATAPI_PKT_DMA
;
#ifdef ATAPI_ENABLE_DMADIR
/* some SATA bridges need us to indicate data xfer direction */
if
(
cmd
->
sc_data_direction
!=
SCSI_DATA_WRITE
)
qc
->
tf
.
feature
|=
ATAPI_DMADIR
;
#endif
}
return
0
;
...
...
include/linux/ata.h
View file @
bd7b6c43
...
...
@@ -134,6 +134,8 @@ enum {
/* ATAPI stuff */
ATAPI_PKT_DMA
=
(
1
<<
0
),
ATAPI_DMADIR
=
(
1
<<
2
),
/* ATAPI data dir:
0=to device, 1=to host */
/* cable types */
ATA_CBL_NONE
=
0
,
...
...
include/linux/libata.h
View file @
bd7b6c43
...
...
@@ -40,6 +40,7 @@
#undef ATA_ENABLE_ATAPI
/* define to enable ATAPI support */
#undef ATA_ENABLE_PATA
/* define to enable PATA support in some
* low-level drivers */
#undef ATAPI_ENABLE_DMADIR
/* enables ATAPI DMADIR bridge support */
/* note: prints function name for you */
...
...
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