Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Aug 2009 15:06:03 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196655 - head/sys/dev/siis
Message-ID:  <200908301506.n7UF63mp098220@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Aug 30 15:06:03 2009
New Revision: 196655
URL: http://svn.freebsd.org/changeset/base/196655

Log:
  MFp4:
   - Add SNTF support.
   - Do not report meaningless transport/protocol versions.

Modified:
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Sun Aug 30 14:45:09 2009	(r196654)
+++ head/sys/dev/siis/siis.c	Sun Aug 30 15:06:03 2009	(r196655)
@@ -647,6 +647,30 @@ siis_slotsfree(device_t dev)
 }
 
 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 @@ siis_ch_intr(void *data)
 	/* 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);
@@ -1267,7 +1294,6 @@ siis_reset(device_t dev)
 		/* XXX; Commands in loading state. */
 		siis_end_transaction(&ch->slot[i], SIIS_ERR_INNOCENT);
 	}
-	ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME);
 	/* Reset and reconnect PHY, */
 	if (!siis_sata_phy_reset(dev)) {
 		ch->devices = 0;
@@ -1461,9 +1487,9 @@ siisaction(struct cam_sim *sim, union cc
 		uint32_t status;
 
 		cts->protocol = PROTO_ATA;
-		cts->protocol_version = SCSI_REV_2;
+		cts->protocol_version = PROTO_VERSION_UNSPECIFIED;
 		cts->transport = XPORT_SATA;
-		cts->transport_version = 2;
+		cts->transport_version = XPORT_VERSION_UNSPECIFIED;
 		cts->proto_specific.valid = 0;
 		cts->xport_specific.sata.valid = 0;
 		if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
@@ -1548,9 +1574,9 @@ siisaction(struct cam_sim *sim, union cc
 		strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
 		cpi->unit_number = cam_sim_unit(sim);
 		cpi->transport = XPORT_SATA;
-		cpi->transport_version = 2;
+		cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
 		cpi->protocol = PROTO_ATA;
-		cpi->protocol_version = SCSI_REV_2;
+		cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
 		cpi->ccb_h.status = CAM_REQ_CMP;
 		cpi->maxio = MAXPHYS;
 		xpt_done(ccb);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908301506.n7UF63mp098220>