linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 06/10] staging: r8188eu: limit rtw_wx_read_rf to path a
Date: Sat, 12 Feb 2022 17:17:33 +0100	[thread overview]
Message-ID: <20220212161737.381841-7-martin@kaiser.cx> (raw)
In-Reply-To: <20220212161737.381841-1-martin@kaiser.cx>

Commit 3b011b097c38 ("staging: r8188eu: limit rf register writes to
path a") limits rf register writes by private ioctls to RF_PATH_A.
Apart from private ioctls, the rest of the driver uses only path a.

This patch limits rf register reads by the private ioctl 0x0D, which
calls rtw_wx_read_rf, to path a.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/os_dep/ioctl_linux.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index e815ae223f53..30fdc8afcffe 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -2063,8 +2063,11 @@ static int rtw_wx_read_rf(struct net_device *dev,
 	u32 path, addr, data32;
 
 	path = *(u32 *)extra;
+	if (path != RF_PATH_A)
+		return -EINVAL;
+
 	addr = *((u32 *)extra + 1);
-	data32 = rtl8188e_PHY_QueryRFReg(padapter, path, addr, 0xFFFFF);
+	data32 = rtl8188e_PHY_QueryRFReg(padapter, RF_PATH_A, addr, 0xFFFFF);
 	/*
 	 * IMPORTANT!!
 	 * Only when wireless private ioctl is at odd order,
@@ -3626,7 +3629,7 @@ static int rtw_dbg_port(struct net_device *dev,
 			break;
 		}
 		rtl8188e_PHY_SetRFReg(padapter, arg, 0xffffffff, extra_arg);
-		DBG_88E("write RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff));
+		DBG_88E("write RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", RF_PATH_A, arg, rtl8188e_PHY_QueryRFReg(padapter, RF_PATH_A, arg, 0xffffffff));
 		break;
 
 	case 0x76:
-- 
2.30.2


  parent reply	other threads:[~2022-02-12 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-12 16:17 [PATCH 00/10] remove rf register access for path b Martin Kaiser
2022-02-12 16:17 ` [PATCH 01/10] staging: r8188eu: set path a explicitly Martin Kaiser
2022-02-12 16:17 ` [PATCH 02/10] staging: r8188eu: write only path a registers in rtw_dbg_port Martin Kaiser
2022-02-12 16:17 ` [PATCH 03/10] staging: r8188eu: remove path parameter from rtl8188e_PHY_SetRFReg Martin Kaiser
2022-02-12 16:17 ` [PATCH 04/10] staging: r8188eu: remove path parameter from phy_RFSerialWrite Martin Kaiser
2022-02-12 16:17 ` [PATCH 05/10] staging: r8188eu: clarify that bb_reg_dump uses only path a Martin Kaiser
2022-02-12 16:17 ` Martin Kaiser [this message]
2022-02-12 16:17 ` [PATCH 07/10] staging: r8188eu: limit rtw_dbg_port to " Martin Kaiser
2022-02-12 16:17 ` [PATCH 08/10] staging: r8188eu: remove path parameter from rtl8188e_PHY_QueryRFReg Martin Kaiser
2022-02-12 16:17 ` [PATCH 09/10] staging: r8188eu: remove path parameter from phy_RFSerialRead Martin Kaiser
2022-02-12 16:17 ` [PATCH 10/10] staging: r8188eu: we only need one struct bb_reg_def for path a Martin Kaiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220212161737.381841-7-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).