• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/ata/

Lines Matching defs:link

25  *	@link: link to read PMP register for
37 static unsigned int sata_pmp_read(struct ata_link *link, int reg, u32 *r_val)
39 struct ata_port *ap = link->ap;
40 struct ata_device *pmp_dev = ap->link.device;
49 tf.device = link->pmp;
62 * @link: link to write PMP register for
74 static unsigned int sata_pmp_write(struct ata_link *link, int reg, u32 val)
76 struct ata_port *ap = link->ap;
77 struct ata_device *pmp_dev = ap->link.device;
85 tf.device = link->pmp;
110 struct ata_link *link = qc->dev->link;
111 struct ata_port *ap = link->ap;
113 if (ap->excl_link == NULL || ap->excl_link == link) {
114 if (ap->nr_active_links == 0 || ata_link_active(link)) {
119 ap->excl_link = link;
127 * @link: ATA link to read PSCR for
131 * Read PSCR @reg into @r_val for @link, to be called from
140 int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *r_val)
147 err_mask = sata_pmp_read(link, reg, r_val);
149 ata_link_printk(link, KERN_WARNING, "failed to read SCR %d "
158 * @link: ATA link to write PSCR for
162 * Write @val to PSCR @reg for @link, to be called from
171 int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val)
178 err_mask = sata_pmp_write(link, reg, val);
180 ata_link_printk(link, KERN_WARNING, "failed to write SCR %d "
210 err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]);
238 struct ata_port *ap = dev->link->ap;
259 err_mask = sata_pmp_write(dev->link, SATA_PMP_GSCR_ERROR_EN,
276 err_mask = sata_pmp_read(&ap->link, PMP_GSCR_SII_POL, &reg);
283 err_mask = sata_pmp_write(&ap->link, PMP_GSCR_SII_POL, reg);
333 struct ata_link *link = &pmp_link[i];
334 struct ata_eh_context *ehc = &link->eh_context;
336 link->flags = 0;
346 u32 *gscr = ap->link.device->gscr;
349 struct ata_link *link;
353 ata_for_each_link(link, ap, EDGE) {
357 if (link->pmp < 5)
358 link->flags |= ATA_LFLAG_NO_SRST |
362 if (link->pmp == 5)
363 link->flags |= ATA_LFLAG_NO_SRST |
368 ata_for_each_link(link, ap, EDGE) {
370 if (link->pmp < 2)
371 link->flags |= ATA_LFLAG_ASSUME_ATA;
374 if (link->pmp == 2)
375 link->flags |= ATA_LFLAG_NO_SRST |
380 ata_for_each_link(link, ap, EDGE) {
386 if (link->pmp <= 5)
387 link->flags |= ATA_LFLAG_NO_SRST |
393 if (link->pmp == 6)
394 link->flags |= ATA_LFLAG_NO_SRST |
426 struct ata_link *link = dev->link;
427 struct ata_port *ap = link->ap;
439 if (!ata_is_host_link(link)) {
451 WARN_ON(link->pmp != 0);
452 link->pmp = SATA_PMP_CTRL_PORT;
490 link->pmp = 0;
506 struct ata_link *link = dev->link;
507 struct ata_port *ap = link->ap;
513 WARN_ON(!ata_is_host_link(link) || dev->devno ||
514 link->pmp != SATA_PMP_CTRL_PORT);
524 link->pmp = 0;
597 struct ata_link *link = dev->link;
598 struct ata_port *ap = link->ap;
604 ata_eh_about_to_do(link, NULL, ATA_EH_REVALIDATE);
634 ata_eh_done(link, NULL, ATA_EH_REVALIDATE);
663 err_mask = sata_pmp_read(dev->link, SATA_PMP_GSCR_PROD_ID, &prod_id);
702 struct ata_link *link = &ap->link;
703 struct ata_eh_context *ehc = &link->eh_context;
704 struct ata_device *dev = link->device;
723 rc = ata_eh_reset(link, 0, prereset, softreset, hardreset,
726 ata_link_printk(link, KERN_ERR,
761 sata_down_spd_limit(link, 0);
794 struct ata_link *link;
800 ata_for_each_link(link, ap, EDGE) {
801 if (!(link->flags & ATA_LFLAG_DISABLED))
809 sata_link_hardreset(link, sata_deb_timing_normal,
814 rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG);
816 ata_link_printk(link, KERN_ERR, "failed to clear "
829 static int sata_pmp_handle_link_fail(struct ata_link *link, int *link_tries)
831 struct ata_port *ap = link->ap;
834 if (link_tries[link->pmp] && --link_tries[link->pmp])
837 /* disable this link */
838 if (!(link->flags & ATA_LFLAG_DISABLED)) {
839 ata_link_printk(link, KERN_WARNING,
840 "failed to recover link after %d tries, disabling\n",
844 link->flags |= ATA_LFLAG_DISABLED;
848 ata_dev_disable(link->device);
849 link->eh_context.i.action = 0;
873 struct ata_link *pmp_link = &ap->link;
877 struct ata_link *link;
884 ata_for_each_link(link, ap, EDGE)
885 link_tries[link->pmp] = ATA_EH_PMP_LINK_TRIES;
893 ata_for_each_dev(dev, &ap->link, ALL)
902 ata_for_each_link(link, ap, EDGE)
903 link_tries[link->pmp] = ATA_EH_PMP_LINK_TRIES;
937 ops->pmp_hardreset, ops->pmp_postreset, &link);
946 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf);
948 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf);
974 ata_for_each_link(link, ap, EDGE) {
975 if (!(gscr_error & (1 << link->pmp)))
978 if (sata_pmp_handle_link_fail(link, link_tries)) {
979 ata_ehi_hotplugged(&link->eh_context.i);
982 ata_link_printk(link, KERN_WARNING,
985 ata_link_printk(link, KERN_WARNING,
986 "Manully issue scan to resume this link\n");
999 if (sata_pmp_handle_link_fail(link, link_tries)) {