From patchwork Fri Nov 2 12:27:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1688211 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D5B2E3FD4E for ; Fri, 2 Nov 2012 12:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758878Ab2KBM2h (ORCPT ); Fri, 2 Nov 2012 08:28:37 -0400 Received: from latitanza.investici.org ([82.94.249.234]:25613 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758308Ab2KBM2g (ORCPT ); Fri, 2 Nov 2012 08:28:36 -0400 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 289A89814F; Fri, 2 Nov 2012 12:28:35 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 289A89814F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1351859315; bh=yW8uVXoh8HoIHARIKXGZpIyE0DEbei8DWJTRktFnZAM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=TeZU4Ek2CsimXTCbKJCJzd0LAN0Np1dtZcblzctbKXRd9gmy4wnaKgkRmDvpDjFY7 Lg22IUXBelFMNOhSEkHPcCPcJZfZ9RvGe5BakvFm4aHt4YeYuqSGFdRmIMEkMLwrhk elR9J9797OOLrajbExfpfpnIJjAbMwnvLH9Z/78k= From: Antonio Quartulli To: Johannes Berg Cc: "John W. Linville" , linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCHv5 2/2] mac80211: implement set_mcast_rate() callback Date: Fri, 2 Nov 2012 13:27:49 +0100 Message-Id: <1351859269-27134-2-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1351859269-27134-1-git-send-email-ordex@autistici.org> References: <1351859269-27134-1-git-send-email-ordex@autistici.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This new callback can be used to tune the rate to be used to send multicast frames. In the current state the multicast rate can be specified on IBSS/MESH joining only. This makes it impossible to select a custom multicast rate when then join command is sent by an external program (e.g. wpa_supplicant) Signed-off-by: Antonio Quartulli --- net/mac80211/cfg.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index eebb70b..80e0618 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1954,6 +1954,16 @@ static int ieee80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) return ieee80211_ibss_leave(IEEE80211_DEV_TO_SUB_IF(dev)); } +static int ieee80211_set_mcast_rate(struct wiphy *wiphy, struct net_device *dev, + int rate[IEEE80211_NUM_BANDS]) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + memcpy(sdata->vif.bss_conf.mcast_rate, rate, sizeof(rate)); + + return 0; +} + static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) { struct ieee80211_local *local = wiphy_priv(wiphy); @@ -3180,6 +3190,7 @@ struct cfg80211_ops mac80211_config_ops = { .disassoc = ieee80211_disassoc, .join_ibss = ieee80211_join_ibss, .leave_ibss = ieee80211_leave_ibss, + .set_mcast_rate = ieee80211_set_mcast_rate, .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power,