driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] staging: comedi: Fix some command data endian problems
@ 2021-02-23 14:30 Ian Abbott
  2021-02-23 14:30 ` [PATCH 01/14] staging: comedi: addi_apci_1032: Fix endian problem for COS sample Ian Abbott
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Ian Abbott @ 2021-02-23 14:30 UTC (permalink / raw)
  To: devel; +Cc: Greg Kroah-Hartman, Ian Abbott

The `comedi_buf_read_samples()` and `comedi_buf_write_samples()`
functions can read/write either 16-bit or 32-bit values from/to the
Comedi buffer used for Comedi asynchonous command data.  The width of
the value depends on whether the subdevice sets the `SDF_LSAMPL` flag
(indicating 32-bit samples, if set).

Various Comedi drivers are calling `comedi_buf_write_samples()` with the
address of an object of type `unsigned int` when the subdevice is set to
use 16-bit wide samples (`SDF_LSAMPL` flag clear).  That will not work
properly on bigendian machines because it will be transferring a 2-byte
value from the wrong end of the 32-bit integer.  This patch series fixes
those problems.

For some of the drivers, the value being transferred is always 0 anyway,
so it doesn't matter much, but fix them anyway in patches 10 thru 14.

01) staging: comedi: addi_apci_1032: Fix endian problem for COS sample
02) staging: comedi: addi_apci_1500: Fix endian problem for command sample
03) staging: comedi: adv_pci1710: Fix endian problem for AI command data
04) staging: comedi: das6402: Fix endian problem for AI command data
05) staging: comedi: das800: Fix endian problem for AI command data
06) staging: comedi: dmm32at: Fix endian problem for AI command data
07) staging: comedi: me4000: Fix endian problem for AI command data
08) staging: comedi: pcl711: Fix endian problem for AI command data
09) staging: comedi: pcl818: Fix endian problem for AI command data
10) staging: comedi: amplc_pc236_common: Use 16-bit 0 for interrupt data
11) staging: comedi: comedi_parport: Use 16-bit 0 for interrupt data
12) staging: comedi: ni_6527: Use 16-bit 0 for interrupt data
13) staging: comedi: ni_65xx: Use 16-bit 0 for interrupt data
14) staging: comedi: pcl726: Use 16-bit 0 for interrupt data

 drivers/staging/comedi/drivers/addi_apci_1032.c     |  4 +++-
 drivers/staging/comedi/drivers/addi_apci_1500.c     | 18 +++++++++---------
 drivers/staging/comedi/drivers/adv_pci1710.c        | 10 +++++-----
 drivers/staging/comedi/drivers/amplc_pc236_common.c |  4 +++-
 drivers/staging/comedi/drivers/comedi_parport.c     |  3 ++-
 drivers/staging/comedi/drivers/das6402.c            |  2 +-
 drivers/staging/comedi/drivers/das800.c             |  2 +-
 drivers/staging/comedi/drivers/dmm32at.c            |  2 +-
 drivers/staging/comedi/drivers/me4000.c             |  2 +-
 drivers/staging/comedi/drivers/ni_6527.c            |  4 +++-
 drivers/staging/comedi/drivers/ni_65xx.c            |  3 ++-
 drivers/staging/comedi/drivers/pcl711.c             |  2 +-
 drivers/staging/comedi/drivers/pcl726.c             |  4 +++-
 drivers/staging/comedi/drivers/pcl818.c             |  2 +-
 14 files changed, 36 insertions(+), 26 deletions(-)

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-02-23 14:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 14:30 [PATCH 00/14] staging: comedi: Fix some command data endian problems Ian Abbott
2021-02-23 14:30 ` [PATCH 01/14] staging: comedi: addi_apci_1032: Fix endian problem for COS sample Ian Abbott
2021-02-23 14:30 ` [PATCH 02/14] staging: comedi: addi_apci_1500: Fix endian problem for command sample Ian Abbott
2021-02-23 14:30 ` [PATCH 03/14] staging: comedi: adv_pci1710: Fix endian problem for AI command data Ian Abbott
2021-02-23 14:30 ` [PATCH 04/14] staging: comedi: das6402: " Ian Abbott
2021-02-23 14:30 ` [PATCH 05/14] staging: comedi: das800: " Ian Abbott
2021-02-23 14:30 ` [PATCH 06/14] staging: comedi: dmm32at: " Ian Abbott
2021-02-23 14:30 ` [PATCH 07/14] staging: comedi: me4000: " Ian Abbott
2021-02-23 14:30 ` [PATCH 08/14] staging: comedi: pcl711: " Ian Abbott
2021-02-23 14:30 ` [PATCH 09/14] staging: comedi: pcl818: " Ian Abbott
2021-02-23 14:30 ` [PATCH 10/14] staging: comedi: amplc_pc236_common: Use 16-bit 0 for interrupt data Ian Abbott
2021-02-23 14:30 ` [PATCH 11/14] staging: comedi: comedi_parport: " Ian Abbott
2021-02-23 14:30 ` [PATCH 12/14] staging: comedi: ni_6527: " Ian Abbott
2021-02-23 14:30 ` [PATCH 13/14] staging: comedi: ni_65xx: " Ian Abbott
2021-02-23 14:30 ` [PATCH 14/14] staging: comedi: pcl726: " Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).