if (!transp_mode) { if (fifon == HFCUSB_B1_TX) handle_led(hfc, LED_B1_DATA); if (fifon == HFCUSB_B2_TX) handle_led(hfc, LED_B2_DATA); } 
tx_iso_complete(struct urb *urb, struct pt_regs *regs){	iso_urb_struct *context_iso_urb = (iso_urb_struct *) urb->context;	usb_fifo *fifo = context_iso_urb->owner_fifo;	hfcusb_data *hfc = fifo->hfc;	int k, tx_offset, num_isoc_packets, sink, len, current_len,	    errcode;	int frame_complete, transp_mode, fifon, status;	__u8 threshbit;	__u8 threshtable[8] = { 1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80 };	fifon = fifo->fifonum;	status = urb->status;	tx_offset = 0;	if (fifo->active && !status) {		transp_mode = 0;		if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS)			transp_mode = TRUE;		/* is FifoFull-threshold set for our channel? */		threshbit = threshtable[fifon] & hfc->threshold_mask;		num_isoc_packets = iso_packets[fifon];		/* predict dataflow to avoid fifo overflow */		if (fifon >= HFCUSB_D_TX) {			sink = (threshbit) ? SINK_DMIN : SINK_DMAX;		} else {			sink = (threshbit) ? SINK_MIN : SINK_MAX;		}		fill_isoc_urb(urb, fifo->hfc->dev, fifo->pipe,			      context_iso_urb->buffer, num_isoc_packets,			      fifo->usb_packet_maxlen, fifo->intervall,			      tx_iso_complete, urb->context);		memset(context_iso_urb->buffer, 0,		       sizeof(context_iso_urb->buffer));		frame_complete = FALSE;		/* Generate next Iso Packets */		for (k = 0; k < num_isoc_packets; ++k) {			if (fifo->skbuff) {				len = fifo->skbuff->len;				/* we lower data margin every msec */				fifo->bit_line -= sink;				current_len = (0 - fifo->bit_line) / 8;				/* maximum 15 byte for every ISO packet makes our life easier */				if (current_len > 14)					current_len = 14;				current_len =				    (len <=				     current_len) ? len : current_len;				/* how much bit do we put on the line? */				fifo->bit_line += current_len * 8;				context_iso_urb->buffer[tx_offset] = 0;				if (current_len == len) {					if (!transp_mode) {						/* here frame completion */						context_iso_urb->						    buffer[tx_offset] = 1;						/* add 2 byte flags and 16bit CRC at end of ISDN frame */						fifo->bit_line += 32;					}					frame_complete = TRUE;				}				memcpy(context_iso_urb->buffer +				       tx_offset + 1, fifo->skbuff->data,				       current_len);				skb_pull(fifo->skbuff, current_len);				/* define packet delimeters within the URB buffer */				urb->iso_frame_desc[k].offset = tx_offset;				urb->iso_frame_desc[k].length =				    current_len + 1;				tx_offset += (current_len + 1);				if (!transp_mode) {					if (fifon == HFCUSB_B1_TX)						handle_led(hfc,							   LED_B1_DATA);					if (fifon == HFCUSB_B2_TX)						handle_led(hfc,							   LED_B2_DATA);				}			} else {				urb->iso_frame_desc[k].offset =				    tx_offset++;				urb->iso_frame_desc[k].length = 1;				fifo->bit_line -= sink;	/* we lower data margin every msec */				if (fifo->bit_line < BITLINE_INF) {					fifo->bit_line = BITLINE_INF;				}			}			if (frame_complete) {				fifo->delete_flg = TRUE;				fifo->hif->l1l2(fifo->hif,						PH_DATA | CONFIRM,						(void *) fifo->skbuff->						truesize);				if (fifo->skbuff && fifo->delete_flg) {					dev_kfree_skb_any(fifo->skbuff);					fifo->skbuff = NULL;					fifo->delete_flg = FALSE;				}				frame_complete = FALSE;			}		}		errcode = usb_submit_urb(urb, GFP_ATOMIC);		if (errcode < 0) {			printk(KERN_INFO			       "HFC-S USB: error submitting ISO URB: %d \n",			       errcode);		}	} else {		if (status && !hfc->disc_flag) {			printk(KERN_INFO			       "HFC-S USB: tx_iso_complete : urb->status %s (%i), fifonum=%d\n",			       symbolic(urb_errlist, status), status,			       fifon);		}	}}				/* tx_iso_complete */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/597a107b1d5587dc230dbbe3faeca242daed494e/hfc_usb.c/buggy/drivers/isdn/hisax/hfc_usb.c