diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -247,6 +247,10 @@ #define LINUX_SIOCGIFINDEX 0x8933 #define LINUX_SIOGIFINDEX LINUX_SIOCGIFINDEX #define LINUX_SIOCGIFCOUNT 0x8938 +/* SIOCSIFMEDIA/SIOCGIFMEDIA is not linux calls, so select linux unused value */ +#define LINUX_SIOCSIFMEDIA 0x894F /* support linux app set freebsd media */ +/* 0x8950 - 0x8952 obsolete calls */ +#define LINUX_SIOCGIFMEDIA 0x8950 /* support linux app to get freebsd media */ #define LINUX_IOCTL_SOCKET_MIN LINUX_FIOSETOWN #define LINUX_IOCTL_SOCKET_MAX LINUX_SIOCGIFCOUNT diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2445,6 +2445,15 @@ error = 0; break; + case LINUX_SIOCGIFMEDIA: + args->cmd = SIOCGIFMEDIA; + error = sys_ioctl(td, (struct ioctl_args *)args); + break; + case LINUX_SIOCSIFMEDIA: + args->cmd = SIOCSIFMEDIA; + error = sys_ioctl(td, (struct ioctl_args *)args); + break; + default: error = linux_ioctl_socket_ifreq(td, args->fd, args->cmd, PTRIN(args->arg));