From e559ad07418a8f9aa81586913ae535ced72aaaeb Mon Sep 17 00:00:00 2001 From: acoul Date: Thu, 31 Mar 2016 08:00:09 +0300 Subject: [PATCH] package/mac80211: ozonet diet: update led code isolation --- .../mac80211/patches/999-fix_led_code.patch | 8 +- .../patches/999-fix_led_code_ath9k.patch | 331 ++++++++++++++++++ 2 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 package/kernel/mac80211/patches/999-fix_led_code_ath9k.patch diff --git a/package/kernel/mac80211/patches/999-fix_led_code.patch b/package/kernel/mac80211/patches/999-fix_led_code.patch index 0e568d5bca..3f93d156d8 100644 --- a/package/kernel/mac80211/patches/999-fix_led_code.patch +++ b/package/kernel/mac80211/patches/999-fix_led_code.patch @@ -1,12 +1,13 @@ --- a/compat/backport-4.5.c +++ b/compat/backport-4.5.c -@@ -8,10 +8,12 @@ +@@ -8,11 +8,13 @@ * published by the Free Software Foundation. */ -#include #include #include + #include +#ifdef CONFIG_NEW_LEDS +#include @@ -14,8 +15,11 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) int led_set_brightness_sync(struct led_classdev *led_cdev, enum led_brightness value) -@@ -31,3 +33,4 @@ int led_set_brightness_sync(struct led_c +@@ -32,6 +34,7 @@ int led_set_brightness_sync(struct led_c } EXPORT_SYMBOL_GPL(led_set_brightness_sync); #endif /* >= 3.19 */ +#endif /* CONFIG_NEW_LEDS */ + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) + /** diff --git a/package/kernel/mac80211/patches/999-fix_led_code_ath9k.patch b/package/kernel/mac80211/patches/999-fix_led_code_ath9k.patch new file mode 100644 index 0000000000..520639e878 --- /dev/null +++ b/package/kernel/mac80211/patches/999-fix_led_code_ath9k.patch @@ -0,0 +1,331 @@ +--- a/backport-include/linux/leds.h 2016-01-15 14:00:07.000000000 +0200 ++++ b/backport-include/linux/leds.h 2016-03-30 10:59:51.620124164 +0300 +@@ -1,3 +1,4 @@ ++#ifdef CONFIG_NEW_LEDS + #ifndef __BACKPORT_LINUX_LEDS_H + #define __BACKPORT_LINUX_LEDS_H + #include_next +@@ -59,3 +60,4 @@ extern int led_set_brightness_sync(struc + #include + + #endif /* __BACKPORT_LINUX_LEDS_H */ ++#endif /* CONFIG_NEW_LEDS */ +--- a/drivers/net/wireless/ath/ath9k/ath9k.h 2016-03-30 11:14:28.014602204 +0300 ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h 2016-03-30 10:32:55.800540370 +0300 +@@ -20,7 +20,9 @@ + #include + #include + #include ++#ifdef CONFIG_NEW_LEDS + #include ++#endif /* CONFIG_NEW_LEDS */ + #include + #include + #include +@@ -36,7 +38,9 @@ struct ath_vif; + + extern struct ieee80211_ops ath9k_ops; + extern int ath9k_modparam_nohwcrypt; ++#ifdef CONFIG_NEW_LEDS + extern int ath9k_led_blink; ++#endif /* CONFIG_NEW_LEDS */ + extern bool is_ath9k_unloaded; + extern int ath9k_use_chanctx; + +@@ -957,12 +961,14 @@ void ath_ant_comb_scan(struct ath_softc + + #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */ + ++#ifdef CONFIG_NEW_LEDS + struct ath_led { + struct list_head list; + struct ath_softc *sc; + const struct gpio_led *gpio; + struct led_classdev cdev; + }; ++#endif /* CONFIG_NEW_LEDS */ + + #ifdef CONFIG_GPIOLIB + struct ath9k_gpio_chip { +--- a/drivers/net/wireless/ath/ath9k/Kconfig 2016-01-15 14:00:10.000000000 +0200 ++++ b/drivers/net/wireless/ath/ath9k/Kconfig 2016-03-30 10:28:36.199953112 +0300 +@@ -24,7 +24,6 @@ config ATH9K + depends on m + depends on MAC80211 && HAS_DMA + select ATH9K_HW +- select MAC80211_LEDS + select BPAUTO_LEDS_CLASS + select BPAUTO_NEW_LEDS + select ATH9K_COMMON +--- a/net/mac80211/ieee80211_i.h 2016-03-30 11:14:27.851520797 +0300 ++++ b/net/mac80211/ieee80211_i.h 2016-03-30 10:35:51.567279499 +0300 +@@ -24,7 +24,9 @@ + #include + #include + #include ++#ifdef CONFIG_NEW_LEDS + #include ++#endif /* CONFIG_NEW_LEDS */ + #include + #include + #include +--- a/net/mac80211/iface.c 2016-03-30 11:14:27.688439390 +0300 ++++ b/net/mac80211/iface.c 2016-03-30 10:46:20.644301765 +0300 +@@ -22,7 +22,9 @@ + #include "sta_info.h" + #include "debugfs_netdev.h" + #include "mesh.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + #include "driver-ops.h" + #include "wme.h" + #include "rate.h" +@@ -128,9 +130,9 @@ static u32 __ieee80211_recalc_idle(struc + led_trig_start |= IEEE80211_TPT_LEDTRIG_FL_CONNECTED; + else + led_trig_stop |= IEEE80211_TPT_LEDTRIG_FL_CONNECTED; +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop); +- ++#endif /* CONFIG_NEW_LEDS */ + if (working || scanning || active) + return __ieee80211_idle_off(local); + return __ieee80211_idle_on(local); +@@ -557,9 +559,11 @@ int ieee80211_do_open(struct wireless_de + goto err_del_bss; + /* we're brought up, everything changes */ + hw_reconf_flags = ~0; ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_radio(local, true); + ieee80211_mod_tpt_led_trig(local, + IEEE80211_TPT_LEDTRIG_FL_RADIO, 0); ++#endif /* CONFIG_NEW_LEDS */ + } + + /* +--- a/net/mac80211/main.c 2016-03-30 11:14:27.852521297 +0300 ++++ b/net/mac80211/main.c 2016-03-30 10:41:10.059264126 +0300 +@@ -30,7 +30,9 @@ + #include "rate.h" + #include "mesh.h" + #include "wep.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + #include "debugfs.h" + + void ieee80211_configure_filter(struct ieee80211_local *local) +@@ -660,9 +662,9 @@ struct ieee80211_hw *ieee80211_alloc_hw_ + skb_queue_head_init(&local->skb_queue); + skb_queue_head_init(&local->skb_queue_unreliable); + skb_queue_head_init(&local->skb_queue_tdls_chsw); +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_alloc_led_names(local); +- ++#endif /* CONFIG_NEW_LEDS */ + ieee80211_roc_setup(local); + + return &local->hw; +@@ -1069,9 +1071,9 @@ int ieee80211_register_hw(struct ieee802 + result); + + local->hw.conf.flags = IEEE80211_CONF_IDLE; +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_init(local); +- ++#endif /* CONFIG_NEW_LEDS */ + rtnl_lock(); + + result = ieee80211_init_rate_ctrl_alg(local, +@@ -1124,7 +1126,9 @@ int ieee80211_register_hw(struct ieee802 + ieee80211_remove_interfaces(local); + fail_rate: + rtnl_unlock(); ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_exit(local); ++#endif /* CONFIG_NEW_LEDS */ + ieee80211_wep_free(local); + destroy_workqueue(local->workqueue); + fail_workqueue: +@@ -1181,7 +1185,9 @@ void ieee80211_unregister_hw(struct ieee + destroy_workqueue(local->workqueue); + wiphy_unregister(local->hw.wiphy); + ieee80211_wep_free(local); ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_exit(local); ++#endif /* CONFIG_NEW_LEDS */ + kfree(local->int_scan_req); + } + EXPORT_SYMBOL(ieee80211_unregister_hw); +@@ -1208,8 +1214,9 @@ void ieee80211_free_hw(struct ieee80211_ + idr_destroy(&local->ack_status_frames); + + sta_info_stop(local); +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_free_led_names(local); ++#endif /* CONFIG_NEW_LEDS */ + + wiphy_free(local->hw.wiphy); + } +--- a/net/mac80211/mlme.c 2016-03-30 11:14:27.692441388 +0300 ++++ b/net/mac80211/mlme.c 2016-03-30 10:55:48.603815437 +0300 +@@ -29,7 +29,9 @@ + #include "ieee80211_i.h" + #include "driver-ops.h" + #include "rate.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + + #define IEEE80211_AUTH_TIMEOUT (HZ / 5) + #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) +@@ -1926,9 +1928,9 @@ static void ieee80211_set_associated(str + + /* just to be sure */ + ieee80211_stop_poll(sdata); +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_assoc(local, 1); +- ++#endif /* CONFIG_NEW_LEDS */ + if (sdata->u.mgd.have_beacon) { + /* + * If the AP is buggy we may get here with no DTIM period +@@ -2032,7 +2034,9 @@ static void ieee80211_set_disassoc(struc + /* finally reset all BSS / config parameters */ + changed |= ieee80211_reset_erp_info(sdata); + ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_assoc(local, 0); ++#endif /* CONFIG_NEW_LEDS */ + changed |= BSS_CHANGED_ASSOC; + sdata->vif.bss_conf.assoc = false; + +--- a/net/mac80211/rx.c 2016-03-30 11:14:27.736463363 +0300 ++++ b/net/mac80211/rx.c 2016-03-30 10:49:05.861774921 +0300 +@@ -24,7 +24,9 @@ + + #include "ieee80211_i.h" + #include "driver-ops.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + #include "mesh.h" + #include "wep.h" + #include "wpa.h" +@@ -1927,8 +1929,10 @@ ieee80211_rx_h_defragment(struct ieee802 + status = IEEE80211_SKB_RXCB(rx->skb); + + out: ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_rx(rx->local); +- out_no_led: ++#endif /* CONFIG_NEW_LEDS */ ++out_no_led: + if (rx->sta) + rx->sta->rx_stats.packets++; + return RX_CONTINUE; +@@ -3650,10 +3654,11 @@ void ieee80211_rx_napi(struct ieee80211_ + rcu_read_unlock(); + return; + } +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_tpt_led_trig_rx(local, + ((struct ieee80211_hdr *)skb->data)->frame_control, + skb->len); ++#endif /* CONFIG_NEW_LEDS */ + __ieee80211_rx_handle_packet(hw, skb, napi); + + rcu_read_unlock(); +--- a/net/mac80211/status.c 2016-01-15 14:00:10.000000000 +0200 ++++ b/net/mac80211/status.c 2016-03-30 10:44:18.728443887 +0300 +@@ -17,7 +17,9 @@ + #include "ieee80211_i.h" + #include "rate.h" + #include "mesh.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + #include "wme.h" + + +@@ -878,9 +880,9 @@ void ieee80211_tx_status(struct ieee8021 + } + + rcu_read_unlock(); +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_tx(local); +- ++#endif /* CONFIG_NEW_LEDS */ + /* SNMP counters + * Fragments are passed to low-level drivers as separate skbs, so these + * are actually fragments, not frames. Update frame counters only for +--- a/net/mac80211/tx.c 2016-03-30 11:14:27.742466360 +0300 ++++ b/net/mac80211/tx.c 2016-03-30 10:51:09.890687595 +0300 +@@ -28,7 +28,9 @@ + + #include "ieee80211_i.h" + #include "driver-ops.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + #include "mesh.h" + #include "wep.h" + #include "wpa.h" +@@ -1455,9 +1457,9 @@ static bool __ieee80211_tx(struct ieee80 + + result = ieee80211_tx_frags(local, vif, pubsta, skbs, + txpending); +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_tpt_led_trig_tx(local, fc, led_len); +- ++#endif /* CONFIG_NEW_LEDS */ + WARN_ON_ONCE(!skb_queue_empty(skbs)); + + return result; +--- a/net/mac80211/util.c 2016-01-15 14:00:10.000000000 +0200 ++++ b/net/mac80211/util.c 2016-03-30 10:52:51.413365620 +0300 +@@ -32,7 +32,9 @@ + #include "rate.h" + #include "mesh.h" + #include "wme.h" ++#ifdef CONFIG_NEW_LEDS + #include "led.h" ++#endif /* CONFIG_NEW_LEDS */ + #include "wep.h" + + /* privid for wiphys to determine whether they belong to us or not */ +@@ -1635,9 +1637,10 @@ u32 ieee80211_sta_get_rates(struct ieee8 + + void ieee80211_stop_device(struct ieee80211_local *local) + { ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_radio(local, false); + ieee80211_mod_tpt_led_trig(local, 0, IEEE80211_TPT_LEDTRIG_FL_RADIO); +- ++#endif /* CONFIG_NEW_LEDS */ + cancel_work_sync(&local->reconfig_filter); + + flush_workqueue(local->workqueue); +@@ -1831,11 +1834,11 @@ int ieee80211_reconfig(struct ieee80211_ + + /* reset coverage class */ + drv_set_coverage_class(local, hw->wiphy->coverage_class); +- ++#ifdef CONFIG_NEW_LEDS + ieee80211_led_radio(local, true); + ieee80211_mod_tpt_led_trig(local, + IEEE80211_TPT_LEDTRIG_FL_RADIO, 0); +- ++#endif /* CONFIG_NEW_LEDS */ + /* add interfaces */ + sdata = rtnl_dereference(local->monitor_sdata); + if (sdata) { -- 2.35.1