26a27 > #include 29,48d29 < < #if LINUX26 < < #include < #define DEV_ERR(dev,format,arg...) dev_err(dev,format, ## arg) < #define USB_KILL_URB usb_kill_urb < < #else /* !LINUX26 */ < < #ifdef CONFIG_USB_SERIAL_DEBUG < static int debug = 1; < #else < static int debug; < #endif < < #define DEV_ERR(dev,format,arg...) err(format, ## arg) < #define USB_KILL_URB usb_unlink_urb < < #endif /* LINUX26 */ < 54,55c35,36 < #define DRIVER_VERSION "v0.10" < #define DRIVER_DESC "Silicon Labs CP2101/CP2102/CP2103 RS232 serial adaptor driver" --- > #define DRIVER_VERSION "v0.05" > #define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver" 60c41 < static int cp2101_open(struct usb_serial_port*, struct file*); --- > static int cp2101_open(struct usb_serial_port*, struct file*); 64a46,48 > static int cp2101_tiocmget (struct usb_serial_port *, struct file *); > static int cp2101_tiocmset (struct usb_serial_port *, struct file *, > unsigned int, unsigned int); 66c50 < static int cp2101_startup (struct usb_serial *); --- > static int cp2101_startup (struct usb_serial *); 68,70c52 < static int cp2101_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg); < static int cp2101_tiocmget (struct usb_serial_port *, struct file *); < static int cp2101_tiocmset (struct usb_serial_port *, struct file *, unsigned int, unsigned int); --- > 74a57 > { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ 76a60,61 > { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ > { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ 77a63 > { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ 83d68 < #if LINUX26 86c71 < .name = "CP2101", --- > .name = "cp2101", 91,92d75 < #define USB_SUBMIT_URB_ATOMIC(_x_) usb_submit_urb(_x_ , GFP_ATOMIC) < #define USB_SUBMIT_URB_KERNEL(_x_) usb_submit_urb(_x_ , GFP_KERNEL) 94,103c77,82 < #else /* LINUX26 */ < < #define USB_SUBMIT_URB_ATOMIC(_x_) usb_submit_urb(_x_) < #define USB_SUBMIT_URB_KERNEL(_x_) usb_submit_urb(_x_) < #endif < < static struct usb_serial_device_type cp2101_device = { < .owner = THIS_MODULE, < .name = "CP2101/CP2102/CP2103 USB to UART Bridge", < .id_table = id_table, --- > static struct usb_serial_driver cp2101_device = { > .driver = { > .owner = THIS_MODULE, > .name = "cp2101", > }, > .id_table = id_table, 107,111c86,89 < .num_ports = 1, < .open = cp2101_open, < .close = cp2101_close, < .ioctl = cp2101_ioctl, /* GLA, Added backport */ < .break_ctl = cp2101_break_ctl, --- > .num_ports = 1, > .open = cp2101_open, > .close = cp2101_close, > .break_ctl = cp2101_break_ctl, 113,120c91,94 < .shutdown = cp2101_shutdown, < #if LINUX26 < .tiocmget = cp2101_tiocmget, < .tiocmset = cp2101_tiocmset, < .attach = cp2101_startup < #else < .startup = cp2101_startup < #endif --- > .tiocmget = cp2101_tiocmget, > .tiocmset = cp2101_tiocmset, > .attach = cp2101_startup, > .shutdown = cp2101_shutdown, 128,134c102,108 < #define CP2101_UART 0x00 /* Enable / Disable */ < #define CP2101_BAUDRATE 0x01 /* (BAUD_RATE_GEN_FREQ / baudrate) */ < #define CP2101_BITS 0x03 /* 0x(0)(databits)(parity)(stopbits) */ < #define CP2101_BREAK 0x05 /* On / Off */ < #define CP2101_CONTROL 0x07 /* Flow control line states */ < #define CP2101_MODEMCTL 0x13 /* Modem controls */ < #define CP2101_CONFIG_6 0x19 /* 6 bytes of config data ??? */ --- > #define CP2101_UART 0x00 /* Enable / Disable */ > #define CP2101_BAUDRATE 0x01 /* (BAUD_RATE_GEN_FREQ / baudrate) */ > #define CP2101_BITS 0x03 /* 0x(0)(databits)(parity)(stopbits) */ > #define CP2101_BREAK 0x05 /* On / Off */ > #define CP2101_CONTROL 0x07 /* Flow control line states */ > #define CP2101_MODEMCTL 0x13 /* Modem controls */ > #define CP2101_CONFIG_6 0x19 /* 6 bytes of config data ??? */ 137,138c111,112 < #define UART_ENABLE 0x0001 < #define UART_DISABLE 0x0000 --- > #define UART_ENABLE 0x0001 > #define UART_DISABLE 0x0000 141c115 < #define BAUD_RATE_GEN_FREQ 0x384000 --- > #define BAUD_RATE_GEN_FREQ 0x384000 144,161c118,135 < #define BITS_DATA_MASK 0x0f00 < #define BITS_DATA_5 0x0500 < #define BITS_DATA_6 0x0600 < #define BITS_DATA_7 0x0700 < #define BITS_DATA_8 0x0800 < #define BITS_DATA_9 0x0900 < < #define BITS_PARITY_MASK 0x00f0 < #define BITS_PARITY_NONE 0x0000 < #define BITS_PARITY_ODD 0x0010 < #define BITS_PARITY_EVEN 0x0020 < #define BITS_PARITY_MARK 0x0030 < #define BITS_PARITY_SPACE 0x0040 < < #define BITS_STOP_MASK 0x000f < #define BITS_STOP_1 0x0000 < #define BITS_STOP_1_5 0x0001 < #define BITS_STOP_2 0x0002 --- > #define BITS_DATA_MASK 0X0f00 > #define BITS_DATA_5 0X0500 > #define BITS_DATA_6 0X0600 > #define BITS_DATA_7 0X0700 > #define BITS_DATA_8 0X0800 > #define BITS_DATA_9 0X0900 > > #define BITS_PARITY_MASK 0x00f0 > #define BITS_PARITY_NONE 0x0000 > #define BITS_PARITY_ODD 0x0010 > #define BITS_PARITY_EVEN 0x0020 > #define BITS_PARITY_MARK 0x0030 > #define BITS_PARITY_SPACE 0x0040 > > #define BITS_STOP_MASK 0x000f > #define BITS_STOP_1 0x0000 > #define BITS_STOP_1_5 0x0001 > #define BITS_STOP_2 0x0002 164,165c138,139 < #define BREAK_ON 0x0000 < #define BREAK_OFF 0x0001 --- > #define BREAK_ON 0x0000 > #define BREAK_OFF 0x0001 168,175c142,149 < #define CONTROL_DTR 0x0001 < #define CONTROL_RTS 0x0002 < #define CONTROL_CTS 0x0010 < #define CONTROL_DSR 0x0020 < #define CONTROL_RING 0x0040 < #define CONTROL_DCD 0x0080 < #define CONTROL_WRITE_DTR 0x0100 < #define CONTROL_WRITE_RTS 0x0200 --- > #define CONTROL_DTR 0x0001 > #define CONTROL_RTS 0x0002 > #define CONTROL_CTS 0x0010 > #define CONTROL_DSR 0x0020 > #define CONTROL_RING 0x0040 > #define CONTROL_DCD 0x0080 > #define CONTROL_WRITE_DTR 0x0100 > #define CONTROL_WRITE_RTS 0x0200 198c172 < DEV_ERR(&port->dev,"%s - out of memory.\n", __FUNCTION__); --- > dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); 206,215c180,182 < result = usb_control_msg ( < serial->dev, < usb_rcvctrlpipe (serial->dev, 0), < request, < REQTYPE_DEVICE_TO_HOST, < 0x0000, < 0, < buf, < size, < 300); --- > result = usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev, 0), > request, REQTYPE_DEVICE_TO_HOST, 0x0000, > 0, buf, size, 300); 218c185,186 < for (i=0; i for (i=0; i data[i] = le32_to_cpu(buf[i]); 223c191 < DEV_ERR(&port->dev,"%s - Unable to send config request, " --- > dev_err(&port->dev, "%s - Unable to send config request, " 250c218 < DEV_ERR(&port->dev,"%s - out of memory.\n", --- > dev_err(&port->dev, "%s - out of memory.\n", 256c224,225 < for (i = 0; i < length; i++) buf[i] = cpu_to_le32(data[i]); --- > for (i = 0; i < length; i++) > buf[i] = cpu_to_le32(data[i]); 259,268c228,231 < result = usb_control_msg ( < serial->dev, < usb_sndctrlpipe(serial->dev, 0), < request, < REQTYPE_HOST_TO_DEVICE, < 0x0000, < 0, < buf, < size, < 300); --- > result = usb_control_msg (serial->dev, > usb_sndctrlpipe(serial->dev, 0), > request, REQTYPE_HOST_TO_DEVICE, 0x0000, > 0, buf, size, 300); 270,279c233,236 < result = usb_control_msg ( < serial->dev, < usb_sndctrlpipe(serial->dev, 0), < request, < REQTYPE_HOST_TO_DEVICE, < data[0], < 0, < NULL, < 0, < 300); --- > result = usb_control_msg (serial->dev, > usb_sndctrlpipe(serial->dev, 0), > request, REQTYPE_HOST_TO_DEVICE, data[0], > 0, NULL, 0, 300); 285c242 < DEV_ERR(&port->dev,"%s - Unable to send request, " --- > dev_err(&port->dev, "%s - Unable to send request, " 292,301c249,252 < result = usb_control_msg ( < serial->dev, < usb_sndctrlpipe(serial->dev, 0), < request, < REQTYPE_HOST_TO_DEVICE, < data[0], < 0, < NULL, < 0, < 300); --- > result = usb_control_msg (serial->dev, > usb_sndctrlpipe(serial->dev, 0), > request, REQTYPE_HOST_TO_DEVICE, data[0], > 0, NULL, 0, 300); 324c275 < DEV_ERR(&port->dev, "%s - Unable to enable UART\n", --- > dev_err(&port->dev, "%s - Unable to enable UART\n", 337c288 < result = USB_SUBMIT_URB_KERNEL(port->read_urb); --- > result = usb_submit_urb(port->read_urb, GFP_KERNEL); 339c290 < DEV_ERR(&port->dev, "%s - failed resubmitting read urb, " --- > dev_err(&port->dev, "%s - failed resubmitting read urb, " 359c310 < if (serial != NULL && serial->dev) { --- > if (serial->dev) { 362c313 < USB_KILL_URB(port->write_urb); --- > usb_kill_urb(port->write_urb); 364c315 < USB_KILL_URB(port->read_urb); --- > usb_kill_urb(port->read_urb); 366,374d316 < < #if LINUX26 < kfree (usb_get_serial_port_data(port)); < usb_set_serial_port_data(port, NULL); < #else < /*TODOGLA: port.private maybe? < Nobody is using that at the moement in this driver*/ < #endif < 383,384c325,326 < USB_KILL_URB(port->write_urb); < USB_KILL_URB(port->read_urb); --- > usb_kill_urb(port->write_urb); > usb_kill_urb(port->read_urb); 615c557 < DEV_ERR(&port->dev, "cp2101 driver does not " --- > dev_err(&port->dev, "cp2101 driver does not " 625c567 < DEV_ERR(&port->dev, "Baud rate requested not " --- > dev_err(&port->dev, "Baud rate requested not " 656c598 < DEV_ERR(&port->dev, "cp2101 driver does not " --- > dev_err(&port->dev, "cp2101 driver does not " 663c605 < DEV_ERR(&port->dev,"Number of data bits requested " --- > dev_err(&port->dev, "Number of data bits requested " 680c622 < DEV_ERR(&port->dev,"Parity mode not supported " --- > dev_err(&port->dev, "Parity mode not supported " 695c637 < DEV_ERR(&port->dev,"Number of stop bits requested " --- > dev_err(&port->dev, "Number of stop bits requested " 789,827d730 < static int cp2101_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) < { < dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd); < < switch (cmd) { < < #if !LINUX26 < case TIOCMGET: < { < int result = cp2101_tiocmget(port, file); < if (copy_to_user(&arg, &result, sizeof(int))) < return -EFAULT; < } < break; < < case TIOCMSET: < case TIOCMBIS: < < case TIOCMBIC: < { < int val = 0; < < if (copy_from_user(&val, &arg, sizeof(int))) < return -EFAULT; < < if(cp2101_tiocmset(port, file, cmd==TIOCMBIC?0:val, cmd==TIOCMBIC?val:0)) < return -EFAULT; < } < break; < #endif < < default: < dbg("%s not supported = 0x%04x", __FUNCTION__, cmd); < break; < } < < return -ENOIOCTLCMD; < } < 843d745 < #if LINUX26 845,847d746 < #else < cp2101_cleanup(&serial->port[i]); < #endif 859,860c758 < #if LINUX26 < retval = usb_register(&cp2101_driver); --- > retval = usb_register(&cp2101_driver); 866c764 < #endif --- > 874d771 < #if LINUX26 876d772 < #endif 883a780 > MODULE_VERSION(DRIVER_VERSION); 886,887d782 < #if LINUX26 < MODULE_VERSION(DRIVER_VERSION); 889,891d783 < #else < MODULE_PARM(debug, "i"); < #endif