#include <asm/uaccess.h>
#include <linux/usb.h>
-#ifdef CONFIG_USB_SERIAL_DEBUG
- static int debug = 1;
-#else
- static int debug;
-#endif
-
+static int debug;
struct ezusb_hex_record {
__u16 address;
wake_up_interruptible( &port->write_wait );
/* wake up line discipline */
- if( (tty->flags & (1 << TTY_DO_WRITE_WAKEUP))
- && tty->ldisc.write_wakeup )
- (tty->ldisc.write_wakeup)(tty);
-
- /* wake up other tty processes */
- wake_up_interruptible( &tty->write_wait );
- /* For 2.2.16 backport -- wake_up_interruptible( &tty->poll_wait ); */
+ tty_wakeup(tty);
}
static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
upon the device too. */
dbg("keyspan_pda_rx_throttle port %d", port->number);
- usb_unlink_urb(port->interrupt_in_urb);
+ usb_kill_urb(port->interrupt_in_urb);
}
return -ENOIOCTLCMD;
}
-static int keyspan_pda_write(struct usb_serial_port *port, int from_user,
+static int keyspan_pda_write(struct usb_serial_port *port,
const unsigned char *buf, int count)
{
struct usb_serial *serial = port->serial;
if (count) {
/* now transfer data */
- if (from_user) {
- if( copy_from_user(port->write_urb->transfer_buffer,
- buf, count) ) {
- rc = -EFAULT;
- goto exit;
- }
- }
- else {
- memcpy (port->write_urb->transfer_buffer, buf, count);
- }
+ memcpy (port->write_urb->transfer_buffer, buf, count);
/* send the data out the bulk port */
port->write_urb->transfer_buffer_length = count;
keyspan_pda_set_modem_info(serial, 0);
/* shutdown our bulk reads and writes */
- usb_unlink_urb (port->write_urb);
- usb_unlink_urb (port->interrupt_in_urb);
+ usb_kill_urb(port->write_urb);
+ usb_kill_urb(port->interrupt_in_urb);
}
}
response = ezusb_set_reset(serial, 1);
#ifdef KEYSPAN
- if (serial->dev->descriptor.idVendor == KEYSPAN_VENDOR_ID)
+ if (le16_to_cpu(serial->dev->descriptor.idVendor) == KEYSPAN_VENDOR_ID)
record = &keyspan_pda_firmware[0];
#endif
#ifdef XIRCOM
- if ((serial->dev->descriptor.idVendor == XIRCOM_VENDOR_ID) ||
- (serial->dev->descriptor.idVendor == ENTREGRA_VENDOR_ID))
+ if ((le16_to_cpu(serial->dev->descriptor.idVendor) == XIRCOM_VENDOR_ID) ||
+ (le16_to_cpu(serial->dev->descriptor.idVendor) == ENTREGRA_VENDOR_ID))
record = &xircom_pgs_firmware[0];
#endif
if (record == NULL) {
usb_set_serial_port_data(serial->port[0], priv);
init_waitqueue_head(&serial->port[0]->write_wait);
INIT_WORK(&priv->wakeup_work, (void *)keyspan_pda_wakeup_write,
- (void *)(&serial->port[0]));
+ (void *)(serial->port[0]));
INIT_WORK(&priv->unthrottle_work,
(void *)keyspan_pda_request_unthrottle,
(void *)(serial));
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");