From patchwork Sun Nov 9 16:50:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 5261531 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 63BDBC11AC for ; Sun, 9 Nov 2014 16:50:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7790D20142 for ; Sun, 9 Nov 2014 16:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F34D2011D for ; Sun, 9 Nov 2014 16:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751769AbaKIQu1 (ORCPT ); Sun, 9 Nov 2014 11:50:27 -0500 Received: from mail-wi0-f170.google.com ([209.85.212.170]:48302 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbaKIQu0 (ORCPT ); Sun, 9 Nov 2014 11:50:26 -0500 Received: by mail-wi0-f170.google.com with SMTP id r20so8092113wiv.3 for ; Sun, 09 Nov 2014 08:50:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RWpK/NyXiMj+yxzQp13NGL9HyBSxAIUGk+CCT/0fzSk=; b=cauEj2qpmbbk282iQHRo9Fe7GUKV/Db3NcoXWTlEWkBViSHJJ0GpPyS2RoU7B2X+ur WFqfMxeeG4u8YvFV7mZp1B7w/JlATIfqVZr2SwY4q+eUIT44VkftCuQ8iYOWCfDezmMz iW5SxMOpwKFOV+4vASbrCyCzWJKbj9r6QmESGg6xK7mFZADurMTs0peDXBV7n908o8Du X5uOYxDZNxw9o+P1H9AqdrSxopcXK6xhx23V2xaMnTWa6Rpq/sg5j4bnf7HC31mA/5/p ZKbKuRanMtOM/kKaI3weIasB3ddu0QDee24lr1F2ayijRDp5WIDsArFxq0pmOwsFgNMQ 9OUQ== X-Gm-Message-State: ALoCoQm29Rfaj+5WDB1E8qnEh4E9VyMOGLa2TaeZMXU9hVa6ILbzoENN9WdoKHHPnDq9h0Th4VOK X-Received: by 10.180.104.229 with SMTP id gh5mr1636225wib.12.1415551825027; Sun, 09 Nov 2014 08:50:25 -0800 (PST) Received: from athena.amr.corp.intel.com (93-172-126-236.bb.netvision.net.il. [93.172.126.236]) by mx.google.com with ESMTPSA id r2sm9994037wif.23.2014.11.09.08.50.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Nov 2014 08:50:24 -0800 (PST) From: Arik Nemtsov To: Cc: Johannes Berg , Liad Kaufman , Arik Nemtsov Subject: [PATCH 01/16] mac80211: add option for setting skb flags before xmit Date: Sun, 9 Nov 2014 18:50:07 +0200 Message-Id: <1415551822-20121-1-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_RHS_DOB autolearn=ham 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 From: Liad Kaufman Allows setting of an skb's flags - if needed - when calling ieee80211_subif_start_xmit(). Signed-off-by: Liad Kaufman Reviewed-by: Johannes Berg Signed-off-by: Arik Nemtsov --- net/mac80211/ieee80211_i.h | 3 +++ net/mac80211/tx.c | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a51c993..208953d 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1625,6 +1625,9 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev); netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev); +void __ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev, + u32 info_flags); void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, struct sk_buff_head *skbs); diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 3ffd91f..66af35f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1787,21 +1787,22 @@ static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local, } /** - * ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type + * __ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type * subinterfaces (wlan#, WDS, and VLAN interfaces) * @skb: packet to be sent * @dev: incoming interface + * @info_flags: skb flags to set * - * Returns: NETDEV_TX_OK both on success and on failure. On failure skb will - * be freed. + * On failure skb will be freed. * * This function takes in an Ethernet header and encapsulates it with suitable * IEEE 802.11 header based on which interface the packet is coming in. The * encapsulated packet will then be passed to master interface, wlan#.11, for * transmission (through low-level driver). */ -netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, - struct net_device *dev) +void __ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev, + u32 info_flags) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; @@ -1819,7 +1820,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, bool wme_sta = false, authorized = false, tdls_auth = false; bool tdls_peer = false, tdls_setup_frame = false; bool multicast; - u32 info_flags = 0; u16 info_id = 0; struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_sub_if_data *ap_sdata; @@ -2224,15 +2224,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ieee80211_xmit(sdata, skb, band); rcu_read_unlock(); - return NETDEV_TX_OK; + return; fail_rcu: rcu_read_unlock(); fail: dev_kfree_skb(skb); - return NETDEV_TX_OK; } +netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev) +{ + __ieee80211_subif_start_xmit(skb, dev, 0); + return NETDEV_TX_OK; +} /* * ieee80211_clear_tx_pending may not be called in a context where