diff options
author | glebius <glebius@FreeBSD.org> | 2015-05-27 22:30:21 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2015-05-27 22:30:21 +0000 |
commit | e347653ba08b12386f2285d9827172ad6eaeefea (patch) | |
tree | ed495785f30b2491d97a9b7ffd8bc4c463b3cbfb | |
parent | 8f088f6f343e72d7c938ca58dcf7e84c8a087e13 (diff) | |
download | FreeBSD-src-e347653ba08b12386f2285d9827172ad6eaeefea.zip FreeBSD-src-e347653ba08b12386f2285d9827172ad6eaeefea.tar.gz |
To avoid sleeping in firmware_get() with bwi mutex held, call
bwi_mac_fw_alloc() at the device attach, not in the interface
init.
-rw-r--r-- | sys/dev/bwi/bwimac.c | 7 | ||||
-rw-r--r-- | sys/dev/bwi/bwimac.h | 1 | ||||
-rw-r--r-- | sys/dev/bwi/if_bwi.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/bwi/bwimac.c b/sys/dev/bwi/bwimac.c index 21f4333..f39ef44 100644 --- a/sys/dev/bwi/bwimac.c +++ b/sys/dev/bwi/bwimac.c @@ -101,7 +101,6 @@ static void bwi_mac_opmode_init(struct bwi_mac *); static void bwi_mac_hostflags_init(struct bwi_mac *); static void bwi_mac_bss_param_init(struct bwi_mac *); -static int bwi_mac_fw_alloc(struct bwi_mac *); static void bwi_mac_fw_free(struct bwi_mac *); static int bwi_mac_fw_load(struct bwi_mac *); static int bwi_mac_fw_init(struct bwi_mac *); @@ -325,10 +324,6 @@ bwi_mac_init(struct bwi_mac *mac) /* * Load and initialize firmwares */ - error = bwi_mac_fw_alloc(mac); - if (error) - return error; - error = bwi_mac_fw_load(mac); if (error) return error; @@ -879,7 +874,7 @@ bwi_fwimage_is_valid(struct bwi_softc *sc, const struct firmware *fw, /* * XXX Error cleanup */ -static int +int bwi_mac_fw_alloc(struct bwi_mac *mac) { struct bwi_softc *sc = mac->mac_sc; diff --git a/sys/dev/bwi/bwimac.h b/sys/dev/bwi/bwimac.h index 2c5275e..a6d9008 100644 --- a/sys/dev/bwi/bwimac.h +++ b/sys/dev/bwi/bwimac.h @@ -57,6 +57,7 @@ void bwi_mac_init_tpctl_11bg(struct bwi_mac *); void bwi_mac_dummy_xmit(struct bwi_mac *); void bwi_mac_reset_hwkeys(struct bwi_mac *); int bwi_mac_config_ps(struct bwi_mac *); +int bwi_mac_fw_alloc(struct bwi_mac *); uint16_t bwi_memobj_read_2(struct bwi_mac *, uint16_t, uint16_t); uint32_t bwi_memobj_read_4(struct bwi_mac *, uint16_t, uint16_t); diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 9f66ff4..53fb58f 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -446,6 +446,10 @@ bwi_attach(struct bwi_softc *sc) if (error) goto fail; + error = bwi_mac_fw_alloc(mac); + if (error) + goto fail; + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); |