From patchwork Tue Jan 12 08:43:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 72334 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0C8hXOP006430 for ; Tue, 12 Jan 2010 08:43:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753569Ab0ALInc (ORCPT ); Tue, 12 Jan 2010 03:43:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753573Ab0ALInb (ORCPT ); Tue, 12 Jan 2010 03:43:31 -0500 Received: from smtp.nokia.com ([192.100.122.233]:44887 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979Ab0ALInb (ORCPT ); Tue, 12 Jan 2010 03:43:31 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0C8hLM7026984; Tue, 12 Jan 2010 10:43:23 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 12 Jan 2010 10:43:22 +0200 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 12 Jan 2010 10:43:21 +0200 Received: from [127.0.1.1] (trdhcp21283.nmp.nokia.com [172.22.212.83]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0C8hH1W006766; Tue, 12 Jan 2010 10:43:18 +0200 Subject: [PATCH PATCH v6 6/7] wl1251: create qos null data template To: linville@tuxdriver.com From: Kalle Valo Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net, a.young.jason@gmail.com Date: Tue, 12 Jan 2010 10:43:07 +0200 Message-ID: <20100112084307.27492.16781.stgit@tikku> In-Reply-To: <20100112084059.27492.86738.stgit@tikku> References: <20100112084059.27492.86738.stgit@tikku> User-Agent: StGit/0.15 MIME-Version: 1.0 X-OriginalArrivalTime: 12 Jan 2010 08:43:22.0033 (UTC) FILETIME=[4C0B3A10:01CA9363] X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c index 4e373f3..4cf3545 100644 --- a/drivers/net/wireless/wl12xx/wl1251_main.c +++ b/drivers/net/wireless/wl12xx/wl1251_main.c @@ -585,6 +585,27 @@ static int wl1251_build_null_data(struct wl1251 *wl) } +static int wl1251_build_qos_null_data(struct wl1251 *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 wl1251_cmd_template_set(wl, CMD_QOS_NULL_DATA, &template, + sizeof(template)); +} + static int wl1251_build_ps_poll(struct wl1251 *wl, u16 aid) { struct wl12xx_ps_poll_template template; @@ -1119,6 +1140,10 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, if (ret < 0) goto out; + ret = wl1251_build_qos_null_data(wl); + if (ret < 0) + goto out; + if (wl->bss_type != BSS_TYPE_IBSS) { ret = wl1251_join(wl, wl->bss_type, wl->channel, wl->beacon_int, wl->dtim_period);