]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
staging: gpib: Fix sending clear and trigger events
authorDave Penkler <dpenkler@gmail.com>
Sun, 28 Sep 2025 11:33:58 +0000 (13:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:10:31 +0000 (14:10 +0100)
commit 92a2b74a6b5a5d9b076cd9aa75e63c6461cbd073 upstream.

This driver was not sending device clear or trigger events when the
board entered the DCAS or DTAS state respectively in device mode.

DCAS is the Device Clear Active State which is entered on receiving a
selective device clear message (SDC) or universal device clear message
(DCL) from the controller in charge.

DTAS is the Device Trigger Active State which is entered on receiving
a group execute trigger (GET) message from the controller.

In order for an application, implementing a particular device, to
detect when one of these states is entered the driver needs to send
the appropriate event.

Send the appropriate gpib_event when DCAS or DTAS is set in the
reported status word. This sets the DCAS or DTAS bits in the board's
status word which can be monitored by the application.

Fixes: 4e127de14fa7 ("staging: gpib: Add National Instruments USB GPIB driver")
Cc: stable <stable@kernel.org>
Tested-by: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/ni_usb/ni_usb_gpib.c

index 4e9a654bf51f4fc9fcaf917bb2fdef48bb25e8ca..5e543fa95b82b182e6ff7de1db965bc49e3958d9 100644 (file)
@@ -327,7 +327,10 @@ static void ni_usb_soft_update_status(struct gpib_board *board, unsigned int ni_
        board->status &= ~clear_mask;
        board->status &= ~ni_usb_ibsta_mask;
        board->status |= ni_usb_ibsta & ni_usb_ibsta_mask;
-       //FIXME should generate events on DTAS and DCAS
+       if (ni_usb_ibsta & DCAS)
+               push_gpib_event(board, EVENT_DEV_CLR);
+       if (ni_usb_ibsta & DTAS)
+               push_gpib_event(board, EVENT_DEV_TRG);
 
        spin_lock_irqsave(&board->spinlock, flags);
 /* remove set status bits from monitored set why ?***/