From patchwork Sat Jun 14 13:51:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jahnavi Meher X-Patchwork-Id: 4352551 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 854559F314 for ; Sat, 14 Jun 2014 13:52:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B39620222 for ; Sat, 14 Jun 2014 13:52:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF4F52021B for ; Sat, 14 Jun 2014 13:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754733AbaFNNv7 (ORCPT ); Sat, 14 Jun 2014 09:51:59 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:55827 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754515AbaFNNv7 (ORCPT ); Sat, 14 Jun 2014 09:51:59 -0400 Received: by mail-pb0-f41.google.com with SMTP id ma3so3031055pbc.0 for ; Sat, 14 Jun 2014 06:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=kPtV8wFE/gN/GlylOgsY9ZYKOGHYMk1vU59Cgv2pUSw=; b=zK/yHY/od+GQn4I7Om84JRvCxDz/UNh6vmFCWYiFz+cfnhYjbn5GLqq80hAbTiEbvg 6a8VH5UgMP2rFwsFw/z31F/79douO8SLSRqdR7XSa65bMM53FpEJ86dlcIBYXn8/3l/E IN9ACxm54pWFN4OtA//uj8rC1B9eudK7ZGb5Gy5pcjt+jYi5im0YNr0vp+wvuVAXWO6+ XobY5qLox6fI6VHvJ9Ty4NVHTSGDU/tuhpUxDDPButxwse6SR1rf8Z0gUu8PXrjyEATG AYrVX0aXCHlFTryckpXikK0Tf5TDTIQTQFQlOsUwKzNtbk91BMVdvcRhBzrBVZ2cfsXd jI1g== X-Received: by 10.68.196.137 with SMTP id im9mr10897314pbc.105.1402753918959; Sat, 14 Jun 2014 06:51:58 -0700 (PDT) Received: from localhost.localdomain ([115.248.87.14]) by mx.google.com with ESMTPSA id ln2sm37726387pab.35.2014.06.14.06.51.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 14 Jun 2014 06:51:58 -0700 (PDT) From: Jahnavi Meher To: Subject: [PATCH 07/16] rsi: Changed rate handling. Date: Sat, 14 Jun 2014 19:21:49 +0530 Message-Id: <1402753909-14040-1-git-send-email-jahnavi.meher@gmail.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-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 Changed rate handling. Signed-off-by: Jahnavi Meher --- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 35 ++++++++++++++---------------- 1 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c index 5c122e8..f5182cd 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c @@ -942,7 +942,7 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) struct ieee80211_hw *hw = common->priv->hw; u8 band = hw->conf.chandef.chan->band; u8 num_supported_rates = 0; - u8 rate_offset = 0; + u8 rate_table_offset, rate_offset = 0; u32 rate_bitmap = common->bitrate_mask[band]; u16 *selected_rates, min_rate; @@ -978,14 +978,18 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) if (common->channel_width == BW_40MHZ) auto_rate->desc_word[7] |= cpu_to_le16(1); - if (band == IEEE80211_BAND_2GHZ) - min_rate = STD_RATE_01; - else - min_rate = STD_RATE_06; + if (band == IEEE80211_BAND_2GHZ) { + min_rate = RSI_RATE_1; + rate_table_offset = 0; + } else { + min_rate = RSI_RATE_6; + rate_table_offset = 4; + } for (ii = 0, jj = 0; ii < ARRAY_SIZE(rsi_rates); ii++) { if (rate_bitmap & BIT(ii)) { - selected_rates[jj++] = (rsi_rates[ii].bitrate / 5); + selected_rates[jj++] = + (rsi_rates[ii + rate_table_offset].bitrate / 5); rate_offset++; } } @@ -998,13 +1002,6 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) rate_offset += ARRAY_SIZE(mcs); } - if (rate_offset < (RSI_TBL_SZ / 2) - 1) { - for (ii = jj; ii < (RSI_TBL_SZ / 2); ii++) { - selected_rates[jj++] = min_rate; - rate_offset++; - } - } - sort(selected_rates, jj, sizeof(u16), &rsi_compare, NULL); /* mapping the rates to RSI rates */ @@ -1020,25 +1017,25 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) /* loading HT rates in the bottom half of the auto rate table */ if (common->vif_info[0].is_ht) { - if (common->vif_info[0].sgi) - auto_rate->supported_rates[rate_offset++] = - cpu_to_le16(RSI_RATE_MCS7_SG); - for (ii = rate_offset, kk = ARRAY_SIZE(rsi_mcsrates) - 1; ii < rate_offset + 2 * ARRAY_SIZE(rsi_mcsrates); ii++) { - if (common->vif_info[0].sgi) + if (common->vif_info[0].sgi || + conf_is_ht40(&common->priv->hw->conf)) auto_rate->supported_rates[ii++] = cpu_to_le16(rsi_mcsrates[kk] | BIT(9)); auto_rate->supported_rates[ii] = cpu_to_le16(rsi_mcsrates[kk--]); } - for (; ii < RSI_TBL_SZ; ii++) { + for (; ii < (RSI_TBL_SZ - 1); ii++) { auto_rate->supported_rates[ii] = cpu_to_le16(rsi_mcsrates[0]); } } + for (; ii < RSI_TBL_SZ; ii++) + auto_rate->supported_rates[ii] = min_rate; + auto_rate->num_supported_rates = cpu_to_le16(num_supported_rates * 2); auto_rate->moderate_rate_inx = cpu_to_le16(num_supported_rates / 2); auto_rate->desc_word[7] |= cpu_to_le16(0 << 8);