From patchwork Wed Jan 21 16:42:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avinash Patil X-Patchwork-Id: 5676471 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 355619F358 for ; Wed, 21 Jan 2015 11:13:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1819E20270 for ; Wed, 21 Jan 2015 11:13:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6E382026F for ; Wed, 21 Jan 2015 11:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752212AbbAULNv (ORCPT ); Wed, 21 Jan 2015 06:13:51 -0500 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:47583 "EHLO mx0a-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889AbbAULNu (ORCPT ); Wed, 21 Jan 2015 06:13:50 -0500 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.14.5/8.14.5) with SMTP id t0LBDeXu010869 for ; Wed, 21 Jan 2015 03:13:50 -0800 Received: from sc-owa03.marvell.com ([199.233.58.149]) by mx0a-0016f401.pphosted.com with ESMTP id 1s09vs9gje-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Wed, 21 Jan 2015 03:13:50 -0800 Received: from maili.marvell.com (10.93.76.43) by SC-OWA03.marvell.com (10.93.76.24) with Microsoft SMTP Server id 8.3.327.1; Wed, 21 Jan 2015 03:13:49 -0800 Received: from pe-lt950 (unknown [10.31.130.82]) by maili.marvell.com (Postfix) with ESMTP id A56563F7040; Wed, 21 Jan 2015 03:13:48 -0800 (PST) Received: from pe-lt950 (localhost [127.0.0.1]) by pe-lt950 (8.14.7/8.14.7) with ESMTP id t0LGhFAU004589; Wed, 21 Jan 2015 22:13:16 +0530 Received: (from root@localhost) by pe-lt950 (8.14.7/8.14.7/Submit) id t0LGhFFa004581; Wed, 21 Jan 2015 22:13:15 +0530 From: Avinash Patil To: CC: , , , , , Avinash Patil Subject: [PATCH 3/3] mwifiex: selectively choose ext_scan support Date: Wed, 21 Jan 2015 22:12:11 +0530 Message-ID: <1421858531-4536-3-git-send-email-patila@marvell.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1421858531-4536-1-git-send-email-patila@marvell.com> References: <1421858531-4536-1-git-send-email-patila@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68, 1.0.33, 0.0.0000 definitions=2015-01-21_02:2015-01-21, 2015-01-21, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1501210108 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Some devices do not support extended scan. This patch adds support to enable ext_scan selectively. For SD/PCIe interfaces, deefine ext_scan_support as part of card structure and use it to initialize ext_scan in adapter during registering device. For USB interfaces, we initialize ext_scan during register_dev handler. Signed-off-by: Yogesh Ashok Powar Signed-off-by: Avinash Patil --- drivers/net/wireless/mwifiex/init.c | 2 +- drivers/net/wireless/mwifiex/pcie.c | 2 ++ drivers/net/wireless/mwifiex/pcie.h | 3 +++ drivers/net/wireless/mwifiex/sdio.c | 2 ++ drivers/net/wireless/mwifiex/sdio.h | 8 ++++++++ drivers/net/wireless/mwifiex/usb.c | 3 +++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index b115e0f..8004d14 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c @@ -294,7 +294,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter)); adapter->arp_filter_size = 0; adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX; - adapter->ext_scan = true; + adapter->ext_scan = false; adapter->key_api_major_ver = 0; adapter->key_api_minor_ver = 0; diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index a460b0e..824a78b 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -204,6 +204,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev, card->pcie.blksz_fw_dl = data->blksz_fw_dl; card->pcie.tx_buf_size = data->tx_buf_size; card->pcie.supports_fw_dump = data->supports_fw_dump; + card->pcie.ext_scan_support = data->ext_scan_support; } if (mwifiex_add_card(card, &add_remove_card_sem, &pcie_ops, @@ -2563,6 +2564,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) adapter->mem_type_mapping_tbl = mem_type_mapping_tbl; adapter->num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl); strcpy(adapter->fw_name, card->pcie.firmware); + adapter->ext_scan = card->pcie.ext_scan_support; return 0; } diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h index 200e8b0..295e66b 100644 --- a/drivers/net/wireless/mwifiex/pcie.h +++ b/drivers/net/wireless/mwifiex/pcie.h @@ -206,6 +206,7 @@ struct mwifiex_pcie_device { u16 blksz_fw_dl; u16 tx_buf_size; bool supports_fw_dump; + u8 ext_scan_support; }; static const struct mwifiex_pcie_device mwifiex_pcie8766 = { @@ -214,6 +215,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8766 = { .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD, .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K, .supports_fw_dump = false, + .ext_scan_support = true, }; static const struct mwifiex_pcie_device mwifiex_pcie8897 = { @@ -222,6 +224,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8897 = { .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD, .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K, .supports_fw_dump = true, + .ext_scan_support = true, }; struct mwifiex_evt_buf_desc { diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index cee107f..01c157d 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c @@ -107,6 +107,7 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) card->mp_rx_agg_buf_size = data->mp_rx_agg_buf_size; card->supports_fw_dump = data->supports_fw_dump; card->auto_tdls = data->auto_tdls; + card->ext_scan = data->ext_scan_support; } sdio_claim_host(func); @@ -1887,6 +1888,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter) } adapter->auto_tdls = card->auto_tdls; + adapter->ext_scan = card->ext_scan; return ret; } diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h index a4bb0db..1d58f25 100644 --- a/drivers/net/wireless/mwifiex/sdio.h +++ b/drivers/net/wireless/mwifiex/sdio.h @@ -256,6 +256,7 @@ struct sdio_mmc_card { u8 *mp_regs; u8 auto_tdls; + u8 ext_scan; struct mwifiex_sdio_mpa_tx mpa_tx; struct mwifiex_sdio_mpa_rx mpa_rx; @@ -273,6 +274,7 @@ struct mwifiex_sdio_device { u32 mp_tx_agg_buf_size; u32 mp_rx_agg_buf_size; u8 auto_tdls; + u8 ext_scan_support; }; static const struct mwifiex_sdio_card_reg mwifiex_reg_sd87xx = { @@ -417,6 +419,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8786 = { .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, .supports_fw_dump = false, .auto_tdls = false, + .ext_scan_support = false, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = { @@ -431,6 +434,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = { .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, .supports_fw_dump = false, .auto_tdls = false, + .ext_scan_support = true, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = { @@ -445,6 +449,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = { .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, .supports_fw_dump = false, .auto_tdls = false, + .ext_scan_support = true, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = { @@ -459,6 +464,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = { .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K, .supports_fw_dump = true, .auto_tdls = false, + .ext_scan_support = true, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = { @@ -473,6 +479,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = { .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K, .supports_fw_dump = false, .auto_tdls = true, + .ext_scan_support = true, }; static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = { @@ -487,6 +494,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = { .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, .supports_fw_dump = false, .auto_tdls = false, + .ext_scan_support = true, }; /* diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index 50517b7..2238730 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c @@ -799,16 +799,19 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) case USB8897_PID_2: adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K; strcpy(adapter->fw_name, USB8897_DEFAULT_FW_NAME); + adapter->ext_scan = true; break; case USB8766_PID_1: case USB8766_PID_2: adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K; strcpy(adapter->fw_name, USB8766_DEFAULT_FW_NAME); + adapter->ext_scan = true; break; case USB8801_PID_1: case USB8801_PID_2: adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K; strcpy(adapter->fw_name, USB8801_DEFAULT_FW_NAME); + adapter->ext_scan = false; break; case USB8797_PID_1: case USB8797_PID_2: