From patchwork Fri Jun 28 08:39:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 2797661 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E6F89F3A0 for ; Fri, 28 Jun 2013 08:41:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C3012014E for ; Fri, 28 Jun 2013 08:41:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4673D2014A for ; Fri, 28 Jun 2013 08:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755392Ab3F1Iki (ORCPT ); Fri, 28 Jun 2013 04:40:38 -0400 Received: from cora.hrz.tu-chemnitz.de ([134.109.228.40]:45848 "EHLO cora.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755209Ab3F1Ikg (ORCPT ); Fri, 28 Jun 2013 04:40:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:Cc:To:From; bh=qOb8w3SXkjfQ5JZMp8EgLe0ckdJiZHG2kCn94knPoac=; b=UJQGNOphN+mJNf9WOvboahhg2O3X1F2DrExLq6+ZNftUYRQDjHemWZWh9JUtPpor5MHDGaw4vOfIrTdDDglfQ9qlbeQjBKa+CJXFORM+YuJv7bR4JvAxbHuaX8B6h97KXEEv1Ib2tVBc6GgXKNKWPl9lWyws2mZ5CkxJ7IIkyLY=; Received: from p549bc3b3.dip0.t-ipconnect.de ([84.155.195.179] helo=pandem0nium) by cora.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UsUDt-0006wa-1j; Fri, 28 Jun 2013 10:40:07 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1UsUDp-0006gF-Bm; Fri, 28 Jun 2013 10:40:01 +0200 From: Simon Wunderlich To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Mathias Kretschmer , Simon Wunderlich Subject: [PATCH 1/2] nl80211: enable HT overrides for ibss Date: Fri, 28 Jun 2013 10:39:58 +0200 Message-Id: <1372408799-25651-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.10.4 X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1372408805-0000051A-DACB5A77/0-0/0-0 X-Scan-AV: cora.hrz.tu-chemnitz.de; 2013-06-28 10:40:05; e7bcd3e2acd8b255d96f2f6c1edd60a3 X-Scan-SA: cora.hrz.tu-chemnitz.de; 2013-06-28 10:40:07; 926b2c1163acd688c21e33a6a4de1168 X-Spam-Score: -1.0 (-) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Simon Wunderlich Signed-off-by: Mathias Kretschmer --- include/net/cfg80211.h | 5 +++++ net/wireless/nl80211.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7b0730a..836b7e2 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1592,6 +1592,9 @@ struct cfg80211_disassoc_request { * user space. Otherwise, port is marked authorized by default. * @basic_rates: bitmap of basic rates to use when creating the IBSS * @mcast_rate: per-band multicast rate index + 1 (0: disabled) + * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask + * will be used in ht_capa. Un-supported values will be ignored. + * @ht_capa_mask: The bits of ht_capa which are to be used. */ struct cfg80211_ibss_params { u8 *ssid; @@ -1605,6 +1608,8 @@ struct cfg80211_ibss_params { bool privacy; bool control_port; int mcast_rate[IEEE80211_NUM_BANDS]; + struct ieee80211_ht_cap ht_capa; + struct ieee80211_ht_cap ht_capa_mask; }; /** diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7dc3343..d74230c 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6344,6 +6344,19 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) return err; } + if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) + memcpy(&ibss.ht_capa_mask, + nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]), + sizeof(ibss.ht_capa_mask)); + + if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { + if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) + return -EINVAL; + memcpy(&ibss.ht_capa, + nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), + sizeof(ibss.ht_capa)); + } + if (info->attrs[NL80211_ATTR_MCAST_RATE] && !nl80211_parse_mcast_rate(rdev, ibss.mcast_rate, nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE])))