Commit 801a68b7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: remove CONFIG_USB_SERIAL_DEBUG

This involved reworking the usb_serial_debug_data() function too.
Based on a request from SuSE, and numerous user confusions with how
to enable this option.  Now that all usb-serial drivers are using
module_param() it can be set from the boot command line if the drivers
are built into the kernel.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent bb965572
...@@ -20,13 +20,6 @@ config USB_SERIAL ...@@ -20,13 +20,6 @@ config USB_SERIAL
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called usbserial. module will be called usbserial.
config USB_SERIAL_DEBUG
bool "USB Serial Converter verbose debug"
depends on USB_SERIAL=y
help
Say Y here if you want verbose debug messages from the USB Serial
Drivers sent to the kernel debug log.
config USB_SERIAL_CONSOLE config USB_SERIAL_CONSOLE
bool "USB Serial Console device support (EXPERIMENTAL)" bool "USB Serial Console device support (EXPERIMENTAL)"
depends on USB_SERIAL=y && EXPERIMENTAL depends on USB_SERIAL=y && EXPERIMENTAL
......
...@@ -75,16 +75,11 @@ ...@@ -75,16 +75,11 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "belkin_sa.h" #include "belkin_sa.h"
static int debug;
/* /*
* Version Information * Version Information
*/ */
...@@ -276,7 +271,7 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -276,7 +271,7 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
goto exit; goto exit;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
/* Handle known interrupt data */ /* Handle known interrupt data */
/* ignore data[0] and data[1] */ /* ignore data[0] and data[1] */
......
...@@ -14,13 +14,6 @@ ...@@ -14,13 +14,6 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
static int usb_serial_device_match (struct device *dev, struct device_driver *drv) static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
......
...@@ -35,16 +35,11 @@ ...@@ -35,16 +35,11 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "usb-serial.h"
#define CYBERJACK_LOCAL_BUF_SIZE 32 #define CYBERJACK_LOCAL_BUF_SIZE 32
#ifdef CONFIG_USB_SERIAL_DEBUG static int debug;
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h"
/* /*
* Version Information * Version Information
...@@ -243,7 +238,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -243,7 +238,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
memcpy (priv->wrbuf+priv->wrfilled, buf, count); memcpy (priv->wrbuf+priv->wrfilled, buf, count);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count,
priv->wrbuf+priv->wrfilled); priv->wrbuf+priv->wrfilled);
priv->wrfilled += count; priv->wrfilled += count;
...@@ -318,7 +313,7 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs ) ...@@ -318,7 +313,7 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
if (urb->status) if (urb->status)
return; return;
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
/* React only to interrupts signaling a bulk_in transfer */ /* React only to interrupts signaling a bulk_in transfer */
if( (urb->actual_length==4) && (data[0]==0x01) ) { if( (urb->actual_length==4) && (data[0]==0x01) ) {
...@@ -374,14 +369,12 @@ static void cyberjack_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -374,14 +369,12 @@ static void cyberjack_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
if (urb->status) { if (urb->status) {
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
tty = port->tty; tty = port->tty;
if (urb->actual_length) { if (urb->actual_length) {
for (i = 0; i < urb->actual_length ; ++i) { for (i = 0; i < urb->actual_length ; ++i) {
......
...@@ -246,16 +246,8 @@ ...@@ -246,16 +246,8 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
/* Defines */ /* Defines */
/* /*
...@@ -480,6 +472,8 @@ static int digi_read_oob_callback( struct urb *urb ); ...@@ -480,6 +472,8 @@ static int digi_read_oob_callback( struct urb *urb );
/* Statics */ /* Statics */
static int debug;
static struct usb_device_id id_table_combined [] = { static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(DIGI_VENDOR_ID, DIGI_2_ID) }, { USB_DEVICE(DIGI_VENDOR_ID, DIGI_2_ID) },
{ USB_DEVICE(DIGI_VENDOR_ID, DIGI_4_ID) }, { USB_DEVICE(DIGI_VENDOR_ID, DIGI_4_ID) },
......
...@@ -63,15 +63,10 @@ ...@@ -63,15 +63,10 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
static int debug;
/* /*
* Version Information * Version Information
*/ */
...@@ -249,7 +244,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -249,7 +244,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
memcpy (urb->transfer_buffer, current_position, transfer_size); memcpy (urb->transfer_buffer, current_position, transfer_size);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size, urb->transfer_buffer);
/* build up our urb */ /* build up our urb */
usb_fill_bulk_urb ( usb_fill_bulk_urb (
...@@ -365,7 +360,7 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -365,7 +360,7 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
tty = port->tty; tty = port->tty;
......
...@@ -16,13 +16,6 @@ ...@@ -16,13 +16,6 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
/* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */ /* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */
...@@ -35,7 +28,7 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da ...@@ -35,7 +28,7 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
/* dbg("ezusb_writememory %x, %d", address, length); */ /* dbg("ezusb_writememory %x, %d", address, length); */
if (!serial->dev) { if (!serial->dev) {
dbg("%s - no physical device present, failing.", __FUNCTION__); err("%s - no physical device present, failing.", __FUNCTION__);
return -ENODEV; return -ENODEV;
} }
...@@ -53,11 +46,11 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da ...@@ -53,11 +46,11 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit) int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit)
{ {
int response; int response;
dbg("%s - %d", __FUNCTION__, reset_bit);
/* dbg("%s - %d", __FUNCTION__, reset_bit); */
response = ezusb_writememory (serial, CPUCS_REG, &reset_bit, 1, 0xa0); response = ezusb_writememory (serial, CPUCS_REG, &reset_bit, 1, 0xa0);
if (response < 0) { if (response < 0)
dev_err(&serial->dev->dev, "%s- %d failed\n", __FUNCTION__, reset_bit); dev_err(&serial->dev->dev, "%s- %d failed\n", __FUNCTION__, reset_bit);
}
return response; return response;
} }
......
...@@ -253,12 +253,6 @@ ...@@ -253,12 +253,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/serial.h> #include <linux/serial.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "ftdi_sio.h" #include "ftdi_sio.h"
...@@ -269,6 +263,8 @@ ...@@ -269,6 +263,8 @@
#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>" #define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
#define DRIVER_DESC "USB FTDI Serial Converters Driver" #define DRIVER_DESC "USB FTDI Serial Converters Driver"
static int debug;
static struct usb_device_id id_table_sio [] = { static struct usb_device_id id_table_sio [] = {
{ USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
{ } /* Terminating entry */ { } /* Terminating entry */
...@@ -1492,7 +1488,7 @@ static int ftdi_write (struct usb_serial_port *port, int from_user, ...@@ -1492,7 +1488,7 @@ static int ftdi_write (struct usb_serial_port *port, int from_user,
} }
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size, buffer);
/* fill the buffer and send it */ /* fill the buffer and send it */
usb_fill_bulk_urb(urb, port->serial->dev, usb_fill_bulk_urb(urb, port->serial->dev,
...@@ -1658,7 +1654,7 @@ static void ftdi_process_read (struct usb_serial_port *port) ...@@ -1658,7 +1654,7 @@ static void ftdi_process_read (struct usb_serial_port *port)
/* The first two bytes of every read packet are status */ /* The first two bytes of every read packet are status */
if (urb->actual_length > 2) { if (urb->actual_length > 2) {
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
} else { } else {
dbg("Status only: %03oo %03oo",data[0],data[1]); dbg("Status only: %03oo %03oo",data[0],data[1]);
} }
......
...@@ -19,15 +19,9 @@ ...@@ -19,15 +19,9 @@
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
static int debug;
#ifdef CONFIG_USB_SERIAL_GENERIC #ifdef CONFIG_USB_SERIAL_GENERIC
static __u16 vendor = 0x05f9; static __u16 vendor = 0x05f9;
...@@ -169,6 +163,7 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const ...@@ -169,6 +163,7 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const
{ {
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
int result; int result;
unsigned char *data;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
...@@ -193,8 +188,8 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const ...@@ -193,8 +188,8 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const
else { else {
memcpy (port->write_urb->transfer_buffer, buf, count); memcpy (port->write_urb->transfer_buffer, buf, count);
} }
data = port->write_urb->transfer_buffer;
usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, data);
/* set up our urb */ /* set up our urb */
usb_fill_bulk_urb (port->write_urb, serial->dev, usb_fill_bulk_urb (port->write_urb, serial->dev,
...@@ -267,7 +262,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg ...@@ -267,7 +262,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
tty = port->tty; tty = port->tty;
if (tty && urb->actual_length) { if (tty && urb->actual_length) {
......
...@@ -259,15 +259,7 @@ ...@@ -259,15 +259,7 @@
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "io_edgeport.h" #include "io_edgeport.h"
#include "io_ionsp.h" /* info for the iosp messages */ #include "io_ionsp.h" /* info for the iosp messages */
#include "io_16654.h" /* 16654 UART defines */ #include "io_16654.h" /* 16654 UART defines */
...@@ -299,19 +291,13 @@ ...@@ -299,19 +291,13 @@
#define IMAGE_VERSION_NAME OperationalCodeImageVersion_GEN2 #define IMAGE_VERSION_NAME OperationalCodeImageVersion_GEN2
#include "io_fw_down2.h" /* Define array OperationalCodeImage[] */ #include "io_fw_down2.h" /* Define array OperationalCodeImage[] */
#define MAX_NAME_LEN 64 #define MAX_NAME_LEN 64
#define CHASE_TIMEOUT (5*HZ) /* 5 seconds */ #define CHASE_TIMEOUT (5*HZ) /* 5 seconds */
#define OPEN_TIMEOUT (5*HZ) /* 5 seconds */ #define OPEN_TIMEOUT (5*HZ) /* 5 seconds */
#define COMMAND_TIMEOUT (5*HZ) /* 5 seconds */ #define COMMAND_TIMEOUT (5*HZ) /* 5 seconds */
#ifndef SERIAL_MAGIC static int debug;
#define SERIAL_MAGIC 0x6702
#endif
#define PORT_MAGIC 0x7301
/* receive port state */ /* receive port state */
enum RXSTATE { enum RXSTATE {
...@@ -793,7 +779,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs) ...@@ -793,7 +779,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
// process this interrupt-read even if there are no ports open // process this interrupt-read even if there are no ports open
if (length) { if (length) {
usb_serial_debug_data (__FILE__, __FUNCTION__, length, data); usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, length, data);
if (length > 1) { if (length > 1) {
bytes_avail = data[0] | (data[1] << 8); bytes_avail = data[0] | (data[1] << 8);
...@@ -869,7 +855,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs) ...@@ -869,7 +855,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
if (urb->actual_length) { if (urb->actual_length) {
raw_data_length = urb->actual_length; raw_data_length = urb->actual_length;
usb_serial_debug_data (__FILE__, __FUNCTION__, raw_data_length, data); usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, raw_data_length, data);
/* decrement our rxBytes available by the number that we just got */ /* decrement our rxBytes available by the number that we just got */
edge_serial->rxBytesAvail -= raw_data_length; edge_serial->rxBytesAvail -= raw_data_length;
...@@ -1327,7 +1313,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -1327,7 +1313,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
} else { } else {
memcpy(&fifo->fifo[fifo->head], data, firsthalf); memcpy(&fifo->fifo[fifo->head], data, firsthalf);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]);
// update the index and size // update the index and size
fifo->head += firsthalf; fifo->head += firsthalf;
...@@ -1348,7 +1334,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -1348,7 +1334,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
} else { } else {
memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf); memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]);
// update the index and size // update the index and size
fifo->count += secondhalf; fifo->count += secondhalf;
fifo->head += secondhalf; fifo->head += secondhalf;
...@@ -1424,7 +1410,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge ...@@ -1424,7 +1410,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
count = fifo->count; count = fifo->count;
buffer = kmalloc (count+2, GFP_ATOMIC); buffer = kmalloc (count+2, GFP_ATOMIC);
if (buffer == NULL) { if (buffer == NULL) {
dev_err(&edge_serial->serial->dev->dev, "%s - no more kernel memory...\n", __FUNCTION__); dev_err(&edge_port->port->dev, "%s - no more kernel memory...\n", __FUNCTION__);
edge_port->write_in_progress = FALSE; edge_port->write_in_progress = FALSE;
return; return;
} }
...@@ -1448,9 +1434,8 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge ...@@ -1448,9 +1434,8 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
fifo->count -= secondhalf; fifo->count -= secondhalf;
} }
if (count) { if (count)
usb_serial_debug_data (__FILE__, __FUNCTION__, count, &buffer[2]); usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, count, &buffer[2]);
}
/* fill up the urb with all of our data and submit it */ /* fill up the urb with all of our data and submit it */
usb_fill_bulk_urb (urb, edge_serial->serial->dev, usb_fill_bulk_urb (urb, edge_serial->serial->dev,
...@@ -2443,7 +2428,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer ...@@ -2443,7 +2428,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
struct urb *urb; struct urb *urb;
int timeout; int timeout;
usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer); usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, length, buffer);
/* Allocate our next urb */ /* Allocate our next urb */
urb = usb_alloc_urb (0, GFP_ATOMIC); urb = usb_alloc_urb (0, GFP_ATOMIC);
......
...@@ -35,19 +35,13 @@ ...@@ -35,19 +35,13 @@
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "io_16654.h" #include "io_16654.h"
#include "io_usbvend.h" #include "io_usbvend.h"
#include "io_ti.h" #include "io_ti.h"
static int debug;
/* /*
* Version Information * Version Information
*/ */
...@@ -315,7 +309,7 @@ static int TIReadDownloadMemory(struct usb_device *dev, int start_address, ...@@ -315,7 +309,7 @@ static int TIReadDownloadMemory(struct usb_device *dev, int start_address,
} }
if (read_length > 1) { if (read_length > 1) {
usb_serial_debug_data (__FILE__, __FUNCTION__, usb_serial_debug_data(debug, &dev->dev, __FUNCTION__,
read_length, buffer); read_length, buffer);
} }
...@@ -357,7 +351,7 @@ static int TIReadBootMemory (struct edgeport_serial *serial, int start_address, ...@@ -357,7 +351,7 @@ static int TIReadBootMemory (struct edgeport_serial *serial, int start_address,
} }
dbg ("%s - start_address = %x, length = %d", __FUNCTION__, start_address, length); dbg ("%s - start_address = %x, length = %d", __FUNCTION__, start_address, length);
usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer); usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, length, buffer);
serial->TiReadI2C = 1; serial->TiReadI2C = 1;
...@@ -390,7 +384,7 @@ static int TIWriteBootMemory (struct edgeport_serial *serial, int start_address, ...@@ -390,7 +384,7 @@ static int TIWriteBootMemory (struct edgeport_serial *serial, int start_address,
} }
dbg ("%s - start_sddr = %x, length = %d", __FUNCTION__, start_address, length); dbg ("%s - start_sddr = %x, length = %d", __FUNCTION__, start_address, length);
usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer); usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, length, buffer);
return status; return status;
} }
...@@ -412,7 +406,7 @@ static int TIWriteDownloadI2C (struct edgeport_serial *serial, int start_address ...@@ -412,7 +406,7 @@ static int TIWriteDownloadI2C (struct edgeport_serial *serial, int start_address
write_length = length; write_length = length;
dbg ("%s - BytesInFirstPage Addr = %x, length = %d", __FUNCTION__, start_address, write_length); dbg ("%s - BytesInFirstPage Addr = %x, length = %d", __FUNCTION__, start_address, write_length);
usb_serial_debug_data (__FILE__, __FUNCTION__, write_length, buffer); usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, write_length, buffer);
/* Write first page */ /* Write first page */
be_start_address = cpu_to_be16 (start_address); be_start_address = cpu_to_be16 (start_address);
...@@ -439,7 +433,7 @@ static int TIWriteDownloadI2C (struct edgeport_serial *serial, int start_address ...@@ -439,7 +433,7 @@ static int TIWriteDownloadI2C (struct edgeport_serial *serial, int start_address
write_length = length; write_length = length;
dbg ("%s - Page Write Addr = %x, length = %d", __FUNCTION__, start_address, write_length); dbg ("%s - Page Write Addr = %x, length = %d", __FUNCTION__, start_address, write_length);
usb_serial_debug_data (__FILE__, __FUNCTION__, write_length, buffer); usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, write_length, buffer);
/* Write next page */ /* Write next page */
be_start_address = cpu_to_be16 (start_address); be_start_address = cpu_to_be16 (start_address);
...@@ -1669,7 +1663,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs) ...@@ -1669,7 +1663,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
goto exit; goto exit;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, length, data); usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, length, data);
if (length != 2) { if (length != 2) {
dbg ("%s - expecting packet of size 2, got %d", __FUNCTION__, length); dbg ("%s - expecting packet of size 2, got %d", __FUNCTION__, length);
...@@ -1761,7 +1755,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs) ...@@ -1761,7 +1755,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
tty = edge_port->port->tty; tty = edge_port->port->tty;
if (tty && urb->actual_length) { if (tty && urb->actual_length) {
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, urb->actual_length, data);
if (edge_port->close_pending) { if (edge_port->close_pending) {
dbg ("%s - close is pending, dropping data on the floor.", __FUNCTION__); dbg ("%s - close is pending, dropping data on the floor.", __FUNCTION__);
...@@ -2045,7 +2039,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -2045,7 +2039,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
memcpy (port->write_urb->transfer_buffer, data, count); memcpy (port->write_urb->transfer_buffer, data, count);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer);
/* set up our urb */ /* set up our urb */
usb_fill_bulk_urb (port->write_urb, port->serial->dev, usb_fill_bulk_urb (port->write_urb, port->serial->dev,
......
...@@ -56,13 +56,6 @@ ...@@ -56,13 +56,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug = 0;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "ipaq.h" #include "ipaq.h"
...@@ -77,6 +70,7 @@ ...@@ -77,6 +70,7 @@
#define DRIVER_DESC "USB PocketPC PDA driver" #define DRIVER_DESC "USB PocketPC PDA driver"
static __u16 product, vendor; static __u16 product, vendor;
static int debug;
/* Function prototypes for an ipaq */ /* Function prototypes for an ipaq */
static int ipaq_open (struct usb_serial_port *port, struct file *filp); static int ipaq_open (struct usb_serial_port *port, struct file *filp);
...@@ -315,7 +309,7 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs) ...@@ -315,7 +309,7 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
tty = port->tty; tty = port->tty;
if (tty && urb->actual_length) { if (tty && urb->actual_length) {
...@@ -396,7 +390,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un ...@@ -396,7 +390,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un
} else { } else {
memcpy(pkt->data, buf, count); memcpy(pkt->data, buf, count);
} }
usb_serial_debug_data(__FILE__, __FUNCTION__, count, pkt->data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, pkt->data);
pkt->len = count; pkt->len = count;
pkt->written = 0; pkt->written = 0;
......
...@@ -58,13 +58,6 @@ ...@@ -58,13 +58,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
/* /*
...@@ -101,9 +94,11 @@ struct irda_class_desc { ...@@ -101,9 +94,11 @@ struct irda_class_desc {
u8 bMaxUnicastList; u8 bMaxUnicastList;
} __attribute__ ((packed)); } __attribute__ ((packed));
static int debug;
/* if overridden by the user, then use their value for the size of the read and /* if overridden by the user, then use their value for the size of the read and
* write urbs */ * write urbs */
static int buffer_size = 0; static int buffer_size;
/* if overridden by the user, then use the specified number of XBOFs */ /* if overridden by the user, then use the specified number of XBOFs */
static int xbof = -1; static int xbof = -1;
...@@ -404,7 +399,8 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -404,7 +399,8 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
} }
usb_serial_debug_data ( usb_serial_debug_data (
__FILE__, debug,
&port->dev,
__FUNCTION__, __FUNCTION__,
urb->actual_length, urb->actual_length,
urb->transfer_buffer); urb->transfer_buffer);
...@@ -439,7 +435,8 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -439,7 +435,8 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
ir_baud = *data & 0x0f; ir_baud = *data & 0x0f;
usb_serial_debug_data ( usb_serial_debug_data (
__FILE__, debug,
&port->dev,
__FUNCTION__, __FUNCTION__,
urb->actual_length, urb->actual_length,
data); data);
......
...@@ -107,20 +107,12 @@ ...@@ -107,20 +107,12 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#define DEBUG
#else
static int debug;
#undef DEBUG
#endif
#include <linux/usb.h> #include <linux/usb.h>
#include "usb-serial.h" #include "usb-serial.h"
#include "keyspan.h" #include "keyspan.h"
static int debug;
/* /*
* Version Information * Version Information
*/ */
......
...@@ -80,12 +80,7 @@ ...@@ -80,12 +80,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG static int debug;
static int debug = 1;
#else
static int debug;
#endif
struct ezusb_hex_record { struct ezusb_hex_record {
__u16 address; __u16 address;
......
...@@ -56,16 +56,10 @@ ...@@ -56,16 +56,10 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "kl5kusb105.h" #include "kl5kusb105.h"
static int debug;
/* /*
* Version Information * Version Information
...@@ -659,7 +653,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -659,7 +653,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
} else if (urb->actual_length <= 2) { } else if (urb->actual_length <= 2) {
dbg("%s - size %d URB not understood", __FUNCTION__, dbg("%s - size %d URB not understood", __FUNCTION__,
urb->actual_length); urb->actual_length);
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__,
urb->actual_length, data);
} else { } else {
int i; int i;
int bytes_sent = ((__u8 *) data)[0] + int bytes_sent = ((__u8 *) data)[0] +
...@@ -671,7 +666,7 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -671,7 +666,7 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
* intermixed tty_flip_buffer_push()s * intermixed tty_flip_buffer_push()s
* FIXME * FIXME
*/ */
usb_serial_debug_data (__FILE__, __FUNCTION__, usb_serial_debug_data(debug, &port->dev, __FUNCTION__,
urb->actual_length, data); urb->actual_length, data);
if (bytes_sent + 2 > urb->actual_length) { if (bytes_sent + 2 > urb->actual_length) {
......
...@@ -48,18 +48,10 @@ ...@@ -48,18 +48,10 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include "usb-serial.h"
#include "kobil_sct.h" #include "kobil_sct.h"
//#include "../core/usb-debug.c"
#ifdef CONFIG_USB_SERIAL_DEBUG static int debug;
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h"
/* Version Information */ /* Version Information */
#define DRIVER_VERSION "21/05/2004" #define DRIVER_VERSION "21/05/2004"
...@@ -456,7 +448,7 @@ static int kobil_write (struct usb_serial_port *port, int from_user, ...@@ -456,7 +448,7 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
memcpy (priv->buf + priv->filled, buf, count); memcpy (priv->buf + priv->filled, buf, count);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, priv->buf + priv->filled); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, priv->buf + priv->filled);
priv->filled = priv->filled + count; priv->filled = priv->filled + count;
......
...@@ -76,17 +76,9 @@ ...@@ -76,17 +76,9 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "mct_u232.h" #include "mct_u232.h"
/* /*
* Version Information * Version Information
*/ */
...@@ -105,6 +97,8 @@ ...@@ -105,6 +97,8 @@
static int write_blocking; /* disabled by default */ static int write_blocking; /* disabled by default */
#endif #endif
static int debug;
/* /*
* Function prototypes * Function prototypes
*/ */
...@@ -523,7 +517,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user, ...@@ -523,7 +517,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
while (count > 0) { while (count > 0) {
size = (count > port->bulk_out_size) ? port->bulk_out_size : count; size = (count > port->bulk_out_size) ? port->bulk_out_size : count;
usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, size, buf);
if (from_user) { if (from_user) {
if (copy_from_user(port->write_urb->transfer_buffer, buf, size)) { if (copy_from_user(port->write_urb->transfer_buffer, buf, size)) {
...@@ -631,7 +625,7 @@ static void mct_u232_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -631,7 +625,7 @@ static void mct_u232_read_int_callback (struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
/* /*
* Work-a-round: handle the 'usual' bulk-in pipe here * Work-a-round: handle the 'usual' bulk-in pipe here
......
...@@ -47,15 +47,9 @@ ...@@ -47,15 +47,9 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
static int debug;
/* /*
* Version Information * Version Information
...@@ -280,7 +274,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns ...@@ -280,7 +274,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
memcpy (wport->write_urb->transfer_buffer + OMNINET_DATAOFFSET, buf, count); memcpy (wport->write_urb->transfer_buffer + OMNINET_DATAOFFSET, buf, count);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, wport->write_urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, wport->write_urb->transfer_buffer);
header->oh_seq = od->od_outseq++; header->oh_seq = od->od_outseq++;
header->oh_len = count; header->oh_len = count;
......
...@@ -49,13 +49,6 @@ ...@@ -49,13 +49,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "pl2303.h" #include "pl2303.h"
...@@ -65,7 +58,7 @@ ...@@ -65,7 +58,7 @@
#define DRIVER_VERSION "v0.11" #define DRIVER_VERSION "v0.11"
#define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver" #define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver"
static int debug;
static struct usb_device_id id_table [] = { static struct usb_device_id id_table [] = {
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
...@@ -251,7 +244,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns ...@@ -251,7 +244,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns
memcpy (port->write_urb->transfer_buffer, buf, count); memcpy (port->write_urb->transfer_buffer, buf, count);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer);
port->write_urb->transfer_buffer_length = count; port->write_urb->transfer_buffer_length = count;
port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev;
...@@ -716,7 +709,7 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -716,7 +709,7 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs)
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
if (urb->actual_length < UART_STATE) if (urb->actual_length < UART_STATE)
goto exit; goto exit;
...@@ -770,7 +763,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -770,7 +763,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
/* get tty_flag from status */ /* get tty_flag from status */
tty_flag = TTY_NORMAL; tty_flag = TTY_NORMAL;
......
...@@ -72,18 +72,14 @@ ...@@ -72,18 +72,14 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "usb-serial.h"
#ifndef CONFIG_USB_SERIAL_DEBUG
#define CONFIG_USB_SERIAL_DEBUG 0
#endif
#ifndef CONFIG_USB_SAFE_PADDED #ifndef CONFIG_USB_SAFE_PADDED
#define CONFIG_USB_SAFE_PADDED 0 #define CONFIG_USB_SAFE_PADDED 0
#endif #endif
static int debug = CONFIG_USB_SERIAL_DEBUG; static int debug;
#include "usb-serial.h" // must follow the declaration of debug
static int safe = 1; static int safe = 1;
static int padded = CONFIG_USB_SAFE_PADDED; static int padded = CONFIG_USB_SAFE_PADDED;
...@@ -347,7 +343,7 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -347,7 +343,7 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign
port->write_urb->transfer_buffer_length = count; port->write_urb->transfer_buffer_length = count;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer);
#ifdef ECHO_TX #ifdef ECHO_TX
{ {
int i; int i;
......
...@@ -336,14 +336,6 @@ ...@@ -336,14 +336,6 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "pl2303.h" #include "pl2303.h"
...@@ -354,7 +346,6 @@ ...@@ -354,7 +346,6 @@
#define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/" #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/"
#define DRIVER_DESC "USB Serial Driver core" #define DRIVER_DESC "USB Serial Driver core"
/* Driver structure we register with the USB core */ /* Driver structure we register with the USB core */
static struct usb_driver usb_serial_driver = { static struct usb_driver usb_serial_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -370,10 +361,10 @@ static struct usb_driver usb_serial_driver = { ...@@ -370,10 +361,10 @@ static struct usb_driver usb_serial_driver = {
drivers depend on it. drivers depend on it.
*/ */
static int debug;
static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /* initially all NULL */ static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /* initially all NULL */
static LIST_HEAD(usb_serial_driver_list); static LIST_HEAD(usb_serial_driver_list);
struct usb_serial *usb_serial_get_by_index(unsigned index) struct usb_serial *usb_serial_get_by_index(unsigned index)
{ {
struct usb_serial *serial = serial_table[index]; struct usb_serial *serial = serial_table[index];
......
...@@ -294,21 +294,21 @@ extern struct usb_serial_device_type usb_serial_generic_device; ...@@ -294,21 +294,21 @@ extern struct usb_serial_device_type usb_serial_generic_device;
extern struct bus_type usb_serial_bus_type; extern struct bus_type usb_serial_bus_type;
extern struct tty_driver *usb_serial_tty_driver; extern struct tty_driver *usb_serial_tty_driver;
static inline void usb_serial_debug_data (const char *file, const char *function, int size, const unsigned char *data) static inline void usb_serial_debug_data(int debug,
struct device *dev,
const char *function, int size,
const unsigned char *data)
{ {
int i; int i;
if (!debug) if (debug) {
return; dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size);
for (i = 0; i < size; ++i)
printk (KERN_DEBUG "%s: %s - length = %d, data = ", file, function, size);
for (i = 0; i < size; ++i) {
printk ("%.2x ", data[i]); printk ("%.2x ", data[i]);
}
printk ("\n"); printk ("\n");
}
} }
/* Use our own dbg macro */ /* Use our own dbg macro */
#undef dbg #undef dbg
#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0)
......
...@@ -155,13 +155,6 @@ ...@@ -155,13 +155,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/usb.h> #include <linux/usb.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "visor.h" #include "visor.h"
...@@ -195,6 +188,7 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i ...@@ -195,6 +188,7 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_id *id); static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_id *id);
/* Parameters that may be passed into the module. */ /* Parameters that may be passed into the module. */
static int debug;
static __u16 vendor; static __u16 vendor;
static __u16 product; static __u16 product;
...@@ -504,7 +498,7 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -504,7 +498,7 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig
memcpy (buffer, buf, count); memcpy (buffer, buf, count);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, count, buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, buffer);
usb_fill_bulk_urb (urb, serial->dev, usb_fill_bulk_urb (urb, serial->dev,
usb_sndbulkpipe (serial->dev, usb_sndbulkpipe (serial->dev,
...@@ -590,7 +584,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -590,7 +584,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
tty = port->tty; tty = port->tty;
if (tty && urb->actual_length) { if (tty && urb->actual_length) {
...@@ -621,6 +615,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -621,6 +615,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs) static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs)
{ {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
int result; int result;
switch (urb->status) { switch (urb->status) {
...@@ -647,8 +642,8 @@ static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -647,8 +642,8 @@ static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs)
* Rumor has it this endpoint is used to notify when data * Rumor has it this endpoint is used to notify when data
* is ready to be read from the bulk ones. * is ready to be read from the bulk ones.
*/ */
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, usb_serial_debug_data(debug, &port->dev, __FUNCTION__,
urb->transfer_buffer); urb->actual_length, urb->transfer_buffer);
exit: exit:
result = usb_submit_urb (urb, GFP_ATOMIC); result = usb_submit_urb (urb, GFP_ATOMIC);
...@@ -799,7 +794,8 @@ static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_i ...@@ -799,7 +794,8 @@ static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_i
dev_err(dev, "%s - error %d getting connection info\n", dev_err(dev, "%s - error %d getting connection info\n",
__FUNCTION__, retval); __FUNCTION__, retval);
else else
usb_serial_debug_data (__FILE__, __FUNCTION__, retval, transfer_buffer); usb_serial_debug_data(debug, &serial->dev->dev, __FUNCTION__,
retval, transfer_buffer);
kfree (transfer_buffer); kfree (transfer_buffer);
return 0; return 0;
......
...@@ -80,17 +80,12 @@ ...@@ -80,17 +80,12 @@
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <linux/serial.h> #include <linux/serial.h>
#ifdef CONFIG_USB_SERIAL_DEBUG
static int debug = 1;
#else
static int debug;
#endif
#include "usb-serial.h" #include "usb-serial.h"
#include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */ #include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */
#include "whiteheat.h" /* WhiteHEAT specific commands */ #include "whiteheat.h" /* WhiteHEAT specific commands */
static int debug;
#ifndef CMSPAR #ifndef CMSPAR
#define CMSPAR 0 #define CMSPAR 0
#endif #endif
...@@ -747,7 +742,7 @@ static int whiteheat_write(struct usb_serial_port *port, int from_user, const un ...@@ -747,7 +742,7 @@ static int whiteheat_write(struct usb_serial_port *port, int from_user, const un
memcpy (urb->transfer_buffer, buf + sent, bytes); memcpy (urb->transfer_buffer, buf + sent, bytes);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, bytes, urb->transfer_buffer); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, bytes, urb->transfer_buffer);
urb->dev = serial->dev; urb->dev = serial->dev;
urb->transfer_buffer_length = bytes; urb->transfer_buffer_length = bytes;
...@@ -975,10 +970,6 @@ static void command_port_write_callback (struct urb *urb, struct pt_regs *regs) ...@@ -975,10 +970,6 @@ static void command_port_write_callback (struct urb *urb, struct pt_regs *regs)
dbg ("nonzero urb status: %d", urb->status); dbg ("nonzero urb status: %d", urb->status);
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
return;
} }
...@@ -997,7 +988,7 @@ static void command_port_read_callback (struct urb *urb, struct pt_regs *regs) ...@@ -997,7 +988,7 @@ static void command_port_read_callback (struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &command_port->dev, __FUNCTION__, urb->actual_length, data);
command_info = usb_get_serial_port_data(command_port); command_info = usb_get_serial_port_data(command_port);
if (!command_info) { if (!command_info) {
...@@ -1059,7 +1050,7 @@ static void whiteheat_read_callback(struct urb *urb, struct pt_regs *regs) ...@@ -1059,7 +1050,7 @@ static void whiteheat_read_callback(struct urb *urb, struct pt_regs *regs)
return; return;
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
spin_lock(&info->lock); spin_lock(&info->lock);
list_add_tail(&wrap->list, &info->rx_urb_q); list_add_tail(&wrap->list, &info->rx_urb_q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment