From owner-svn-src-projects@FreeBSD.ORG Fri Jun 26 18:37:42 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6939F1065673; Fri, 26 Jun 2009 18:37:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57E108FC23; Fri, 26 Jun 2009 18:37:42 +0000 (UTC) (envelope-from rpaulo@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 n5QIbgeM094558; Fri, 26 Jun 2009 18:37:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5QIbg6N094554; Fri, 26 Jun 2009 18:37:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200906261837.n5QIbg6N094554@svn.freebsd.org> From: Rui Paulo Date: Fri, 26 Jun 2009 18:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195067 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2009 18:37:42 -0000 Author: rpaulo Date: Fri Jun 26 18:37:42 2009 New Revision: 195067 URL: http://svn.freebsd.org/changeset/base/195067 Log: Move the maxhops sysctl to a per vap setting. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_hwmp.h projects/mesh11s/sys/net80211/ieee80211_ioctl.h Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jun 26 18:36:46 2009 (r195066) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jun 26 18:37:42 2009 (r195067) @@ -102,7 +102,6 @@ static inline int hwmp_send_rann(struct const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshrann_ie *); -static int ieee80211_hwmp_maxhops = 31; static int ieee80211_hwmp_targetonly = 0; static int ieee80211_hwmp_replyforward = 1; static const int ieee80211_hwmp_maxprepretries = 3; @@ -131,8 +130,6 @@ static const uint8_t invalidaddr[IEEE802 SYSCTL_NODE(_net_wlan, OID_AUTO, hwmp, CTLFLAG_RD, 0, "IEEE 802.11s HWMP parameters"); -SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, maxhops, CTLTYPE_INT | CTLFLAG_RW, - &ieee80211_hwmp_maxhops, 0, "Maximum number of hops for paths"); SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, targetonly, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_hwmp_targetonly, 0, "Set TO bit on generated PREQs"); SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, replyforward, CTLTYPE_INT | CTLFLAG_RW, @@ -140,6 +137,8 @@ SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, rep MALLOC_DEFINE(M_80211_HWMP, "80211hwmp", "802.11 HWMP routing table"); +#define IEEE80211_HWMP_DEFAULT_MAXHOPS 31 + /* * Helper functions to manipulate the HWMP routing table. */ @@ -211,6 +210,7 @@ ieee80211_hwmp_vattach(struct ieee80211v } TAILQ_INIT(&hs->hs_head); mtx_init(&hs->hs_lock, "HWMP", "802.11s HWMP", MTX_DEF); + hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; vap->iv_hwmp = hs; } @@ -1107,6 +1107,9 @@ hwmp_ioctl_get80211(struct ieee80211vap case IEEE80211_IOC_HWMP_ROOTMODE: ireq->i_val = hs->hs_rootmode; break; + case IEEE80211_IOC_HWMP_MAXHOPS: + ireq->i_val = hs->hs_maxhops; + break; default: return ENOSYS; } @@ -1161,6 +1164,11 @@ hwmp_ioctl_set80211(struct ieee80211vap return EINVAL; hs->hs_rootmode = ireq->i_val; break; + case IEEE80211_IOC_HWMP_MAXHOPS: + if (ireq->i_val <= 0 || ireq->i_val > 255) + return EINVAL; + hs->hs_maxhops = ireq->i_val; + break; default: return ENOSYS; } Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.h Fri Jun 26 18:36:46 2009 (r195066) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.h Fri Jun 26 18:37:42 2009 (r195067) @@ -63,6 +63,7 @@ struct ieee80211_hwmp_state { struct timeval hs_lastperr; /* last time we sent a PERR */ struct mtx hs_lock; /* lock for the fi table */ int hs_rootmode; /* proactive HWMP */ + uint8_t hs_maxhops; /* max hop count */ }; void ieee80211_hwmp_vattach(struct ieee80211vap *); Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jun 26 18:36:46 2009 (r195066) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jun 26 18:37:42 2009 (r195067) @@ -668,6 +668,7 @@ struct ieee80211req { #define IEEE80211_IOC_MESH_TTL 194 /* mesh TTL */ #define IEEE80211_IOC_HWMP_CMD 195 /* HWMP table commands */ #define IEEE80211_IOC_HWMP_ROOTMODE 196 /* HWMP root mode */ +#define IEEE80211_IOC_HWMP_MAXHOPS 197 /* number of hops before drop */ #define IEEE80211_IOC_TDMA_SLOT 201 /* TDMA: assigned slot */ #define IEEE80211_IOC_TDMA_SLOTCNT 202 /* TDMA: slots in bss */