Преглед на файлове

[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>
tags/v0.9.8
Joshua Oreman преди 15 години
родител
ревизия
1e810bebe9
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5
    0
      src/net/80211/net80211.c

+ 5
- 0
src/net/80211/net80211.c Целия файл

794
 	memcpy ( dev->hw, hw, sizeof ( *hw ) );
794
 	memcpy ( dev->hw, hw, sizeof ( *hw ) );
795
 	memcpy ( dev->netdev->ll_addr, hw->hwaddr, ETH_ALEN );
795
 	memcpy ( dev->netdev->ll_addr, hw->hwaddr, ETH_ALEN );
796
 
796
 
797
+	/* Set some sensible channel defaults for driver's open() function */
798
+	memcpy ( dev->channels, dev->hw->channels,
799
+		 NET80211_MAX_CHANNELS * sizeof ( dev->channels[0] ) );
800
+	dev->channel = 0;
801
+
797
 	list_add_tail ( &dev->list, &net80211_devices );
802
 	list_add_tail ( &dev->list, &net80211_devices );
798
 	return register_netdev ( dev->netdev );
803
 	return register_netdev ( dev->netdev );
799
 }
804
 }

Loading…
Отказ
Запис