#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
- static int debug = 1;
-#else
- static int debug;
-#endif
-
#include "usb-serial.h"
/*
u8 bMaxUnicastList;
} __attribute__ ((packed));
+static int debug;
+
/* if overridden by the user, then use their value for the size of the read and
* write urbs */
-static int buffer_size = 0;
+static int buffer_size;
/* if overridden by the user, then use the specified number of XBOFs */
static int xbof = -1;
static int ir_startup (struct usb_serial *serial);
static int ir_open (struct usb_serial_port *port, struct file *filep);
static void ir_close (struct usb_serial_port *port, struct file *filep);
-static int ir_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count);
+static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int count);
static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
static void ir_set_termios (struct usb_serial_port *port, struct termios *old_termios);
ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0),
IU_REQ_GET_CLASS_DESC,
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- 0, ifnum, desc, sizeof(*desc), HZ);
+ 0, ifnum, desc, sizeof(*desc), 1000);
dbg("%s - ret=%d", __FUNCTION__, ret);
if (ret < sizeof(*desc)) {
dbg("%s - port %d", __FUNCTION__, port->number);
/* shutdown our bulk read */
- usb_unlink_urb (port->read_urb);
+ usb_kill_urb(port->read_urb);
}
-static int ir_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count)
+static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int count)
{
unsigned char *transfer_buffer;
int result;
*transfer_buffer = ir_xbof | ir_baud;
++transfer_buffer;
- if (from_user) {
- if (copy_from_user (transfer_buffer, buf, transfer_size))
- return -EFAULT;
- } else {
- memcpy (transfer_buffer, buf, transfer_size);
- }
+ memcpy (transfer_buffer, buf, transfer_size);
usb_fill_bulk_urb (
port->write_urb,
}
usb_serial_debug_data (
- __FILE__,
+ debug,
+ &port->dev,
__FUNCTION__,
urb->actual_length,
urb->transfer_buffer);
ir_baud = *data & 0x0f;
usb_serial_debug_data (
- __FILE__,
+ debug,
+ &port->dev,
__FUNCTION__,
urb->actual_length,
data);
*/
tty = port->tty;
+ /*
+ * FIXME: must not do this in IRQ context,
+ * must honour TTY_DONT_FLIP
+ */
tty->ldisc.receive_buf(
tty,
data+1,
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");
-MODULE_PARM(xbof, "i");
+module_param(xbof, int, 0);
MODULE_PARM_DESC(xbof, "Force specific number of XBOFs");
-MODULE_PARM(buffer_size, "i");
+module_param(buffer_size, int, 0);
MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers");