From patchwork Mon Feb 10 12:12:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 3618471 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 CCBB1BF418 for ; Mon, 10 Feb 2014 12:13:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E162201D3 for ; Mon, 10 Feb 2014 12:13:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FC3D201CD for ; Mon, 10 Feb 2014 12:13:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526AbaBJMN1 (ORCPT ); Mon, 10 Feb 2014 07:13:27 -0500 Received: from mail-ee0-f42.google.com ([74.125.83.42]:50549 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbaBJMN0 (ORCPT ); Mon, 10 Feb 2014 07:13:26 -0500 Received: by mail-ee0-f42.google.com with SMTP id b15so2904263eek.1 for ; Mon, 10 Feb 2014 04:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=AZnHP/VPZHsqSPR8VOdUjmMRa/it5PJH5czIXbdlUZk=; b=yVlwIEpUW3pZSll4wFaOgYQJ20Vfhb4/fyNHDtcI4rUhWN/at8OaJtgx1xDsl8ul03 7OAXkHX3gL1uk7jOLBi3DPms+x2EFRL8vN77L3diYhGn4w/19rpMoxbspHHwD63Rcosj 5bZUQl8jYG3J7wsZ/Ql1cuQq6p668s0LZ64rk= 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=AZnHP/VPZHsqSPR8VOdUjmMRa/it5PJH5czIXbdlUZk=; b=bYPR3mIQiRctptYg7kkhkT2wpuupSGX0hgXMGSs4UvGWAYgHnuP+u0Lydacr7Ss9te uUN2qJ6ag1v6tfcuupApQs7/umdliCFt1WH4GobsecGjs3EefzL1K20nOfUxpvjMwtJC yKfNbNFffOIHwXdPNhfwhomVV4NR+XcvBbDKi782Uw20AtCQXh3N2JAKXm9RSHF3uTQr rQKi77pAJsFaZNjM0idGNMTdpxwXxLoFXoMYIjVlro/MMxFgGVAVSVdY2ISBjUREvsVe abnaXA/LYUqed4PMvbUK0vno6H97QqvHS3LyiQKff/0fsA7aOhs1ln1N9nnRAxSTGWoN cc4g== X-Gm-Message-State: ALoCoQmmUhZTU0qBbAU7q9RTQFBctj7koDJ6XF+/KNMLyJBwkBe994nE4rgjQbGa4dBAoCCYXmnzT1yKrOGjyjJ2wPyD0CCUoIDsM8Etht6c98kz6KNxIdA= X-Received: by 10.14.204.9 with SMTP id g9mr2287394eeo.82.1392034405505; Mon, 10 Feb 2014 04:13:25 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id j42sm54172054eep.21.2014.02.10.04.13.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 04:13:24 -0800 (PST) From: Bartosz Markowski To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Bartosz Markowski Subject: [PATCH] ath10k: AP: handle HT station which does not have HT RX MCS Date: Mon, 10 Feb 2014 13:12:55 +0100 Message-Id: <1392034375-13532-1-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 1.7.9.5 X-DomainID: tieto.com 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_SIGNED, 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 This is a workaround for HT-enabled STAs which break the spec and have no HT capabilities RX mask (no HT RX MCS map). As per spec, in section 20.3.5 Modulation and coding scheme (MCS), MCS 0 through 7 are mandatory in 20MHz with 800 ns GI at all STAs. Firmware asserts if such situation occurs. Signed-off-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/mac.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 144b4d6..162920a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1148,8 +1148,23 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar, if (ht_cap->mcs.rx_mask[i/8] & (1 << i%8)) arg->peer_ht_rates.rates[n++] = i; - arg->peer_ht_rates.num_rates = n; - arg->peer_num_spatial_streams = max((n+7) / 8, 1); + /* + * This is a workaround for HT-enabled STAs which break the spec + * and have no HT capabilities RX mask (no HT RX MCS map). + * + * As per spec, in section 20.3.5 Modulation and coding scheme (MCS), + * MCS 0 through 7 are mandatory in 20MHz with 800 ns GI at all STAs. + * + * Firmware asserts if such situation occurs. + */ + if (n == 0) { + arg->peer_ht_rates.num_rates = 8; + for (i = 0; i < arg->peer_ht_rates.num_rates; i++) + arg->peer_ht_rates.rates[i] = i; + } else { + arg->peer_ht_rates.num_rates = n; + arg->peer_num_spatial_streams = max((n+7) / 8, 1); + } ath10k_dbg(ATH10K_DBG_MAC, "mac ht peer %pM mcs cnt %d nss %d\n", arg->addr,