FreeBSD/sys/dev/otus/if_otus.c
/*
 * Map net80211 rate to hw rate for otus MAC/PHY.
 */
Map net80211 rate to hw rate for otus MAC/PHY.
Map net80211 rate to hw rate for otus MAC / PHY .
static uint8_t
otus_rate_to_hw_rate(struct otus_softc *sc, uint8_t rate)
{
	int is_2ghz;
	is_2ghz = !! (IEEE80211_IS_CHAN_2GHZ(sc->sc_ic.ic_curchan));
	switch (rate) {
	case 2:
		return (0x0);
	case 4:
		return (0x1);
	case 11:
		return (0x2);
	case 22:
		return (0x3);
	case 12:
		return (0xb);
	case 18:
		return (0xf);
	case 24:
		return (0xa);
	case 36:
		return (0xe);
	case 48:
		return (0x9);
	case 72:
		return (0xd);
	case 96:
		return (0x8);
	case 108:
		return (0xc);
	default:
		device_printf(sc->sc_dev, "%s: unknown rate '%d'\n",
		    __func__, (int) rate);
	case 0:
		if (is_2ghz)
			return (0x0);	
		else
			return (0xb);	
	}
}
static uint8_t otus_rate_to_hw_rate ( struct otus_softc * sc , uint8_t rate ) { int is_2ghz ; is_2ghz = ! ! ( IEEE80211_IS_CHAN_2GHZ ( sc -> sc_ic . ic_curchan ) ) ; switch ( rate ) { case 2 : return ( 0x0 ) ; case 4 : return ( 0x1 ) ; case 11 : return ( 0x2 ) ; case 22 : return ( 0x3 ) ; case 12 : return ( 0xb ) ; case 18 : return ( 0xf ) ; case 24 : return ( 0xa ) ; case 36 : return ( 0xe ) ; case 48 : return ( 0x9 ) ; case 72 : return ( 0xd ) ; case 96 : return ( 0x8 ) ; case 108 : return ( 0xc ) ; default : device_printf ( sc -> sc_dev , " \n " , __func__ , ( int ) rate ) ; case 0 : if ( is_2ghz ) return ( 0x0 ) ; else return ( 0xb ) ; } }
Map net80211 rate to hw rate for otus MAC/PHY.
Map net80211 rate to hw rate for otus MAC / PHY .
/* CCK */ /* OFDM */ /* 1MB CCK */ /* 6MB OFDM */ /* XXX TODO: HT */