Date: Fri, 26 Jun 2009 18:37:42 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195067 - projects/mesh11s/sys/net80211 Message-ID: <200906261837.n5QIbg6N094554@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906261837.n5QIbg6N094554>