From: Sepherosa Ziehau Date: Sun, 8 Jun 2008 10:06:05 +0000 (+0000) Subject: Add tunable to enable/disable PBCC support in acx(4) and it is enabled X-Git-Tag: v2.0.1~452 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/841427099d6f0c30d280066689d8f72e6a0b6248 Add tunable to enable/disable PBCC support in acx(4) and it is enabled by default. --- diff --git a/sys/dev/netif/acx/acx100.c b/sys/dev/netif/acx/acx100.c index 5fa3df6245..d2b005947b 100644 --- a/sys/dev/netif/acx/acx100.c +++ b/sys/dev/netif/acx/acx100.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/acx/acx100.c,v 1.12 2008/02/06 08:21:22 sephe Exp $ + * $DragonFly: src/sys/dev/netif/acx/acx100.c,v 1.13 2008/06/08 10:06:05 sephe Exp $ */ #include @@ -327,7 +327,10 @@ acx100_set_param(device_t dev) sc->chip_chan_flags = IEEE80211_CHAN_B; ic->ic_phytype = IEEE80211_T_DS; - ic->ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b; + if (acx_enable_pbcc) + ic->ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b_pbcc; + else + ic->ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b; IEEE80211_ONOE_PARAM_SETUP(&sc->sc_onoe_param); diff --git a/sys/dev/netif/acx/acx111.c b/sys/dev/netif/acx/acx111.c index 5cbb4ba7a1..f80adda31a 100644 --- a/sys/dev/netif/acx/acx111.c +++ b/sys/dev/netif/acx/acx111.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/acx/acx111.c,v 1.15 2008/06/06 10:47:14 sephe Exp $ + * $DragonFly: src/sys/dev/netif/acx/acx111.c,v 1.16 2008/06/08 10:06:05 sephe Exp $ */ #include @@ -380,8 +380,13 @@ acx111_set_param(device_t dev) ic->ic_caps = IEEE80211_C_WPA | IEEE80211_C_SHSLOT; ic->ic_phytype = IEEE80211_T_OFDM; - ic->ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = acx_rates_11g; + if (acx_enable_pbcc) { + ic->ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b_pbcc; + ic->ic_sup_rates[IEEE80211_MODE_11G] = acx_rates_11g_pbcc; + } else { + ic->ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = acx_rates_11g; + } IEEE80211_ONOE_PARAM_SETUP(&sc->sc_onoe_param); IEEE80211_AMRR_PARAM_SETUP(&sc->sc_amrr_param); diff --git a/sys/dev/netif/acx/if_acx.c b/sys/dev/netif/acx/if_acx.c index 026fcf67ff..259f27cecd 100644 --- a/sys/dev/netif/acx/if_acx.c +++ b/sys/dev/netif/acx/if_acx.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/acx/if_acx.c,v 1.29 2008/06/06 10:47:14 sephe Exp $ + * $DragonFly: src/sys/dev/netif/acx/if_acx.c,v 1.30 2008/06/08 10:06:05 sephe Exp $ */ /* @@ -175,10 +175,17 @@ static int acx_sysctl_msdu_lifetime(SYSCTL_HANDLER_ARGS); static int acx_sysctl_free_firmware(SYSCTL_HANDLER_ARGS); const struct ieee80211_rateset acx_rates_11b = - { 5, { 2, 4, 11, 22, 44 } }; + { 4, { 2, 4, 11, 22 } }; const struct ieee80211_rateset acx_rates_11g = + { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; +const struct ieee80211_rateset acx_rates_11b_pbcc = + { 5, { 2, 4, 11, 22, 44 } }; +const struct ieee80211_rateset acx_rates_11g_pbcc = { 13, { 2, 4, 11, 22, 44, 12, 18, 24, 36, 48, 72, 96, 108 } }; +int acx_enable_pbcc = 1; +TUNABLE_INT("hw.acx.enable_pbcc", &acx_enable_pbcc); + static const struct acx_device { uint16_t vid; uint16_t did; @@ -499,7 +506,8 @@ acx_attach(device_t dev) IEEE80211_C_MONITOR | /* Monitor mode */ IEEE80211_C_IBSS | /* IBSS modes */ IEEE80211_C_SHPREAMBLE; /* Short preamble */ - ic->ic_caps_ext = IEEE80211_CEXT_PBCC; /* PBCC modulation */ + if (acx_enable_pbcc) + ic->ic_caps_ext = IEEE80211_CEXT_PBCC; /* PBCC modulation */ /* Get station id */ for (i = 0; i < IEEE80211_ADDR_LEN; ++i) { diff --git a/sys/dev/netif/acx/if_acxvar.h b/sys/dev/netif/acx/if_acxvar.h index 38c8574a5b..deb0c10668 100644 --- a/sys/dev/netif/acx/if_acxvar.h +++ b/sys/dev/netif/acx/if_acxvar.h @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/acx/if_acxvar.h,v 1.13 2008/06/06 10:47:14 sephe Exp $ + * $DragonFly: src/sys/dev/netif/acx/if_acxvar.h,v 1.14 2008/06/08 10:06:05 sephe Exp $ */ #ifndef _IF_ACXVAR_H @@ -512,7 +512,10 @@ struct acx_softc { #define ACX_BASE_RADIO_FW_PATH "acx/%s/FwRad%02x.bin" extern const struct ieee80211_rateset acx_rates_11b; +extern const struct ieee80211_rateset acx_rates_11b_pbcc; extern const struct ieee80211_rateset acx_rates_11g; +extern const struct ieee80211_rateset acx_rates_11g_pbcc; +extern int acx_enable_pbcc; void acx100_set_param(device_t); void acx111_set_param(device_t);