[Madwifi-devel] PATCH 1/2: lock the slottime for long-distance links
Status: Beta
Brought to you by:
otaku
From: Thorsten v. E. <tv...@vo...> - 2005-09-22 16:17:30
|
Last night I finally upgraded two of my long distance nodes from a 9 month old madwifi to the latest one. Lots of improvements and the sample rate control works a whole lot better! Thanks so much to everyone who spent time improving the driver! Below is an updated copy of one of my old patches that is still relevant. It allows athctrl to lock the slottime when changing the acktimeout and ctstimeout. Currently the slottime (which should be about 1/2 the acktimeout) is changed back to 9us or 20us when certain association events occur. If lockslottime (another sysctl variable) is set, then this change is prevented. This has worked well for me for the past 9 months. I'm not convinced that the lockslottime variable is the nicest approach. The benefit is that it exposes what's going on. An alternative would be to implicitly lock the slottime if the acktimeout is not the standard value. The patch below changes ath/if_ath.c and ath/if_athvar.h. I'm sending a 2nd email with the patch to tools/athctrl.c Cheers, Thorsten --- ath-orig/if_ath.c Wed Sep 21 23:18:07 2005 +++ ath/if_ath.c Wed Sep 21 23:30:56 2005 @@ -2384,6 +2384,8 @@ /* * Set the slot time based on the current setting. + * This is called by ath_updateslot below and when a non-ERP node + * joins the network. */ static void ath_setslottime(struct ath_softc *sc) @@ -2391,10 +2393,16 @@ struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; - if (ic->ic_flags & IEEE80211_F_SHSLOT) - ath_hal_setslottime(ah, HAL_SLOT_TIME_9); - else - ath_hal_setslottime(ah, HAL_SLOT_TIME_20); + /* If the user has asked to lock the slot-time, ignore the + * slot time adjustment. This is useful in long-range networks + * that require a slot time larger than the standard ones. -TvE + */ + if (!sc->sc_lockslottime) { + if (ic->ic_flags & IEEE80211_F_SHSLOT) + ath_hal_setslottime(ah, HAL_SLOT_TIME_9); + else + ath_hal_setslottime(ah, HAL_SLOT_TIME_20); + } sc->sc_updateslot = OK; } @@ -6211,6 +6219,7 @@ ATH_RAWDEV_TYPE = 19, ATH_RXFILTER = 20, ATH_RADARSIM = 21, + ATH_LOCKSLOTTIME= 22, }; static int @@ -6233,6 +6242,9 @@ if (!ath_hal_setslottime(ah, val)) ret = -EINVAL; break; + case ATH_LOCKSLOTTIME: + sc->sc_lockslottime = val != 0; + break; case ATH_ACKTIMEOUT: if (!ath_hal_setacktimeout(ah, val)) ret = -EINVAL; @@ -6341,6 +6353,9 @@ case ATH_SLOTTIME: val = ath_hal_getslottime(ah); break; + case ATH_LOCKSLOTTIME: + val = sc->sc_lockslottime; + break; case ATH_ACKTIMEOUT: val = ath_hal_getacktimeout(ah); break; @@ -6428,6 +6443,11 @@ .mode = 0644, .proc_handler = ath_sysctl_halparam }, + { .ctl_name = ATH_LOCKSLOTTIME, + .procname = "lockslottime", + .mode = 0644, + .proc_handler = ath_sysctl_halparam + }, { .ctl_name = ATH_ACKTIMEOUT, .procname = "acktimeout", .mode = 0644, @@ -6580,6 +6600,7 @@ #endif sc->sc_txantenna = 0; /* default to auto-selection */ sc->sc_txintrperiod = ATH_TXINTR_PERIOD; + sc->sc_lockslottime = 0; } static void --- ath-orig/if_athvar.h Wed Sep 21 23:18:07 2005 +++ ath/if_athvar.h Wed Sep 21 23:31:59 2005 @@ -264,6 +264,7 @@ sc_needmib : 1, /* enable MIB stats intr */ sc_hasdiversity : 1,/* rx diversity available */ sc_diversity : 1,/* enable rx diversity */ + sc_lockslottime : 1,/* lock slot time value */ sc_hasveol : 1, /* tx VEOL support */ sc_hastpc : 1, /* per-packet TPC support */ sc_ledstate: 1, /* LED on/off state */ |