diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-11-30 02:58:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-22 14:33:37 -0500 |
commit | e1e5406854378dfada3f33c7192b012083a5b8e0 (patch) | |
tree | e878058f28b8f6db50ef5d73d09aed66dd9ad9f2 /include/net | |
parent | fe67c913f1ec2a01aaa9176c80ef36eaf87d705d (diff) |
mac80211: add throughput based LED blink trigger
iwlwifi and other drivers like to blink their LED
based on throughput. Implement this generically in
mac80211, based on a throughput table the driver
specifies. That way, drivers can set the blink
frequencies depending on their desired behaviour
and max throughput.
All the drivers need to do is provide an LED class
device, best with blink hardware offload.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/mac80211.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 69ded1ee49ce..40a93d582c79 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1852,11 +1852,26 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1852 | */ | 1852 | */ |
1853 | int ieee80211_register_hw(struct ieee80211_hw *hw); | 1853 | int ieee80211_register_hw(struct ieee80211_hw *hw); |
1854 | 1854 | ||
1855 | /** | ||
1856 | * struct ieee80211_tpt_blink - throughput blink description | ||
1857 | * @throughput: throughput in Kbit/sec | ||
1858 | * @blink_time: blink time in milliseconds | ||
1859 | * (full cycle, ie. one off + one on period) | ||
1860 | */ | ||
1861 | struct ieee80211_tpt_blink { | ||
1862 | int throughput; | ||
1863 | int blink_time; | ||
1864 | }; | ||
1865 | |||
1855 | #ifdef CONFIG_MAC80211_LEDS | 1866 | #ifdef CONFIG_MAC80211_LEDS |
1856 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); | 1867 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); |
1857 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); | 1868 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); |
1858 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); | 1869 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); |
1859 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); | 1870 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); |
1871 | extern char *__ieee80211_create_tpt_led_trigger( | ||
1872 | struct ieee80211_hw *hw, | ||
1873 | const struct ieee80211_tpt_blink *blink_table, | ||
1874 | unsigned int blink_table_len); | ||
1860 | #endif | 1875 | #endif |
1861 | /** | 1876 | /** |
1862 | * ieee80211_get_tx_led_name - get name of TX LED | 1877 | * ieee80211_get_tx_led_name - get name of TX LED |
@@ -1935,6 +1950,29 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
1935 | } | 1950 | } |
1936 | 1951 | ||
1937 | /** | 1952 | /** |
1953 | * ieee80211_create_tpt_led_trigger - create throughput LED trigger | ||
1954 | * @hw: the hardware to create the trigger for | ||
1955 | * @blink_table: the blink table -- needs to be ordered by throughput | ||
1956 | * @blink_table_len: size of the blink table | ||
1957 | * | ||
1958 | * This function returns %NULL (in case of error, or if no LED | ||
1959 | * triggers are configured) or the name of the new trigger. | ||
1960 | * This function must be called before ieee80211_register_hw(). | ||
1961 | */ | ||
1962 | static inline char * | ||
1963 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, | ||
1964 | const struct ieee80211_tpt_blink *blink_table, | ||
1965 | unsigned int blink_table_len) | ||
1966 | { | ||
1967 | #ifdef CONFIG_MAC80211_LEDS | ||
1968 | return __ieee80211_create_tpt_led_trigger(hw, blink_table, | ||
1969 | blink_table_len); | ||
1970 | #else | ||
1971 | return NULL; | ||
1972 | #endif | ||
1973 | } | ||
1974 | |||
1975 | /** | ||
1938 | * ieee80211_unregister_hw - Unregister a hardware device | 1976 | * ieee80211_unregister_hw - Unregister a hardware device |
1939 | * | 1977 | * |
1940 | * This function instructs mac80211 to free allocated resources | 1978 | * This function instructs mac80211 to free allocated resources |