PERFORCE change 166555 for review
Alexander Motin
mav at FreeBSD.org
Sat Jul 25 14:19:48 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166555
Change 166555 by mav at mav_mavbook on 2009/07/25 14:19:15
Teach siis driver to report device async notifications.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#2 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#2 (text+ko) ====
@@ -647,6 +647,30 @@
}
static void
+siis_notify_events(device_t dev)
+{
+ struct siis_channel *ch = device_get_softc(dev);
+ struct cam_path *dpath;
+ u_int32_t status;
+ int i;
+
+ status = ATA_INL(ch->r_mem, SIIS_P_SNTF);
+ ATA_OUTL(ch->r_mem, SIIS_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
siis_phy_check_events(device_t dev)
{
struct siis_channel *ch = device_get_softc(dev);
@@ -707,6 +731,9 @@
/* Process PHY events */
if (istatus & SIIS_P_IX_PHYRDYCHG)
siis_phy_check_events(dev);
+ /* Process NOTIFY events */
+ if (istatus & SIIS_P_IX_SDBN)
+ siis_notify_events(dev);
/* Process command errors */
if (istatus & SIIS_P_IX_COMMERR) {
estatus = ATA_INL(ch->r_mem, SIIS_P_CMDERR);
More information about the p4-projects
mailing list