Browse Source

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>
sbg
Mark Charlebois 10 years ago
parent
commit
02aaa403f1
  1. 3
      src/drivers/device/device.cpp
  2. 9
      src/drivers/device/vdev.cpp
  3. 3
      src/drivers/drv_device.h
  4. 6
      src/platforms/px4_posix.h

3
src/drivers/device/device.cpp

@ -41,6 +41,7 @@ @@ -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 @@ -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;

9
src/drivers/device/vdev.cpp

@ -298,19 +298,20 @@ VDev::ioctl(px4_dev_handle_t *handlep, int cmd, unsigned long arg) @@ -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
src/drivers/drv_device.h

@ -65,5 +65,8 @@ @@ -65,5 +65,8 @@
*/
#define DEVIOCGDEVICEID _DEVICEIOC(2)
#ifdef __PX4_POSIX
#define DIOC_GETPRIV SIOCDEVPRIVATE
#endif
#endif /* _DRV_DEVICE_H */

6
src/platforms/px4_posix.h

@ -49,12 +49,6 @@ @@ -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__)

Loading…
Cancel
Save