PERFORCE change 135790 for review
Sepherosa Ziehau
sephe at FreeBSD.org
Wed Feb 20 14:10:50 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=135790
Change 135790 by sephe at sephe_zealot:sam_wifi on 2008/02/20 14:10:14
Make firmware autoloading work.
Discussed with: sam kevlo mlaier
Affected files ...
.. //depot/projects/wifi/sys/dev/bwi/bwimac.c#8 edit
.. //depot/projects/wifi/sys/dev/bwi/if_bwivar.h#13 edit
.. //depot/projects/wifi/sys/modules/bwifw/Makefile#4 edit
Differences ...
==== //depot/projects/wifi/sys/dev/bwi/bwimac.c#8 (text+ko) ====
@@ -882,6 +882,20 @@
char fwname[64];
int idx;
+ /*
+ * Try getting the firmware stub so firmware
+ * module would be loaded automatically
+ */
+ if (mac->mac_stub == NULL) {
+ snprintf(fwname, sizeof(fwname), BWI_FW_STUB_PATH,
+ sc->sc_fw_version);
+ mac->mac_stub = firmware_get(fwname);
+ if (mac->mac_stub == NULL) {
+ if_printf(ifp, "request firmware %s failed\n", fwname);
+ return ENOMEM;
+ }
+ }
+
if (mac->mac_ucode == NULL) {
snprintf(fwname, sizeof(fwname), BWI_FW_UCODE_PATH,
sc->sc_fw_version,
@@ -987,6 +1001,11 @@
firmware_put(mac->mac_iv_ext, FIRMWARE_UNLOAD);
mac->mac_iv_ext = NULL;
}
+
+ if (mac->mac_stub != NULL) {
+ firmware_put(mac->mac_stub, FIRMWARE_UNLOAD);
+ mac->mac_stub = NULL;
+ }
}
static int
==== //depot/projects/wifi/sys/dev/bwi/if_bwivar.h#13 (text+ko) ====
@@ -292,6 +292,7 @@
#define BWI_FW_VERSION3_REVMAX 0x128
#define BWI_FW_PATH "bwi_v%d_"
+#define BWI_FW_STUB_PATH BWI_FW_PATH "ucode"
#define BWI_FW_UCODE_PATH BWI_FW_PATH "ucode%d"
#define BWI_FW_PCM_PATH BWI_FW_PATH "pcm%d"
#define BWI_FW_IV_PATH BWI_FW_PATH "b0g0initvals%d"
@@ -463,6 +464,7 @@
struct bwi_tpctl mac_tpctl; /* TX power control */
uint32_t mac_flags; /* BWI_MAC_F_ */
+ const struct firmware *mac_stub;
const struct firmware *mac_ucode;
const struct firmware *mac_pcm;
const struct firmware *mac_iv;
==== //depot/projects/wifi/sys/modules/bwifw/Makefile#4 (text+ko) ====
@@ -2,8 +2,9 @@
.PATH: ${.CURDIR}/../../contrib/dev/bwi
+FWNAME= bwi_v3
FWFILE= wl_apsta-3.130.20.0.o
-_FWIMGS=ucode11 ucode2 ucode4 ucode5 \
+_FWIMGS=ucode ucode11 ucode2 ucode4 ucode5 \
a0g0bsinitvals2 a0g0bsinitvals5 a0g0initvals2 \
a0g0initvals5 a0g1bsinitvals5 a0g1initvals5 \
b0g0bsinitvals2 b0g0bsinitvals5 b0g0initvals2 b0g0initvals5 \
@@ -14,14 +15,14 @@
SUBDIR= fwcutter
FWCUTTER= fwcutter/b43-fwcutter
-KMOD= bwi_v3
-FIRMWS= ${_FWIMGS:C/.*/&.fw:${KMOD}_&/}
+KMOD= ${FWNAME}_ucode
+FIRMWS= ${_FWIMGS:C/.*/&.fw:${FWNAME}_&/}
-bwi_v3: ${FWIMGS}
+${FWNAME}: ${FWIMGS}
# NB: the cutter has v3/v4 pathname prefixes built-in; yech
${FWIMGS}: ${FWCUTTER} ${FWFILE}
- ln -sf . v3; ${FWCUTTER} -w . ${FWFILE}; rm v3
+ ln -sf . v3; ${FWCUTTER} -w . ${FWFILE}; rm v3; touch ucode.fw
${FWCUTTER}: fwcutter
More information about the p4-projects
mailing list