spin_lock_irqsave(&ch->collect_lock, saveflags); if (ch->collect_len + l > ch->max_bufsize - 2) rc = -EBUSY; else { 
if (ch->collect_len + l > ch->max_bufsize - 2) { spin_unlock_irqrestore(&ch->collect_lock, saveflags); return -EBUSY; } else { 
transmit_skb(struct channel *ch, struct sk_buff *skb){	unsigned long saveflags;	struct ll_header header;	int rc = 0;	DBF_TEXT(trace, 5, __FUNCTION__);	if (fsm_getstate(ch->fsm) != CH_STATE_TXIDLE) {		int l = skb->len + LL_HEADER_LENGTH;		spin_lock_irqsave(&ch->collect_lock, saveflags);		if (ch->collect_len + l > ch->max_bufsize - 2)			rc = -EBUSY;		else {			atomic_inc(&skb->users);			header.length = l;			header.type = skb->protocol;			header.unused = 0;			memcpy(skb_push(skb, LL_HEADER_LENGTH), &header,			       LL_HEADER_LENGTH);			skb_queue_tail(&ch->collect_queue, skb);			ch->collect_len += l;		}		spin_unlock_irqrestore(&ch->collect_lock, saveflags);	} else {		__u16 block_len;		int ccw_idx;		struct sk_buff *nskb;		unsigned long hi;		/**		 * Protect skb against beeing free'd by upper		 * layers.		 */		atomic_inc(&skb->users);		ch->prof.txlen += skb->len;		header.length = skb->len + LL_HEADER_LENGTH;		header.type = skb->protocol;		header.unused = 0;		memcpy(skb_push(skb, LL_HEADER_LENGTH), &header,		       LL_HEADER_LENGTH);		block_len = skb->len + 2;		*((__u16 *) skb_push(skb, 2)) = block_len;		/**		 * IDAL support in CTC is broken, so we have to		 * care about skb's above 2G ourselves.		 */		hi = ((unsigned long) skb->tail + LL_HEADER_LENGTH) >> 31;		if (hi) {			nskb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);			if (!nskb) {				atomic_dec(&skb->users);				skb_pull(skb, LL_HEADER_LENGTH + 2);				return -ENOMEM;			} else {				memcpy(skb_put(nskb, skb->len),				       skb->data, skb->len);				atomic_inc(&nskb->users);				atomic_dec(&skb->users);				dev_kfree_skb_irq(skb);				skb = nskb;			}		}		ch->ccw[4].count = block_len;		if (set_normalized_cda(&ch->ccw[4], skb->data)) {			/**			 * idal allocation failed, try via copying to			 * trans_skb. trans_skb usually has a pre-allocated			 * idal.			 */			if (ctc_checkalloc_buffer(ch, 1)) {				/**				 * Remove our header. It gets added				 * again on retransmit.				 */				atomic_dec(&skb->users);				skb_pull(skb, LL_HEADER_LENGTH + 2);				return -EBUSY;			}			ch->trans_skb->tail = ch->trans_skb->data;			ch->trans_skb->len = 0;			ch->ccw[1].count = skb->len;			memcpy(skb_put(ch->trans_skb, skb->len), skb->data,			       skb->len);			atomic_dec(&skb->users);			dev_kfree_skb_irq(skb);			ccw_idx = 0;		} else {			skb_queue_tail(&ch->io_queue, skb);			ccw_idx = 3;		}		ch->retry = 0;		fsm_newstate(ch->fsm, CH_STATE_TX);		fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);		spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);		ch->prof.send_stamp = xtime;		rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx],				      (unsigned long) ch, 0xff, 0);		spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags);		if (ccw_idx == 3)			ch->prof.doios_single++;		if (rc != 0) {			fsm_deltimer(&ch->timer);			ccw_check_return_code(ch, rc, "single skb TX");			if (ccw_idx == 3)				skb_dequeue_tail(&ch->io_queue);			/**			 * Remove our header. It gets added			 * again on retransmit.			 */			skb_pull(skb, LL_HEADER_LENGTH + 2);		} else {			if (ccw_idx == 0) {				struct net_device *dev = ch->netdev;				struct ctc_priv *privptr = dev->priv;				privptr->stats.tx_packets++;				privptr->stats.tx_bytes +=				    skb->len - LL_HEADER_LENGTH;			}		}	}	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e172577da02cde3916e75406b314e6f01c228a5c/ctcmain.c/clean/drivers/s390/net/ctcmain.c