From owner-p4-projects@FreeBSD.ORG Mon Nov 17 09:37:10 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 73C3E16A4D0; Mon, 17 Nov 2003 09:37:10 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4531216A4CE for ; Mon, 17 Nov 2003 09:37:10 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90B9543FCB for ; Mon, 17 Nov 2003 09:37:09 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hAHHb9XJ036348 for ; Mon, 17 Nov 2003 09:37:09 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hAHHb87d036345 for perforce@freebsd.org; Mon, 17 Nov 2003 09:37:08 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 17 Nov 2003 09:37:08 -0800 (PST) Message-Id: <200311171737.hAHHb87d036345@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 42669 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2003 17:37:10 -0000 X-List-Received-Date: Mon, 17 Nov 2003 17:37:10 -0000 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;