Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10780137ybl; Fri, 27 Dec 2019 02:03:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyrvW7ToGnfcb4Hfm/x/nGKiVQ2MyouFjDRpsX7CjcCHX5z7T83HeclALBGW9onRPVTS9ND X-Received: by 2002:a9d:68cb:: with SMTP id i11mr51945279oto.210.1577440985303; Fri, 27 Dec 2019 02:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577440985; cv=none; d=google.com; s=arc-20160816; b=PcwudgMVkh6S0yqO+HxU3grnyjmaIw4D1nCgjLY0sZRqMiAp4Po9r9+N65XTxNroly 6Am3UUbULxHytHFYu253cQSulrCjI6QJGLe4Xk5YbOIB18B5WtetHLk69ikVKNSx5cpj Y4AEt2u6B7E9RNEN7isaUQg1ZI5rwv7lJfR9lwHHG/pzuHaG7KQEtRbwK0CDqYkJ004X aEuoepLFuaVWUbXRnPSUVr34umyQnVWTmx0yNGM65NcjpSSdZQsdFfm8KebiF10xIcbS ZqAZoqnr3o85ygk5jfI8sKE4/S+fnvYndTT6BuKu8Gdkp0BPQByAN5b18LnDVw8K93Ay D6ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Eox7lEH740PTF6D96eI3HV/UGGPqU91i5ubWo4citZk=; b=GoTKQkXdaOWzOQgjMmv6lnhQnkXxQXhi9KGAp4LNIa9CJTQn0oAw1lpos05stF4YLi KSvU6DNNKeXyuXDff092pG1HVDugY8EFfiZddA2+r091JlR3/7yy3MubnUoiF/K6QZau nLzX+fjwC6LIRwbk4IvyLfTjiieUkNF/lCXSAG1JG8taCeRJXfpykg69K+ANNKuoWwJP oN/CsFuC1aN7FIqM4Y94Fzq1RF2VV01K1oDOEyFaW3YhpDB4j8hYQfplIT9Mu/Xs/mMg 6fxfUZKji45vsp1nPZAmp40usGvISoOQPpwAgfOLApQWd2vy/gZhUbXIiyoYxVyt84fr WLgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+gp22DT; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si17786065ota.71.2019.12.27.02.02.42; Fri, 27 Dec 2019 02:03:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+gp22DT; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726396AbfL0KCm (ORCPT + 99 others); Fri, 27 Dec 2019 05:02:42 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37015 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfL0KCm (ORCPT ); Fri, 27 Dec 2019 05:02:42 -0500 Received: by mail-lj1-f195.google.com with SMTP id o13so15290087ljg.4 for ; Fri, 27 Dec 2019 02:02:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Eox7lEH740PTF6D96eI3HV/UGGPqU91i5ubWo4citZk=; b=r+gp22DTWkzSgzAMpTbiOylfpkQd67WQmmo+0oYgza5niAhbeux7h7Px2gXotp9GpX CZ/UqfB2Drv0cqj47BsP1tlaVP5kC8/LjAwFbcqV6srVOPR5sl3vCJjEFxVIFnfQCUnW P30jwJPN4EyvA4RdrZG3hEUBdc0h/Bh+uWv9sESpbllJJjX+SepEChRfOj6aKBZ5wFzH CqXOF/wIJjp5gSgQomt9RqAEe2jHHjD7i2eh/2RGO+C053OhzrPfGeCh8obX6gMK8FBJ fAwklMyPnt19Ag7ddEbFed1jHzfxgIfe+lxgxLgItIaiXhC+ukCGVIhlLrfw4TuXnYIA yUQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Eox7lEH740PTF6D96eI3HV/UGGPqU91i5ubWo4citZk=; b=Va5Pzc0ok9LcDz5O4sw2u6zJUmyUhevIuNtxvZBdWKqEEzNilEesApu3dEPMqS66mY tLE7s2mOa0LBDBYMn03eygIixZBlzDJRbvi/fiV+Lcgr+i9+N+jiCUyGIWX3PBlMgCAz PyBQQH2dPP004pfpX8my9YtOyAy0BPF2/GPRvM9e/PVyWKpguH+6A3h56rXBRJdHY2S7 Wtokjel3SVSRSaI1byeBExBDYQPX18HYpsODoxE+NO4nFTh8Dk+YYxS6gQoGdAcSV9Bp vomzUo+RqIZOAgfaCAOHB8U8rGr2jJzN23ywCwarTMDnNV4ue2xpDoEDiAHbLHBQfGbm +ltA== X-Gm-Message-State: APjAAAWfULJQwq8uUIM1jzSvvw5ydOJs0OTuASlHyc2tyYhUhCwhcBtD FHTB+kErhZg9l+3YEDWal0K46bmRYkI= X-Received: by 2002:a2e:6f19:: with SMTP id k25mr27216632ljc.84.1577440959667; Fri, 27 Dec 2019 02:02:39 -0800 (PST) Received: from dk.user.kdf.lan ([89.18.140.18]) by smtp.gmail.com with ESMTPSA id s13sm13492983lje.35.2019.12.27.02.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2019 02:02:39 -0800 (PST) From: Denis Kalashnikov To: linux-wireless@vger.kernel.org Cc: kvalo@codeaurora.org Subject: [RESEND] ath9k: fix firmware bug in some of Mikrotik R11e-2HPnD cards Date: Fri, 27 Dec 2019 13:01:15 +0300 Message-Id: <20191227100115.6870-1-denis281089@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Sorry, first I sent the patch through a Gmail web interface, and spaces were broken. --- Some of the Mikrotik R11e-2HPnD cards have EEPROM where is flashed that a card has 3 chains, but actually all this cards have only 2. This leads ath9k to write periodically into the logs: 'ath: phy0: Unable to reset channel, reset status -5' and stations don't see that AP. Mikrotik R11e-2HPnD is based on AR9582 chip. Signed-off-by: Denis Kalashnikov --- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index b4885a700296..554a81400648 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -3373,6 +3373,15 @@ static int ar9300_eeprom_restore_internal(struct ath_hw *ah, cptr -= (COMP_HDR_LEN + osize + COMP_CKSUM_LEN); } + /** + * Fix firmware bug of some Mikrotik R11e-2HPnD cards (based on AR9582) + * that claim that they have 3 chains, but actually have only 2. + */ + if (AR_SREV_9580(ah)) { + eep = (struct ar9300_eeprom *)mptr; + eep->baseEepHeader.txrxMask &= 0x33; + } + kfree(word); return cptr; -- 2.23.0