Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
rwcr authored and Michael Brown committed Aug 8, 2009
1 parent f128a6d commit 1e810be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/net/80211/net80211.c
Expand Up @@ -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 );
}
Expand Down

0 comments on commit 1e810be

Please sign in to comment.