From patchwork Tue Feb 7 19:23:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 54051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3035396wrn; Tue, 7 Feb 2023 11:29:29 -0800 (PST) X-Google-Smtp-Source: AK7set+JhY53h5ORnBi3o7g3jKgn2piqkFRCptaDwNy4msFnWsoeHEIFv/GLJul9HhHYJXD5HnL9 X-Received: by 2002:a17:906:730d:b0:880:50de:5e86 with SMTP id di13-20020a170906730d00b0088050de5e86mr5909643ejc.3.1675798169618; Tue, 07 Feb 2023 11:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675798169; cv=none; d=google.com; s=arc-20160816; b=DKrHjkbvXpBcanWbzOwk61vluVWd1O8Yjw1Qm7YlrlBGwd7QHWKrvjzGq98f4uDi1B MilKB+peFzY6W4S5qxo+SFusHP/ORHuG/9qUFIJbrMOBd6ucCp75M6wV9edBTkfcVj+T /PCdklGubMmFzrGLnzn9M1Ni+iwOMq06mMURnUJSHESrHZh+oUSQ7kNTWYlfYdNnreB2 rdcEq2+9uk+eA+1jgndc/SvnBwUgmjFbEXq65+j58RLDCTDw/2miNhBuGlvDsS3K/CBf 8ElG5AL1hvZ3zOyF8S6XyvTlsdvzHT/Q7qc0mk34nRym/Vksv7hr0dnfSW05PZlNapkw 2CVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BSXjjhsv5rhAxVklIFfU5xKJJjxf7fqu1txuPOrpnFM=; b=h+C6f6A4WQB2M/Jia2dd0dsZ48cn4YjbATf2d863VDDLiBkBoiVvhaQnhlvmLzLd3E xH3IBGJz28YQBpsdH8X/yJrYB6Kl/iGOntIz+MOxMiXOV6U1M2Gs83y3ehEdJlvFdRTN IfIIt2zgpq2cwO5rsY8AhK+gdFJMfEleNzMC6fDLKpqA+1/0UeYDvr+4f5+Ko/6pA0eX uCvQPGlpV20k9ebIBBMGTUP9xkNB6MgcpmuNyjBl6OFGweMye7yusZEE/v0vprl99beV 9z/hBdNWsCCQXM0sDYZ4n3Amjdruw5n1CVBoBb72PC3BF6szdmoAR5rtIjvNH7b9hI25 ZQQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020aa7de18000000b004aacd8e198csi3082980edv.412.2023.02.07.11.29.06; Tue, 07 Feb 2023 11:29:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbjBGTXv (ORCPT + 99 others); Tue, 7 Feb 2023 14:23:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbjBGTXs (ORCPT ); Tue, 7 Feb 2023 14:23:48 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF4039CDA for ; Tue, 7 Feb 2023 11:23:42 -0800 (PST) Received: from dslb-178-004-202-208.178.004.pools.vodafone-ip.de ([178.4.202.208] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pPTZ3-0002XK-08; Tue, 07 Feb 2023 20:23:37 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 5/7] staging: r8188eu: simplify xmit_buf flags Date: Tue, 7 Feb 2023 20:23:17 +0100 Message-Id: <20230207192319.294203-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230207192319.294203-1-martin@kaiser.cx> References: <20230207192319.294203-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757201741862980820?= X-GMAIL-MSGID: =?utf-8?q?1757201741862980820?= rtw_write_port stores a queue index in pxmitbuf->flags before submitting an urb. The urb completion function reads the flags. All it needs is the info if the high queue was used or not. We can replace the flags with a boolean high_queue variable. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- drivers/staging/r8188eu/include/rtw_xmit.h | 2 +- .../staging/r8188eu/os_dep/usb_ops_linux.c | 25 ++----------------- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 6ec342b726f9..df88b3e29e77 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -148,7 +148,7 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) goto free_xmitbuf; } - pxmitbuf->flags = XMIT_VO_QUEUE; + pxmitbuf->high_queue = false; list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmitbuf_queue.queue); pxmitbuf++; diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 9a001fbf45a0..feeac85aedb0 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -189,7 +189,7 @@ struct xmit_buf { u8 *pbuf; void *priv_data; u16 ext_tag; /* 0: Normal xmitbuf, 1: extension xmitbuf. */ - u16 flags; + bool high_queue; u32 alloc_sz; u32 len; struct submit_ctx *sctx; diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index 48c96f731ce1..ca09f7ed7e4d 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -39,7 +39,7 @@ static void usb_write_port_complete(struct urb *purb) struct adapter *padapter = pxmitbuf->padapter; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - if (pxmitbuf->flags == HIGH_QUEUE_INX) + if (pxmitbuf->high_queue) rtw_chk_hi_queue_cmd(padapter); switch (purb->status) { @@ -83,28 +83,7 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem) } spin_lock_irqsave(&pxmitpriv->lock, irqL); - - switch (addr) { - case VO_QUEUE_INX: - pxmitbuf->flags = VO_QUEUE_INX; - break; - case VI_QUEUE_INX: - pxmitbuf->flags = VI_QUEUE_INX; - break; - case BE_QUEUE_INX: - pxmitbuf->flags = BE_QUEUE_INX; - break; - case BK_QUEUE_INX: - pxmitbuf->flags = BK_QUEUE_INX; - break; - case HIGH_QUEUE_INX: - pxmitbuf->flags = HIGH_QUEUE_INX; - break; - default: - pxmitbuf->flags = MGT_QUEUE_INX; - break; - } - + pxmitbuf->high_queue = (addr == HIGH_QUEUE_INX); spin_unlock_irqrestore(&pxmitpriv->lock, irqL); purb = pxmitbuf->pxmit_urb;