Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141405
b: refs/heads/master
c: 0a3b8b6
h: refs/heads/master
i:
  141403: a256aa3
v: v3
  • Loading branch information
Mariusz Kozlowski authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 438871b commit 9d1bc9d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6fffdb355c326b26482307d421b55fc00ee2abbc
refs/heads/master: 0a3b8b642247b509d3308cd9c32156d21505fcb8
7 changes: 7 additions & 0 deletions trunk/drivers/staging/comedi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ config COMEDI
Enable support a wide range of data acquision devices
for Linux.

config COMEDI_DEBUG
bool "Comedi debugging"
depends on COMEDI != n
help
This is an option for use by developers; most people should
say N here. This enables comedi core and driver debugging.

config COMEDI_RT
tristate "Comedi Real-time support"
depends on COMEDI && RT
Expand Down
46 changes: 22 additions & 24 deletions trunk/drivers/staging/comedi/drivers/usbduxfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ Status: testing
#include "comedi_fc.h"
#include "../comedidev.h"

// (un)comment this if you want to have debug info.
//#define CONFIG_COMEDI_DEBUG
#undef CONFIG_COMEDI_DEBUG

#define BOARDNAME "usbduxfast"

// timeout for the USB-transfer
Expand Down Expand Up @@ -189,26 +185,29 @@ static DECLARE_MUTEX(start_stop_sem);

static int send_dux_commands(usbduxfastsub_t * this_usbduxfastsub, int cmd_type)
{
int result, nsent;
int tmp, nsent;

this_usbduxfastsub->dux_commands[0] = cmd_type;

#ifdef CONFIG_COMEDI_DEBUG
int i;
printk("comedi%d: usbduxfast: dux_commands: ",
printk(KERN_DEBUG "comedi%d: usbduxfast: dux_commands: ",
this_usbduxfastsub->comedidev->minor);
for (i = 0; i < SIZEOFDUXBUFFER; i++) {
printk(" %02x", this_usbduxfastsub->dux_commands[i]);
}
for (tmp = 0; tmp < SIZEOFDUXBUFFER; tmp++)
printk(" %02x", this_usbduxfastsub->dux_commands[tmp]);
printk("\n");
#endif
result = usb_bulk_msg(this_usbduxfastsub->usbdev,

tmp = usb_bulk_msg(this_usbduxfastsub->usbdev,
usb_sndbulkpipe(this_usbduxfastsub->usbdev,
CHANNELLISTEP),
this_usbduxfastsub->dux_commands, SIZEOFDUXBUFFER,
&nsent, 10000);
if (result < 0) {
printk("comedi%d: could not transmit dux_commands to the usb-device, err=%d\n", this_usbduxfastsub->comedidev->minor, result);
}
return result;
if (tmp < 0)
printk(KERN_ERR "comedi%d: could not transmit dux_commands to"
"the usb-device, err=%d\n",
this_usbduxfastsub->comedidev->minor, tmp);

return tmp;
}

// Stops the data acquision
Expand Down Expand Up @@ -548,10 +547,10 @@ int usbduxfastsub_submit_InURBs(usbduxfastsub_t * usbduxfastsub)
SIZEINBUF, usbduxfastsub_ai_Irq, usbduxfastsub->comedidev);

#ifdef CONFIG_COMEDI_DEBUG
printk("comedi%d: usbduxfast: submitting in-urb: %x,%x\n",
printk("comedi%d: usbduxfast: submitting in-urb: 0x%p,0x%p\n",
usbduxfastsub->comedidev->minor,
(int)(usbduxfastsub->urbIn->context),
(int)(usbduxfastsub->urbIn->dev));
usbduxfastsub->urbIn->context,
usbduxfastsub->urbIn->dev);
#endif
errFlag = usb_submit_urb(usbduxfastsub->urbIn, GFP_ATOMIC);
if (errFlag) {
Expand Down Expand Up @@ -826,9 +825,8 @@ static int usbduxfast_ai_cmd(comedi_device * dev, comedi_subdevice * s)
return -EINVAL;
}
#ifdef CONFIG_COMEDI_DEBUG
printk("comedi%d: usbduxfast: steps=%ld, convert_arg=%u, ai_timer=%u\n",
dev->minor,
steps, cmd->convert_arg, this_usbduxfastsub->ai_timer);
printk("comedi%d: usbduxfast: steps=%ld, convert_arg=%u\n",
dev->minor, steps, cmd->convert_arg);
#endif

switch (cmd->chanlist_len) {
Expand Down Expand Up @@ -1211,10 +1209,10 @@ static int usbduxfast_ai_insn_read(comedi_device * dev,
return err;
}
#ifdef CONFIG_COMEDI_DEBUG
printk("comedi%d: usbduxfast: submitting in-urb: %x,%x\n",
printk("comedi%d: usbduxfast: submitting in-urb: 0x%p,0x%p\n",
usbduxfastsub->comedidev->minor,
(int)(usbduxfastsub->urbIn->context),
(int)(usbduxfastsub->urbIn->dev));
usbduxfastsub->urbIn->context,
usbduxfastsub->urbIn->dev);
#endif
for (i = 0; i < PACKETS_TO_IGNORE; i++) {
err = usb_bulk_msg(usbduxfastsub->usbdev,
Expand Down

0 comments on commit 9d1bc9d

Please sign in to comment.