new sk driver [was: nve timeout (and down) regression?]

Ganbold ganbold at micom.mng.net
Mon May 8 06:14:09 UTC 2006


Pyun,

I can not apply the patch cleanly on 
http://people.freebsd.org/~yongari/sk/sk_test2/if_sk.c
What version of sk driver should I use?

Ganbold


Pyun YongHyeon wrote:
> On Mon, May 08, 2006 at 02:25:48PM +0900, Ganbold wrote:
>  > Pyun YongHyeon wrote:
>  > >On Mon, May 08, 2006 at 01:15:54PM +0900, Ganbold wrote:
>  > > > Pyun,
>  > > > 
>  > > > ...
>  > > > Is this NIC supported by if_sk driver?
>  > > > 
>  > >
>  > >Hmm, It seems that the NIC is SysKonnect V2.0(SK98XX2) which is
>  > >supposed to work with sk(4). Did it ever work with sk(4)?
>  > >  
>  > No, it is new server and it came with such additional NIC.
>  > >I see there is differences between sk(4) and Linux skge driver 
>  > >in determining physical media type. It seems OpenBSD also
>  > >used Linux skge approach.
>  > >  
>  > I'll try to take a look at linux/openbsd drivers.
>  > 
>
> How about attached one? It's not tested but it may help your
> situation.
>
>  > Ganbold
>  > > > thanks,
>  > > > 
>  > > > Ganbold
>  > > > 
>  > >
>  > >  
>  > 
>
>   
> ------------------------------------------------------------------------
>
> --- if_sk.c.orig	Thu May  4 10:27:39 2006
> +++ if_sk.c	Mon May  8 14:48:33 2006
> @@ -1604,14 +1604,15 @@
>  		}
>  	} else {
>  		if (sc_if->sk_phytype < SK_PHYTYPE_MARV_COPPER &&
> -		    sc->sk_pmd == IFM_1000_T) {
> +		    sc->sk_pmd != 'S') {
>  			/* not initialized, punt */
>  			sc_if->sk_phytype = SK_PHYTYPE_MARV_COPPER;
> +			sc->sk_coppertype = 1;
>  		}
>  
>  		sc_if->sk_phyaddr = SK_PHYADDR_MARV;
>  
> -		if (sc->sk_pmd != IFM_1000_T && sc->sk_pmd != IFM_1000_CX)
> +		if (!(sc->sk_coppertype))
>  			sc_if->sk_phytype = SK_PHYTYPE_MARV_FIBER;
>  	}
>  
> @@ -1788,31 +1789,12 @@
>  	}
>  
>  	/* Read and save physical media type */
> -	switch(sk_win_read_1(sc, SK_PMDTYPE)) {
> -	case SK_PMD_1000BASESX:
> -		sc->sk_pmd = IFM_1000_SX;
> -		break;
> -	case SK_PMD_1000BASELX:
> -		sc->sk_pmd = IFM_1000_LX;
> -		break;
> -	case SK_PMD_1000BASECX:
> -		sc->sk_pmd = IFM_1000_CX;
> -		break;
> -	case SK_PMD_1000BASETX:
> -		sc->sk_pmd = IFM_1000_T;
> -		break;
> -	default:
> -		if (SK_YUKON_FAMILY(sc->sk_type) && (sk_win_read_1(sc, SK_EPROM1) 
> -		    & 0xF) < SK_PHYTYPE_MARV_COPPER) {
> -			/* not initialized, punt */
> -			sc->sk_pmd = IFM_1000_T;
> -			break;
> -		}
> -		device_printf(dev, "unknown media type: 0x%x\n",
> -		    sk_win_read_1(sc, SK_PMDTYPE));
> -		error = ENXIO;
> -		goto fail;
> -	}
> +	 sc->sk_pmd = sk_win_read_1(sc, SK_PMDTYPE);
> +
> +	 if (sc->sk_pmd == 'T' || sc->sk_pmd == '1')
> +		 sc->sk_coppertype = 1;
> +	 else
> +		 sc->sk_coppertype = 0;
>  
>  	/* Determine whether to name it with VPD PN or just make it up.
>  	 * Marvell Yukon VPD PN seems to freqently be bogus. */
> @@ -3722,17 +3704,10 @@
>  	phy = SK_GPHY_INT_POL_HI | SK_GPHY_DIS_FC | SK_GPHY_DIS_SLEEP |
>  		SK_GPHY_ENA_XC | SK_GPHY_ANEG_ALL | SK_GPHY_ENA_PAUSE;
>  
> -	switch(sc_if->sk_softc->sk_pmd) {
> -	case IFM_1000_SX:
> -	case IFM_1000_LX:
> -		phy |= SK_GPHY_FIBER;
> -		break;
> -
> -	case IFM_1000_CX:
> -	case IFM_1000_T:
> +	if (sc->sk_coppertype)
>  		phy |= SK_GPHY_COPPER;
> -		break;
> -	}
> +	else
> +		phy |= SK_GPHY_FIBER;
>  
>  	SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, phy | SK_GPHY_RESET_SET);
>  	DELAY(1000);
> --- if_skreg.h.orig	Tue May  2 11:12:42 2006
> +++ if_skreg.h	Mon May  8 14:48:33 2006
> @@ -1535,6 +1535,7 @@
>  	u_int32_t		sk_rboff;	/* RAMbuffer offset */
>  	u_int32_t		sk_ramsize;	/* amount of RAM on NIC */
>  	u_int32_t		sk_pmd;		/* physical media type */
> +	u_int32_t		sk_coppertype;
>  	u_int32_t		sk_intrmask;
>  	int			sk_int_mod;
>  	int			sk_int_ticks;
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> freebsd-stable at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"



More information about the freebsd-stable mailing list