i386/155441: Firewire support in loader is broken

Andreas Longwitz longwitz at incore.de
Thu Mar 10 16:10:12 UTC 2011


>Number:         155441
>Category:       i386
>Synopsis:       Firewire support in loader is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 10 16:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Longwitz
>Release:        8.1-RELEASE-p1
>Organization:
Data Service Stockelsdorf
>Environment:
FreeBSD pclong.incore 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #3: Mon Feb 14 14:47:50 CET 2011     root at pclong.incore:/usr/src/sys/i386/compile/PCLONG  i386
>Description:
With LOADER_FIREWIRE_SUPPORT=yes the loader includes firewire support.
In /usr/src/sys/boot/i386/libfirewire/firewire.c the call of the function biospci_write_config is not correct (the second and third parameter must be swapped). Some hardware complains about this, some do not.
Also only the first firewire device is supported - in my opinion unnecessarily.
>How-To-Repeat:
Try to use the loader over firewire.
>Fix:


Patch attached with submission follows:

--- /usr/src/sys/boot/i386/libfirewire/firewire.c.orig	2010-06-14 04:09:06.000000000 +0200
+++ /usr/src/sys/boot/i386/libfirewire/firewire.c	2011-02-07 14:40:15.000000000 +0100
@@ -105,10 +105,14 @@
 		return;
 	}
 
-	biospci_write_config(sc->locator,
+	err = biospci_write_config(sc->locator,
 		0x4	/* command */,
-		0x6	/* enable bus master and memory mapped I/O */,
-		1	/* word */);
+		1	/* word */,
+		0x6	/* enable bus master and memory mapped I/O */);
+	if (err != 0) {
+		sc->state = FWOHCI_STATE_DEAD;
+		return;
+	}
 
 	biospci_read_config(sc->locator, 0x00 /*devid*/, 2 /*dword*/,
 		&sc->devid);
@@ -135,9 +139,9 @@
 		sc = &fwinfo[i];
 		fw_probe(i, sc);
 		if (sc->state == FWOHCI_STATE_DEAD)
-			break;
+			continue;
 		avail ++;
-			break;
+			continue;
 	}
 	fw_initialized = 1;
 
@@ -157,7 +161,7 @@
 	for (i = 0; i < MAX_OHCI; i ++) {
 		sc = &fwinfo[i];
 		if (sc->state == FWOHCI_STATE_DEAD)
-			break;
+			continue;
 		printf("%d: locator=0x%04x devid=0x%08x"
 			" base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n",
 			i, sc->locator, sc->devid,
@@ -360,7 +364,7 @@
 	for (i = 0; i < MAX_OHCI; i ++) {
 		sc = &fwinfo[i];
 		if (sc->state != FWOHCI_STATE_INIT)
-			break;
+			continue;
 
 		sc->config_rom = (uint32_t *)
 			(((uint32_t)sc->config_rom_buf
@@ -389,7 +393,7 @@
 	for (i = 0; i < MAX_OHCI; i ++) {
 		sc = &fwinfo[i];
 		if (sc->state < FWOHCI_STATE_ENABLED)
-			break;
+			continue;
 		fwohci_poll(sc);
 	}
 }
@@ -404,7 +408,7 @@
 	for (i = 0; i < MAX_OHCI; i ++) {
 		sc = &fwinfo[i];
 		if (sc->state < FWOHCI_STATE_INIT)
-			break;
+			continue;
 		fw_busreset(sc);
 	}
 	return(CMD_OK);


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list