dev_kfree_skb(skb); 
dev_kfree_skb_any(skb); 
claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid){        int                             rc=0;        struct claw_privbk 		*privptr;        struct ccwbk           *p_this_ccw;        struct ccwbk           *p_first_ccw;        struct ccwbk           *p_last_ccw;        __u32                           numBuffers;        signed long                     len_of_data;        unsigned long                   bytesInThisBuffer;        unsigned char                   *pDataAddress;        struct endccw                   *pEnd;        struct ccw1                     tempCCW;        struct chbk                     *p_ch;	struct claw_env			*p_env;        int                             lock;	struct clawph			*pk_head;	struct chbk			*ch;#ifdef IOTRACE        struct ccwbk                   *p_buf;#endif#ifdef FUNCTRACE        printk(KERN_INFO "%s: %s() > enter\n",dev->name,__FUNCTION__);#endif	CLAW_DBF_TEXT(4,trace,"hw_tx");#ifdef DEBUGMSG        printk(KERN_INFO "%s: variable dev skb =\n",dev->name);        dumpit((char *) skb, sizeof(struct sk_buff));        printk(KERN_INFO "%s: variable dev =\n",dev->name);        dumpit((char *) dev, sizeof(struct net_device));        printk(KERN_INFO "%s: variable linkid = %ld\n",dev->name,linkid);#endif        privptr = (struct claw_privbk *) (dev->priv);        p_ch=(struct chbk *)&privptr->channel[WRITE];	p_env =privptr->p_env;#ifdef IOTRACE        printk(KERN_INFO "%s: %s() dump sk_buff  \n",dev->name,__FUNCTION__);        dumpit((char *)skb ,sizeof(struct sk_buff));#endif	claw_free_wrt_buf(dev);	/* Clean up free chain if posible */        /*  scan the write queue to free any completed write packets   */        p_first_ccw=NULL;        p_last_ccw=NULL;	if ((p_env->packing >= PACK_SEND) &&       	    (skb->cb[1] != 'P')) {		skb_push(skb,sizeof(struct clawph));		pk_head=(struct clawph *)skb->data;		pk_head->len=skb->len-sizeof(struct clawph);		if (pk_head->len%4)  {			pk_head->len+= 4-(pk_head->len%4);			skb_pad(skb,4-(pk_head->len%4));			skb_put(skb,4-(pk_head->len%4));		}		if (p_env->packing == DO_PACKED)			pk_head->link_num = linkid;		else			pk_head->link_num = 0;		pk_head->flag = 0x00;		skb_pad(skb,4);		skb->cb[1] = 'P';	}        if (linkid == 0) {        	if (claw_check_busy(dev)) {                	if (privptr->write_free_count!=0) {                                claw_clear_busy(dev);                        }                        else {                                claw_strt_out_IO(dev );                                claw_free_wrt_buf( dev );                                if (privptr->write_free_count==0) {#ifdef IOTRACE                                	printk(KERN_INFO "%s: "					   "(claw_check_busy) no free write "					   "buffers\n", dev->name);#endif					ch = &privptr->channel[WRITE];					atomic_inc(&skb->users);					skb_queue_tail(&ch->collect_queue, skb);                                	goto Done;                                }                                else {                                	claw_clear_busy(dev);                                }                        }                }                /*  tx lock  */                if (claw_test_and_setbit_busy(TB_TX,dev)) { /* set to busy */#ifdef DEBUGMSG                        printk(KERN_INFO "%s:  busy  (claw_test_and_setbit_"				"busy)\n", dev->name);#endif			ch = &privptr->channel[WRITE];			atomic_inc(&skb->users);			skb_queue_tail(&ch->collect_queue, skb);                        claw_strt_out_IO(dev );                        rc=-EBUSY;                        goto Done2;                }        }        /*      See how many write buffers are required to hold this data */        numBuffers= ( skb->len + privptr->p_env->write_size - 1) /			( privptr->p_env->write_size);        /*      If that number of buffers isn't available, give up for now */        if (privptr->write_free_count < numBuffers ||            privptr->p_write_free_chain == NULL ) {                claw_setbit_busy(TB_NOBUFFER,dev);#ifdef DEBUGMSG                printk(KERN_INFO "%s:  busy  (claw_setbit_busy"			"(TB_NOBUFFER))\n", dev->name);                printk(KERN_INFO "       free_count: %d, numBuffers : %d\n",			(int)privptr->write_free_count,(int) numBuffers );#endif		ch = &privptr->channel[WRITE];		atomic_inc(&skb->users);		skb_queue_tail(&ch->collect_queue, skb);		CLAW_DBF_TEXT(2,trace,"clawbusy");                goto Done2;        }        pDataAddress=skb->data;        len_of_data=skb->len;        while (len_of_data > 0) {#ifdef DEBUGMSG                printk(KERN_INFO "%s: %s() length-of-data is %ld \n",			dev->name ,__FUNCTION__,len_of_data);                dumpit((char *)pDataAddress ,64);#endif                p_this_ccw=privptr->p_write_free_chain;  /* get a block */		if (p_this_ccw == NULL) { /* lost the race */			ch = &privptr->channel[WRITE];			atomic_inc(&skb->users);			skb_queue_tail(&ch->collect_queue, skb);			goto Done2;		}                privptr->p_write_free_chain=p_this_ccw->next;                p_this_ccw->next=NULL;                --privptr->write_free_count; /* -1 */                bytesInThisBuffer=len_of_data;                memcpy( p_this_ccw->p_buffer,pDataAddress, bytesInThisBuffer);                len_of_data-=bytesInThisBuffer;                pDataAddress+=(unsigned long)bytesInThisBuffer;                /*      setup write CCW         */                p_this_ccw->write.cmd_code = (linkid * 8) +1;                if (len_of_data>0) {                        p_this_ccw->write.cmd_code+=MORE_to_COME_FLAG;                }                p_this_ccw->write.count=bytesInThisBuffer;                /*      now add to end of this chain    */                if (p_first_ccw==NULL)    {                        p_first_ccw=p_this_ccw;                }                if (p_last_ccw!=NULL) {                        p_last_ccw->next=p_this_ccw;                        /*      set up TIC ccws         */                        p_last_ccw->w_TIC_1.cda=				(__u32)__pa(&p_this_ccw->write);                }                p_last_ccw=p_this_ccw;      /* save new last block */#ifdef IOTRACE		printk(KERN_INFO "%s: %s() > CCW and Buffer %ld bytes long \n",			dev->name,__FUNCTION__,bytesInThisBuffer);                dumpit((char *)p_this_ccw, sizeof(struct ccwbk));                dumpit((char *)p_this_ccw->p_buffer, 64);#endif        }        /*      FirstCCW and LastCCW now contain a new set of write channel        *       programs to append to the running channel program        */        if (p_first_ccw!=NULL) {                /*      setup ending ccw sequence for this segment              */                pEnd=privptr->p_end_ccw;                if (pEnd->write1) {                        pEnd->write1=0x00;   /* second end ccw is now active */                        /*      set up Tic CCWs         */                        p_last_ccw->w_TIC_1.cda=				(__u32)__pa(&pEnd->write2_nop1);                        pEnd->write2_nop2.cmd_code = CCW_CLAW_CMD_READFF;                        pEnd->write2_nop2.flags    =				CCW_FLAG_SLI | CCW_FLAG_SKIP;                        pEnd->write2_nop2.cda=0;                        pEnd->write2_nop2.count=1;                }                else {  /*  end of if (pEnd->write1)*/                        pEnd->write1=0x01;   /* first end ccw is now active */                        /*      set up Tic CCWs         */                        p_last_ccw->w_TIC_1.cda=				(__u32)__pa(&pEnd->write1_nop1);                        pEnd->write1_nop2.cmd_code = CCW_CLAW_CMD_READFF;                        pEnd->write1_nop2.flags    =				CCW_FLAG_SLI | CCW_FLAG_SKIP;                        pEnd->write1_nop2.cda=0;                        pEnd->write1_nop2.count=1;                }  /* end if if (pEnd->write1) */                if (privptr->p_write_active_first==NULL ) {                        privptr->p_write_active_first=p_first_ccw;                        privptr->p_write_active_last=p_last_ccw;                }                else {                        /*      set up Tic CCWs         */                        tempCCW.cda=(__u32)__pa(&p_first_ccw->write);                        tempCCW.count=0;                        tempCCW.flags=0;                        tempCCW.cmd_code=CCW_CLAW_CMD_TIC;                        if (pEnd->write1) {                 /*                 * first set of ending CCW's is chained to the new write                 * chain, so the second set is chained to the active chain                 * Therefore modify the second set to point the new write chain.                 * make sure we update the CCW atomically                 * so channel does not fetch it when it's only half done                 */                                memcpy( &pEnd->write2_nop2, &tempCCW ,					sizeof(struct ccw1));                                privptr->p_write_active_last->w_TIC_1.cda=					(__u32)__pa(&p_first_ccw->write);                        }                        else {                        /*make sure we update the CCW atomically                         *so channel does not fetch it when it's only half done                         */                                memcpy(&pEnd->write1_nop2, &tempCCW ,					sizeof(struct ccw1));                                privptr->p_write_active_last->w_TIC_1.cda=				        (__u32)__pa(&p_first_ccw->write);                        } /* end if if (pEnd->write1) */                        privptr->p_write_active_last->next=p_first_ccw;                        privptr->p_write_active_last=p_last_ccw;                }        } /* endif (p_first_ccw!=NULL)  */#ifdef IOTRACE        printk(KERN_INFO "%s: %s() >  Dump Active CCW chain \n",		dev->name,__FUNCTION__);        p_buf=privptr->p_write_active_first;        while (p_buf!=NULL) {                dumpit((char *)p_buf, sizeof(struct ccwbk));                p_buf=p_buf->next;        }        p_buf=(struct ccwbk*)privptr->p_end_ccw;        dumpit((char *)p_buf, sizeof(struct endccw));#endif        dev_kfree_skb(skb);	if (linkid==0) {        	lock=LOCK_NO;        }        else  {                lock=LOCK_YES;        }        claw_strt_out_IO(dev );        /*      if write free count is zero , set NOBUFFER       */#ifdef DEBUGMSG        printk(KERN_INFO "%s: %s() > free_count is %d\n",		dev->name,__FUNCTION__,		(int) privptr->write_free_count );#endif	if (privptr->write_free_count==0) {		claw_setbit_busy(TB_NOBUFFER,dev);        }Done2:	claw_clearbit_busy(TB_TX,dev);Done:#ifdef FUNCTRACE        printk(KERN_INFO "%s: %s() > exit on line %d, rc = %d \n",		dev->name,__FUNCTION__,__LINE__, rc);#endif	return(rc);}    /*    end of claw_hw_tx    */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8e84c801bad50d2e0e9f802610d2c13f8d342230/claw.c/clean/drivers/s390/net/claw.c