upon the device too. */
dbg("keyspan_pda_rx_throttle port %d", port->number);
- usb_kill_urb(port->interrupt_in_urb);
+ usb_unlink_urb(port->interrupt_in_urb);
}
return -ENOIOCTLCMD;
}
-static int keyspan_pda_write(struct usb_serial_port *port,
+static int keyspan_pda_write(struct usb_serial_port *port, int from_user,
const unsigned char *buf, int count)
{
struct usb_serial *serial = port->serial;
if (count) {
/* now transfer data */
- memcpy (port->write_urb->transfer_buffer, buf, count);
+ 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);
+ }
/* 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_kill_urb(port->write_urb);
- usb_kill_urb(port->interrupt_in_urb);
+ usb_unlink_urb (port->write_urb);
+ usb_unlink_urb (port->interrupt_in_urb);
}
}