Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193835
b: refs/heads/master
c: 899e6e6
h: refs/heads/master
i:
  193833: b278388
  193831: 7faa0b9
v: v3
  • Loading branch information
Kalle Valo authored and John W. Linville committed Mar 23, 2010
1 parent 49db8b2 commit 87400b3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 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: 12bd89499f22ec01bbff21fd04a347ee82726bf6
refs/heads/master: 899e6e65c39990a76c17940625dbe6001f618734
44 changes: 20 additions & 24 deletions trunk/drivers/net/wireless/wl12xx/wl1271_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,41 +776,37 @@ static int wl1271_build_extended_rates(u8 *rates, u8 band)

int wl1271_cmd_build_null_data(struct wl1271 *wl)
{
struct wl12xx_null_data_template template;
struct sk_buff *skb;
int ret = 0;

if (!is_zero_ether_addr(wl->bssid)) {
memcpy(template.header.da, wl->bssid, ETH_ALEN);
memcpy(template.header.bssid, wl->bssid, ETH_ALEN);
} else {
memset(template.header.da, 0xff, ETH_ALEN);
memset(template.header.bssid, 0xff, ETH_ALEN);
}
skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
if (!skb)
goto out;

memcpy(template.header.sa, wl->mac_addr, ETH_ALEN);
template.header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_DATA |
IEEE80211_STYPE_NULLFUNC |
IEEE80211_FCTL_TODS);
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, skb->data,
skb->len);

return wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, &template,
sizeof(template));
out:
dev_kfree_skb(skb);
return ret;

}

int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid)
{
struct wl12xx_ps_poll_template template;

memcpy(template.bssid, wl->bssid, ETH_ALEN);
memcpy(template.ta, wl->mac_addr, ETH_ALEN);

/* aid in PS-Poll has its two MSBs each set to 1 */
template.aid = cpu_to_le16(1 << 15 | 1 << 14 | aid);
struct sk_buff *skb;
int ret = 0;

template.fc = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL);
skb = ieee80211_pspoll_get(wl->hw, wl->vif);
if (!skb)
goto out;

return wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, &template,
sizeof(template));
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, skb->data,
skb->len);

out:
dev_kfree_skb(skb);
return ret;
}

int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len,
Expand Down

0 comments on commit 87400b3

Please sign in to comment.