Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183381
b: refs/heads/master
c: e0d8bbf
h: refs/heads/master
i:
  183379: 4e32f04
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Dec 28, 2009
1 parent 7fd64a6 commit 3643987
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26a63f6af58144818d4979cce1cbb8e49329f732
refs/heads/master: e0d8bbf0d23e6b82f13b29f39593d5d13d923b2b
45 changes: 43 additions & 2 deletions trunk/drivers/net/wireless/wl12xx/wl1271_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,11 +1139,15 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw,

static int wl1271_join_channel(struct wl1271 *wl, int channel)
{
int ret;
int ret = 0;
/* we need to use a dummy BSSID for now */
static const u8 dummy_bssid[ETH_ALEN] = { 0x0b, 0xad, 0xde,
0xad, 0xbe, 0xef };

/* the dummy join is not required for ad-hoc */
if (wl->bss_type == BSS_TYPE_IBSS)
goto out;

/* disable mac filter, so we hear everything */
wl->rx_config &= ~CFG_BSSID_FILTER_EN;

Expand Down Expand Up @@ -1572,6 +1576,42 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
wl->joined = true;
}

if (wl->bss_type == BSS_TYPE_IBSS) {
/* FIXME: This implements rudimentary ad-hoc support -
proper templates are on the wish list and notification
on when they change. This patch will update the templates
on every call to this function. Also, the firmware will not
answer to probe-requests as it does not have the proper
SSID set in the JOIN command. The probe-response template
is set nevertheless, as the FW will ASSERT without it */
struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);

if (beacon) {
struct ieee80211_hdr *hdr;
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON,
beacon->data,
beacon->len);

if (ret < 0) {
dev_kfree_skb(beacon);
goto out_sleep;
}

hdr = (struct ieee80211_hdr *) beacon->data;
hdr->frame_control = cpu_to_le16(
IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_PROBE_RESP);

ret = wl1271_cmd_template_set(wl,
CMD_TEMPL_PROBE_RESPONSE,
beacon->data,
beacon->len);
dev_kfree_skb(beacon);
if (ret < 0)
goto out_sleep;
}
}

if (changed & BSS_CHANGED_ASSOC) {
if (bss_conf->assoc) {
wl->aid = bss_conf->aid;
Expand Down Expand Up @@ -1857,7 +1897,8 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
IEEE80211_HW_BEACON_FILTER |
IEEE80211_HW_SUPPORTS_PS;

wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC);
wl->hw->wiphy->max_scan_ssids = 1;
wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz;

Expand Down

0 comments on commit 3643987

Please sign in to comment.