Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| sata_port_multipliers [2019/04/24 10:55] – [struct ata_device] rpjday | sata_port_multipliers [2019/04/24 12:30] (current) – [struct ata_device] rpjday | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| * Makefile | * Makefile | ||
| * libata-pmp.c | * libata-pmp.c | ||
| + | * libata-eh.c | ||
| ===== Build files [drivers/ | ===== Build files [drivers/ | ||
| Line 109: | Line 110: | ||
| ATA_FLAG_PMP | ATA_FLAG_PMP | ||
| ... | ... | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | struct ata_port_operations { | ||
| + | ... | ||
| + | void (*pmp_attach)(struct ata_port *ap); | ||
| + | void (*pmp_detach)(struct ata_port *ap); | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | #ifdef CONFIG_SATA_PMP | ||
| + | static inline bool sata_pmp_supported(struct ata_port *ap) | ||
| + | { | ||
| + | return ap-> | ||
| + | } | ||
| + | |||
| + | static inline bool sata_pmp_attached(struct ata_port *ap) | ||
| + | { | ||
| + | return ap-> | ||
| + | } | ||
| + | |||
| + | static inline bool ata_is_host_link(const struct ata_link *link) | ||
| + | { | ||
| + | return link == & | ||
| + | } | ||
| + | #else /* CONFIG_SATA_PMP */ | ||
| + | static inline bool sata_pmp_supported(struct ata_port *ap) | ||
| + | { | ||
| + | return false; | ||
| + | } | ||
| + | |||
| + | static inline bool sata_pmp_attached(struct ata_port *ap) | ||
| + | { | ||
| + | return false; | ||
| + | } | ||
| + | |||
| + | static inline bool ata_is_host_link(const struct ata_link *link) | ||
| + | { | ||
| + | return 1; | ||
| + | } | ||
| + | #endif /* CONFIG_SATA_PMP */ | ||
| </ | </ | ||
| Line 115: | Line 158: | ||
| ==== struct ata_device ==== | ==== struct ata_device ==== | ||
| - | '' | + | '' |
| < | < | ||
| Line 138: | Line 181: | ||
| unsigned int class; | unsigned int class; | ||
| ... | ... | ||
| + | union { | ||
| + | u16 | ||
| + | u32 | ||
| + | } ____cacheline_aligned; | ||
| + | |||
| </ | </ | ||
| Line 143: | Line 191: | ||
| ==== struct ata_link ==== | ==== struct ata_link ==== | ||
| + | |||
| + | '' | ||
| < | < | ||
| Line 149: | Line 199: | ||
| int | int | ||
| ... | ... | ||
| + | struct ata_device | ||
| </ | </ | ||
| Line 162: | Line 213: | ||
| unsigned long | unsigned long | ||
| ... | ... | ||
| + | struct ata_link | ||
| + | struct ata_link | ||
| + | |||
| int | int | ||
| struct ata_link | struct ata_link | ||
| Line 170: | Line 224: | ||
| </ | </ | ||
| - | ===== libata-pmp.c ===== | + | ===== drivers/ |
| + | |||
| + | ==== libata-eh.c ==== | ||
| + | |||
| + | < | ||
| + | static int ata_eh_revalidate_and_attach(struct ata_link *link, | ||
| + | struct ata_device **r_failed_dev) | ||
| + | { | ||
| + | struct ata_port *ap = link-> | ||
| + | struct ata_eh_context *ehc = & | ||
| + | struct ata_device *dev; | ||
| + | ... | ||
| + | ata_for_each_dev(dev, | ||
| + | ... | ||
| + | dev-> | ||
| + | |||
| + | if (dev-> | ||
| + | rc = sata_pmp_attach(dev); | ||
| + | else | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ==== libata-pmp.c ==== | ||
| + | |||
| + | === sata_pmp_configure() | ||