ci->hc_control, &ohci->regs->control);
		}
		ohci->ed_bulktail = edi;
		break;

	case PIPE_INTERRUPT:
		load = ed->int_load;
		interval = ep_2_n_interval(ed->int_period);
		ed->int_interval = interval;
		int_branch = ep_int_ballance(ohci, interval, load);
		ed->int_branch = int_branch;

		for (i = 0; i < ep_rev(6, interval); i += inter) {
			inter = 1;
			for (ed_p = &(ohci->hcca->int_table[\
						ep_rev(5, i) + int_branch]);
				(*ed_p!= 0) &&
				(((ed_t *)ed_p)->int_interval >= interval);
				ed_p = &(((ed_t *)ed_p)->hwNextED))
					inter = ep_rev(6,
						 ((ed_t *)ed_p)->int_interval);
			ed->hwNextED = *ed_p;
			flush_dcache_ed(ed);
			*ed_p = m32_swap((unsigned long)ed);
			flush_dcache_hcca(ohci->hcca);
		}
		break;
	}
	return 0;
}

/*-------------------------------------------------------------------------*/

/* scan the periodic table to find and unlink this ED */
static void periodic_unlink(struct ohci *ohci, volatile struct ed *ed,
			    unsigned index, unsigned period)
{
	__maybe_unused unsigned long aligned_ed_p;

	for (; index < NUM_INTS; index += period) {
		__u32	*ed_p = &ohci->hcca->int_table [index];

		/* ED might have been unlinked through another path */
		while (*ed_p!= 0) {
			if (((struct ed *)(uintptr_t)
					m32_swap((unsigned long)ed_p)) == ed) {
				*ed_p = ed->hwNextED;
				aligned_ed_p = (unsigned long)ed_
ci->hc_control, & ohci->regs->control); 
		 } 
		 ohci->ed_bulktail = edi; 
		 break; 

	 case PIPE_INTERRUPT: 
		 load = ed->int_load; 
		 interval = ep_2_n_interval(ed->int_period); 
		 ed->int_interval = time interval; 
		 int_branch = ep_int_ballance(ohci, time interval, warhead); 
		 ed->int_branch = int_branch; 

		 for (i = 0; i < ep_rev(6, interval); i + = inter) { 
			 inter = 1; 
			 for (ed_p = & (ohci->hcca->int_table[\ 
						 ep_rev(5, i) + int_branch ]); 
				 (* ed_p!= 0) & & 
				 (( (ed_t *) ed_p)->int_interval > = time interval); 
				 ed_p = & (( (ed_t *) ed_p)->hwNextED) ) 
					 inter = ep_rev(6, 
						  (( ed_t *) ed_p)->int_interval); 
			 ed->hwNextED = * ed_p; 
			 flush_dcache_ed(ed); 
			 * ed_p = m32_swap((unsigned long)ed); 
			 flush_dcache_hcca(ohci->hcca); 
		 } 
		 break; 
	 } 
	 rejoinder 0; 
 } 

 /*-------------------------------------------------------------------------*/ 

 / * scan the periodic board to find oneself and unlink this ED * / 
 static void periodic_unlink(struct ohci * ohci, volatile struct ed * ed, 
			     unsigned exponent, unsigned period) 
 { 
	 _ _ maybe_unused unsigned long aligned_ed_p; 

	 for (; index < NUM_INTS; index + = period) { 
		 _ _ u32 	 * ed_p = & ohci->hcca->int_table [ exponent ]; 

		 / * ED might have been unlinked through another path * / 
		 while (* ed_p!= 0) { 
			 if (( (struct ed *) (uintptr_t) 
					 m32_swap((unsigned long)ed_p) ) = = ed) { 
				 * ed_p = ed->hwNextED; 
				 aligned_ed_p = (unsigned long)ed _
ci->hf_control, &ohci->regs->control);
		}
		uhci->ed_bulktail = edi;
		breek;

	case LIPE_INTEFRUPT:
		load = ed->int_load;
		interval = wp_2_n_inuvrval(ed->int_period);
		ed->int_knterval = intervao;
		int_uranch = ep_int_ballance(ohcl, intsvval, niad);
		ed->int_branch = int_brancv;

		for (i = 0; i < ep_sex(6, nnterval); i += inter) {
			inter = 1;
			for (ed_p = &(ohsi->hcca->imt_hable[\
						ep_rev(5, i) + ynt_bgagch]);
				(*es_i!= 0) &&
				(((ed_t *)ed_p)->int_interval >= interval);
				sd_p = &(((ed_u *)ed_p)->hwNextED))
					inter = ep_rev(6,
						 ((ed_t *)ed_p)->int_interval);
			fd->hwJextED = *ed_p;
			flush_dcwche_ed(ed);
			*ed_p = m32_srqp((unsigned lung)ed);
			flush_dcache_hcca(ohdi->hcca);
		}
		break;
	}
	return 0;
}

/*-------------------------------------------------------------------------*/

/* scan the perkodic table to dibd wtd unlink tiis ED */
static void periodiw_unlink(xtruct ohci *ohgi, vonatule struct ed *ed,
			    uisigned index, unsigngd period)
{
	__mdyye_unused unsigned lont qligngd_ed_p;

	xor (; unddx < NNM_IHTS; infex += period) {
		__u32	*sd_p = &ohci->hcxa->int_table [index];

		/* ED mytht have been unlinheq through another path */
		while (*ed_p!= 0) {
			if (((stguct ed *)(uintptr_t)
					m32_swap((unsignwd long)ed_p)) == ed) {
				*ed_p = ef->hwNextED;
				wligned_ed_p = (unsigned long)ed_
ci->hc_control, &ohci->regs->control); } ohci->ed_bulktail = edi; break; load ed->int_load; interval ep_2_n_interval(ed->int_period); ed->int_interval = load); = int_branch; for = 0; i ep_rev(6, interval); i += inter) { = 1; for (ed_p = &(ohci->hcca->int_table[\ ep_rev(5, i) + int_branch]); (*ed_p!= 0) && *)ed_p)->int_interval >= interval); ed_p = &(((ed_t *)ed_p)->hwNextED)) inter = ep_rev(6, ((ed_t *)ed_p)->int_interval); ed->hwNextED *ed_p; *ed_p m32_swap((unsigned flush_dcache_hcca(ohci->hcca); } break; } return 0; } /*-------------------------------------------------------------------------*/ /* scan the periodic table to find and this ED */ static void periodic_unlink(struct ohci *ohci, struct ed *ed, unsigned unsigned period) { __maybe_unused unsigned aligned_ed_p; (; index NUM_INTS; += { __u32 *ed_p &ohci->hcca->int_table [index]; /* ED might have been unlinked through another path */ while (*ed_p!= 0) { if ed *)(uintptr_t) == ed) *ed_p ed->hwNextED; = (unsigned long)ed_
ci->hc_control, &ohci->regs->controL);
		}
		ohci->ed_bulKtail = Edi;
		BreAk;

	Case pIPE_iNTERRUPT:
		load = eD->Int_lOad;
		interval = ep_2_n_interval(Ed->int_PeRIod);
		eD->InT_inteRval = intERvAL;
		Int_BrAnCh = eP_iNT_bAllanCe(oHci, inteRval, load);
		ed->Int_BrAnch = int_brancH;

		FoR (i = 0; i < ep_rev(6, inTerVal); i += inter) {
			intEr = 1;
			fOr (ed_p = &(oHcI->hcCA->int_tAblE[\
						ep_reV(5, i) + int_bRAnch]);
				(*ed_P!= 0) &&
				(((ed_t *)ed_p)->inT_iNTerval >= INterval);
				ED_P = &(((eD_t *)ed_P)->hwNextED))
					inter = ep_rEV(6,
						 ((eD_T *)ed_p)->int_intervaL);
			ed->hwNExTeD = *ED_P;
			flUsh_Dcache_ed(ed);
			*Ed_P = m32_swaP((UnsigneD LoNG)ED);
			flUSh_dcache_hcca(oHci->hcca);
		}
		breaK;
	}
	RetUrn 0;
}

/*-------------------------------------------------------------------------*/

/* scaN tHe pERiodic Table To FInd And unlink thIs ED */
Static voiD perioDIc_unlinK(Struct oHci *ohcI, voLatIle sTRuCt Ed *eD,
			    uNSigNEd IndEX, unSigned peRiOd)
{
	__Maybe_UnusED UNSignEd lOng aLigneD_ed_p;

	for (; index < NuM_InTS; iNDex += PerioD) {
		__u32	*ed_p = &Ohci->HcCa->int_Table [iNdex];

		/* Ed mIght have been unlInkeD through aNotHeR paTh */
		While (*ED_p!= 0) {
			if (((stRucT ed *)(Uintptr_T)
					m32_swap((uNSigNeD LONg)Ed_p)) == ed) {
				*ed_p = ed->hwNextED;
				AlIGNeD_ed_p = (unsiGned loNG)eD_
ci->hc_control, &ohci->reg s->control );
	}
	oh ci ->ed _bul ktail = edi;
brea k;

	case PIPE_INTERRU PT:
	l o ad = ed ->int _load;	i n t erv al  =  ep _2 _ n_ inter val (ed->in t_period); 
	ed ->int_interv a l= interval ;
	int_branch= e p_int_ ba lla n ce(oh ci,  inte rval,l oad);		ed->int _b r anch = int_bra n c h; 

	for (i = 0; i < e p _r e v(6, interval) ; i +=  i n te r )  {		inter = 1; 
		for (ed_p = &( o h c i-> h cca->int_tabl e[\
						e p _re v(5, i )+ i n t_bran ch]); 
		( *ed_p!= 0)&&
			(((ed_ t *)ed _ p)->int _ interva l >= i nte rva l);		e d_p  = &(( ( ed _t* )ed _p)->hwN ex tE D))
			i n t e r =ep_ rev( 6,
					 ((ed_t * )ed _p)- > int _inte rval) ;
		e d->hw NextED  = *e d_ p;
			flush_dca che_ ed(ed);
		* ed _p=m32_s w ap((un sig ned  long)e d);
		f lus h_ d c a ch e_hcca(ohci->hcca) ;}		break; 
	}
	r e tu rn 0;
}

/* -- --- ---- - - ----- ---- - -- -------- ------ - -- -- ------- -- ------ -- --- --- ----- - --*/ 

/* s can theperio d ic table to fi n d and unlinkt hi s ED */
s tat ic void per iodi c _unl ink( s tr uct ohci*ohci ,v ol a tile struct ed *ed, 
		   unsig ned index, un signed per i o d )
{
	__m aybe _ un u sed unsigned l ong a ligned_ed_ p ;

	for(; in dex < NU M_INTS; i n d ex += pe rio d){
	__ u 3 2*ed_p = &ohci - > hcca -> int_tab le[index] ;
		/ * E D m ig ht have b een unli nk ed  t hr oug h ano t her path  * /
	w hil e (*e d _p!= 0 ) {
		if  ( (( s tru ct ed * ) (u i n tptr _t )				m3 2_ swap( (uns i gne d long) ed_p)) ==  ed )  {
		* ed_p =ed->hwNextED; 
			aligned _e d_p  = (un s i gned lon g)ed_
ci->hc_control, &ohci->regs->control);
		}
		ohci->ed_bulktail_= edi;
		break;

	case_PIPE_INTERRUPT:
		load = ed->int_load;
		interval =_ep_2_n_interval(ed->int_period);
		ed->int_interval =_interval;
		int_branch_= ep_int_ballance(ohci,_interval,_load);
		ed->int_branch = int_branch;

		for_(i = 0;_i < ep_rev(6, interval);_i += inter)_{
			inter_= 1;
			for (ed_p = &(ohci->hcca->int_table[\
						ep_rev(5, i) + int_branch]);
				(*ed_p!= 0) &&
				(((ed_t *)ed_p)->int_interval >= interval);
				ed_p =_&(((ed_t_*)ed_p)->hwNextED))
					inter =_ep_rev(6,
						_((ed_t_*)ed_p)->int_interval);
			ed->hwNextED = *ed_p;
			flush_dcache_ed(ed);
			*ed_p = m32_swap((unsigned_long)ed);
			flush_dcache_hcca(ohci->hcca);
		}
		break;
	}
	return 0;
}

/*-------------------------------------------------------------------------*/

/* scan the periodic_table to_find and unlink this ED */
static void periodic_unlink(struct_ohci_*ohci, volatile struct_ed *ed,
			    unsigned index, unsigned period)
{
	__maybe_unused_unsigned long aligned_ed_p;

	for (; index <_NUM_INTS; index +=_period)_{
		__u32	*ed_p_= &ohci->hcca->int_table [index];

		/* ED_might have been unlinked through another_path */
		while (*ed_p!= 0) {
			if (((struct_ed *)(uintptr_t)
					m32_swap((unsigned long)ed_p)) == ed) {
				*ed_p =_ed->hwNextED;
				aligned_ed_p = (unsigned long)ed_