From owner-svn-src-projects@FreeBSD.ORG Thu Jun 4 22:33:12 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 E67B1106566B; Thu, 4 Jun 2009 22:33:12 +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 CA0B08FC1B; Thu, 4 Jun 2009 22:33:12 +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 n54MXCki006466; Thu, 4 Jun 2009 22:33:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n54MXCuc006463; Thu, 4 Jun 2009 22:33:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200906042233.n54MXCuc006463@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jun 2009 22:33:12 +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: r193470 - 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: Thu, 04 Jun 2009 22:33:13 -0000 Author: rpaulo Date: Thu Jun 4 22:33:12 2009 New Revision: 193470 URL: http://svn.freebsd.org/changeset/base/193470 Log: Initial handling of IEEE80211_IOC_HWMP_TABLE (getter). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jun 4 22:23:44 2009 (r193469) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jun 4 22:33:12 2009 (r193470) @@ -951,12 +951,40 @@ static int hwmp_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { int error; + size_t len, off; + struct ieee80211_hwmp_state *hs; + struct ieee80211_hwmp_fi *fi; + uint8_t *p; error = 0; switch (ireq->i_type) { case IEEE80211_IOC_HWMP_TABLE: if (vap->iv_opmode != IEEE80211_M_MBSS) return EINVAL; + hs = vap->iv_hwmp; + len = 0; + mtx_lock(&hs->hs_lock); + TAILQ_FOREACH(fi, &hs->hs_head, fi_next) { + len += sizeof(*fi); + } + mtx_unlock(&hs->hs_lock); + if (len > ireq->i_len || ireq->i_len < sizeof(*fi)) + return EFAULT; + p = malloc(len, M_TEMP, M_NOWAIT | M_ZERO); + if (p == NULL) + return ENOMEM; + off = 0; + mtx_lock(&hs->hs_lock); + TAILQ_FOREACH(fi, &hs->hs_head, fi_next) { + if (off >= len) + break; + memcpy(p + off, fi, sizeof(*fi)); + off += sizeof(*fi); + } + mtx_unlock(&hs->hs_lock); + error = copyout(p, (uint8_t *) ireq->i_data, ireq->i_len); + free(p, M_TEMP); + break; default: return ENOSYS; } Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jun 4 22:23:44 2009 (r193469) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jun 4 22:33:12 2009 (r193470) @@ -284,7 +284,7 @@ mesh_input(struct ieee80211_node *ni, st } /* NB: not ieee80211_hdrspace, datapad is not honored */ hdrlen = ieee80211_hdrsize(wh) - + sizeof(struct ieee80211_meshcntl); + + sizeof(struct ieee80211_meshcntl) + 2; if (m->m_len < hdrlen && (m = m_pullup(m, hdrlen)) == NULL) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, @@ -652,6 +652,8 @@ mesh_recv_action(struct ieee80211_node * * XXX: wait for it to beacon or create ieee80211_node? */ if (ni == vap->iv_bss) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_MESH, + wh, NULL, "%s", "unknown node"); return; } Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Thu Jun 4 22:23:44 2009 (r193469) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Thu Jun 4 22:33:12 2009 (r193470) @@ -207,9 +207,12 @@ ieee80211_start(struct ifnet *ifp) } } + ieee80211_hwmp_discover(vap, eh->ether_dhost); +#if 0 if (vap->iv_opmode == IEEE80211_M_MBSS) ni = ieee80211_hwmp_discover(vap, eh->ether_dhost); else +#endif ni = ieee80211_find_txnode(vap, eh->ether_dhost); if (ni == NULL) { /* NB: ieee80211_find_txnode does stat+msg */