Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| net_ioctl [2018/09/03 16:01] – [Sample userspace call] rpjday | net_ioctl [2018/09/04 10:31] (current) – [send_ioctl()] rpjday | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| * [[https:// | * [[https:// | ||
| - | ===== Sample userspace call ===== | + | ===== Sample userspace call: ethtool |
| + | |||
| + | Git repo is [[https:// | ||
| ==== send_ioctl() ==== | ==== send_ioctl() ==== | ||
| - | From '' | + | From '' |
| < | < | ||
| Line 28: | Line 30: | ||
| int send_ioctl(struct cmd_context *ctx, void *cmd) | int send_ioctl(struct cmd_context *ctx, void *cmd) | ||
| { | { | ||
| - | ctx-> | + | ctx-> |
| return ioctl(ctx-> | return ioctl(ctx-> | ||
| } | } | ||
| #endif | #endif | ||
| </ | </ | ||
| + | |||
| + | QUESTION: What is returned in ifreq%%-> | ||
| ==== struct cmd_context ==== | ==== struct cmd_context ==== | ||
| + | |||
| + | From '' | ||
| < | < | ||
| Line 48: | Line 54: | ||
| </ | </ | ||
| - | ===== struct ifreq ===== | + | ==== struct ifreq ==== |
| - | From '' | + | From '' |
| < | < | ||
| Line 128: | Line 134: | ||
| ==== sock_ioctl() ==== | ==== sock_ioctl() ==== | ||
| - | Also from '' | + | Also from '' |
| < | < | ||
| Line 152: | Line 158: | ||
| return -EFAULT; | return -EFAULT; | ||
| } else | } else | ||
| + | </ | ||
| + | |||
| + | This reflects wireless extensions, which should not be relevant: | ||
| + | |||
| + | < | ||
| #ifdef CONFIG_WEXT_CORE | #ifdef CONFIG_WEXT_CORE | ||
| if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { | if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { | ||
| Line 157: | Line 168: | ||
| } else | } else | ||
| #endif | #endif | ||
| + | </ | ||
| + | |||
| + | Finally, this is where we should end up: | ||
| + | |||
| + | < | ||
| switch (cmd) { | switch (cmd) { | ||
| case FIOSETOWN: | case FIOSETOWN: | ||