Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 21:47:26 -0800
From:      Sean Bruno <sean.bruno@dsl-only.net>
To:        freebsd-firewire <freebsd-firewire@FreeBSD.org>
Cc:        scottl <scottl@freebsd.org>
Subject:   dev/firewire updates
Message-ID:  <1234504046.30696.189.camel@localhost.localdomain>

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

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

A couple of nits and an update to the SelfID packet Union.

fwohci.c -- duplicate while() deleted.  

firewire.h -- expand the SelfID packet union and rename unused variables
to conform the spec naming convention.

Sean

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

Index: firewire.h
===================================================================
--- firewire.h	(revision 188509)
+++ firewire.h	(working copy)
@@ -284,10 +284,10 @@
 	struct fw_devinfo dev[FW_MAX_DEVLST];
 };
 
-#define FW_SELF_ID_PORT_CONNECTED_TO_CHILD 3
-#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
+/*
+ * Defined in IEEE 1394a-2000
+ * 4.3.4.1
+ */
 #if BYTE_ORDER == BIG_ENDIAN
 union fw_self_id {
 	struct {
@@ -312,18 +312,32 @@
 			  phy_id:6,
 			  sequel:1,
 			  sequence_num:3,
-			  :2,
-			  porta:2,
-			  portb:2,
-			  portc:2,
-			  portd:2,
-			  porte:2,
-			  portf:2,
-			  portg:2,
-			  porth:2,
-			  :1,
+			  reserved2:2,
+			  port3:2,
+			  port4:2,
+			  port5:2,
+			  port6:2,
+			  port7:2,
+			  port8:2,
+			  port9:2,
+			  port10:2,
+			  reserved1:1,
 			  more_packets:1;
 	} p1;
+	struct {
+		uint32_t
+			  id:2,
+			  phy_id:6,
+			  sequel:1,
+			  sequence_num:3,
+			  :2,
+			  port11:2,
+			  port12:2,
+			  port13:2,
+			  port14:2,
+			  port15:2,
+			  :8;
+	} p2;
 };
 #else
 union fw_self_id {
@@ -346,20 +360,34 @@
 	struct {
 		uint32_t  more_packets:1,
 			  reserved1:1,
-			  porth:2,
-			  portg:2,
-			  portf:2,
-			  porte:2,
-			  portd:2,
-			  portc:2,
-			  portb:2,
-			  porta:2,
+			  port10:2,
+			  port9:2,
+			  port8:2,
+			  port7:2,
+			  port6:2,
+			  port5:2,
+			  port4:2,
+			  port3:2,
 			  reserved2:2,
 			  sequence_num:3,
 			  sequel:1,
 			  phy_id:6,
 			  id:2;
 	} p1;
+	struct {
+		uint32_t
+			  reserved3:8,
+			  port15:2,
+			  port14:2,
+			  port13:2,
+			  port12:2,
+			  port11:2,
+			  reserved4:2,
+			  sequence_num:3,
+			  sequel:1,
+			  phy_id:6,
+			  id:2;
+	} p2;
 };
 #endif
 

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

Index: fwohci.c
===================================================================
--- fwohci.c	(revision 188509)
+++ fwohci.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/fwohci.c 188509 2009-02-12 03:26:05Z sbruno $
  *
  */
 
@@ -2979,7 +2979,7 @@
 		db_tr = STAILQ_NEXT(db_tr, link);
 		resCount = FWOHCI_DMA_READ(db_tr->db[0].db.desc.res)
 						& OHCI_COUNT_MASK;
-	} while (resCount == 0)
+	}
 	printf(" done\n");
 	dbch->top = db_tr;
 	dbch->buf_offset = dbch->xferq.psize - resCount;

--=-pQ4Xt4QrHmbj2Exnznxe--




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