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
8382a6c0
Commit
8382a6c0
authored
Jul 04, 2004
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[libata] convert set-xfer-mode operation to use ata_queued_cmd
parent
7a3e5b20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+27
-17
No files found.
drivers/scsi/libata-core.c
View file @
8382a6c0
...
...
@@ -57,6 +57,7 @@ static int fgb(unsigned long bitmap);
static
int
ata_choose_xfer_mode
(
struct
ata_port
*
ap
,
unsigned
int
*
xfer_mode_out
,
unsigned
int
*
xfer_shift_out
);
static
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
static
unsigned
int
ata_unique_id
=
1
;
static
struct
workqueue_struct
*
ata_wq
;
...
...
@@ -1748,30 +1749,34 @@ static int ata_choose_xfer_mode(struct ata_port *ap,
static
void
ata_dev_set_xfermode
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
)
{
struct
ata_taskfile
tf
;
DECLARE_COMPLETION
(
wait
);
struct
ata_queued_cmd
*
qc
;
int
rc
;
unsigned
long
flags
;
/* set up set-features taskfile */
DPRINTK
(
"set features - xfer mode
\n
"
);
ata_tf_init
(
ap
,
&
tf
,
dev
->
devno
);
tf
.
ctl
|=
ATA_NIEN
;
tf
.
command
=
ATA_CMD_SET_FEATURES
;
tf
.
feature
=
SETFEATURES_XFER
;
tf
.
flags
|=
ATA_TFLAG_ISADDR
|
ATA_TFLAG_DEVICE
;
tf
.
protocol
=
ATA_PROT_NODATA
;
tf
.
nsect
=
dev
->
xfer_mode
;
/* do bus reset */
ata_tf_to_host
(
ap
,
&
tf
);
/* crazy ATAPI devices... */
if
(
dev
->
class
==
ATA_DEV_ATAPI
)
msleep
(
150
);
qc
=
ata_qc_new_init
(
ap
,
dev
);
BUG_ON
(
qc
==
NULL
);
ata_busy_sleep
(
ap
,
ATA_TMOUT_BOOT_QUICK
,
ATA_TMOUT_BOOT
);
qc
->
tf
.
command
=
ATA_CMD_SET_FEATURES
;
qc
->
tf
.
feature
=
SETFEATURES_XFER
;
qc
->
tf
.
flags
|=
ATA_TFLAG_ISADDR
|
ATA_TFLAG_DEVICE
;
qc
->
tf
.
protocol
=
ATA_PROT_NODATA
;
qc
->
tf
.
nsect
=
dev
->
xfer_mode
;
qc
->
waiting
=
&
wait
;
qc
->
complete_fn
=
ata_qc_complete_noop
;
ata_irq_on
(
ap
);
/* re-enable interrupts */
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
rc
=
ata_qc_issue
(
qc
);
spin_unlock_irqrestore
(
&
ap
->
host_set
->
lock
,
flags
);
ata_wait_idle
(
ap
);
if
(
rc
)
ata_port_disable
(
ap
);
else
wait_for_completion
(
&
wait
);
DPRINTK
(
"EXIT
\n
"
);
}
...
...
@@ -2330,6 +2335,11 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
return
qc
;
}
static
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
)
{
return
0
;
}
/**
* ata_qc_complete - Complete an active ATA command
* @qc: Command to complete
...
...
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