wl1271: get pspoll and nullfunc templates from mac80211

mac80211 now can create pspoll and nullfunc templates, better to use those.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Kalle Valo 2010-03-18 12:26:34 +02:00 committed by John W. Linville
parent 12bd89499f
commit 899e6e65c3
1 changed files with 20 additions and 24 deletions

View File

@ -776,41 +776,37 @@ static int wl1271_build_extended_rates(u8 *rates, u8 band)
int wl1271_cmd_build_null_data(struct wl1271 *wl) 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)) { skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
memcpy(template.header.da, wl->bssid, ETH_ALEN); if (!skb)
memcpy(template.header.bssid, wl->bssid, ETH_ALEN); goto out;
} else {
memset(template.header.da, 0xff, ETH_ALEN);
memset(template.header.bssid, 0xff, ETH_ALEN);
}
memcpy(template.header.sa, wl->mac_addr, ETH_ALEN); ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, skb->data,
template.header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_DATA | skb->len);
IEEE80211_STYPE_NULLFUNC |
IEEE80211_FCTL_TODS);
return wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, &template, out:
sizeof(template)); dev_kfree_skb(skb);
return ret;
} }
int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid) int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid)
{ {
struct wl12xx_ps_poll_template template; struct sk_buff *skb;
int ret = 0;
memcpy(template.bssid, wl->bssid, ETH_ALEN); skb = ieee80211_pspoll_get(wl->hw, wl->vif);
memcpy(template.ta, wl->mac_addr, ETH_ALEN); if (!skb)
goto out;
/* aid in PS-Poll has its two MSBs each set to 1 */ ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, skb->data,
template.aid = cpu_to_le16(1 << 15 | 1 << 14 | aid); skb->len);
template.fc = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL);
return wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, &template,
sizeof(template));
out:
dev_kfree_skb(skb);
return ret;
} }
int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len, int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len,