From patchwork Tue Dec 19 12:06:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 10123139 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 7C9D56019C for ; Tue, 19 Dec 2017 12:07:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63699292C0 for ; Tue, 19 Dec 2017 12:07:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 557AE292D7; Tue, 19 Dec 2017 12:07:25 +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=ham 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 E6E45292C0 for ; Tue, 19 Dec 2017 12:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762570AbdLSMHX (ORCPT ); Tue, 19 Dec 2017 07:07:23 -0500 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:43402 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1762565AbdLSMHX (ORCPT ); Tue, 19 Dec 2017 07:07:23 -0500 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id vBJC59da005869; Tue, 19 Dec 2017 04:07:18 -0800 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2ew1qn2dhd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2017 04:07:18 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 19 Dec 2017 04:07:17 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Tue, 19 Dec 2017 04:07:17 -0800 Received: from smtp.marvell.com (unknown [10.38.32.107]) by maili.marvell.com (Postfix) with SMTP id D815E3F703F; Tue, 19 Dec 2017 04:07:12 -0800 (PST) Received: by smtp.marvell.com (sSMTP sendmail emulation); Tue, 19 Dec 2017 20:07:07 +0800 From: Xinming Hu To: Linux MMC CC: Ulf Hansson , Kalle Valo , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Zhiyuan Yang , Tim Song , Cathy Luo , James Cao , Ganapathi Bhat , Xu Wang , Bob Tan , Xinming Hu Subject: [PATCH v6 2/4] ath6kl: change to use mmc api for accessing host supported maximum segment count and size Date: Tue, 19 Dec 2017 20:06:48 +0800 Message-ID: <1513685211-640-2-git-send-email-huxm@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513685211-640-1-git-send-email-huxm@marvell.com> References: <1513685211-640-1-git-send-email-huxm@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-19_07:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=969 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712190176 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using mmc standard api to get the host sg capability. Signed-off-by: Xinming Hu Acked-by: Kalle Valo --- v6: separate driver patch from patch 1/4. --- drivers/net/wireless/ath/ath6kl/sdio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index 2195b1b..3217698 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -734,17 +734,18 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar) struct htc_target *target = ar->htc_target; int ret = 0; bool virt_scat = false; + unsigned short max_segs = 0; if (ar_sdio->scatter_enabled) return 0; ar_sdio->scatter_enabled = true; + max_segs = sdio_get_host_max_seg_count(ar_sdio->func); /* check if host supports scatter and it meets our requirements */ - if (ar_sdio->func->card->host->max_segs < MAX_SCATTER_ENTRIES_PER_REQ) { + if (max_segs < MAX_SCATTER_ENTRIES_PER_REQ) { ath6kl_err("host only supports scatter of :%d entries, need: %d\n", - ar_sdio->func->card->host->max_segs, - MAX_SCATTER_ENTRIES_PER_REQ); + max_segs, MAX_SCATTER_ENTRIES_PER_REQ); virt_scat = true; }