Message ID | 1456781570-16552-13-git-send-email-qca_merez@qca.qualcomm.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Kalle Valo |
Headers | show |
Maya Erez <qca_merez@qca.qualcomm.com> writes: > From: Lior David <qca_liord@qca.qualcomm.com> > > Fix a debug message related to IOCTL that was incorrectly logged > with the MISC category, and move it inside wil_ioctl so it will > always be logged even if we call wil_ioctl from other places. > > Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> > Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> [...] > --- a/drivers/net/wireless/ath/wil6210/ioctl.c > +++ b/drivers/net/wireless/ath/wil6210/ioctl.c > @@ -161,13 +161,20 @@ out_free: > > int wil_ioctl(struct wil6210_priv *wil, void __user *data, int cmd) > { > + int ret; > + > switch (cmd) { > case WIL_IOCTL_MEMIO: > - return wil_ioc_memio_dword(wil, data); > + ret = wil_ioc_memio_dword(wil, data); > + break; > case WIL_IOCTL_MEMIO_BLOCK: > - return wil_ioc_memio_block(wil, data); > + ret = wil_ioc_memio_block(wil, data); > + break; > default: > wil_dbg_ioctl(wil, "Unsupported IOCTL 0x%04x\n", cmd); > return -ENOIOCTLCMD; > } > + > + wil_dbg_ioctl(wil, "ioctl(0x%04x) -> %d\n", cmd, ret); > + return ret; > } ioctl interfaces don't belong to wireless drivers and this should be converted something else, like debugfs. I think there was a discussion about this a year ago or so. I can take this patch still but please replace this interface altogether.
diff --git a/drivers/net/wireless/ath/wil6210/ioctl.c b/drivers/net/wireless/ath/wil6210/ioctl.c index f7f9486..6303800 100644 --- a/drivers/net/wireless/ath/wil6210/ioctl.c +++ b/drivers/net/wireless/ath/wil6210/ioctl.c @@ -161,13 +161,20 @@ out_free: int wil_ioctl(struct wil6210_priv *wil, void __user *data, int cmd) { + int ret; + switch (cmd) { case WIL_IOCTL_MEMIO: - return wil_ioc_memio_dword(wil, data); + ret = wil_ioc_memio_dword(wil, data); + break; case WIL_IOCTL_MEMIO_BLOCK: - return wil_ioc_memio_block(wil, data); + ret = wil_ioc_memio_block(wil, data); + break; default: wil_dbg_ioctl(wil, "Unsupported IOCTL 0x%04x\n", cmd); return -ENOIOCTLCMD; } + + wil_dbg_ioctl(wil, "ioctl(0x%04x) -> %d\n", cmd, ret); + return ret; } diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index d4ec5b2..3bc0e26 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c @@ -60,11 +60,7 @@ static int wil_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) { struct wil6210_priv *wil = ndev_to_wil(ndev); - int ret = wil_ioctl(wil, ifr->ifr_data, cmd); - - wil_dbg_misc(wil, "ioctl(0x%04x) -> %d\n", cmd, ret); - - return ret; + return wil_ioctl(wil, ifr->ifr_data, cmd); } static const struct net_device_ops wil_netdev_ops = {