Skip to content

Commit

Permalink
staging: line6: drop control URB dumping code
Browse files Browse the repository at this point in the history
The usbmon feature should be used instead of manually dumping control
URBs.  There are a few advantages to using usbmon:

 * Can be turned on/off at runtime
 * Provides full USB-level traffic
 * tcpdump and wireshark support for powerful analysis
 * No driver-specific code is required

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Stefan Hajnoczi authored and Greg Kroah-Hartman committed Nov 15, 2012
1 parent 8fdefcb commit 70ce939
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
36 changes: 0 additions & 36 deletions drivers/staging/line6/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,6 @@ void line6_write_hexdump(struct usb_line6 *line6, char dir,
}
#endif

#ifdef CONFIG_LINE6_USB_DUMP_CTRL
/*
Dump URB data to syslog.
*/
static void line6_dump_urb(struct urb *urb)
{
struct usb_line6 *line6 = (struct usb_line6 *)urb->context;

if (urb->status < 0)
return;

line6_write_hexdump(line6, 'R', (unsigned char *)urb->transfer_buffer,
urb->actual_length);
}
#endif

/*
Send raw message in pieces of wMaxPacketSize bytes.
*/
Expand All @@ -201,10 +185,6 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
{
int i, done = 0;

#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_write_hexdump(line6, 'S', buffer, size);
#endif

for (i = 0; i < size; i += line6->max_packet_size) {
int partial;
const char *frag_buf = buffer + i;
Expand Down Expand Up @@ -259,10 +239,6 @@ static int line6_send_raw_message_async_part(struct message *msg,
(char *)msg->buffer + done, bytes,
line6_async_request_sent, msg, line6->interval);

#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_write_hexdump(line6, 'S', (char *)msg->buffer + done, bytes);
#endif

msg->done += bytes;
retval = usb_submit_urb(urb, GFP_ATOMIC);

Expand Down Expand Up @@ -403,10 +379,6 @@ static void line6_data_received(struct urb *urb)
if (urb->status == -ESHUTDOWN)
return;

#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_dump_urb(urb);
#endif

done =
line6_midibuf_write(mb, urb->transfer_buffer, urb->actual_length);

Expand Down Expand Up @@ -502,10 +474,6 @@ int line6_send_program(struct usb_line6 *line6, u8 value)
buffer[0] = LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST;
buffer[1] = value;

#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_write_hexdump(line6, 'S', buffer, 2);
#endif

retval = usb_interrupt_msg(line6->usbdev,
usb_sndintpipe(line6->usbdev,
line6->ep_control_write),
Expand Down Expand Up @@ -539,10 +507,6 @@ int line6_transmit_parameter(struct usb_line6 *line6, int param, u8 value)
buffer[1] = param;
buffer[2] = value;

#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_write_hexdump(line6, 'S', buffer, 3);
#endif

retval = usb_interrupt_msg(line6->usbdev,
usb_sndintpipe(line6->usbdev,
line6->ep_control_write),
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/line6/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
dev_err(line6->ifcdev, "Out of memory\n");
return -ENOMEM;
}
#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_write_hexdump(line6, 'S', data, length);
#endif

transfer_buffer = kmemdup(data, length, GFP_ATOMIC);

Expand Down

0 comments on commit 70ce939

Please sign in to comment.