Date: Mon, 23 Mar 2009 15:59:31 +0100 From: "Paul B. Mahol" <onemda@gmail.com> To: freebsd-net@freebsd.org Subject: Re: kern/132342: commit references a PR Message-ID: <3a142e750903230759s272f90abs4c6eb783f6f06d0@mail.gmail.com> In-Reply-To: <200903090240.n292e4Ov062176@freefall.freebsd.org> References: <200903090240.n292e4Ov062176@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 3/9/09, dfilter service <dfilter@freebsd.org> wrote: > The following reply was made to PR kern/132342; it has been noted by GNATS. > > From: dfilter@FreeBSD.ORG (dfilter service) > To: bug-followup@FreeBSD.org > Cc: > Subject: Re: kern/132342: commit references a PR > Date: Mon, 9 Mar 2009 02:38:02 +0000 (UTC) > > Author: sam > Date: Mon Mar 9 02:37:52 2009 > New Revision: 189550 > URL: http://svn.freebsd.org/changeset/base/189550 > > Log: > Fix TXPMGT handling: > o correct dBm<->mW conversion logic > o set net80211 TXPMGT capability only if driver reports it is capable > > PR: kern/132342 > Submitted by: "Paul B. Mahol" <onemda@gmail.com> > > Modified: > head/sys/dev/if_ndis/if_ndis.c > > Modified: head/sys/dev/if_ndis/if_ndis.c > ============================================================================== > --- head/sys/dev/if_ndis/if_ndis.c Mon Mar 9 02:34:02 2009 (r189549) > +++ head/sys/dev/if_ndis/if_ndis.c Mon Mar 9 02:37:52 2009 (r189550) > @@ -102,7 +102,7 @@ SYSCTL_INT(_hw_ndisusb, OID_AUTO, halt, > "Halt NDIS USB driver when it's attached"); > > /* 0 - 30 dBm to mW conversion table */ > -const uint16_t dBm2mW[] = { > +static const uint16_t dBm2mW[] = { > 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, > 3, 4, 4, 4, 5, 6, 6, 7, 8, 9, > 10, 11, 13, 14, 16, 18, 20, 22, 25, 28, > @@ -749,7 +749,7 @@ ndis_attach(dev) > ic->ic_ifp = ifp; > ic->ic_opmode = IEEE80211_M_STA; > ic->ic_phytype = IEEE80211_T_DS; > - ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_IBSS | IEEE80211_C_TXPMGT; > + ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_IBSS; > setbit(ic->ic_modecaps, IEEE80211_MODE_AUTO); > len = 0; > r = ndis_get_info(sc, OID_802_11_NETWORK_TYPES_SUPPORTED, > @@ -928,6 +928,11 @@ got_crypto: > r = ndis_get_info(sc, OID_802_11_POWER_MODE, &arg, &i); > if (r == 0) > ic->ic_caps |= IEEE80211_C_PMGT; > + > + r = ndis_get_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &i); > + if (r == 0) > + ic->ic_caps |= IEEE80211_C_TXPMGT; > + > bcopy(eaddr, &ic->ic_myaddr, sizeof(eaddr)); > ieee80211_ifattach(ic); > ic->ic_raw_xmit = ndis_raw_xmit; > @@ -2325,9 +2330,10 @@ ndis_setstate_80211(sc) > ndis_set_info(sc, OID_802_11_POWER_MODE, &arg, &len); > > /* Set TX power */ > - if (ic->ic_txpowlimit < sizeof(dBm2mW)) { > - len = sizeof(arg); > + if ((ic->ic_caps & IEEE80211_C_TXPMGT) && > + ic->ic_txpowlimit < (sizeof(dBm2mW) / sizeof(dBm2mW[0]))) { > arg = dBm2mW[ic->ic_txpowlimit]; > + len = sizeof(arg); > ndis_set_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); > } > > @@ -2798,11 +2804,10 @@ ndis_getstate_80211(sc) > } > > /* Get TX power */ > - len = sizeof(arg); > - rval = ndis_get_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); > - > - if (!rval) { > - for (i = 0; i < sizeof(dBm2mW); i++) > + if (ic->ic_caps & IEEE80211_C_TXPMGT) { > + len = sizeof(arg); > + ndis_get_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); > + for (i = 0; i < (sizeof(dBm2mW) / sizeof(dBm2mW[0])); i++) > if (dBm2mW[i] >= arg) > break; > ic->ic_txpowlimit = i; > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > Looks to be still open, should get closed. I dont expect anybody is going to MFC this and similar changes. -- Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a142e750903230759s272f90abs4c6eb783f6f06d0>