Module: xenomai-3
Branch: wip/rtnet-fixes
Commit: 7c8838fdc733a374229d054ba5e2c5277e93e45c
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7c8838fdc733a374229d054ba5e2c5277e93e45c

Author: Philippe Gerum <[email protected]>
Date:   Thu Jan 18 10:37:01 2018 +0100

net/socket: enforce secondary mode for SIOCETHTOOL

Assume this feature was originally provided by the regular driver
converted to RTNet, which we may want to support thoroughly, including
when tapping into the common PHY layer is required.

To this end, we need to enter the ioctl handler from secondary mode
only, which is not supposed to be an issue since there is no point is
expecting ethertool requests to be part of the time-critical code
anyway.

---

 kernel/drivers/net/stack/socket.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/drivers/net/stack/socket.c 
b/kernel/drivers/net/stack/socket.c
index d7d36d5..1eb1856 100644
--- a/kernel/drivers/net/stack/socket.c
+++ b/kernel/drivers/net/stack/socket.c
@@ -340,10 +340,12 @@ int rt_socket_if_ioctl(struct rtdm_fd *fd, int request, 
void __user *arg)
                break;
 
        case SIOCETHTOOL:
-           if (rtdev->do_ioctl != NULL)
-               ret = rtdev->do_ioctl(rtdev, request, arg);
-           else
-               ret = -EOPNOTSUPP;
+               if (rtdev->do_ioctl != NULL) {
+                       if (rtdm_in_rt_context())
+                               return -ENOSYS;
+                       ret = rtdev->do_ioctl(rtdev, request, arg);
+               } else
+                       ret = -EOPNOTSUPP;
            break;
 
        default:


_______________________________________________
Xenomai-git mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to