From patchwork Thu Dec 31 13:37:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 70389 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 nBVDesB5003126 for ; Thu, 31 Dec 2009 13:40:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752038AbZLaNkx (ORCPT ); Thu, 31 Dec 2009 08:40:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751926AbZLaNkx (ORCPT ); Thu, 31 Dec 2009 08:40:53 -0500 Received: from smtp.nokia.com ([192.100.105.134]:26291 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbZLaNkw (ORCPT ); Thu, 31 Dec 2009 08:40:52 -0500 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBVDeCKX025396; Thu, 31 Dec 2009 07:40:16 -0600 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 31 Dec 2009 15:37:51 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 31 Dec 2009 15:37:51 +0200 Received: from [127.0.1.1] (essapo-nirac253202.europe.nokia.com [10.162.253.202]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBVDbnwO012998; Thu, 31 Dec 2009 15:37:49 +0200 Subject: [RFC PATCH v5 6/7] wl1251: create qos null data template To: linux-wireless@vger.kernel.org From: Kalle Valo Cc: johannes@sipsolutions.net, a.young.jason@gmail.com Date: Thu, 31 Dec 2009 15:37:49 +0200 Message-ID: <20091231133748.29899.82916.stgit@tikku> In-Reply-To: <20091231133626.29899.95683.stgit@tikku> References: <20091231133626.29899.95683.stgit@tikku> User-Agent: StGit/0.15 MIME-Version: 1.0 X-OriginalArrivalTime: 31 Dec 2009 13:37:51.0378 (UTC) FILETIME=[72D64F20:01CA8A1E] 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);