From patchwork Sun Aug 12 17:36:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1309961 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 510A53FC23 for ; Sun, 12 Aug 2012 17:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014Ab2HLRgv (ORCPT ); Sun, 12 Aug 2012 13:36:51 -0400 Received: from contumacia.investici.org ([178.255.144.35]:48265 "EHLO contumacia.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852Ab2HLRgu (ORCPT ); Sun, 12 Aug 2012 13:36:50 -0400 Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 1EB64E834C; Sun, 12 Aug 2012 17:36:47 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 contumacia.investici.org 1EB64E834C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1344793008; bh=vATfSjHQ9LFAOPMe3DLqpKZ4yZ2Gx/BezEVHoChLldw=; h=From:To:Cc:Subject:Date:Message-Id; b=Va3tS1DUCA5AukGW/gcnXundipEkecibYGDoDHSl9pQyl4/BRF7unqCLeRvIxVn7g NuZiTJ5nVVHfftrwCTxuSJENCVOOti0Ch2AhrKYjUIJsr0P9BgYO3EU5+sCQv+WtzR swt7+CHy01HkVBcdOXRkO05Tb6iW9hP6qiHKZWc0= From: Antonio Quartulli To: "Luis R. Rodriguez" , Sujith Manoharan Cc: linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, Antonio Quartulli Subject: [PATCH] ath9k_htc: implement sta_rc_update() mac80211 callback Date: Sun, 12 Aug 2012 19:36:41 +0200 Message-Id: <1344793001-27085-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In case of changes in the supported rates set for a given station, it is now possible to use this callback to update the current internal state of the station in the htc driver. Reported-by: Gui Iribarren Signed-off-by: Antonio Quartulli --- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index c785129..2658d0a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -1331,6 +1331,34 @@ static int ath9k_htc_sta_remove(struct ieee80211_hw *hw, return ret; } +static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, u32 changed) +{ + struct ath9k_htc_priv *priv = hw->priv; + struct ath_common *common = ath9k_hw_common(priv->ah); + struct ath9k_htc_target_rate trate; + + mutex_lock(&priv->mutex); + ath9k_htc_ps_wakeup(priv); + + if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) { + memset(&trate, 0, sizeof(struct ath9k_htc_target_rate)); + ath9k_htc_setup_rate(priv, sta, &trate); + if (!ath9k_htc_send_rate_cmd(priv, &trate)) + ath_dbg(common, CONFIG, + "Supported rates for sta: %pM updated, rate caps: 0x%X\n", + sta->addr, be32_to_cpu(trate.capflags)); + else + ath_dbg(common, CONFIG, + "Unable to update supported rates for sta: %pM\n", + sta->addr); + } + + ath9k_htc_ps_restore(priv); + mutex_unlock(&priv->mutex); +} + static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) @@ -1758,6 +1786,7 @@ struct ieee80211_ops ath9k_htc_ops = { .sta_add = ath9k_htc_sta_add, .sta_remove = ath9k_htc_sta_remove, .conf_tx = ath9k_htc_conf_tx, + .sta_rc_update = ath9k_htc_sta_rc_update, .bss_info_changed = ath9k_htc_bss_info_changed, .set_key = ath9k_htc_set_key, .get_tsf = ath9k_htc_get_tsf,