Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: start separating SATA specific code from libata-core.c

Start separating SATA specific code from libata-core.c:

* move following functions to libata-sata.c:
- ata_tf_to_fis()
- ata_tf_from_fis()
- sata_link_scr_lpm()
- ata_slave_link_init()
- sata_lpm_ignore_phy_events()

* group above functions together in <linux/libata.h>

* include libata-sata.c in the build when CONFIG_SATA_HOST=y

Code size savings on m68k arch using (modified) atari_defconfig:

text data bss dec hex filename
before:
37582 572 40 38194 9532 drivers/ata/libata-core.o
after:
36762 572 40 37374 91fe drivers/ata/libata-core.o

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Bartlomiej Zolnierkiewicz and committed by
Jens Axboe
7fe183c7 4c9029e7

+269 -251
+1
drivers/ata/Makefile
··· 123 123 124 124 libata-y := libata-core.o libata-scsi.o libata-eh.o \ 125 125 libata-transport.o libata-trace.o 126 + libata-$(CONFIG_SATA_HOST) += libata-sata.o 126 127 libata-$(CONFIG_ATA_SFF) += libata-sff.o 127 128 libata-$(CONFIG_SATA_PMP) += libata-pmp.o 128 129 libata-$(CONFIG_ATA_ACPI) += libata-acpi.o
-245
drivers/ata/libata-core.c
··· 531 531 } 532 532 EXPORT_SYMBOL_GPL(atapi_cmd_type); 533 533 534 - /** 535 - * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 536 - * @tf: Taskfile to convert 537 - * @pmp: Port multiplier port 538 - * @is_cmd: This FIS is for command 539 - * @fis: Buffer into which data will output 540 - * 541 - * Converts a standard ATA taskfile to a Serial ATA 542 - * FIS structure (Register - Host to Device). 543 - * 544 - * LOCKING: 545 - * Inherited from caller. 546 - */ 547 - void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) 548 - { 549 - fis[0] = 0x27; /* Register - Host to Device FIS */ 550 - fis[1] = pmp & 0xf; /* Port multiplier number*/ 551 - if (is_cmd) 552 - fis[1] |= (1 << 7); /* bit 7 indicates Command FIS */ 553 - 554 - fis[2] = tf->command; 555 - fis[3] = tf->feature; 556 - 557 - fis[4] = tf->lbal; 558 - fis[5] = tf->lbam; 559 - fis[6] = tf->lbah; 560 - fis[7] = tf->device; 561 - 562 - fis[8] = tf->hob_lbal; 563 - fis[9] = tf->hob_lbam; 564 - fis[10] = tf->hob_lbah; 565 - fis[11] = tf->hob_feature; 566 - 567 - fis[12] = tf->nsect; 568 - fis[13] = tf->hob_nsect; 569 - fis[14] = 0; 570 - fis[15] = tf->ctl; 571 - 572 - fis[16] = tf->auxiliary & 0xff; 573 - fis[17] = (tf->auxiliary >> 8) & 0xff; 574 - fis[18] = (tf->auxiliary >> 16) & 0xff; 575 - fis[19] = (tf->auxiliary >> 24) & 0xff; 576 - } 577 - EXPORT_SYMBOL_GPL(ata_tf_to_fis); 578 - 579 - /** 580 - * ata_tf_from_fis - Convert SATA FIS to ATA taskfile 581 - * @fis: Buffer from which data will be input 582 - * @tf: Taskfile to output 583 - * 584 - * Converts a serial ATA FIS structure to a standard ATA taskfile. 585 - * 586 - * LOCKING: 587 - * Inherited from caller. 588 - */ 589 - 590 - void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf) 591 - { 592 - tf->command = fis[2]; /* status */ 593 - tf->feature = fis[3]; /* error */ 594 - 595 - tf->lbal = fis[4]; 596 - tf->lbam = fis[5]; 597 - tf->lbah = fis[6]; 598 - tf->device = fis[7]; 599 - 600 - tf->hob_lbal = fis[8]; 601 - tf->hob_lbam = fis[9]; 602 - tf->hob_lbah = fis[10]; 603 - 604 - tf->nsect = fis[12]; 605 - tf->hob_nsect = fis[13]; 606 - } 607 - EXPORT_SYMBOL_GPL(ata_tf_from_fis); 608 - 609 534 static const u8 ata_rw_cmds[] = { 610 535 /* pio multi */ 611 536 ATA_CMD_READ_MULTI, ··· 3705 3780 EXPORT_SYMBOL_GPL(sata_link_resume); 3706 3781 3707 3782 /** 3708 - * sata_link_scr_lpm - manipulate SControl IPM and SPM fields 3709 - * @link: ATA link to manipulate SControl for 3710 - * @policy: LPM policy to configure 3711 - * @spm_wakeup: initiate LPM transition to active state 3712 - * 3713 - * Manipulate the IPM field of the SControl register of @link 3714 - * according to @policy. If @policy is ATA_LPM_MAX_POWER and 3715 - * @spm_wakeup is %true, the SPM field is manipulated to wake up 3716 - * the link. This function also clears PHYRDY_CHG before 3717 - * returning. 3718 - * 3719 - * LOCKING: 3720 - * EH context. 3721 - * 3722 - * RETURNS: 3723 - * 0 on success, -errno otherwise. 3724 - */ 3725 - int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, 3726 - bool spm_wakeup) 3727 - { 3728 - struct ata_eh_context *ehc = &link->eh_context; 3729 - bool woken_up = false; 3730 - u32 scontrol; 3731 - int rc; 3732 - 3733 - rc = sata_scr_read(link, SCR_CONTROL, &scontrol); 3734 - if (rc) 3735 - return rc; 3736 - 3737 - switch (policy) { 3738 - case ATA_LPM_MAX_POWER: 3739 - /* disable all LPM transitions */ 3740 - scontrol |= (0x7 << 8); 3741 - /* initiate transition to active state */ 3742 - if (spm_wakeup) { 3743 - scontrol |= (0x4 << 12); 3744 - woken_up = true; 3745 - } 3746 - break; 3747 - case ATA_LPM_MED_POWER: 3748 - /* allow LPM to PARTIAL */ 3749 - scontrol &= ~(0x1 << 8); 3750 - scontrol |= (0x6 << 8); 3751 - break; 3752 - case ATA_LPM_MED_POWER_WITH_DIPM: 3753 - case ATA_LPM_MIN_POWER_WITH_PARTIAL: 3754 - case ATA_LPM_MIN_POWER: 3755 - if (ata_link_nr_enabled(link) > 0) 3756 - /* no restrictions on LPM transitions */ 3757 - scontrol &= ~(0x7 << 8); 3758 - else { 3759 - /* empty port, power off */ 3760 - scontrol &= ~0xf; 3761 - scontrol |= (0x1 << 2); 3762 - } 3763 - break; 3764 - default: 3765 - WARN_ON(1); 3766 - } 3767 - 3768 - rc = sata_scr_write(link, SCR_CONTROL, scontrol); 3769 - if (rc) 3770 - return rc; 3771 - 3772 - /* give the link time to transit out of LPM state */ 3773 - if (woken_up) 3774 - msleep(10); 3775 - 3776 - /* clear PHYRDY_CHG from SError */ 3777 - ehc->i.serror &= ~SERR_PHYRDY_CHG; 3778 - return sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); 3779 - } 3780 - EXPORT_SYMBOL_GPL(sata_link_scr_lpm); 3781 - 3782 - /** 3783 3783 * ata_std_prereset - prepare for reset 3784 3784 * @link: ATA link to be reset 3785 3785 * @deadline: deadline jiffies for the operation ··· 5968 6118 } 5969 6119 EXPORT_SYMBOL_GPL(ata_host_alloc_pinfo); 5970 6120 5971 - /** 5972 - * ata_slave_link_init - initialize slave link 5973 - * @ap: port to initialize slave link for 5974 - * 5975 - * Create and initialize slave link for @ap. This enables slave 5976 - * link handling on the port. 5977 - * 5978 - * In libata, a port contains links and a link contains devices. 5979 - * There is single host link but if a PMP is attached to it, 5980 - * there can be multiple fan-out links. On SATA, there's usually 5981 - * a single device connected to a link but PATA and SATA 5982 - * controllers emulating TF based interface can have two - master 5983 - * and slave. 5984 - * 5985 - * However, there are a few controllers which don't fit into this 5986 - * abstraction too well - SATA controllers which emulate TF 5987 - * interface with both master and slave devices but also have 5988 - * separate SCR register sets for each device. These controllers 5989 - * need separate links for physical link handling 5990 - * (e.g. onlineness, link speed) but should be treated like a 5991 - * traditional M/S controller for everything else (e.g. command 5992 - * issue, softreset). 5993 - * 5994 - * slave_link is libata's way of handling this class of 5995 - * controllers without impacting core layer too much. For 5996 - * anything other than physical link handling, the default host 5997 - * link is used for both master and slave. For physical link 5998 - * handling, separate @ap->slave_link is used. All dirty details 5999 - * are implemented inside libata core layer. From LLD's POV, the 6000 - * only difference is that prereset, hardreset and postreset are 6001 - * called once more for the slave link, so the reset sequence 6002 - * looks like the following. 6003 - * 6004 - * prereset(M) -> prereset(S) -> hardreset(M) -> hardreset(S) -> 6005 - * softreset(M) -> postreset(M) -> postreset(S) 6006 - * 6007 - * Note that softreset is called only for the master. Softreset 6008 - * resets both M/S by definition, so SRST on master should handle 6009 - * both (the standard method will work just fine). 6010 - * 6011 - * LOCKING: 6012 - * Should be called before host is registered. 6013 - * 6014 - * RETURNS: 6015 - * 0 on success, -errno on failure. 6016 - */ 6017 - int ata_slave_link_init(struct ata_port *ap) 6018 - { 6019 - struct ata_link *link; 6020 - 6021 - WARN_ON(ap->slave_link); 6022 - WARN_ON(ap->flags & ATA_FLAG_PMP); 6023 - 6024 - link = kzalloc(sizeof(*link), GFP_KERNEL); 6025 - if (!link) 6026 - return -ENOMEM; 6027 - 6028 - ata_link_init(ap, link, 1); 6029 - ap->slave_link = link; 6030 - return 0; 6031 - } 6032 - EXPORT_SYMBOL_GPL(ata_slave_link_init); 6033 - 6034 6121 static void ata_host_stop(struct device *gendev, void *res) 6035 6122 { 6036 6123 struct ata_host *host = dev_get_drvdata(gendev); ··· 6892 7105 return tmp; 6893 7106 } 6894 7107 EXPORT_SYMBOL_GPL(ata_wait_register); 6895 - 6896 - /** 6897 - * sata_lpm_ignore_phy_events - test if PHY event should be ignored 6898 - * @link: Link receiving the event 6899 - * 6900 - * Test whether the received PHY event has to be ignored or not. 6901 - * 6902 - * LOCKING: 6903 - * None: 6904 - * 6905 - * RETURNS: 6906 - * True if the event has to be ignored. 6907 - */ 6908 - bool sata_lpm_ignore_phy_events(struct ata_link *link) 6909 - { 6910 - unsigned long lpm_timeout = link->last_lpm_change + 6911 - msecs_to_jiffies(ATA_TMOUT_SPURIOUS_PHY); 6912 - 6913 - /* if LPM is enabled, PHYRDY doesn't mean anything */ 6914 - if (link->lpm_policy > ATA_LPM_MAX_POWER) 6915 - return true; 6916 - 6917 - /* ignore the first PHY event after the LPM policy changed 6918 - * as it is might be spurious 6919 - */ 6920 - if ((link->flags & ATA_LFLAG_CHANGED) && 6921 - time_before(jiffies, lpm_timeout)) 6922 - return true; 6923 - 6924 - return false; 6925 - } 6926 - EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events); 6927 7108 6928 7109 /* 6929 7110 * Dummy port_ops
+258
drivers/ata/libata-sata.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * SATA specific part of ATA helper library 4 + * 5 + * Copyright 2003-2004 Red Hat, Inc. All rights reserved. 6 + * Copyright 2003-2004 Jeff Garzik 7 + */ 8 + 9 + #include <linux/kernel.h> 10 + #include <linux/module.h> 11 + #include <linux/libata.h> 12 + 13 + #include "libata.h" 14 + 15 + /** 16 + * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 17 + * @tf: Taskfile to convert 18 + * @pmp: Port multiplier port 19 + * @is_cmd: This FIS is for command 20 + * @fis: Buffer into which data will output 21 + * 22 + * Converts a standard ATA taskfile to a Serial ATA 23 + * FIS structure (Register - Host to Device). 24 + * 25 + * LOCKING: 26 + * Inherited from caller. 27 + */ 28 + void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) 29 + { 30 + fis[0] = 0x27; /* Register - Host to Device FIS */ 31 + fis[1] = pmp & 0xf; /* Port multiplier number*/ 32 + if (is_cmd) 33 + fis[1] |= (1 << 7); /* bit 7 indicates Command FIS */ 34 + 35 + fis[2] = tf->command; 36 + fis[3] = tf->feature; 37 + 38 + fis[4] = tf->lbal; 39 + fis[5] = tf->lbam; 40 + fis[6] = tf->lbah; 41 + fis[7] = tf->device; 42 + 43 + fis[8] = tf->hob_lbal; 44 + fis[9] = tf->hob_lbam; 45 + fis[10] = tf->hob_lbah; 46 + fis[11] = tf->hob_feature; 47 + 48 + fis[12] = tf->nsect; 49 + fis[13] = tf->hob_nsect; 50 + fis[14] = 0; 51 + fis[15] = tf->ctl; 52 + 53 + fis[16] = tf->auxiliary & 0xff; 54 + fis[17] = (tf->auxiliary >> 8) & 0xff; 55 + fis[18] = (tf->auxiliary >> 16) & 0xff; 56 + fis[19] = (tf->auxiliary >> 24) & 0xff; 57 + } 58 + EXPORT_SYMBOL_GPL(ata_tf_to_fis); 59 + 60 + /** 61 + * ata_tf_from_fis - Convert SATA FIS to ATA taskfile 62 + * @fis: Buffer from which data will be input 63 + * @tf: Taskfile to output 64 + * 65 + * Converts a serial ATA FIS structure to a standard ATA taskfile. 66 + * 67 + * LOCKING: 68 + * Inherited from caller. 69 + */ 70 + 71 + void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf) 72 + { 73 + tf->command = fis[2]; /* status */ 74 + tf->feature = fis[3]; /* error */ 75 + 76 + tf->lbal = fis[4]; 77 + tf->lbam = fis[5]; 78 + tf->lbah = fis[6]; 79 + tf->device = fis[7]; 80 + 81 + tf->hob_lbal = fis[8]; 82 + tf->hob_lbam = fis[9]; 83 + tf->hob_lbah = fis[10]; 84 + 85 + tf->nsect = fis[12]; 86 + tf->hob_nsect = fis[13]; 87 + } 88 + EXPORT_SYMBOL_GPL(ata_tf_from_fis); 89 + 90 + /** 91 + * sata_link_scr_lpm - manipulate SControl IPM and SPM fields 92 + * @link: ATA link to manipulate SControl for 93 + * @policy: LPM policy to configure 94 + * @spm_wakeup: initiate LPM transition to active state 95 + * 96 + * Manipulate the IPM field of the SControl register of @link 97 + * according to @policy. If @policy is ATA_LPM_MAX_POWER and 98 + * @spm_wakeup is %true, the SPM field is manipulated to wake up 99 + * the link. This function also clears PHYRDY_CHG before 100 + * returning. 101 + * 102 + * LOCKING: 103 + * EH context. 104 + * 105 + * RETURNS: 106 + * 0 on success, -errno otherwise. 107 + */ 108 + int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, 109 + bool spm_wakeup) 110 + { 111 + struct ata_eh_context *ehc = &link->eh_context; 112 + bool woken_up = false; 113 + u32 scontrol; 114 + int rc; 115 + 116 + rc = sata_scr_read(link, SCR_CONTROL, &scontrol); 117 + if (rc) 118 + return rc; 119 + 120 + switch (policy) { 121 + case ATA_LPM_MAX_POWER: 122 + /* disable all LPM transitions */ 123 + scontrol |= (0x7 << 8); 124 + /* initiate transition to active state */ 125 + if (spm_wakeup) { 126 + scontrol |= (0x4 << 12); 127 + woken_up = true; 128 + } 129 + break; 130 + case ATA_LPM_MED_POWER: 131 + /* allow LPM to PARTIAL */ 132 + scontrol &= ~(0x1 << 8); 133 + scontrol |= (0x6 << 8); 134 + break; 135 + case ATA_LPM_MED_POWER_WITH_DIPM: 136 + case ATA_LPM_MIN_POWER_WITH_PARTIAL: 137 + case ATA_LPM_MIN_POWER: 138 + if (ata_link_nr_enabled(link) > 0) 139 + /* no restrictions on LPM transitions */ 140 + scontrol &= ~(0x7 << 8); 141 + else { 142 + /* empty port, power off */ 143 + scontrol &= ~0xf; 144 + scontrol |= (0x1 << 2); 145 + } 146 + break; 147 + default: 148 + WARN_ON(1); 149 + } 150 + 151 + rc = sata_scr_write(link, SCR_CONTROL, scontrol); 152 + if (rc) 153 + return rc; 154 + 155 + /* give the link time to transit out of LPM state */ 156 + if (woken_up) 157 + msleep(10); 158 + 159 + /* clear PHYRDY_CHG from SError */ 160 + ehc->i.serror &= ~SERR_PHYRDY_CHG; 161 + return sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); 162 + } 163 + EXPORT_SYMBOL_GPL(sata_link_scr_lpm); 164 + 165 + /** 166 + * ata_slave_link_init - initialize slave link 167 + * @ap: port to initialize slave link for 168 + * 169 + * Create and initialize slave link for @ap. This enables slave 170 + * link handling on the port. 171 + * 172 + * In libata, a port contains links and a link contains devices. 173 + * There is single host link but if a PMP is attached to it, 174 + * there can be multiple fan-out links. On SATA, there's usually 175 + * a single device connected to a link but PATA and SATA 176 + * controllers emulating TF based interface can have two - master 177 + * and slave. 178 + * 179 + * However, there are a few controllers which don't fit into this 180 + * abstraction too well - SATA controllers which emulate TF 181 + * interface with both master and slave devices but also have 182 + * separate SCR register sets for each device. These controllers 183 + * need separate links for physical link handling 184 + * (e.g. onlineness, link speed) but should be treated like a 185 + * traditional M/S controller for everything else (e.g. command 186 + * issue, softreset). 187 + * 188 + * slave_link is libata's way of handling this class of 189 + * controllers without impacting core layer too much. For 190 + * anything other than physical link handling, the default host 191 + * link is used for both master and slave. For physical link 192 + * handling, separate @ap->slave_link is used. All dirty details 193 + * are implemented inside libata core layer. From LLD's POV, the 194 + * only difference is that prereset, hardreset and postreset are 195 + * called once more for the slave link, so the reset sequence 196 + * looks like the following. 197 + * 198 + * prereset(M) -> prereset(S) -> hardreset(M) -> hardreset(S) -> 199 + * softreset(M) -> postreset(M) -> postreset(S) 200 + * 201 + * Note that softreset is called only for the master. Softreset 202 + * resets both M/S by definition, so SRST on master should handle 203 + * both (the standard method will work just fine). 204 + * 205 + * LOCKING: 206 + * Should be called before host is registered. 207 + * 208 + * RETURNS: 209 + * 0 on success, -errno on failure. 210 + */ 211 + int ata_slave_link_init(struct ata_port *ap) 212 + { 213 + struct ata_link *link; 214 + 215 + WARN_ON(ap->slave_link); 216 + WARN_ON(ap->flags & ATA_FLAG_PMP); 217 + 218 + link = kzalloc(sizeof(*link), GFP_KERNEL); 219 + if (!link) 220 + return -ENOMEM; 221 + 222 + ata_link_init(ap, link, 1); 223 + ap->slave_link = link; 224 + return 0; 225 + } 226 + EXPORT_SYMBOL_GPL(ata_slave_link_init); 227 + 228 + /** 229 + * sata_lpm_ignore_phy_events - test if PHY event should be ignored 230 + * @link: Link receiving the event 231 + * 232 + * Test whether the received PHY event has to be ignored or not. 233 + * 234 + * LOCKING: 235 + * None: 236 + * 237 + * RETURNS: 238 + * True if the event has to be ignored. 239 + */ 240 + bool sata_lpm_ignore_phy_events(struct ata_link *link) 241 + { 242 + unsigned long lpm_timeout = link->last_lpm_change + 243 + msecs_to_jiffies(ATA_TMOUT_SPURIOUS_PHY); 244 + 245 + /* if LPM is enabled, PHYRDY doesn't mean anything */ 246 + if (link->lpm_policy > ATA_LPM_MAX_POWER) 247 + return true; 248 + 249 + /* ignore the first PHY event after the LPM policy changed 250 + * as it is might be spurious 251 + */ 252 + if ((link->flags & ATA_LFLAG_CHANGED) && 253 + time_before(jiffies, lpm_timeout)) 254 + return true; 255 + 256 + return false; 257 + } 258 + EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
+10 -6
include/linux/libata.h
··· 1082 1082 const unsigned long *params, unsigned long deadline); 1083 1083 extern int sata_link_resume(struct ata_link *link, const unsigned long *params, 1084 1084 unsigned long deadline); 1085 - extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, 1086 - bool spm_wakeup); 1087 1085 extern int sata_link_hardreset(struct ata_link *link, 1088 1086 const unsigned long *timing, unsigned long deadline, 1089 1087 bool *online, int (*check_ready)(struct ata_link *)); ··· 1092 1094 extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); 1093 1095 extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, 1094 1096 const struct ata_port_info * const * ppi, int n_ports); 1095 - extern int ata_slave_link_init(struct ata_port *ap); 1096 1097 extern void ata_host_get(struct ata_host *host); 1097 1098 extern void ata_host_put(struct ata_host *host); 1098 1099 extern int ata_host_start(struct ata_host *host); ··· 1149 1152 extern u32 ata_wait_register(struct ata_port *ap, void __iomem *reg, u32 mask, 1150 1153 u32 val, unsigned long interval, unsigned long timeout); 1151 1154 extern int atapi_cmd_type(u8 opcode); 1152 - extern void ata_tf_to_fis(const struct ata_taskfile *tf, 1153 - u8 pmp, int is_cmd, u8 *fis); 1154 - extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 1155 1155 extern unsigned long ata_pack_xfermask(unsigned long pio_mask, 1156 1156 unsigned long mwdma_mask, unsigned long udma_mask); 1157 1157 extern void ata_unpack_xfermask(unsigned long xfer_mask, ··· 1189 1195 extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); 1190 1196 extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); 1191 1197 extern void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, struct list_head *eh_q); 1198 + 1199 + /* 1200 + * SATA specific code - drivers/ata/libata-sata.c 1201 + */ 1202 + extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, 1203 + bool spm_wakeup); 1204 + extern int ata_slave_link_init(struct ata_port *ap); 1205 + extern void ata_tf_to_fis(const struct ata_taskfile *tf, 1206 + u8 pmp, int is_cmd, u8 *fis); 1207 + extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 1192 1208 extern bool sata_lpm_ignore_phy_events(struct ata_link *link); 1193 1209 1194 1210 extern int ata_cable_40wire(struct ata_port *ap);