Posix: removed PX4_DEVIOC* definitions

The following should not have been defined:

PX4_DIOC_GETPRIV
PX4_DEVIOCSPUBBLOCK
PX4_DEVIOCGPUBBLOCK
PX4_DEVIOCGDEVICEID

The actual defines are in drv_device.h and are:

DEVIOCSPUBBLOCK
DEVIOCGPUBBLOCK
DEVIOCGDEVICEID

DIOC_GETPRIV is defined by Nuttx, so mapped to SIOCDEVPRIVATE for POSIX

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-04-21 23:20:59 -07:00
parent da29004a26
commit 02aaa403f1
4 changed files with 10 additions and 11 deletions
+2 -1
View File
@@ -41,6 +41,7 @@
#include <px4_defines.h>
#include <px4_posix.h>
#include <drivers/drv_device.h>
#include <stdio.h>
#include <unistd.h>
@@ -121,7 +122,7 @@ int
Device::dev_ioctl(unsigned operation, unsigned &arg)
{
switch (operation) {
case PX4_DEVIOCGDEVICEID:
case DEVIOCGDEVICEID:
return (int)_device_id.devid;
}
return -ENODEV;
+5 -4
View File
@@ -298,19 +298,20 @@ VDev::ioctl(px4_dev_handle_t *handlep, int cmd, unsigned long arg)
switch (cmd) {
/* fetch a pointer to the driver's private data */
case PX4_DIOC_GETPRIV:
case DIOC_GETPRIV:
*(void **)(uintptr_t)arg = (void *)this;
ret = PX4_OK;
break;
case PX4_DEVIOCSPUBBLOCK:
case DEVIOCSPUBBLOCK:
_pub_blocked = (arg != 0);
ret = PX4_OK;
break;
case PX4_DEVIOCGPUBBLOCK:
case DEVIOCGPUBBLOCK:
ret = _pub_blocked;
break;
case PX4_DEVIOCGDEVICEID:
case DEVIOCGDEVICEID:
ret = (int)_device_id.devid;
printf("IOCTL DEVIOCGDEVICEID %d\n", ret);
default:
break;
}
+3
View File
@@ -65,5 +65,8 @@
*/
#define DEVIOCGDEVICEID _DEVICEIOC(2)
#ifdef __PX4_POSIX
#define DIOC_GETPRIV SIOCDEVPRIVATE
#endif
#endif /* _DRV_DEVICE_H */
-6
View File
@@ -49,12 +49,6 @@
#define PX4_F_RDONLY 1
#define PX4_F_WRONLY 2
#define PX4_DEVIOCGDEVICEID 1
#define PX4_DIOC_GETPRIV 2
#define PX4_DEVIOCSPUBBLOCK 3
#define PX4_DEVIOCGPUBBLOCK 4
#define PX4_DEBUG(...)
//#define PX4_DEBUG(...) printf(__VA_ARGS__)