 if (port->write_urb->status == -EINPROGRESS) { dbg("%s - already writing", __FUNCTION__); spin_unlock(&priv->lock); return; } 
static void cyberjack_write_bulk_callback (struct urb *urb, struct pt_regs *regs){	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;	struct cyberjack_private *priv = usb_get_serial_port_data(port);	dbg("%s - port %d", __FUNCTION__, port->number);		if (urb->status) {		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);		return;	}	spin_lock(&priv->lock);	/* only do something if we have more data to send */	if( priv->wrfilled ) {		int length, blksize, result;		if (port->write_urb->status == -EINPROGRESS) {			dbg("%s - already writing", __FUNCTION__);			spin_unlock(&priv->lock);			return;		}		dbg("%s - transmitting data (frame n)", __FUNCTION__);		length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ?			port->bulk_out_size : (priv->wrfilled - priv->wrsent);		memcpy (port->write_urb->transfer_buffer, priv->wrbuf + priv->wrsent,			length );		priv->wrsent+=length;		/* set up our urb */		usb_fill_bulk_urb(port->write_urb, port->serial->dev, 			      usb_sndbulkpipe(port->serial->dev, port->bulk_out_endpointAddress),			      port->write_urb->transfer_buffer, length,			      ((port->serial->type->write_bulk_callback) ? 			       port->serial->type->write_bulk_callback : 			       cyberjack_write_bulk_callback), 			      port);		/* send the data out the bulk port */		result = usb_submit_urb(port->write_urb, GFP_ATOMIC);		if (result) {			err("%s - failed submitting write urb, error %d", __FUNCTION__, result);			/* Throw away data. No better idea what to do with it. */			priv->wrfilled=0;			priv->wrsent=0;			goto exit;		}		dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);		dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);		blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;		if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) {			dbg("%s - buffer cleaned", __FUNCTION__);			memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );			priv->wrfilled=0;			priv->wrsent=0;		}	}exit:	spin_unlock(&priv->lock);	schedule_work(&port->work);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/507ca9bc0476662f3463888d583864834eab1e11/cyberjack.c/buggy/drivers/usb/serial/cyberjack.c