openwrt/package/mac80211/patches/800-nuke_led_code.patch
Alexandros C. Couloumbis c4e73984fa package/mac80211: fix r22422, add missing bits & bytes
SVN-Revision: 22611
2010-08-12 14:13:52 +00:00

434 lines
10 KiB
Diff

--- a/config.mk
+++ b/config.mk
@@ -115,7 +115,7 @@ CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstr
# CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
-CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_LEDS=y
# enable mesh networking too
CONFIG_MAC80211_MESH=y
@@ -194,7 +194,7 @@ CONFIG_B43_PCI_AUTOSELECT=y
ifneq ($(CONFIG_PCMCIA),)
# CONFIG_B43_PCMCIA=y
endif
-CONFIG_B43_LEDS=y
+# CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y
# CONFIG_B43_NPHY is not set
# CONFIG_B43_FORCE_PIO=y
@@ -203,7 +203,7 @@ CONFIG_B43_PHY_LP=y
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_HWRNG=y
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
-CONFIG_B43LEGACY_LEDS=y
+# CONFIG_B43LEGACY_LEDS=y
# CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
@@ -336,13 +336,13 @@ endif
CONFIG_P54_USB=m
CONFIG_RTL8187=m
-CONFIG_RTL8187_LEDS=y
+# CONFIG_RTL8187_LEDS=y
CONFIG_AT76C50X_USB=m
ifndef CONFIG_COMPAT_KERNEL_28
CONFIG_AR9170_USB=m
-CONFIG_AR9170_LEDS=y
+# CONFIG_AR9170_LEDS=y
endif
CONFIG_ATH9K_HTC=m
@@ -426,7 +426,7 @@ CONFIG_RT2800_LIB=m
CONFIG_RT2X00_LIB_HT=y
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
-CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG=y
# CONFIG_RT2X00_LIB_DEBUGFS
endif
@@ -437,7 +437,7 @@ endif
# p54
CONFIG_P54_COMMON=m
-CONFIG_P54_LEDS=y
+# CONFIG_P54_LEDS=y
# Atheros
CONFIG_ATH_COMMON=m
--- a/include/linux/compat-2.6.25.h
+++ b/include/linux/compat-2.6.25.h
@@ -146,10 +146,12 @@ static inline void __hwrng_unregister(st
hwrng_unregister(rng);
}
+#ifdef CONFIG_MAC80211_LEDS
static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
{
led_classdev_unregister(lcd);
}
+#endif
/**
* The following things are out of ./include/linux/kernel.h
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -20,6 +20,7 @@
/* LED functions */
/********************************/
+#ifdef CONFIG_MAC80211_LEDS
static void ath_led_blink_work(struct work_struct *work)
{
struct ath_softc *sc = container_of(work, struct ath_softc,
@@ -194,6 +195,7 @@ fail:
cancel_delayed_work_sync(&sc->ath_led_blink_work);
ath_deinit_leds(sc);
}
+#endif
/*******************/
/* Rfkill */
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -273,7 +273,9 @@ static int ath_pci_suspend(struct pci_de
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;
+#ifdef CONFIG_MAC80211_LEDS
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
+#endif
pci_save_state(pdev);
pci_disable_device(pdev);
@@ -305,10 +307,12 @@ static int ath_pci_resume(struct pci_dev
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
+#ifdef CONFIG_MAC80211_LEDS
/* Enable LED */
ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
+#endif
return 0;
}
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -465,6 +465,7 @@ void ath9k_btcoex_timer_pause(struct ath
/********************/
/* LED Control */
/********************/
+#ifdef CONFIG_MAC80211_LEDS
#define ATH_LED_PIN_DEF 1
#define ATH_LED_PIN_9287 8
@@ -489,6 +490,7 @@ struct ath_led {
void ath_init_leds(struct ath_softc *sc);
void ath_deinit_leds(struct ath_softc *sc);
+#endif
/********************/
/* Main driver core */
@@ -586,6 +588,7 @@ struct ath_softc {
enum wireless_mode cur_rate_mode;
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
+#ifdef CONFIG_MAC80211_LEDS
struct ath_led radio_led;
struct ath_led assoc_led;
struct ath_led tx_led;
@@ -595,6 +598,7 @@ struct ath_softc {
int led_off_duration;
int led_on_cnt;
int led_off_cnt;
+#endif
int beacon_interval;
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -34,9 +34,11 @@ int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
+#ifdef CONFIG_MAC80211_LEDS
int led_blink = 1;
module_param_named(blink, led_blink, int, 0444);
MODULE_PARM_DESC(blink, "Enable LED blink on activity");
+#endif
/* We use the hw_value as an index into our private channel structure */
@@ -757,7 +759,9 @@ int ath9k_init_device(u16 devid, struct
INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work);
sc->wiphy_scheduler_int = msecs_to_jiffies(500);
+#ifdef CONFIG_MAC80211_LEDS
ath_init_leds(sc);
+#endif
ath_start_rfkill_poll(sc);
return 0;
@@ -810,7 +814,9 @@ void ath9k_deinit_device(struct ath_soft
ath9k_ps_wakeup(sc);
wiphy_rfkill_stop_polling(sc->hw->wiphy);
+#ifdef CONFIG_MAC80211_LEDS
ath_deinit_leds(sc);
+#endif
for (i = 0; i < sc->num_sec_wiphy; i++) {
struct ath_wiphy *aphy = sc->sec_wiphy[i];
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -868,9 +868,11 @@ void ath_radio_enable(struct ath_softc *
ath9k_hw_set_interrupts(ah, ah->imask);
/* Enable LED */
+#ifdef CONFIG_MAC80211_LEDS
ath9k_hw_cfg_output(ah, ah->led_pin,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
ath9k_hw_set_gpio(ah, ah->led_pin, 0);
+#endif
ieee80211_wake_queues(hw);
ath9k_ps_restore(sc);
@@ -889,10 +891,12 @@ void ath_radio_disable(struct ath_softc
* Keep the LED on when the radio is disabled
* during idle unassociated state.
*/
+#ifdef CONFIG_MAC80211_LEDS
if (!sc->ps_idle) {
ath9k_hw_set_gpio(ah, ah->led_pin, 1);
ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
}
+#endif
/* Disable interrupts */
ath9k_hw_set_interrupts(ah, 0);
@@ -1303,8 +1307,10 @@ static void ath9k_stop(struct ieee80211_
aphy->state = ATH_WIPHY_INACTIVE;
+#ifdef CONFIG_MAC80211_LEDS
if (led_blink)
cancel_delayed_work_sync(&sc->ath_led_blink_work);
+#endif
cancel_delayed_work_sync(&sc->tx_complete_work);
cancel_work_sync(&sc->paprd_work);
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -21,7 +21,9 @@
#include "sta_info.h"
#include "debugfs_netdev.h"
#include "mesh.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
#include "driver-ops.h"
#include "wme.h"
@@ -189,7 +191,9 @@ static int ieee80211_open(struct net_dev
goto err_del_bss;
/* we're brought up, everything changes */
hw_reconf_flags = ~0;
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_radio(local, true);
+#endif
}
/*
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -29,7 +29,9 @@
#include "rate.h"
#include "mesh.h"
#include "wep.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
#include "cfg.h"
#include "debugfs.h"
@@ -674,7 +676,9 @@ int ieee80211_register_hw(struct ieee802
rtnl_unlock();
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_init(local);
+#endif
local->network_latency_notifier.notifier_call =
ieee80211_max_network_latency;
@@ -699,7 +703,9 @@ int ieee80211_register_hw(struct ieee802
&local->network_latency_notifier);
rtnl_lock();
fail_pm_qos:
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_exit(local);
+#endif
ieee80211_remove_interfaces(local);
fail_rate:
rtnl_unlock();
@@ -755,7 +761,9 @@ void ieee80211_unregister_hw(struct ieee
destroy_workqueue(local->workqueue);
wiphy_unregister(local->hw.wiphy);
ieee80211_wep_free(local);
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_exit(local);
+#endif
kfree(local->int_scan_req);
}
EXPORT_SYMBOL(ieee80211_unregister_hw);
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -26,7 +26,9 @@
#include "ieee80211_i.h"
#include "driver-ops.h"
#include "rate.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
#define IEEE80211_MAX_PROBE_TRIES 5
@@ -872,7 +874,9 @@ static void ieee80211_set_associated(str
*/
sdata->u.mgd.wmm_last_param_set = -1;
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_assoc(local, 1);
+#endif
if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD)
bss_conf->dtim_period = bss->dtim_period;
@@ -958,7 +962,9 @@ static void ieee80211_set_disassoc(struc
changed |= ieee80211_reset_erp_info(sdata);
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_assoc(local, 0);
+#endif
changed |= BSS_CHANGED_ASSOC;
sdata->vif.bss_conf.assoc = false;
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -4,7 +4,9 @@
#include "ieee80211_i.h"
#include "mesh.h"
#include "driver-ops.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
int __ieee80211_suspend(struct ieee80211_hw *hw)
{
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -21,7 +21,9 @@
#include "ieee80211_i.h"
#include "driver-ops.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
#include "mesh.h"
#include "wep.h"
#include "wpa.h"
@@ -1343,7 +1345,9 @@ ieee80211_rx_h_defragment(struct ieee802
if (is_multicast_ether_addr(hdr->addr1))
rx->local->dot11MulticastReceivedFrameCount++;
else
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_rx(rx->local);
+#endif
return RX_CONTINUE;
}
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -13,7 +13,9 @@
#include "ieee80211_i.h"
#include "rate.h"
#include "mesh.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
@@ -247,7 +249,9 @@ void ieee80211_tx_status(struct ieee8021
rcu_read_unlock();
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_tx(local, 0);
+#endif
/* SNMP counters
* Fragments are passed to low-level drivers as separate skbs, so these
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -26,7 +26,9 @@
#include "ieee80211_i.h"
#include "driver-ops.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
#include "mesh.h"
#include "wep.h"
#include "wpa.h"
@@ -1312,7 +1314,9 @@ static int __ieee80211_tx(struct ieee802
}
*skbp = skb = next;
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_tx(local, 1);
+#endif
fragm = true;
}
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -29,7 +29,9 @@
#include "rate.h"
#include "mesh.h"
#include "wme.h"
+#ifdef CONFIG_MAC80211_LEDS
#include "led.h"
+#endif
#include "wep.h"
/* privid for wiphys to determine whether they belong to us or not */
@@ -1107,7 +1109,9 @@ u32 ieee80211_sta_get_rates(struct ieee8
void ieee80211_stop_device(struct ieee80211_local *local)
{
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_radio(local, false);
+#endif
cancel_work_sync(&local->reconfig_filter);
@@ -1141,7 +1145,9 @@ int ieee80211_reconfig(struct ieee80211_
return res;
}
+#ifdef CONFIG_MAC80211_LEDS
ieee80211_led_radio(local, true);
+#endif
}
/* add interfaces */