generic.c (de8853bc38ceab1fa7e7f723b21430d4aad60fea) | generic.c (c1e13f25674ed564948ecb7dfe5f83e578892896) |
---|---|
1/* 2 * USB Serial Converter Generic functions 3 * 4 * Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License version 8 * 2 as published by the Free Software Foundation. --- 271 unchanged lines hidden (view full) --- 280 port->write_urb_busy = start_io; 281 } 282 spin_unlock_irqrestore(&port->lock, flags); 283 284 if (!start_io) 285 return 0; 286 287 data = port->write_urb->transfer_buffer; | 1/* 2 * USB Serial Converter Generic functions 3 * 4 * Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License version 8 * 2 as published by the Free Software Foundation. --- 271 unchanged lines hidden (view full) --- 280 port->write_urb_busy = start_io; 281 } 282 spin_unlock_irqrestore(&port->lock, flags); 283 284 if (!start_io) 285 return 0; 286 287 data = port->write_urb->transfer_buffer; |
288 count = kfifo_get(port->write_fifo, data, port->bulk_out_size); | 288 count = kfifo_get_locked(port->write_fifo, data, port->bulk_out_size, &port->lock); |
289 usb_serial_debug_data(debug, &port->dev, __func__, count, data); 290 291 /* set up our urb */ 292 usb_fill_bulk_urb(port->write_urb, serial->dev, 293 usb_sndbulkpipe(serial->dev, 294 port->bulk_out_endpointAddress), 295 port->write_urb->transfer_buffer, count, 296 ((serial->type->write_bulk_callback) ? --- 43 unchanged lines hidden (view full) --- 340 /* only do something if we have a bulk out endpoint */ 341 if (!serial->num_bulk_out) 342 return 0; 343 344 if (serial->type->max_in_flight_urbs) 345 return usb_serial_multi_urb_write(tty, port, 346 buf, count); 347 | 289 usb_serial_debug_data(debug, &port->dev, __func__, count, data); 290 291 /* set up our urb */ 292 usb_fill_bulk_urb(port->write_urb, serial->dev, 293 usb_sndbulkpipe(serial->dev, 294 port->bulk_out_endpointAddress), 295 port->write_urb->transfer_buffer, count, 296 ((serial->type->write_bulk_callback) ? --- 43 unchanged lines hidden (view full) --- 340 /* only do something if we have a bulk out endpoint */ 341 if (!serial->num_bulk_out) 342 return 0; 343 344 if (serial->type->max_in_flight_urbs) 345 return usb_serial_multi_urb_write(tty, port, 346 buf, count); 347 |
348 count = kfifo_put(port->write_fifo, buf, count); | 348 count = kfifo_put_locked(port->write_fifo, buf, count, &port->lock); |
349 result = usb_serial_generic_write_start(port); 350 351 if (result >= 0) 352 result = count; 353 354 return result; 355} 356EXPORT_SYMBOL_GPL(usb_serial_generic_write); --- 264 unchanged lines hidden --- | 349 result = usb_serial_generic_write_start(port); 350 351 if (result >= 0) 352 result = count; 353 354 return result; 355} 356EXPORT_SYMBOL_GPL(usb_serial_generic_write); --- 264 unchanged lines hidden --- |