diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-04-02 14:08:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:40 -0400 |
commit | 6bad8766620a3c8b64afa981502fdb543e3cfd6c (patch) | |
tree | 7524ea7826a443d920062e48fe081e82b6fd7385 /net/wireless/nl80211.c | |
parent | 5dab3b8a68cc97a7e6b9f79f5de05803c8e55a3c (diff) |
cfg80211: send regulatory beacon hint events to userspace
This informs userspace when a change has occured on a world
roaming wiphy's channel which has lifted some restrictions
due to a regulatory beacon hint.
Because this is now sent to userspace through the regulatory
multicast group we remove the debug prints we used to use as
they are no longer necessary.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7285bdc4e598..85b5aa3c76f8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3491,6 +3491,60 @@ void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, | |||
3491 | nlmsg_free(msg); | 3491 | nlmsg_free(msg); |
3492 | } | 3492 | } |
3493 | 3493 | ||
3494 | void nl80211_send_beacon_hint_event(struct wiphy *wiphy, | ||
3495 | struct ieee80211_channel *channel_before, | ||
3496 | struct ieee80211_channel *channel_after) | ||
3497 | { | ||
3498 | struct sk_buff *msg; | ||
3499 | void *hdr; | ||
3500 | struct nlattr *nl_freq; | ||
3501 | |||
3502 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); | ||
3503 | if (!msg) | ||
3504 | return; | ||
3505 | |||
3506 | hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_REG_BEACON_HINT); | ||
3507 | if (!hdr) { | ||
3508 | nlmsg_free(msg); | ||
3509 | return; | ||
3510 | } | ||
3511 | |||
3512 | /* | ||
3513 | * Since we are applying the beacon hint to a wiphy we know its | ||
3514 | * wiphy_idx is valid | ||
3515 | */ | ||
3516 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy)); | ||
3517 | |||
3518 | /* Before */ | ||
3519 | nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_BEFORE); | ||
3520 | if (!nl_freq) | ||
3521 | goto nla_put_failure; | ||
3522 | if (nl80211_msg_put_channel(msg, channel_before)) | ||
3523 | goto nla_put_failure; | ||
3524 | nla_nest_end(msg, nl_freq); | ||
3525 | |||
3526 | /* After */ | ||
3527 | nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_AFTER); | ||
3528 | if (!nl_freq) | ||
3529 | goto nla_put_failure; | ||
3530 | if (nl80211_msg_put_channel(msg, channel_after)) | ||
3531 | goto nla_put_failure; | ||
3532 | nla_nest_end(msg, nl_freq); | ||
3533 | |||
3534 | if (genlmsg_end(msg, hdr) < 0) { | ||
3535 | nlmsg_free(msg); | ||
3536 | return; | ||
3537 | } | ||
3538 | |||
3539 | genlmsg_multicast(msg, 0, nl80211_regulatory_mcgrp.id, GFP_ATOMIC); | ||
3540 | |||
3541 | return; | ||
3542 | |||
3543 | nla_put_failure: | ||
3544 | genlmsg_cancel(msg, hdr); | ||
3545 | nlmsg_free(msg); | ||
3546 | } | ||
3547 | |||
3494 | /* initialisation/exit functions */ | 3548 | /* initialisation/exit functions */ |
3495 | 3549 | ||
3496 | int nl80211_init(void) | 3550 | int nl80211_init(void) |