PERFORCE change 136297 for review

Kip Macy kmacy at FreeBSD.org
Tue Feb 26 22:47:58 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=136297

Change 136297 by kmacy at kmacy:entropy:iwarp on 2008/02/26 22:47:34

	move remaining binaries in to blob headers to be compiled in to the firmware module

Affected files ...

.. //depot/projects/iwarp/sys/dev/cxgb/cxgb_main.c#20 edit
.. //depot/projects/iwarp/sys/dev/cxgb/cxgb_t3fw.c#2 edit
.. //depot/projects/iwarp/sys/dev/cxgb/t3b_protocol_sram-1.1.0.bin.gz.uu#2 delete
.. //depot/projects/iwarp/sys/dev/cxgb/t3b_protocol_sram.h#1 add
.. //depot/projects/iwarp/sys/dev/cxgb/t3b_tp_eeprom-1.1.0.bin.gz.uu#2 delete
.. //depot/projects/iwarp/sys/dev/cxgb/t3b_tp_eeprom.h#1 add

Differences ...

==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_main.c#20 (text+ko) ====

@@ -389,8 +389,8 @@
 }
 
 #define FW_FNAME "cxgb_t3fw"
-#define TPEEPROM_NAME "t3%ctpe%d%d%d"
-#define TPSRAM_NAME "t3%cps%d%d%d"
+#define TPEEPROM_NAME "t3b_tp_eeprom"
+#define TPSRAM_NAME "t3b_protocol_sram"
 
 static int
 upgrade_fw(adapter_t *sc)
@@ -1475,7 +1475,6 @@
 	struct firmware *tpeeprom;
 #endif
 
-	char buf[64];
 	uint32_t version;
 	unsigned int major, minor;
 	int ret, len;
@@ -1490,13 +1489,10 @@
 
 	rev = t3rev2char(adap);
 
-	snprintf(buf, sizeof(buf), TPEEPROM_NAME, rev,
-		 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
-
-	tpeeprom = firmware_get(buf);
+	tpeeprom = firmware_get(TPEEPROM_NAME);
 	if (tpeeprom == NULL) {
 		device_printf(adap->dev, "could not load TP EEPROM: unable to load %s\n",
-			buf);
+		    TPEEPROM_NAME);
 		return;
 	}
 
@@ -1507,7 +1503,7 @@
 		goto release_tpeeprom;
 
 	if (len != TP_SRAM_LEN) {
-		device_printf(adap->dev, "%s length is wrong len=%d expected=%d\n", buf, len, TP_SRAM_LEN);
+		device_printf(adap->dev, "%s length is wrong len=%d expected=%d\n", TPEEPROM_NAME, len, TP_SRAM_LEN);
 		return;
 	}
 	
@@ -1535,7 +1531,6 @@
 #else
 	struct firmware *tpsram;
 #endif	
-	char buf[64];
 	int ret;
 	char rev;
 
@@ -1545,16 +1540,12 @@
 
 	update_tpeeprom(adap);
 
-	snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
-		 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
-
-	tpsram = firmware_get(buf);
+	tpsram = firmware_get(TPSRAM_NAME);
 	if (tpsram == NULL){
-		device_printf(adap->dev, "could not load TP SRAM: unable to load %s\n",
-			buf);
+		device_printf(adap->dev, "could not load TP SRAM\n");
 		return (EINVAL);
 	} else
-		device_printf(adap->dev, "updating TP SRAM with %s\n", buf);
+		device_printf(adap->dev, "updating TP SRAM\n");
 	
 	ret = t3_check_tpsram(adap, tpsram->data, tpsram->datasize);
 	if (ret)

==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_t3fw.c#2 (text+ko) ====

@@ -11,6 +11,8 @@
 #include <sys/firmware.h>
 #include <sys/systm.h>
 #include <dev/cxgb/cxgb_t3fw.h>
+#include <dev/cxgb/t3b_protocol_sram.h>
+#include <dev/cxgb/t3b_tp_eeprom.h>
 
 static int
 cxgb_t3fw_modevent(module_t mod, int type, void *unused)
@@ -45,3 +47,69 @@
 MODULE_VERSION(cxgb_t3fw, 1);
 MODULE_DEPEND(cxgb_t3fw, firmware, 1, 1, 1);
 
+static int
+cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused)
+{
+	const struct firmware *fp, *parent;
+	int error;
+	switch (type) {
+	case MOD_LOAD:
+
+		fp = firmware_register("cxgb_t3b_protocol_sram", t3b_protocol_sram, 
+				       (size_t)t3b_protocol_sram_length,
+				       0, NULL);
+		if (fp == NULL)
+			goto fail_0;
+		parent = fp;
+		return (0);
+	fail_0:
+		return (ENXIO);
+	case MOD_UNLOAD:
+		error = firmware_unregister("cxgb_t3b_protocol_sram");
+		return (error);
+	}
+	return (EINVAL);
+}
+
+static moduledata_t cxgb_t3b_protocol_sram_mod = {
+        "cxgb_t3b_protocol_sram",
+        cxgb_t3b_protocol_sram_modevent,
+        0
+};
+DECLARE_MODULE(cxgb_t3b_protocol_sram, cxgb_t3b_protocol_sram_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
+MODULE_VERSION(cxgb_t3b_protocol_sram, 1);
+MODULE_DEPEND(cxgb_t3b_protocol_sram, firmware, 1, 1, 1);
+
+
+static int
+cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
+{
+	const struct firmware *fp, *parent;
+	int error;
+	switch (type) {
+	case MOD_LOAD:
+
+		fp = firmware_register("cxgb_t3b_tp_eeprom", t3b_tp_eeprom, 
+				       (size_t)t3b_tp_eeprom_length,
+				       0, NULL);
+		if (fp == NULL)
+			goto fail_0;
+		parent = fp;
+		return (0);
+	fail_0:
+		return (ENXIO);
+	case MOD_UNLOAD:
+		error = firmware_unregister("cxgb_t3b_tp_eeprom");
+		return (error);
+	}
+	return (EINVAL);
+}
+
+static moduledata_t cxgb_t3b_tp_eeprom_mod = {
+        "cxgb_t3b_tp_eeprom",
+        cxgb_t3b_tp_eeprom_modevent,
+        0
+};
+DECLARE_MODULE(cxgb_t3b_tp_eeprom, cxgb_t3b_tp_eeprom_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
+MODULE_VERSION(cxgb_t3b_tp_eeprom, 1);
+MODULE_DEPEND(cxgb_t3b_tp_eeprom, firmware, 1, 1, 1);


More information about the p4-projects mailing list