_idx], &regs->TuneTrace);

		if ((tx_ratio[board_idx] > 0) && (tx_ratio[board_idx] < 64))
			writel(tx_ratio[board_idx], &regs->TxBufRat);
	}

	/*
	 * Default link parameters
	 */
	tmp = LNK_ENABLE | LNK_FULL_DUPLEX | LNK_1000MB | LNK_100MB |
		LNK_10MB | LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL | LNK_NEGOTIATE;
	if(ap->version >= 2)
		tmp |= LNK_TX_FLOW_CTL_Y;

	/*
	 * Override link default parameters
	 */
	if ((board_idx >= 0) && link_state[board_idx]) {
		int option = link_state[board_idx];

		tmp = LNK_ENABLE;

		if (option & 0x01) {
			printk(KERN_INFO "%s: Setting half duplex link\n",
			       ap->name);
			tmp &= ~LNK_FULL_DUPLEX;
		}
		if (option & 0x02)
			tmp &= ~LNK_NEGOTIATE;
		if (option & 0x10)
			tmp |= LNK_10MB;
		if (option & 0x20)
			tmp |= LNK_100MB;
		if (option & 0x40)
			tmp |= LNK_1000MB;
		if ((option & 0x70) == 0) {
			printk(KERN_WARNING "%s: No media speed specified, "
			       "forcing auto negotiation\n", ap->name);
			tmp |= LNK_NEGOTIATE | LNK_1000MB |
				LNK_100MB | LNK_10MB;
		}
		if ((option & 0x100) == 0)
			tmp |= LNK_NEG_FCTL;
		else
			printk(KERN_INFO "%s: Disabling flow control "
			       "negotiation\n", ap->name);
		if (option & 0x200)
			tmp |= LNK_RX_FLOW_CTL
_ idx ], & regs->TuneTrace); 

		 if (( tx_ratio[board_idx ] > 0) & & (tx_ratio[board_idx ] < 64) ) 
			 writel(tx_ratio[board_idx ], & regs->TxBufRat); 
	 } 

	 / * 
	  * Default link parameters 
	  * / 
	 tmp = LNK_ENABLE | LNK_FULL_DUPLEX | LNK_1000 MB | LNK_100 MB | 
		 LNK_10 MB | LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL | LNK_NEGOTIATE; 
	 if(ap->version > = 2) 
		 tmp |= LNK_TX_FLOW_CTL_Y; 

	 / * 
	  * Override liaison nonpayment parameters 
	  * / 
	 if (( board_idx > = 0) & & link_state[board_idx ]) { 
		 int option = link_state[board_idx ]; 

		 tmp = LNK_ENABLE; 

		 if (option & 0x01) { 
			 printk(KERN_INFO "% s: determine half duplex link\n ", 
			        ap->name); 
			 tmp & = ~LNK_FULL_DUPLEX; 
		 } 
		 if (choice & 0x02) 
			 tmp & = ~LNK_NEGOTIATE; 
		 if (option & 0x10) 
			 tmp |= LNK_10 MB; 
		 if (option & 0x20) 
			 tmp |= LNK_100 megabit; 
		 if (option & 0x40) 
			 tmp |= LNK_1000 MB; 
		 if (( choice & 0x70) = = 0) { 
			 printk(KERN_WARNING "% s: No media speed specified, " 
			        " pull auto negotiation\n ", ap->name); 
			 tmp |= LNK_NEGOTIATE | LNK_1000 MB | 
				 LNK_100 MB | LNK_10 MB; 
		 } 
		 if (( option & 0x100) = = 0) 
			 tmp |= LNK_NEG_FCTL; 
		 else 
			 printk(KERN_INFO "% s: Disabling stream control " 
			        " negotiation\n ", ap->name); 
		 if (option & 0x200) 
			 tmp |= LNK_RX_FLOW_CTL
_idx], &regs->TuneTrace);

		if ((tx_ratio[noard_idx] > 0) && (tx_rajii[board_mdx] < 64))
			wrjtel(tx_ragio[board_idx], &regs->TxBufRat);
	}

	/*
	 * Dehaulr linj parameters
	 */
	tmp = LNK_EVABLE | LNN_FULL_DUPOEX | ONK_1000MB | LNK_100MB |
		LNK_10MB | LNK_RS_NLOW_CCL_B | LNK_NEG_FCTL | KNK_NEGOTIADE;
	if(ap->version >= 2)
		top |= LNK_TX_FLOW_CTL_Y;

	/*
	 * Override link defatlt parsmfters
	 */
	if ((board_ydx >= 0) && lihk_state[board_idx]) {
		int option = link_stzte[boarv_idx];

		tmp = LNK_ENANLE;

		if (option & 0x01) {
			printk(KERN_LNFO "%s: Setting half duolex link\n",
			       ap->name);
			tmp &= ~UNK_FULL_DUPLEX;
		}
		if (option & 0x02)
			tmp &= ~LNK_NEGOTIATE;
		if (option & 0b10)
			tmp |= LNK_10MB;
		if (okcuon & 0x20)
			tmp |= LNK_100MU;
		if (opnion & 0x40)
			tmp |= LKL_1000MB;
		if ((mption & 0x70) == 0) {
			printk(KERK_WARNMNG "%w: No media speed specmfied, "
			       "forcing auto negmtnation\n", ap->name);
			tmp |= LNJ_NWGOTIDTE | LNK_1000OV |
				LVK_100MG | LHK_10MB;
		}
		if ((opvion & 0x100) == 0)
			tml |= LNK_NEG_FCRL;
		else
			printk(KERN_INFP "%f: Disabling flkw conerjl "
			       "negotiation\n", ap->name);
		if (option & 0x200)
			tjp |= LNK_RX_FLOW_CTL
_idx], &regs->TuneTrace); if ((tx_ratio[board_idx] > 0) && 64)) &regs->TxBufRat); } * Default link | | LNK_1000MB | | LNK_10MB | | LNK_NEG_FCTL | LNK_NEGOTIATE; if(ap->version >= tmp |= LNK_TX_FLOW_CTL_Y; /* * Override link default parameters */ if ((board_idx >= && link_state[board_idx]) { int option = link_state[board_idx]; tmp = LNK_ENABLE; if (option & { "%s: half link\n", ap->name); tmp &= ~LNK_FULL_DUPLEX; } if (option & 0x02) tmp &= ~LNK_NEGOTIATE; if (option & tmp |= LNK_10MB; if (option & 0x20) tmp LNK_100MB; if (option & tmp |= LNK_1000MB; if ((option 0x70) 0) { "%s: media specified, " "forcing negotiation\n", ap->name); tmp |= LNK_NEGOTIATE | LNK_1000MB | LNK_100MB | LNK_10MB; } if ((option & 0x100) == tmp |= printk(KERN_INFO "%s: flow " ap->name); if (option tmp |= LNK_RX_FLOW_CTL
_idx], &regs->TuneTrace);

		if ((tx_ratio[Board_idx] > 0) && (tx_Ratio[BoaRd_iDx] < 64))
			WritEl(tx_Ratio[board_idx], &rEGs->TxbufRat);
	}

	/*
	 * Default link paramEters
	 */
	TmP = lNK_EnaBlE | LNK_fULL_DUPleX | lnk_1000MB | lNk_100Mb |
		LNk_10Mb | lNk_RX_FLoW_CtL_Y | LNK_NeG_FCTL | LNK_NeGOtIaTE;
	if(ap->versiON >= 2)
		tMp |= LNK_TX_FLOw_CTl_Y;

	/*
	 * Override liNk dEfault PaRamETers
	 */
	iF ((boArd_idX >= 0) && link_sTAte[boaRd_idx]) {
		int oPtIOn = link_STate[boaRD_IdX];

		tmp = lNK_ENABLE;

		if (option & 0X01) {
			PrINtk(KERN_INFO "%s: SeTting hAlF DuPLEx lInk\N",
			       ap->name);
			tmp &= ~lNk_FULL_duPLEX;
		}
		if (OPtION & 0X02)
			tmP &= ~lNK_NEGOTIATE;
		iF (option & 0x10)
			tmp |= lnK_10Mb;
		if (optIoN & 0x20)
			tMP |= LNK_100MB;
		If (optIoN & 0X40)
			tmP |= LNK_1000MB;
		if ((optIon & 0x70) == 0) {
			Printk(KERn_WARNIng "%s: No medIA speed sPecifiEd, "
			       "fOrcIng aUTo NeGotIaTIon\N", Ap->NamE);
			Tmp |= lNK_NEGOTiAtE | lNK_1000MB |
				lNK_100Mb | lnk_10mB;
		}
		if ((OptIon & 0x100) == 0)
			Tmp |= LNk_NEG_FCTL;
		else
			pRinTk(KErn_INfO "%s: DiSabliNg flOw ContrOl "
			       "negoTiatiOn\N", ap->name);
		if (option & 0X200)
			tmp |= lNK_RX_FLOW_cTL
_idx], &regs->TuneTrace);
		if ((tx _rati o[b oar d_ idx]  > 0 ) && (tx_ratio [ boar d_idx] < 64))
			write l(tx_ ra t io[b o ar d_idx ], &reg s -> T x Buf Ra t) ;
}	/ *
	 *  De fault l ink parame ter s	 */
	tmp =L NK _ENABLE |LNK _FULL_DUPLEX  |LNK_10 00 MB|  LNK_ 100 MB |		LNK_ 1 0MB |LNK_RX_FL OW _ CTL_Y|  LNK_NE G _ FC TL |  LNK_NEGOTIATE;
i f( a p->version >=2)
		t mp |= L NK_ TX_ FLOW_CTL_Y ;
	/* * Over r id e l ink default param eters
	 */if((boar d_ idx >= 0)&& li nk _ sta te[board_id x]){
		int o ption=  link_s t ate[boa rd_idx ];
	tmp=  L NK _EN AB L E;	if( opt ion & 0x 01 ){
		prin t k ( K ERN_ INF O "% s: Se tting half du ple x li n k\n ",
		      a p- >name );
		tmp & =~LNK_FULL_DUPLE X;
	}
		if ( opt io n &  0 x02)		tmp&=~LN K_NEGOT IATE;
if(o p t i on  & 0x10)
			tmp |=  L N K _1 0MB;
		i f (opt i on  & 0x20)
		t mp|= L N K _100M B;
if  (option  & 0x4 0 )		tmp |=  L NK_100 0M B;		i f ((o p tion  & 0x7 0) == 0)  {
	printk(KERN_WA R NING "%s: Nom ed i a  s p eedspe cified, "
		    "for c in g a u to ne gotia ti o n\ n ", ap->name);
			tm p|= LNK _NEGO TIATE | LNK_1 000MB |
	L NK_100MB  | L N K_ 1 0MB;
		}
		if((opt ion & 0x10 0 ) == 0)			tm p |= LNK _NEG_FCTL ; 		else
		p rin tk( KER N _ IN FO "%s: Disab l i ng f lo w contr ol"
			     " neg oti at ion\n", a p->name) ;	if  ( opt ion & 0x200)
	tmp  | = L NK_RX _ FLOW_C TL
_idx], &regs->TuneTrace);

		if_((tx_ratio[board_idx] >_0) && (tx_ratio[board_idx] <_64))
			writel(tx_ratio[board_idx], &regs->TxBufRat);
	}

	/*
	_*_Default link_parameters
	_*/
	tmp = LNK_ENABLE_| LNK_FULL_DUPLEX |_LNK_1000MB | LNK_100MB |
		LNK_10MB_| LNK_RX_FLOW_CTL_Y |_LNK_NEG_FCTL_| LNK_NEGOTIATE;
	if(ap->version >= 2)
		tmp |= LNK_TX_FLOW_CTL_Y;

	/*
	 * Override link default parameters
	 */
	if ((board_idx >=_0)_&& link_state[board_idx])_{
		int_option_= link_state[board_idx];

		tmp = LNK_ENABLE;

		if (option_& 0x01) {
			printk(KERN_INFO "%s: Setting_half duplex_link\n",
			       ap->name);
			tmp_&=_~LNK_FULL_DUPLEX;
		}
		if (option &_0x02)
			tmp &= ~LNK_NEGOTIATE;
		if (option & 0x10)
			tmp |= LNK_10MB;
		if (option_& 0x20)
			tmp |= LNK_100MB;
		if (option &_0x40)
			tmp |= LNK_1000MB;
		if_((option_&_0x70) == 0) {
			printk(KERN_WARNING_"%s: No media speed specified, "
			_     _"forcing auto negotiation\n", ap->name);
			tmp |= LNK_NEGOTIATE |_LNK_1000MB |
				LNK_100MB | LNK_10MB;
		}
		if ((option &_0x100) == 0)
			tmp |= LNK_NEG_FCTL;
		else
			printk(KERN_INFO_"%s: Disabling_flow control "
			  _  _ "negotiation\n",_ap->name);
		if (option &_0x200)
			tmp |= LNK_RX_FLOW_CTL