*/
rt2x00lib_precalculate_link_signal(&rt2x00dev->link.qual);
+ /*
+ * Send a signal to the led to update the led signal strength.
+ */
+ rt2x00leds_led_quality(rt2x00dev, rt2x00dev->link.qual.avg_rssi);
+
/*
* Evaluate antenna setup, make this the last step since this could
* possibly reset some statistics.
const int channel, const int tx_power,
const int value)
{
- if (channel <= 14)
- entry->center_freq = 2407 + (5 * channel);
- else
- entry->center_freq = 5000 + (5 * channel);
+ entry->center_freq = ieee80211_channel_to_frequency(channel);
entry->hw_value = value;
entry->max_power = tx_power;
entry->max_antenna_gain = 0xff;
* Initialize Rate list.
*/
for (i = 0; i < spec->num_rates; i++)
- rt2x00lib_rate(&rates[0], i, rt2x00_get_rate(i));
+ rt2x00lib_rate(&rates[i], i, rt2x00_get_rate(i));
/*
* Initialize Channel list.
* Rates: CCK.
* Channels: 2.4 GHz
*/
- if (spec->num_modes > HWMODE_B) {
+ if (spec->num_modes > 0) {
sbands[IEEE80211_BAND_2GHZ].n_channels = 14;
sbands[IEEE80211_BAND_2GHZ].n_bitrates = 4;
sbands[IEEE80211_BAND_2GHZ].channels = channels;
* Rates: CCK, OFDM.
* Channels: 2.4 GHz
*/
- if (spec->num_modes > HWMODE_G) {
+ if (spec->num_modes > 1) {
sbands[IEEE80211_BAND_2GHZ].n_channels = 14;
sbands[IEEE80211_BAND_2GHZ].n_bitrates = spec->num_rates;
sbands[IEEE80211_BAND_2GHZ].channels = channels;
* Rates: OFDM.
* Channels: OFDM, UNII, HiperLAN2.
*/
- if (spec->num_modes > HWMODE_A) {
+ if (spec->num_modes > 2) {
sbands[IEEE80211_BAND_5GHZ].n_channels = spec->num_channels - 14;
sbands[IEEE80211_BAND_5GHZ].n_bitrates = spec->num_rates - 4;
sbands[IEEE80211_BAND_5GHZ].channels = &channels[14];
goto exit;
}
+ /*
+ * Register LED.
+ */
+ rt2x00leds_register(rt2x00dev);
+
/*
* Allocatie rfkill.
*/
*/
rt2x00rfkill_free(rt2x00dev);
+ /*
+ * Free LED.
+ */
+ rt2x00leds_unregister(rt2x00dev);
+
/*
* Free ieee80211_hw memory.
*/
*/
rt2x00lib_stop(rt2x00dev);
rt2x00lib_uninitialize(rt2x00dev);
+ rt2x00leds_suspend(rt2x00dev);
rt2x00debug_deregister(rt2x00dev);
exit:
NOTICE(rt2x00dev, "Waking up.\n");
/*
- * Open the debugfs entry.
+ * Open the debugfs entry and restore led handling.
*/
rt2x00debug_register(rt2x00dev);
+ rt2x00leds_resume(rt2x00dev);
/*
* Only continue if mac80211 had open interfaces.