Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
35bb94b1
Commit
35bb94b1
authored
Apr 11, 2006
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libata: Add helper ata_shost_to_port()
parent
381544bb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
9 deletions
+15
-9
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+2
-2
drivers/scsi/libata-eh.c
drivers/scsi/libata-eh.c
+2
-2
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+4
-4
drivers/scsi/sata_svw.c
drivers/scsi/sata_svw.c
+1
-1
include/linux/libata.h
include/linux/libata.h
+6
-0
No files found.
drivers/scsi/libata-core.c
View file @
35bb94b1
...
@@ -4659,7 +4659,7 @@ static struct ata_port * ata_host_add(const struct ata_probe_ent *ent,
...
@@ -4659,7 +4659,7 @@ static struct ata_port * ata_host_add(const struct ata_probe_ent *ent,
host
->
transportt
=
&
ata_scsi_transport_template
;
host
->
transportt
=
&
ata_scsi_transport_template
;
ap
=
(
struct
ata_port
*
)
&
host
->
hostdata
[
0
]
;
ap
=
ata_shost_to_port
(
host
)
;
ata_host_init
(
ap
,
host
,
host_set
,
ent
,
port_no
);
ata_host_init
(
ap
,
host
,
host_set
,
ent
,
port_no
);
...
@@ -4872,7 +4872,7 @@ void ata_host_set_remove(struct ata_host_set *host_set)
...
@@ -4872,7 +4872,7 @@ void ata_host_set_remove(struct ata_host_set *host_set)
int
ata_scsi_release
(
struct
Scsi_Host
*
host
)
int
ata_scsi_release
(
struct
Scsi_Host
*
host
)
{
{
struct
ata_port
*
ap
=
(
struct
ata_port
*
)
&
host
->
hostdata
[
0
]
;
struct
ata_port
*
ap
=
ata_shost_to_port
(
host
)
;
int
i
;
int
i
;
DPRINTK
(
"ENTER
\n
"
);
DPRINTK
(
"ENTER
\n
"
);
...
...
drivers/scsi/libata-eh.c
View file @
35bb94b1
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
enum
scsi_eh_timer_return
ata_scsi_timed_out
(
struct
scsi_cmnd
*
cmd
)
enum
scsi_eh_timer_return
ata_scsi_timed_out
(
struct
scsi_cmnd
*
cmd
)
{
{
struct
Scsi_Host
*
host
=
cmd
->
device
->
host
;
struct
Scsi_Host
*
host
=
cmd
->
device
->
host
;
struct
ata_port
*
ap
=
(
struct
ata_port
*
)
&
host
->
hostdata
[
0
]
;
struct
ata_port
*
ap
=
ata_shost_to_port
(
host
)
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
ata_queued_cmd
*
qc
;
struct
ata_queued_cmd
*
qc
;
enum
scsi_eh_timer_return
ret
=
EH_HANDLED
;
enum
scsi_eh_timer_return
ret
=
EH_HANDLED
;
...
@@ -99,7 +99,7 @@ enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
...
@@ -99,7 +99,7 @@ enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
*/
*/
void
ata_scsi_error
(
struct
Scsi_Host
*
host
)
void
ata_scsi_error
(
struct
Scsi_Host
*
host
)
{
{
struct
ata_port
*
ap
=
(
struct
ata_port
*
)
&
host
->
hostdata
[
0
]
;
struct
ata_port
*
ap
=
ata_shost_to_port
(
host
)
;
DPRINTK
(
"ENTER
\n
"
);
DPRINTK
(
"ENTER
\n
"
);
...
...
drivers/scsi/libata-scsi.c
View file @
35bb94b1
...
@@ -395,7 +395,7 @@ void ata_dump_status(unsigned id, struct ata_taskfile *tf)
...
@@ -395,7 +395,7 @@ void ata_dump_status(unsigned id, struct ata_taskfile *tf)
int
ata_scsi_device_resume
(
struct
scsi_device
*
sdev
)
int
ata_scsi_device_resume
(
struct
scsi_device
*
sdev
)
{
{
struct
ata_port
*
ap
=
(
struct
ata_port
*
)
&
sdev
->
host
->
hostdata
[
0
]
;
struct
ata_port
*
ap
=
ata_shost_to_port
(
sdev
->
host
)
;
struct
ata_device
*
dev
=
&
ap
->
device
[
sdev
->
id
];
struct
ata_device
*
dev
=
&
ap
->
device
[
sdev
->
id
];
return
ata_device_resume
(
ap
,
dev
);
return
ata_device_resume
(
ap
,
dev
);
...
@@ -403,7 +403,7 @@ int ata_scsi_device_resume(struct scsi_device *sdev)
...
@@ -403,7 +403,7 @@ int ata_scsi_device_resume(struct scsi_device *sdev)
int
ata_scsi_device_suspend
(
struct
scsi_device
*
sdev
,
pm_message_t
state
)
int
ata_scsi_device_suspend
(
struct
scsi_device
*
sdev
,
pm_message_t
state
)
{
{
struct
ata_port
*
ap
=
(
struct
ata_port
*
)
&
sdev
->
host
->
hostdata
[
0
]
;
struct
ata_port
*
ap
=
ata_shost_to_port
(
sdev
->
host
)
;
struct
ata_device
*
dev
=
&
ap
->
device
[
sdev
->
id
];
struct
ata_device
*
dev
=
&
ap
->
device
[
sdev
->
id
];
return
ata_device_suspend
(
ap
,
dev
,
state
);
return
ata_device_suspend
(
ap
,
dev
,
state
);
...
@@ -704,7 +704,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
...
@@ -704,7 +704,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
struct
ata_port
*
ap
;
struct
ata_port
*
ap
;
struct
ata_device
*
dev
;
struct
ata_device
*
dev
;
ap
=
(
struct
ata_port
*
)
&
sdev
->
host
->
hostdata
[
0
]
;
ap
=
ata_shost_to_port
(
sdev
->
host
)
;
dev
=
&
ap
->
device
[
sdev
->
id
];
dev
=
&
ap
->
device
[
sdev
->
id
];
ata_scsi_dev_config
(
sdev
,
dev
);
ata_scsi_dev_config
(
sdev
,
dev
);
...
@@ -2478,7 +2478,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
...
@@ -2478,7 +2478,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
struct
scsi_device
*
scsidev
=
cmd
->
device
;
struct
scsi_device
*
scsidev
=
cmd
->
device
;
struct
Scsi_Host
*
shost
=
scsidev
->
host
;
struct
Scsi_Host
*
shost
=
scsidev
->
host
;
ap
=
(
struct
ata_port
*
)
&
shost
->
hostdata
[
0
]
;
ap
=
ata_shost_to_port
(
shost
)
;
spin_unlock
(
shost
->
host_lock
);
spin_unlock
(
shost
->
host_lock
);
spin_lock
(
&
ap
->
host_set
->
lock
);
spin_lock
(
&
ap
->
host_set
->
lock
);
...
...
drivers/scsi/sata_svw.c
View file @
35bb94b1
...
@@ -257,7 +257,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
...
@@ -257,7 +257,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
int
len
,
index
;
int
len
,
index
;
/* Find the ata_port */
/* Find the ata_port */
ap
=
(
struct
ata_port
*
)
&
shost
->
hostdata
[
0
]
;
ap
=
ata_shost_to_port
(
shost
)
;
if
(
ap
==
NULL
)
if
(
ap
==
NULL
)
return
0
;
return
0
;
...
...
include/linux/libata.h
View file @
35bb94b1
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <asm/io.h>
#include <asm/io.h>
#include <linux/ata.h>
#include <linux/ata.h>
#include <linux/workqueue.h>
#include <linux/workqueue.h>
#include <scsi/scsi_host.h>
/*
/*
* compile-time options: to be removed as soon as all the drivers are
* compile-time options: to be removed as soon as all the drivers are
...
@@ -977,4 +978,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
...
@@ -977,4 +978,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
dma_free_coherent
(
dev
,
ATA_DMA_PAD_BUF_SZ
,
ap
->
pad
,
ap
->
pad_dma
);
dma_free_coherent
(
dev
,
ATA_DMA_PAD_BUF_SZ
,
ap
->
pad
,
ap
->
pad_dma
);
}
}
static
inline
struct
ata_port
*
ata_shost_to_port
(
struct
Scsi_Host
*
host
)
{
return
(
struct
ata_port
*
)
&
host
->
hostdata
[
0
];
}
#endif
/* __LINUX_LIBATA_H__ */
#endif
/* __LINUX_LIBATA_H__ */
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