Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp9325263ioo; Sun, 5 Jun 2022 11:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPKPwFFv4JV2n9DFyylCsjHtlrKD9GK3BXAi6j0gpKCmaX0VWi1rySE7Mu1PnxPBsrpC4K X-Received: by 2002:a05:6402:3482:b0:42d:e063:7c1d with SMTP id v2-20020a056402348200b0042de0637c1dmr22513867edc.40.1654452259293; Sun, 05 Jun 2022 11:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654452259; cv=none; d=google.com; s=arc-20160816; b=wKTFT8xJZd6Jt5kYa5w6v2YJqk1O8rh5gZW2yurhJPKRAwHJMjBicDRe5VpvC91445 KAZNi/ANiZjdObAWTmVudiZ7wO/KBO8ePbZ3Mw4I/+50oeAaJWK9KQLqgbs9mAe18E2v lm4jcKGTOAiDWdKPy3yoEOORGdIpwBUZcH4YS0Sm2teCqbpwpYUdJbazQhLS0JfUjnBE /gIw7966SafIaJ5aFde2CrEVC1O5KP82vao63llKmVlb8OrFfWn5oE1mL2bZGTlhV91P /nF9giIM7aFM05V662bxjqSK2Zsj/PXaZ7RW9t84MO+WEToOPUJV0ttPrXThQttay2KU gkUw== 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=C6a0olJtBrR3BsmTn/ejEGmpmyERN1wNCPJU1UO7f7w=; b=yFKxJoYz+MiZCmUX5pLR2hZxQuffvwYe+rDiKm5IgUxvEVhcvSrFWmBpD44qLSxI/k 5+9kr/FeG14gVhWo66LTSfD2sxPLCnE7VV3M5tl4AbzigB3cVa47AAQIPh84Yi/CIPGQ 9ZWw7TlAT2ZMxgBXenVQV9mir19JzWKWl3dL0c2oo9WaaTmZazRJUTaVNQ8wOx56Qwgm 7iDhQmt8V2taR+83fw6+uRpvKJGy5bR6B0QqmJtDRQ/QRE6t/gmPnALcLIE82Us4rR7e WcMSSrJFHmhAy8OdKbjfv0bSMN8bdPfl3jnCxv7AbIL1BUa05FWJ4X6WZKbQvkXbhrJx +v6A== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a170906131000b006f4326c816bsi12005198ejb.357.2022.06.05.11.03.50; Sun, 05 Jun 2022 11:04:19 -0700 (PDT) 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 S238760AbiFBTie (ORCPT + 99 others); Thu, 2 Jun 2022 15:38:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238723AbiFBThz (ORCPT ); Thu, 2 Jun 2022 15:37:55 -0400 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 1170C2F00F for ; Thu, 2 Jun 2022 12:37:53 -0700 (PDT) Received: from ipservice-092-217-081-045.092.217.pools.vodafone-ip.de ([92.217.81.45] 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 1nwqde-0003py-PW; Thu, 02 Jun 2022 21:37:47 +0200 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 08/11] staging: r8188eu: clarify the contents of the delba params Date: Thu, 2 Jun 2022 21:37:23 +0200 Message-Id: <20220602193726.280922-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220602193726.280922-1-martin@kaiser.cx> References: <20220602193726.280922-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 The delba parameters field contains an initiator/receiver flag and the tid. The caller of issue_action_BA passes these components in the status parameter. Extract the two components from status and use u16_encode_bits to copy them into the parameters field. This should clarify what's going on and should make it easier to replace the status parameter in the future. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index b4d22dae212a..7968674a0705 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -5377,7 +5377,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch struct sta_priv *pstapriv = &padapter->stapriv; struct registry_priv *pregpriv = &padapter->registrypriv; struct ieee80211_mgmt *mgmt; - u16 capab; + u16 capab, params; pmgntframe = alloc_mgtxmitframe(pxmitpriv); if (!pmgntframe) @@ -5450,6 +5450,9 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch mgmt->u.action.u.delba.action_code = WLAN_ACTION_DELBA; pattrib->pktlen++; mgmt->u.action.u.delba.params = cpu_to_le16((status & 0x1F) << 3); + params = u16_encode_bits((status & 0x1), IEEE80211_DELBA_PARAM_INITIATOR_MASK); + params |= u16_encode_bits((status >> 1) & 0xF, IEEE80211_DELBA_PARAM_TID_MASK); + mgmt->u.action.u.delba.params = cpu_to_le16(params); pattrib->pktlen += 2; mgmt->u.action.u.delba.reason_code = cpu_to_le16(WLAN_STATUS_REQUEST_DECLINED); pattrib->pktlen += 2; -- 2.30.2