Author: sbruno
Date: Tue Feb 17 19:37:04 2009
New Revision: 188726
URL: http://svn.freebsd.org/changeset/base/188726

Log:
  Introduce 1394a-2000 extended PHY Self ID packets.
  
  Deprecate unused phy_delay Self ID field as it was removed
  by 1394a-2000.
  
  Attempt to parse extended Self ID PHY packets if they are detected
  
  Reviewed by:  scottl (mentor)
  MFC after:    2 weeks

Modified:
  head/sys/dev/firewire/firewire.c
  head/sys/dev/firewire/firewire.h

Modified: head/sys/dev/firewire/firewire.c
==============================================================================
--- head/sys/dev/firewire/firewire.c    Tue Feb 17 19:17:25 2009        
(r188725)
+++ head/sys/dev/firewire/firewire.c    Tue Feb 17 19:37:04 2009        
(r188726)
@@ -1270,12 +1270,29 @@ fw_print_sid(uint32_t sid)
 {
        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);
+       }
 }
 
 /*

Modified: head/sys/dev/firewire/firewire.h
==============================================================================
--- head/sys/dev/firewire/firewire.h    Tue Feb 17 19:17:25 2009        
(r188725)
+++ head/sys/dev/firewire/firewire.h    Tue Feb 17 19:37:04 2009        
(r188726)
@@ -292,6 +292,10 @@ struct fw_devlstreq {
 #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 @@ union fw_self_id {
                          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 @@ union fw_self_id {
                          port0:2,
                          power_class:3,
                          contender:1,
-                         phy_delay:2,
+                         reserved:2,
                          phy_speed:2,
                          gap_count:6,
                          link_active:1,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to