diff options
author | Kalle Valo <kalle.valo@nokia.com> | 2010-03-18 06:26:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-23 16:50:21 -0400 |
commit | 899e6e65c39990a76c17940625dbe6001f618734 (patch) | |
tree | f35b111f6659ce50f3a92640961b87279b10fed8 /drivers/net | |
parent | 12bd89499f22ec01bbff21fd04a347ee82726bf6 (diff) |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c index d59b3830a6a5..3a615fac54e8 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.c +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c | |||
@@ -776,41 +776,37 @@ static int wl1271_build_extended_rates(u8 *rates, u8 band) | |||
776 | 776 | ||
777 | int wl1271_cmd_build_null_data(struct wl1271 *wl) | 777 | int wl1271_cmd_build_null_data(struct wl1271 *wl) |
778 | { | 778 | { |
779 | struct wl12xx_null_data_template template; | 779 | struct sk_buff *skb; |
780 | int ret = 0; | ||
780 | 781 | ||
781 | if (!is_zero_ether_addr(wl->bssid)) { | 782 | skb = ieee80211_nullfunc_get(wl->hw, wl->vif); |
782 | memcpy(template.header.da, wl->bssid, ETH_ALEN); | 783 | if (!skb) |
783 | memcpy(template.header.bssid, wl->bssid, ETH_ALEN); | 784 | goto out; |
784 | } else { | ||
785 | memset(template.header.da, 0xff, ETH_ALEN); | ||
786 | memset(template.header.bssid, 0xff, ETH_ALEN); | ||
787 | } | ||
788 | 785 | ||
789 | memcpy(template.header.sa, wl->mac_addr, ETH_ALEN); | 786 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, skb->data, |
790 | template.header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_DATA | | 787 | skb->len); |
791 | IEEE80211_STYPE_NULLFUNC | | ||
792 | IEEE80211_FCTL_TODS); | ||
793 | 788 | ||
794 | return wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, &template, | 789 | out: |
795 | sizeof(template)); | 790 | dev_kfree_skb(skb); |
791 | return ret; | ||
796 | 792 | ||
797 | } | 793 | } |
798 | 794 | ||
799 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid) | 795 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid) |
800 | { | 796 | { |
801 | struct wl12xx_ps_poll_template template; | 797 | struct sk_buff *skb; |
802 | 798 | int ret = 0; | |
803 | memcpy(template.bssid, wl->bssid, ETH_ALEN); | ||
804 | memcpy(template.ta, wl->mac_addr, ETH_ALEN); | ||
805 | |||
806 | /* aid in PS-Poll has its two MSBs each set to 1 */ | ||
807 | template.aid = cpu_to_le16(1 << 15 | 1 << 14 | aid); | ||
808 | 799 | ||
809 | template.fc = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); | 800 | skb = ieee80211_pspoll_get(wl->hw, wl->vif); |
801 | if (!skb) | ||
802 | goto out; | ||
810 | 803 | ||
811 | return wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, &template, | 804 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, skb->data, |
812 | sizeof(template)); | 805 | skb->len); |
813 | 806 | ||
807 | out: | ||
808 | dev_kfree_skb(skb); | ||
809 | return ret; | ||
814 | } | 810 | } |
815 | 811 | ||
816 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len, | 812 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len, |