Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1267462lqb; Thu, 18 Apr 2024 05:23:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsXb78Z/X0uMunA3QWCb1lPm844qxQKgoXYEM/u2fnaXLbdjrORcTCMFMXOEZcMoN9eDxkwCDXEXCbfImBvaQjEK674IkZB9u/MVLAxg== X-Google-Smtp-Source: AGHT+IGte/1uULvYYVrMA+nmVMTuj5NWXskgVvUARfCMvajM8x/SA1pVRaKgNDokg8p2OSmRTdEP X-Received: by 2002:a05:6a20:729f:b0:1a9:c843:6f37 with SMTP id o31-20020a056a20729f00b001a9c8436f37mr3424860pzk.19.1713442981826; Thu, 18 Apr 2024 05:23:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713442981; cv=pass; d=google.com; s=arc-20160816; b=wLz7fpNh3li3QTGgK372r+nwzoA/DLQhuLWZq+9sGcA+PhQKej+Op8bE7u1IAVqVfG vvukuQWynbaB8Pupv4A0aRZe8lqBlplaCUXKmJgUrCT2Ms/HOxpDAbq84U1R1FIhxvxU KTV8w5RKYSjHk7ikcuqNxB0oZgE6VGzPW5kblQjhJCf8bQi393TSgjFs9r23kvO77s9n 9K77Pd/e8J5h/X31wNH/gh95S2sYNWCYQ2O6I20ZZe7Gp5oVm+mHwCpNTCf2WJJPpYVw kvbcKSIMBEwaJzYjHvLTKPFKmuLttVuLKllYUQM2eAP+CAtRyO5X6QgayuTy9SuDYf3q RP3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=YxiOphSzFG5Jwu7YxITX8qnsYklBmzhxTqREey7lHE0=; fh=97edmNyxeiv8/BOs8Gq6fqFTNGd6AfK6cX0vGf2zx7o=; b=GDbz9ZjmA02rJflncV4gWxn5fCmxXJAfhtYYwLr0RpfIFOJg6HS1Fk1bo1edLatWoB Q9Qzl6hJXnjtxpkUPRMsZ/x7idj7sMarHRFvvU8CISJMV/nTTLGRT+lKAnlnKSlgBEND RuJu3rMNH0a1qOzOik5FXARVZSVkDIL6cLZrdp+mFHkhd0ZcWVcLwnBhanT5J4Ul6HyK OnJCyy2Vzz08Hp9uwRdW9Nbi5wu9FkDenTVH8SarSozTKnI3biq/0LPqnhvupf2pnWlv 2DGRzRhjNFPgoDICDEFDT/y7VdPjGYAzhq0xP0sv6W64sHsQC27Z91ei3d61Jv1buMGc Jd+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KsbExEHW; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-6523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v1-20020a63f201000000b005e858e345dbsi1365746pgh.373.2024.04.18.05.23.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:23:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KsbExEHW; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-6523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 029422836D0 for ; Thu, 18 Apr 2024 12:22:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7039E15D5D6; Thu, 18 Apr 2024 12:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KsbExEHW" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6ADF15E5C9 for ; Thu, 18 Apr 2024 12:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713442935; cv=none; b=jWHrbRqIPmfhatkWXJkUym+X47syE+yEO8IJq1NJL8Zy09BgDwi4ZKSle0fwa6QXJLAL5vFGJsZd5GK1CPnUqgkMd7sxhC9E2CkPcaQWL6YC0jfH2cmGDTEwofx1jPrD14zot5U6j6QHsxERbS6hpggB7s+jd+MFyymux5ODONk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713442935; c=relaxed/simple; bh=QtXXT/QFYde8XdVhs7nc/lo1biN57+1P5AAI9Ec98MA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ibJJ2fSZJbNPoixYe6UhI2nuA9K5gtdCxZjtVuXwNbCYwxxjZk8xD1fH/eMmkFQbc8Wa4gWUoQLvg+Om6P2fjPyZgINY5e6W/zQsnbXzzyhlZVcwZHFZKkKTOKL8wjBdQE55BbAu3IWRL2/0g84fZhRT7RauANEKvnSZbewnqnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KsbExEHW; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-418dde387a3so5906675e9.0 for ; Thu, 18 Apr 2024 05:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713442932; x=1714047732; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YxiOphSzFG5Jwu7YxITX8qnsYklBmzhxTqREey7lHE0=; b=KsbExEHWYP25+X9pAS3C7jTcJGe2czIk7I/FH96b5Tozhz0QC/JjnQLYkJJgXKXTlL yObEOPr9ZnIbgiylcHjFg65zqAxprlmmIPR9j0ihMwRWvgQCwiSH2l4KExRCK2hUcp49 f/KgMwFtgxdXD25H5rZ/J7f0gF3y/bwCGWmvMgLiqnvJ2meHWSjBVGNCgFKa0KI1yNY6 5mkaqsXxtnS41T2XMx0czPG5DJA+hmUOLimLkJFJ+HP6AHCu5J9GFAigTHbKn2Iz0yaz OxfaWQwDAkdgiQZfmqP9aB/D+dPtzZlM15aPeoaULk45wu5JQYuTxtU1j0hcInPWCUUC uLXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713442932; x=1714047732; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YxiOphSzFG5Jwu7YxITX8qnsYklBmzhxTqREey7lHE0=; b=burvLqrl6ITqdepP5dLpMJKH8x8G8LS/Eamif/N4e3tSLSsgn7fj8RsvFaJvoa0GBp m4zdMbfMii9uSR42coHqs49zc1VidGoOmEvCDlppo/8HonSUErYx3eZNRZzYbMj7UUoN 4PUanmBBdMZMn+99dMEXqf0WD+HRZizJ3Z6iB6V4J5y6UsSMERT9HvM/34TbcTMJ000l FsuayAJcA8jACmkjGUkCm5m4PjVDUOG40qavy5z8Lmy0uCbYGC7J6YB479mBBTfTWLi8 idGXpApNPw6dsVbW3otobsyKQuLB2IwNaZUvlQMCk5YpR+Mr1bTkLg9725+eWBKpUHWA yUsQ== X-Forwarded-Encrypted: i=1; AJvYcCUQNfvL20sGlf59fyC9usoLx5YFYp3V5l5+J167aunZX2YahVC0d0DDHJPSNBQUH0aPg3W5LMXYJUKgqoG3sEPa4xV5vKO3+Y60MTvThxY= X-Gm-Message-State: AOJu0YzSDcFoo0V4DEKzXmYHWmsLiy/QRlwiYIiaaGEqmMmRiVz1trAw Y9Df5CSoGb37P5+LqvtwGb2j+uWg5o9LZpq03dGjQvE8RhoVo8zS X-Received: by 2002:a05:600c:524a:b0:416:8091:a39e with SMTP id fc10-20020a05600c524a00b004168091a39emr2078138wmb.10.1713442931885; Thu, 18 Apr 2024 05:22:11 -0700 (PDT) Received: from [192.168.1.50] ([79.113.154.240]) by smtp.gmail.com with ESMTPSA id ay15-20020a05600c1e0f00b004189a5ada3asm6412908wmb.19.2024.04.18.05.22.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 05:22:11 -0700 (PDT) Message-ID: Date: Thu, 18 Apr 2024 15:22:10 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 5/6] wifi: rtlwifi: Clean up rtl8192d-common a bit To: Ping-Ke Shih , "linux-wireless@vger.kernel.org" Cc: Larry Finger , Stefan Lippers-Hollmann , Christian Hewitt References: <561cc9e4-3ddc-40cd-a076-2c14c44eea87@gmail.com> <4e47c56c-4b7f-4ae6-84b9-05f0cac97dac@gmail.com> <72bd1a7172154d4e9a79678e5151cdf3@realtek.com> <42113d0a089d4096aa1b5cc3861ac297@realtek.com> Content-Language: en-US From: Bitterblue Smith In-Reply-To: <42113d0a089d4096aa1b5cc3861ac297@realtek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18/04/2024 03:49, Ping-Ke Shih wrote: > Bitterblue Smith wrote: >> >> On 17/04/2024 09:48, Ping-Ke Shih wrote: >>> Bitterblue Smith wrote: >>> >>>> @@ -228,35 +238,25 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw, >>>> break; >>>> } >>>> } >>>> + >>>> while (!bwrite_success) { >>>> wait_writeh2c_limmit--; >>>> if (wait_writeh2c_limmit == 0) { >>>> pr_err("Write H2C fail because no trigger for FW INT!\n"); >>>> break; >>>> } >>>> + >>>> boxnum = rtlhal->last_hmeboxnum; >>>> switch (boxnum) { >>>> - case 0: >>>> - box_reg = REG_HMEBOX_0; >>>> - box_extreg = REG_HMEBOX_EXT_0; >>>> - break; >>>> - case 1: >>>> - box_reg = REG_HMEBOX_1; >>>> - box_extreg = REG_HMEBOX_EXT_1; >>>> - break; >>>> - case 2: >>>> - box_reg = REG_HMEBOX_2; >>>> - box_extreg = REG_HMEBOX_EXT_2; >>>> - break; >>>> - case 3: >>>> - box_reg = REG_HMEBOX_3; >>>> - box_extreg = REG_HMEBOX_EXT_3; >>>> + case 0 ... 3: >>>> + box_reg = REG_HMEBOX_0 + boxnum * 4; >>>> + box_extreg = REG_HMEBOX_EXT_0 + boxnum * 2; >>> >>> Should be "* 4" as well? >>> >>> box_extreg = REG_HMEBOX_EXT_0 + boxnum * 4; >>> >> >> No, because they are only two bytes apart in this old chip: >> >> #define REG_HMEBOX_EXT_0 0x0088 >> #define REG_HMEBOX_EXT_1 0x008A >> #define REG_HMEBOX_EXT_2 0x008C >> #define REG_HMEBOX_EXT_3 0x008E >> > > Sorry, I misread them in rtl8188ee/reg.h. > > To clearly know what 4 and 2 are, how about to define: > > #define SIZE_OF_REG_HMEBOX 4 > #define SIZE_OF_REG_HMEBOX_EXT 2 > Sounds good.