MFP4 27224 and 27225:

Change 27224 by imp@imp_hammer on 2003/03/22 00:16:22
	Put what I think are the correct TX RATE translation tables
	in place for LUCENT firmware.  This is based on the 4.x driver.
	Maybe it should be table driven?

	ifconfig wi0 media DS/11Mbps still fails, but it fails before
	we even get to the txrate stuff, so other things are wrong.

Change 27225 by imp@imp_hammer on 2003/03/22 00:45:11
	Default ic_fixed_rate to -1.  This is the same thing as autoselect.
	There really should be a #define for this...
This commit is contained in:
Warner Losh 2003-03-22 15:39:38 +00:00
parent 667b217aa3
commit fb9e391927

View File

@ -312,6 +312,7 @@ wi_attach(device_t dev)
ic->ic_flags = IEEE80211_F_HASPMGT | IEEE80211_F_HASAHDEMO;
ic->ic_state = IEEE80211_S_INIT;
ic->ic_newstate = wi_newstate;
ic->ic_fixed_rate = -1; /* Auto */
/* Find available channels */
buflen = sizeof(val);
@ -1238,8 +1239,10 @@ wi_media_status(struct ifnet *ifp, struct ifmediareq *imr)
/* convert to 802.11 rate */
rate = val * 2;
if (sc->sc_firmware_type == WI_LUCENT) {
if (rate == 10)
if (rate == 4 * 2)
rate = 11; /* 5.5Mbps */
else if (rate == 5 * 2)
rate = 22; /* 11Mbps */
} else {
if (rate == 4*2)
rate = 11; /* 5.5Mbps */
@ -2005,8 +2008,20 @@ wi_write_txrate(struct wi_softc *sc)
switch (sc->sc_firmware_type) {
case WI_LUCENT:
if (rate == 0)
rate = 3; /* auto */
switch (rate) {
case 0: /* auto == 11mbps auto */
rate = 3;
break;
/* case 1, 2 map to 1, 2*/
case 5: /* 5.5Mbps -> 4 */
rate = 4;
break;
case 11: /* 11mbps -> 5 */
rate = 5;
break;
default:
break;
}
break;
default:
/* Choose a bit according to this table.