diff options
author | Joshua Oreman | 2009-08-01 18:52:59 +0200 |
---|---|---|
committer | Michael Brown | 2009-08-09 01:11:33 +0200 |
commit | 1e810bebe95eafc3c8427d7c5ddf753debb1316e (patch) | |
tree | d1e00b123b5402cf9d6f1532066a91af4a9d2d17 | |
parent | [802.11] Enhance support for driver PHY differences (diff) | |
download | ipxe-1e810bebe95eafc3c8427d7c5ddf753debb1316e.tar.gz ipxe-1e810bebe95eafc3c8427d7c5ddf753debb1316e.tar.xz ipxe-1e810bebe95eafc3c8427d7c5ddf753debb1316e.zip |
[802.11] Set channels early on to avoid tuning to an undefined channel
Some cards (such as ath5k) always need to tune to a particular channel
when they are reset; the reset may happen upon open(), which is before
the channels array would be set up (in prepare_probe()). Avoid tuning
the card to an inconsistent state by copying the hardware
supported-channels array to the 802.11 device's allowable-channels
array even before channels are "properly" set up.
Signed-off-by: Michael Brown <mcb30@etherboot.org>
-rw-r--r-- | src/net/80211/net80211.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/80211/net80211.c b/src/net/80211/net80211.c index 32547b5f..1b2ffd38 100644 --- a/src/net/80211/net80211.c +++ b/src/net/80211/net80211.c @@ -794,6 +794,11 @@ int net80211_register ( struct net80211_device *dev, memcpy ( dev->hw, hw, sizeof ( *hw ) ); memcpy ( dev->netdev->ll_addr, hw->hwaddr, ETH_ALEN ); + /* Set some sensible channel defaults for driver's open() function */ + memcpy ( dev->channels, dev->hw->channels, + NET80211_MAX_CHANNELS * sizeof ( dev->channels[0] ) ); + dev->channel = 0; + list_add_tail ( &dev->list, &net80211_devices ); return register_netdev ( dev->netdev ); } |