From patchwork Wed Dec 16 18:20:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Oh X-Patchwork-Id: 7865471 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A84F9F387 for ; Wed, 16 Dec 2015 18:21:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 796DD20396 for ; Wed, 16 Dec 2015 18:21:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8ED04202EC for ; Wed, 16 Dec 2015 18:21:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9Ghd-0003Fp-Q9; Wed, 16 Dec 2015 18:21:29 +0000 Received: from sabertooth02.qualcomm.com ([65.197.215.38]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9Ghb-0003EJ-Sb for ath10k@lists.infradead.org; Wed, 16 Dec 2015 18:21:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1450290087; x=1481826087; h=from:to:cc:subject:date:message-id:mime-version; bh=o/WDdMH2O2EF1PLM73jwzn6cKW/n6ZfAtiNCylEUV8g=; b=Ysxk+H81jbk2jaLR2pdmIAUaiNC4OuUI+NaFqgZd29GFjYYegUStCrnK GVXrXOXYG6UX9RWq1/iQaPW7t4TzMSwmVVsCg4ampvf5PsgdQNl6Pm/TN sOklSGL4yQY+lLXDstMf2E6S+UlMf6b+mTWZCr02SrmHikO8DkD0ILdQl w=; X-IronPort-AV: E=Sophos;i="5.20,437,1444719600"; d="scan'208";a="104390991" Received: from ironmsg04-l-new.qualcomm.com (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by sabertooth02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Dec 2015 10:21:05 -0800 X-IronPort-AV: E=McAfee;i="5700,7163,8017"; a="1028765262" Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 16 Dec 2015 10:21:05 -0800 Received: from poh-linux-laptop-2.qualcomm.com (10.80.80.8) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Wed, 16 Dec 2015 10:21:05 -0800 From: Peter Oh To: Subject: [PATCH] ath10k: add modparam 'hw_csum' to make HW checksum configurable Date: Wed, 16 Dec 2015 10:20:51 -0800 Message-ID: <1450290051-15593-1-git-send-email-poh@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To NASANEXM01B.na.qualcomm.com (10.85.0.82) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151216_102128_002126_65F1EDDC X-CRM114-Status: GOOD ( 10.03 ) X-Spam-Score: -7.0 (-------) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Some hardwares such as QCA988X and QCA99X0 doesn't have capability of checksum offload when frame formats are not suitable for it such as Mesh frame. Hence add a module parameter, hw_csum, to make checksum offload configurable during module registration time. Signed-off-by: Peter Oh --- drivers/net/wireless/ath/ath10k/core.c | 6 ++++++ drivers/net/wireless/ath/ath10k/core.h | 3 +++ drivers/net/wireless/ath/ath10k/mac.c | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index fca702c..fcfccd8 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -35,18 +35,21 @@ static unsigned int ath10k_cryptmode_param; static bool uart_print; static bool skip_otp; static bool rawmode; +static bool hw_csum = true; module_param_named(debug_mask, ath10k_debug_mask, uint, 0644); module_param_named(cryptmode, ath10k_cryptmode_param, uint, 0644); module_param(uart_print, bool, 0644); module_param(skip_otp, bool, 0644); module_param(rawmode, bool, 0644); +module_param(hw_csum, bool, 0644); MODULE_PARM_DESC(debug_mask, "Debugging mask"); MODULE_PARM_DESC(uart_print, "Uart target debugging"); MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode"); MODULE_PARM_DESC(cryptmode, "Crypto mode: 0-hardware, 1-software"); MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath"); +MODULE_PARM_DESC(hw_csum, "Enable HW checksum offload (default: on)"); static const struct ath10k_hw_params ath10k_hw_params_list[] = { { @@ -1405,6 +1408,9 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) ar->htt.max_num_amsdu = 1; } + if (!hw_csum) + set_bit(ATH10K_FLAG_HW_CSUM_DISABLED, &ar->dev_flags); + /* Backwards compatibility for firmwares without * ATH10K_FW_IE_WMI_OP_VERSION. */ diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 3c8a510..1972439 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -535,6 +535,9 @@ enum ath10k_dev_flags { /* Bluetooth coexistance enabled */ ATH10K_FLAG_BTCOEX, + + /* Do not use checksum offload */ + ATH10K_FLAG_HW_CSUM_DISABLED, }; enum ath10k_cal_mode { diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index a4c5c1d..f87f521 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7332,7 +7332,8 @@ int ath10k_mac_register(struct ath10k *ar) goto err_free; } - if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) + if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags) && + !test_bit(ATH10K_FLAG_HW_CSUM_DISABLED, &ar->dev_flags)) ar->hw->netdev_features = NETIF_F_HW_CSUM; if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) {