diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/oti6858.c | 129 |
1 files changed, 46 insertions, 83 deletions
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index eea226ae37bd..db725aaf7d19 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -79,7 +79,7 @@ static int debug; | |||
79 | #define PL2303_BUF_SIZE 1024 | 79 | #define PL2303_BUF_SIZE 1024 |
80 | #define PL2303_TMP_BUF_SIZE 1024 | 80 | #define PL2303_TMP_BUF_SIZE 1024 |
81 | 81 | ||
82 | struct pl2303_buf { | 82 | struct oti6858_buf { |
83 | unsigned int buf_size; | 83 | unsigned int buf_size; |
84 | char *buf_buf; | 84 | char *buf_buf; |
85 | char *buf_get; | 85 | char *buf_get; |
@@ -161,14 +161,14 @@ static int oti6858_startup(struct usb_serial *serial); | |||
161 | static void oti6858_shutdown(struct usb_serial *serial); | 161 | static void oti6858_shutdown(struct usb_serial *serial); |
162 | 162 | ||
163 | /* functions operating on buffers */ | 163 | /* functions operating on buffers */ |
164 | static struct pl2303_buf *pl2303_buf_alloc(unsigned int size); | 164 | static struct oti6858_buf *oti6858_buf_alloc(unsigned int size); |
165 | static void pl2303_buf_free(struct pl2303_buf *pb); | 165 | static void oti6858_buf_free(struct oti6858_buf *pb); |
166 | static void pl2303_buf_clear(struct pl2303_buf *pb); | 166 | static void oti6858_buf_clear(struct oti6858_buf *pb); |
167 | static unsigned int pl2303_buf_data_avail(struct pl2303_buf *pb); | 167 | static unsigned int oti6858_buf_data_avail(struct oti6858_buf *pb); |
168 | static unsigned int pl2303_buf_space_avail(struct pl2303_buf *pb); | 168 | static unsigned int oti6858_buf_space_avail(struct oti6858_buf *pb); |
169 | static unsigned int pl2303_buf_put(struct pl2303_buf *pb, const char *buf, | 169 | static unsigned int oti6858_buf_put(struct oti6858_buf *pb, const char *buf, |
170 | unsigned int count); | 170 | unsigned int count); |
171 | static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf, | 171 | static unsigned int oti6858_buf_get(struct oti6858_buf *pb, char *buf, |
172 | unsigned int count); | 172 | unsigned int count); |
173 | 173 | ||
174 | 174 | ||
@@ -203,7 +203,7 @@ static struct usb_serial_driver oti6858_device = { | |||
203 | struct oti6858_private { | 203 | struct oti6858_private { |
204 | spinlock_t lock; | 204 | spinlock_t lock; |
205 | 205 | ||
206 | struct pl2303_buf *buf; | 206 | struct oti6858_buf *buf; |
207 | struct oti6858_control_pkt status; | 207 | struct oti6858_control_pkt status; |
208 | 208 | ||
209 | struct { | 209 | struct { |
@@ -316,7 +316,7 @@ void send_data(struct work_struct *work) | |||
316 | } | 316 | } |
317 | priv->flags.write_urb_in_use = 1; | 317 | priv->flags.write_urb_in_use = 1; |
318 | 318 | ||
319 | count = pl2303_buf_data_avail(priv->buf); | 319 | count = oti6858_buf_data_avail(priv->buf); |
320 | spin_unlock_irqrestore(&priv->lock, flags); | 320 | spin_unlock_irqrestore(&priv->lock, flags); |
321 | if (count > port->bulk_out_size) | 321 | if (count > port->bulk_out_size) |
322 | count = port->bulk_out_size; | 322 | count = port->bulk_out_size; |
@@ -345,7 +345,7 @@ void send_data(struct work_struct *work) | |||
345 | } | 345 | } |
346 | 346 | ||
347 | spin_lock_irqsave(&priv->lock, flags); | 347 | spin_lock_irqsave(&priv->lock, flags); |
348 | pl2303_buf_get(priv->buf, port->write_urb->transfer_buffer, count); | 348 | oti6858_buf_get(priv->buf, port->write_urb->transfer_buffer, count); |
349 | spin_unlock_irqrestore(&priv->lock, flags); | 349 | spin_unlock_irqrestore(&priv->lock, flags); |
350 | 350 | ||
351 | port->write_urb->transfer_buffer_length = count; | 351 | port->write_urb->transfer_buffer_length = count; |
@@ -370,7 +370,7 @@ static int oti6858_startup(struct usb_serial *serial) | |||
370 | priv = kzalloc(sizeof(struct oti6858_private), GFP_KERNEL); | 370 | priv = kzalloc(sizeof(struct oti6858_private), GFP_KERNEL); |
371 | if (!priv) | 371 | if (!priv) |
372 | break; | 372 | break; |
373 | priv->buf = pl2303_buf_alloc(PL2303_BUF_SIZE); | 373 | priv->buf = oti6858_buf_alloc(PL2303_BUF_SIZE); |
374 | if (priv->buf == NULL) { | 374 | if (priv->buf == NULL) { |
375 | kfree(priv); | 375 | kfree(priv); |
376 | break; | 376 | break; |
@@ -391,7 +391,7 @@ static int oti6858_startup(struct usb_serial *serial) | |||
391 | 391 | ||
392 | for (--i; i >= 0; --i) { | 392 | for (--i; i >= 0; --i) { |
393 | priv = usb_get_serial_port_data(serial->port[i]); | 393 | priv = usb_get_serial_port_data(serial->port[i]); |
394 | pl2303_buf_free(priv->buf); | 394 | oti6858_buf_free(priv->buf); |
395 | kfree(priv); | 395 | kfree(priv); |
396 | usb_set_serial_port_data(serial->port[i], NULL); | 396 | usb_set_serial_port_data(serial->port[i], NULL); |
397 | } | 397 | } |
@@ -410,7 +410,7 @@ static int oti6858_write(struct usb_serial_port *port, | |||
410 | return count; | 410 | return count; |
411 | 411 | ||
412 | spin_lock_irqsave(&priv->lock, flags); | 412 | spin_lock_irqsave(&priv->lock, flags); |
413 | count = pl2303_buf_put(priv->buf, buf, count); | 413 | count = oti6858_buf_put(priv->buf, buf, count); |
414 | spin_unlock_irqrestore(&priv->lock, flags); | 414 | spin_unlock_irqrestore(&priv->lock, flags); |
415 | 415 | ||
416 | return count; | 416 | return count; |
@@ -425,7 +425,7 @@ static int oti6858_write_room(struct usb_serial_port *port) | |||
425 | dbg("%s(port = %d)", __FUNCTION__, port->number); | 425 | dbg("%s(port = %d)", __FUNCTION__, port->number); |
426 | 426 | ||
427 | spin_lock_irqsave(&priv->lock, flags); | 427 | spin_lock_irqsave(&priv->lock, flags); |
428 | room = pl2303_buf_space_avail(priv->buf); | 428 | room = oti6858_buf_space_avail(priv->buf); |
429 | spin_unlock_irqrestore(&priv->lock, flags); | 429 | spin_unlock_irqrestore(&priv->lock, flags); |
430 | 430 | ||
431 | return room; | 431 | return room; |
@@ -440,7 +440,7 @@ static int oti6858_chars_in_buffer(struct usb_serial_port *port) | |||
440 | dbg("%s(port = %d)", __FUNCTION__, port->number); | 440 | dbg("%s(port = %d)", __FUNCTION__, port->number); |
441 | 441 | ||
442 | spin_lock_irqsave(&priv->lock, flags); | 442 | spin_lock_irqsave(&priv->lock, flags); |
443 | chars = pl2303_buf_data_avail(priv->buf); | 443 | chars = oti6858_buf_data_avail(priv->buf); |
444 | spin_unlock_irqrestore(&priv->lock, flags); | 444 | spin_unlock_irqrestore(&priv->lock, flags); |
445 | 445 | ||
446 | return chars; | 446 | return chars; |
@@ -458,7 +458,7 @@ static void oti6858_set_termios(struct usb_serial_port *port, | |||
458 | 458 | ||
459 | dbg("%s(port = %d)", __FUNCTION__, port->number); | 459 | dbg("%s(port = %d)", __FUNCTION__, port->number); |
460 | 460 | ||
461 | if ((!port->tty) || (!port->tty->termios)) { | 461 | if (!port->tty || !port->tty->termios) { |
462 | dbg("%s(): no tty structures", __FUNCTION__); | 462 | dbg("%s(): no tty structures", __FUNCTION__); |
463 | return; | 463 | return; |
464 | } | 464 | } |
@@ -468,6 +468,8 @@ static void oti6858_set_termios(struct usb_serial_port *port, | |||
468 | *(port->tty->termios) = tty_std_termios; | 468 | *(port->tty->termios) = tty_std_termios; |
469 | port->tty->termios->c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL; | 469 | port->tty->termios->c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL; |
470 | priv->flags.termios_initialized = 1; | 470 | priv->flags.termios_initialized = 1; |
471 | port->tty->termios->c_ispeed = 38400; | ||
472 | port->tty->termios->c_ospeed = 38400; | ||
471 | } | 473 | } |
472 | spin_unlock_irqrestore(&priv->lock, flags); | 474 | spin_unlock_irqrestore(&priv->lock, flags); |
473 | 475 | ||
@@ -504,19 +506,14 @@ static void oti6858_set_termios(struct usb_serial_port *port, | |||
504 | br = tty_get_baud_rate(port->tty); | 506 | br = tty_get_baud_rate(port->tty); |
505 | if (br == 0) { | 507 | if (br == 0) { |
506 | divisor = 0; | 508 | divisor = 0; |
507 | } else if (br <= OTI6858_MAX_BAUD_RATE) { | 509 | } else { |
508 | int real_br; | 510 | int real_br; |
511 | br = min(br, OTI6858_MAX_BAUD_RATE); | ||
509 | 512 | ||
510 | divisor = (96000000 + 8 * br) / (16 * br); | 513 | divisor = (96000000 + 8 * br) / (16 * br); |
511 | real_br = 96000000 / (16 * divisor); | 514 | real_br = 96000000 / (16 * divisor); |
512 | if ((((real_br - br) * 100 + br - 1) / br) > 2) { | ||
513 | dbg("%s(): baud rate %d is invalid", __FUNCTION__, br); | ||
514 | return; | ||
515 | } | ||
516 | divisor = cpu_to_le16(divisor); | 515 | divisor = cpu_to_le16(divisor); |
517 | } else { | 516 | tty_encode_baud_rate(port->tty, real_br, real_br); |
518 | dbg("%s(): baud rate %d is too high", __FUNCTION__, br); | ||
519 | return; | ||
520 | } | 517 | } |
521 | 518 | ||
522 | frame_fmt &= ~FMT_STOP_BITS_MASK; | 519 | frame_fmt &= ~FMT_STOP_BITS_MASK; |
@@ -650,7 +647,7 @@ static void oti6858_close(struct usb_serial_port *port, struct file *filp) | |||
650 | dbg("%s(): entering wait loop", __FUNCTION__); | 647 | dbg("%s(): entering wait loop", __FUNCTION__); |
651 | for (;;) { | 648 | for (;;) { |
652 | set_current_state(TASK_INTERRUPTIBLE); | 649 | set_current_state(TASK_INTERRUPTIBLE); |
653 | if (pl2303_buf_data_avail(priv->buf) == 0 | 650 | if (oti6858_buf_data_avail(priv->buf) == 0 |
654 | || timeout == 0 || signal_pending(current) | 651 | || timeout == 0 || signal_pending(current) |
655 | || !usb_get_intfdata(port->serial->interface)) /* disconnect */ | 652 | || !usb_get_intfdata(port->serial->interface)) /* disconnect */ |
656 | break; | 653 | break; |
@@ -663,7 +660,7 @@ static void oti6858_close(struct usb_serial_port *port, struct file *filp) | |||
663 | dbg("%s(): after wait loop", __FUNCTION__); | 660 | dbg("%s(): after wait loop", __FUNCTION__); |
664 | 661 | ||
665 | /* clear out any remaining data in the buffer */ | 662 | /* clear out any remaining data in the buffer */ |
666 | pl2303_buf_clear(priv->buf); | 663 | oti6858_buf_clear(priv->buf); |
667 | spin_unlock_irqrestore(&priv->lock, flags); | 664 | spin_unlock_irqrestore(&priv->lock, flags); |
668 | 665 | ||
669 | /* wait for characters to drain from the device */ | 666 | /* wait for characters to drain from the device */ |
@@ -831,21 +828,6 @@ static int oti6858_ioctl(struct usb_serial_port *port, struct file *file, | |||
831 | return -EFAULT; | 828 | return -EFAULT; |
832 | return oti6858_tiocmset(port, NULL, 0, x); | 829 | return oti6858_tiocmset(port, NULL, 0, x); |
833 | 830 | ||
834 | case TIOCGSERIAL: | ||
835 | if (copy_to_user(user_arg, port->tty->termios, | ||
836 | sizeof(struct ktermios))) { | ||
837 | return -EFAULT; | ||
838 | } | ||
839 | return 0; | ||
840 | |||
841 | case TIOCSSERIAL: | ||
842 | if (copy_from_user(port->tty->termios, user_arg, | ||
843 | sizeof(struct ktermios))) { | ||
844 | return -EFAULT; | ||
845 | } | ||
846 | oti6858_set_termios(port, NULL); | ||
847 | return 0; | ||
848 | |||
849 | case TIOCMIWAIT: | 831 | case TIOCMIWAIT: |
850 | dbg("%s(): TIOCMIWAIT", __FUNCTION__); | 832 | dbg("%s(): TIOCMIWAIT", __FUNCTION__); |
851 | return wait_modem_info(port, arg); | 833 | return wait_modem_info(port, arg); |
@@ -887,7 +869,7 @@ static void oti6858_shutdown(struct usb_serial *serial) | |||
887 | for (i = 0; i < serial->num_ports; ++i) { | 869 | for (i = 0; i < serial->num_ports; ++i) { |
888 | priv = usb_get_serial_port_data(serial->port[i]); | 870 | priv = usb_get_serial_port_data(serial->port[i]); |
889 | if (priv) { | 871 | if (priv) { |
890 | pl2303_buf_free(priv->buf); | 872 | oti6858_buf_free(priv->buf); |
891 | kfree(priv); | 873 | kfree(priv); |
892 | usb_set_serial_port_data(serial->port[i], NULL); | 874 | usb_set_serial_port_data(serial->port[i], NULL); |
893 | } | 875 | } |
@@ -987,7 +969,7 @@ static void oti6858_read_int_callback(struct urb *urb) | |||
987 | 969 | ||
988 | spin_lock_irqsave(&priv->lock, flags); | 970 | spin_lock_irqsave(&priv->lock, flags); |
989 | if (priv->flags.write_urb_in_use == 0 | 971 | if (priv->flags.write_urb_in_use == 0 |
990 | && pl2303_buf_data_avail(priv->buf) != 0) { | 972 | && oti6858_buf_data_avail(priv->buf) != 0) { |
991 | schedule_delayed_work(&priv->delayed_write_work,0); | 973 | schedule_delayed_work(&priv->delayed_write_work,0); |
992 | resubmit = 0; | 974 | resubmit = 0; |
993 | } | 975 | } |
@@ -1015,9 +997,8 @@ static void oti6858_read_bulk_callback(struct urb *urb) | |||
1015 | struct tty_struct *tty; | 997 | struct tty_struct *tty; |
1016 | unsigned char *data = urb->transfer_buffer; | 998 | unsigned char *data = urb->transfer_buffer; |
1017 | unsigned long flags; | 999 | unsigned long flags; |
1018 | int i, result; | ||
1019 | int status = urb->status; | 1000 | int status = urb->status; |
1020 | char tty_flag; | 1001 | int result; |
1021 | 1002 | ||
1022 | dbg("%s(port = %d, status = %d)", | 1003 | dbg("%s(port = %d, status = %d)", |
1023 | __FUNCTION__, port->number, status); | 1004 | __FUNCTION__, port->number, status); |
@@ -1045,27 +1026,9 @@ static void oti6858_read_bulk_callback(struct urb *urb) | |||
1045 | return; | 1026 | return; |
1046 | } | 1027 | } |
1047 | 1028 | ||
1048 | // get tty_flag from status | ||
1049 | tty_flag = TTY_NORMAL; | ||
1050 | |||
1051 | /* FIXME: probably, errors will be signalled using interrupt pipe! */ | ||
1052 | /* | ||
1053 | // break takes precedence over parity, | ||
1054 | // which takes precedence over framing errors | ||
1055 | if (status & UART_BREAK_ERROR ) | ||
1056 | tty_flag = TTY_BREAK; | ||
1057 | else if (status & UART_PARITY_ERROR) | ||
1058 | tty_flag = TTY_PARITY; | ||
1059 | else if (status & UART_FRAME_ERROR) | ||
1060 | tty_flag = TTY_FRAME; | ||
1061 | dbg("%s - tty_flag = %d", __FUNCTION__, tty_flag); | ||
1062 | */ | ||
1063 | |||
1064 | tty = port->tty; | 1029 | tty = port->tty; |
1065 | if (tty != NULL && urb->actual_length > 0) { | 1030 | if (tty != NULL && urb->actual_length > 0) { |
1066 | tty_buffer_request_room(tty, urb->actual_length); | 1031 | tty_insert_flip_string(tty, data, urb->actual_length); |
1067 | for (i = 0; i < urb->actual_length; ++i) | ||
1068 | tty_insert_flip_char(tty, data[i], tty_flag); | ||
1069 | tty_flip_buffer_push(tty); | 1032 | tty_flip_buffer_push(tty); |
1070 | } | 1033 | } |
1071 | 1034 | ||
@@ -1133,18 +1096,18 @@ static void oti6858_write_bulk_callback(struct urb *urb) | |||
1133 | 1096 | ||
1134 | 1097 | ||
1135 | /* | 1098 | /* |
1136 | * pl2303_buf_alloc | 1099 | * oti6858_buf_alloc |
1137 | * | 1100 | * |
1138 | * Allocate a circular buffer and all associated memory. | 1101 | * Allocate a circular buffer and all associated memory. |
1139 | */ | 1102 | */ |
1140 | static struct pl2303_buf *pl2303_buf_alloc(unsigned int size) | 1103 | static struct oti6858_buf *oti6858_buf_alloc(unsigned int size) |
1141 | { | 1104 | { |
1142 | struct pl2303_buf *pb; | 1105 | struct oti6858_buf *pb; |
1143 | 1106 | ||
1144 | if (size == 0) | 1107 | if (size == 0) |
1145 | return NULL; | 1108 | return NULL; |
1146 | 1109 | ||
1147 | pb = kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL); | 1110 | pb = kmalloc(sizeof(struct oti6858_buf), GFP_KERNEL); |
1148 | if (pb == NULL) | 1111 | if (pb == NULL) |
1149 | return NULL; | 1112 | return NULL; |
1150 | 1113 | ||
@@ -1161,11 +1124,11 @@ static struct pl2303_buf *pl2303_buf_alloc(unsigned int size) | |||
1161 | } | 1124 | } |
1162 | 1125 | ||
1163 | /* | 1126 | /* |
1164 | * pl2303_buf_free | 1127 | * oti6858_buf_free |
1165 | * | 1128 | * |
1166 | * Free the buffer and all associated memory. | 1129 | * Free the buffer and all associated memory. |
1167 | */ | 1130 | */ |
1168 | static void pl2303_buf_free(struct pl2303_buf *pb) | 1131 | static void oti6858_buf_free(struct oti6858_buf *pb) |
1169 | { | 1132 | { |
1170 | if (pb) { | 1133 | if (pb) { |
1171 | kfree(pb->buf_buf); | 1134 | kfree(pb->buf_buf); |
@@ -1174,11 +1137,11 @@ static void pl2303_buf_free(struct pl2303_buf *pb) | |||
1174 | } | 1137 | } |
1175 | 1138 | ||
1176 | /* | 1139 | /* |
1177 | * pl2303_buf_clear | 1140 | * oti6858_buf_clear |
1178 | * | 1141 | * |
1179 | * Clear out all data in the circular buffer. | 1142 | * Clear out all data in the circular buffer. |
1180 | */ | 1143 | */ |
1181 | static void pl2303_buf_clear(struct pl2303_buf *pb) | 1144 | static void oti6858_buf_clear(struct oti6858_buf *pb) |
1182 | { | 1145 | { |
1183 | if (pb != NULL) { | 1146 | if (pb != NULL) { |
1184 | /* equivalent to a get of all data available */ | 1147 | /* equivalent to a get of all data available */ |
@@ -1187,12 +1150,12 @@ static void pl2303_buf_clear(struct pl2303_buf *pb) | |||
1187 | } | 1150 | } |
1188 | 1151 | ||
1189 | /* | 1152 | /* |
1190 | * pl2303_buf_data_avail | 1153 | * oti6858_buf_data_avail |
1191 | * | 1154 | * |
1192 | * Return the number of bytes of data available in the circular | 1155 | * Return the number of bytes of data available in the circular |
1193 | * buffer. | 1156 | * buffer. |
1194 | */ | 1157 | */ |
1195 | static unsigned int pl2303_buf_data_avail(struct pl2303_buf *pb) | 1158 | static unsigned int oti6858_buf_data_avail(struct oti6858_buf *pb) |
1196 | { | 1159 | { |
1197 | if (pb == NULL) | 1160 | if (pb == NULL) |
1198 | return 0; | 1161 | return 0; |
@@ -1200,12 +1163,12 @@ static unsigned int pl2303_buf_data_avail(struct pl2303_buf *pb) | |||
1200 | } | 1163 | } |
1201 | 1164 | ||
1202 | /* | 1165 | /* |
1203 | * pl2303_buf_space_avail | 1166 | * oti6858_buf_space_avail |
1204 | * | 1167 | * |
1205 | * Return the number of bytes of space available in the circular | 1168 | * Return the number of bytes of space available in the circular |
1206 | * buffer. | 1169 | * buffer. |
1207 | */ | 1170 | */ |
1208 | static unsigned int pl2303_buf_space_avail(struct pl2303_buf *pb) | 1171 | static unsigned int oti6858_buf_space_avail(struct oti6858_buf *pb) |
1209 | { | 1172 | { |
1210 | if (pb == NULL) | 1173 | if (pb == NULL) |
1211 | return 0; | 1174 | return 0; |
@@ -1213,14 +1176,14 @@ static unsigned int pl2303_buf_space_avail(struct pl2303_buf *pb) | |||
1213 | } | 1176 | } |
1214 | 1177 | ||
1215 | /* | 1178 | /* |
1216 | * pl2303_buf_put | 1179 | * oti6858_buf_put |
1217 | * | 1180 | * |
1218 | * Copy data data from a user buffer and put it into the circular buffer. | 1181 | * Copy data data from a user buffer and put it into the circular buffer. |
1219 | * Restrict to the amount of space available. | 1182 | * Restrict to the amount of space available. |
1220 | * | 1183 | * |
1221 | * Return the number of bytes copied. | 1184 | * Return the number of bytes copied. |
1222 | */ | 1185 | */ |
1223 | static unsigned int pl2303_buf_put(struct pl2303_buf *pb, const char *buf, | 1186 | static unsigned int oti6858_buf_put(struct oti6858_buf *pb, const char *buf, |
1224 | unsigned int count) | 1187 | unsigned int count) |
1225 | { | 1188 | { |
1226 | unsigned int len; | 1189 | unsigned int len; |
@@ -1228,7 +1191,7 @@ static unsigned int pl2303_buf_put(struct pl2303_buf *pb, const char *buf, | |||
1228 | if (pb == NULL) | 1191 | if (pb == NULL) |
1229 | return 0; | 1192 | return 0; |
1230 | 1193 | ||
1231 | len = pl2303_buf_space_avail(pb); | 1194 | len = oti6858_buf_space_avail(pb); |
1232 | if (count > len) | 1195 | if (count > len) |
1233 | count = len; | 1196 | count = len; |
1234 | 1197 | ||
@@ -1252,14 +1215,14 @@ static unsigned int pl2303_buf_put(struct pl2303_buf *pb, const char *buf, | |||
1252 | } | 1215 | } |
1253 | 1216 | ||
1254 | /* | 1217 | /* |
1255 | * pl2303_buf_get | 1218 | * oti6858_buf_get |
1256 | * | 1219 | * |
1257 | * Get data from the circular buffer and copy to the given buffer. | 1220 | * Get data from the circular buffer and copy to the given buffer. |
1258 | * Restrict to the amount of data available. | 1221 | * Restrict to the amount of data available. |
1259 | * | 1222 | * |
1260 | * Return the number of bytes copied. | 1223 | * Return the number of bytes copied. |
1261 | */ | 1224 | */ |
1262 | static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf, | 1225 | static unsigned int oti6858_buf_get(struct oti6858_buf *pb, char *buf, |
1263 | unsigned int count) | 1226 | unsigned int count) |
1264 | { | 1227 | { |
1265 | unsigned int len; | 1228 | unsigned int len; |
@@ -1267,7 +1230,7 @@ static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf, | |||
1267 | if (pb == NULL) | 1230 | if (pb == NULL) |
1268 | return 0; | 1231 | return 0; |
1269 | 1232 | ||
1270 | len = pl2303_buf_data_avail(pb); | 1233 | len = oti6858_buf_data_avail(pb); |
1271 | if (count > len) | 1234 | if (count > len) |
1272 | count = len; | 1235 | count = len; |
1273 | 1236 | ||