From patchwork Fri Nov 19 11:40:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 339141 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAJBej1v017089 for ; Fri, 19 Nov 2010 11:40:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504Ab0KSLkm (ORCPT ); Fri, 19 Nov 2010 06:40:42 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:65219 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753270Ab0KSLkm (ORCPT ); Fri, 19 Nov 2010 06:40:42 -0500 Received: by bwz15 with SMTP id 15so3773153bwz.19 for ; Fri, 19 Nov 2010 03:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=W7gscB0VafAMgOHZuh4NNTXs2ePv8GEtylrEaK8EL98=; b=NBcYcpdyIOXUjVSPFvByRBAssQfDulaHDXKFCwE06N4/gw3SwNeyzBdcAOTrmLpuPN W8J+YALyQL5NDpK9RO7vP8oHKgc+2ERoV7yqUbYYoI3U3jtGAByUjYnh3+WnSjJZF4Oj Dx3QrbQk7BY+eZIGuuP8xs+yH+i2p+wzTlhNU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=o+Z7XwdzvF5qQVcy4UrcXqiXQDf1c8rxD+3oXyle4wImSInJqXIa0kx1b/KkBi720C kfehuYDA4AYVO4wkdo7RyXkJZfvw5rdpXa29yd2X0Noce0bd8vViXAuuS2/u/uCJY2dd eMgq8KpB0bBZnBv4TIHPRFnafUCe4IcbceWcY= Received: by 10.204.73.7 with SMTP id o7mr1924583bkj.7.1290166840936; Fri, 19 Nov 2010 03:40:40 -0800 (PST) Received: from localhost.localdomain (p5495FCE2.dip.t-dialin.net [84.149.252.226]) by mx.google.com with ESMTPS id d12sm793856bkw.19.2010.11.19.03.40.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Nov 2010 03:40:39 -0800 (PST) From: Helmut Schaa To: "John W. Linville" Cc: linux-wireless@vger.kernel.org, Helmut Schaa , Johannes Berg Subject: [PATCH 1/2] cfg80211: Add new BSS attribute ht_opmode Date: Fri, 19 Nov 2010 12:40:25 +0100 Message-Id: <1290166826-27063-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 19 Nov 2010 11:40:46 +0000 (UTC) diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 037b4e4..edac2ef 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h @@ -828,6 +828,8 @@ enum nl80211_commands { * * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS * + * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) + * * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use */ @@ -1002,6 +1004,8 @@ enum nl80211_attrs { NL80211_ATTR_MCAST_RATE, + NL80211_ATTR_BSS_HT_OPMODE, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 91f0995..a2be9e6 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -605,6 +605,8 @@ struct mpath_info { * (or NULL for no change) * @basic_rates_len: number of basic rates * @ap_isolate: do not forward packets between connected stations + * @ht_opmode: HT Operation mode + * (u16 = opmode, -1 = do not change) */ struct bss_parameters { int use_cts_prot; @@ -613,6 +615,7 @@ struct bss_parameters { u8 *basic_rates; u8 basic_rates_len; int ap_isolate; + int ht_opmode; }; struct mesh_config { diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index b15eb77..d692570 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -121,6 +121,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { [NL80211_ATTR_BSS_SHORT_SLOT_TIME] = { .type = NLA_U8 }, [NL80211_ATTR_BSS_BASIC_RATES] = { .type = NLA_BINARY, .len = NL80211_MAX_SUPP_RATES }, + [NL80211_ATTR_BSS_HT_OPMODE] = { .type = NLA_U16 }, [NL80211_ATTR_MESH_PARAMS] = { .type = NLA_NESTED }, @@ -2435,6 +2436,7 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) params.use_short_preamble = -1; params.use_short_slot_time = -1; params.ap_isolate = -1; + params.ht_opmode = -1; if (info->attrs[NL80211_ATTR_BSS_CTS_PROT]) params.use_cts_prot = @@ -2453,6 +2455,9 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) } if (info->attrs[NL80211_ATTR_AP_ISOLATE]) params.ap_isolate = !!nla_get_u8(info->attrs[NL80211_ATTR_AP_ISOLATE]); + if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE]) + params.ht_opmode = + nla_get_u16(info->attrs[NL80211_ATTR_BSS_HT_OPMODE]); if (!rdev->ops->change_bss) return -EOPNOTSUPP;