Skip to content

Commit a4881cc

Browse files
committed
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2 parents 6de3f7e + aba4e6f commit a4881cc

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

‎include/linux/rfkill.h‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,37 @@ static inline bool rfkill_blocked(struct rfkill *rfkill)
354354
}
355355
#endif /* RFKILL || RFKILL_MODULE */
356356

357+
358+
#ifdef CONFIG_RFKILL_LEDS
359+
/**
360+
* rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED.
361+
* This function might return a NULL pointer if registering of the
362+
* LED trigger failed. Use this as "default_trigger" for the LED.
363+
*/
364+
const char *rfkill_get_led_trigger_name(struct rfkill *rfkill);
365+
366+
/**
367+
* rfkill_set_led_trigger_name -- set the LED trigger name
368+
* @rfkill: rfkill struct
369+
* @name: LED trigger name
370+
*
371+
* This function sets the LED trigger name of the radio LED
372+
* trigger that rfkill creates. It is optional, but if called
373+
* must be called before rfkill_register() to be effective.
374+
*/
375+
void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name);
376+
#else
377+
static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill)
378+
{
379+
return NULL;
380+
}
381+
382+
static inline void
383+
rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name)
384+
{
385+
}
386+
#endif
387+
357388
#endif /* __KERNEL__ */
358389

359390
#endif /* RFKILL_H */

‎net/mac80211/cfg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,
740740
struct probe_resp *new, *old;
741741

742742
if (!resp || !resp_len)
743-
return -EINVAL;
743+
return 1;
744744

745745
old = rtnl_dereference(sdata->u.ap.probe_resp);
746746

‎net/rfkill/core.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ static void rfkill_led_trigger_activate(struct led_classdev *led)
150150
rfkill_led_trigger_event(rfkill);
151151
}
152152

153+
const char *rfkill_get_led_trigger_name(struct rfkill *rfkill)
154+
{
155+
return rfkill->led_trigger.name;
156+
}
157+
EXPORT_SYMBOL(rfkill_get_led_trigger_name);
158+
159+
void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name)
160+
{
161+
BUG_ON(!rfkill);
162+
163+
rfkill->ledtrigname = name;
164+
}
165+
EXPORT_SYMBOL(rfkill_set_led_trigger_name);
166+
153167
static int rfkill_led_trigger_register(struct rfkill *rfkill)
154168
{
155169
rfkill->led_trigger.name = rfkill->ledtrigname

0 commit comments

Comments
 (0)