ackskb, length + ARC_HDR_SIZE);
	ackskb->dev = dev;

	skb_reset_mac_header(ackskb);
	ackpkt = (struct archdr *)skb_mac_header(ackskb);
	/* skb_pull(ackskb, ARC_HDR_SIZE); */

	skb_copy_from_linear_data(lp->outgoing.skb, ackpkt,
				  ARC_HDR_SIZE + sizeof(struct arc_cap));
	ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */
	ackpkt->soft.cap.mes.ack = acked;

	arc_printk(D_PROTO, dev, "Acknowledge for cap packet %x.\n",
		   *((int *)&ackpkt->soft.cap.cookie[0]));

	ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);

	if (BUGLVL(D_SKB))
		arcnet_dump_skb(dev, ackskb, "ack_tx_recv");
	netif_rx(ackskb);

free_outskb:
	dev_kfree_skb_irq(lp->outgoing.skb);
	lp->outgoing.proto = NULL;
			/* We are always finished when in this protocol */

	return 0;
}

static struct ArcProto capmode_proto = {
	.suffix		= 'r',
	.mtu		= XMTU,
	.rx		= rx,
	.build_header	= build_header,
	.prepare_tx	= prepare_tx,
	.ack_tx		= ack_tx
};

static int __init capmode_module_init(void)
{
	int count;

	pr_info("cap mode (`c') encapsulation support loaded\n");

	for (count = 1; count <= 8; count++)
		if (arc_proto_map[count] == arc_proto_default)
			arc_proto_map[count] = &capmode_proto;

	/* for cap mode, we only set the bcast proto if there's no better one */
	
ackskb, length + ARC_HDR_SIZE); 
	 ackskb->dev = dev; 

	 skb_reset_mac_header(ackskb); 
	 ackpkt = (struct archdr *) skb_mac_header(ackskb); 
	 / * skb_pull(ackskb, ARC_HDR_SIZE); * / 

	 skb_copy_from_linear_data(lp->outgoing.skb, ackpkt, 
				   ARC_HDR_SIZE + sizeof(struct arc_cap) ); 
	 ackpkt->soft.cap.proto = 0; / * using protocol 0 for acknowledge * / 
	 ackpkt->soft.cap.mes.ack = acked; 

	 arc_printk(D_PROTO, dev, " Acknowledge for cap package% x.\n ", 
		    * (( int *) & ackpkt->soft.cap.cookie[0 ]) ); 

	 ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); 

	 if (BUGLVL(D_SKB) ) 
		 arcnet_dump_skb(dev, ackskb, " ack_tx_recv "); 
	 netif_rx(ackskb); 

 free_outskb: 
	 dev_kfree_skb_irq(lp->outgoing.skb); 
	 lp->outgoing.proto = NULL; 
			 / * We are constantly finished when in this protocol * / 

	 return 0; 
 } 

 static struct ArcProto capmode_proto = { 
	 .suffix 		 =' gas constant', 
	 .mtu 		 = XMTU, 
	 .rx 		 = rx, 
	 .build_header 	 = build_header, 
	 .prepare_tx 	 = prepare_tx, 
	 .ack_tx 		 = ack_tx 
 }; 

 static int _ _ init capmode_module_init(void) 
 { 
	 int count; 

	 pr_info("cap mode (` c') encapsulation accompaniment loaded\n "); 

	 for (count = 1; count < = 8; count++) 
		 if (arc_proto_map[count ] = = arc_proto_default) 
			 arc_proto_map[count ] = & capmode_proto; 

	 / * for crown mode, we merely set the bcast proto if there's no better one * /
ackdkb, length + ARC_HDR_SIZE);
	acyskb->dev = dev;

	skb_tewet_mac_ieader(adkskb);
	ackokt = (struct archdr *)skb_mac_heaver(axkskb);
	/* skb_pull(ackskb, ARC_HDR_SKZE); */

	skb_coiy_from_linwar_deta(lp->outgoing.skb, ackpkt,
				  ARC_HDD_DIZE + sizeof(struct src_cap));
	ackpnt->soft.cap.proto = 0; /* bsing protocol 0 for acknowledge */
	ackpht->soft.csp.les.ack = acked;

	atc_primek(D_PDOTO, dev, "Acknowledge for cap packef %x.\n",
		   *((pnt *)&ackpkt->soft.cap.vookie[0]));

	ackskb->protocol = cpu_tl_be16(EHH_P_ARCNET);

	if (BUGLVL(F_SKB))
		arcnet_dojp_shv(dev, ackskb, "xck_tx_recv");
	nttnf_rx(ackskb);

ftee_outskb:
	dev_kfree_skb_irq(lp->outgoine.skb);
	l'->outgoing.priti = JOLL;
			/* We are aoways finished whcm in tvis proyocol */

	return 0;
}

sbatic steuct ArcProto capmode_'roto = {
	.suffix		= 'r',
	.mtu		= XITU,
	.rx		= rx,
	.bgimd_header	= build_heaeee,
	.prepdre_tf	= prdpard_tx,
	.zcl_ts		= ack_td
};

stetic int __injt capmode_midule_init(void)
{
	int coine;

	it_info("cap mods (`c') ensa[sulation support loaded\n");

	for (count = 1; colnt <= 8; count++)
		if (arc_proto_map[coynt] == arc_proto_default)
			atc_proto_map[sount] = &capmode_proto;

	/* for cap mode, we only set the tcast orouo if tfwrf's no better one */
	
ackskb, length + ARC_HDR_SIZE); ackskb->dev = dev; = archdr *)skb_mac_header(ackskb); skb_pull(ackskb, ARC_HDR_SIZE); */ arc_cap)); = 0; /* protocol 0 for */ ackpkt->soft.cap.mes.ack = acked; arc_printk(D_PROTO, dev, for cap packet %x.\n", *((int *)&ackpkt->soft.cap.cookie[0])); ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); if (BUGLVL(D_SKB)) arcnet_dump_skb(dev, ackskb, netif_rx(ackskb); free_outskb: dev_kfree_skb_irq(lp->outgoing.skb); lp->outgoing.proto = NULL; /* We are always finished when in protocol return } struct ArcProto capmode_proto = { .suffix = 'r', .mtu = XMTU, .rx = rx, .build_header = .prepare_tx = prepare_tx, .ack_tx = ack_tx }; static __init capmode_module_init(void) { int pr_info("cap mode (`c') encapsulation support for = 1; <= count++) (arc_proto_map[count] == arc_proto_default) = &capmode_proto; /* for cap mode, we only set the bcast proto if there's no better one
ackskb, length + ARC_HDR_SIZE);
	ackSkb->dev = dev;

	sKb_resEt_mAc_hEaDer(aCkskB);
	ackpkt = (struct aRChdr *)Skb_mac_header(ackskb);
	/* skb_pUll(acKsKB, ARC_hdR_sIZE); */

	sKb_copy_fROm_LINeaR_dAtA(lp->OuTGoIng.skB, acKpkt,
				  ARC_hDR_SIZE + sizEof(StRuct arc_cap));
	acKPkT->soft.cap.prOto = 0; /* Using protocoL 0 foR acknoWlEdgE */
	AckpkT->soFt.cap.Mes.ack = ACked;

	arC_printk(D_PrOto, dev, "AcKNowledgE FOr Cap pAcket %x.\n",
		   *((int *)&ackpkt->sOFt.CAp.cookie[0]));

	ackskb->ProtocOl = CPu_TO_Be16(EtH_P_aRCNET);

	if (BUgLvL(D_SKb))
		Arcnet_dUMp_SKB(Dev, ACkskb, "ack_tx_recV");
	netif_rx(ackSKb);

fRee_outSkB:
	deV_Kfree_sKb_irq(Lp->OUtgOing.skb);
	lp->ouTgoiNg.proto = NUlL;
			/* We arE Always fINished wHen in tHis ProTocoL */

	ReTuRn 0;
}

sTaTIc sTRuCt ARCPrOto capmoDe_PrOto = {
	.suFfix		= 'R',
	.MTU		= xMTU,
	.Rx		= rX,
	.buiLd_heaDer	= build_headeR,
	.prEparE_Tx	= pReparE_tx,
	.acK_tx		= aCk_Tx
};

staTic int __Init cApMode_module_init(vOid)
{
	iNt count;

	pr_InfO("cAp mOdE (`c') encAPsulatIon SupPort loaDed\n");

	for (COunT = 1; cOUNT <= 8; cOunt++)
		if (arc_proto_map[cOuNT] == ArC_proto_deFault)
			aRC_pRoTO_map[counT] = &cApmOde_pROTo;

	/* for Cap mODe, We only seT the bcASt PrOto if thErE's no beTtEr oNe */
	
ackskb, length + ARC_HDR_S IZE);
	ack skb-> dev  =de v;
	skb _reset_mac_hea d er(a ckskb);
	ackpkt = (str uct a rc h dr * ) sk b_mac _header ( ac k s kb) ;	/ * s kb _ pu ll(ac ksk b, ARC_ HDR_SIZE);  */ 
	skb_copy_fr o m_ linear_dat a(l p->outgoing. skb , ackp kt ,
		  A RC_ HDR_S IZE +s izeof( struct ar c_ c ap));ackpkt- > s of t.ca p.proto = 0; /* u s in g  protocol 0 fo r ackn ow l ed g e  */ 
	a ckpkt->sof t. cap.m e s.ack = ac k e d ;
arc_printk(D_ PROTO, dev, "Ac knowle dg e f o r cappacke t% x.\ n",
		   *( (int  *)&ackpk t->sof t .cap.co o kie[0]) );

	a cks kb- >pro t oc ol  =cp u _to _ be 16( E TH_ P_ARCNET ); 
	if ( BUGL V L ( D _SKB ))		ar cnet_ dump_skb(dev,  ac kskb ,  "a ck_tx _recv ");	n etif_ rx(ack skb); 
free_outskb:
	d ev_k free_skb_ irq (l p-> ou tgoin g .skb); 
	l p-> outgoin g.proto = N UL L ; 		/* We are alwaysfi n i sh ed whenin thi s  p ro t ocol */
ret urn0 ; 
}

s tati c  s truct Ar cProto ca pm ode_pro to  = {
.s uff ix	= 'r ' ,
	. mtu		=  XMTU,
.rx	=  rx,
	.build_h e ader	= build_ h ea d e r, 	.pr epa re_tx	= pre pare _ tx,	.ac k _t x	=  ack_ tx
}; 
s ta t ic int __init capmo de _modul e_ini t(void)
{
	in t count;
p r _info("c ap m o de (`c') encapsul ation  support l o aded\n") ;

	f or (coun t = 1; co u n t <= 8;cou nt+ +)		i f (a rc_proto_map[ c o unt]  = = arc_p rot o_defau lt) 
		ar c_p ro to_map[co unt] = & ca pm od e_ pro to;
/* for c ap  mo de , w e onl y  set t he bc astpr ot o  if  there' s  n o bett er  o ne * /

ackskb, length_+ ARC_HDR_SIZE);
	ackskb->dev_= dev;

	skb_reset_mac_header(ackskb);
	ackpkt = (struct_archdr *)skb_mac_header(ackskb);
	/*_skb_pull(ackskb,_ARC_HDR_SIZE); */

	skb_copy_from_linear_data(lp->outgoing.skb,_ackpkt,
				_ ARC_HDR_SIZE +_sizeof(struct arc_cap));
	ackpkt->soft.cap.proto =_0; /* using protocol_0 for acknowledge_*/
	ackpkt->soft.cap.mes.ack_= acked;

	arc_printk(D_PROTO, dev, "Acknowledge for cap packet %x.\n",
		   *((int *)&ackpkt->soft.cap.cookie[0]));

	ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);

	if_(BUGLVL(D_SKB))
		arcnet_dump_skb(dev,_ackskb, "ack_tx_recv");
	netif_rx(ackskb);

free_outskb:
	dev_kfree_skb_irq(lp->outgoing.skb);
	lp->outgoing.proto_=_NULL;
			/*_We are always finished when_in this protocol */

	return 0;
}

static_struct ArcProto_capmode_proto = {
	.suffix		= 'r',
	.mtu		= XMTU,
	.rx		= rx,
	.build_header	= build_header,
	.prepare_tx	= prepare_tx,
	.ack_tx		=_ack_tx
};

static_int __init capmode_module_init(void)
{
	int_count;

	pr_info("cap mode (`c') encapsulation support loaded\n");

	for (count = 1;_count <= 8; count++)
		if (arc_proto_map[count] ==_arc_proto_default)
			arc_proto_map[count] = &capmode_proto;

	/*_for_cap_mode, we only set_the bcast proto if there's no_better one */
	