Browse Source

delete IOCTL SENSORIOCSQUEUEDEPTH

- only used in test routines
sbg
Daniel Agar 6 years ago committed by Lorenz Meier
parent
commit
dd0baaee91
  1. 29
      src/drivers/barometer/bmp280/bmp280.cpp
  2. 27
      src/drivers/barometer/lps25h/lps25h.cpp
  3. 27
      src/drivers/barometer/mpl3115a2/mpl3115a2.cpp
  4. 27
      src/drivers/barometer/ms5611/ms5611.cpp
  5. 8
      src/drivers/drv_sensor.h
  6. 54
      src/drivers/imu/adis16448/adis16448.cpp
  7. 18
      src/drivers/imu/bma180/bma180.cpp
  8. 18
      src/drivers/imu/bmi055/BMI055_accel.cpp
  9. 18
      src/drivers/imu/bmi055/BMI055_gyro.cpp
  10. 36
      src/drivers/imu/bmi160/bmi160.cpp
  11. 18
      src/drivers/imu/fxas21002c/fxas21002c.cpp
  12. 36
      src/drivers/imu/fxos8701cq/fxos8701cq.cpp
  13. 18
      src/drivers/imu/l3gd20/l3gd20.cpp
  14. 36
      src/drivers/imu/lsm303d/lsm303d.cpp
  15. 36
      src/drivers/imu/mpu6000/mpu6000.cpp
  16. 18
      src/drivers/imu/mpu9250/mag.cpp
  17. 36
      src/drivers/imu/mpu9250/mpu9250.cpp
  18. 18
      src/drivers/magnetometer/bmm150/bmm150.cpp
  19. 28
      src/drivers/magnetometer/hmc5883/hmc5883.cpp
  20. 28
      src/drivers/magnetometer/ist8310/ist8310.cpp
  21. 18
      src/drivers/magnetometer/lis3mdl/lis3mdl.cpp
  22. 6
      src/drivers/magnetometer/lis3mdl/lis3mdl_main.cpp
  23. 18
      src/drivers/magnetometer/rm3100/rm3100.cpp
  24. 12
      src/drivers/magnetometer/rm3100/rm3100_main.cpp
  25. 18
      src/drivers/pwm_input/pwm_input.cpp
  26. 18
      src/drivers/px4flow/px4flow.cpp
  27. 26
      src/modules/simulator/accelsim/accelsim.cpp
  28. 17
      src/modules/simulator/airspeedsim/airspeedsim.cpp
  29. 26
      src/modules/simulator/gyrosim/gyrosim.cpp
  30. 18
      src/modules/uavcan/sensors/baro.cpp
  31. 3
      src/modules/uavcan/sensors/mag.cpp

29
src/drivers/barometer/bmp280/bmp280.cpp

@ -372,23 +372,6 @@ BMP280::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -372,23 +372,6 @@ BMP280::ioctl(struct file *filp, int cmd, unsigned long arg)
break;
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
/*
* Since we are initialized, we do not need to do anything, since the
@ -723,18 +706,6 @@ test(enum BMP280_BUS busid) @@ -723,18 +706,6 @@ test(enum BMP280_BUS busid)
print_message(report);
/* set the queue depth to 10 */
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
PX4_ERR("failed to set queue depth");
exit(1);
}
/* start the sensor polling at 2Hz */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
PX4_ERR("failed to set 2Hz poll rate");
exit(1);
}
/* read the sensor 5x and report each value */
for (unsigned i = 0; i < 5; i++) {
struct pollfd fds;

27
src/drivers/barometer/lps25h/lps25h.cpp

@ -487,23 +487,6 @@ LPS25H::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -487,23 +487,6 @@ LPS25H::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
return reset();
@ -896,16 +879,6 @@ test(enum LPS25H_BUS busid) @@ -896,16 +879,6 @@ test(enum LPS25H_BUS busid)
print_message(report);
/* set the queue depth to 10 */
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
errx(1, "failed to set queue depth");
}
/* start the sensor polling at 2Hz */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
errx(1, "failed to set 2Hz poll rate");
}
/* read the sensor 5x and report each value */
for (unsigned i = 0; i < 5; i++) {
struct pollfd fds;

27
src/drivers/barometer/mpl3115a2/mpl3115a2.cpp

@ -438,23 +438,6 @@ MPL3115A2::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -438,23 +438,6 @@ MPL3115A2::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET: {
/*
* Since we are initialized, we do not need to do anything, since the
@ -827,16 +810,6 @@ test(enum MPL3115A2_BUS busid) @@ -827,16 +810,6 @@ test(enum MPL3115A2_BUS busid)
print_message(report);
/* set the queue depth to 10 */
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
errx(1, "failed to set queue depth");
}
/* start the sensor polling at 2Hz */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
errx(1, "failed to set 2Hz poll rate");
}
/* read the sensor 5x and report each value */
for (unsigned i = 0; i < 5; i++) {
struct pollfd fds;

27
src/drivers/barometer/ms5611/ms5611.cpp

@ -513,23 +513,6 @@ MS5611::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -513,23 +513,6 @@ MS5611::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
/*
* Since we are initialized, we do not need to do anything, since the
@ -1030,16 +1013,6 @@ test(enum MS5611_BUS busid) @@ -1030,16 +1013,6 @@ test(enum MS5611_BUS busid)
print_message(report);
/* set the queue depth to 10 */
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
errx(1, "failed to set queue depth");
}
/* start the sensor polling at 2Hz */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
errx(1, "failed to set 2Hz poll rate");
}
/* read the sensor 5x and report each value */
for (unsigned i = 0; i < 5; i++) {
struct pollfd fds;

8
src/drivers/drv_sensor.h

@ -128,14 +128,6 @@ @@ -128,14 +128,6 @@
#define SENSOR_POLLRATE_DEFAULT 1000003 /**< poll at driver normal rate */
/**
* Set the internal queue depth to (arg) entries, must be at least 1
*
* This sets the upper bound on the number of readings that can be
* read from the driver.
*/
#define SENSORIOCSQUEUEDEPTH _SENSORIOC(2)
/**
* Reset the sensor to its default configuration
*/

54
src/drivers/imu/adis16448/adis16448.cpp

@ -1034,24 +1034,6 @@ ADIS16448::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -1034,24 +1034,6 @@ ADIS16448::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -1082,24 +1064,6 @@ ADIS16448::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -1082,24 +1064,6 @@ ADIS16448::gyro_ioctl(struct file *filp, int cmd, unsigned long arg)
case SENSORIOCRESET:
return ioctl(filp, cmd, arg);
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_gyro_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case GYROIOCSSCALE:
/* copy scale in */
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));
@ -1121,24 +1085,6 @@ ADIS16448::mag_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -1121,24 +1085,6 @@ ADIS16448::mag_ioctl(struct file *filp, int cmd, unsigned long arg)
case SENSORIOCRESET:
return ioctl(filp, cmd, arg);
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_mag_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case MAGIOCSSCALE:
/* copy scale in */
memcpy(&_mag_scale, (struct mag_calibration_s *) arg, sizeof(_mag_scale));

18
src/drivers/imu/bma180/bma180.cpp

@ -437,24 +437,6 @@ BMA180::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -437,24 +437,6 @@ BMA180::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 2) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
/* XXX implement */
return -EINVAL;

18
src/drivers/imu/bmi055/BMI055_accel.cpp

@ -381,24 +381,6 @@ BMI055_accel::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -381,24 +381,6 @@ BMI055_accel::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

18
src/drivers/imu/bmi055/BMI055_gyro.cpp

@ -365,24 +365,6 @@ BMI055_gyro::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -365,24 +365,6 @@ BMI055_gyro::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_gyro_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case GYROIOCSSCALE:
/* copy scale in */
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));

36
src/drivers/imu/bmi160/bmi160.cpp

@ -617,24 +617,6 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -617,24 +617,6 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -665,24 +647,6 @@ BMI160::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -665,24 +647,6 @@ BMI160::gyro_ioctl(struct file *filp, int cmd, unsigned long arg)
case SENSORIOCRESET:
return ioctl(filp, cmd, arg);
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_gyro_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case GYROIOCSSCALE:
/* copy scale in */
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));

18
src/drivers/imu/fxas21002c/fxas21002c.cpp

@ -698,24 +698,6 @@ FXAS21002C::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -698,24 +698,6 @@ FXAS21002C::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
reset();
return OK;

36
src/drivers/imu/fxos8701cq/fxos8701cq.cpp

@ -844,24 +844,6 @@ FXOS8701CQ::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -844,24 +844,6 @@ FXOS8701CQ::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
reset();
return OK;
@ -931,24 +913,6 @@ FXOS8701CQ::mag_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -931,24 +913,6 @@ FXOS8701CQ::mag_ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_mag_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
reset();
return OK;

18
src/drivers/imu/l3gd20/l3gd20.cpp

@ -622,24 +622,6 @@ L3GD20::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -622,24 +622,6 @@ L3GD20::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
reset();
return OK;

36
src/drivers/imu/lsm303d/lsm303d.cpp

@ -856,24 +856,6 @@ LSM303D::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -856,24 +856,6 @@ LSM303D::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
reset();
return OK;
@ -942,24 +924,6 @@ LSM303D::mag_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -942,24 +924,6 @@ LSM303D::mag_ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_mag_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
reset();
return OK;

36
src/drivers/imu/mpu6000/mpu6000.cpp

@ -1325,24 +1325,6 @@ MPU6000::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -1325,24 +1325,6 @@ MPU6000::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -1373,24 +1355,6 @@ MPU6000::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -1373,24 +1355,6 @@ MPU6000::gyro_ioctl(struct file *filp, int cmd, unsigned long arg)
case SENSORIOCRESET:
return ioctl(filp, cmd, arg);
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_gyro_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case GYROIOCSSCALE:
/* copy scale in */
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));

18
src/drivers/imu/mpu9250/mag.cpp

@ -317,24 +317,6 @@ MPU9250_mag::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -317,24 +317,6 @@ MPU9250_mag::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_mag_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case MAGIOCSSCALE:
/* copy scale in */
memcpy(&_mag_scale, (struct mag_scale *) arg, sizeof(_mag_scale));

36
src/drivers/imu/mpu9250/mpu9250.cpp

@ -791,24 +791,6 @@ MPU9250::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -791,24 +791,6 @@ MPU9250::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_accel_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -839,24 +821,6 @@ MPU9250::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) @@ -839,24 +821,6 @@ MPU9250::gyro_ioctl(struct file *filp, int cmd, unsigned long arg)
case SENSORIOCRESET:
return ioctl(filp, cmd, arg);
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_gyro_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case GYROIOCSSCALE:
/* copy scale in */
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));

18
src/drivers/magnetometer/bmm150/bmm150.cpp

@ -759,24 +759,6 @@ BMM150::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -759,24 +759,6 @@ BMM150::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
return reset();

28
src/drivers/magnetometer/hmc5883/hmc5883.cpp

@ -662,24 +662,6 @@ HMC5883::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -662,24 +662,6 @@ HMC5883::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
return reset();
@ -1548,16 +1530,6 @@ test(enum HMC5883_BUS busid) @@ -1548,16 +1530,6 @@ test(enum HMC5883_BUS busid)
warnx("device active: %s", ret ? "external" : "onboard");
/* set the queue depth to 5 */
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
errx(1, "failed to set queue depth");
}
/* start the sensor polling at 2Hz */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
errx(1, "failed to set 2Hz poll rate");
}
/* read the sensor 5x and report each value */
for (unsigned i = 0; i < 5; i++) {
struct pollfd fds;

28
src/drivers/magnetometer/ist8310/ist8310.cpp

@ -642,24 +642,6 @@ IST8310::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -642,24 +642,6 @@ IST8310::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
return reset();
@ -1329,16 +1311,6 @@ test(enum IST8310_BUS busid) @@ -1329,16 +1311,6 @@ test(enum IST8310_BUS busid)
errx(1, "failed to get if mag is onboard or external");
}
/* set the queue depth to 5 */
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
errx(1, "failed to set queue depth");
}
/* start the sensor polling at 2Hz */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
errx(1, "failed to set 2Hz poll rate");
}
/* read the sensor 5x and report each value */
for (unsigned i = 0; i < 5; i++) {
struct pollfd fds;

18
src/drivers/magnetometer/lis3mdl/lis3mdl.cpp

@ -557,24 +557,6 @@ LIS3MDL::ioctl(struct file *file_pointer, int cmd, unsigned long arg) @@ -557,24 +557,6 @@ LIS3MDL::ioctl(struct file *file_pointer, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return PX4_OK;
}
case SENSORIOCRESET:
return reset();

6
src/drivers/magnetometer/lis3mdl/lis3mdl_main.cpp

@ -190,12 +190,6 @@ lis3mdl::test(struct lis3mdl_bus_option &bus) @@ -190,12 +190,6 @@ lis3mdl::test(struct lis3mdl_bus_option &bus)
return PX4_ERROR;
}
/* set the queue depth to 5 */
if (ioctl(fd, SENSORIOCSQUEUEDEPTH, 10) != OK) {
PX4_WARN("failed to set queue depth");
return PX4_ERROR;
}
/* start the sensor polling at 2Hz */
if (ioctl(fd, SENSORIOCSPOLLRATE, 2) != OK) {
PX4_WARN("failed to set 2Hz poll rate");

18
src/drivers/magnetometer/rm3100/rm3100.cpp

@ -418,24 +418,6 @@ RM3100::ioctl(struct file *file_pointer, int cmd, unsigned long arg) @@ -418,24 +418,6 @@ RM3100::ioctl(struct file *file_pointer, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return PX4_OK;
}
case SENSORIOCRESET:
return reset();

12
src/drivers/magnetometer/rm3100/rm3100_main.cpp

@ -182,18 +182,6 @@ rm3100::test(RM3100_BUS bus_id) @@ -182,18 +182,6 @@ rm3100::test(RM3100_BUS bus_id)
return 1;
}
/* set the queue depth to 5 */
if (ioctl(fd, SENSORIOCSQUEUEDEPTH, 10) != OK) {
PX4_WARN("failed to set queue depth");
return 1;
}
/* start the sensor polling at 2Hz */
if (ioctl(fd, SENSORIOCSPOLLRATE, 2) != OK) {
PX4_WARN("failed to set 2Hz poll rate");
return 1;
}
struct pollfd fds;
/* read the sensor 5x and report each value */

18
src/drivers/pwm_input/pwm_input.cpp

@ -437,24 +437,6 @@ int @@ -437,24 +437,6 @@ int
PWMIN::ioctl(struct file *filp, int cmd, unsigned long arg)
{
switch (cmd) {
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 500)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
/* user has asked for the timer to be reset. This may
* be needed if the pin was used for a different

18
src/drivers/px4flow/px4flow.cpp

@ -381,24 +381,6 @@ PX4FLOW::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -381,24 +381,6 @@ PX4FLOW::ioctl(struct file *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
/* XXX implement this */
return -EINVAL;

26
src/modules/simulator/accelsim/accelsim.cpp

@ -532,19 +532,6 @@ ACCELSIM::devIOCTL(unsigned long cmd, unsigned long arg) @@ -532,19 +532,6 @@ ACCELSIM::devIOCTL(unsigned long cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((ul_arg < 1) || (ul_arg > 100)) {
return -EINVAL;
}
if (!_accel_reports->resize(ul_arg)) {
return -ENOMEM;
}
return OK;
}
case SENSORIOCRESET:
// Nothing to do for simulator
return OK;
@ -612,19 +599,6 @@ ACCELSIM::mag_ioctl(unsigned long cmd, unsigned long arg) @@ -612,19 +599,6 @@ ACCELSIM::mag_ioctl(unsigned long cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
if (!_mag_reports->resize(arg)) {
return -ENOMEM;
}
return OK;
}
case SENSORIOCRESET:
// Nothing to do for simulator
return OK;

17
src/modules/simulator/airspeedsim/airspeedsim.cpp

@ -216,23 +216,6 @@ AirspeedSim::ioctl(cdev::file_t *filp, int cmd, unsigned long arg) @@ -216,23 +216,6 @@ AirspeedSim::ioctl(cdev::file_t *filp, int cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
//irqstate_t flags = px4_enter_critical_section();
if (!_reports->resize(arg)) {
//px4_leave_critical_section(flags);
return -ENOMEM;
}
//px4_leave_critical_section(flags);
return OK;
}
case SENSORIOCRESET:
/* XXX implement this */
return -EINVAL;

26
src/modules/simulator/gyrosim/gyrosim.cpp

@ -667,19 +667,6 @@ GYROSIM::devIOCTL(unsigned long cmd, unsigned long arg) @@ -667,19 +667,6 @@ GYROSIM::devIOCTL(unsigned long cmd, unsigned long arg)
}
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
if (!_accel_reports->resize(arg)) {
return -ENOMEM;
}
return OK;
}
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -710,19 +697,6 @@ GYROSIM::gyro_ioctl(unsigned long cmd, unsigned long arg) @@ -710,19 +697,6 @@ GYROSIM::gyro_ioctl(unsigned long cmd, unsigned long arg)
case SENSORIOCRESET:
return devIOCTL(cmd, arg);
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
if (!_gyro_reports->resize(arg)) {
return -ENOMEM;
}
return OK;
}
case GYROIOCSSCALE:
/* copy scale in */
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));

18
src/modules/uavcan/sensors/baro.cpp

@ -103,24 +103,6 @@ int UavcanBarometerBridge::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -103,24 +103,6 @@ int UavcanBarometerBridge::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case SENSORIOCSQUEUEDEPTH: {
/* lower bound is mandatory, upper bound is a sanity check */
if ((arg < 1) || (arg > 100)) {
return -EINVAL;
}
irqstate_t flags = px4_enter_critical_section();
if (!_reports.resize(arg)) {
px4_leave_critical_section(flags);
return -ENOMEM;
}
px4_leave_critical_section(flags);
return OK;
}
default: {
return CDev::ioctl(filp, cmd, arg);
}

3
src/modules/uavcan/sensors/mag.cpp

@ -100,9 +100,6 @@ ssize_t UavcanMagnetometerBridge::read(struct file *filp, char *buffer, size_t b @@ -100,9 +100,6 @@ ssize_t UavcanMagnetometerBridge::read(struct file *filp, char *buffer, size_t b
int UavcanMagnetometerBridge::ioctl(struct file *filp, int cmd, unsigned long arg)
{
switch (cmd) {
case SENSORIOCSQUEUEDEPTH: {
return OK; // Pretend that this stuff is supported to keep APM happy
}
case MAGIOCSSCALE: {
std::memcpy(&_scale, reinterpret_cast<const void *>(arg), sizeof(_scale));

Loading…
Cancel
Save