From patchwork Thu Sep 6 14:20:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Psyborg X-Patchwork-Id: 967027 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=198.137.202.133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Lv86XMQx"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Hl5p/MYc"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 425jRT4nBBz9s55 for ; Fri, 7 Sep 2018 00:21:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EhEXiPY+nYVOcrRDiSW0kUDEOu8yzWGQbSa/P1Q6BWY=; b=Lv86XMQxn3b8bI OKrOpFlJlgqlpkN4dVrsZKNTV0PVAAsL7iqegZ7Gm0UGLTaFZkk+LhMFDaQja4UwjNgB0rXZ29UoW /3Rv5BjjZM+zitEKDUHv0Thd6eFHM+dyV79XA1/AZAnGArHs1nxcS+978Z38EwSHo+pfnL+11Q315 Bk5v6DogNaCs83s4GLipju++3lmbZNZGGwgkg6q3ZbSHKluej8K7Pcs7sUs4hDPxayS7bOxvx57g8 Uu3ZC36AjdjMSSarSNLQbOQXMWZRMWB5rVGpIawx2r2bXEr6mYTtyj/YX21Czqs19wnjxIRLvjyWq qNJz1+dwSR73pmRk1p4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxv9d-0006NN-Hh; Thu, 06 Sep 2018 14:21:05 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxv93-00045k-KD for openwrt-devel@lists.openwrt.org; Thu, 06 Sep 2018 14:20:31 +0000 Received: by mail-wm0-x241.google.com with SMTP id s12-v6so11635828wmc.0 for ; Thu, 06 Sep 2018 07:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=5Cczrm3nvhtqcdtqFlfB71XvRVaa9NiORqQ82AFtM5k=; b=Hl5p/MYcGybQ+tDIQUHIAI51dYGyYljOmm+0MjyKcdprNyW3TRWHxC2iFOEGRD0R4f RZcZQgvjeNhJ7STs3eO0cWBQOTuiqSy5Lxj89oiW9L6rLEZGNjTs0T+YZ4o3pwTdVPaI u2KaRYkWXGMnWSX5CE8bMsqkymbOr3p4IOOtjcq5DCxoDHk4Ily787w7HEV6Evfgt1sm M3V+7yQrlAuR/NcFBojTgck4wP4SKfkz10SZDCrh/lee2+ACEA3Sxbpkrq4qxAaY8Aoy HYXrw2GhvcX4jC1A9fag/ke9IhhYOY6JqXSWG9+NnyQJ67bfKVeyt7EAHLymPJTwiPTg 0Akg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=5Cczrm3nvhtqcdtqFlfB71XvRVaa9NiORqQ82AFtM5k=; b=V3Bdv8A0Kv3T2N3o87S4IYPrdjlJ1qw9lahuTz777SZSws1WYpZ/6FzCXirib/+Yjp TFsZnwVLRP+rTgkKMdLDdqPlgXAfjpcKkFdMPacFDtoQyUwkYU6LfOqD7Evu/J4F8+Fr l0ZT/4a4NCGrvOVk6M/1WOsOjnDuP9o+COe+6LSMaUu/S+p1le04IA+6qCbFM15yLFDH ipMA2xn8V3ZAKiQ5079SMbZwtLMsbFkvL1S7A7gr+x5kYPGdw4wBC+QQRUsZ1Q4S/UW1 jtq+sSL2uBm57Ob58QkTvsAuhlfnjk/194YzlNm6X5ma65GZFdbMip+R9FQT0Z/BArft 03JA== X-Gm-Message-State: APzg51C6FFqZKIRPyQqJ97ML8un7nfbrVR9KN7HeZ+k+x3EIfFpZczno tDcHFGxQOb/yWOftfKj0sfyLShAm X-Google-Smtp-Source: ANB0VdbOq3Vw2bmUz6k6XnrCB4LIzgHiSFT2rAM4i5HvZqM205lJm+EupLoTKJtZMQzSiJ99QG+lZg== X-Received: by 2002:a1c:1745:: with SMTP id 66-v6mr2193173wmx.38.1536243617338; Thu, 06 Sep 2018 07:20:17 -0700 (PDT) Received: from localhost.localdomain ([31.147.208.18]) by smtp.googlemail.com with ESMTPSA id i4-v6sm5723653wrs.85.2018.09.06.07.20.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 06 Sep 2018 07:20:16 -0700 (PDT) From: =?utf-8?q?Tomislav_Po=C5=BEega?= To: openwrt-devel@lists.openwrt.org Date: Thu, 6 Sep 2018 16:20:12 +0200 Message-Id: <1536243613-23135-1-git-send-email-pozega.tomislav@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180906_072029_736780_1A64887D X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pozega.tomislav[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [OpenWrt-Devel] [PATCH 1/2] mac80211: 5/10 MHz channel width support for ath9k_htc X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add 5/10 MHz channel width support for ath9k_htc driver. Connection tested between several devices and working. Signed-off-by: Tomislav Požega --- .../patches/512-ath9k_channelbw_debugfs.patch | 62 ++++++++++++++++++++ 1 files changed, 62 insertions(+), 0 deletions(-) diff --git a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch index 2ebb73d..9349c07 100644 --- a/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch +++ b/package/kernel/mac80211/patches/512-ath9k_channelbw_debugfs.patch @@ -123,3 +123,65 @@ return channel; } +--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +@@ -398,6 +398,50 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath9k_htc_priv *priv = file->private_data; ++ struct ath_common *common = ath9k_hw_common(priv->ah); ++ char buf[32]; ++ unsigned int len; ++ ++ len = sprintf(buf, "0x%08x\n", common->chan_bw); ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath9k_htc_priv *priv = file->private_data; ++ struct ath_common *common = ath9k_hw_common(priv->ah); ++ unsigned long chan_bw; ++ char buf[32]; ++ ssize_t len; ++ ++ len = min(count, sizeof(buf) - 1); ++ if (copy_from_user(buf, user_buf, len)) ++ return -EFAULT; ++ ++ buf[len] = '\0'; ++ if (kstrtoul(buf, 0, &chan_bw)) ++ return -EINVAL; ++ ++ common->chan_bw = chan_bw; ++ if (!test_bit(ATH_OP_INVALID, &common->op_flags)) ++ ath9k_htc_ops.config(priv->hw, IEEE80211_CONF_CHANGE_CHANNEL); ++ ++ return count; ++} ++ ++static const struct file_operations fops_chanbw = { ++ .read = read_file_chan_bw, ++ .write = write_file_chan_bw, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ + /* Ethtool support for get-stats */ + #define AMKSTR(nm) #nm "_BE", #nm "_BK", #nm "_VI", #nm "_VO" + static const char ath9k_htc_gstrings_stats[][ETH_GSTRING_LEN] = { +@@ -520,5 +564,8 @@ int ath9k_htc_init_debug(struct ath_hw * + ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah); + ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah); + ++ debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, priv->debug.debugfs_phy, ++ priv, &fops_chanbw); ++ + return 0; + }