]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/libata.h
libata: implement slave_link
[linux-2.6-omap-h63xx.git] / include / linux / libata.h
index 0c7e6f3c28eb7057c1e2a9b31d1696031bcf3570..244ff601559ac79243261fd446ea09c32326caaa 100644 (file)
@@ -690,7 +690,8 @@ struct ata_port {
        unsigned int            qc_active;
        int                     nr_active_links; /* #links with active qcs */
 
-       struct ata_link         link;   /* host default link */
+       struct ata_link         link;           /* host default link */
+       struct ata_link         *slave_link;    /* see ata_slave_link_init() */
 
        int                     nr_pmp_links;   /* nr of available PMP links */
        struct ata_link         *pmp_link;      /* array of PMP links */
@@ -897,6 +898,7 @@ extern void ata_port_disable(struct ata_port *);
 extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports);
 extern struct ata_host *ata_host_alloc_pinfo(struct device *dev,
                        const struct ata_port_info * const * ppi, int n_ports);
+extern int ata_slave_link_init(struct ata_port *ap);
 extern int ata_host_start(struct ata_host *host);
 extern int ata_host_register(struct ata_host *host,
                             struct scsi_host_template *sht);
@@ -1136,7 +1138,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap)
 
 static inline int ata_is_host_link(const struct ata_link *link)
 {
-       return link == &link->ap->link;
+       return link == &link->ap->link || link == link->ap->slave_link;
 }
 #else /* CONFIG_SATA_PMP */
 static inline bool sata_pmp_supported(struct ata_port *ap)
@@ -1169,7 +1171,7 @@ static inline int sata_srst_pmp(struct ata_link *link)
        printk("%sata%u: "fmt, lv, (ap)->print_id , ##args)
 
 #define ata_link_printk(link, lv, fmt, args...) do { \
-       if (sata_pmp_attached((link)->ap)) \
+       if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link)    \
                printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id,   \
                       (link)->pmp , ##args); \
        else \