From patchwork Sun Feb 3 01:02:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2085031 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 42F31DFE76 for ; Sun, 3 Feb 2013 01:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689Ab3BCBDd (ORCPT ); Sat, 2 Feb 2013 20:03:33 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:43400 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492Ab3BCBDa (ORCPT ); Sat, 2 Feb 2013 20:03:30 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so2187966dak.33 for ; Sat, 02 Feb 2013 17:03:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=pzEOC2oqHkDoV/QKKY2ZXX/7XKNlG/ywmIpWqZsuUWQ=; b=ZQXQID3p4gs041oerd3fBuMGwMQIVKojKRRttRPYezlbQdBNcsFQFH027PRwvohq/z fOVayZXblrISzeUX2OgY6ue+Wvt5mPucuy504kzYSk3TsopTKKAAoDVEseNnADoqA76A 1/C2llDd7KCIE0Sj5/QHd5dlSS27ZJGs6sDyEkMq2Dz0TrChRc4WgaPE29oOic8QJaWg IXM4d2PIndyOS6Xi6IXEh8Qqb+kIrMf+siwELcJI1oNcVIWQ7g67ouk45F7pIif1bhAn Wl81AWWgvL81ULvx7+iWiYEjl6mGSd+toFIy5K4c5XA3i4RmKXkEYIDm/N+mSTB/2GO9 P+jQ== X-Received: by 10.68.137.131 with SMTP id qi3mr43883378pbb.114.1359853410505; Sat, 02 Feb 2013 17:03:30 -0800 (PST) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPS id i6sm13998384paw.19.2013.02.02.17.03.28 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 02 Feb 2013 17:03:29 -0800 (PST) From: Thomas Pedersen To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, devel@lists.open80211s.org, Thomas Pedersen Subject: [PATCH 2/3] mac80211: generate mesh probe requests Date: Sat, 2 Feb 2013 17:02:20 -0800 Message-Id: <1359853341-29237-3-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359853341-29237-1-git-send-email-thomas@cozybit.com> References: <1359853341-29237-1-git-send-email-thomas@cozybit.com> X-Gm-Message-State: ALoCoQn2qX16cEuK/HVWd7n8FU+A5NihAOCk2/wFvUtwmYN5ow6bQO72+9s8iiIaUABV664uliAH Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A mesh probe request must include the mesh ID IE and a wildcard SSID IE. Add this and transpose the SSID scan list into mesh IDs for mesh interfaces. Also allow the user to specify a mesh ID IE in the user scan IEs, since additional SSID IEs seem to be allowed. Signed-off-by: Thomas Pedersen --- net/mac80211/tx.c | 15 +++++++++++---- net/mac80211/util.c | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 01dc001..9f3e9ba 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2622,11 +2622,18 @@ struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, memcpy(hdr->addr2, vif->addr, ETH_ALEN); eth_broadcast_addr(hdr->addr3); - pos = skb_put(skb, ie_ssid_len); - *pos++ = WLAN_EID_SSID; + if (ieee80211_vif_is_mesh(vif)) { + pos = skb_put(skb, 2 + 2 + ssid_len); + *pos++ = WLAN_EID_SSID; + *pos++ = 0; + /* NOTE: mesh ID will be out of order */ + *pos++ = WLAN_EID_MESH_ID; + } else { + pos = skb_put(skb, 2 + ssid_len); + *pos++ = WLAN_EID_SSID; + } *pos++ = ssid_len; - if (ssid_len) - memcpy(pos, ssid, ssid_len); + memcpy(pos, ssid, ssid_len); pos += ssid_len; return skb; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 139ad9b..aeb0f88 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1181,6 +1181,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, if (ie && ie_len) { static const u8 before_ht[] = { WLAN_EID_SSID, + WLAN_EID_MESH_ID, WLAN_EID_SUPP_RATES, WLAN_EID_REQUEST, WLAN_EID_EXT_SUPP_RATES,