150 |
return 0; |
return 0; |
151 |
} |
} |
152 |
|
|
153 |
static void generic_read_bulk_callback (struct urb *urb) |
static void generic_read_bulk_callback(struct urb *urb) |
154 |
{ |
{ |
155 |
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
156 |
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); |
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); |
171 |
return; |
return; |
172 |
} |
} |
173 |
|
|
174 |
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); |
usb_serial_debug_data(__FILE__, __FUNCTION__, urb->actual_length, data); |
175 |
|
|
176 |
tty = port->tty; |
tty = port->tty; |
177 |
if (tty && urb->actual_length) { |
if (tty && urb->actual_length) { |
178 |
for (i = 0; i < urb->actual_length ; ++i) { |
for (i = 0; i < urb->actual_length ; ++i) { |
179 |
/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ |
/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ |
180 |
if(tty->flip.count >= TTY_FLIPBUF_SIZE) { |
if (tty->flip.count >= TTY_FLIPBUF_SIZE) { |
181 |
tty_flip_buffer_push(tty); |
tty_flip_buffer_push(tty); |
182 |
} |
} |
183 |
/* this doesn't actually push the data through unless tty->low_latency is set */ |
/* this doesn't actually push the data through unless tty->low_latency is set */ |
187 |
} |
} |
188 |
|
|
189 |
/* Continue trying to always read */ |
/* Continue trying to always read */ |
190 |
usb_fill_bulk_urb (port->read_urb, serial->dev, |
usb_fill_bulk_urb(port->read_urb, serial->dev, |
191 |
usb_rcvbulkpipe (serial->dev, |
usb_rcvbulkpipe(serial->dev, |
192 |
port->bulk_in_endpointAddress), |
port->bulk_in_endpointAddress), |
193 |
port->read_urb->transfer_buffer, |
port->read_urb->transfer_buffer, |
194 |
port->read_urb->transfer_buffer_length, |
port->read_urb->transfer_buffer_length, |
195 |
((serial->type->read_bulk_callback) ? |
((serial->type->read_bulk_callback) ? |
196 |
serial->type->read_bulk_callback : |
serial->type->read_bulk_callback : |
197 |
generic_read_bulk_callback), port); |
generic_read_bulk_callback), port); |
198 |
result = usb_submit_urb(port->read_urb); |
result = usb_submit_urb(port->read_urb); |
199 |
if (result) |
if (result) |
200 |
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); |
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); |
201 |
} |
} |
202 |
|
|
203 |
static void generic_write_bulk_callback (struct urb *urb) |
static void generic_write_bulk_callback(struct urb *urb) |
204 |
{ |
{ |
205 |
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
206 |
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); |
struct usb_serial *serial = get_usb_serial(port, __FUNCTION__); |
207 |
|
|
208 |
dbg("%s - port %d", __FUNCTION__, port->number); |
dbg("%s - port %d", __FUNCTION__, port->number); |
209 |
|
|
247 |
return 0; |
return 0; |
248 |
} |
} |
249 |
|
|
250 |
static void __exit nokia_exit (void) |
static void __exit nokia_exit(void) |
251 |
{ |
{ |
252 |
usb_deregister(&nokia_driver); |
usb_deregister(&nokia_driver); |
253 |
usb_serial_deregister(&nokia_device); |
usb_serial_deregister(&nokia_device); |
256 |
module_init(nokia_init); |
module_init(nokia_init); |
257 |
module_exit(nokia_exit); |
module_exit(nokia_exit); |
258 |
|
|
259 |
MODULE_AUTHOR( DRIVER_AUTHOR ); |
MODULE_AUTHOR(DRIVER_AUTHOR); |
260 |
MODULE_DESCRIPTION( DRIVER_DESC ); |
MODULE_DESCRIPTION(DRIVER_DESC); |
261 |
MODULE_LICENSE("GPL"); |
MODULE_LICENSE("GPL"); |
262 |
|
|
263 |
MODULE_PARM(debug, "i"); |
MODULE_PARM(debug, "i"); |