From owner-svn-src-all@FreeBSD.ORG Wed Mar 18 19:38:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5DCD1065673; Wed, 18 Mar 2009 19:38:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9E2A8FC19; Wed, 18 Mar 2009 19:38:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IJcdX6035738; Wed, 18 Mar 2009 19:38:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IJcdnk035736; Wed, 18 Mar 2009 19:38:39 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903181938.n2IJcdnk035736@svn.freebsd.org> From: Sam Leffler Date: Wed, 18 Mar 2009 19:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189981 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 19:38:40 -0000 Author: sam Date: Wed Mar 18 19:38:39 2009 New Revision: 189981 URL: http://svn.freebsd.org/changeset/base/189981 Log: rate limit printfs for invalid tdma ie contents; probably want this to be less than 1/sec Modified: head/sys/net80211/ieee80211_tdma.c head/sys/net80211/ieee80211_tdma.h Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Wed Mar 18 19:28:17 2009 (r189980) +++ head/sys/net80211/ieee80211_tdma.c Wed Mar 18 19:38:39 2009 (r189981) @@ -387,8 +387,9 @@ tdma_update(struct ieee80211vap *vap, co update = 0; if (tdma->tdma_slotcnt != ts->tdma_slotcnt) { if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) { - printf("%s: bad slot cnt %u\n", - __func__, tdma->tdma_slotcnt); + if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) + printf("%s: bad slot cnt %u\n", + __func__, tdma->tdma_slotcnt); return 0; } update |= TDMA_UPDATE_SLOTCNT; @@ -396,16 +397,18 @@ tdma_update(struct ieee80211vap *vap, co slotlen = le16toh(tdma->tdma_slotlen) * 100; if (slotlen != ts->tdma_slotlen) { if (!TDMA_SLOTLEN_VALID(slotlen)) { - printf("%s: bad slot len %u\n", - __func__, slotlen); + if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) + printf("%s: bad slot len %u\n", + __func__, slotlen); return 0; } update |= TDMA_UPDATE_SLOTLEN; } if (tdma->tdma_bintval != ts->tdma_bintval) { if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) { - printf("%s: bad beacon interval %u\n", - __func__, tdma->tdma_bintval); + if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1)) + printf("%s: bad beacon interval %u\n", + __func__, tdma->tdma_bintval); return 0; } update |= TDMA_UPDATE_BINTVAL; Modified: head/sys/net80211/ieee80211_tdma.h ============================================================================== --- head/sys/net80211/ieee80211_tdma.h Wed Mar 18 19:28:17 2009 (r189980) +++ head/sys/net80211/ieee80211_tdma.h Wed Mar 18 19:38:39 2009 (r189981) @@ -38,9 +38,11 @@ struct ieee80211_tdma_state { uint8_t tdma_bintval; /* beacon interval (slots) */ uint8_t tdma_slot; /* station slot # */ uint8_t tdma_inuse[1]; /* mask of slots in use */ - void *tdma_peer; /* peer station cookie */ uint8_t tdma_active[1]; /* mask of active slots */ int tdma_count; /* active/inuse countdown */ + void *tdma_peer; /* peer station cookie */ + struct timeval tdma_lastprint; /* time of last rate-limited printf */ + int tdma_fails; /* fail count for rate-limiting */ /* parent method pointers */ int (*tdma_newstate)(struct ieee80211vap *, enum ieee80211_state,