diff options
author | Martin Kaiser <martin@kaiser.cx> | 2022-02-12 17:17:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-15 17:11:23 +0100 |
commit | 67a825083163331bbc48569dca41aa7f53a26625 (patch) | |
tree | dac1f8307ef7e55deb2495cd655ad31237800db5 | |
parent | aa7776609583ba8d3cbf44a7c46c8bd0cbb75689 (diff) |
staging: r8188eu: limit rtw_wx_read_rf to path a
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>
Link: https://lore.kernel.org/r/20220212161737.381841-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/r8188eu/os_dep/ioctl_linux.c | 7 |
1 files 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: |