From patchwork Tue Nov 15 09:56:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 9429263 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33CD460484 for ; Tue, 15 Nov 2016 10:02:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21B5C28B6C for ; Tue, 15 Nov 2016 10:02:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16BCD28B72; Tue, 15 Nov 2016 10:02:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BADA128B6C for ; Tue, 15 Nov 2016 10:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941376AbcKOKCa (ORCPT ); Tue, 15 Nov 2016 05:02:30 -0500 Received: from ni.piap.pl ([195.187.100.4]:36858 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937351AbcKOKC2 (ORCPT ); Tue, 15 Nov 2016 05:02:28 -0500 X-Greylist: delayed 347 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2016 05:02:28 EST Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTP id 88048441A0E; Tue, 15 Nov 2016 10:56:37 +0100 (CET) From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: QCA ath9k Development , Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected Date: Tue, 15 Nov 2016 10:56:37 +0100 Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 105500 [Nov 15 2016] X-KLMS-AntiSpam-Version: 5.7.0.14 X-KLMS-AntiSpam-Envelope-From: khalasa@piap.pl X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Info: LuaCore: 146 146 ca296b6febd88566e5c05beab84d29a62059872c, Auth:dkim=none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2016/11/14 07:44:19 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2016/11/15 02:09:00 #8102272 X-KLMS-AntiVirus-Status: Clean, skipped Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I recently tried to select a single antenna on AR9300 and it works for 30 seconds only. The subsequent calibration makes the RX signal level to drop from the usual -30/-40 dBm to -70/-80 dBm, and the transmission practically stops. With the attached patch it works, though selecting the antenna doesn't seem to have any visible effect, at least with "iw wlanX station dump" (perhaps it works for TX). I'm using ad-hoc mode: rmmod ath9k modprobe ath9k iw dev wlan0 set type ibss iw phy phyX set antenna 2 ip link set up dev wlan0 iw dev wlan0 set bitrates legacy-2.4 18 iw dev wlan0 ibss join nameXXX freqYYY ip addr add ZZZ broadcast + dev wlan0 The card in question is Mikrotik (Routerboard) R11e-2HPnD mPCIe adapter: AR9580 Wireless Network Adapter (rev 01), ID 168c:0033, subsystem 19b6:d016. ieee80211 phy0: Atheros AR9300 Rev:4 mem=0xc0f40000, irq=334 https://routerboard.com/R11e-2HPnD Linux 4.9.0-rc5. Is there a better way? Signed-off-by: Krzysztof Halasa diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index e9f32b5..7f17e5d 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -2245,7 +2245,7 @@ static int ath9k_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) return 0; /* AR9100 runs into calibration issues if not all rx chains are enabled */ - if (AR_SREV_9100(ah)) + if (AR_SREV_9100(ah) || AR_SREV_9300(ah)) ah->rxchainmask = 0x7; else ah->rxchainmask = fill_chainmask(ah->caps.rx_chainmask, rx_ant);