mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] staging: line6: drop driver-specific dumping code
@ 2012-11-14  7:50 Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 1/6] staging: line6: drop control URB " Stefan Hajnoczi
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

The line6 driver has compile-time options for dumping USB and MIDI data.
This functionality has been superceded by usbmon and amidi/aseqdump.
These mechanisms can be enabled at run-time and have other features not
in the line6 dumping code.  Therefore it's time to drop the
driver-specific dumping code as part of the effort to clean up the driver
and get it out of staging.

Stefan Hajnoczi (6):
  staging: line6: drop control URB dumping code
  staging: line6: drop CONTROL from CONFIG_LINE6_USB_DUMP_ANY
  staging: line6: drop unused CONFIG_LINE6_USB_DUMP_CTRL
  staging: line6: drop MIDI dumping code
  staging: line6: drop MIDI from CONFIG_LINE6_USB_DUMP_ANY
  staging: line6: drop unused CONFIG_LINE6_USB_DUMP_MIDI

 drivers/staging/line6/Kconfig  | 18 ------------------
 drivers/staging/line6/driver.c | 39 ---------------------------------------
 drivers/staging/line6/driver.h |  2 +-
 drivers/staging/line6/midi.c   |  6 ------
 4 files changed, 1 insertion(+), 64 deletions(-)

-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/6] staging: line6: drop control URB dumping code
  2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
@ 2012-11-14  7:50 ` Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 2/6] staging: line6: drop CONTROL from CONFIG_LINE6_USB_DUMP_ANY Stefan Hajnoczi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

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>
---
 drivers/staging/line6/driver.c | 36 ------------------------------------
 drivers/staging/line6/midi.c   |  3 ---
 2 files changed, 39 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 571f2ce..fda92d1 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -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.
 */
@@ -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;
@@ -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);
 
@@ -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);
 
@@ -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),
@@ -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),
diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c
index 5040729..348d425 100644
--- a/drivers/staging/line6/midi.c
+++ b/drivers/staging/line6/midi.c
@@ -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);
 
-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/6] staging: line6: drop CONTROL from CONFIG_LINE6_USB_DUMP_ANY
  2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 1/6] staging: line6: drop control URB " Stefan Hajnoczi
@ 2012-11-14  7:50 ` Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 3/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_CTRL Stefan Hajnoczi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

CONFIG_LINE6_USB_DUMP_CTRL is no longer used by the code and therefore
no longer plays a role in CONFIG_LINE6_USB_DUMP_ANY.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
---
 drivers/staging/line6/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index 9dd8ff4..7770635 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -20,7 +20,7 @@
 
 #define DRIVER_NAME "line6usb"
 
-#if defined(CONFIG_LINE6_USB_DUMP_CTRL) || defined(CONFIG_LINE6_USB_DUMP_MIDI) || defined(CONFIG_LINE6_USB_DUMP_PCM)
+#if defined(CONFIG_LINE6_USB_DUMP_MIDI) || defined(CONFIG_LINE6_USB_DUMP_PCM)
 #define CONFIG_LINE6_USB_DUMP_ANY
 #endif
 
-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_CTRL
  2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 1/6] staging: line6: drop control URB " Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 2/6] staging: line6: drop CONTROL from CONFIG_LINE6_USB_DUMP_ANY Stefan Hajnoczi
@ 2012-11-14  7:50 ` Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 4/6] staging: line6: drop MIDI dumping code Stefan Hajnoczi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
---
 drivers/staging/line6/Kconfig | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig
index a5ded12..2101799 100644
--- a/drivers/staging/line6/Kconfig
+++ b/drivers/staging/line6/Kconfig
@@ -23,15 +23,6 @@ menuconfig LINE6_USB
 
 if LINE6_USB
 
-config LINE6_USB_DUMP_CTRL
-	bool "dump control messages"
-	default n
-	help
-	  Say Y here to write control messages sent to and received from
-	  Line6 devices to the syslog.
-
-	  If unsure, say N.
-
 config LINE6_USB_DUMP_MIDI
 	bool "dump MIDI messages"
 	default n
-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/6] staging: line6: drop MIDI dumping code
  2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2012-11-14  7:50 ` [PATCH 3/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_CTRL Stefan Hajnoczi
@ 2012-11-14  7:50 ` Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 5/6] staging: line6: drop MIDI from CONFIG_LINE6_USB_DUMP_ANY Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 6/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_MIDI Stefan Hajnoczi
  5 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

ALSA amidi(1) and aseqdump(1) can be used to dump MIDI instead of
manually dumping MIDI messages in the driver.  The advantage of using
these existing tools is that can be used at run-time rather than
compile-time.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
---
 drivers/staging/line6/driver.c | 3 ---
 drivers/staging/line6/midi.c   | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index fda92d1..0bc838d 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -402,9 +402,6 @@ static void line6_data_received(struct urb *urb)
 			continue;
 
 		line6->message_length = done;
-#ifdef CONFIG_LINE6_USB_DUMP_MIDI
-		line6_write_hexdump(line6, 'r', line6->buffer_message, done);
-#endif
 		line6_midi_receive(line6, line6->buffer_message, done);
 
 		switch (line6->usbdev->descriptor.idProduct) {
diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c
index 348d425..c8e099b 100644
--- a/drivers/staging/line6/midi.c
+++ b/drivers/staging/line6/midi.c
@@ -59,9 +59,6 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
 		if (done == 0)
 			break;
 
-#ifdef CONFIG_LINE6_USB_DUMP_MIDI
-		line6_write_hexdump(line6, 's', chunk, done);
-#endif
 		line6_midibuf_write(mb, chunk, done);
 		snd_rawmidi_transmit_ack(substream, done);
 	}
-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 5/6] staging: line6: drop MIDI from CONFIG_LINE6_USB_DUMP_ANY
  2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
                   ` (3 preceding siblings ...)
  2012-11-14  7:50 ` [PATCH 4/6] staging: line6: drop MIDI dumping code Stefan Hajnoczi
@ 2012-11-14  7:50 ` Stefan Hajnoczi
  2012-11-14  7:50 ` [PATCH 6/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_MIDI Stefan Hajnoczi
  5 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

CONFIG_LINE6_USB_DUMP_MIDI is no longer used by the code and therefore
no longer plays a role in CONFIG_LINE6_USB_DUMP_ANY.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
---
 drivers/staging/line6/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index 7770635..f0be5a2 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -20,7 +20,7 @@
 
 #define DRIVER_NAME "line6usb"
 
-#if defined(CONFIG_LINE6_USB_DUMP_MIDI) || defined(CONFIG_LINE6_USB_DUMP_PCM)
+#if defined(CONFIG_LINE6_USB_DUMP_PCM)
 #define CONFIG_LINE6_USB_DUMP_ANY
 #endif
 
-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 6/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_MIDI
  2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
                   ` (4 preceding siblings ...)
  2012-11-14  7:50 ` [PATCH 5/6] staging: line6: drop MIDI from CONFIG_LINE6_USB_DUMP_ANY Stefan Hajnoczi
@ 2012-11-14  7:50 ` Stefan Hajnoczi
  5 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-11-14  7:50 UTC (permalink / raw)
  To: devel
  Cc: Markus Grabner, Greg Kroah-Hartman, line6linux-devel,
	linux-kernel, Stefan Hajnoczi

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
---
 drivers/staging/line6/Kconfig | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig
index 2101799..80a7202 100644
--- a/drivers/staging/line6/Kconfig
+++ b/drivers/staging/line6/Kconfig
@@ -23,15 +23,6 @@ menuconfig LINE6_USB
 
 if LINE6_USB
 
-config LINE6_USB_DUMP_MIDI
-	bool "dump MIDI messages"
-	default n
-	help
-	  Say Y here to write MIDI messages sent to and received from
-	  Line6 devices to the syslog.
-
-	  If unsure, say N.
-
 config LINE6_USB_DUMP_PCM
 	bool "dump PCM data"
 	default n
-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-14  7:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14  7:50 [PATCH 0/6] staging: line6: drop driver-specific dumping code Stefan Hajnoczi
2012-11-14  7:50 ` [PATCH 1/6] staging: line6: drop control URB " Stefan Hajnoczi
2012-11-14  7:50 ` [PATCH 2/6] staging: line6: drop CONTROL from CONFIG_LINE6_USB_DUMP_ANY Stefan Hajnoczi
2012-11-14  7:50 ` [PATCH 3/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_CTRL Stefan Hajnoczi
2012-11-14  7:50 ` [PATCH 4/6] staging: line6: drop MIDI dumping code Stefan Hajnoczi
2012-11-14  7:50 ` [PATCH 5/6] staging: line6: drop MIDI from CONFIG_LINE6_USB_DUMP_ANY Stefan Hajnoczi
2012-11-14  7:50 ` [PATCH 6/6] staging: line6: drop unused CONFIG_LINE6_USB_DUMP_MIDI Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome