* Moved socket ioctls from FreeBSD compat layer into the corresponding Haiku
header. This shall ensure uniqueness of the ioctls. * Added a special SIOCEND define to Haiku's sockio.h, so that drivers can define private ioctls as can be seen in src/add-ons/kernel/drivers/network/wlan/atheros/dev/ath/if_athioctl.h. * Modified ioccom.h of the FreeBSD compat layer, to make use of the special SIOCEND define. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34612 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -52,4 +52,11 @@
|
||||
#define SIOCSPGRP 8939 /* set process group */
|
||||
#define SIOCGPGRP 8940 /* get process group */
|
||||
|
||||
#define SIOCGPRIVATE_0 8941 /* device private 0 */
|
||||
#define SIOCGPRIVATE_1 8942 /* device private 1 */
|
||||
#define SIOCSDRVSPEC 8943 /* set driver-specific parameters */
|
||||
#define SIOCGDRVSPEC 8944 /* get driver-specific parameters */
|
||||
|
||||
#define SIOCEND 8944 /* Always set to highest SIOC* */
|
||||
|
||||
#endif /* _SYS_SOCKIO_H */
|
||||
|
||||
@@ -6,23 +6,7 @@
|
||||
#define _FBSD_COMPAT_SYS_IOCCOM_H_
|
||||
|
||||
|
||||
/*
|
||||
* Ioctl's have the command encoded in the lower word, and the size of
|
||||
* any in or out parameters in the upper word. The high 3 bits of the
|
||||
* upper word are used to encode the in/out status of the parameter.
|
||||
*/
|
||||
#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */
|
||||
|
||||
#define IOC_OUT 0x40000000 /* copy out parameters */
|
||||
#define IOC_IN 0x80000000 /* copy in parameters */
|
||||
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
||||
|
||||
|
||||
#define _IOC(inout,group,num,len) ((unsigned long) \
|
||||
((inout) | (((len) & IOCPARM_MASK) << 16) | ((group) << 8) | (num)))
|
||||
|
||||
#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
|
||||
/* this should be _IORW, but stdio got there first */
|
||||
#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
|
||||
#define _IOW(g,n,t) SIOCEND + n
|
||||
#define _IOWR(g,n,t) SIOCEND + n
|
||||
|
||||
#endif /* _FBSD_COMPAT_SYS_IOCCOM_H_ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007 Haiku Inc. All rights reserved.
|
||||
* Copyright 2007-2009 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _FBSD_COMPAT_SYS_SOCKIO_H_
|
||||
@@ -13,14 +13,4 @@
|
||||
|
||||
#define SIOCSIFCAP SIOCSPACKETCAP
|
||||
|
||||
// TODO look whether those ioctls are already used by Haiku
|
||||
// and add them to Haiku's sockio.h eventually
|
||||
#define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */
|
||||
#define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */
|
||||
|
||||
#define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific
|
||||
parameters */
|
||||
#define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific
|
||||
parameters */
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user