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
a939c963
Commit
a939c963
authored
Oct 05, 2005
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libata: move atapi_request_sense() to libata-scsi module
No content changes, just moving code around.
parent
a15dbeb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
48 deletions
+50
-48
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+1
-48
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+46
-0
drivers/scsi/libata.h
drivers/scsi/libata.h
+3
-0
No files found.
drivers/scsi/libata-core.c
View file @
a939c963
...
@@ -71,7 +71,6 @@ static int fgb(u32 bitmap);
...
@@ -71,7 +71,6 @@ static int fgb(u32 bitmap);
static
int
ata_choose_xfer_mode
(
struct
ata_port
*
ap
,
static
int
ata_choose_xfer_mode
(
struct
ata_port
*
ap
,
u8
*
xfer_mode_out
,
u8
*
xfer_mode_out
,
unsigned
int
*
xfer_shift_out
);
unsigned
int
*
xfer_shift_out
);
static
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
static
void
__ata_qc_complete
(
struct
ata_queued_cmd
*
qc
);
static
void
__ata_qc_complete
(
struct
ata_queued_cmd
*
qc
);
static
unsigned
int
ata_unique_id
=
1
;
static
unsigned
int
ata_unique_id
=
1
;
...
@@ -3015,52 +3014,6 @@ static void ata_pio_task(void *_data)
...
@@ -3015,52 +3014,6 @@ static void ata_pio_task(void *_data)
goto
fsm_start
;
goto
fsm_start
;
}
}
static
void
atapi_request_sense
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
struct
scsi_cmnd
*
cmd
)
{
DECLARE_COMPLETION
(
wait
);
struct
ata_queued_cmd
*
qc
;
unsigned
long
flags
;
int
rc
;
DPRINTK
(
"ATAPI request sense
\n
"
);
qc
=
ata_qc_new_init
(
ap
,
dev
);
BUG_ON
(
qc
==
NULL
);
/* FIXME: is this needed? */
memset
(
cmd
->
sense_buffer
,
0
,
sizeof
(
cmd
->
sense_buffer
));
ata_sg_init_one
(
qc
,
cmd
->
sense_buffer
,
sizeof
(
cmd
->
sense_buffer
));
qc
->
dma_dir
=
DMA_FROM_DEVICE
;
memset
(
&
qc
->
cdb
,
0
,
ap
->
cdb_len
);
qc
->
cdb
[
0
]
=
REQUEST_SENSE
;
qc
->
cdb
[
4
]
=
SCSI_SENSE_BUFFERSIZE
;
qc
->
tf
.
flags
|=
ATA_TFLAG_ISADDR
|
ATA_TFLAG_DEVICE
;
qc
->
tf
.
command
=
ATA_CMD_PACKET
;
qc
->
tf
.
protocol
=
ATA_PROT_ATAPI
;
qc
->
tf
.
lbam
=
(
8
*
1024
)
&
0xff
;
qc
->
tf
.
lbah
=
(
8
*
1024
)
>>
8
;
qc
->
nbytes
=
SCSI_SENSE_BUFFERSIZE
;
qc
->
waiting
=
&
wait
;
qc
->
complete_fn
=
ata_qc_complete_noop
;
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
rc
=
ata_qc_issue
(
qc
);
spin_unlock_irqrestore
(
&
ap
->
host_set
->
lock
,
flags
);
if
(
rc
)
ata_port_disable
(
ap
);
else
wait_for_completion
(
&
wait
);
DPRINTK
(
"EXIT
\n
"
);
}
/**
/**
* ata_qc_timeout - Handle timeout of queued command
* ata_qc_timeout - Handle timeout of queued command
* @qc: Command that timed out
* @qc: Command that timed out
...
@@ -3254,7 +3207,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
...
@@ -3254,7 +3207,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
return
qc
;
return
qc
;
}
}
static
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
)
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
)
{
{
return
0
;
return
0
;
}
}
...
...
drivers/scsi/libata-scsi.c
View file @
a939c963
...
@@ -1479,6 +1479,52 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8
...
@@ -1479,6 +1479,52 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8
done
(
cmd
);
done
(
cmd
);
}
}
void
atapi_request_sense
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
struct
scsi_cmnd
*
cmd
)
{
DECLARE_COMPLETION
(
wait
);
struct
ata_queued_cmd
*
qc
;
unsigned
long
flags
;
int
rc
;
DPRINTK
(
"ATAPI request sense
\n
"
);
qc
=
ata_qc_new_init
(
ap
,
dev
);
BUG_ON
(
qc
==
NULL
);
/* FIXME: is this needed? */
memset
(
cmd
->
sense_buffer
,
0
,
sizeof
(
cmd
->
sense_buffer
));
ata_sg_init_one
(
qc
,
cmd
->
sense_buffer
,
sizeof
(
cmd
->
sense_buffer
));
qc
->
dma_dir
=
DMA_FROM_DEVICE
;
memset
(
&
qc
->
cdb
,
0
,
ap
->
cdb_len
);
qc
->
cdb
[
0
]
=
REQUEST_SENSE
;
qc
->
cdb
[
4
]
=
SCSI_SENSE_BUFFERSIZE
;
qc
->
tf
.
flags
|=
ATA_TFLAG_ISADDR
|
ATA_TFLAG_DEVICE
;
qc
->
tf
.
command
=
ATA_CMD_PACKET
;
qc
->
tf
.
protocol
=
ATA_PROT_ATAPI
;
qc
->
tf
.
lbam
=
(
8
*
1024
)
&
0xff
;
qc
->
tf
.
lbah
=
(
8
*
1024
)
>>
8
;
qc
->
nbytes
=
SCSI_SENSE_BUFFERSIZE
;
qc
->
waiting
=
&
wait
;
qc
->
complete_fn
=
ata_qc_complete_noop
;
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
rc
=
ata_qc_issue
(
qc
);
spin_unlock_irqrestore
(
&
ap
->
host_set
->
lock
,
flags
);
if
(
rc
)
ata_port_disable
(
ap
);
else
wait_for_completion
(
&
wait
);
DPRINTK
(
"EXIT
\n
"
);
}
static
int
atapi_qc_complete
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
)
static
int
atapi_qc_complete
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
)
{
{
struct
scsi_cmnd
*
cmd
=
qc
->
scsicmd
;
struct
scsi_cmnd
*
cmd
=
qc
->
scsicmd
;
...
...
drivers/scsi/libata.h
View file @
a939c963
...
@@ -39,6 +39,7 @@ struct ata_scsi_args {
...
@@ -39,6 +39,7 @@ struct ata_scsi_args {
/* libata-core.c */
/* libata-core.c */
extern
int
atapi_enabled
;
extern
int
atapi_enabled
;
extern
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
extern
struct
ata_queued_cmd
*
ata_qc_new_init
(
struct
ata_port
*
ap
,
extern
struct
ata_queued_cmd
*
ata_qc_new_init
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
);
struct
ata_device
*
dev
);
extern
void
ata_qc_free
(
struct
ata_queued_cmd
*
qc
);
extern
void
ata_qc_free
(
struct
ata_queued_cmd
*
qc
);
...
@@ -51,6 +52,8 @@ extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
...
@@ -51,6 +52,8 @@ extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
/* libata-scsi.c */
/* libata-scsi.c */
extern
void
atapi_request_sense
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
struct
scsi_cmnd
*
cmd
);
extern
void
ata_scsi_scan_host
(
struct
ata_port
*
ap
);
extern
void
ata_scsi_scan_host
(
struct
ata_port
*
ap
);
extern
void
ata_to_sense_error
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
extern
void
ata_to_sense_error
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
...
...
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