dev/firewire updates

Sean Bruno <[email protected]>
Newsgroups gmane.os.freebsd.devel.firewire
Message-ID <[email protected]>
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

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-firewire
To unsubscribe, send any mail to "[email protected]"
firewire.h.diff (text/x-patch, 1.7 KB)
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
fwohci.c.diff (text/x-patch, 637 B)
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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.