Date: Mon, 17 Nov 2003 09:37:08 -0800 (PST) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 42669 for review Message-ID: <200311171737.hAHHb87d036345@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=42669 Change 42669 by sam@sam_ebb on 2003/11/17 09:36:32 o change diag ioctl to not copyout unless a pointer was returned and to always return the size retrieved from the HAL; this allows users to pass in a null pointer and a large size to find out the "right size" for an item they want to retrieve o fix WEP use in hostap mode; need to reset the pointer to the 802.11 packet header after stripping the WEP header on input o move rate control change messages under ath_debug; they were left on to be annoying and motivate someone to do a good algorithm but it looks like noone's going to step up Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#37 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#37 (text+ko) ==== @@ -915,11 +915,10 @@ u_int size; if (ath_hal_getdiagstate(ah, ad->ad_id, &data, &size)) { - if (size > ad->ad_size) - size = ad->ad_size; - error = copyout(data, ad->ad_data, size); - if (error == 0) + if (size < ad->ad_size) ad->ad_size = size; + if (data) + error = copyout(data, ad->ad_data, ad->ad_size); } else error = EINVAL; break; @@ -1729,7 +1728,8 @@ wh->i_fc[1] &= ~IEEE80211_FC1_WEP; memcpy(&whbuf, wh, sizeof(whbuf)); m_adj(m, IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN); - memcpy(mtod(m, caddr_t), &whbuf, sizeof(whbuf)); + wh = mtod(m, struct ieee80211_frame *); + memcpy(wh, &whbuf, sizeof(whbuf)); /* * Also trim WEP ICV from the tail. */ @@ -2765,11 +2765,11 @@ } if (ni->ni_txrate != orate) { - printf("%s: %dM -> %dM (%d ok, %d err, %d retr)\n", + DPRINTF(("%s: %dM -> %dM (%d ok, %d err, %d retr)\n", __func__, (rs->rs_rates[orate] & IEEE80211_RATE_VAL) / 2, (rs->rs_rates[ni->ni_txrate] & IEEE80211_RATE_VAL) / 2, - an->an_tx_ok, an->an_tx_err, an->an_tx_retr); + an->an_tx_ok, an->an_tx_err, an->an_tx_retr)); } if (ni->ni_txrate != orate || enough) an->an_tx_ok = an->an_tx_err = an->an_tx_retr = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311171737.hAHHb87d036345>