PERFORCE change 166655 for review

Alexander Motin mav at FreeBSD.org
Mon Jul 27 21:52:40 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166655

Change 166655 by mav at mav_mavbook on 2009/07/27 21:51:51

	Add SNTF support.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#47 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#47 (text+ko) ====

@@ -848,6 +848,31 @@
 }
 
 static void
+ahci_notify_events(device_t dev)
+{
+	struct ahci_channel *ch = device_get_softc(dev);
+	struct cam_path *dpath;
+	u_int32_t status;
+	int i;
+
+	status = ATA_INL(ch->r_mem, AHCI_P_SNTF);
+	if (status == 0)
+		return;
+	ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status);
+	if (bootverbose)
+		device_printf(dev, "SNTF 0x%04x\n", status);
+	for (i = 0; i < 16; i++) {
+		if ((status & (1 << i)) == 0)
+			continue;
+		if (xpt_create_path(&dpath, NULL,
+		    xpt_path_path_id(ch->path), i, 0) == CAM_REQ_CMP) {
+			xpt_async(AC_SCSI_AEN, dpath, NULL);
+			xpt_free_path(dpath);
+		}
+	}
+}
+
+static void
 ahci_ch_intr_locked(void *data)
 {
 	device_t dev = (device_t)data;
@@ -936,6 +961,9 @@
 		if (ncq_err)
 			ahci_issue_read_log(dev);
 	}
+	/* Process NOTIFY events */
+	if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF))
+		ahci_notify_events(dev);
 }
 
 /* Must be called with channel locked. */


More information about the p4-projects mailing list