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
532de20c
Commit
532de20c
authored
Apr 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
fcd93c96
a9403f0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+1
-0
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+16
-11
drivers/scsi/sata_promise.c
drivers/scsi/sata_promise.c
+2
-2
No files found.
drivers/scsi/libata-core.c
View file @
532de20c
...
@@ -2245,6 +2245,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
...
@@ -2245,6 +2245,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
qc
->
scsicmd
=
NULL
;
qc
->
scsicmd
=
NULL
;
qc
->
ap
=
ap
;
qc
->
ap
=
ap
;
qc
->
dev
=
dev
;
qc
->
dev
=
dev
;
qc
->
cursect
=
qc
->
cursg
=
qc
->
cursg_ofs
=
0
;
INIT_LIST_HEAD
(
&
qc
->
node
);
INIT_LIST_HEAD
(
&
qc
->
node
);
init_MUTEX_LOCKED
(
&
qc
->
sem
);
init_MUTEX_LOCKED
(
&
qc
->
sem
);
...
...
drivers/scsi/libata-scsi.c
View file @
532de20c
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "libata.h"
#include "libata.h"
typedef
unsigned
int
(
*
ata_xlat_func_t
)(
struct
ata_queued_cmd
*
qc
,
u8
*
scsicmd
);
static
void
ata_scsi_simulate
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
static
void
ata_scsi_simulate
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
struct
scsi_cmnd
*
cmd
,
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_cmnd
*
));
void
(
*
done
)(
struct
scsi_cmnd
*
));
...
@@ -222,7 +223,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
...
@@ -222,7 +223,6 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
struct
ata_taskfile
*
tf
=
&
qc
->
tf
;
struct
ata_taskfile
*
tf
=
&
qc
->
tf
;
unsigned
int
lba48
=
tf
->
flags
&
ATA_TFLAG_LBA48
;
unsigned
int
lba48
=
tf
->
flags
&
ATA_TFLAG_LBA48
;
qc
->
cursect
=
qc
->
cursg
=
qc
->
cursg_ofs
=
0
;
tf
->
flags
|=
ATA_TFLAG_ISADDR
|
ATA_TFLAG_DEVICE
;
tf
->
flags
|=
ATA_TFLAG_ISADDR
|
ATA_TFLAG_DEVICE
;
tf
->
hob_nsect
=
0
;
tf
->
hob_nsect
=
0
;
tf
->
hob_lbal
=
0
;
tf
->
hob_lbal
=
0
;
...
@@ -335,7 +335,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
...
@@ -335,7 +335,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
static
void
ata_scsi_translate
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
static
void
ata_scsi_translate
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
struct
scsi_cmnd
*
cmd
,
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_cmnd
*
))
void
(
*
done
)(
struct
scsi_cmnd
*
),
ata_xlat_func_t
xlat_func
)
{
{
struct
ata_queued_cmd
*
qc
;
struct
ata_queued_cmd
*
qc
;
u8
*
scsicmd
=
cmd
->
cmnd
;
u8
*
scsicmd
=
cmd
->
cmnd
;
...
@@ -352,9 +353,11 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
...
@@ -352,9 +353,11 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
if
(
!
qc
)
if
(
!
qc
)
return
;
return
;
qc
->
flags
|=
ATA_QCFLAG_SG
;
/* data is present; dma-map it */
if
(
cmd
->
sc_data_direction
==
SCSI_DATA_READ
||
cmd
->
sc_data_direction
==
SCSI_DATA_WRITE
)
qc
->
flags
|=
ATA_QCFLAG_SG
;
/* data is present; dma-map it */
if
(
ata_scsi_rw_xlat
(
qc
,
scsicmd
))
if
(
xlat_func
(
qc
,
scsicmd
))
goto
err_out
;
goto
err_out
;
/* select device, send command to hardware */
/* select device, send command to hardware */
...
@@ -1014,17 +1017,17 @@ ata_scsi_find_dev(struct ata_port *ap, struct scsi_cmnd *cmd)
...
@@ -1014,17 +1017,17 @@ ata_scsi_find_dev(struct ata_port *ap, struct scsi_cmnd *cmd)
}
}
/**
/**
* ata_
scsi_xlat_possible
- check if SCSI to ATA translation is possible
* ata_
get_xlat_func
- check if SCSI to ATA translation is possible
* @cmd: SCSI command opcode to consider
* @cmd: SCSI command opcode to consider
*
*
* Look up the SCSI command given, and determine whether the
* Look up the SCSI command given, and determine whether the
* SCSI command is to be translated or simulated.
* SCSI command is to be translated or simulated.
*
*
* RETURNS:
* RETURNS:
*
Non-zero if possible, zero
if not.
*
Pointer to translation function if possible, %NULL
if not.
*/
*/
static
inline
int
ata_scsi_xlat_possible
(
u8
cmd
)
static
inline
ata_xlat_func_t
ata_get_xlat_func
(
u8
cmd
)
{
{
switch
(
cmd
)
{
switch
(
cmd
)
{
case
READ_6
:
case
READ_6
:
...
@@ -1034,10 +1037,10 @@ static inline int ata_scsi_xlat_possible(u8 cmd)
...
@@ -1034,10 +1037,10 @@ static inline int ata_scsi_xlat_possible(u8 cmd)
case
WRITE_6
:
case
WRITE_6
:
case
WRITE_10
:
case
WRITE_10
:
case
WRITE_16
:
case
WRITE_16
:
return
1
;
return
ata_scsi_rw_xlat
;
}
}
return
0
;
return
NULL
;
}
}
/**
/**
...
@@ -1099,8 +1102,10 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
...
@@ -1099,8 +1102,10 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
}
}
if
(
dev
->
class
==
ATA_DEV_ATA
)
{
if
(
dev
->
class
==
ATA_DEV_ATA
)
{
if
(
ata_scsi_xlat_possible
(
cmd
->
cmnd
[
0
]))
ata_xlat_func_t
xlat_func
=
ata_get_xlat_func
(
cmd
->
cmnd
[
0
]);
ata_scsi_translate
(
ap
,
dev
,
cmd
,
done
);
if
(
xlat_func
)
ata_scsi_translate
(
ap
,
dev
,
cmd
,
done
,
xlat_func
);
else
else
ata_scsi_simulate
(
ap
,
dev
,
cmd
,
done
);
ata_scsi_simulate
(
ap
,
dev
,
cmd
,
done
);
}
else
}
else
...
...
drivers/scsi/sata_promise.c
View file @
532de20c
...
@@ -1180,14 +1180,14 @@ static void pdc_dma_start(struct ata_queued_cmd *qc)
...
@@ -1180,14 +1180,14 @@ static void pdc_dma_start(struct ata_queued_cmd *qc)
static
void
pdc_tf_load_mmio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
)
static
void
pdc_tf_load_mmio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
)
{
{
if
(
tf
->
protocol
!=
ATA_PROT_DMA
)
if
(
tf
->
protocol
==
ATA_PROT_PIO
)
ata_tf_load_mmio
(
ap
,
tf
);
ata_tf_load_mmio
(
ap
,
tf
);
}
}
static
void
pdc_exec_command_mmio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
)
static
void
pdc_exec_command_mmio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
)
{
{
if
(
tf
->
protocol
!=
ATA_PROT_DMA
)
if
(
tf
->
protocol
==
ATA_PROT_PIO
)
ata_exec_command_mmio
(
ap
,
tf
);
ata_exec_command_mmio
(
ap
,
tf
);
}
}
...
...
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