Skip to content

Commit 92a2b74

Browse files
dpenklergregkh
authored andcommitted
staging: gpib: Fix sending clear and trigger events
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: 4e127de ("staging: gpib: Add National Instruments USB GPIB driver") Cc: stable <[email protected]> Tested-by: Dave Penkler <[email protected]> Signed-off-by: Dave Penkler <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d3c4c1f commit 92a2b74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/staging/gpib/ni_usb/ni_usb_gpib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ static void ni_usb_soft_update_status(struct gpib_board *board, unsigned int ni_
327327
board->status &= ~clear_mask;
328328
board->status &= ~ni_usb_ibsta_mask;
329329
board->status |= ni_usb_ibsta & ni_usb_ibsta_mask;
330-
// FIXME should generate events on DTAS and DCAS
330+
if (ni_usb_ibsta & DCAS)
331+
push_gpib_event(board, EVENT_DEV_CLR);
332+
if (ni_usb_ibsta & DTAS)
333+
push_gpib_event(board, EVENT_DEV_TRG);
331334

332335
spin_lock_irqsave(&board->spinlock, flags);
333336
/* remove set status bits from monitored set why ?***/

0 commit comments

Comments
 (0)