Hi,
Thank you for your input. I've decided to embrace the asynchronous
route. I'm now trying to get interrupt out to work in the normal repeated
interrupt mode, every 30ms. The problem is I can't make it stop!! The
completion handler goes to unlink the urb if there is no more data to
send. No errors are returned but the completion handler gets call with no
end in sight...
Is there anything special that I need to do to stop a sending interrupt
urb other than just use usb_unlink_urb()?
Thanks,
-Mike
PS Here's my completion handler and below it is a dump of the urb
coming into it...
static void voipblaster_cmd_irq(urb_t *urb)
{
struct voipblaster_usb_data *voipblaster = urb->context;
unsigned long flags;
int status;
/* The last command was sent to the voipblaster. If there are
any more commands send them off too. If there aren't anymore
then unlink this urb. This completion handler may also be
called when we unlink the URB... */
usb_dump_urb(urb);
spin_lock_irqsave(&voipblaster->io_lock,flags);
if (voipblaster->cmd_buffer_len <= 0) {
info("Command buffer empty but IRQ handler just completed...");
spin_unlock_irqrestore(&voipblaster->io_lock,flags);
return;
}
/* The current command has been processed... */
voipblaster->cmd_buffer_len--;
voipblaster->cmd_buffer_in += VB_CMD_BUFF_LENGTH -1;
voipblaster->cmd_buffer_in %= VB_CMD_BUFF_LENGTH;
if (voipblaster->cmd_buffer_len <= 0) {
/* This was the last command in the buffer. Unlink URB for now. */
info("Unlinking CMD URB");
urb->transfer_flags |= USB_ASYNC_UNLINK;
status = usb_unlink_urb(urb);
if (status != 0) {
info("Error unlinking CMD URB: %d",status);
}
}
spin_unlock_irqrestore(&voipblaster->io_lock,flags);
info("CMD successfully delivered to USB subsystem...");
}
Dumped URB:
Jun 21 12:53:19 devbox kernel: urb :c6839410
Jun 21 12:53:19 devbox kernel: next :00000000
Jun 21 12:53:19 devbox kernel: dev :c3943000
Jun 21 12:53:19 devbox kernel: pipe :40008200
Jun 21 12:53:19 devbox kernel: status :0
Jun 21 12:53:19 devbox kernel: transfer_flags :00000000
Jun 21 12:53:19 devbox kernel: transfer_buffer :c6839464
Jun 21 12:53:19 devbox kernel: transfer_buffer_length:1
Jun 21 12:53:19 devbox kernel: actual_length :1
Jun 21 12:53:19 devbox kernel: setup_packet :00000000
Jun 21 12:53:19 devbox kernel: start_frame :-1
Jun 21 12:53:19 devbox kernel: number_of_packets :0
Jun 21 12:53:19 devbox kernel: interval :30
Jun 21 12:53:19 devbox kernel: error_count :0
Jun 21 12:53:19 devbox kernel: context :c6837e80
Jun 21 12:53:19 devbox kernel: complete :c6837150
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel