]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
wl1271: create qos nullfunc template
authorKalle Valo <kalle.valo@nokia.com>
Thu, 18 Mar 2010 10:26:36 +0000 (12:26 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 23 Mar 2010 20:50:22 +0000 (16:50 -0400)
Needed for U-APSD.

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>
drivers/net/wireless/wl12xx/wl1271_cmd.c
drivers/net/wireless/wl12xx/wl1271_cmd.h

index 8364270b2d5c3742ba37bb22d8543215a7b598a8..0cbb0e1e3d40275d21bf9dfbf497737d3d036ea8 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/crc7.h>
 #include <linux/spi/spi.h>
 #include <linux/etherdevice.h>
+#include <linux/ieee80211.h>
 
 #include "wl1271.h"
 #include "wl1271_reg.h"
@@ -778,6 +779,27 @@ out:
        return ret;
 }
 
+int wl1271_build_qos_null_data(struct wl1271 *wl)
+{
+       struct ieee80211_qos_hdr template;
+
+       memset(&template, 0, sizeof(template));
+
+       memcpy(template.addr1, wl->bssid, ETH_ALEN);
+       memcpy(template.addr2, wl->mac_addr, ETH_ALEN);
+       memcpy(template.addr3, wl->bssid, ETH_ALEN);
+
+       template.frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
+                                            IEEE80211_STYPE_QOS_NULLFUNC |
+                                            IEEE80211_FCTL_TODS);
+
+       /* FIXME: not sure what priority to use here */
+       template.qos_ctrl = cpu_to_le16(0);
+
+       return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template,
+                                      sizeof(template));
+}
+
 int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id)
 {
        struct wl1271_cmd_set_keys *cmd;
index e936d3ace7b88e27ab4872234e63cbf2df000f32..6324bbf36843f3a9daf4cf5ecfdcda986d1d2f8d 100644 (file)
@@ -51,6 +51,7 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
 int wl1271_cmd_build_probe_req(struct wl1271 *wl,
                               const u8 *ssid, size_t ssid_len,
                               const u8 *ie, size_t ie_len, u8 band);
+int wl1271_build_qos_null_data(struct wl1271 *wl);
 int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id);
 int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
                       u8 key_size, const u8 *key, const u8 *addr,