Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2009 10:03:42 -0800
From:      Sean Bruno <sean.bruno@dsl-only.net>
To:        freebsd-firewire@FreeBSD.org
Cc:        scottl <scottl@freebsd.org>
Subject:   SelfID Enhancements
Message-ID:  <1234893822.7648.3.camel@localhost.localdomain>

next in thread | raw e-mail | index | archive | help

--=-N3PRuzhvb6gLVy6BdUfj
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This patch implements 1394a-2000 extended SelfID PHY packets.

Also, cull the "PHY DELAY" Self ID Field as this has been deprecated by
specification.  It was never implemented in the firewire stack to begin
with.



--=-N3PRuzhvb6gLVy6BdUfj
Content-Disposition: attachment; filename="firewire.diff"
Content-Type: text/x-patch; name="firewire.diff"; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Index: firewire.c
===================================================================
--- firewire.c	(revision 188722)
+++ firewire.c	(working copy)
@@ -31,7 +31,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  * 
- * $FreeBSD$
+ * $FreeBSD: head/sys/dev/firewire/firewire.c 188704 2009-02-17 04:08:08Z sbruno $
  *
  */
 
@@ -1270,12 +1270,29 @@
 {
 	union fw_self_id *s;
 	s = (union fw_self_id *) &sid;
-	printf("node:%d link:%d gap:%d spd:%d del:%d con:%d pwr:%d"
-		" p0:%d p1:%d p2:%d i:%d m:%d\n",
-		s->p0.phy_id, s->p0.link_active, s->p0.gap_count,
-		s->p0.phy_speed, s->p0.phy_delay, s->p0.contender,
-		s->p0.power_class, s->p0.port0, s->p0.port1,
-		s->p0.port2, s->p0.initiated_reset, s->p0.more_packets);
+	if ( s->p0.sequel ) {
+		if ( s->p1.sequence_num == FW_SELF_ID_PAGE0 ) {
+			printf("node:%d p3:%d p4:%d p5:%d p6:%d p7:%d"
+				"p8:%d p9:%d p10:%d\n",
+				s->p1.phy_id, s->p1.port3, s->p1.port4,
+				s->p1.port5, s->p1.port6, s->p1.port7,
+				s->p1.port8, s->p1.port9, s->p1.port10);
+		} else if (s->p2.sequence_num == FW_SELF_ID_PAGE1 ){
+			printf("node:%d p11:%d p12:%d p13:%d p14:%d p15:%d\n",
+				s->p2.phy_id, s->p2.port11, s->p2.port12,
+				s->p2.port13, s->p2.port14, s->p2.port15);
+		} else {
+			printf("node:%d Unknown Self ID Page number %d\n",
+				s->p1.phy_id, s->p1.sequence_num);
+		}
+	} else {
+		printf("node:%d link:%d gap:%d spd:%d con:%d pwr:%d"
+			" p0:%d p1:%d p2:%d i:%d m:%d\n",
+			s->p0.phy_id, s->p0.link_active, s->p0.gap_count,
+			s->p0.phy_speed, s->p0.contender,
+			s->p0.power_class, s->p0.port0, s->p0.port1,
+			s->p0.port2, s->p0.initiated_reset, s->p0.more_packets);
+	}
 }
 
 /*
Index: firewire.h
===================================================================
--- firewire.h	(revision 188719)
+++ firewire.h	(working copy)
@@ -31,7 +31,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  * 
- * $FreeBSD$
+ * $FreeBSD: head/sys/dev/firewire/firewire.h 188585 2009-02-13 17:45:09Z sbruno $
  *
  */
 
@@ -292,6 +292,10 @@
 #define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2
 #define FW_SELF_ID_PORT_NOT_CONNECTED 1
 #define FW_SELF_ID_PORT_NOT_EXISTS 0
+
+#define FW_SELF_ID_PAGE0 0
+#define FW_SELF_ID_PAGE1 1
+
 #if BYTE_ORDER == BIG_ENDIAN
 union fw_self_id {
 	struct {
@@ -301,7 +305,7 @@
 			  link_active:1,
 			  gap_count:6,
 			  phy_speed:2,
-			  phy_delay:2,
+			  reserved:2,
 			  contender:1,
 			  power_class:3,
 			  port0:2,
@@ -353,7 +357,7 @@
 			  port0:2,
 			  power_class:3,
 			  contender:1,
-			  phy_delay:2,
+			  reserved:2,
 			  phy_speed:2,
 			  gap_count:6,
 			  link_active:1,

--=-N3PRuzhvb6gLVy6BdUfj--




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