Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149874
b: refs/heads/master
c: 06aa7af
h: refs/heads/master
v: v3
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Apr 22, 2009
1 parent 86e3a8c commit 8fb9ee1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 964c1d417e4738d359ba263921a7b9c18fa711c4
refs/heads/master: 06aa7afaaa21a4e7f1bcb196bd3f29193924a603
8 changes: 8 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,14 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
struct ieee80211_mgmt *mgmt, size_t len,
s32 signal, gfp_t gfp);

struct cfg80211_bss*
cfg80211_inform_bss(struct wiphy *wiphy,
struct ieee80211_channel *channel,
const u8 *bssid,
u64 timestamp, u16 capability, u16 beacon_interval,
const u8 *ie, size_t ielen,
s32 signal, gfp_t gfp);

struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
struct ieee80211_channel *channel,
const u8 *bssid,
Expand Down
49 changes: 49 additions & 0 deletions trunk/net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,55 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
return found;
}

struct cfg80211_bss*
cfg80211_inform_bss(struct wiphy *wiphy,
struct ieee80211_channel *channel,
const u8 *bssid,
u64 timestamp, u16 capability, u16 beacon_interval,
const u8 *ie, size_t ielen,
s32 signal, gfp_t gfp)
{
struct cfg80211_internal_bss *res;
size_t privsz;

if (WARN_ON(!wiphy))
return NULL;

privsz = wiphy->bss_priv_size;

if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC &&
(signal < 0 || signal > 100)))
return NULL;

res = kzalloc(sizeof(*res) + privsz + ielen, gfp);
if (!res)
return NULL;

memcpy(res->pub.bssid, bssid, ETH_ALEN);
res->pub.channel = channel;
res->pub.signal = signal;
res->pub.tsf = timestamp;
res->pub.beacon_interval = beacon_interval;
res->pub.capability = capability;
/* point to after the private area */
res->pub.information_elements = (u8 *)res + sizeof(*res) + privsz;
memcpy(res->pub.information_elements, ie, ielen);
res->pub.len_information_elements = ielen;

kref_init(&res->ref);

res = cfg80211_bss_update(wiphy_to_dev(wiphy), res, 0);
if (!res)
return NULL;

if (res->pub.capability & WLAN_CAPABILITY_ESS)
regulatory_hint_found_beacon(wiphy, channel, gfp);

/* cfg80211_bss_update gives us a referenced result */
return &res->pub;
}
EXPORT_SYMBOL(cfg80211_inform_bss);

struct cfg80211_bss *
cfg80211_inform_bss_frame(struct wiphy *wiphy,
struct ieee80211_channel *channel,
Expand Down

0 comments on commit 8fb9ee1

Please sign in to comment.