1ATA_SLAVE_LINK_INIT(9) libata Library ATA_SLAVE_LINK_INIT(9)
2
3
4
6 ata_slave_link_init - initialize slave link
7
9 int ata_slave_link_init(struct ata_port * ap);
10
12 ap
13 port to initialize slave link for
14
16 Create and initialize slave link for ap. This enables slave link
17 handling on the port.
18
19 In libata, a port contains links and a link contains devices. There is
20 single host link but if a PMP is attached to it, there can be multiple
21 fan-out links. On SATA, there's usually a single device connected to a
22 link but PATA and SATA controllers emulating TF based interface can
23 have two - master and slave.
24
25 However, there are a few controllers which don't fit into this
26 abstraction too well - SATA controllers which emulate TF interface with
27 both master and slave devices but also have separate SCR register sets
28 for each device. These controllers need separate links for physical
29 link handling (e.g. onlineness, link speed) but should be treated like
30 a traditional M/S controller for everything else (e.g. command issue,
31 softreset).
32
33 slave_link is libata's way of handling this class of controllers
34 without impacting core layer too much. For anything other than physical
35 link handling, the default host link is used for both master and slave.
36 For physical link handling, separate ap->slave_link is used. All dirty
37 details are implemented inside libata core layer. From LLD's POV, the
38 only difference is that prereset, hardreset and postreset are called
39 once more for the slave link, so the reset sequence looks like the
40 following.
41
42 prereset(M) -> prereset(S) -> hardreset(M) -> hardreset(S) ->
43 softreset(M) -> postreset(M) -> postreset(S)
44
45 Note that softreset is called only for the master. Softreset resets
46 both M/S by definition, so SRST on master should handle both (the
47 standard method will work just fine).
48
50 Should be called before host is registered.
51
53 0 on success, -errno on failure.
54
56 Jeff Garzik
57 Author.
58
60Kernel Hackers Manual 2.6. November 2011 ATA_SLAVE_LINK_INIT(9)