From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 10:15:51 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 5774710656AE; Mon, 27 Apr 2009 10:15:51 +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 4499F8FC0C; Mon, 27 Apr 2009 10:15:51 +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 n3RAFppu012553; Mon, 27 Apr 2009 10:15:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RAFp5C012552; Mon, 27 Apr 2009 10:15:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271015.n3RAFp5C012552@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 10:15:51 +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: r191556 - projects/mesh11s/sbin/ifconfig 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: Mon, 27 Apr 2009 10:15:51 -0000 Author: rpaulo Date: Mon Apr 27 10:15:50 2009 New Revision: 191556 URL: http://svn.freebsd.org/changeset/base/191556 Log: Add IFM_IEEE80211_MBSS to the IFM_OPMODE macro. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifmedia.c Modified: projects/mesh11s/sbin/ifconfig/ifmedia.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifmedia.c Sun Apr 26 23:11:22 2009 (r191555) +++ projects/mesh11s/sbin/ifconfig/ifmedia.c Mon Apr 27 10:15:50 2009 (r191556) @@ -104,7 +104,8 @@ static struct ifmedia_description *get_s #define IFM_OPMODE(x) \ ((x) & (IFM_IEEE80211_ADHOC | IFM_IEEE80211_HOSTAP | \ - IFM_IEEE80211_IBSS | IFM_IEEE80211_WDS | IFM_IEEE80211_MONITOR)) + IFM_IEEE80211_IBSS | IFM_IEEE80211_WDS | IFM_IEEE80211_MONITOR | \ + IFM_IEEE80211_MBSS)) #define IFM_IEEE80211_STA 0 static void From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 11:12:04 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 719021065934; Mon, 27 Apr 2009 11:12:04 +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 00A068FC40; Mon, 27 Apr 2009 11:12:00 +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 n3RBBxLw013588; Mon, 27 Apr 2009 11:11:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RBBx9t013587; Mon, 27 Apr 2009 11:11:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271111.n3RBBx9t013587@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 11:11:59 +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: r191557 - 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: Mon, 27 Apr 2009 11:12:20 -0000 Author: rpaulo Date: Mon Apr 27 11:11:59 2009 New Revision: 191557 URL: http://svn.freebsd.org/changeset/base/191557 Log: Add comments so that I don't forget to add these fields to beacons/data. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 10:15:50 2009 (r191556) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:11:59 2009 (r191557) @@ -2446,6 +2446,15 @@ ieee80211_beacon_construct(struct mbuf * } if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); + /* frm = ieee80211_add_meshconf(frm, vap); */ + /* struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm; + tie->tim_ie = IEEE80211_ELEMID_TIM; + tie->tim_len = 4; /* length * + tie->tim_count = 0; /* DTIM count * + tie->tim_period = vap->iv_dtim_period; /* DTIM period * + tie->tim_bitctl = 0; /* bitmap control * + tie->tim_bitmap[0] = 0; /* Partial Virtual Bitmap * + frm += sizeof(struct ieee80211_tim_ie); */ } bo->bo_tim_trailer_len = frm - bo->bo_tim_trailer; bo->bo_csa_trailer_len = frm - bo->bo_csa; From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 11:12:46 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 8D5291065679; Mon, 27 Apr 2009 11:12:46 +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 50A0E8FC43; Mon, 27 Apr 2009 11:12:46 +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 n3RBCkZH013637; Mon, 27 Apr 2009 11:12:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RBCkJj013636; Mon, 27 Apr 2009 11:12:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271112.n3RBCkJj013636@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 11:12:46 +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: r191558 - 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: Mon, 27 Apr 2009 11:12:59 -0000 Author: rpaulo Date: Mon Apr 27 11:12:46 2009 New Revision: 191558 URL: http://svn.freebsd.org/changeset/base/191558 Log: Add initial code to create a MBSS. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 11:11:59 2009 (r191557) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 11:12:46 2009 (r191558) @@ -132,7 +132,7 @@ mesh_newstate(struct ieee80211vap *vap, * Already have a channel; bypass the * scan and startup immediately. */ - /* ieee80211_create_mesh(vap, vap->iv_des_chan); */ + ieee80211_create_mbss(vap, vap->iv_des_chan); break; } /* @@ -416,6 +416,52 @@ ieee80211_create_mbss(struct ieee80211va "%s: creating mbss on channel %u\n", __func__, ieee80211_chan2ieee(ic, chan)); + ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr); + if (ni == NULL) { + /* XXX recovery? */ + return; + } + ni->ni_meshidlen = vap->iv_meshidlen; + memcpy(ni->ni_meshid, vap->iv_meshid, ni->ni_meshidlen); + ni->ni_intval = ic->ic_bintval; + ic->ic_bsschan = chan; + ieee80211_node_set_chan(ni, chan); + ieee80211_setcurchan(ic, ni->ni_chan); + ic->ic_curmode = ieee80211_chan2mode(chan); + /* + * Do mode-specific setup. + */ + if (IEEE80211_IS_CHAN_FULL(chan)) { + if (IEEE80211_IS_CHAN_ANYG(chan)) { + /* + * Use a mixed 11b/11g basic rate set. + */ + ieee80211_setbasicrates(&ni->ni_rates, + IEEE80211_MODE_11G); + if (vap->iv_flags & IEEE80211_F_PUREG) { + /* + * Also mark OFDM rates basic so 11b + * stations do not join (WiFi compliance). + */ + ieee80211_addbasicrates(&ni->ni_rates, + IEEE80211_MODE_11A); + } + } else if (IEEE80211_IS_CHAN_B(chan)) { + /* + * Force pure 11b rate set. + */ + ieee80211_setbasicrates(&ni->ni_rates, + IEEE80211_MODE_11B); + } + } + /* + * Set the erp state (mostly the slot time) to deal with + * the auto-select case; this should be redundant if the + * mode is locked. + */ + ieee80211_reset_erp(ic); + ieee80211_wme_initparams(vap); + ieee80211_new_state(vap, IEEE80211_S_RUN, -1); } static int From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 11:14:55 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 8D4C5106570B; Mon, 27 Apr 2009 11:14:55 +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 72B848FC15; Mon, 27 Apr 2009 11:14:55 +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 n3RBEtP9013707; Mon, 27 Apr 2009 11:14:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RBEt8G013706; Mon, 27 Apr 2009 11:14:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271114.n3RBEt8G013706@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 11:14:55 +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: r191559 - 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: Mon, 27 Apr 2009 11:15:01 -0000 Author: rpaulo Date: Mon Apr 27 11:14:55 2009 New Revision: 191559 URL: http://svn.freebsd.org/changeset/base/191559 Log: Fix compiler error. Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:12:46 2009 (r191558) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:14:55 2009 (r191559) @@ -2449,11 +2449,11 @@ ieee80211_beacon_construct(struct mbuf * /* frm = ieee80211_add_meshconf(frm, vap); */ /* struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm; tie->tim_ie = IEEE80211_ELEMID_TIM; - tie->tim_len = 4; /* length * - tie->tim_count = 0; /* DTIM count * - tie->tim_period = vap->iv_dtim_period; /* DTIM period * - tie->tim_bitctl = 0; /* bitmap control * - tie->tim_bitmap[0] = 0; /* Partial Virtual Bitmap * + tie->tim_len = 4; * length * + tie->tim_count = 0; * DTIM count * + tie->tim_period = vap->iv_dtim_period; * DTIM period * + tie->tim_bitctl = 0; * bitmap control * + tie->tim_bitmap[0] = 0; * Partial Virtual Bitmap * frm += sizeof(struct ieee80211_tim_ie); */ } bo->bo_tim_trailer_len = frm - bo->bo_tim_trailer; From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 11:49:21 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 2AF3B1065670; Mon, 27 Apr 2009 11:49:21 +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 F379D8FC16; Mon, 27 Apr 2009 11:49:20 +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 n3RBnKaI014339; Mon, 27 Apr 2009 11:49:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RBnKNE014338; Mon, 27 Apr 2009 11:49:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271149.n3RBnKNE014338@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 11:49:20 +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: r191560 - 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: Mon, 27 Apr 2009 11:49:21 -0000 Author: rpaulo Date: Mon Apr 27 11:49:20 2009 New Revision: 191560 URL: http://svn.freebsd.org/changeset/base/191560 Log: Add mesh IEs to probe response construction routines. While there, sync the way we construct beacons with probe responses. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:14:55 2009 (r191559) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:49:20 2009 (r191560) @@ -2031,6 +2031,8 @@ ieee80211_alloc_proberesp(struct ieee802 * [tlv] Vendor OUI HT information (optional) * [tlv] Atheros capabilities * [tlv] AppIE's (optional) + * [tlv] Mesh ID (MBSS) + * [tlv] Mesh Conf (MBSS) */ m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), @@ -2055,6 +2057,8 @@ ieee80211_alloc_proberesp(struct ieee802 #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) #endif + + 2 + IEEE80211_MESHID_LEN + /* + sizeof(struct ieee80211_meshconf_ie) */ + (vap->iv_appie_proberesp != NULL ? vap->iv_appie_proberesp->ie_len : 0) ); @@ -2144,6 +2148,10 @@ ieee80211_alloc_proberesp(struct ieee802 #endif if (vap->iv_appie_proberesp != NULL) frm = add_appie(frm, vap->iv_appie_proberesp); + if (vap->iv_opmode == IEEE80211_M_MBSS) { + frm = ieee80211_add_meshid(frm, vap); + /* frm = ieee80211_add_mesconf(frm, vap); */ + } m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); return m; @@ -2332,12 +2340,12 @@ ieee80211_beacon_construct(struct mbuf * * XXX Vendor-specific OIDs (e.g. Atheros) * [tlv] WPA parameters * [tlv] WME parameters - * [tlv] MESH ID - * [tlv] MESH configuration * [tlv] Vendor OUI HT capabilities (optional) * [tlv] Vendor OUI HT information (optional) * [tlv] Atheros capabilities (optional) * [tlv] TDMA parameters (optional) + * [tlv] Mesh ID (MBSS) + * [tlv] Mesh Conf (MBSS) * [tlv] application data (optional) */ @@ -2500,6 +2508,8 @@ ieee80211_beacon_alloc(struct ieee80211_ * [tlv] WPA parameters * [tlv] WME parameters * [tlv] TDMA parameters (optional) + * [tlv] Mesh ID (MBSS) + * [tlv] Mesh Conf (MBSS) * [tlv] application data (optional) * NB: we allocate the max space required for the TIM bitmap. * XXX how big is this? @@ -2531,6 +2541,10 @@ ieee80211_beacon_alloc(struct ieee80211_ + (vap->iv_caps & IEEE80211_C_TDMA ? /* TDMA */ sizeof(struct ieee80211_tdma_param) : 0) #endif + + (vap->iv_opmode == IEEE80211_M_MBSS ? + 2 + ni->ni_meshidlen) : 0 + /* + (vap->iv_opmode == IEEE80211_M_MBSS ? + sizeof(struct ieee80211_meshconf_ie) : 0 */ + IEEE80211_MAX_APPIE ; m = ieee80211_getmgtframe(&frm, From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 11:51:14 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 62746106566B; Mon, 27 Apr 2009 11:51:14 +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 517118FC17; Mon, 27 Apr 2009 11:51:14 +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 n3RBpE8n014416; Mon, 27 Apr 2009 11:51:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RBpEHd014415; Mon, 27 Apr 2009 11:51:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271151.n3RBpEHd014415@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 11:51:14 +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: r191561 - 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: Mon, 27 Apr 2009 11:51:14 -0000 Author: rpaulo Date: Mon Apr 27 11:51:14 2009 New Revision: 191561 URL: http://svn.freebsd.org/changeset/base/191561 Log: Fix compilation. Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:49:20 2009 (r191560) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 11:51:14 2009 (r191561) @@ -2542,9 +2542,9 @@ ieee80211_beacon_alloc(struct ieee80211_ sizeof(struct ieee80211_tdma_param) : 0) #endif + (vap->iv_opmode == IEEE80211_M_MBSS ? - 2 + ni->ni_meshidlen) : 0 + 2 + ni->ni_meshidlen : 0) /* + (vap->iv_opmode == IEEE80211_M_MBSS ? - sizeof(struct ieee80211_meshconf_ie) : 0 */ + sizeof(struct ieee80211_meshconf_ie) : 0) */ + IEEE80211_MAX_APPIE ; m = ieee80211_getmgtframe(&frm, From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 18:15:41 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 A5B95106567C; Mon, 27 Apr 2009 18:15:41 +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 91D948FC23; Mon, 27 Apr 2009 18:15:41 +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 n3RIFfgL022269; Mon, 27 Apr 2009 18:15:41 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RIFfVK022268; Mon, 27 Apr 2009 18:15:41 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271815.n3RIFfVK022268@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 18:15:41 +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: r191574 - 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: Mon, 27 Apr 2009 18:15:42 -0000 Author: rpaulo Date: Mon Apr 27 18:15:41 2009 New Revision: 191574 URL: http://svn.freebsd.org/changeset/base/191574 Log: * Simplify and fix add_meshid function() * Implement code to deal with probe request frames (similar to other operating modes) * Setup the bss id (technically there's no BSS ID in mesh, so I must revisit this in the future). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 18:10:42 2009 (r191573) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 18:15:41 2009 (r191574) @@ -293,6 +293,22 @@ out: return type; } +static int +is11bclient(const uint8_t *rates, const uint8_t *xrates) +{ + static const uint32_t brates = (1<<2*1)|(1<<2*2)|(1<<11)|(1<<2*11); + int i; + + /* NB: the 11b clients we care about will not have xrates */ + if (xrates != NULL || rates == NULL) + return 0; + for (i = 0; i < rates[1]; i++) { + int r = rates[2+i] & IEEE80211_RATE_VAL; + if (r > 2*11 || ((1<iv_state != IEEE80211_S_RUN) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "wrong state %s", + ieee80211_state_name[vap->iv_state]); + vap->iv_stats.is_rx_mgtdiscard++; + return; + } + if (IEEE80211_IS_MULTICAST(wh->i_addr2)) { + /* frame must be directed */ + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "not unicast"); + vap->iv_stats.is_rx_mgtdiscard++; /* XXX stat */ + return; + } + + /* + * prreq frame format + * [tlv] ssid + * [tlv] supported rates + * [tlv] extended supported rates + * [tlv] Mesh ID + */ + ssid = meshid = rates = xrates = NULL; + sfrm = frm; + while (efrm - frm > 1) { + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); + switch (*frm) { + case IEEE80211_ELEMID_SSID: + ssid = frm; + break; + case IEEE80211_ELEMID_RATES: + rates = frm; + break; + case IEEE80211_ELEMID_XRATES: + xrates = frm; + break; + case IEEE80211_ELEMID_MESHID: + meshid = frm; + break; + } + frm += frm[2] + 2; + } + IEEE80211_VERIFY_ELEMENT(ssid, IEEE80211_NWID_LEN, return); + IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE, return); + if (xrates != NULL) + IEEE80211_VERIFY_ELEMENT(xrates, + IEEE80211_RATE_MAXSIZE - rates[1], return); + if (meshid != NULL) + IEEE80211_VERIFY_ELEMENT(meshid, + IEEE80211_MESHID_LEN, return); + IEEE80211_VERIFY_SSID(vap->iv_bss, ssid, return); + /* XXX add verify meshid ? */ + + /* XXX find a better class or define it's own */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_INPUT, wh->i_addr2, + "%s", "recv probe req"); + /* + * Some legacy 11b clients cannot hack a complete + * probe response frame. When the request includes + * only a bare-bones rate set, communicate this to + * the transmit side. + */ + ieee80211_send_proberesp(vap, wh->i_addr2, + is11bclient(rates, xrates) ? IEEE80211_SEND_LEGACY_11B : 0); break; + } case IEEE80211_FC0_SUBTYPE_ACTION: break; case IEEE80211_FC0_SUBTYPE_AUTH: @@ -399,11 +484,10 @@ ieee80211_add_meshid(uint8_t *frm, struc KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a mbss vap")); *frm++ = IEEE80211_ELEMID_MESHID; - *frm++ = sizeof(struct ieee80211_meshid_ie) + vap->iv_meshidlen; + *frm++ = vap->iv_meshidlen; memcpy(frm, vap->iv_meshid, vap->iv_meshidlen); - frm += vap->iv_meshidlen; - - return frm; + + return frm + vap->iv_meshidlen; } void @@ -421,12 +505,20 @@ ieee80211_create_mbss(struct ieee80211va /* XXX recovery? */ return; } + IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_myaddr); ni->ni_meshidlen = vap->iv_meshidlen; memcpy(ni->ni_meshid, vap->iv_meshid, ni->ni_meshidlen); ni->ni_intval = ic->ic_bintval; + /* + * Fix the channel and related attributes. + */ + /* clear DFS CAC state on previous channel */ + if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && + ic->ic_bsschan->ic_freq != chan->ic_freq && + IEEE80211_IS_CHAN_CACDONE(ic->ic_bsschan)) + ieee80211_dfs_cac_clear(ic, ic->ic_bsschan); ic->ic_bsschan = chan; ieee80211_node_set_chan(ni, chan); - ieee80211_setcurchan(ic, ni->ni_chan); ic->ic_curmode = ieee80211_chan2mode(chan); /* * Do mode-specific setup. @@ -454,6 +546,9 @@ ieee80211_create_mbss(struct ieee80211va IEEE80211_MODE_11B); } } + ieee80211_ref_node(ni); + vap->iv_bss = ni; + ieee80211_setcurchan(ic, ni->ni_chan); /* * Set the erp state (mostly the slot time) to deal with * the auto-select case; this should be redundant if the From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 18:17:33 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 54B5C106566C; Mon, 27 Apr 2009 18:17:33 +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 429E28FC12; Mon, 27 Apr 2009 18:17:33 +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 n3RIHX4P022335; Mon, 27 Apr 2009 18:17:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RIHX5S022333; Mon, 27 Apr 2009 18:17:33 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271817.n3RIHX5S022333@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 18:17:33 +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: r191575 - projects/mesh11s/sys/dev/ral 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: Mon, 27 Apr 2009 18:17:33 -0000 Author: rpaulo Date: Mon Apr 27 18:17:32 2009 New Revision: 191575 URL: http://svn.freebsd.org/changeset/base/191575 Log: Send beacons when operating in MBSS mode too. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/dev/ral/rt2560.c projects/mesh11s/sys/dev/ral/rt2661.c Modified: projects/mesh11s/sys/dev/ral/rt2560.c ============================================================================== --- projects/mesh11s/sys/dev/ral/rt2560.c Mon Apr 27 18:15:41 2009 (r191574) +++ projects/mesh11s/sys/dev/ral/rt2560.c Mon Apr 27 18:17:32 2009 (r191575) @@ -819,7 +819,8 @@ rt2560_newstate(struct ieee80211vap *vap } if (vap->iv_opmode == IEEE80211_M_HOSTAP || - vap->iv_opmode == IEEE80211_M_IBSS) { + vap->iv_opmode == IEEE80211_M_IBSS || + vap->iv_opmode == IEEE80211_M_MBSS) { m = ieee80211_beacon_alloc(ni, &rvp->ral_bo); if (m == NULL) { if_printf(ifp, "could not allocate beacon\n"); Modified: projects/mesh11s/sys/dev/ral/rt2661.c ============================================================================== --- projects/mesh11s/sys/dev/ral/rt2661.c Mon Apr 27 18:15:41 2009 (r191574) +++ projects/mesh11s/sys/dev/ral/rt2661.c Mon Apr 27 18:17:32 2009 (r191575) @@ -826,7 +826,8 @@ rt2661_newstate(struct ieee80211vap *vap } if (vap->iv_opmode == IEEE80211_M_HOSTAP || - vap->iv_opmode == IEEE80211_M_IBSS) { + vap->iv_opmode == IEEE80211_M_IBSS || + vap->iv_opmode == IEEE80211_M_MBSS) { error = rt2661_prepare_beacon(sc, vap); if (error != 0) return error; From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 18:29:59 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 6C9E710656C8; Mon, 27 Apr 2009 18:29:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59D2C8FC19; Mon, 27 Apr 2009 18:29:59 +0000 (UTC) (envelope-from gonzo@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 n3RITxgX022656; Mon, 27 Apr 2009 18:29:59 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RITxc4022654; Mon, 27 Apr 2009 18:29:59 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200904271829.n3RITxc4022654@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 Apr 2009 18:29:59 +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: r191577 - in projects/mips/sys/mips: include mips 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: Mon, 27 Apr 2009 18:29:59 -0000 Author: gonzo Date: Mon Apr 27 18:29:59 2009 New Revision: 191577 URL: http://svn.freebsd.org/changeset/base/191577 Log: - Use naming convention the same as MIPS spec does: eliminate _sel1 sufix and just use selector number. e.g. mips_rd_config_sel1 -> mips_rd_config1 - Add WatchHi/WatchLo accessors for selctors 1..3 (for debug purposes) Modified: projects/mips/sys/mips/include/cpufunc.h projects/mips/sys/mips/mips/cpu.c Modified: projects/mips/sys/mips/include/cpufunc.h ============================================================================== --- projects/mips/sys/mips/include/cpufunc.h Mon Apr 27 18:27:54 2009 (r191576) +++ projects/mips/sys/mips/include/cpufunc.h Mon Apr 27 18:29:59 2009 (r191577) @@ -183,6 +183,28 @@ mips_wr_ ## n (uint32_t a0) \ mips_barrier(); \ } struct __hack +#define MIPS_RDRW32_COP0_SEL(n,r,s) \ +static __inline uint32_t \ +mips_rd_ ## n ## s(void) \ +{ \ + int v0; \ + __asm __volatile ("mfc0 %[v0], $"__XSTRING(r)", "__XSTRING(s)";" \ + : [v0] "=&r"(v0)); \ + mips_barrier(); \ + return (v0); \ +} \ +static __inline void \ +mips_wr_ ## n ## s(uint32_t a0) \ +{ \ + __asm __volatile ("mtc0 %[a0], $"__XSTRING(r)", "__XSTRING(s)";" \ + __XSTRING(COP0_SYNC)";" \ + "nop;" \ + "nop;" \ + : \ + : [a0] "r"(a0)); \ + mips_barrier(); \ +} struct __hack + #ifdef TARGET_OCTEON static __inline void mips_sync_icache (void) { @@ -197,6 +219,9 @@ static __inline void mips_sync_icache (v MIPS_RDRW32_COP0(compare, MIPS_COP_0_COMPARE); MIPS_RDRW32_COP0(config, MIPS_COP_0_CONFIG); +MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 1); +MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 2); +MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 3); MIPS_RDRW32_COP0(count, MIPS_COP_0_COUNT); MIPS_RDRW32_COP0(index, MIPS_COP_0_TLB_INDEX); MIPS_RDRW32_COP0(wired, MIPS_COP_0_TLB_WIRED); @@ -211,26 +236,15 @@ MIPS_RDRW32_COP0(entryhi, MIPS_COP_0_TLB MIPS_RDRW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); MIPS_RDRW32_COP0(prid, MIPS_COP_0_PRID); MIPS_RDRW32_COP0(watchlo, MIPS_COP_0_WATCH_LO); +MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 1); +MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 2); +MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 3); MIPS_RDRW32_COP0(watchhi, MIPS_COP_0_WATCH_HI); +MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 1); +MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 2); +MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 3); #undef MIPS_RDRW32_COP0 -#define MIPS_RD_CONFIG_SEL(sel) \ -static __inline uint32_t \ -mips_rd_config_sel##sel(void) \ -{ \ - int v0; \ - __asm __volatile("mfc0 %[v0], $16, " #sel " ;" \ - : [v0] "=&r" (v0)); \ - mips_barrier(); \ - return (v0); \ -} - - -MIPS_RD_CONFIG_SEL(1); -MIPS_RD_CONFIG_SEL(2); -MIPS_RD_CONFIG_SEL(3); -#undef MIPS_RD_CONFIG_SEL - static __inline register_t intr_disable(void) { Modified: projects/mips/sys/mips/mips/cpu.c ============================================================================== --- projects/mips/sys/mips/mips/cpu.c Mon Apr 27 18:27:54 2009 (r191576) +++ projects/mips/sys/mips/mips/cpu.c Mon Apr 27 18:29:59 2009 (r191577) @@ -89,7 +89,7 @@ mips_get_identity(struct mips_cpuinfo *c return; /* Learn TLB size and L1 cache geometry. */ - cfg1 = mips_rd_config_sel1(); + cfg1 = mips_rd_config1(); cpuinfo->tlb_nentries = ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1; @@ -226,14 +226,14 @@ cpu_identify(void) if (!(cfg0 & MIPS3_CONFIG_CM)) return; - cfg1 = mips_rd_config_sel1(); + cfg1 = mips_rd_config1(); printf(" Config1=0x%b\n", cfg1, "\20\7COP2\6MDMX\5PerfCount\4WatchRegs\3MIPS16\2EJTAG\1FPU"); /* If config register selection 2 does not exist, exit. */ if (!(cfg1 & MIPS3_CONFIG_CM)) return; - cfg2 = mips_rd_config_sel2(); + cfg2 = mips_rd_config2(); /* * Config2 contains no useful information other then Config3 * existence flag @@ -242,7 +242,7 @@ cpu_identify(void) /* If config register selection 3 does not exist, exit. */ if (!(cfg2 & MIPS3_CONFIG_CM)) return; - cfg3 = mips_rd_config_sel3(); + cfg3 = mips_rd_config3(); /* Print Config3 if it contains any useful info */ if (cfg3 & ~(0x80000000)) From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 18:46:19 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 86408106566B; Mon, 27 Apr 2009 18:46:19 +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 73EF38FC20; Mon, 27 Apr 2009 18:46:19 +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 n3RIkJgV023260; Mon, 27 Apr 2009 18:46:19 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RIkJUr023258; Mon, 27 Apr 2009 18:46:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271846.n3RIkJUr023258@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 18:46:19 +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: r191582 - 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: Mon, 27 Apr 2009 18:46:19 -0000 Author: rpaulo Date: Mon Apr 27 18:46:19 2009 New Revision: 191582 URL: http://svn.freebsd.org/changeset/base/191582 Log: * sync mesh conf ie with latest draft * add add_meshconf() function to add this IE to a frame. * while there, simplify names of mesh conf variables and defines. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 18:39:55 2009 (r191581) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 18:46:19 2009 (r191582) @@ -490,6 +490,33 @@ ieee80211_add_meshid(uint8_t *frm, struc return frm + vap->iv_meshidlen; } +/* + * Add a Mesh Configuration element to a frame. + * For now just use HWMP routing, Airtime link metric, Null Congestion + * Signaling, Null Sync Protocol and Null Authentication. + */ +uint8_t * +ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap) +{ + static const struct ieee80211_meshconf_ie ie = { + .conf_ie = IEEE80211_ELEMID_MESHCONF, + .conf_len = sizeof(struct ieee80211_meshconf_ie) - 2, + .conf_ver = IEEE80211_MESHCONF_VERSION, + .conf_pselid = IEEE80211_MESHCONF_HWMP, + .conf_pmetid = IEEE80211_MESHCONF_AIRTIME, + .conf_ccid = IEEE80211_MESHCONF_NULL, + .conf_syncid = IEEE80211_MESHCONF_NULL, + .conf_authid = IEEE80211_MESHCONF_NULL, + .conf_form = 0, /* XXX */ + .conf_cap = 1, /* XXX */ + }; + + KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a mbss vap")); + memcpy(frm, &ie, sizeof(ie)); + + return frm + sizeof(ie); +} + void ieee80211_create_mbss(struct ieee80211vap *vap, struct ieee80211_channel *chan) { Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Apr 27 18:39:55 2009 (r191581) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Apr 27 18:46:19 2009 (r191582) @@ -39,23 +39,36 @@ struct ieee80211_meshconf_ie { uint8_t conf_ie; /* IEEE80211_ELEMID_MESHCONF */ uint8_t conf_len; uint8_t conf_ver; - uint32_t conf_apspi; /* Active Path Sel. Proto. ID */ - uint32_t conf_apsmi; /* APS Metric Identifier */ - uint32_t conf_ccmi; /* Congestion Control Mode ID */ - uint8_t conf_finfo; /* Formation Information */ + uint32_t conf_pselid; /* Active Path Sel. Proto. ID */ + uint32_t conf_pmetid; /* APS Metric Identifier */ + uint32_t conf_ccid; /* Congestion Control Mode ID */ + uint32_t conf_syncid; /* Sync. Protocol ID */ + uint32_t conf_authid; /* Auth. Protocol ID */ + uint8_t conf_form; /* Formation Information */ uint8_t conf_cap; } __packed; -#define IEEE80211_MESHCONF_APSPI_HWMP_OUI 0x000fac -#define IEEE80211_MESHCONF_APSPI_HWMP_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_APSMI_AIRTIME_OUI 0x000fac -#define IEEE80211_MESHCONF_APSMI_AIRTIME_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_CCMI_DEFAULT_OUI 0x000fac -#define IEEE80211_MESHCONF_CCMI_DEFAULT_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_CCMI_NULL_OUI 0x000fac -#define IEEE80211_MESHCONF_CCMI_NULL_VALUE 255 +#define IEEE80211_MESHCONF_VERSION 1 +#define IEEE80211_MESHCONF_NULL_OUI 0x000fac /* Null Protocol */ +#define IEEE80211_MESHCONF_NULL_VALUE 255 +#define IEEE80211_MESHCONF_NULL (IEEE80211_MESHCONF_NULL_OUI << 8 | IEEE80211_MESHCONF_NULL_VALUE) +#define IEEE80211_MESHCONF_HWMP_OUI 0x000fac +#define IEEE80211_MESHCONF_HWMP_VALUE 0xff /* XXX Linux */ +#define IEEE80211_MESHCONF_HWMP (IEEE80211_MESHCONF_HWMP_OUI << 8 | IEEE80211_MESHCONF_HWMP_VALUE) +#define IEEE80211_MESHCONF_AIRTIME_OUI 0x000fac +#define IEEE80211_MESHCONF_AIRTIME_VALUE 0xff /* XXX Linux */ +#define IEEE80211_MESHCONF_AIRTIME (IEEE80211_MESHCONF_AIRTIME_OUI << 8 | IEEE80211_MESHCONF_AIRTIME_VALUE) +#define IEEE80211_MESHCONF_CCSIG_OUI 0x000fac +#define IEEE80211_MESHCONF_CCSIG_VALUE 0xff /* XXX Linux */ +#define IEEE80211_MESHCONF_NEIGHOFF_OUI 0x000fac /* Neighbour offset */ +#define IEEE80211_MESHCONF_NEIGHOFF_VALUE 0 +#define IEEE80211_MESHCONF_NEIGHOFF (IEEE80211_MESHCONF_NEIGHOFF_OUI << 8 | IEEE80211_MESHCONF_NEIGHOFF_VALUE) +#define IEEE80211_MESHCONF_SAE_OUI 0x000fac +#define IEEE80211_MESHCONF_SAE_VALUE 1 +#define IEEE80211_MESHCONF_SAE (IEEE80211_MESHCONF_SAE_OUI << 8 | IEEE80211_MESHCONF_SAE_VALUE) #define IEEE80211_MESHCONF_FORM_MP (1 << 1) /* connected to portal */ #define IEEE80211_MESHCONF_FORM_NEIGH (1 << 4) /* no of neighbours */ +/* XXX ... */ /* Mesh Identifier */ struct ieee80211_meshid_ie { @@ -293,6 +306,7 @@ void ieee80211_mesh_attach(struct ieee8 void ieee80211_mesh_detach(struct ieee80211com *); void ieee80211_parse_meshid(struct ieee80211_node *, const uint8_t *); uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *); +uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); void ieee80211_create_mbss(struct ieee80211vap *, struct ieee80211_channel *); From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 18:46:57 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 DFECE106564A; Mon, 27 Apr 2009 18:46:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDFD78FC1B; Mon, 27 Apr 2009 18:46:57 +0000 (UTC) (envelope-from gonzo@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 n3RIkvYZ023305; Mon, 27 Apr 2009 18:46:57 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RIkvhI023304; Mon, 27 Apr 2009 18:46:57 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200904271846.n3RIkvhI023304@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 Apr 2009 18:46:57 +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: r191583 - projects/mips/sys/mips/mips 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: Mon, 27 Apr 2009 18:46:58 -0000 Author: gonzo Date: Mon Apr 27 18:46:57 2009 New Revision: 191583 URL: http://svn.freebsd.org/changeset/base/191583 Log: - Use new spacebus - Be a bit more verbose on failures - style(9) fixes - Use default rid value of 0 instead of MIPS_MEM_RID (0x20) Modified: projects/mips/sys/mips/mips/nexus.c Modified: projects/mips/sys/mips/mips/nexus.c ============================================================================== --- projects/mips/sys/mips/mips/nexus.c Mon Apr 27 18:46:19 2009 (r191582) +++ projects/mips/sys/mips/mips/nexus.c Mon Apr 27 18:46:57 2009 (r191583) @@ -255,13 +255,14 @@ nexus_hinted_child(device_t bus, const c if ((mem_hints_count > 0) && (mem_hints_count < 2)) { printf("Either maddr or msize hint is missing for %s%d\n", dname, dunit); - } else if (mem_hints_count) { + } + else if (mem_hints_count) { dprintf("%s: discovered hinted child %s at maddr %p(%d)\n", __func__, device_get_nameunit(child), (void *)(intptr_t)maddr, msize); - result = bus_set_resource(child, SYS_RES_MEMORY, MIPS_MEM_RID, - maddr, msize); + result = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, + msize); if (result != 0) { device_printf(bus, "warning: bus_set_resource() failed\n"); @@ -351,7 +352,8 @@ nexus_alloc_resource(device_t bus, devic rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) { - printf("%s: could not reserve resource\n", __func__); + printf("%s: could not reserve resource for %s\n", __func__, + device_get_nameunit(child)); return (0); } @@ -391,7 +393,7 @@ nexus_activate_resource(device_t bus, de vaddr = (caddr_t) pmap_mapdev(paddr-poffs, psize+poffs) + poffs; rman_set_virtual(r, vaddr); - rman_set_bustag(r, MIPS_BUS_SPACE_MEM); + rman_set_bustag(r, mips_bus_space_generic); #ifdef TARGET_OCTEON temp = 0x0000000000000000; temp |= (uint32_t)vaddr; From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 18:59:40 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 C39C1106567C; Mon, 27 Apr 2009 18:59:40 +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 B1D988FC27; Mon, 27 Apr 2009 18:59:40 +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 n3RIxe7e023617; Mon, 27 Apr 2009 18:59:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RIxePs023616; Mon, 27 Apr 2009 18:59:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271859.n3RIxePs023616@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 18:59:40 +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: r191585 - 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: Mon, 27 Apr 2009 18:59:41 -0000 Author: rpaulo Date: Mon Apr 27 18:59:40 2009 New Revision: 191585 URL: http://svn.freebsd.org/changeset/base/191585 Log: Append Mesh Configuration IE on probe responses and beacons. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 18:55:22 2009 (r191584) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Apr 27 18:59:40 2009 (r191585) @@ -2058,7 +2058,7 @@ ieee80211_alloc_proberesp(struct ieee802 + sizeof(struct ieee80211_ath_ie) #endif + 2 + IEEE80211_MESHID_LEN - /* + sizeof(struct ieee80211_meshconf_ie) */ + + sizeof(struct ieee80211_meshconf_ie) + (vap->iv_appie_proberesp != NULL ? vap->iv_appie_proberesp->ie_len : 0) ); @@ -2454,7 +2454,7 @@ ieee80211_beacon_construct(struct mbuf * } if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); - /* frm = ieee80211_add_meshconf(frm, vap); */ + frm = ieee80211_add_meshconf(frm, vap); /* struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm; tie->tim_ie = IEEE80211_ELEMID_TIM; tie->tim_len = 4; * length * @@ -2543,8 +2543,8 @@ ieee80211_beacon_alloc(struct ieee80211_ #endif + (vap->iv_opmode == IEEE80211_M_MBSS ? 2 + ni->ni_meshidlen : 0) - /* + (vap->iv_opmode == IEEE80211_M_MBSS ? - sizeof(struct ieee80211_meshconf_ie) : 0) */ + + (vap->iv_opmode == IEEE80211_M_MBSS ? + sizeof(struct ieee80211_meshconf_ie) : 0) + IEEE80211_MAX_APPIE ; m = ieee80211_getmgtframe(&frm, From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 19:18:58 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 35AE310656CF; Mon, 27 Apr 2009 19:18:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED83F8FC27; Mon, 27 Apr 2009 19:18:55 +0000 (UTC) (envelope-from gonzo@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 n3RJItBq024248; Mon, 27 Apr 2009 19:18:55 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RJItqM024247; Mon, 27 Apr 2009 19:18:55 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200904271918.n3RJItqM024247@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 27 Apr 2009 19:18:55 +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: r191589 - projects/mips/sys/mips/include 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: Mon, 27 Apr 2009 19:19:00 -0000 Author: gonzo Date: Mon Apr 27 19:18:55 2009 New Revision: 191589 URL: http://svn.freebsd.org/changeset/base/191589 Log: - Cast argument to proper type in order to avoid warnings like "shift value is too large for given type" Modified: projects/mips/sys/mips/include/endian.h Modified: projects/mips/sys/mips/include/endian.h ============================================================================== --- projects/mips/sys/mips/include/endian.h Mon Apr 27 19:15:33 2009 (r191588) +++ projects/mips/sys/mips/include/endian.h Mon Apr 27 19:18:55 2009 (r191589) @@ -108,12 +108,12 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) -#define __bswap32(x) (__uint32_t)(__is_constant(x) ? __bswap32_const(x) : \ - __bswap32_var(x)) -#define __bswap64(x) (__uint64_t)(__is_constant(x) ? __bswap64_const(x) : \ - __bswap64_var(x)) +#define __bswap16(x) (__uint16_t)(__is_constant(x) ? \ + __bswap16_const((__uint16_t)x) : __bswap16_var((__uint16_t)x)) +#define __bswap32(x) (__uint32_t)(__is_constant(x) ? \ + __bswap32_const((__uint32_t)x) : __bswap32_var((__uint32_t)x)) +#define __bswap64(x) (__uint64_t)(__is_constant(x) ? \ + __bswap64_const((__uint64_t)x) : __bswap64_var((__uint64_t)x)) #ifdef __MIPSEB__ #define __htonl(x) ((__uint32_t)(x)) From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 02:59:19 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 42452106564A; Tue, 28 Apr 2009 02:59:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFD8F8FC15; Tue, 28 Apr 2009 02:59:18 +0000 (UTC) (envelope-from gonzo@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 n3S2xIN0034694; Tue, 28 Apr 2009 02:59:18 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3S2xICj034693; Tue, 28 Apr 2009 02:59:18 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200904280259.n3S2xICj034693@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 28 Apr 2009 02:59:18 +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: r191613 - projects/mips/sys/mips/mips 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: Tue, 28 Apr 2009 02:59:19 -0000 Author: gonzo Date: Tue Apr 28 02:59:18 2009 New Revision: 191613 URL: http://svn.freebsd.org/changeset/base/191613 Log: - When destroying va -> pa mapping writeback all caches or we may endup with partial page content in SDRAM - style(9) fix Modified: projects/mips/sys/mips/mips/pmap.c Modified: projects/mips/sys/mips/mips/pmap.c ============================================================================== --- projects/mips/sys/mips/mips/pmap.c Mon Apr 27 23:43:28 2009 (r191612) +++ projects/mips/sys/mips/mips/pmap.c Tue Apr 28 02:59:18 2009 (r191613) @@ -699,6 +699,11 @@ pmap_kremove(vm_offset_t va) { register pt_entry_t *pte; + /* + * Write back all caches from the page being destroyed + */ + mips_dcache_wbinv_range(va, NBPG); + pte = pmap_pte(kernel_pmap, va); *pte = PTE_G; pmap_invalidate_page(kernel_pmap, va); @@ -1523,6 +1528,12 @@ pmap_remove_page(struct pmap *pmap, vm_o if (!ptq || !pmap_pte_v(ptq)) { return; } + + /* + * Write back all caches from the page being destroyed + */ + mips_dcache_wbinv_range(va, NBPG); + /* * get a local va for mappings for this pmap. */ @@ -1608,6 +1619,14 @@ pmap_remove_all(vm_page_t m) while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { PMAP_LOCK(pv->pv_pmap); + + /* + * If it's last mapping writeback all caches from + * the page being destroyed + */ + if (m->md.pv_list_count == 1) + mips_dcache_wbinv_range(pv->pv_va, NBPG); + pv->pv_pmap->pm_stats.resident_count--; pte = pmap_pte(pv->pv_pmap, pv->pv_va); @@ -2501,9 +2520,7 @@ pmap_remove_pages(pmap_t pmap) PMAP_LOCK(pmap); sched_pin(); //XXX need to be TAILQ_FOREACH_SAFE ? - for (pv = TAILQ_FIRST(&pmap->pm_pvlist); - pv; - pv = npv) { + for (pv = TAILQ_FIRST(&pmap->pm_pvlist); pv; pv = npv) { pte = pmap_pte(pv->pv_pmap, pv->pv_va); if (!pmap_pte_v(pte)) From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 11:30:18 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 D5A8A1065672; Tue, 28 Apr 2009 11:30:18 +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 C40BD8FC36; Tue, 28 Apr 2009 11:30:18 +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 n3SBUIbH048282; Tue, 28 Apr 2009 11:30:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SBUId9048280; Tue, 28 Apr 2009 11:30:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281130.n3SBUId9048280@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 11:30:18 +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: r191622 - 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: Tue, 28 Apr 2009 11:30:19 -0000 Author: rpaulo Date: Tue Apr 28 11:30:18 2009 New Revision: 191622 URL: http://svn.freebsd.org/changeset/base/191622 Log: Second try at filling up a mesh conf IE. This now avoids any endianess problems and, as a result, Linux is now trying to establish a link with us! Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Apr 28 11:10:33 2009 (r191621) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Apr 28 11:30:18 2009 (r191622) @@ -504,9 +504,9 @@ ieee80211_add_meshconf(uint8_t *frm, str .conf_ver = IEEE80211_MESHCONF_VERSION, .conf_pselid = IEEE80211_MESHCONF_HWMP, .conf_pmetid = IEEE80211_MESHCONF_AIRTIME, - .conf_ccid = IEEE80211_MESHCONF_NULL, - .conf_syncid = IEEE80211_MESHCONF_NULL, - .conf_authid = IEEE80211_MESHCONF_NULL, + .conf_ccid = IEEE80211_MESHCONF_CCSIG, + .conf_syncid = { 0, 0, 0, 0 }, /* XXX */ + .conf_authid = { 0x80, 0, 0, 0 }, /* XXX */ .conf_form = 0, /* XXX */ .conf_cap = 1, /* XXX */ }; Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Apr 28 11:10:33 2009 (r191621) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Apr 28 11:30:18 2009 (r191622) @@ -39,33 +39,40 @@ struct ieee80211_meshconf_ie { uint8_t conf_ie; /* IEEE80211_ELEMID_MESHCONF */ uint8_t conf_len; uint8_t conf_ver; - uint32_t conf_pselid; /* Active Path Sel. Proto. ID */ - uint32_t conf_pmetid; /* APS Metric Identifier */ - uint32_t conf_ccid; /* Congestion Control Mode ID */ - uint32_t conf_syncid; /* Sync. Protocol ID */ - uint32_t conf_authid; /* Auth. Protocol ID */ + uint8_t conf_pselid[4]; /* Active Path Sel. Proto. ID */ + uint8_t conf_pmetid[4]; /* APS Metric Identifier */ + uint8_t conf_ccid[4]; /* Congestion Control Mode ID */ + uint8_t conf_syncid[4]; /* Sync. Protocol ID */ + uint8_t conf_authid[4]; /* Auth. Protocol ID */ uint8_t conf_form; /* Formation Information */ uint8_t conf_cap; } __packed; #define IEEE80211_MESHCONF_VERSION 1 -#define IEEE80211_MESHCONF_NULL_OUI 0x000fac /* Null Protocol */ -#define IEEE80211_MESHCONF_NULL_VALUE 255 -#define IEEE80211_MESHCONF_NULL (IEEE80211_MESHCONF_NULL_OUI << 8 | IEEE80211_MESHCONF_NULL_VALUE) -#define IEEE80211_MESHCONF_HWMP_OUI 0x000fac +/* Null Protocol */ +#define IEEE80211_MESHCONF_NULL_OUI 0x00, 0x0f, 0xac +#define IEEE80211_MESHCONF_NULL_VALUE 0xff +#define IEEE80211_MESHCONF_NULL { IEEE80211_MESHCONF_NULL_OUI, IEEE80211_MESHCONF_NULL_VALUE } +/* Hybrid Wireless Mesh Protocol */ +#define IEEE80211_MESHCONF_HWMP_OUI 0x00, 0x0f, 0xac #define IEEE80211_MESHCONF_HWMP_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_HWMP (IEEE80211_MESHCONF_HWMP_OUI << 8 | IEEE80211_MESHCONF_HWMP_VALUE) -#define IEEE80211_MESHCONF_AIRTIME_OUI 0x000fac +#define IEEE80211_MESHCONF_HWMP { IEEE80211_MESHCONF_HWMP_OUI, IEEE80211_MESHCONF_HWMP_VALUE } +/* Airtime Link Metric */ +#define IEEE80211_MESHCONF_AIRTIME_OUI 0x00, 0x0f, 0xac #define IEEE80211_MESHCONF_AIRTIME_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_AIRTIME (IEEE80211_MESHCONF_AIRTIME_OUI << 8 | IEEE80211_MESHCONF_AIRTIME_VALUE) -#define IEEE80211_MESHCONF_CCSIG_OUI 0x000fac +#define IEEE80211_MESHCONF_AIRTIME { IEEE80211_MESHCONF_AIRTIME_OUI, IEEE80211_MESHCONF_AIRTIME_VALUE } +/* Congestion Control Signaling */ +#define IEEE80211_MESHCONF_CCSIG_OUI 0x00, 0x0f, 0xac #define IEEE80211_MESHCONF_CCSIG_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_NEIGHOFF_OUI 0x000fac /* Neighbour offset */ -#define IEEE80211_MESHCONF_NEIGHOFF_VALUE 0 -#define IEEE80211_MESHCONF_NEIGHOFF (IEEE80211_MESHCONF_NEIGHOFF_OUI << 8 | IEEE80211_MESHCONF_NEIGHOFF_VALUE) -#define IEEE80211_MESHCONF_SAE_OUI 0x000fac -#define IEEE80211_MESHCONF_SAE_VALUE 1 -#define IEEE80211_MESHCONF_SAE (IEEE80211_MESHCONF_SAE_OUI << 8 | IEEE80211_MESHCONF_SAE_VALUE) +#define IEEE80211_MESHCONF_CCSIG { IEEE80211_MESHCONF_CCSIG_OUI, IEEE80211_MESHCONF_CCSIG_VALUE } +/* Neighbour Offset */ +#define IEEE80211_MESHCONF_NEIGHOFF_OUI 0x00, 0x0f, 0xac +#define IEEE80211_MESHCONF_NEIGHOFF_VALUE 0x00 +#define IEEE80211_MESHCONF_NEIGHOFF { IEEE80211_MESHCONF_NEIGHOFF_OUI, IEEE80211_MESHCONF_NEIGHOFF_VALUE } +/* Simultaneous Authenticaction of Equals */ +#define IEEE80211_MESHCONF_SAE_OUI 0x00, 0x0f, 0xac +#define IEEE80211_MESHCONF_SAE_VALUE 0x01 +#define IEEE80211_MESHCONF_SAE { IEEE80211_MESHCONF_SAE_OUI, IEEE80211_MESHCONF_SAE_VALUE } #define IEEE80211_MESHCONF_FORM_MP (1 << 1) /* connected to portal */ #define IEEE80211_MESHCONF_FORM_NEIGH (1 << 4) /* no of neighbours */ /* XXX ... */ From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 11:35:23 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 4D044106564A; Tue, 28 Apr 2009 11:35:23 +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 3B6F88FC1A; Tue, 28 Apr 2009 11:35:23 +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 n3SBZNih048422; Tue, 28 Apr 2009 11:35:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SBZNj6048420; Tue, 28 Apr 2009 11:35:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281135.n3SBZNj6048420@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 11:35:23 +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: r191623 - 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: Tue, 28 Apr 2009 11:35:23 -0000 Author: rpaulo Date: Tue Apr 28 11:35:22 2009 New Revision: 191623 URL: http://svn.freebsd.org/changeset/base/191623 Log: * Forgot to add Mesh Conf IE to probe responses. * Add TIM to Mesh beacons by reusing hostap code. (Mesh TIM is equal as the non-mesh version. The IE may differ in the future if ANA allocates a new one, but for now use one we already have.) Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Apr 28 11:30:18 2009 (r191622) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Apr 28 11:35:22 2009 (r191623) @@ -128,16 +128,8 @@ struct ieee80211_meshcsa_ie { uint8_t csa_count; } __packed; -/* XXXRP: this is equal to the non mesh version. Should we simplify ? */ /* Mesh TIM */ -struct ieee80211_meshtim_ie { - uint8_t tim_ie; /* IEEE80211_ELEMID_MESHTIM */ - uint8_t tim_len; - uint8_t tim_count; /* DTIM count */ - uint8_t tim_period; /* DTIM period */ - uint8_t tim_bitctl; /* bitmap control */ - uint8_t tim_bitmap[1]; /* variable-length bitmap */ -} __packed; +/* Equal to the non Mesh version */ /* Mesh Awake Window */ struct ieee80211_meshawakew_ie { Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Tue Apr 28 11:30:18 2009 (r191622) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Tue Apr 28 11:35:22 2009 (r191623) @@ -2150,7 +2150,7 @@ ieee80211_alloc_proberesp(struct ieee802 frm = add_appie(frm, vap->iv_appie_proberesp); if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); - /* frm = ieee80211_add_mesconf(frm, vap); */ + frm = ieee80211_add_mesconf(frm, vap); } m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); @@ -2382,7 +2382,9 @@ ieee80211_beacon_construct(struct mbuf * *frm++ = 2; *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ bo->bo_tim_len = 0; - } else if (vap->iv_opmode == IEEE80211_M_HOSTAP) { + } else if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_MBSS) { + /* TIM IE is the same for Mesh and Hostap */ struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm; tie->tim_ie = IEEE80211_ELEMID_TIM; @@ -2455,14 +2457,6 @@ ieee80211_beacon_construct(struct mbuf * if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); - /* struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm; - tie->tim_ie = IEEE80211_ELEMID_TIM; - tie->tim_len = 4; * length * - tie->tim_count = 0; * DTIM count * - tie->tim_period = vap->iv_dtim_period; * DTIM period * - tie->tim_bitctl = 0; * bitmap control * - tie->tim_bitmap[0] = 0; * Partial Virtual Bitmap * - frm += sizeof(struct ieee80211_tim_ie); */ } bo->bo_tim_trailer_len = frm - bo->bo_tim_trailer; bo->bo_csa_trailer_len = frm - bo->bo_csa; From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 11:36:13 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 22325106566B; Tue, 28 Apr 2009 11:36:13 +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 110B68FC0A; Tue, 28 Apr 2009 11:36:13 +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 n3SBaCe5048472; Tue, 28 Apr 2009 11:36:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SBaCC0048471; Tue, 28 Apr 2009 11:36:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281136.n3SBaCC0048471@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 11:36: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: r191624 - 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: Tue, 28 Apr 2009 11:36:13 -0000 Author: rpaulo Date: Tue Apr 28 11:36:12 2009 New Revision: 191624 URL: http://svn.freebsd.org/changeset/base/191624 Log: Fix typo in previous commit. Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Tue Apr 28 11:35:22 2009 (r191623) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Tue Apr 28 11:36:12 2009 (r191624) @@ -2150,7 +2150,7 @@ ieee80211_alloc_proberesp(struct ieee802 frm = add_appie(frm, vap->iv_appie_proberesp); if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); - frm = ieee80211_add_mesconf(frm, vap); + frm = ieee80211_add_meshconf(frm, vap); } m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 13:22:40 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 DF58D106566B; Tue, 28 Apr 2009 13:22:40 +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 CE46D8FC13; Tue, 28 Apr 2009 13:22:40 +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 n3SDMe6D050681; Tue, 28 Apr 2009 13:22:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SDMe9I050680; Tue, 28 Apr 2009 13:22:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281322.n3SDMe9I050680@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 13:22:40 +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: r191628 - projects/mesh11s/usr.sbin/wlandebug 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: Tue, 28 Apr 2009 13:22:41 -0000 Author: rpaulo Date: Tue Apr 28 13:22:40 2009 New Revision: 191628 URL: http://svn.freebsd.org/changeset/base/191628 Log: Sync with sys and add mesh debug bit. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/usr.sbin/wlandebug/wlandebug.c Modified: projects/mesh11s/usr.sbin/wlandebug/wlandebug.c ============================================================================== --- projects/mesh11s/usr.sbin/wlandebug/wlandebug.c Tue Apr 28 11:56:54 2009 (r191627) +++ projects/mesh11s/usr.sbin/wlandebug/wlandebug.c Tue Apr 28 13:22:40 2009 (r191628) @@ -65,7 +65,7 @@ const char *progname; #define IEEE80211_MSG_DOT1XSM 0x00010000 /* 802.1x state machine */ #define IEEE80211_MSG_RADIUS 0x00008000 /* 802.1x radius client */ #define IEEE80211_MSG_RADDUMP 0x00004000 /* dump 802.1x radius packets */ -#define IEEE80211_MSG_RADKEYS 0x00002000 /* dump 802.1x keys */ +#define IEEE80211_MSG_MES 0x00002000 /* mesh networking */ #define IEEE80211_MSG_WPA 0x00001000 /* WPA/RSN protocol */ #define IEEE80211_MSG_ACL 0x00000800 /* ACL handling */ #define IEEE80211_MSG_WME 0x00000400 /* WME protocol */ @@ -101,7 +101,7 @@ static struct { { "dot1xsm", IEEE80211_MSG_DOT1XSM }, { "radius", IEEE80211_MSG_RADIUS }, { "raddump", IEEE80211_MSG_RADDUMP }, - { "radkeys", IEEE80211_MSG_RADKEYS }, + { "mesh", IEEE80211_MSG_MESH }, { "wpa", IEEE80211_MSG_WPA }, { "acl", IEEE80211_MSG_ACL }, { "wme", IEEE80211_MSG_WME }, From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 13:23:13 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 AB7C91065676; Tue, 28 Apr 2009 13:23:13 +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 9A5EF8FC0A; Tue, 28 Apr 2009 13:23:13 +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 n3SDNDCM050735; Tue, 28 Apr 2009 13:23:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SDNDUP050734; Tue, 28 Apr 2009 13:23:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281323.n3SDNDUP050734@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 13:23:13 +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: r191629 - 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: Tue, 28 Apr 2009 13:23:13 -0000 Author: rpaulo Date: Tue Apr 28 13:23:13 2009 New Revision: 191629 URL: http://svn.freebsd.org/changeset/base/191629 Log: Use proper mesh debug bit. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Apr 28 13:22:40 2009 (r191628) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Apr 28 13:23:13 2009 (r191629) @@ -523,7 +523,7 @@ ieee80211_create_mbss(struct ieee80211va struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; - IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, + IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, "%s: creating mbss on channel %u\n", __func__, ieee80211_chan2ieee(ic, chan)); From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 17:36:31 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 372A41065677; Tue, 28 Apr 2009 17:36:31 +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 0B72D8FC23; Tue, 28 Apr 2009 17:36:31 +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 n3SHaUAZ055524; Tue, 28 Apr 2009 17:36:30 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SHaU3a055523; Tue, 28 Apr 2009 17:36:30 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281736.n3SHaU3a055523@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 17:36:30 +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: r191630 - 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: Tue, 28 Apr 2009 17:36:31 -0000 Author: rpaulo Date: Tue Apr 28 17:36:30 2009 New Revision: 191630 URL: http://svn.freebsd.org/changeset/base/191630 Log: Sync again with draft. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Apr 28 13:23:13 2009 (r191629) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Apr 28 17:36:30 2009 (r191630) @@ -149,27 +149,6 @@ struct ieee80211_meshbeacont_ie { } mp[1] __packed; /* NB: variable size */ } __packed; -/* Mesh Timing Info */ -struct ieee80211_meshtinfo_ie { - uint8_t tinfo_ie; /* IEEE80211_ELEMID_MESHTIMINGINFO */ - uint8_t tinfo_len; - uint8_t tinfo_field; -} __packed; - -#define IEEE80211_MESH_TINFO_BEACON_PARAMS_CHANGED (1 << 8) -#define IEEE80211_MESH_TINFO_MDA_ENABLED (1 << 7) - -/* Synchronization Protocol */ -struct ieee80211_meshsyncproto_ie { - uint8_t syncproto_ie; /* IEEE80211_ELEMID_MESHSYNCPROTO */ - uint8_t syncproto_len; - uint32_t syncproto_id; /* Sync Protocol ID OUI */ -} __packed; - -/* Neighbour Offset Protocol */ -#define IEEE80211_MESH_SYNCPROTO_NEIGHOFFSET_OUI 0x000fac -#define IEEE80211_MESH_SYNCPROTO_NEIGHOFFSET_VALUE 0 - /* MDAOP Setup Request */ struct ieee80211_meshdaopsreq_ie { uint8_t daopsreq_ie; /* IEEE80211_ELEMID_MESHDAOPSREQ */ @@ -271,36 +250,6 @@ struct ieee80211_meshpuc_ie { uint8_t puc_daddr[IEEE80211_ADDR_LEN]; } __packed; -/* Mesh Security Capability */ -struct ieee80211_meshsc_ie { - uint8_t sc_ie; /* IEEE80211_ELEMID_MESHSC */ - uint8_t sc_len; - uint8_t sc_mkdid[IEEE80211_ADDR_LEN]; /* MKD Domain ID */ - uint8_t sc_sconfig; /* Security Configuration */ -} __packed; - -/* Mesh Security Authentication */ -struct ieee80211_meshsa_ie { - uint8_t sa_ie; /* IEEE80211_ELEMID_MESHSA */ - uint8_t sa_len; - uint8_t sa_handshake; - uint8_t sa_maid[IEEE80211_ADDR_LEN]; /* MA-ID */ - uint8_t sa_lmpid[IEEE80211_ADDR_LEN]; - uint32_t sa_akm; /* Selected AKM Suite */ - uint32_t sa_pcs; /* Selected Pairwise Cipher Suite */ - uint8_t sa_pmk[16]; - uint8_t sa_lnonce[32]; - uint8_t sa_pnonce[32]; - /* XXX more parameters */ -} __packed; - -/* Mesh Anti-Clogging Token */ -struct ieee80211_meshact_ie { - uint8_t act_ie; /* IEEE80211_ELEMID_MESHACT */ - uint8_t act_len; -} __packed; - - void ieee80211_mesh_attach(struct ieee80211com *); void ieee80211_mesh_detach(struct ieee80211com *); void ieee80211_parse_meshid(struct ieee80211_node *, const uint8_t *); From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 17:41:19 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 32FA21065676; Tue, 28 Apr 2009 17:41:19 +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 06A408FC18; Tue, 28 Apr 2009 17:41:19 +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 n3SHfI64055649; Tue, 28 Apr 2009 17:41:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SHfI0U055648; Tue, 28 Apr 2009 17:41:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281741.n3SHfI0U055648@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 17:41:18 +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: r191631 - 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: Tue, 28 Apr 2009 17:41:19 -0000 Author: rpaulo Date: Tue Apr 28 17:41:18 2009 New Revision: 191631 URL: http://svn.freebsd.org/changeset/base/191631 Log: Mesh nodes always set the BSSID to zero when transmitting beacons and probe responses. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Tue Apr 28 17:36:30 2009 (r191630) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Tue Apr 28 17:41:18 2009 (r191631) @@ -420,11 +420,11 @@ ieee80211_send_setup( const uint8_t bssid[IEEE80211_ADDR_LEN]) { #define WH4(wh) ((struct ieee80211_frame_addr4 *)wh) + static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; + struct ieee80211vap *vap = ni->ni_vap; wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { - struct ieee80211vap *vap = ni->ni_vap; - switch (vap->iv_opmode) { case IEEE80211_M_STA: wh->i_fc[1] = IEEE80211_FC1_DIR_TODS; @@ -462,7 +462,10 @@ ieee80211_send_setup( wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; IEEE80211_ADDR_COPY(wh->i_addr1, da); IEEE80211_ADDR_COPY(wh->i_addr2, sa); - IEEE80211_ADDR_COPY(wh->i_addr3, bssid); + if (vap->iv_opmode == IEEE80211_M_MBSS) + IEEE80211_ADDR_COPY(wh->i_addr3, zerobssid); + else + IEEE80211_ADDR_COPY(wh->i_addr3, bssid); } *(uint16_t *)&wh->i_dur[0] = 0; *(uint16_t *)&wh->i_seq[0] = @@ -2470,6 +2473,7 @@ struct mbuf * ieee80211_beacon_alloc(struct ieee80211_node *ni, struct ieee80211_beacon_offsets *bo) { + static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = vap->iv_ifp; @@ -2560,7 +2564,10 @@ ieee80211_beacon_alloc(struct ieee80211_ *(uint16_t *)wh->i_dur = 0; IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr); - IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid); + if (vap->iv_opmode == IEEE80211_M_MBSS) + IEEE80211_ADDR_COPY(wh->i_addr3, zerobssid); + else + IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid); *(uint16_t *)wh->i_seq = 0; return m; From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 17:41:52 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 B912C1065679; Tue, 28 Apr 2009 17:41:52 +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 A79678FC1E; Tue, 28 Apr 2009 17:41:52 +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 n3SHfqDw055692; Tue, 28 Apr 2009 17:41:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SHfqUW055691; Tue, 28 Apr 2009 17:41:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904281741.n3SHfqUW055691@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 17:41:52 +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: r191632 - 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: Tue, 28 Apr 2009 17:41:53 -0000 Author: rpaulo Date: Tue Apr 28 17:41:52 2009 New Revision: 191632 URL: http://svn.freebsd.org/changeset/base/191632 Log: Sync with draft. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211.h Modified: projects/mesh11s/sys/net80211/ieee80211.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211.h Tue Apr 28 17:41:18 2009 (r191631) +++ projects/mesh11s/sys/net80211/ieee80211.h Tue Apr 28 17:41:52 2009 (r191632) @@ -710,8 +710,6 @@ enum { IEEE80211_ELEMID_MESHTIM = 39, IEEE80211_ELEMID_MESHAWAKEW = 40, IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHTIMINGINFO = 42, - IEEE80211_ELEMID_MESHSYNCPROTO = 43, IEEE80211_ELEMID_MESHDAOPSREQ = 44, /* MDAOP Setup Request */ IEEE80211_ELEMID_MESHDAOPSREPLY = 45, /* MDAOP Setup Request */ IEEE80211_ELEMID_MESHDAOPADV = 46, /* MDAOP Advertisements */ @@ -723,9 +721,8 @@ enum { IEEE80211_ELEMID_MESHPERR = 70, IEEE80211_ELEMID_MESHPU = 53, IEEE80211_ELEMID_MESHPUC = 54, - IEEE80211_ELEMID_MESHSC = 55, - IEEE80211_ELEMID_MESHSA = 56, - IEEE80211_ELEMID_MESHACT = 57, /* Anti-Clogging Token */ + IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHPPV = 61, /* Peering Protocol Version */ }; struct ieee80211_tim_ie { From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 21:48:07 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 D8239106566C; Tue, 28 Apr 2009 21:48:07 +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 C734B8FC18; Tue, 28 Apr 2009 21:48:07 +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 n3SLm7FK060754; Tue, 28 Apr 2009 21:48:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SLm7ku060753; Tue, 28 Apr 2009 21:48:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904282148.n3SLm7ku060753@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 21:48:07 +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: r191640 - 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: Tue, 28 Apr 2009 21:48:08 -0000 Author: rpaulo Date: Tue Apr 28 21:48:07 2009 New Revision: 191640 URL: http://svn.freebsd.org/changeset/base/191640 Log: First code to handle action frames. Add a comment so I don't forget to send peering requests. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Apr 28 21:00:50 2009 (r191639) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Apr 28 21:48:07 2009 (r191640) @@ -362,6 +362,13 @@ mesh_recv_mgmt(struct ieee80211_node *ni subtype, rssi, noise, rstamp); return; } + + /* + * If it's a beacon for our mesh and we haven't already + * peered with this node, send him a mgmt frame with + * peer link IE. + */ + /* XXX */ break; } case IEEE80211_FC0_SUBTYPE_PROBE_REQ: @@ -436,6 +443,11 @@ mesh_recv_mgmt(struct ieee80211_node *ni break; } case IEEE80211_FC0_SUBTYPE_ACTION: + if (vap->iv_state == IEEE80211_S_RUN) { + if (ieee80211_parse_action(ni, m0) == 0) + ic->ic_recv_action(ni, frm, efrm); + } else + vap->iv_stats.is_rx_mgtdiscard++; break; case IEEE80211_FC0_SUBTYPE_AUTH: case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 22:27:23 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 26D97106566B; Tue, 28 Apr 2009 22:27:23 +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 EF8338FC1A; Tue, 28 Apr 2009 22:27:22 +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 n3SMRMd7061794; Tue, 28 Apr 2009 22:27:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SMRMGD061793; Tue, 28 Apr 2009 22:27:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904282227.n3SMRMGD061793@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 22:27:22 +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: r191641 - projects/mesh11s/sbin/ifconfig 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: Tue, 28 Apr 2009 22:27:23 -0000 Author: rpaulo Date: Tue Apr 28 22:27:22 2009 New Revision: 191641 URL: http://svn.freebsd.org/changeset/base/191641 Log: Sync with latest modifications to meshconf IE struct. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifieee80211.c Tue Apr 28 21:48:07 2009 (r191640) +++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Tue Apr 28 22:27:22 2009 (r191641) @@ -83,6 +83,7 @@ #include #include #include +#include #include #include @@ -2502,10 +2503,9 @@ printathie(const char *tag, const u_int8 static void printmeshconf(const char *tag, const uint8_t *ie, size_t ielen, int maxlen) { -#define MATCHOUI(bitfield, oui, value, string) \ +#define MATCHOUI(field, oui, string) \ do { \ - if (((htonl(bitfield)) >> 8) == oui && \ - ((htonl(bitfield)) & 0xff) == value) \ + if (memcmp(field, oui, 4) == 0) \ printf("%s", string); \ } while (0) @@ -2513,21 +2513,27 @@ do { \ if (verbose) { const struct ieee80211_meshconf_ie *mconf = (const struct ieee80211_meshconf_ie *)ie; - printf("conf_ver); - MATCHOUI(mconf->conf_apspi, IEEE80211_MESHCONF_APSPI_HWMP_OUI, - IEEE80211_MESHCONF_APSPI_HWMP_VALUE, "HWMP"); - printf(" APSMI:"); - MATCHOUI(mconf->conf_apsmi, - IEEE80211_MESHCONF_APSMI_AIRTIME_OUI, - IEEE80211_MESHCONF_APSMI_AIRTIME_VALUE, "AIRTIME"); - printf(" CCMI:"); - MATCHOUI(mconf->conf_ccmi, IEEE80211_MESHCONF_CCMI_DEFAULT_OUI, - IEEE80211_MESHCONF_CCMI_DEFAULT_VALUE, "DEFAULT"); - MATCHOUI(mconf->conf_ccmi, IEEE80211_MESHCONF_CCMI_NULL_OUI, - IEEE80211_MESHCONF_CCMI_NULL_VALUE, "NULL"); - printf(" FORM:0x%x CAPS:0x%x", mconf->conf_finfo, + const uint8_t null[4] = IEEE80211_MESHCONF_NULL; + const uint8_t hwmp[4] = IEEE80211_MESHCONF_HWMP; + const uint8_t airtime[4] = IEEE80211_MESHCONF_AIRTIME; + const uint8_t ccsig[4] = IEEE80211_MESHCONF_CCSIG; + const uint8_t sae[4] = IEEE80211_MESHCONF_SAE; + const uint8_t neighoff[4] = IEEE80211_MESHCONF_SAE; + printf("conf_ver); + MATCHOUI(mconf->conf_pselid, hwmp, "HWMP"); + printf(" LINK:"); + MATCHOUI(mconf->conf_pmetid, airtime, "AIRTIME"); + printf(" CONGESTION:"); + MATCHOUI(mconf->conf_ccid, ccsig, "SIG"); + MATCHOUI(mconf->conf_ccid, null, "NULL"); + printf(" SYNC:"); + MATCHOUI(mconf->conf_syncid, neighoff, "NEIGHOFF"); + MATCHOUI(mconf->conf_syncid, null, "NULL"); + printf(" AUTH:"); + MATCHOUI(mconf->conf_authid, sae, "SAE"); + MATCHOUI(mconf->conf_authid, null, "NULL"); + printf(" FORM:0x%x CAPS:0x%x>", mconf->conf_form, mconf->conf_cap); - printf(">"); } #undef MATCHOUI } From owner-svn-src-projects@FreeBSD.ORG Tue Apr 28 23:36:31 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 D1A91106564A; Tue, 28 Apr 2009 23:36:31 +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 BCA448FC0C; Tue, 28 Apr 2009 23:36:31 +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 n3SNaV5K063139; Tue, 28 Apr 2009 23:36:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3SNaUaC063120; Tue, 28 Apr 2009 23:36:30 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904282336.n3SNaUaC063120@svn.freebsd.org> From: Rui Paulo Date: Tue, 28 Apr 2009 23:36:30 +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: r191642 - in projects/mesh11s: . contrib/amd/m4 contrib/bind contrib/bind9 contrib/bind9/lib/dns/sec contrib/cpio contrib/csup contrib/cvs/tools/pcl-cvs contrib/file contrib/gcc/config/... 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: Tue, 28 Apr 2009 23:36:32 -0000 Author: rpaulo Date: Tue Apr 28 23:36:29 2009 New Revision: 191642 URL: http://svn.freebsd.org/changeset/base/191642 Log: MFH 191433:191639. Sponsored by: The FreeBSD Foundation Added: projects/mesh11s/lib/libarchive/archive_read_support_format_raw.c - copied unchanged from r191639, head/lib/libarchive/archive_read_support_format_raw.c projects/mesh11s/lib/libarchive/test/test_compat_solaris_tar_acl.c - copied unchanged from r191639, head/lib/libarchive/test/test_compat_solaris_tar_acl.c projects/mesh11s/lib/libarchive/test/test_compat_solaris_tar_acl.tar.uu - copied unchanged from r191639, head/lib/libarchive/test/test_compat_solaris_tar_acl.tar.uu projects/mesh11s/lib/libarchive/test/test_read_format_cpio_bin_be.c - copied unchanged from r191639, head/lib/libarchive/test/test_read_format_cpio_bin_be.c projects/mesh11s/lib/libarchive/test/test_read_format_cpio_bin_be.cpio.uu - copied unchanged from r191639, head/lib/libarchive/test/test_read_format_cpio_bin_be.cpio.uu projects/mesh11s/lib/libarchive/test/test_read_format_raw.c - copied unchanged from r191639, head/lib/libarchive/test/test_read_format_raw.c projects/mesh11s/lib/libarchive/test/test_read_format_raw.data.Z.uu - copied unchanged from r191639, head/lib/libarchive/test/test_read_format_raw.data.Z.uu projects/mesh11s/lib/libarchive/test/test_read_format_raw.data.uu - copied unchanged from r191639, head/lib/libarchive/test/test_read_format_raw.data.uu projects/mesh11s/sys/powerpc/mpc85xx/atpic.c - copied unchanged from r191639, head/sys/powerpc/mpc85xx/atpic.c projects/mesh11s/sys/powerpc/mpc85xx/isa.c - copied unchanged from r191639, head/sys/powerpc/mpc85xx/isa.c Deleted: projects/mesh11s/contrib/amd/m4/ projects/mesh11s/contrib/bind/ projects/mesh11s/contrib/bind9/lib/dns/sec/ projects/mesh11s/contrib/cvs/tools/pcl-cvs/ projects/mesh11s/contrib/gcc/config/alpha/ projects/mesh11s/contrib/gcc/config/frv/ projects/mesh11s/contrib/gcc/config/mpw/ projects/mesh11s/contrib/gcc/contrib/ projects/mesh11s/contrib/gcc/f/ projects/mesh11s/contrib/gcc/include/ projects/mesh11s/contrib/gdb/gdb/config/none/ projects/mesh11s/contrib/gdb/gdb/nlm/ projects/mesh11s/contrib/groff/addftinfo/ projects/mesh11s/contrib/groff/afmtodit/ projects/mesh11s/contrib/groff/eqn/ projects/mesh11s/contrib/groff/grn/ projects/mesh11s/contrib/groff/grodvi/ projects/mesh11s/contrib/groff/groff/ projects/mesh11s/contrib/groff/grog/ projects/mesh11s/contrib/groff/grohtml/ projects/mesh11s/contrib/groff/grolbp/ projects/mesh11s/contrib/groff/grolj4/ projects/mesh11s/contrib/groff/grops/ projects/mesh11s/contrib/groff/grotty/ projects/mesh11s/contrib/groff/hpftodit/ projects/mesh11s/contrib/groff/include/ projects/mesh11s/contrib/groff/indxbib/ projects/mesh11s/contrib/groff/libbib/ projects/mesh11s/contrib/groff/libdriver/ projects/mesh11s/contrib/groff/libgroff/ projects/mesh11s/contrib/groff/lkbib/ projects/mesh11s/contrib/groff/lookbib/ projects/mesh11s/contrib/groff/mm/ projects/mesh11s/contrib/groff/nroff/ projects/mesh11s/contrib/groff/pfbtops/ projects/mesh11s/contrib/groff/pic/ projects/mesh11s/contrib/groff/refer/ projects/mesh11s/contrib/groff/soelim/ projects/mesh11s/contrib/groff/src/xditview/ projects/mesh11s/contrib/groff/tbl/ projects/mesh11s/contrib/groff/tfmtodit/ projects/mesh11s/contrib/groff/troff/ projects/mesh11s/contrib/groff/xditview/ projects/mesh11s/contrib/libpcap/doc/ projects/mesh11s/contrib/libstdc++/config/abi/alpha-freebsd5/ projects/mesh11s/contrib/libstdc++/config/abi/alpha-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/alphaev67-unknown-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/arm-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/hppa-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/i386-freebsd4/ projects/mesh11s/contrib/libstdc++/config/abi/i386-freebsd5/ projects/mesh11s/contrib/libstdc++/config/abi/i386-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/i486-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/i686-pc-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/ia64-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/ia64-unknown-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/m68k-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/mips-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/powerpc-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/s390-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/s390x-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/sparc-freebsd5/ projects/mesh11s/contrib/libstdc++/config/abi/sparc-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/abi/x86_64-linux-gnu/ projects/mesh11s/contrib/libstdc++/config/cpu/alpha/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/arm/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/cris/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/generic/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/i386/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/i486/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/ia64/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/m68k/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/mips/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/mmix/ projects/mesh11s/contrib/libstdc++/config/cpu/powerpc/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/s390/ projects/mesh11s/contrib/libstdc++/config/cpu/sparc/bits/ projects/mesh11s/contrib/libstdc++/config/cpu/x86-64/ projects/mesh11s/contrib/libstdc++/config/os/aix/bits/ projects/mesh11s/contrib/libstdc++/config/os/bsd/freebsd/bits/ projects/mesh11s/contrib/libstdc++/config/os/bsd/netbsd/bits/ projects/mesh11s/contrib/libstdc++/config/os/djgpp/bits/ projects/mesh11s/contrib/libstdc++/config/os/generic/bits/ projects/mesh11s/contrib/libstdc++/config/os/gnu-linux/bits/ projects/mesh11s/contrib/libstdc++/config/os/hpux/bits/ projects/mesh11s/contrib/libstdc++/config/os/irix/irix5.2/bits/ projects/mesh11s/contrib/libstdc++/config/os/irix/irix6.5/bits/ projects/mesh11s/contrib/libstdc++/config/os/mingw32/bits/ projects/mesh11s/contrib/libstdc++/config/os/newlib/bits/ projects/mesh11s/contrib/libstdc++/config/os/osf/ projects/mesh11s/contrib/libstdc++/config/os/qnx/qnx6.1/bits/ projects/mesh11s/contrib/libstdc++/config/os/solaris/solaris2.5/bits/ projects/mesh11s/contrib/libstdc++/config/os/solaris/solaris2.6/bits/ projects/mesh11s/contrib/libstdc++/config/os/solaris/solaris2.7/bits/ projects/mesh11s/contrib/libstdc++/include/c_shadow/ projects/mesh11s/contrib/ncurses/tack/ projects/mesh11s/contrib/ntp/html/hints/ projects/mesh11s/contrib/ntp/scripts/support/ projects/mesh11s/contrib/openpam/modules/pam_dummy/ projects/mesh11s/crypto/openssl/os2/ projects/mesh11s/gnu/usr.bin/perl/ projects/mesh11s/gnu/usr.bin/pr/ projects/mesh11s/gnu/usr.bin/texinfo/info-files/ projects/mesh11s/lib/libftp/ projects/mesh11s/libexec/bugfiler/ projects/mesh11s/libexec/kpasswdd/ projects/mesh11s/sys/cddl/dev/dtnfsclient/ projects/mesh11s/sys/modules/ata/ata/ projects/mesh11s/tools/tools/nanobsd/rescue/Files/conf/ projects/mesh11s/tools/tools/nanobsd/rescue/Pkg/ projects/mesh11s/usr.bin/compile_et/test/ projects/mesh11s/usr.bin/diff/ projects/mesh11s/usr.bin/grep/ projects/mesh11s/usr.bin/timedef/ projects/mesh11s/usr.sbin/bootpd/ projects/mesh11s/usr.sbin/update/ projects/mesh11s/usr.sbin/xntpd/ Modified: projects/mesh11s/ (props changed) projects/mesh11s/UPDATING projects/mesh11s/contrib/bind9/ (props changed) projects/mesh11s/contrib/cpio/ (props changed) projects/mesh11s/contrib/csup/ (props changed) projects/mesh11s/contrib/file/ (props changed) projects/mesh11s/contrib/gdb/ (props changed) projects/mesh11s/contrib/gdtoa/ (props changed) projects/mesh11s/contrib/ipfilter/ipsend/sbpf.c projects/mesh11s/contrib/libpcap/ (props changed) projects/mesh11s/contrib/ncurses/ (props changed) projects/mesh11s/contrib/netcat/ (props changed) projects/mesh11s/contrib/ntp/ (props changed) projects/mesh11s/contrib/openbsm/ (props changed) projects/mesh11s/contrib/openpam/ (props changed) projects/mesh11s/contrib/pf/ (props changed) projects/mesh11s/contrib/sendmail/ (props changed) projects/mesh11s/contrib/tcpdump/ (props changed) projects/mesh11s/contrib/top/ (props changed) projects/mesh11s/contrib/top/install-sh (props changed) projects/mesh11s/contrib/wpa/ (props changed) projects/mesh11s/crypto/openssh/ (props changed) projects/mesh11s/crypto/openssl/ (props changed) projects/mesh11s/etc/rc.d/jail projects/mesh11s/lib/libarchive/Makefile projects/mesh11s/lib/libarchive/archive.h projects/mesh11s/lib/libarchive/archive_entry.c projects/mesh11s/lib/libarchive/archive_read.3 projects/mesh11s/lib/libarchive/archive_read.c projects/mesh11s/lib/libarchive/archive_read_open_fd.c projects/mesh11s/lib/libarchive/archive_read_open_file.c projects/mesh11s/lib/libarchive/archive_read_open_filename.c projects/mesh11s/lib/libarchive/archive_read_private.h projects/mesh11s/lib/libarchive/archive_read_support_compression_xz.c projects/mesh11s/lib/libarchive/archive_read_support_format_cpio.c projects/mesh11s/lib/libarchive/archive_read_support_format_empty.c projects/mesh11s/lib/libarchive/archive_read_support_format_iso9660.c projects/mesh11s/lib/libarchive/archive_read_support_format_mtree.c projects/mesh11s/lib/libarchive/archive_read_support_format_tar.c projects/mesh11s/lib/libarchive/archive_write_set_format_cpio.c projects/mesh11s/lib/libarchive/archive_write_set_format_pax.c projects/mesh11s/lib/libarchive/archive_write_set_format_ustar.c projects/mesh11s/lib/libarchive/tar.5 projects/mesh11s/lib/libarchive/test/Makefile projects/mesh11s/lib/libarchive/test/main.c projects/mesh11s/lib/libarchive/test/test.h projects/mesh11s/lib/libarchive/test/test_acl_pax.c projects/mesh11s/lib/libarchive/test/test_fuzz.c projects/mesh11s/lib/libarchive/test/test_pax_filename_encoding.c projects/mesh11s/lib/libarchive/test/test_read_format_isojoliet_bz2.c projects/mesh11s/lib/libarchive/test/test_read_format_isorr_bz2.c projects/mesh11s/lib/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu projects/mesh11s/lib/libarchive/test/test_read_format_mtree.c projects/mesh11s/lib/libc/ (props changed) projects/mesh11s/lib/libc/arm/string/strncmp.S projects/mesh11s/lib/libc/posix1e/acl_set_qualifier.3 projects/mesh11s/lib/libc/stdio/asprintf.c (props changed) projects/mesh11s/lib/libc/stdtime/ (props changed) projects/mesh11s/lib/libc/string/ffsll.c (props changed) projects/mesh11s/lib/libc/string/flsll.c (props changed) projects/mesh11s/lib/libc/string/wcpcpy.c (props changed) projects/mesh11s/lib/libc/string/wcpncpy.c (props changed) projects/mesh11s/lib/libusb/ (props changed) projects/mesh11s/lib/libusb/libusb.3 (props changed) projects/mesh11s/lib/libusb/usb.h (props changed) projects/mesh11s/lib/libutil/ (props changed) projects/mesh11s/release/doc/en_US.ISO8859-1/hardware/article.sgml projects/mesh11s/release/picobsd/tinyware/ns/ns.c projects/mesh11s/sbin/ (props changed) projects/mesh11s/sbin/ipfw/ (props changed) projects/mesh11s/share/man/man4/pts.4 projects/mesh11s/share/man/man5/rc.conf.5 projects/mesh11s/share/zoneinfo/ (props changed) projects/mesh11s/share/zoneinfo/africa projects/mesh11s/sys/ (props changed) projects/mesh11s/sys/amd64/amd64/busdma_machdep.c projects/mesh11s/sys/amd64/include/xen/ (props changed) projects/mesh11s/sys/arm/arm/busdma_machdep.c projects/mesh11s/sys/compat/linux/linux_socket.c projects/mesh11s/sys/conf/files.powerpc projects/mesh11s/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c projects/mesh11s/sys/contrib/pf/ (props changed) projects/mesh11s/sys/dev/acpica/acpi.c projects/mesh11s/sys/dev/ata/ata-pci.c projects/mesh11s/sys/dev/ata/ata-pci.h projects/mesh11s/sys/dev/ata/ata-usb.c (props changed) projects/mesh11s/sys/dev/ata/atapi-tape.c projects/mesh11s/sys/dev/ata/chipsets/ata-ahci.c projects/mesh11s/sys/dev/ata/chipsets/ata-ati.c projects/mesh11s/sys/dev/cxgb/ (props changed) projects/mesh11s/sys/dev/cxgb/cxgb_multiq.c projects/mesh11s/sys/dev/e1000/if_em.c projects/mesh11s/sys/dev/e1000/if_em.h projects/mesh11s/sys/dev/e1000/if_igb.c projects/mesh11s/sys/dev/ed/if_ed_pccard.c projects/mesh11s/sys/dev/fb/creator.c projects/mesh11s/sys/dev/mxge/if_mxge.c projects/mesh11s/sys/dev/mxge/if_mxge_var.h projects/mesh11s/sys/dev/nve/if_nve.c projects/mesh11s/sys/dev/pccard/pccarddevs projects/mesh11s/sys/dev/rp/rp.c projects/mesh11s/sys/dev/rp/rp_pci.c projects/mesh11s/sys/dev/rp/rpreg.h projects/mesh11s/sys/dev/sound/usb/uaudio.c (props changed) projects/mesh11s/sys/dev/sound/usb/uaudio.h (props changed) projects/mesh11s/sys/dev/sound/usb/uaudio_pcm.c (props changed) projects/mesh11s/sys/dev/sound/usb/uaudioreg.h (props changed) projects/mesh11s/sys/dev/usb/README.TXT (props changed) projects/mesh11s/sys/dev/usb/bluetooth/TODO.TXT (props changed) projects/mesh11s/sys/dev/usb/bluetooth/ng_ubt.c (props changed) projects/mesh11s/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) projects/mesh11s/sys/dev/usb/bluetooth/ubtbcmfw.c (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci.c (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci.h (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci.c (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci.h (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci.c (contents, props changed) projects/mesh11s/sys/dev/usb/controller/ehci.h (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_mbus.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg.c (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg.h (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci.c (contents, props changed) projects/mesh11s/sys/dev/usb/controller/ohci.h (props changed) projects/mesh11s/sys/dev/usb/controller/ohci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uhci.c (contents, props changed) projects/mesh11s/sys/dev/usb/controller/uhci.h (props changed) projects/mesh11s/sys/dev/usb/controller/uhci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/usb_controller.c (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci.h (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/input/uhid.c (props changed) projects/mesh11s/sys/dev/usb/input/ukbd.c (props changed) projects/mesh11s/sys/dev/usb/input/ums.c (props changed) projects/mesh11s/sys/dev/usb/input/usb_rdesc.h (props changed) projects/mesh11s/sys/dev/usb/misc/udbp.c (props changed) projects/mesh11s/sys/dev/usb/misc/udbp.h (props changed) projects/mesh11s/sys/dev/usb/misc/ufm.c (props changed) projects/mesh11s/sys/dev/usb/net/if_aue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_auereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_axe.c (props changed) projects/mesh11s/sys/dev/usb/net/if_axereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_cdce.c (props changed) projects/mesh11s/sys/dev/usb/net/if_cdcereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_cue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_cuereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_kue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_kuefw.h (props changed) projects/mesh11s/sys/dev/usb/net/if_kuereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_rue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_ruereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_udav.c (props changed) projects/mesh11s/sys/dev/usb/net/if_udavreg.h (props changed) projects/mesh11s/sys/dev/usb/net/usb_ethernet.c (props changed) projects/mesh11s/sys/dev/usb/net/usb_ethernet.h (props changed) projects/mesh11s/sys/dev/usb/quirk/usb_quirk.c (props changed) projects/mesh11s/sys/dev/usb/quirk/usb_quirk.h (props changed) projects/mesh11s/sys/dev/usb/serial/u3g.c (props changed) projects/mesh11s/sys/dev/usb/serial/uark.c (props changed) projects/mesh11s/sys/dev/usb/serial/ubsa.c (props changed) projects/mesh11s/sys/dev/usb/serial/ubser.c (props changed) projects/mesh11s/sys/dev/usb/serial/uchcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/ucycom.c (props changed) projects/mesh11s/sys/dev/usb/serial/ufoma.c (props changed) projects/mesh11s/sys/dev/usb/serial/uftdi.c (props changed) projects/mesh11s/sys/dev/usb/serial/uftdi_reg.h (props changed) projects/mesh11s/sys/dev/usb/serial/ugensa.c (props changed) projects/mesh11s/sys/dev/usb/serial/uipaq.c (props changed) projects/mesh11s/sys/dev/usb/serial/ulpt.c (props changed) projects/mesh11s/sys/dev/usb/serial/umct.c (props changed) projects/mesh11s/sys/dev/usb/serial/umodem.c (props changed) projects/mesh11s/sys/dev/usb/serial/umoscom.c (props changed) projects/mesh11s/sys/dev/usb/serial/uplcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/usb_serial.c (props changed) projects/mesh11s/sys/dev/usb/serial/usb_serial.h (props changed) projects/mesh11s/sys/dev/usb/serial/uslcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/uvisor.c (props changed) projects/mesh11s/sys/dev/usb/serial/uvscom.c (props changed) projects/mesh11s/sys/dev/usb/storage/rio500_usb.h (props changed) projects/mesh11s/sys/dev/usb/storage/umass.c (props changed) projects/mesh11s/sys/dev/usb/storage/urio.c (props changed) projects/mesh11s/sys/dev/usb/storage/ustorage_fs.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template.h (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_cdce.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_msc.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_mtp.c (props changed) projects/mesh11s/sys/dev/usb/ufm_ioctl.h (props changed) projects/mesh11s/sys/dev/usb/usb.h (props changed) projects/mesh11s/sys/dev/usb/usb_bus.h (props changed) projects/mesh11s/sys/dev/usb/usb_busdma.c (props changed) projects/mesh11s/sys/dev/usb/usb_busdma.h (props changed) projects/mesh11s/sys/dev/usb/usb_cdc.h (props changed) projects/mesh11s/sys/dev/usb/usb_compat_linux.c (props changed) projects/mesh11s/sys/dev/usb/usb_compat_linux.h (props changed) projects/mesh11s/sys/dev/usb/usb_controller.h (props changed) projects/mesh11s/sys/dev/usb/usb_core.c (props changed) projects/mesh11s/sys/dev/usb/usb_core.h (contents, props changed) projects/mesh11s/sys/dev/usb/usb_debug.c (props changed) projects/mesh11s/sys/dev/usb/usb_debug.h (props changed) projects/mesh11s/sys/dev/usb/usb_defs.h (props changed) projects/mesh11s/sys/dev/usb/usb_dev.c (props changed) projects/mesh11s/sys/dev/usb/usb_dev.h (props changed) projects/mesh11s/sys/dev/usb/usb_device.c (contents, props changed) projects/mesh11s/sys/dev/usb/usb_device.h (contents, props changed) projects/mesh11s/sys/dev/usb/usb_dynamic.c (props changed) projects/mesh11s/sys/dev/usb/usb_dynamic.h (props changed) projects/mesh11s/sys/dev/usb/usb_endian.h (props changed) projects/mesh11s/sys/dev/usb/usb_error.c (props changed) projects/mesh11s/sys/dev/usb/usb_error.h (props changed) projects/mesh11s/sys/dev/usb/usb_generic.c (contents, props changed) projects/mesh11s/sys/dev/usb/usb_generic.h (props changed) projects/mesh11s/sys/dev/usb/usb_handle_request.c (props changed) projects/mesh11s/sys/dev/usb/usb_handle_request.h (props changed) projects/mesh11s/sys/dev/usb/usb_hid.c (props changed) projects/mesh11s/sys/dev/usb/usb_hid.h (props changed) projects/mesh11s/sys/dev/usb/usb_hub.c (contents, props changed) projects/mesh11s/sys/dev/usb/usb_hub.h (props changed) projects/mesh11s/sys/dev/usb/usb_if.m (props changed) projects/mesh11s/sys/dev/usb/usb_ioctl.h (props changed) projects/mesh11s/sys/dev/usb/usb_lookup.c (props changed) projects/mesh11s/sys/dev/usb/usb_lookup.h (props changed) projects/mesh11s/sys/dev/usb/usb_mbuf.c (props changed) projects/mesh11s/sys/dev/usb/usb_mbuf.h (props changed) projects/mesh11s/sys/dev/usb/usb_mfunc.h (props changed) projects/mesh11s/sys/dev/usb/usb_msctest.c (props changed) projects/mesh11s/sys/dev/usb/usb_msctest.h (props changed) projects/mesh11s/sys/dev/usb/usb_parse.c (props changed) projects/mesh11s/sys/dev/usb/usb_parse.h (props changed) projects/mesh11s/sys/dev/usb/usb_pci.h (props changed) projects/mesh11s/sys/dev/usb/usb_process.c (props changed) projects/mesh11s/sys/dev/usb/usb_process.h (props changed) projects/mesh11s/sys/dev/usb/usb_request.c (contents, props changed) projects/mesh11s/sys/dev/usb/usb_request.h (props changed) projects/mesh11s/sys/dev/usb/usb_revision.h (contents, props changed) projects/mesh11s/sys/dev/usb/usb_transfer.c (contents, props changed) projects/mesh11s/sys/dev/usb/usb_transfer.h (props changed) projects/mesh11s/sys/dev/usb/usb_util.c (props changed) projects/mesh11s/sys/dev/usb/usb_util.h (props changed) projects/mesh11s/sys/dev/usb/usbdevs (props changed) projects/mesh11s/sys/dev/usb/usbhid.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rum.c (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumfw.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumvar.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_ural.c (props changed) projects/mesh11s/sys/dev/usb/wlan/if_uralreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_uralvar.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zyd.c (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zydfw.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zydreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/usb_wlan.h (props changed) projects/mesh11s/sys/dev/xen/netfront/ (props changed) projects/mesh11s/sys/dev/xen/xenpci/ (props changed) projects/mesh11s/sys/dev/xl/if_xl.c projects/mesh11s/sys/i386/i386/busdma_machdep.c projects/mesh11s/sys/ia64/isa/isa.c projects/mesh11s/sys/kern/kern_cpuset.c projects/mesh11s/sys/kern/kern_rmlock.c projects/mesh11s/sys/kern/kern_vimage.c projects/mesh11s/sys/kern/tty_pts.c projects/mesh11s/sys/legacy/dev/ata/ata-usb.c (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudio.c (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudio.h (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) projects/mesh11s/sys/legacy/dev/usb/ (props changed) projects/mesh11s/sys/legacy/dev/usb/ehci_ixp4xx.c (props changed) projects/mesh11s/sys/modules/dtrace/dtnfsclient/ (props changed) projects/mesh11s/sys/modules/ip6_mroute_mod/ (props changed) projects/mesh11s/sys/modules/ipmi/ipmi_linux/ (props changed) projects/mesh11s/sys/net/bridgestp.c projects/mesh11s/sys/net/flowtable.c projects/mesh11s/sys/net/if_arcsubr.c projects/mesh11s/sys/net/if_bridge.c projects/mesh11s/sys/net/if_ef.c projects/mesh11s/sys/net/if_loop.c projects/mesh11s/sys/net/route.c projects/mesh11s/sys/net/rtsock.c projects/mesh11s/sys/net80211/ieee80211_adhoc.c projects/mesh11s/sys/net80211/ieee80211_ddb.c projects/mesh11s/sys/net80211/ieee80211_freebsd.h projects/mesh11s/sys/net80211/ieee80211_hostap.c projects/mesh11s/sys/net80211/ieee80211_ht.c projects/mesh11s/sys/net80211/ieee80211_ioctl.c projects/mesh11s/sys/net80211/ieee80211_output.c projects/mesh11s/sys/net80211/ieee80211_sta.c projects/mesh11s/sys/net80211/ieee80211_superg.c projects/mesh11s/sys/net80211/ieee80211_var.h projects/mesh11s/sys/net80211/ieee80211_wds.c projects/mesh11s/sys/netgraph/netgraph.h projects/mesh11s/sys/netgraph/ng_base.c projects/mesh11s/sys/netgraph/ng_eiface.c projects/mesh11s/sys/netgraph/ng_ether.c projects/mesh11s/sys/netgraph/ng_iface.c projects/mesh11s/sys/netinet/igmp.c projects/mesh11s/sys/netinet/in.c projects/mesh11s/sys/netinet/in_mcast.c projects/mesh11s/sys/netinet/in_rmx.c projects/mesh11s/sys/netinet/ip_carp.c projects/mesh11s/sys/netinet/ip_divert.c projects/mesh11s/sys/netinet/ip_fw2.c projects/mesh11s/sys/netinet/ip_fw_pfil.c projects/mesh11s/sys/netinet/ip_ipsec.c projects/mesh11s/sys/netinet/ip_mroute.c projects/mesh11s/sys/netinet/ip_output.c projects/mesh11s/sys/netinet/tcp_subr.c projects/mesh11s/sys/netinet/tcp_timewait.c projects/mesh11s/sys/netinet/udp_usrreq.c projects/mesh11s/sys/netinet6/in6_rmx.c projects/mesh11s/sys/netinet6/nd6_rtr.c projects/mesh11s/sys/netipsec/key.c projects/mesh11s/sys/netipsec/key.h projects/mesh11s/sys/netipx/spx_usrreq.c projects/mesh11s/sys/powerpc/aim/machdep.c projects/mesh11s/sys/powerpc/booke/pmap.c projects/mesh11s/sys/powerpc/conf/MPC85XX projects/mesh11s/sys/powerpc/include/intr_machdep.h projects/mesh11s/sys/powerpc/include/pte.h projects/mesh11s/sys/powerpc/mpc85xx/ocpbus.c projects/mesh11s/sys/powerpc/mpc85xx/pci_ocp.c projects/mesh11s/sys/powerpc/powerpc/autoconf.c projects/mesh11s/sys/powerpc/powerpc/bus_machdep.c projects/mesh11s/sys/powerpc/powerpc/intr_machdep.c projects/mesh11s/sys/sys/mbuf.h projects/mesh11s/sys/sys/queue.h projects/mesh11s/sys/sys/vimage.h projects/mesh11s/sys/ufs/ufs/dinode.h projects/mesh11s/sys/ufs/ufs/inode.h projects/mesh11s/sys/ufs/ufs/ufs_vnops.c projects/mesh11s/sys/vm/swap_pager.c projects/mesh11s/sys/vm/vm_fault.c projects/mesh11s/sys/vm/vm_object.c projects/mesh11s/sys/vm/vm_pageout.c projects/mesh11s/sys/vm/vnode_pager.c projects/mesh11s/sys/xen/evtchn.h (props changed) projects/mesh11s/sys/xen/hypervisor.h (props changed) projects/mesh11s/sys/xen/xen_intr.h (props changed) projects/mesh11s/tools/regression/lib/msun/test-conj.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs.h (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5210.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5211.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5212.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5416.c (props changed) projects/mesh11s/usr.bin/csup/ (props changed) projects/mesh11s/usr.bin/procstat/ (props changed) projects/mesh11s/usr.sbin/arp/arp.8 projects/mesh11s/usr.sbin/dumpcis/cardinfo.h (props changed) projects/mesh11s/usr.sbin/dumpcis/cis.h (props changed) projects/mesh11s/usr.sbin/kbdmap/kbdmap.1 projects/mesh11s/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/mesh11s/usr.sbin/makefs/getid.c (props changed) projects/mesh11s/usr.sbin/zic/ (props changed) Modified: projects/mesh11s/UPDATING ============================================================================== --- projects/mesh11s/UPDATING Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/UPDATING Tue Apr 28 23:36:29 2009 (r191642) @@ -22,27 +22,35 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) -20090422 +20090422: Implement low-level Bluetooth HCI API. Bump __FreeBSD_version to 800083. +20090419: + The layout of struct malloc_type, used by modules to register new + memory allocation types, has changed. Most modules will need to + be rebuilt or panics may be experienced. + Bump __FreeBSD_version to 800081. + 20090415: - Anticipate overflowing inp_flags - add inp_flags2. + Anticipate overflowing inp_flags - add inp_flags2. This changes most offsets in inpcb, so checking v4 connection - state will require a world rebuild. + state will require a world rebuild. Bump __FreeBSD_version to 800080. + 20090415: Add an llentry to struct route and struct route_in6. Modules - embedding a struct route will need to be recompiled. + embedding a struct route will need to be recompiled. Bump __FreeBSD_version to 800079. 20090414: The size of rt_metrics_lite and by extension rtentry has changed. Networking administration apps will need to be recompiled. - The route command now supports show as an alias for get, weighting + The route command now supports show as an alias for get, weighting of routes, sticky and nostick flags to alter the behavior of stateful load balancing. Bump __FreeBSD_version to 800078. + 20090408: Do not use Giant for kbdmux(4) locking. This is wrong and apparently causing more problems than it solves. This will @@ -62,7 +70,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. GEOM_PART has become the default partition slicer for storage devices, replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It introduces some changes: - + MSDOS/EBR: the devices created from MSDOS extended partition entries (EBR) can be named differently than with GEOM_MBR and are now symlinks to devices with offset-based names. fstabs may need to be modified. @@ -71,7 +79,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. cases but it points to problems in file system misalignment with disk geometry. The "c" partition is now implicit, covers the whole top-level drive and cannot be (mis)used by users. - + General: Kernel dumps are now not allowed to be written to devices whose partition types indicate they are meant to be used for file systems (or, in case of MSDOS partitions, as something else than Modified: projects/mesh11s/contrib/ipfilter/ipsend/sbpf.c ============================================================================== --- projects/mesh11s/contrib/ipfilter/ipsend/sbpf.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/contrib/ipfilter/ipsend/sbpf.c Tue Apr 28 23:36:29 2009 (r191642) @@ -28,9 +28,6 @@ #include #include #include -#include -#include -#include #include #include Modified: projects/mesh11s/etc/rc.d/jail ============================================================================== --- projects/mesh11s/etc/rc.d/jail Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/etc/rc.d/jail Tue Apr 28 23:36:29 2009 (r191642) @@ -41,6 +41,14 @@ init_variables() eval _ip=\"\$jail_${_j}_ip\" eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" eval _exec=\"\$jail_${_j}_exec\" + + i=0 + while : ; do + eval _exec_prestart${i}=\"\${jail_${_j}_exec_prestart${i}:-\${jail_exec_prestart${i}}}\" + [ -z "$(eval echo \"\$_exec_prestart${i}\")" ] && break + i=$((i + 1)) + done + eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\" i=1 @@ -49,8 +57,30 @@ init_variables() [ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] && break i=$((i + 1)) done - + + i=0 + while : ; do + eval _exec_poststart${i}=\"\${jail_${_j}_exec_poststart${i}:-\${jail_exec_poststart${i}}}\" + [ -z "$(eval echo \"\$_exec_poststart${i}\")" ] && break + i=$((i + 1)) + done + + i=0 + while : ; do + eval _exec_prestop${i}=\"\${jail_${_j}_exec_prestop${i}:-\${jail_exec_prestop${i}}}\" + [ -z "$(eval echo \"\$_exec_prestop${i}\")" ] && break + i=$((i + 1)) + done + eval _exec_stop=\"\${jail_${_j}_exec_stop:-${jail_exec_stop}}\" + + i=0 + while : ; do + eval _exec_poststop${i}=\"\${jail_${_j}_exec_poststop${i}:-\${jail_exec_poststop${i}}}\" + [ -z "$(eval echo \"\$_exec_poststop${i}\")" ] && break + i=$((i + 1)) + done + if [ -n "${_exec}" ]; then # simple/backward-compatible execution _exec_start="${_exec}" @@ -102,9 +132,20 @@ init_variables() debug "$_j procdir: $_procdir" debug "$_j ruleset: $_ruleset" debug "$_j fstab: $_fstab" - debug "$_j exec start: $_exec_start" debug "$_j consolelog: $_consolelog" + i=0 + while : ; do + eval out=\"\${_exec_prestart${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_j exec pre-start #${i}: ${out}" + i=$((i + 1)) + done + + debug "$_j exec start: $_exec_start" + i=1 while [ true ]; do eval out=\"\${_exec_afterstart${i}:-''}\" @@ -117,7 +158,38 @@ init_variables() i=$((i + 1)) done + i=0 + while : ; do + eval out=\"\${_exec_poststart${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_j exec post-start #${i}: ${out}" + i=$((i + 1)) + done + + i=0 + while : ; do + eval out=\"\${_exec_prestop${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_j exec pre-stop #${i}: ${out}" + i=$((i + 1)) + done + debug "$_j exec stop: $_exec_stop" + + i=0 + while : ; do + eval out=\"\${_exec_poststop${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_j exec post-stop #${i}: ${out}" + i=$((i + 1)) + done + debug "$_j flags: $_flags" debug "$_j consolelog: $_consolelog" @@ -555,6 +627,15 @@ jail_start() fi fi _tmp_jail=${_tmp_dir}/jail.$$ + + i=0 + while : ; do + eval out=\"\${_exec_prestart${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done + eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 @@ -575,6 +656,14 @@ jail_start() echo -n " $_hostname" tail +2 ${_tmp_jail} >${_consolelog} echo ${_jail_id} > /var/run/jail_${_jail}.id + + i=0 + while : ; do + eval out=\"\${_exec_poststart${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done else jail_umount_fs jail_ips "del" @@ -596,6 +685,15 @@ jail_stop() _jail_id=$(cat /var/run/jail_${_jail}.id) if [ ! -z "${_jail_id}" ]; then init_variables $_jail + + i=0 + while : ; do + eval out=\"\${_exec_prestop${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done + if [ -n "${_exec_stop}" ]; then eval env -i /usr/sbin/jexec ${_jail_id} ${_exec_stop} \ >> ${_consolelog} 2>&1 @@ -605,6 +703,14 @@ jail_stop() killall -j ${_jail_id} -KILL > /dev/null 2>&1 jail_umount_fs echo -n " $_hostname" + + i=0 + while : ; do + eval out=\"\${_exec_poststop${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done fi jail_ips "del" rm /var/run/jail_${_jail}.id Modified: projects/mesh11s/lib/libarchive/Makefile ============================================================================== --- projects/mesh11s/lib/libarchive/Makefile Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/Makefile Tue Apr 28 23:36:29 2009 (r191642) @@ -11,6 +11,9 @@ SHLIB_MAJOR= 4 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.OBJDIR} +#Uncomment to build with full lzma/xz support via liblzma +#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 +#LDADD+= -L/usr/local/lib -llzma .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL @@ -52,6 +55,7 @@ SRCS= archive_check_magic.c \ archive_read_support_format_empty.c \ archive_read_support_format_iso9660.c \ archive_read_support_format_mtree.c \ + archive_read_support_format_raw.c \ archive_read_support_format_tar.c \ archive_read_support_format_zip.c \ archive_string.c \ @@ -177,6 +181,7 @@ MLINKS+= archive_read.3 archive_read_ext MLINKS+= archive_read.3 archive_read_finish.3 MLINKS+= archive_read.3 archive_read_new.3 MLINKS+= archive_read.3 archive_read_next_header.3 +MLINKS+= archive_read.3 archive_read_next_header2.3 MLINKS+= archive_read.3 archive_read_open.3 MLINKS+= archive_read.3 archive_read_open2.3 MLINKS+= archive_read.3 archive_read_open_FILE.3 @@ -188,11 +193,17 @@ MLINKS+= archive_read.3 archive_read_sup MLINKS+= archive_read.3 archive_read_support_compression_bzip2.3 MLINKS+= archive_read.3 archive_read_support_compression_compress.3 MLINKS+= archive_read.3 archive_read_support_compression_gzip.3 +MLINKS+= archive_read.3 archive_read_support_compression_lzma.3 MLINKS+= archive_read.3 archive_read_support_compression_none.3 MLINKS+= archive_read.3 archive_read_support_compression_program.3 +MLINKS+= archive_read.3 archive_read_support_compression_program_signature.3 +MLINKS+= archive_read.3 archive_read_support_compression_xz.3 MLINKS+= archive_read.3 archive_read_support_format_all.3 +MLINKS+= archive_read.3 archive_read_support_format_ar.3 MLINKS+= archive_read.3 archive_read_support_format_cpio.3 +MLINKS+= archive_read.3 archive_read_support_format_empty.3 MLINKS+= archive_read.3 archive_read_support_format_iso9660.3 +MLINKS+= archive_read.3 archive_read_support_format_raw.3 MLINKS+= archive_read.3 archive_read_support_format_tar.3 MLINKS+= archive_read.3 archive_read_support_format_zip.3 MLINKS+= archive_read_disk.3 archive_read_disk_entry_from_file.3 Modified: projects/mesh11s/lib/libarchive/archive.h ============================================================================== --- projects/mesh11s/lib/libarchive/archive.h Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive.h Tue Apr 28 23:36:29 2009 (r191642) @@ -272,6 +272,7 @@ typedef int archive_close_callback(struc #define ARCHIVE_FORMAT_AR_GNU (ARCHIVE_FORMAT_AR | 1) #define ARCHIVE_FORMAT_AR_BSD (ARCHIVE_FORMAT_AR | 2) #define ARCHIVE_FORMAT_MTREE 0x80000 +#define ARCHIVE_FORMAT_RAW 0x90000 /*- * Basic outline for reading an archive: @@ -315,6 +316,7 @@ __LA_DECL int archive_read_support_for __LA_DECL int archive_read_support_format_gnutar(struct archive *); __LA_DECL int archive_read_support_format_iso9660(struct archive *); __LA_DECL int archive_read_support_format_mtree(struct archive *); +__LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_zip(struct archive *); Modified: projects/mesh11s/lib/libarchive/archive_entry.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_entry.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_entry.c Tue Apr 28 23:36:29 2009 (r191642) @@ -115,6 +115,7 @@ static int acl_special(struct archive_en static struct ae_acl *acl_new_entry(struct archive_entry *entry, int type, int permset, int tag, int id); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); +static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, const wchar_t **end, wchar_t *sep); static int prefix_w(const wchar_t *start, const wchar_t *end, @@ -1238,7 +1239,7 @@ static struct ae_acl * acl_new_entry(struct archive_entry *entry, int type, int permset, int tag, int id) { - struct ae_acl *ap; + struct ae_acl *ap, *aq; if (type != ARCHIVE_ENTRY_ACL_TYPE_ACCESS && type != ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) @@ -1251,20 +1252,26 @@ acl_new_entry(struct archive_entry *entr /* XXX TODO: More sanity-checks on the arguments XXX */ /* If there's a matching entry already in the list, overwrite it. */ - for (ap = entry->acl_head; ap != NULL; ap = ap->next) { + ap = entry->acl_head; + aq = NULL; + while (ap != NULL) { if (ap->type == type && ap->tag == tag && ap->id == id) { ap->permset = permset; return (ap); } + aq = ap; + ap = ap->next; } - /* Add a new entry to the list. */ + /* Add a new entry to the end of the list. */ ap = (struct ae_acl *)malloc(sizeof(*ap)); if (ap == NULL) return (NULL); memset(ap, 0, sizeof(*ap)); - ap->next = entry->acl_head; - entry->acl_head = ap; + if (aq == NULL) + entry->acl_head = ap; + else + aq->next = ap; ap->type = type; ap->tag = tag; ap->id = id; @@ -1586,11 +1593,10 @@ __archive_entry_acl_parse_w(struct archi struct { const wchar_t *start; const wchar_t *end; - } field[4]; + } field[4], name; int fields; int type, tag, permset, id; - const wchar_t *p; wchar_t sep; while (text != NULL && *text != L'\0') { @@ -1609,9 +1615,6 @@ __archive_entry_acl_parse_w(struct archi ++fields; } while (sep == L':'); - if (fields < 3) - return (ARCHIVE_WARN); - /* Check for a numeric ID in field 1 or 3. */ id = -1; isint_w(field[1].start, field[1].end, &id); @@ -1619,27 +1622,6 @@ __archive_entry_acl_parse_w(struct archi if (id == -1 && fields > 3) isint_w(field[3].start, field[3].end, &id); - /* Parse the permissions from field 2. */ - permset = 0; - p = field[2].start; - while (p < field[2].end) { - switch (*p++) { - case 'r': case 'R': - permset |= ARCHIVE_ENTRY_ACL_READ; - break; - case 'w': case 'W': - permset |= ARCHIVE_ENTRY_ACL_WRITE; - break; - case 'x': case 'X': - permset |= ARCHIVE_ENTRY_ACL_EXECUTE; - break; - case '-': - break; - default: - return (ARCHIVE_WARN); - } - } - /* * Solaris extension: "defaultuser::rwx" is the * default ACL corresponding to "user::rwx", etc. @@ -1651,22 +1633,47 @@ __archive_entry_acl_parse_w(struct archi } else type = default_type; + name.start = name.end = NULL; if (prefix_w(field[0].start, field[0].end, L"user")) { - if (id != -1 || field[1].start < field[1].end) + if (!ismode_w(field[2].start, field[2].end, &permset)) + return (ARCHIVE_WARN); + if (id != -1 || field[1].start < field[1].end) { tag = ARCHIVE_ENTRY_ACL_USER; - else + name = field[1]; + } else tag = ARCHIVE_ENTRY_ACL_USER_OBJ; } else if (prefix_w(field[0].start, field[0].end, L"group")) { - if (id != -1 || field[1].start < field[1].end) + if (!ismode_w(field[2].start, field[2].end, &permset)) + return (ARCHIVE_WARN); + if (id != -1 || field[1].start < field[1].end) { tag = ARCHIVE_ENTRY_ACL_GROUP; - else + name = field[1]; + } else tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; } else if (prefix_w(field[0].start, field[0].end, L"other")) { - if (id != -1 || field[1].start < field[1].end) + if (fields == 2 + && field[1].start < field[1].end + && ismode_w(field[1].start, field[2].end, &permset)) { + /* This is Solaris-style "other:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode_w(field[2].start, field[2].end, &permset)) { + /* This is FreeBSD-style "other::rwx" */ + } else return (ARCHIVE_WARN); tag = ARCHIVE_ENTRY_ACL_OTHER; } else if (prefix_w(field[0].start, field[0].end, L"mask")) { - if (id != -1 || field[1].start < field[1].end) + if (fields == 2 + && field[1].start < field[1].end + && ismode_w(field[1].start, field[1].end, &permset)) { + /* This is Solaris-style "mask:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode_w(field[2].start, field[2].end, &permset)) { + /* This is FreeBSD-style "mask::rwx" */ + } else return (ARCHIVE_WARN); tag = ARCHIVE_ENTRY_ACL_MASK; } else @@ -1674,7 +1681,7 @@ __archive_entry_acl_parse_w(struct archi /* Add entry to the internal list. */ archive_entry_acl_add_entry_w_len(entry, type, permset, - tag, id, field[1].start, field[1].end - field[1].start); + tag, id, name.start, name.end - name.start); } return (ARCHIVE_OK); } @@ -1798,6 +1805,38 @@ isint_w(const wchar_t *start, const wcha } /* + * Parse a string as a mode field. Returns true if + * the string is non-empty and consists only of mode characters, + * false otherwise. + */ +static int +ismode_w(const wchar_t *start, const wchar_t *end, int *permset) +{ + const wchar_t *p; + + p = start; + *permset = 0; + while (p < end) { + switch (*p++) { + case 'r': case 'R': + *permset |= ARCHIVE_ENTRY_ACL_READ; + break; + case 'w': case 'W': + *permset |= ARCHIVE_ENTRY_ACL_WRITE; + break; + case 'x': case 'X': + *permset |= ARCHIVE_ENTRY_ACL_EXECUTE; + break; + case '-': + break; + default: + return (0); + } + } + return (1); +} + +/* * Match "[:whitespace:]*(.*)[:whitespace:]*[:,\n]". *wp is updated * to point to just after the separator. *start points to the first * character of the matched text and *end just after the last Modified: projects/mesh11s/lib/libarchive/archive_read.3 ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read.3 Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read.3 Tue Apr 28 23:36:29 2009 (r191642) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2006 +.Dd April 13, 2009 .Dt archive_read 3 .Os .Sh NAME @@ -36,12 +36,18 @@ .Nm archive_read_support_compression_bzip2 , .Nm archive_read_support_compression_compress , .Nm archive_read_support_compression_gzip , +.Nm archive_read_support_compression_lzma , .Nm archive_read_support_compression_none , +.Nm archive_read_support_compression_xz , .Nm archive_read_support_compression_program , +.Nm archive_read_support_compression_program_signature , .Nm archive_read_support_format_all , +.Nm archive_read_support_format_ar , .Nm archive_read_support_format_cpio , .Nm archive_read_support_format_empty , .Nm archive_read_support_format_iso9660 , +.Nm archive_read_support_format_mtree, +.Nm archive_read_support_format_raw, .Nm archive_read_support_format_tar , .Nm archive_read_support_format_zip , .Nm archive_read_open , @@ -78,21 +84,38 @@ .Ft int .Fn archive_read_support_compression_gzip "struct archive *" .Ft int +.Fn archive_read_support_compression_lzma "struct archive *" +.Ft int .Fn archive_read_support_compression_none "struct archive *" .Ft int +.Fn archive_read_support_compression_xz "struct archive *" +.Ft int .Fo archive_read_support_compression_program .Fa "struct archive *" .Fa "const char *cmd" .Fc .Ft int +.Fo archive_read_support_compression_program_signature +.Fa "struct archive *" +.Fa "const char *cmd" +.Fa "const void *signature" +.Fa "size_t signature_length" +.Fc +.Ft int .Fn archive_read_support_format_all "struct archive *" .Ft int +.Fn archive_read_support_format_ar "struct archive *" +.Ft int .Fn archive_read_support_format_cpio "struct archive *" .Ft int .Fn archive_read_support_format_empty "struct archive *" .Ft int .Fn archive_read_support_format_iso9660 "struct archive *" .Ft int +.Fn archive_read_support_format_mtree "struct archive *" +.Ft int +.Fn archive_read_support_format_raw "struct archive *" +.Ft int .Fn archive_read_support_format_tar "struct archive *" .Ft int .Fn archive_read_support_format_zip "struct archive *" @@ -189,30 +212,43 @@ Allocates and initializes a .Tn struct archive object suitable for reading from an archive. .It Xo -.Fn archive_read_support_compression_all , .Fn archive_read_support_compression_bzip2 , .Fn archive_read_support_compression_compress , .Fn archive_read_support_compression_gzip , -.Fn archive_read_support_compression_none +.Fn archive_read_support_compression_lzma , +.Fn archive_read_support_compression_none , +.Fn archive_read_support_compression_xz .Xc Enables auto-detection code and decompression support for the specified compression. +Returns +.Cm ARCHIVE_OK +if the compression is fully supported, or +.Cm ARCHIVE_WARN +if the compression is supported only through an external program. +Note that decompression using an external program is usually slower than +decompression through built-in libraries. Note that .Dq none is always enabled by default. -For convenience, -.Fn archive_read_support_compression_all -enables all available decompression code. +.It Fn archive_read_support_compression_all +Enables all available decompression filters. .It Fn archive_read_support_compression_program Data is fed through the specified external program before being dearchived. Note that this disables automatic detection of the compression format, so it makes no sense to specify this in conjunction with any other decompression option. +.It Fn archive_read_support_compression_program_signature +This feeds data through the specified external program +but only if the initial bytes of the data match the specified +signature value. .It Xo .Fn archive_read_support_format_all , +.Fn archive_read_support_format_ar , .Fn archive_read_support_format_cpio , .Fn archive_read_support_format_empty , .Fn archive_read_support_format_iso9660 , +.Fn archive_read_support_format_mtree , .Fn archive_read_support_format_tar , .Fn archive_read_support_format_zip .Xc @@ -226,6 +262,17 @@ For convenience, .Fn archive_read_support_format_all enables support for all available formats. Only empty archives are supported by default. +.It Fn archive_read_support_format_raw +The +.Dq raw +format handler allows libarchive to be used to read arbitrary data. +It treats any data stream as an archive with a single entry. +The pathname of this entry is +.Dq data ; +all other entry fields are unset. +This is not enabled by +.Fn archive_read_support_format_all +in order to avoid erroneous handling of damaged archives. .It Xo .Fn archive_read_set_filter_options , .Fn archive_read_set_format_options , @@ -322,9 +369,9 @@ a .Tn struct archive_entry . This is a convenience wrapper around .Fn archive_read_next_header2 -that uses an internal +that reuses an internal .Tn struct archive_entry -object. +object for each request. .It Fn archive_read_next_header2 Read the header for the next entry and populate the provided .Tn struct archive_entry . Modified: projects/mesh11s/lib/libarchive/archive_read.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read.c Tue Apr 28 23:36:29 2009 (r191642) @@ -1112,7 +1112,24 @@ __archive_read_filter_consume(struct arc int64_t __archive_read_skip(struct archive_read *a, int64_t request) { - return (__archive_read_filter_skip(a->filter, request)); + int64_t skipped = __archive_read_skip_lenient(a, request); + if (skipped == request) + return (skipped); + /* We hit EOF before we satisfied the skip request. */ + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Truncated input file (needed %jd bytes, only %jd available)", + (intmax_t)request, (intmax_t)skipped); + return (ARCHIVE_FATAL); +} + +int64_t +__archive_read_skip_lenient(struct archive_read *a, int64_t request) +{ + int64_t skipped = __archive_read_filter_skip(a->filter, request); + if (skipped > 0) + a->archive.file_position += skipped; + return (skipped); } int64_t @@ -1128,13 +1145,13 @@ __archive_read_filter_skip(struct archiv */ if (filter->avail > 0) { min = minimum(request, (off_t)filter->avail); - bytes_skipped = __archive_read_consume(filter->archive, min); + bytes_skipped = __archive_read_filter_consume(filter, min); request -= bytes_skipped; total_bytes_skipped += bytes_skipped; } if (filter->client_avail > 0) { min = minimum(request, (off_t)filter->client_avail); - bytes_skipped = __archive_read_consume(filter->archive, min); + bytes_skipped = __archive_read_filter_consume(filter, min); request -= bytes_skipped; total_bytes_skipped += bytes_skipped; } @@ -1155,7 +1172,6 @@ __archive_read_filter_skip(struct archiv filter->fatal = 1; return (bytes_skipped); } - filter->archive->archive.file_position += bytes_skipped; total_bytes_skipped += bytes_skipped; request -= bytes_skipped; filter->client_next = filter->client_buff; @@ -1170,20 +1186,15 @@ __archive_read_filter_skip(struct archiv while (request > 0) { const void* dummy_buffer; ssize_t bytes_read; - dummy_buffer = __archive_read_ahead(filter->archive, + dummy_buffer = __archive_read_filter_ahead(filter, 1, &bytes_read); if (bytes_read < 0) return (bytes_read); if (bytes_read == 0) { - /* We hit EOF before we satisfied the skip request. */ - archive_set_error(&filter->archive->archive, - ARCHIVE_ERRNO_MISC, - "Truncated input file (need to skip %jd bytes)", - (intmax_t)request); - return (ARCHIVE_FATAL); + return (total_bytes_skipped); } min = (size_t)(minimum(bytes_read, request)); - bytes_read = __archive_read_consume(filter->archive, min); + bytes_read = __archive_read_filter_consume(filter, min); total_bytes_skipped += bytes_read; request -= bytes_read; } Modified: projects/mesh11s/lib/libarchive/archive_read_open_fd.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_open_fd.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_open_fd.c Tue Apr 28 23:36:29 2009 (r191642) @@ -66,6 +66,7 @@ archive_read_open_fd(struct archive *a, struct read_fd_data *mine; void *b; + archive_clear_error(a); if (fstat(fd, &st) != 0) { archive_set_error(a, errno, "Can't stat fd %d", fd); return (ARCHIVE_FATAL); Modified: projects/mesh11s/lib/libarchive/archive_read_open_file.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_open_file.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_open_file.c Tue Apr 28 23:36:29 2009 (r191642) @@ -70,6 +70,7 @@ archive_read_open_FILE(struct archive *a size_t block_size = 128 * 1024; void *b; + archive_clear_error(a); mine = (struct read_FILE_data *)malloc(sizeof(*mine)); b = malloc(block_size); if (mine == NULL || b == NULL) { Modified: projects/mesh11s/lib/libarchive/archive_read_open_filename.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_open_filename.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_open_filename.c Tue Apr 28 23:36:29 2009 (r191642) @@ -84,6 +84,7 @@ archive_read_open_filename(struct archiv void *b; int fd; + archive_clear_error(a); if (filename == NULL || filename[0] == '\0') return (archive_read_open_fd(a, 0, block_size)); Modified: projects/mesh11s/lib/libarchive/archive_read_private.h ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_private.h Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_private.h Tue Apr 28 23:36:29 2009 (r191642) @@ -189,6 +189,7 @@ const void *__archive_read_filter_ahead( ssize_t __archive_read_consume(struct archive_read *, size_t); ssize_t __archive_read_filter_consume(struct archive_read_filter *, size_t); int64_t __archive_read_skip(struct archive_read *, int64_t); +int64_t __archive_read_skip_lenient(struct archive_read *, int64_t); int64_t __archive_read_filter_skip(struct archive_read_filter *, int64_t); int __archive_read_program(struct archive_read_filter *, const char *); #endif Modified: projects/mesh11s/lib/libarchive/archive_read_support_compression_xz.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_support_compression_xz.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_support_compression_xz.c Tue Apr 28 23:36:29 2009 (r191642) @@ -100,6 +100,7 @@ archive_read_support_compression_xz(stru struct archive_read *a = (struct archive_read *)_a; struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a); + archive_clear_error(_a); if (bidder == NULL) return (ARCHIVE_FATAL); @@ -123,6 +124,7 @@ archive_read_support_compression_lzma(st struct archive_read *a = (struct archive_read *)_a; struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a); + archive_clear_error(_a); if (bidder == NULL) return (ARCHIVE_FATAL); Modified: projects/mesh11s/lib/libarchive/archive_read_support_format_cpio.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_support_format_cpio.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_support_format_cpio.c Tue Apr 28 23:36:29 2009 (r191642) @@ -257,6 +257,11 @@ archive_read_format_cpio_read_header(str cpio->entry_bytes_remaining = 0; } + /* XXX TODO: If the full mode is 0160200, then this is a Solaris + * ACL description for the following entry. Read this body + * and parse it as a Solaris-style ACL, then read the next + * header. XXX */ + /* Compare name to "TRAILER!!!" to test for end-of-archive. */ if (namelength == 11 && strcmp((const char *)h, "TRAILER!!!") == 0) { /* TODO: Store file location of start of block. */ @@ -669,7 +674,7 @@ le4(const unsigned char *p) static int be4(const unsigned char *p) { - return (p[0] + (p[1]<<8) + (p[2]<<16) + (p[3]<<24)); + return ((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + (p[3])); } /* Modified: projects/mesh11s/lib/libarchive/archive_read_support_format_empty.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_support_format_empty.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_support_format_empty.c Tue Apr 28 23:36:29 2009 (r191642) @@ -59,10 +59,9 @@ archive_read_support_format_empty(struct static int archive_read_format_empty_bid(struct archive_read *a) { - const void *h; ssize_t avail; - h = __archive_read_ahead(a, 1, &avail); + (void)__archive_read_ahead(a, 1, &avail); if (avail != 0) return (-1); return (1); Modified: projects/mesh11s/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_support_format_iso9660.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_support_format_iso9660.c Tue Apr 28 23:36:29 2009 (r191642) @@ -683,7 +683,7 @@ archive_read_format_iso9660_read_data(st if (bytes_read == 0) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Truncated input file"); - if (buff == NULL) + if (*buff == NULL) return (ARCHIVE_FATAL); if (bytes_read > iso9660->entry_bytes_remaining) bytes_read = iso9660->entry_bytes_remaining; Modified: projects/mesh11s/lib/libarchive/archive_read_support_format_mtree.c ============================================================================== --- projects/mesh11s/lib/libarchive/archive_read_support_format_mtree.c Tue Apr 28 22:27:22 2009 (r191641) +++ projects/mesh11s/lib/libarchive/archive_read_support_format_mtree.c Tue Apr 28 23:36:29 2009 (r191642) @@ -990,8 +990,8 @@ read_data(struct archive_read *a, const if (mtree->buff == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); } - return (ARCHIVE_FATAL); } *buff = mtree->buff; Copied: projects/mesh11s/lib/libarchive/archive_read_support_format_raw.c (from r191639, head/lib/libarchive/archive_read_support_format_raw.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mesh11s/lib/libarchive/archive_read_support_format_raw.c Tue Apr 28 23:36:29 2009 (r191642, copy of r191639, head/lib/libarchive/archive_read_support_format_raw.c) @@ -0,0 +1,187 @@ +/*- + * Copyright (c) 2003-2009 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_read_private.h" + +struct raw_info { + int64_t offset; /* Current position in the file. */ + int end_of_file; +}; + +static int archive_read_format_raw_bid(struct archive_read *); +static int archive_read_format_raw_cleanup(struct archive_read *); +static int archive_read_format_raw_read_data(struct archive_read *, + const void **, size_t *, off_t *); +static int archive_read_format_raw_read_data_skip(struct archive_read *); +static int archive_read_format_raw_read_header(struct archive_read *, + struct archive_entry *); + +int +archive_read_support_format_raw(struct archive *_a) +{ + struct raw_info *info; + struct archive_read *a = (struct archive_read *)_a; + int r; + + info = (struct raw_info *)calloc(1, sizeof(*info)); + if (info == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate raw_info data"); + return (ARCHIVE_FATAL); + } + + r = __archive_read_register_format(a, + info, + "raw", + archive_read_format_raw_bid, + NULL, + archive_read_format_raw_read_header, + archive_read_format_raw_read_data, + archive_read_format_raw_read_data_skip, + archive_read_format_raw_cleanup); + if (r != ARCHIVE_OK) + free(info); + return (r); +} + +/* + * Bid 1 if this is a non-empty file. Anyone who can really support + * this should outbid us, so it should generally be safe to use "raw" + * in conjunction with other formats. But, this could really confuse + * folks if there are bid errors or minor file damage, so we don't + * include "raw" as part of support_format_all(). + */ +static int +archive_read_format_raw_bid(struct archive_read *a) +{ + const char *p; + + if ((p = __archive_read_ahead(a, 1, NULL)) == NULL) + return (-1); + return (1); +} + +/* + * Mock up a fake header. + */ +static int +archive_read_format_raw_read_header(struct archive_read *a, + struct archive_entry *entry) +{ + struct raw_info *info; + + info = (struct raw_info *)(a->format->data); + if (info->end_of_file) + return (ARCHIVE_EOF); + + a->archive.archive_format = ARCHIVE_FORMAT_RAW; + a->archive.archive_format_name = "Raw data"; + archive_entry_set_pathname(entry, "data"); + /* XXX should we set mode to mimic a regular file? XXX */ + /* I'm deliberately leaving most fields unset here. */ + return (ARCHIVE_OK); +} + +static int +archive_read_format_raw_read_data(struct archive_read *a, + const void **buff, size_t *size, off_t *offset) +{ + struct raw_info *info; + ssize_t avail; + + info = (struct raw_info *)(a->format->data); + if (info->end_of_file) + return (ARCHIVE_EOF); + + /* Get whatever bytes are immediately available. */ + *buff = __archive_read_ahead(a, 1, &avail); + if (avail > 0) { + /* Consume and return the bytes we just read */ + __archive_read_consume(a, avail); + *size = avail; + *offset = info->offset; + info->offset += *size; + return (ARCHIVE_OK); + } else if (0 == avail) { + /* Record and return end-of-file. */ + info->end_of_file = 1; + *size = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Wed Apr 29 03:21:53 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 90A64106564A; Wed, 29 Apr 2009 03:21:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F56B8FC0A; Wed, 29 Apr 2009 03:21:53 +0000 (UTC) (envelope-from gonzo@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 n3T3LrSP067710; Wed, 29 Apr 2009 03:21:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3T3Lraq067709; Wed, 29 Apr 2009 03:21:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200904290321.n3T3Lraq067709@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 29 Apr 2009 03:21:53 +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: r191644 - projects/mips/sys/mips/atheros 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: Wed, 29 Apr 2009 03:21:53 -0000 Author: gonzo Date: Wed Apr 29 03:21:53 2009 New Revision: 191644 URL: http://svn.freebsd.org/changeset/base/191644 Log: - accummulate interrupt causes in filter instead of rewriting old. The only place where status should be overrided - interrupt handler Modified: projects/mips/sys/mips/atheros/if_arge.c Modified: projects/mips/sys/mips/atheros/if_arge.c ============================================================================== --- projects/mips/sys/mips/atheros/if_arge.c Wed Apr 29 03:15:43 2009 (r191643) +++ projects/mips/sys/mips/atheros/if_arge.c Wed Apr 29 03:21:53 2009 (r191644) @@ -1471,7 +1471,7 @@ arge_intr_filter(void *arg) ARGE_CLEAR_BITS(sc, AR71XX_DMA_INTR, DMA_INTR_TX_UNDERRUN | DMA_INTR_TX_PKT_SENT); - sc->arge_intr_status = status; + sc->arge_intr_status |= status; return (FILTER_SCHEDULE_THREAD); } From owner-svn-src-projects@FreeBSD.ORG Wed Apr 29 11:18:04 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 37BB1106568A; Wed, 29 Apr 2009 11:18:04 +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 263078FC16; Wed, 29 Apr 2009 11:18:04 +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 n3TBI4fh079114; Wed, 29 Apr 2009 11:18:04 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3TBI4bk079113; Wed, 29 Apr 2009 11:18:04 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904291118.n3TBI4bk079113@svn.freebsd.org> From: Rui Paulo Date: Wed, 29 Apr 2009 11:18:04 +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: r191664 - projects/mesh11s/usr.sbin/wlandebug 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: Wed, 29 Apr 2009 11:18:04 -0000 Author: rpaulo Date: Wed Apr 29 11:18:03 2009 New Revision: 191664 URL: http://svn.freebsd.org/changeset/base/191664 Log: Fix typo. Modified: projects/mesh11s/usr.sbin/wlandebug/wlandebug.c Modified: projects/mesh11s/usr.sbin/wlandebug/wlandebug.c ============================================================================== --- projects/mesh11s/usr.sbin/wlandebug/wlandebug.c Wed Apr 29 11:15:58 2009 (r191663) +++ projects/mesh11s/usr.sbin/wlandebug/wlandebug.c Wed Apr 29 11:18:03 2009 (r191664) @@ -65,7 +65,7 @@ const char *progname; #define IEEE80211_MSG_DOT1XSM 0x00010000 /* 802.1x state machine */ #define IEEE80211_MSG_RADIUS 0x00008000 /* 802.1x radius client */ #define IEEE80211_MSG_RADDUMP 0x00004000 /* dump 802.1x radius packets */ -#define IEEE80211_MSG_MES 0x00002000 /* mesh networking */ +#define IEEE80211_MSG_MESH 0x00002000 /* mesh networking */ #define IEEE80211_MSG_WPA 0x00001000 /* WPA/RSN protocol */ #define IEEE80211_MSG_ACL 0x00000800 /* ACL handling */ #define IEEE80211_MSG_WME 0x00000400 /* WME protocol */ From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 11:45:09 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 93725106566B; Thu, 30 Apr 2009 11:45:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 801CD8FC12; Thu, 30 Apr 2009 11:45:09 +0000 (UTC) (envelope-from rwatson@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 n3UBj9wt011154; Thu, 30 Apr 2009 11:45:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UBj9Tg011152; Thu, 30 Apr 2009 11:45:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904301145.n3UBj9Tg011152@svn.freebsd.org> From: Robert Watson Date: Thu, 30 Apr 2009 11:45:09 +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: r191683 - projects/pnet/sys/net 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, 30 Apr 2009 11:45:09 -0000 Author: rwatson Date: Thu Apr 30 11:45:09 2009 New Revision: 191683 URL: http://svn.freebsd.org/changeset/base/191683 Log: implify and improve netisr2 significantly: - Allow protocols to map mbufs to flow IDs, and flow IDs to CPUs - Always use the flowid field in the packet header to carry flow IDs with packets - Always use write-locking for protocol registration, even if we've compiled out read-locking for the fast path - Don't lock around per-workflow statistics - Use a simpler default flow->CPU mapping for protocols without specific affinity requirements Modified: projects/pnet/sys/net/netisr2.c projects/pnet/sys/net/netisr2.h Modified: projects/pnet/sys/net/netisr2.c ============================================================================== --- projects/pnet/sys/net/netisr2.c Thu Apr 30 10:01:13 2009 (r191682) +++ projects/pnet/sys/net/netisr2.c Thu Apr 30 11:45:09 2009 (r191683) @@ -28,12 +28,12 @@ __FBSDID("$FreeBSD$"); /* - * netisr2 is a work dispatch service, allowing synchronous and asynchronous - * processing of packets by protocol handlers. Each protocol registers a - * handler, and callers pass the protocol identifier and packet to the netisr - * dispatch routines to cause them to be processed. Processing may occur - * synchonously via direct dispatch, or asynchronously via queued dispatch in - * a worker thread. + * netisr2 is a packet dispatch service, allowing synchronous (directly + * dispatched) and asynchronous (deferred dispatch) processing of packets by + * registered protocol handlers. Callers pass a protocol identifier and + * packet to netisr2, along with a direct dispatch hint, and work will either + * be immediately processed with the registered handler, or passed to a + * kernel worker thread for deferred dispatch. * * Maintaining ordering for protocol streams is a critical design concern. * Enforcing ordering limits the opportunity for concurrency, but maintains @@ -42,38 +42,22 @@ __FBSDID("$FreeBSD$"); * associated with a particular stream on the same CPU over time in order to * avoid acquiring locks associated with the connection on different CPUs, * keep connection data in one cache, and to generally encourage associated - * user threads to live on the same CPU as the stream. - * - * We handle three cases: - * - * - The protocol is unable to determine an a priori ordering based on a - * cheap inspection of packet contents, so we either globally order (run in - * a single worker) or source order (run in the context of a particular - * source). - * - * - The protocol exposes ordering information in the form of a generated - * flow identifier, and relies on netisr2 to assign this work to a CPU. We - * can execute the handler in the source thread, or we can assign it to a - * CPU based on hashing flows to CPUs. - * - * - The protocol exposes ordering and affinity information in the form of a - * CPU identifier. We can execute the handler in the source thread, or we - * can dispatch it to the worker for that CPU. - * - * When CPU and flow affinities are returned by protocols, they also express - * an affinity strength, which is used by netisr2 to decide whether or not to - * directly dispatch a packet on a CPU other than the one it has an affinity - * for. - * - * We guarantee that if two packets come from the same source have the same - * flowid or CPU affinity, and have the same affinity strength, they will - * remain in order with respect to each other. We guarantee that if the - * returned affinity is strong, the packet will only be processed on the - * requested CPU or CPU associated with the requested flow. - * - * Protocols that provide flowids but not affinity should attempt to provide - * a uniform distribution over the flowid space in order to balance work - * effectively. + * user threads to live on the same CPU as the stream. It's also desirable + * to avoid lock migration and contention where locks are associated with + * more than one flow. + * + * There are two cases: + * + * - The packet has a flow ID, query the protocol to map it to a CPU and + * execute there if not direct dispatching. + * + * - The packet has no flowid, query the protocol to generate a flow ID, then + * query a CPU and execute there if not direct dispatching. + * + * We guarantee that if two packets from the same source have the same + * protocol, and the source provides an ordering, that ordering will be + * maintained *unless* the policy is changing between queued and direct + * dispatch in which case minor re-ordering might occur. * * Some possible sources of flow identifiers for packets: * - Hardware-generated hash from RSS @@ -106,37 +90,36 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef NETISR_LOCKING /*- * Synchronize use and modification of the registered netisr data structures; * acquire a read lock while modifying the set of registered protocols to * prevent partially registered or unregistered protocols from being run. * - * We make this optional so that we can measure the performance impact of - * providing consistency against run-time registration and deregristration, - * which is a very uncommon event. + * We make per-packet use optional so that we can measure the performance + * impact of providing consistency against run-time registration and + * deregristration, which is a very uncommon event. * * The following data structures and fields are protected by this lock: * * - The np array, including all fields of struct netisr_proto. * - The nws array, including all fields of struct netisr_worker. * - The nws_array array. + * + * XXXRW: This should use an rmlock. */ static struct rwlock netisr_rwlock; #define NETISR_LOCK_INIT() rw_init(&netisr_rwlock, "netisr") +#ifdef NETISR_LOCKING #define NETISR_LOCK_ASSERT() rw_assert(&netisr_rwlock, RW_LOCKED) #define NETISR_RLOCK() rw_rlock(&netisr_rwlock) #define NETISR_RUNLOCK() rw_runlock(&netisr_rwlock) -#define NETISR_WLOCK() rw_wlock(&netisr_rwlock) -#define NETISR_WUNLOCK() rw_wunlock(&netisr_rwlock) #else -#define NETISR_LOCK_INIT() #define NETISR_LOCK_ASSERT() #define NETISR_RLOCK() #define NETISR_RUNLOCK() -#define NETISR_WLOCK() -#define NETISR_WUNLOCK() #endif +#define NETISR_WLOCK() rw_wlock(&netisr_rwlock) +#define NETISR_WUNLOCK() rw_wunlock(&netisr_rwlock) SYSCTL_NODE(_net, OID_AUTO, isr2, CTLFLAG_RW, 0, "netisr2"); @@ -147,7 +130,8 @@ SYSCTL_INT(_net_isr2, OID_AUTO, direct, /* * Allow the administrator to limit the number of threads (CPUs) to use for * netisr2. Notice that we don't check netisr_maxthreads before creating the - * thread for CPU 0, so in practice we ignore values <= 1. + * thread for CPU 0, so in practice we ignore values <= 1. This must be set + * as a tunable, no run-time reconfiguration yet. */ static int netisr_maxthreads = MAXCPU; /* Bound number of threads. */ TUNABLE_INT("net.isr2.maxthreads", &netisr_maxthreads); @@ -157,15 +141,13 @@ SYSCTL_INT(_net_isr2, OID_AUTO, maxthrea /* * Each protocol is described by an instance of netisr_proto, which holds all * global per-protocol information. This data structure is set up by - * netisr_register(). Currently, no flags are required, as all handlers are - * MPSAFE in the netisr2 system. Protocols provide zero or one of the two - * lookup interfaces, but not both. + * netisr_register(). */ struct netisr_proto { - netisr_t *np_func; /* Protocol handler. */ - netisr_lookup_flow_t *np_lookup_flow; /* Flow generation. */ - netisr_lookup_cpu_t *np_lookup_cpu; /* CPU affinity. */ - const char *np_name; /* Protocol name. */ + const char *np_name; /* Protocol name. */ + netisr_t *np_func; /* Protocol handler. */ + netisr_m2flow_t *np_m2flow; /* mbuf -> flow ID. */ + netisr_flow2cpu_t *np_flow2cpu; /* Flow ID -> CPU ID. */ }; #define NETISR_MAXPROT 32 /* Compile-time limit. */ @@ -195,7 +177,7 @@ struct netisr_work { u_int nw_watermark; /* - * Statistics. + * Statistics -- written unlocked, but mostly from curcpu. */ u_int nw_dispatched; /* Number of direct dispatches. */ u_int nw_dropped; /* Number of drops. */ @@ -225,7 +207,7 @@ struct netisr_workstream { * Each protocol has per-workstream data. */ struct netisr_work nws_work[NETISR_MAXPROT]; -} __aligned(64); +} __aligned(CACHE_LINE_SIZE); /* * Kernel process associated with worker threads. @@ -273,8 +255,8 @@ static u_int nws_count; * the protocol is installed. */ void -netisr2_register(u_int proto, netisr_t func, netisr_lookup_cpu_t lookup_cpu, - netisr_lookup_flow_t lookup_flow, const char *name, u_int max) +netisr2_register(u_int proto, const char *name, netisr_t func, + netisr_m2flow_t m2flow, netisr_flow2cpu_t flow2cpu, u_int max) { struct netisr_work *npwp; int i; @@ -282,28 +264,29 @@ netisr2_register(u_int proto, netisr_t f NETISR_WLOCK(); KASSERT(proto < NETISR_MAXPROT, ("netisr2_register(%d, %s): too many protocols", proto, name)); - KASSERT(np[proto].np_func == NULL, - ("netisr2_register(%d, %s): func present", proto, name)); - KASSERT(np[proto].np_lookup_cpu == NULL, - ("netisr2_register(%d, %s): lookup_cpu present", proto, name)); - KASSERT(np[proto].np_lookup_flow == NULL, - ("netisr2_register(%d, %s): lookup_flow present", proto, name)); KASSERT(np[proto].np_name == NULL, ("netisr2_register(%d, %s): name present", proto, name)); - - KASSERT(func != NULL, ("netisr2_register: func NULL")); - KASSERT((lookup_flow == NULL && lookup_cpu == NULL) || - (lookup_flow != NULL && lookup_cpu == NULL) || - (lookup_flow == NULL && lookup_cpu != NULL), - ("netisr2_register(%d, %s): flow and cpu set", proto, name)); + KASSERT(np[proto].np_func == NULL, + ("netisr2_register(%d, %s): func present", proto, name)); + KASSERT(np[proto].np_m2flow == NULL, + ("netisr2_register(%d, %s): m2flow present", proto, name)); + KASSERT(np[proto].np_flow2cpu == NULL, + ("netisr2_register(%d, %s): flow2cpu present", proto, name)); + + KASSERT(name != NULL, ("netisr2_register: name NULL for %d", proto)); + KASSERT(func != NULL, ("netisr2_register: func NULL for %s", name)); + KASSERT(m2flow != NULL, ("netisr2_register: m2flow NULL for %s", + name)); + KASSERT(flow2cpu != NULL, ("netisr2_registeR: flow2cpu NULL for %s", + name)); /* * Initialize global and per-workstream protocol state. */ - np[proto].np_func = func; - np[proto].np_lookup_cpu = lookup_cpu; - np[proto].np_lookup_flow = lookup_flow; np[proto].np_name = name; + np[proto].np_func = func; + np[proto].np_m2flow = m2flow; + np[proto].np_flow2cpu = flow2cpu; for (i = 0; i < MAXCPU; i++) { npwp = &nws[i].nws_work[proto]; bzero(npwp, sizeof(*npwp)); @@ -350,10 +333,10 @@ netisr2_deregister(u_int proto) KASSERT(np[proto].np_func != NULL, ("netisr_deregister(%d): protocol not registered", proto)); - np[proto].np_func = NULL; np[proto].np_name = NULL; - np[proto].np_lookup_cpu = NULL; - np[proto].np_lookup_flow = NULL; + np[proto].np_func = NULL; + np[proto].np_m2flow = NULL; + np[proto].np_flow2cpu = NULL; for (i = 0; i < MAXCPU; i++) { npwp = &nws[i].nws_work[proto]; netisr2_drain_proto(npwp); @@ -363,30 +346,13 @@ netisr2_deregister(u_int proto) } /* - * Naively map a flow ID into a CPU ID. For now we use a rather poor hash to - * reduce 32 bits down to a much smaller number of bits. We should attempt - * to be much more adaptive to the actual CPU count. - * - * XXXRW: This needs to be entirely rewritten. + * Provide a simple flow -> CPU mapping for protocols with strong ordering + * requirements but no built-in notion of affinity. */ u_int netisr2_flowid2cpuid(u_int flowid) { - NETISR_LOCK_ASSERT(); - - /* - * Most systems have less than 256 CPUs, so combine the various bytes - * in the flowid so that we get all the entropy down to a single - * byte. We could be doing a much better job here. On systems with - * fewer CPUs, we slide the top nibble into the bottom nibble. - */ - flowid = ((flowid & 0xff000000) >> 24) ^ - ((flowid & 0x00ff0000) >> 16) ^ ((flowid & 0x0000ff00) >> 8) ^ - (flowid & 0x000000ff); -#if MAXCPU <= 16 - flowid = ((flowid & 0xf0) >> 4) ^ (flowid & 0x0f); -#endif return (nws_array[flowid % nws_count]); } @@ -406,34 +372,21 @@ netisr2_flowid2cpuid(u_int flowid) * (i.e., out of mbufs and a rewrite is required). */ static struct mbuf * -netisr2_selectcpu(u_int proto, struct mbuf *m, u_int *cpuidp, - u_int *strengthp) +netisr2_selectcpu(struct netisr_proto *npp, struct mbuf *m, u_int *cpuidp) { - u_int flowid; NETISR_LOCK_ASSERT(); - KASSERT(nws_count > 0, ("netisr2_workstream_lookup: nws_count")); - - *cpuidp = 0; - *strengthp = 0; - if (np[proto].np_lookup_cpu != NULL) - return (np[proto].np_lookup_cpu(m, cpuidp, strengthp)); - else if (np[proto].np_lookup_flow != NULL) { - m = np[proto].np_lookup_flow(m, &flowid, strengthp); + if (!(m->m_flags & M_FLOWID)) { + m = npp->np_m2flow(m); if (m == NULL) return (NULL); - *cpuidp = netisr2_flowid2cpuid(flowid); - return (m); - } else { - /* - * XXXRW: Pin protocols without a CPU or flow assignment - * preference to an arbitrary CPU. This needs refinement. - */ - *cpuidp = netisr2_flowid2cpuid(proto); - *strengthp = NETISR2_AFFINITY_WEAK; - return (m); + KASSERT(m->m_flags & M_FLOWID, ("netisr2_selectcpu: protocol" + " %s failed to return flowid on mbuf", + npp->np_name)); } + *cpuidp = npp->np_flow2cpu(m->m_pkthdr.flowid); + return (m); } /* @@ -464,7 +417,7 @@ netisr2_process_workstream_proto(struct return; /* - * Create a local copy of the work queue, and clear the global queue. + * Move the global work queue to a thread-local work queue. * * Notice that this means the effective maximum length of the queue * is actually twice that of the maximum queue length specified in @@ -556,28 +509,6 @@ netisr2_worker(void *arg) } } -/* - * Internal routines for dispatch and queue. - */ -static void -netisr2_dispatch_internal(u_int proto, struct mbuf *m, u_int cpuid) -{ - struct netisr_workstream *nwsp; - struct netisr_work *npwp; - - KASSERT(cpuid == curcpu, ("netisr2_dispatch_internal: wrong CPU")); - - NETISR_LOCK_ASSERT(); - - nwsp = &nws[cpuid]; - npwp = &nwsp->nws_work[proto]; - NWS_LOCK(nwsp); - npwp->nw_dispatched++; - npwp->nw_handled++; - NWS_UNLOCK(nwsp); - np[proto].np_func(m); -} - static int netisr2_queue_internal(u_int proto, struct mbuf *m, u_int cpuid) { @@ -588,11 +519,11 @@ netisr2_queue_internal(u_int proto, stru NETISR_LOCK_ASSERT(); dosignal = 0; + error = 0; nwsp = &nws[cpuid]; npwp = &nwsp->nws_work[proto]; NWS_LOCK(nwsp); if (npwp->nw_len < npwp->nw_max) { - error = 0; m->m_nextpkt = NULL; if (npwp->nw_head == NULL) { npwp->nw_head = m; @@ -604,168 +535,86 @@ netisr2_queue_internal(u_int proto, stru npwp->nw_len++; if (npwp->nw_len > npwp->nw_watermark) npwp->nw_watermark = npwp->nw_len; - npwp->nw_queued++; nwsp->nws_pendingwork++; if (!(nwsp->nws_flags & NWS_SIGNALED)) { nwsp->nws_flags |= NWS_SIGNALED; dosignal = 1; /* Defer until unlocked. */ } - } else { + error = 0; + } else error = ENOBUFS; - npwp->nw_dropped++; - } NWS_UNLOCK(nwsp); if (dosignal) NWS_SIGNAL(nwsp); - return (error); -} - -/* - * Variations on dispatch and queue in which the protocol determines where - * work is placed. - * - * XXXRW: The fact that the strength of affinity is only available by making - * a call to determine affinity means that we always pay the price of hashing - * the headers. If the protocol declared ahead of time the strength of the - * affinity it required, such as at netisr2 registration time, we could skip - * the hash generation when we knew we wanted to direct dispatch. - */ -int -netisr2_dispatch(u_int proto, struct mbuf *m) -{ - u_int cpuid, strength; - int error; - - error = 0; - sched_pin(); - NETISR_RLOCK(); - m = netisr2_selectcpu(proto, m, &cpuid, &strength); - if (m == NULL) { - error = ENOBUFS; - goto out; - } - switch (strength) { - case NETISR2_AFFINITY_STRONG: - if (curcpu != cpuid) { - error = netisr2_queue_internal(proto, m, cpuid); - break; - } - /* FALLSTHROUGH */ - - case NETISR2_AFFINITY_WEAK: - if (netisr_direct) { - cpuid = curcpu; - netisr2_dispatch_internal(proto, m, cpuid); - } else - error = netisr2_queue_internal(proto, m, cpuid); - break; - } -out: - NETISR_RUNLOCK(); - sched_unpin(); - if (error && m != NULL) - m_freem(m); + if (error) + npwp->nw_dropped++; + else + npwp->nw_queued++; return (error); } int netisr2_queue(u_int proto, struct mbuf *m) { - u_int cpuid, strength; - int error; - - NETISR_RLOCK(); - m = netisr2_selectcpu(proto, m, &cpuid, &strength); - if (m == NULL) { - error = ENOBUFS; - goto out; - } - error = netisr2_queue_internal(proto, m, cpuid); -out: - NETISR_RUNLOCK(); - if (error && m != NULL) - m_freem(m); - return (error); -} + u_int cpuid, error; -/* - * Variations on dispatch and queue in which the caller specifies an explicit - * CPU affinity. - */ -int -netisr2_dispatch_cpu(u_int proto, struct mbuf *m, u_int cpuid) -{ - int error; + KASSERT(proto < NETISR_MAXPROT, + ("netisr2_dispatch: invalid proto %d", proto)); - sched_pin(); NETISR_RLOCK(); - if (cpuid == curcpu) { - netisr2_dispatch_internal(proto, m, cpuid); - error = 0; - } else + KASSERT(np[proto].np_func != NULL, + ("netisr2_dispatch: invalid proto %d", proto)); + + m = netisr2_selectcpu(&np[proto], m, &cpuid); + if (m != NULL) error = netisr2_queue_internal(proto, m, cpuid); + else + error = ENOBUFS; NETISR_RUNLOCK(); - sched_unpin(); return (error); } int -netisr2_queue_cpu(u_int proto, struct mbuf *m, u_int cpuid) +netisr2_dispatch(u_int proto, struct mbuf *m) { - int error; - - NETISR_RLOCK(); - error = netisr2_queue_internal(proto, m, cpuid); - NETISR_RUNLOCK(); - return (error); -} + struct netisr_workstream *nwsp; + struct netisr_work *npwp; -/* - * Variations on dispatch and queue in which the caller specifies an explicit - * flow identifier. - */ -int -netisr2_dispatch_flow(u_int proto, struct mbuf *m, u_int flowid) -{ - u_int cpuid; - int error; + if (!netisr_direct) + return (netisr2_queue(proto, m)); + KASSERT(proto < NETISR_MAXPROT, + ("netisr2_dispatch: invalid proto %d", proto)); - sched_pin(); NETISR_RLOCK(); - cpuid = netisr2_flowid2cpuid(flowid); - if (cpuid == curcpu) { - netisr2_dispatch_internal(proto, m, cpuid); - error = 0; - } else - error = netisr2_queue_internal(proto, m, cpuid); - NETISR_RUNLOCK(); - sched_unpin(); - return (error); -} - -int -netisr2_queue_flow(u_int proto, struct mbuf *m, u_int flowid) -{ - u_int cpuid; - int error; + KASSERT(np[proto].np_func != NULL, + ("netisr2_dispatch: invalid proto %d", proto)); - NETISR_RLOCK(); - cpuid = netisr2_flowid2cpuid(flowid); - error = netisr2_queue_internal(proto, m, cpuid); + /* + * Borrow current CPU's stats, even if there's no worker. + */ + nwsp = &nws[curcpu]; + npwp = &nwsp->nws_work[proto]; + npwp->nw_dispatched++; + npwp->nw_handled++; + np[proto].np_func(m); NETISR_RUNLOCK(); - return (error); + return (0); } /* * Initialize the netisr subsystem. We rely on BSS and static initialization - * of most fields in global data structures. Start a worker thread for the - * boot CPU. + * of most fields in global data structures. + * + * Start a worker thread for the boot CPU so that we can support network + * traffic immediately in case the netowrk stack is used before additional + * CPUs are started (for example, diskless boot). */ static void netisr2_init(void *arg) { struct netisr_workstream *nwsp; - int cpuid, error; + u_int cpuid; + int error; KASSERT(curcpu == 0, ("netisr2_init: not on CPU 0")); Modified: projects/pnet/sys/net/netisr2.h ============================================================================== --- projects/pnet/sys/net/netisr2.h Thu Apr 30 10:01:13 2009 (r191682) +++ projects/pnet/sys/net/netisr2.h Thu Apr 30 11:45:09 2009 (r191683) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2008 Robert N. M. Watson + * Copyright (c) 2007-2009 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,60 +34,37 @@ #endif /*- - * Protocols may express flow affinities or CPU affinities using lookup - * functions: + * Prototocols express flow and CPU affinities by implementing two functions: * - * netisr_lookup_cpu_t - Given a packet for the protocol handler, return a - * CPU affinity that will be used, and an indication of - * the affinity strength. All packets with the same - * CPU affinity and strength must be processed in order - * with respect to a single source. - * - * netisr_lookup_flow_t - Given a packet for the protocol handler, return a - * flow identifier that can be used to identify - * ordering requirements with respect to other - * packets, and likewise an affinity strength to use - * with the flowid-derived affinity. All packets - * with the same flowid and affinity strength must be - * processed in order with respect to a single source. - * - * Protocols that implement direct CPU assignment of work, rather than - * returning a flowid, must not return invalid (i.e., absent or otherwise - * inappropriate) CPU identifiers. The dispatch routines will panic if that - * occurs. + * netisr_m2flow_t - When a packet without M_FLOWID is processed by netisr2, + * it may call into the protocol to generate the missing + * flow ID which should be installed in the packet header. + * If a flow ID cannot be generated, or failure occurs, + * NULL should be returned. + * + * netisr_flow2cpu_t - Given a flowid, possibly generated by netisr_m2flow, + * select a CPU to execute the packet handler on. * * XXXRW: If we eventually support dynamic reconfiguration, there should be * protocol handlers to notify them of CPU configuration changes so that they * can rebalance work. */ -typedef struct mbuf *netisr_lookup_flow_t(struct mbuf *m, u_int *flowid, - u_int *strength); -typedef struct mbuf *netisr_lookup_cpu_t(struct mbuf *m, u_int *cpuid, - u_int *strength); - -/* - * Possibly values for the 'strength' returned by netisr_lookup_cpu_t. - * Protocols should consistently return the same strength for packets in the - * same flow, or misordering may occur due to varying dispatch decisions. - */ -#define NETISR2_AFFINITY_STRONG 1 /* Never direct dispatch off-CPU. */ -#define NETISR2_AFFINITY_WEAK 2 /* Direct dispatch even if off-CPU. */ +typedef struct mbuf *netisr_m2flow_t(struct mbuf *m); +typedef u_int netisr_flow2cpu_t(u_int flowid); /*- * Register a new netisr2 handler for a given protocol. No previous - * registration may exist. At most one of lookup_cpu and lookup_flow may be - * defined. If no lookup routine is defined, the protocol's work will be - * assigned to a CPU arbitrarily. + * registration may exist. * * proto - Integer protocol identifier. + * name - Character string describing the protocol handler. * func - Protocol handler. - * lookup_cpu - CPU affinity lookup. - * lookup_flow - Flow lookup. + * m2flow - Generate [missing] flowid for mbuf. + * flow2cpu - Convert a flowid to a CPU affinity. * max - Maximum queue depth. */ -void netisr2_register(u_int proto, netisr_t func, - netisr_lookup_cpu_t lookup_cpu, netisr_lookup_flow_t lookup_flow, - const char *name, u_int max); +void netisr2_register(u_int proto, const char *name, netisr_t func, + netisr_m2flow_t m2flow, netisr_flow2cpu_t flow2cpu, u_int max); /* * Deregister a protocol handler. @@ -95,54 +72,17 @@ void netisr2_register(u_int proto, netis void netisr2_deregister(u_int proto); /* - * Packet processing routines -- each accepts a protocol identifier and a - * packet. Some also force the use of a particular CPU affinity or flow - * identifier rather than having the dispatcher query the protocol. - * - * _dispatch variants will attempt do directly dispatch the handler if - * globally enabled and permitted by the protocol. - * - * _queue variants will enqueue the packet for later processing by the - * handler in a deferred context. - * - * Direct dispatch decisions are made based on a combination of global - * properties (is direct dispatch enabled), caller properties (is direct - * dispatch allowed in this context) and protocol properties (strong affinity - * will prevent direct dispatch on the wrong CPU, even if it maintains source - * ordering). Callers should use only one of the direct and queued dispatch - * modes for each source, or ordering constraints with respect to the source - * cannot be maintained. - */ - -/* - * Process a packet destined for a protocol, looking up the CPU or flowid - * using the protocol's lookup routines. + * Process a packet destined for a protocol, and attempt direct dispatch. */ int netisr2_dispatch(u_int proto, struct mbuf *m); int netisr2_queue(u_int proto, struct mbuf *m); /* - * Process a packet destined for a protocol on a specific CPU, rather than - * querying the protocol to determine work placement. The passed CPU ID is - * considered a strong CPU affinity in making dispatch decisions. - */ -int netisr2_dispatch_cpu(u_int proto, struct mbuf *m, u_int cpuid); -int netisr2_queue_cpu(u_int proto, struct mbuf *m, u_int cpuid); - -/* - * Process a packet destined for a protocol with a specific flowid, rather - * than querying the protocol to determine work placement. The CPU affinity - * generated with the flowid is considered a strong affinity in making - * dispatch decisions. - */ -int netisr2_dispatch_flow(u_int proto, struct mbuf *m, u_int flowid); -int netisr2_queue_flow(u_int proto, struct mbuf *m, u_int flowid); - -/* - * In order to allow the same mapping of flow IDs to CPU affinities across - * layers, expose the netisr2 mapping function. + * Provide a default function to map flow IDs to CPU IDs, so that protocols + * needing a default flow->CPU model can use it. * - * XXXRW: Perhaps we should inline this and instead expose nws_count? + * XXXRW: Should also provide a way to query available CPUs so that protocols + * can decide how to map work more usefully themselves. */ u_int netisr2_flowid2cpuid(u_int flowid); From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 12:14:53 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 473DB106564A; Thu, 30 Apr 2009 12:14:53 +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 360B18FC1A; Thu, 30 Apr 2009 12:14:53 +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 n3UCErnk011761; Thu, 30 Apr 2009 12:14:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UCErFU011760; Thu, 30 Apr 2009 12:14:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904301214.n3UCErFU011760@svn.freebsd.org> From: Rui Paulo Date: Thu, 30 Apr 2009 12:14:53 +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: r191684 - 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, 30 Apr 2009 12:14:53 -0000 Author: rpaulo Date: Thu Apr 30 12:14:52 2009 New Revision: 191684 URL: http://svn.freebsd.org/changeset/base/191684 Log: Use Linux numbers (again). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211.h Modified: projects/mesh11s/sys/net80211/ieee80211.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211.h Thu Apr 30 11:45:09 2009 (r191683) +++ projects/mesh11s/sys/net80211/ieee80211.h Thu Apr 30 12:14:52 2009 (r191684) @@ -703,9 +703,9 @@ enum { */ IEEE80211_ELEMID_MESHCONF = 51, IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 55, + IEEE80211_ELEMID_MESHLINK = 35, IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 37, + IEEE80211_ELEMID_MESHPEER = 55, IEEE80211_ELEMID_MESHCSA = 38, IEEE80211_ELEMID_MESHTIM = 39, IEEE80211_ELEMID_MESHAWAKEW = 40, From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 12:16:15 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 EF0C9106567E; Thu, 30 Apr 2009 12:16:15 +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 DC4AD8FC14; Thu, 30 Apr 2009 12:16:15 +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 n3UCGFrh011837; Thu, 30 Apr 2009 12:16:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UCGFSA011833; Thu, 30 Apr 2009 12:16:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904301216.n3UCGFSA011833@svn.freebsd.org> From: Rui Paulo Date: Thu, 30 Apr 2009 12:16:15 +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: r191685 - 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, 30 Apr 2009 12:16:16 -0000 Author: rpaulo Date: Thu Apr 30 12:16:15 2009 New Revision: 191685 URL: http://svn.freebsd.org/changeset/base/191685 Log: Initial implementation of Mesh Peering. This makes it possible to establish a mesh link with a Linux mesh node, but the code is still imature. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_ht.c projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_node.h Modified: projects/mesh11s/sys/net80211/ieee80211_ht.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ht.c Thu Apr 30 12:14:52 2009 (r191684) +++ projects/mesh11s/sys/net80211/ieee80211_ht.c Thu Apr 30 12:16:15 2009 (r191685) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* define here, used throughout file */ #define MS(_v, _f) (((_v) & _f) >> _f##_S) @@ -2121,7 +2122,7 @@ ieee80211_send_action(struct ieee80211_n struct mbuf *m; uint8_t *frm; uint16_t baparamset; - int ret; + int ret, addsize; KASSERT(ni != NULL, ("null node")); @@ -2137,11 +2138,29 @@ ieee80211_send_action(struct ieee80211_n ieee80211_node_refcnt(ni)+1); ieee80211_ref_node(ni); + addsize = 0; + switch (category) { + case IEEE80211_ACTION_CAT_BA: + case IEEE80211_ACTION_CAT_HT: + addsize += sizeof(struct ieee80211_action_ba_addbaresponse); + break; + case IEEE80211_ACTION_CAT_MESHPEERING: + addsize += sizeof(uint16_t); /* capabilities */ + addsize += 2 + vap->iv_meshidlen; /* Mesh ID */ + addsize += sizeof(struct ieee80211_meshconf_ie); + /* On Open frames, the peer link ID is not sent */ + if (action == IEEE80211_ACTION_MESHPEERING_OPEN) + addsize += sizeof(struct ieee80211_meshpeer_ie) - 2; + else + addsize += sizeof(struct ieee80211_meshpeer_ie); + break; + } m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ /* XXX may action payload */ - + sizeof(struct ieee80211_action_ba_addbaresponse) + + addsize + ); if (m == NULL) senderr(ENOMEM, is_tx_nobuf); @@ -2210,6 +2229,43 @@ ieee80211_send_action(struct ieee80211_n goto badaction; } break; + case IEEE80211_ACTION_CAT_MESHPEERING: + + switch (action) { + case IEEE80211_ACTION_MESHPEERING_OPEN: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, + "send PEER OPEN action: lid %x", args[0]); + *frm++ = 0; /* capabilites */ + *frm++ = 0; + frm = ieee80211_add_meshid(frm, vap); + frm = ieee80211_add_meshconf(frm, vap); + *frm++ = IEEE80211_ELEMID_MESHPEER; + *frm++ = 3; /* len */ + *frm++ = IEEE80211_MESH_PEER_LINK_OPEN; /* subtype */ + ADDSHORT(frm, args[0]); /* local ID */ + break; + case IEEE80211_ACTION_MESHPEERING_CONFIRM: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, + "send PEER CONFIRM action: lid %x, pid %x", + args[0], args[1]); + *frm++ = 0; /* capabilites */ + *frm++ = 0; + *frm++ = 0; /* status code */ + *frm++ = 0; + *frm++ = 0; /* AID */ + *frm++ = 0; + frm = ieee80211_add_meshid(frm, vap); + frm = ieee80211_add_meshconf(frm, vap); + *frm++ = IEEE80211_ELEMID_MESHPEER; + *frm++ = 5; /* len */ + *frm++ = IEEE80211_MESH_PEER_LINK_CONFIRM; /* subtype */ + ADDSHORT(frm, args[0]); + ADDSHORT(frm, args[1]); + break; + } + break; default: badaction: IEEE80211_NOTE(vap, Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Apr 30 12:14:52 2009 (r191684) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Apr 30 12:16:15 2009 (r191685) @@ -68,6 +68,7 @@ static int mesh_input(struct ieee80211_n uint32_t); static void mesh_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, int, uint32_t); +static void mesh_recv_action(struct ieee80211_node *, struct mbuf *); void ieee80211_mesh_attach(struct ieee80211com *ic) @@ -314,6 +315,7 @@ static void mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, int rssi, int noise, uint32_t rstamp) { + static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ieee80211_frame *wh; @@ -327,7 +329,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni case IEEE80211_FC0_SUBTYPE_BEACON: { struct ieee80211_scanparams scan; - /* * We process beacon/probe response * frames to discover neighbors. @@ -363,6 +364,42 @@ mesh_recv_mgmt(struct ieee80211_node *ni return; } + /* The rest of this code assumes we setup and running */ + if (vap->iv_state != IEEE80211_S_RUN) + return; + /* + * Ignore non-mesh STAs and STAs for other mesh networks. + */ + if (scan.meshid && + memcmp(scan.meshid+2, vap->iv_meshid, vap->iv_meshidlen) != 0) { + IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, ni, + "beacon not for our mesh (%s)", scan.meshid+2); + return; + } + + /* + * More validation: make sure we are talking to a Mesh node. + */ + if ((scan.capinfo & (IEEE80211_CAPINFO_ESS|IEEE80211_CAPINFO_IBSS)) == 0 && + !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr) && + IEEE80211_ADDR_EQ(wh->i_addr3, zerobssid)) { + /* + * Create a new entry in the neighbor table. + */ + ni = ieee80211_add_neighbor(vap, wh, &scan); + } else { + /* + * Record tsf for potential resync. + */ + memcpy(ni->ni_tstamp.data, scan.tstamp, + sizeof(ni->ni_tstamp)); + } + if (ni != NULL) { + IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); + ni->ni_noise = noise; + ni->ni_rstamp = rstamp; + } + /* * If it's a beacon for our mesh and we haven't already * peered with this node, send him a mgmt frame with @@ -443,11 +480,15 @@ mesh_recv_mgmt(struct ieee80211_node *ni break; } case IEEE80211_FC0_SUBTYPE_ACTION: - if (vap->iv_state == IEEE80211_S_RUN) { - if (ieee80211_parse_action(ni, m0) == 0) - ic->ic_recv_action(ni, frm, efrm); - } else + if (vap->iv_state != IEEE80211_S_RUN) { vap->iv_stats.is_rx_mgtdiscard++; + break; + } + /* XXX parse_action is a bit useless now */ + if (ieee80211_parse_action(ni, m0) == 0) { + mesh_recv_action(ni, m0); + ic->ic_recv_action(ni, frm, efrm); + } break; case IEEE80211_FC0_SUBTYPE_AUTH: case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: @@ -467,6 +508,97 @@ mesh_recv_mgmt(struct ieee80211_node *ni break; } } +static void +mesh_recv_action(struct ieee80211_node *ni, struct mbuf *m0) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_action *ia; + struct ieee80211_frame *wh; + struct ieee80211_meshid_ie *meshid; + struct ieee80211_meshconf_ie *meshconf; + struct ieee80211_meshpeer_ie *meshpeer; + uint8_t *frm, *efrm; + uint16_t args[4]; + + wh = mtod(m0, struct ieee80211_frame *); + ia = (struct ieee80211_action *) &wh[1]; + frm = (uint8_t *)&wh[1]; + frm += sizeof(ia); + efrm = mtod(m0, uint8_t *) + m0->m_len; + + /* XXX explain frame format */ + meshid = NULL; + meshpeer = NULL; + meshconf = NULL; + while (efrm - frm > 1) { + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); + switch (*frm) { + case IEEE80211_ELEMID_MESHID: + meshid = (struct ieee80211_meshid_ie *) frm; + break; + case IEEE80211_ELEMID_MESHCONF: + meshconf = (struct ieee80211_meshconf_ie *) frm; + break; + case IEEE80211_ELEMID_MESHPEER: + meshpeer = (struct ieee80211_meshpeer_ie *) frm; + break; + } + frm += frm[1] + 2; + } + /* + * Check if we agree on Mesh ID and Configuration. + * XXX: TBD + */ + if (!meshid || !meshconf || !meshpeer) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, + wh, NULL, "%s", "action frame not for our mesh"); + vap->iv_stats.is_rx_mgtdiscard++; + return; + } + switch (ia->ia_category) { + case IEEE80211_ACTION_CAT_MESHPEERING: + switch (ia->ia_action) { + case IEEE80211_ACTION_MESHPEERING_OPEN: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, + "%s", "recv peering open"); + ni->ni_peerstate = IEEE80211_NODE_MESH_OPENRCV; + ni->ni_llid = meshpeer->peer_llinkid; + ni->ni_plid = 0xf4ef; + args[0] = ni->ni_plid; + ieee80211_send_action(ni, + IEEE80211_ACTION_CAT_MESHPEERING, + IEEE80211_ACTION_MESHPEERING_OPEN, args); + break; + case IEEE80211_ACTION_MESHPEERING_CONFIRM: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, + "%s", "recv peering confirm"); + if (ni->ni_peerstate != IEEE80211_NODE_MESH_OPNSENT && + ni->ni_peerstate != IEEE80211_NODE_MESH_OPENRCV) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, + wh, NULL, "received confirm in invalid " + "state %d", ni->ni_peerstate); + vap->iv_stats.is_rx_mgtdiscard++; + return; + } + ni->ni_peerstate = IEEE80211_NODE_MESH_CONFIRMRECV; + args[0] = 0xf4ef; + args[1] = ni->ni_llid; + ieee80211_send_action(ni, + IEEE80211_ACTION_CAT_MESHPEERING, + IEEE80211_ACTION_MESHPEERING_CONFIRM, args); + } + break; + default: + IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, + wh, NULL, "%s", "not handled"); + vap->iv_stats.is_rx_mgtdiscard++; + } +} + /* * Parse a MESH ID ie on station join. */ Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Thu Apr 30 12:14:52 2009 (r191684) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Thu Apr 30 12:16:15 2009 (r191685) @@ -250,6 +250,20 @@ struct ieee80211_meshpuc_ie { uint8_t puc_daddr[IEEE80211_ADDR_LEN]; } __packed; +/* + * 802.11s Action Frames + */ +#define IEEE80211_ACTION_CAT_MESHPEERING 30 /* XXX Linux */ +#define IEEE80211_ACTION_CAT_MESHLINK 13 +#define IEEE80211_ACTION_CAT_PATHSEL 14 +#define IEEE80211_ACTION_CAT_INTERWORK 15 +#define IEEE80211_ACTION_CAT_RESOURCE 16 +#define IEEE80211_ACTION_CAT_PROXY 17 + +#define IEEE80211_ACTION_MESHPEERING_OPEN 0 +#define IEEE80211_ACTION_MESHPEERING_CONFIRM 1 +#define IEEE80211_ACTION_MESHPEERING_CLOSE 2 + void ieee80211_mesh_attach(struct ieee80211com *); void ieee80211_mesh_detach(struct ieee80211com *); void ieee80211_parse_meshid(struct ieee80211_node *, const uint8_t *); Modified: projects/mesh11s/sys/net80211/ieee80211_node.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.h Thu Apr 30 12:14:52 2009 (r191684) +++ projects/mesh11s/sys/net80211/ieee80211_node.h Thu Apr 30 12:16:15 2009 (r191685) @@ -36,7 +36,7 @@ * Each ieee80211com instance has a single timer that fires every * IEEE80211_INACT_WAIT seconds to handle "inactivity processing". * This is used to do node inactivity processing when operating - * as an AP or in adhoc mode. For inactivity processing each node + * as an AP, adhoc or mesh mode. For inactivity processing each node * has a timeout set in it's ni_inact field that is decremented * on each timeout and the node is reclaimed when the counter goes * to zero. We use different inactivity timeout values depending @@ -175,6 +175,17 @@ struct ieee80211_node { uint8_t ni_dtim_period; /* DTIM period */ uint8_t ni_dtim_count; /* DTIM count for last bcn */ + /* mesh */ +#define IEEE80211_NODE_MESH_IDLE 0 +#define IEEE80211_NODE_MESH_OPNSENT 1 /* Peer Open Frame Received */ +#define IEEE80211_NODE_MESH_OPENRCV 2 /* Peer Open Frame Sent */ +#define IEEE80211_NODE_MESH_CONFIRMRECV 3 /* Peer Confirm Frame Recvived */ +#define IEEE80211_NODE_MESH_ESTABLISHED 4 /* Peer Link Established */ +#define IEEE80211_NODE_MESH_HOLDING 5 /* Peer Link Closing */ + int8_t ni_peerstate; /* Mesh Peering state */ + uint16_t ni_llid; /* local link ID */ + uint16_t ni_plid; /* peer link ID */ + /* 11n state */ uint16_t ni_htcap; /* HT capabilities */ uint8_t ni_htparam; /* HT params */ From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 12:18:47 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 004EC106566B; Thu, 30 Apr 2009 12:18:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E339C8FC0C; Thu, 30 Apr 2009 12:18:46 +0000 (UTC) (envelope-from rwatson@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 n3UCIkwl011913; Thu, 30 Apr 2009 12:18:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UCIkW0011912; Thu, 30 Apr 2009 12:18:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904301218.n3UCIkW0011912@svn.freebsd.org> From: Robert Watson Date: Thu, 30 Apr 2009 12:18:46 +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: r191686 - projects/pnet/sys/net 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, 30 Apr 2009 12:18:47 -0000 Author: rwatson Date: Thu Apr 30 12:18:46 2009 New Revision: 191686 URL: http://svn.freebsd.org/changeset/base/191686 Log: Add NETISR protocol constant for ethernet input, in order to allow the ethernet input path to be scheduled in a deferred context. Modified: projects/pnet/sys/net/netisr.h Modified: projects/pnet/sys/net/netisr.h ============================================================================== --- projects/pnet/sys/net/netisr.h Thu Apr 30 12:16:15 2009 (r191685) +++ projects/pnet/sys/net/netisr.h Thu Apr 30 12:18:46 2009 (r191686) @@ -53,6 +53,7 @@ #define NETISR_ATALK1 17 /* Appletalk phase 1 */ #define NETISR_ARP 18 /* same as AF_LINK */ #define NETISR_IPX 23 /* same as AF_IPX */ +#define NETISR_ETHER 24 /* ethernet input */ #define NETISR_USB 25 /* USB soft interrupt */ #define NETISR_PPP 26 /* PPP soft interrupt */ #define NETISR_IPV6 27 From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 13:44:59 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 CCB331065670; Thu, 30 Apr 2009 13:44:59 +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 BAC488FC08; Thu, 30 Apr 2009 13:44:59 +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 n3UDixkd013801; Thu, 30 Apr 2009 13:44:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UDixdY013795; Thu, 30 Apr 2009 13:44:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904301344.n3UDixdY013795@svn.freebsd.org> From: Rui Paulo Date: Thu, 30 Apr 2009 13:44:59 +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: r191689 - 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, 30 Apr 2009 13:45:00 -0000 Author: rpaulo Date: Thu Apr 30 13:44:59 2009 New Revision: 191689 URL: http://svn.freebsd.org/changeset/base/191689 Log: Move ieee80211_recv_action() to ieee80211_input.c and ieee80211_send_action() to ieee80211_output.c because they are used both by 11s and 11n. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_ht.c projects/mesh11s/sys/net80211/ieee80211_ht.h projects/mesh11s/sys/net80211/ieee80211_input.c projects/mesh11s/sys/net80211/ieee80211_input.h projects/mesh11s/sys/net80211/ieee80211_output.c projects/mesh11s/sys/net80211/ieee80211_proto.h Modified: projects/mesh11s/sys/net80211/ieee80211_ht.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ht.c Thu Apr 30 13:36:26 2009 (r191688) +++ projects/mesh11s/sys/net80211/ieee80211_ht.c Thu Apr 30 13:44:59 2009 (r191689) @@ -1732,84 +1732,6 @@ ieee80211_aggr_recv_action(struct ieee80 } /* - * Process a received 802.11n action frame. - * Aggregation-related frames are assumed to be handled - * already; we handle any other frames we can, otherwise - * complain about being unsupported (with debugging). - */ -void -ieee80211_recv_action(struct ieee80211_node *ni, - const uint8_t *frm, const uint8_t *efrm) -{ - struct ieee80211vap *vap = ni->ni_vap; - const struct ieee80211_action *ia; - int chw; - - ia = (const struct ieee80211_action *) frm; - switch (ia->ia_category) { - case IEEE80211_ACTION_CAT_BA: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: BA action %d not implemented", __func__, - ia->ia_action); - vap->iv_stats.is_rx_mgtdiscard++; - break; - case IEEE80211_ACTION_CAT_HT: - switch (ia->ia_action) { - case IEEE80211_ACTION_HT_TXCHWIDTH: - chw = frm[2] == IEEE80211_A_HT_TXCHWIDTH_2040 ? 40 : 20; - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: HT txchwidth, width %d%s", - __func__, chw, ni->ni_chw != chw ? "*" : ""); - if (chw != ni->ni_chw) { - ni->ni_chw = chw; - /* XXX notify on change */ - } - break; - case IEEE80211_ACTION_HT_MIMOPWRSAVE: { - const struct ieee80211_action_ht_mimopowersave *mps = - (const struct ieee80211_action_ht_mimopowersave *) ia; - /* XXX check iv_htcaps */ - if (mps->am_control & IEEE80211_A_HT_MIMOPWRSAVE_ENA) - ni->ni_flags |= IEEE80211_NODE_MIMO_PS; - else - ni->ni_flags &= ~IEEE80211_NODE_MIMO_PS; - if (mps->am_control & IEEE80211_A_HT_MIMOPWRSAVE_MODE) - ni->ni_flags |= IEEE80211_NODE_MIMO_RTS; - else - ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS; - /* XXX notify on change */ - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: HT MIMO PS (%s%s)", __func__, - (ni->ni_flags & IEEE80211_NODE_MIMO_PS) ? - "on" : "off", - (ni->ni_flags & IEEE80211_NODE_MIMO_RTS) ? - "+rts" : "" - ); - break; - } - default: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: HT action %d not implemented", __func__, - ia->ia_action); - vap->iv_stats.is_rx_mgtdiscard++; - break; - } - break; - default: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: category %d not implemented", __func__, - ia->ia_category); - vap->iv_stats.is_rx_mgtdiscard++; - break; - } -} - -/* * Transmit processing. */ @@ -2102,199 +2024,6 @@ bad: } /* - * Send an action management frame. The arguments are stuff - * into a frame without inspection; the caller is assumed to - * prepare them carefully (e.g. based on the aggregation state). - */ -int -ieee80211_send_action(struct ieee80211_node *ni, - int category, int action, uint16_t args[4]) -{ -#define senderr(_x, _v) do { vap->iv_stats._v++; ret = _x; goto bad; } while (0) -#define ADDSHORT(frm, v) do { \ - frm[0] = (v) & 0xff; \ - frm[1] = (v) >> 8; \ - frm += 2; \ -} while (0) - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_bpf_params params; - struct mbuf *m; - uint8_t *frm; - uint16_t baparamset; - int ret, addsize; - - KASSERT(ni != NULL, ("null node")); - - /* - * Hold a reference on the node so it doesn't go away until after - * the xmit is complete all the way in the driver. On error we - * will remove our reference. - */ - IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, - "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", - __func__, __LINE__, - ni, ether_sprintf(ni->ni_macaddr), - ieee80211_node_refcnt(ni)+1); - ieee80211_ref_node(ni); - - addsize = 0; - switch (category) { - case IEEE80211_ACTION_CAT_BA: - case IEEE80211_ACTION_CAT_HT: - addsize += sizeof(struct ieee80211_action_ba_addbaresponse); - break; - case IEEE80211_ACTION_CAT_MESHPEERING: - addsize += sizeof(uint16_t); /* capabilities */ - addsize += 2 + vap->iv_meshidlen; /* Mesh ID */ - addsize += sizeof(struct ieee80211_meshconf_ie); - /* On Open frames, the peer link ID is not sent */ - if (action == IEEE80211_ACTION_MESHPEERING_OPEN) - addsize += sizeof(struct ieee80211_meshpeer_ie) - 2; - else - addsize += sizeof(struct ieee80211_meshpeer_ie); - break; - } - m = ieee80211_getmgtframe(&frm, - ic->ic_headroom + sizeof(struct ieee80211_frame), - sizeof(uint16_t) /* action+category */ - /* XXX may action payload */ - + addsize - - ); - if (m == NULL) - senderr(ENOMEM, is_tx_nobuf); - - *frm++ = category; - *frm++ = action; - switch (category) { - case IEEE80211_ACTION_CAT_BA: - switch (action) { - case IEEE80211_ACTION_BA_ADDBA_REQUEST: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "send ADDBA request: dialogtoken %d " - "baparamset 0x%x (tid %d) batimeout 0x%x baseqctl 0x%x", - args[0], args[1], MS(args[1], IEEE80211_BAPS_TID), - args[2], args[3]); - - *frm++ = args[0]; /* dialog token */ - ADDSHORT(frm, args[1]); /* baparamset */ - ADDSHORT(frm, args[2]); /* batimeout */ - ADDSHORT(frm, args[3]); /* baseqctl */ - break; - case IEEE80211_ACTION_BA_ADDBA_RESPONSE: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "send ADDBA response: dialogtoken %d status %d " - "baparamset 0x%x (tid %d) batimeout %d", - args[0], args[1], args[2], - MS(args[2], IEEE80211_BAPS_TID), args[3]); - - *frm++ = args[0]; /* dialog token */ - ADDSHORT(frm, args[1]); /* statuscode */ - ADDSHORT(frm, args[2]); /* baparamset */ - ADDSHORT(frm, args[3]); /* batimeout */ - break; - case IEEE80211_ACTION_BA_DELBA: - /* XXX */ - baparamset = SM(args[0], IEEE80211_DELBAPS_TID) - | args[1] - ; - ADDSHORT(frm, baparamset); - ADDSHORT(frm, args[2]); /* reason code */ - - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "send DELBA action: tid %d, initiator %d reason %d", - args[0], args[1], args[2]); - break; - default: - goto badaction; - } - break; - case IEEE80211_ACTION_CAT_HT: - switch (action) { - case IEEE80211_ACTION_HT_TXCHWIDTH: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, - ni, "send HT txchwidth: width %d", - IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? 40 : 20 - ); - *frm++ = IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? - IEEE80211_A_HT_TXCHWIDTH_2040 : - IEEE80211_A_HT_TXCHWIDTH_20; - break; - default: - goto badaction; - } - break; - case IEEE80211_ACTION_CAT_MESHPEERING: - - switch (action) { - case IEEE80211_ACTION_MESHPEERING_OPEN: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, - "send PEER OPEN action: lid %x", args[0]); - *frm++ = 0; /* capabilites */ - *frm++ = 0; - frm = ieee80211_add_meshid(frm, vap); - frm = ieee80211_add_meshconf(frm, vap); - *frm++ = IEEE80211_ELEMID_MESHPEER; - *frm++ = 3; /* len */ - *frm++ = IEEE80211_MESH_PEER_LINK_OPEN; /* subtype */ - ADDSHORT(frm, args[0]); /* local ID */ - break; - case IEEE80211_ACTION_MESHPEERING_CONFIRM: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, - "send PEER CONFIRM action: lid %x, pid %x", - args[0], args[1]); - *frm++ = 0; /* capabilites */ - *frm++ = 0; - *frm++ = 0; /* status code */ - *frm++ = 0; - *frm++ = 0; /* AID */ - *frm++ = 0; - frm = ieee80211_add_meshid(frm, vap); - frm = ieee80211_add_meshconf(frm, vap); - *frm++ = IEEE80211_ELEMID_MESHPEER; - *frm++ = 5; /* len */ - *frm++ = IEEE80211_MESH_PEER_LINK_CONFIRM; /* subtype */ - ADDSHORT(frm, args[0]); - ADDSHORT(frm, args[1]); - break; - } - break; - default: - badaction: - IEEE80211_NOTE(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: unsupported category %d action %d", __func__, - category, action); - senderr(EINVAL, is_tx_unknownmgt); - /* NOTREACHED */ - } - m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - - memset(¶ms, 0, sizeof(params)); - params.ibp_pri = WME_AC_VO; - params.ibp_rate0 = ni->ni_txparms->mgmtrate; - /* NB: we know all frames are unicast */ - params.ibp_try0 = ni->ni_txparms->maxretry; - params.ibp_power = ni->ni_txpower; - return ieee80211_mgmt_output(ni, m, IEEE80211_FC0_SUBTYPE_ACTION, - ¶ms); -bad: - ieee80211_free_node(ni); - if (m != NULL) - m_freem(m); - return ret; -#undef ADDSHORT -#undef senderr -} - -/* * Construct the MCS bit mask for inclusion * in an HT information element. */ Modified: projects/mesh11s/sys/net80211/ieee80211_ht.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ht.h Thu Apr 30 13:36:26 2009 (r191688) +++ projects/mesh11s/sys/net80211/ieee80211_ht.h Thu Apr 30 13:44:59 2009 (r191689) @@ -186,16 +186,12 @@ void ieee80211_parse_htinfo(struct ieee8 void ieee80211_ht_updateparams(struct ieee80211_node *, const uint8_t *, const uint8_t *); void ieee80211_ht_updatehtcap(struct ieee80211_node *, const uint8_t *); -void ieee80211_recv_action(struct ieee80211_node *, - const uint8_t *, const uint8_t *); int ieee80211_ampdu_request(struct ieee80211_node *, struct ieee80211_tx_ampdu *); void ieee80211_ampdu_stop(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int); int ieee80211_send_bar(struct ieee80211_node *, struct ieee80211_tx_ampdu *, ieee80211_seq); -int ieee80211_send_action(struct ieee80211_node *, - int, int, uint16_t [4]); uint8_t *ieee80211_add_htcap(uint8_t *, struct ieee80211_node *); uint8_t *ieee80211_add_htcap_vendor(uint8_t *, struct ieee80211_node *); uint8_t *ieee80211_add_htinfo(uint8_t *, struct ieee80211_node *); Modified: projects/mesh11s/sys/net80211/ieee80211_input.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_input.c Thu Apr 30 13:36:26 2009 (r191688) +++ projects/mesh11s/sys/net80211/ieee80211_input.c Thu Apr 30 13:44:59 2009 (r191689) @@ -739,6 +739,85 @@ ieee80211_parse_action(struct ieee80211_ return 0; } +/* + * Process a received 802.11 action frame. + * Aggregation-related frames are assumed to be handled + * already; we handle any other frames we can, otherwise + * complain about being unsupported (with debugging). + */ +void +ieee80211_recv_action(struct ieee80211_node *ni, + const uint8_t *frm, const uint8_t *efrm) +{ + struct ieee80211vap *vap = ni->ni_vap; + const struct ieee80211_action *ia; + int chw; + + ia = (const struct ieee80211_action *) frm; + switch (ia->ia_category) { + case IEEE80211_ACTION_CAT_BA: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "%s: BA action %d not implemented", __func__, + ia->ia_action); + vap->iv_stats.is_rx_mgtdiscard++; + break; + case IEEE80211_ACTION_CAT_HT: + switch (ia->ia_action) { + case IEEE80211_ACTION_HT_TXCHWIDTH: + chw = frm[2] == IEEE80211_A_HT_TXCHWIDTH_2040 ? 40 : 20; + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "%s: HT txchwidth, width %d%s", + __func__, chw, ni->ni_chw != chw ? "*" : ""); + if (chw != ni->ni_chw) { + ni->ni_chw = chw; + /* XXX notify on change */ + } + break; + case IEEE80211_ACTION_HT_MIMOPWRSAVE: { + const struct ieee80211_action_ht_mimopowersave *mps = + (const struct ieee80211_action_ht_mimopowersave *) ia; + /* XXX check iv_htcaps */ + if (mps->am_control & IEEE80211_A_HT_MIMOPWRSAVE_ENA) + ni->ni_flags |= IEEE80211_NODE_MIMO_PS; + else + ni->ni_flags &= ~IEEE80211_NODE_MIMO_PS; + if (mps->am_control & IEEE80211_A_HT_MIMOPWRSAVE_MODE) + ni->ni_flags |= IEEE80211_NODE_MIMO_RTS; + else + ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS; + /* XXX notify on change */ + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "%s: HT MIMO PS (%s%s)", __func__, + (ni->ni_flags & IEEE80211_NODE_MIMO_PS) ? + "on" : "off", + (ni->ni_flags & IEEE80211_NODE_MIMO_RTS) ? + "+rts" : "" + ); + break; + } + default: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "%s: HT action %d not implemented", __func__, + ia->ia_action); + vap->iv_stats.is_rx_mgtdiscard++; + break; + } + break; + default: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "%s: category %d not implemented", __func__, + ia->ia_category); + vap->iv_stats.is_rx_mgtdiscard++; + break; + } +} + + #ifdef IEEE80211_DEBUG /* * Debugging support. Modified: projects/mesh11s/sys/net80211/ieee80211_input.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_input.h Thu Apr 30 13:36:26 2009 (r191688) +++ projects/mesh11s/sys/net80211/ieee80211_input.h Thu Apr 30 13:44:59 2009 (r191689) @@ -156,4 +156,6 @@ int ieee80211_alloc_challenge(struct iee int ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *, struct ieee80211_scanparams *); int ieee80211_parse_action(struct ieee80211_node *, struct mbuf *); +void ieee80211_recv_action(struct ieee80211_node *, const uint8_t *, + const uint8_t *); #endif /* _NET80211_IEEE80211_INPUT_H_ */ Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Thu Apr 30 13:36:26 2009 (r191688) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Thu Apr 30 13:44:59 2009 (r191689) @@ -527,6 +527,204 @@ ieee80211_send_setup( } /* + * Send an action management frame. The arguments are stuff + * into a frame without inspection; the caller is assumed to + * prepare them carefully (e.g. based on the aggregation state). + */ +int +ieee80211_send_action(struct ieee80211_node *ni, + int category, int action, uint16_t args[4]) +{ +#define senderr(_x, _v) do { vap->iv_stats._v++; ret = _x; goto bad; } while (0) +#define ADDSHORT(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = (v) >> 8; \ + frm += 2; \ +} while (0) +#define MS(_v, _f) (((_v) & _f) >> _f##_S) +#define SM(_v, _f) (((_v) << _f##_S) & _f) + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_bpf_params params; + struct mbuf *m; + uint8_t *frm; + uint16_t baparamset; + int ret, addsize; + + KASSERT(ni != NULL, ("null node")); + + /* + * Hold a reference on the node so it doesn't go away until after + * the xmit is complete all the way in the driver. On error we + * will remove our reference. + */ + IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, + "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", + __func__, __LINE__, + ni, ether_sprintf(ni->ni_macaddr), + ieee80211_node_refcnt(ni)+1); + ieee80211_ref_node(ni); + + addsize = 0; + switch (category) { + case IEEE80211_ACTION_CAT_BA: + case IEEE80211_ACTION_CAT_HT: + addsize += sizeof(struct ieee80211_action_ba_addbaresponse); + break; + case IEEE80211_ACTION_CAT_MESHPEERING: + addsize += sizeof(uint16_t); /* capabilities */ + addsize += 2 + vap->iv_meshidlen; /* Mesh ID */ + addsize += sizeof(struct ieee80211_meshconf_ie); + /* On Open frames, the peer link ID is not sent */ + if (action == IEEE80211_ACTION_MESHPEERING_OPEN) + addsize += sizeof(struct ieee80211_meshpeer_ie) - 2; + else + addsize += sizeof(struct ieee80211_meshpeer_ie); + break; + } + m = ieee80211_getmgtframe(&frm, + ic->ic_headroom + sizeof(struct ieee80211_frame), + sizeof(uint16_t) /* action+category */ + /* XXX may action payload */ + + addsize + + ); + if (m == NULL) + senderr(ENOMEM, is_tx_nobuf); + + *frm++ = category; + *frm++ = action; + switch (category) { + case IEEE80211_ACTION_CAT_BA: + switch (action) { + case IEEE80211_ACTION_BA_ADDBA_REQUEST: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "send ADDBA request: dialogtoken %d " + "baparamset 0x%x (tid %d) batimeout 0x%x baseqctl 0x%x", + args[0], args[1], MS(args[1], IEEE80211_BAPS_TID), + args[2], args[3]); + + *frm++ = args[0]; /* dialog token */ + ADDSHORT(frm, args[1]); /* baparamset */ + ADDSHORT(frm, args[2]); /* batimeout */ + ADDSHORT(frm, args[3]); /* baseqctl */ + break; + case IEEE80211_ACTION_BA_ADDBA_RESPONSE: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "send ADDBA response: dialogtoken %d status %d " + "baparamset 0x%x (tid %d) batimeout %d", + args[0], args[1], args[2], + MS(args[2], IEEE80211_BAPS_TID), args[3]); + + *frm++ = args[0]; /* dialog token */ + ADDSHORT(frm, args[1]); /* statuscode */ + ADDSHORT(frm, args[2]); /* baparamset */ + ADDSHORT(frm, args[3]); /* batimeout */ + break; + case IEEE80211_ACTION_BA_DELBA: + /* XXX */ + baparamset = SM(args[0], IEEE80211_DELBAPS_TID) + | args[1] + ; + ADDSHORT(frm, baparamset); + ADDSHORT(frm, args[2]); /* reason code */ + + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "send DELBA action: tid %d, initiator %d reason %d", + args[0], args[1], args[2]); + break; + default: + goto badaction; + } + break; + case IEEE80211_ACTION_CAT_HT: + switch (action) { + case IEEE80211_ACTION_HT_TXCHWIDTH: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, + ni, "send HT txchwidth: width %d", + IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? 40 : 20 + ); + *frm++ = IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? + IEEE80211_A_HT_TXCHWIDTH_2040 : + IEEE80211_A_HT_TXCHWIDTH_20; + break; + default: + goto badaction; + } + break; + case IEEE80211_ACTION_CAT_MESHPEERING: + + switch (action) { + case IEEE80211_ACTION_MESHPEERING_OPEN: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, + "send PEER OPEN action: lid %x", args[0]); + *frm++ = 0; /* capabilites */ + *frm++ = 0; + frm = ieee80211_add_meshid(frm, vap); + frm = ieee80211_add_meshconf(frm, vap); + *frm++ = IEEE80211_ELEMID_MESHPEER; + *frm++ = 3; /* len */ + *frm++ = IEEE80211_MESH_PEER_LINK_OPEN; /* subtype */ + ADDSHORT(frm, args[0]); /* local ID */ + break; + case IEEE80211_ACTION_MESHPEERING_CONFIRM: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, + "send PEER CONFIRM action: lid %x, pid %x", + args[0], args[1]); + *frm++ = 0; /* capabilites */ + *frm++ = 0; + *frm++ = 0; /* status code */ + *frm++ = 0; + *frm++ = 0; /* AID */ + *frm++ = 0; + frm = ieee80211_add_meshid(frm, vap); + frm = ieee80211_add_meshconf(frm, vap); + *frm++ = IEEE80211_ELEMID_MESHPEER; + *frm++ = 5; /* len */ + *frm++ = IEEE80211_MESH_PEER_LINK_CONFIRM; /* subtype */ + ADDSHORT(frm, args[0]); + ADDSHORT(frm, args[1]); + break; + } + break; + default: + badaction: + IEEE80211_NOTE(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, + "%s: unsupported category %d action %d", __func__, + category, action); + senderr(EINVAL, is_tx_unknownmgt); + /* NOTREACHED */ + } + m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); + + memset(¶ms, 0, sizeof(params)); + params.ibp_pri = WME_AC_VO; + params.ibp_rate0 = ni->ni_txparms->mgmtrate; + /* NB: we know all frames are unicast */ + params.ibp_try0 = ni->ni_txparms->maxretry; + params.ibp_power = ni->ni_txpower; + return ieee80211_mgmt_output(ni, m, IEEE80211_FC0_SUBTYPE_ACTION, + ¶ms); +bad: + ieee80211_free_node(ni); + if (m != NULL) + m_freem(m); + return ret; +#undef ADDSHORT +#undef senderr +#undef MS +#undef SM +} + + +/* * Send a management frame to the specified node. The node pointer * must have a reference as the pointer will be passed to the driver * and potentially held for a long time. If the frame is successfully Modified: projects/mesh11s/sys/net80211/ieee80211_proto.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_proto.h Thu Apr 30 13:36:26 2009 (r191688) +++ projects/mesh11s/sys/net80211/ieee80211_proto.h Thu Apr 30 13:44:59 2009 (r191689) @@ -65,6 +65,7 @@ void ieee80211_syncflag_ext(struct ieee8 int ieee80211_input_all(struct ieee80211com *, struct mbuf *, int, int, uint32_t); struct ieee80211_bpf_params; +int ieee80211_send_action(struct ieee80211_node *, int, int, uint16_t [4]); int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int, struct ieee80211_bpf_params *); int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *, From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 14:21:51 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 65FFF1065670; Thu, 30 Apr 2009 14:21:51 +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 3AE898FC15; Thu, 30 Apr 2009 14:21:51 +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 n3UELpZ5014630; Thu, 30 Apr 2009 14:21:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UELpwt014629; Thu, 30 Apr 2009 14:21:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904301421.n3UELpwt014629@svn.freebsd.org> From: Rui Paulo Date: Thu, 30 Apr 2009 14:21:51 +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: r191691 - 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, 30 Apr 2009 14:21:51 -0000 Author: rpaulo Date: Thu Apr 30 14:21:50 2009 New Revision: 191691 URL: http://svn.freebsd.org/changeset/base/191691 Log: Don't forget to send our rates on mesh peer action frames. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Thu Apr 30 13:53:00 2009 (r191690) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Thu Apr 30 14:21:50 2009 (r191691) @@ -69,6 +69,10 @@ __FBSDID("$FreeBSD$"); static int ieee80211_fragment(struct ieee80211vap *, struct mbuf *, u_int hdrsize, u_int ciphdrsize, u_int mtu); static void ieee80211_tx_mgt_cb(struct ieee80211_node *, void *, int); +static uint8_t * + ieee80211_add_rates(uint8_t *, const struct ieee80211_rateset *); +static uint8_t * + ieee80211_add_xrates(uint8_t *, const struct ieee80211_rateset *); #ifdef IEEE80211_DEBUG /* @@ -546,6 +550,7 @@ ieee80211_send_action(struct ieee80211_n struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ieee80211_bpf_params params; + const struct ieee80211_rateset *rs; struct mbuf *m; uint8_t *frm; uint16_t baparamset; @@ -573,13 +578,11 @@ ieee80211_send_action(struct ieee80211_n break; case IEEE80211_ACTION_CAT_MESHPEERING: addsize += sizeof(uint16_t); /* capabilities */ + addsize += 2 + IEEE80211_RATE_SIZE; + addsize += 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE); addsize += 2 + vap->iv_meshidlen; /* Mesh ID */ addsize += sizeof(struct ieee80211_meshconf_ie); - /* On Open frames, the peer link ID is not sent */ - if (action == IEEE80211_ACTION_MESHPEERING_OPEN) - addsize += sizeof(struct ieee80211_meshpeer_ie) - 2; - else - addsize += sizeof(struct ieee80211_meshpeer_ie); + addsize += sizeof(struct ieee80211_meshpeer_ie); break; } m = ieee80211_getmgtframe(&frm, @@ -657,7 +660,7 @@ ieee80211_send_action(struct ieee80211_n } break; case IEEE80211_ACTION_CAT_MESHPEERING: - + rs = ieee80211_get_suprates(ic, ic->ic_curchan); switch (action) { case IEEE80211_ACTION_MESHPEERING_OPEN: IEEE80211_NOTE(vap, @@ -665,6 +668,8 @@ ieee80211_send_action(struct ieee80211_n "send PEER OPEN action: lid %x", args[0]); *frm++ = 0; /* capabilites */ *frm++ = 0; + frm = ieee80211_add_rates(frm, rs); + frm = ieee80211_add_xrates(frm, rs); frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); *frm++ = IEEE80211_ELEMID_MESHPEER; @@ -683,6 +688,8 @@ ieee80211_send_action(struct ieee80211_n *frm++ = 0; *frm++ = 0; /* AID */ *frm++ = 0; + frm = ieee80211_add_rates(frm, rs); + frm = ieee80211_add_xrates(frm, rs); frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); *frm++ = IEEE80211_ELEMID_MESHPEER; From owner-svn-src-projects@FreeBSD.ORG Thu Apr 30 15:38:36 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 25A441065670; Thu, 30 Apr 2009 15:38:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13D628FC14; Thu, 30 Apr 2009 15:38:36 +0000 (UTC) (envelope-from rwatson@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 n3UFcZTf016171; Thu, 30 Apr 2009 15:38:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3UFcZEH016169; Thu, 30 Apr 2009 15:38:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904301538.n3UFcZEH016169@svn.freebsd.org> From: Robert Watson Date: Thu, 30 Apr 2009 15:38:35 +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: r191694 - projects/pnet/sys/net 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, 30 Apr 2009 15:38:36 -0000 Author: rwatson Date: Thu Apr 30 15:38:35 2009 New Revision: 191694 URL: http://svn.freebsd.org/changeset/base/191694 Log: Revise netisr2 interface some more: - Add public APIs to query available workstream counts and CPU IDs for them (netisr2_get_cpucount(), netisr2_get_cpuid()). - Provide default flow2cpu inmplementation as netisr2_default_flow2cpu, and install it if the protocol doesn't register one. - Add uintptr_t source argument to netisr2_queue() and netisr2_dispatch(), allowing to caller to provide additional information about a source that might be used to improve parallelism by constraining ordering. Should be set to 0 if none is identified (i.e., maximum ordering). - If the protocol doesn't provide a flow ID conversion function and there isn't one on the packet, use the source to order. Modified: projects/pnet/sys/net/netisr2.c projects/pnet/sys/net/netisr2.h Modified: projects/pnet/sys/net/netisr2.c ============================================================================== --- projects/pnet/sys/net/netisr2.c Thu Apr 30 14:31:52 2009 (r191693) +++ projects/pnet/sys/net/netisr2.c Thu Apr 30 15:38:35 2009 (r191694) @@ -250,6 +250,37 @@ static u_int nws_count; #define NWS_WAIT(s) cv_wait(&(s)->nws_cv, &(s)->nws_mtx) /* + * Utility routines for protocols that implement their own mapping of flows + * to CPUs. + */ +u_int +netisr2_get_cpucount(void) +{ + + return (nws_count); +} + +u_int +netisr2_get_cpuid(u_int cpunumber) +{ + + return (nws_array[cpunumber]); +} + +/* + * The default implementation of (source, flow ID) -> CPU ID mapping. + * Non-static so that protocols can use it to map their own work to specific + * CPUs in a manner consistent to netisr2 for affinity purposes. + */ +u_int +netisr2_default_flow2cpu(uintptr_t source, u_int flowid) +{ + + return (netisr2_get_cpuid((source ^ flowid) % + netisr2_get_cpucount())); +} + +/* * Register a new netisr handler, which requires initializing per-protocol * fields for each workstream. All netisr2 work is briefly suspended while * the protocol is installed. @@ -275,10 +306,6 @@ netisr2_register(u_int proto, const char KASSERT(name != NULL, ("netisr2_register: name NULL for %d", proto)); KASSERT(func != NULL, ("netisr2_register: func NULL for %s", name)); - KASSERT(m2flow != NULL, ("netisr2_register: m2flow NULL for %s", - name)); - KASSERT(flow2cpu != NULL, ("netisr2_registeR: flow2cpu NULL for %s", - name)); /* * Initialize global and per-workstream protocol state. @@ -286,7 +313,10 @@ netisr2_register(u_int proto, const char np[proto].np_name = name; np[proto].np_func = func; np[proto].np_m2flow = m2flow; - np[proto].np_flow2cpu = flow2cpu; + if (flow2cpu != NULL) + np[proto].np_flow2cpu = flow2cpu; + else + np[proto].np_flow2cpu = netisr2_default_flow2cpu; for (i = 0; i < MAXCPU; i++) { npwp = &nws[i].nws_work[proto]; bzero(npwp, sizeof(*npwp)); @@ -346,17 +376,6 @@ netisr2_deregister(u_int proto) } /* - * Provide a simple flow -> CPU mapping for protocols with strong ordering - * requirements but no built-in notion of affinity. - */ -u_int -netisr2_flowid2cpuid(u_int flowid) -{ - - return (nws_array[flowid % nws_count]); -} - -/* * Look up the correct stream for a requested flowid. There are two cases: * one in which the caller has requested execution on the current CPU (i.e., * source ordering is sufficient, perhaps because the underlying hardware has @@ -372,12 +391,13 @@ netisr2_flowid2cpuid(u_int flowid) * (i.e., out of mbufs and a rewrite is required). */ static struct mbuf * -netisr2_selectcpu(struct netisr_proto *npp, struct mbuf *m, u_int *cpuidp) +netisr2_selectcpu(struct netisr_proto *npp, uintptr_t source, struct mbuf *m, + u_int *cpuidp) { NETISR_LOCK_ASSERT(); - if (!(m->m_flags & M_FLOWID)) { + if (!(m->m_flags & M_FLOWID) && npp->np_m2flow != NULL) { m = npp->np_m2flow(m); if (m == NULL) return (NULL); @@ -385,7 +405,10 @@ netisr2_selectcpu(struct netisr_proto *n " %s failed to return flowid on mbuf", npp->np_name)); } - *cpuidp = npp->np_flow2cpu(m->m_pkthdr.flowid); + if (m->m_flags & M_FLOWID) + *cpuidp = npp->np_flow2cpu(source, m->m_pkthdr.flowid); + else + *cpuidp = npp->np_flow2cpu(source, 0); return (m); } @@ -554,7 +577,7 @@ netisr2_queue_internal(u_int proto, stru } int -netisr2_queue(u_int proto, struct mbuf *m) +netisr2_queue(u_int proto, uintptr_t source, struct mbuf *m) { u_int cpuid, error; @@ -565,7 +588,7 @@ netisr2_queue(u_int proto, struct mbuf * KASSERT(np[proto].np_func != NULL, ("netisr2_dispatch: invalid proto %d", proto)); - m = netisr2_selectcpu(&np[proto], m, &cpuid); + m = netisr2_selectcpu(&np[proto], source, m, &cpuid); if (m != NULL) error = netisr2_queue_internal(proto, m, cpuid); else @@ -575,13 +598,13 @@ netisr2_queue(u_int proto, struct mbuf * } int -netisr2_dispatch(u_int proto, struct mbuf *m) +netisr2_dispatch(u_int proto, uintptr_t source, struct mbuf *m) { struct netisr_workstream *nwsp; struct netisr_work *npwp; if (!netisr_direct) - return (netisr2_queue(proto, m)); + return (netisr2_queue(proto, source, m)); KASSERT(proto < NETISR_MAXPROT, ("netisr2_dispatch: invalid proto %d", proto)); Modified: projects/pnet/sys/net/netisr2.h ============================================================================== --- projects/pnet/sys/net/netisr2.h Thu Apr 30 14:31:52 2009 (r191693) +++ projects/pnet/sys/net/netisr2.h Thu Apr 30 15:38:35 2009 (r191694) @@ -43,14 +43,16 @@ * NULL should be returned. * * netisr_flow2cpu_t - Given a flowid, possibly generated by netisr_m2flow, - * select a CPU to execute the packet handler on. + * and an optional source identifier (possibly a tid, pcb, + * or kernel pointer), select a CPU to execute the packet + * handler on. If source isn't used, it will be 0/NULL. * * XXXRW: If we eventually support dynamic reconfiguration, there should be * protocol handlers to notify them of CPU configuration changes so that they * can rebalance work. */ typedef struct mbuf *netisr_m2flow_t(struct mbuf *m); -typedef u_int netisr_flow2cpu_t(u_int flowid); +typedef u_int netisr_flow2cpu_t(uintptr_t source, u_int flowid); /*- * Register a new netisr2 handler for a given protocol. No previous @@ -74,16 +76,20 @@ void netisr2_deregister(u_int proto); /* * Process a packet destined for a protocol, and attempt direct dispatch. */ -int netisr2_dispatch(u_int proto, struct mbuf *m); -int netisr2_queue(u_int proto, struct mbuf *m); +int netisr2_dispatch(u_int proto, uintptr_t source, struct mbuf *m); +int netisr2_queue(u_int proto, uintptr_t source, struct mbuf *m); /* - * Provide a default function to map flow IDs to CPU IDs, so that protocols - * needing a default flow->CPU model can use it. - * - * XXXRW: Should also provide a way to query available CPUs so that protocols - * can decide how to map work more usefully themselves. + * Provide a default implementation of "map a flow ID to a cpu ID". + */ +u_int netisr2_default_flow2cpu(uintptr_t source, u_int flowid); + +/* + * Utility routines to return the number of CPUs participting in netisr2, and + * to return a mapping from a number to a CPU ID that can be used with the + * scheduler. */ -u_int netisr2_flowid2cpuid(u_int flowid); +u_int netisr2_get_cpucount(void); +u_int netisr2_get_cpuid(u_int cpunumber); #endif /* !_NET_NETISR2_H_ */ From owner-svn-src-projects@FreeBSD.ORG Fri May 1 17:12:10 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 818A1106566B; Fri, 1 May 2009 17:12:10 +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 6F6B28FC16; Fri, 1 May 2009 17:12:10 +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 n41HCAHg048403; Fri, 1 May 2009 17:12:10 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n41HCAtU048400; Fri, 1 May 2009 17:12:10 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905011712.n41HCAtU048400@svn.freebsd.org> From: Rui Paulo Date: Fri, 1 May 2009 17:12:10 +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: r191721 - 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, 01 May 2009 17:12:10 -0000 Author: rpaulo Date: Fri May 1 17:12:10 2009 New Revision: 191721 URL: http://svn.freebsd.org/changeset/base/191721 Log: Implement ieee80211_add_meshpeer() and use it when necessary. While there, correctly fill the capinfo for mesh action frames. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri May 1 17:05:49 2009 (r191720) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri May 1 17:12:10 2009 (r191721) @@ -661,6 +661,41 @@ ieee80211_add_meshconf(uint8_t *frm, str return frm + sizeof(ie); } +uint8_t * +ieee80211_add_meshpeer(uint8_t *frm, uint8_t subtype, uint16_t localid, + uint16_t peerid, uint16_t reason) +{ +#define ADDSHORT(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = (v) >> 8; \ + frm += 2; \ +} while (0) + *frm++ = IEEE80211_ELEMID_MESHPEER; + switch (subtype) { + case IEEE80211_MESH_PEER_LINK_OPEN: + *frm++ = 3; /* length */ + *frm++ = subtype; + ADDSHORT(frm, localid); /* local ID */ + break; + case IEEE80211_MESH_PEER_LINK_CONFIRM: + *frm++ = 5; /* length */ + ADDSHORT(frm, localid); /* local ID */ + ADDSHORT(frm, peerid); /* peer ID */ + break; + case IEEE80211_MESH_PEER_LINK_CLOSE: + if (peerid) + *frm++ = 7; /* length */ + else + *frm++ = 5; /* length */ + ADDSHORT(frm, localid); /* local ID */ + if (peerid) + ADDSHORT(frm, peerid); /* peer ID */ + ADDSHORT(frm, reason); + break; + } + return frm; +#undef ADDSHORT +} void ieee80211_create_mbss(struct ieee80211vap *vap, struct ieee80211_channel *chan) { Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri May 1 17:05:49 2009 (r191720) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri May 1 17:12:10 2009 (r191721) @@ -269,6 +269,8 @@ void ieee80211_mesh_detach(struct ieee8 void ieee80211_parse_meshid(struct ieee80211_node *, const uint8_t *); uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); +uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t, + uint16_t); void ieee80211_create_mbss(struct ieee80211vap *, struct ieee80211_channel *); Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Fri May 1 17:05:49 2009 (r191720) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Fri May 1 17:12:10 2009 (r191721) @@ -73,7 +73,8 @@ static uint8_t * ieee80211_add_rates(uint8_t *, const struct ieee80211_rateset *); static uint8_t * ieee80211_add_xrates(uint8_t *, const struct ieee80211_rateset *); - +static uint16_t + getcapinfo(struct ieee80211vap *, struct ieee80211_channel *); #ifdef IEEE80211_DEBUG /* * Decide if an outbound management frame should be @@ -666,37 +667,29 @@ ieee80211_send_action(struct ieee80211_n IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, "send PEER OPEN action: lid %x", args[0]); - *frm++ = 0; /* capabilites */ - *frm++ = 0; + ADDSHORT(frm, getcapinfo(vap, ni->ni_chan)); frm = ieee80211_add_rates(frm, rs); frm = ieee80211_add_xrates(frm, rs); frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); - *frm++ = IEEE80211_ELEMID_MESHPEER; - *frm++ = 3; /* len */ - *frm++ = IEEE80211_MESH_PEER_LINK_OPEN; /* subtype */ - ADDSHORT(frm, args[0]); /* local ID */ + frm = ieee80211_add_meshpeer(frm, + IEEE80211_MESH_PEER_LINK_OPEN, args[0], 0, 0); break; case IEEE80211_ACTION_MESHPEERING_CONFIRM: IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, "send PEER CONFIRM action: lid %x, pid %x", args[0], args[1]); - *frm++ = 0; /* capabilites */ - *frm++ = 0; - *frm++ = 0; /* status code */ - *frm++ = 0; - *frm++ = 0; /* AID */ - *frm++ = 0; + ADDSHORT(frm, getcapinfo(vap, ni->ni_chan)); + ADDSHORT(frm, 0); /* status code */ + ADDSHORT(frm, 0); /* AID */ frm = ieee80211_add_rates(frm, rs); frm = ieee80211_add_xrates(frm, rs); frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); - *frm++ = IEEE80211_ELEMID_MESHPEER; - *frm++ = 5; /* len */ - *frm++ = IEEE80211_MESH_PEER_LINK_CONFIRM; /* subtype */ - ADDSHORT(frm, args[0]); - ADDSHORT(frm, args[1]); + frm = ieee80211_add_meshpeer(frm, + IEEE80211_MESH_PEER_LINK_CONFIRM, args[0], args[1], + 0); break; } break; From owner-svn-src-projects@FreeBSD.ORG Fri May 1 17:50:41 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 2A125106564A; Fri, 1 May 2009 17:50:41 +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 187B98FC16; Fri, 1 May 2009 17:50:41 +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 n41Hoerv049420; Fri, 1 May 2009 17:50:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n41Hoe8t049419; Fri, 1 May 2009 17:50:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905011750.n41Hoe8t049419@svn.freebsd.org> From: Rui Paulo Date: Fri, 1 May 2009 17:50:40 +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: r191727 - 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, 01 May 2009 17:50:41 -0000 Author: rpaulo Date: Fri May 1 17:50:40 2009 New Revision: 191727 URL: http://svn.freebsd.org/changeset/base/191727 Log: Add missing subtype on peer confirm frame construction. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri May 1 17:20:16 2009 (r191726) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri May 1 17:50:40 2009 (r191727) @@ -679,6 +679,7 @@ ieee80211_add_meshpeer(uint8_t *frm, uin break; case IEEE80211_MESH_PEER_LINK_CONFIRM: *frm++ = 5; /* length */ + *frm++ = subtype; ADDSHORT(frm, localid); /* local ID */ ADDSHORT(frm, peerid); /* peer ID */ break; From owner-svn-src-projects@FreeBSD.ORG Sat May 2 18:47:25 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 3495D106566C; Sat, 2 May 2009 18:47:25 +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 1EACE8FC1B; Sat, 2 May 2009 18:47:25 +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 n42IlPaK092370; Sat, 2 May 2009 18:47:25 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n42IlOk7092353; Sat, 2 May 2009 18:47:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905021847.n42IlOk7092353@svn.freebsd.org> From: Rui Paulo Date: Sat, 2 May 2009 18:47:24 +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: r191750 - in projects/mesh11s: . bin/rm contrib/bind9 contrib/cpio contrib/csup contrib/file contrib/gdb contrib/gdtoa contrib/libpcap contrib/ncurses contrib/netcat contrib/ntp contrib... 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: Sat, 02 May 2009 18:47:25 -0000 Author: rpaulo Date: Sat May 2 18:47:23 2009 New Revision: 191750 URL: http://svn.freebsd.org/changeset/base/191750 Log: MFC 191639:191746. Added: projects/mesh11s/sys/netinet6/in6_mcast.c - copied unchanged from r191746, head/sys/netinet6/in6_mcast.c projects/mesh11s/sys/netinet6/mld6.h - copied unchanged from r191746, head/sys/netinet6/mld6.h Deleted: projects/mesh11s/sys/dev/usb/wlan/usb_wlan.h Modified: projects/mesh11s/ (props changed) projects/mesh11s/UPDATING projects/mesh11s/bin/rm/rm.c projects/mesh11s/contrib/bind9/ (props changed) projects/mesh11s/contrib/cpio/ (props changed) projects/mesh11s/contrib/csup/ (props changed) projects/mesh11s/contrib/file/ (props changed) projects/mesh11s/contrib/gdb/ (props changed) projects/mesh11s/contrib/gdtoa/ (props changed) projects/mesh11s/contrib/libpcap/ (props changed) projects/mesh11s/contrib/ncurses/ (props changed) projects/mesh11s/contrib/netcat/ (props changed) projects/mesh11s/contrib/ntp/ (props changed) projects/mesh11s/contrib/openbsm/ (props changed) projects/mesh11s/contrib/openpam/ (props changed) projects/mesh11s/contrib/pf/ (props changed) projects/mesh11s/contrib/sendmail/ (props changed) projects/mesh11s/contrib/tcpdump/ (props changed) projects/mesh11s/contrib/top/ (props changed) projects/mesh11s/contrib/top/install-sh (props changed) projects/mesh11s/contrib/wpa/ (props changed) projects/mesh11s/crypto/openssh/ (props changed) projects/mesh11s/crypto/openssl/ (props changed) projects/mesh11s/lib/libc/ (props changed) projects/mesh11s/lib/libc/net/sourcefilter.c projects/mesh11s/lib/libc/stdio/asprintf.c (props changed) projects/mesh11s/lib/libc/stdtime/ (props changed) projects/mesh11s/lib/libc/string/ffsll.c (props changed) projects/mesh11s/lib/libc/string/flsll.c (props changed) projects/mesh11s/lib/libc/string/wcpcpy.c (props changed) projects/mesh11s/lib/libc/string/wcpncpy.c (props changed) projects/mesh11s/lib/libc/sys/Makefile.inc projects/mesh11s/lib/libc/sys/Symbol.map projects/mesh11s/lib/libc/sys/jail.2 projects/mesh11s/lib/libusb/ (props changed) projects/mesh11s/lib/libusb/libusb.3 (props changed) projects/mesh11s/lib/libusb/usb.h (props changed) projects/mesh11s/lib/libutil/ (props changed) projects/mesh11s/sbin/ (props changed) projects/mesh11s/sbin/geom/class/journal/gjournal.8 projects/mesh11s/sbin/ifconfig/iflagg.c projects/mesh11s/sbin/ipfw/ (props changed) projects/mesh11s/sbin/newfs/newfs.8 projects/mesh11s/sbin/tunefs/tunefs.8 projects/mesh11s/share/man/man4/ng_hole.4 projects/mesh11s/share/man/man4/u3g.4 projects/mesh11s/share/misc/bsd-family-tree projects/mesh11s/share/zoneinfo/ (props changed) projects/mesh11s/sys/ (props changed) projects/mesh11s/sys/amd64/amd64/identcpu.c projects/mesh11s/sys/amd64/amd64/local_apic.c projects/mesh11s/sys/amd64/amd64/mp_machdep.c projects/mesh11s/sys/amd64/conf/GENERIC projects/mesh11s/sys/amd64/include/apicvar.h projects/mesh11s/sys/amd64/include/clock.h projects/mesh11s/sys/amd64/include/smp.h projects/mesh11s/sys/amd64/include/specialreg.h projects/mesh11s/sys/amd64/include/xen/ (props changed) projects/mesh11s/sys/amd64/isa/clock.c projects/mesh11s/sys/amd64/linux32/linux32_sysvec.c projects/mesh11s/sys/cddl/compat/opensolaris/kern/opensolaris_zone.c projects/mesh11s/sys/compat/freebsd32/freebsd32_misc.c projects/mesh11s/sys/compat/freebsd32/freebsd32_proto.h projects/mesh11s/sys/compat/freebsd32/freebsd32_syscall.h projects/mesh11s/sys/compat/freebsd32/freebsd32_syscalls.c projects/mesh11s/sys/compat/freebsd32/freebsd32_sysent.c projects/mesh11s/sys/compat/freebsd32/syscalls.master projects/mesh11s/sys/compat/linux/linux_futex.c projects/mesh11s/sys/compat/linux/linux_futex.h projects/mesh11s/sys/compat/linux/linux_socket.c projects/mesh11s/sys/conf/NOTES projects/mesh11s/sys/conf/files projects/mesh11s/sys/conf/options projects/mesh11s/sys/contrib/pf/ (props changed) projects/mesh11s/sys/dev/acpica/acpi.c projects/mesh11s/sys/dev/ata/ata-all.h projects/mesh11s/sys/dev/ata/ata-disk.c projects/mesh11s/sys/dev/ata/ata-pci.c projects/mesh11s/sys/dev/ata/ata-queue.c projects/mesh11s/sys/dev/ata/ata-sata.c projects/mesh11s/sys/dev/ata/ata-usb.c (props changed) projects/mesh11s/sys/dev/ata/chipsets/ata-ahci.c projects/mesh11s/sys/dev/cxgb/ (props changed) projects/mesh11s/sys/dev/if_ndis/if_ndis.c projects/mesh11s/sys/dev/if_ndis/if_ndisvar.h projects/mesh11s/sys/dev/ipw/if_ipw.c projects/mesh11s/sys/dev/ipw/if_ipwvar.h projects/mesh11s/sys/dev/iwi/if_iwi.c projects/mesh11s/sys/dev/iwi/if_iwivar.h projects/mesh11s/sys/dev/iwn/if_iwn.c projects/mesh11s/sys/dev/iwn/if_iwnvar.h projects/mesh11s/sys/dev/sk/if_sk.c projects/mesh11s/sys/dev/sound/usb/uaudio.c (props changed) projects/mesh11s/sys/dev/sound/usb/uaudio.h (props changed) projects/mesh11s/sys/dev/sound/usb/uaudio_pcm.c (props changed) projects/mesh11s/sys/dev/sound/usb/uaudioreg.h (props changed) projects/mesh11s/sys/dev/usb/README.TXT (props changed) projects/mesh11s/sys/dev/usb/bluetooth/TODO.TXT (props changed) projects/mesh11s/sys/dev/usb/bluetooth/ng_ubt.c (props changed) projects/mesh11s/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) projects/mesh11s/sys/dev/usb/bluetooth/ubtbcmfw.c (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci.c (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci.h (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci.c (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci.h (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci.h (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_mbus.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg.c (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg.h (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci.h (props changed) projects/mesh11s/sys/dev/usb/controller/ohci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uhci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uhci.h (props changed) projects/mesh11s/sys/dev/usb/controller/uhci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/usb_controller.c (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci.h (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/input/uhid.c (props changed) projects/mesh11s/sys/dev/usb/input/ukbd.c (props changed) projects/mesh11s/sys/dev/usb/input/ums.c (props changed) projects/mesh11s/sys/dev/usb/input/usb_rdesc.h (props changed) projects/mesh11s/sys/dev/usb/misc/udbp.c (props changed) projects/mesh11s/sys/dev/usb/misc/udbp.h (props changed) projects/mesh11s/sys/dev/usb/misc/ufm.c (props changed) projects/mesh11s/sys/dev/usb/net/if_aue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_auereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_axe.c (props changed) projects/mesh11s/sys/dev/usb/net/if_axereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_cdce.c (props changed) projects/mesh11s/sys/dev/usb/net/if_cdcereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_cue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_cuereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_kue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_kuefw.h (props changed) projects/mesh11s/sys/dev/usb/net/if_kuereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_rue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_ruereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_udav.c (props changed) projects/mesh11s/sys/dev/usb/net/if_udavreg.h (props changed) projects/mesh11s/sys/dev/usb/net/usb_ethernet.c (props changed) projects/mesh11s/sys/dev/usb/net/usb_ethernet.h (props changed) projects/mesh11s/sys/dev/usb/quirk/usb_quirk.c (props changed) projects/mesh11s/sys/dev/usb/quirk/usb_quirk.h (props changed) projects/mesh11s/sys/dev/usb/serial/u3g.c (props changed) projects/mesh11s/sys/dev/usb/serial/uark.c (props changed) projects/mesh11s/sys/dev/usb/serial/ubsa.c (props changed) projects/mesh11s/sys/dev/usb/serial/ubser.c (props changed) projects/mesh11s/sys/dev/usb/serial/uchcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/ucycom.c (props changed) projects/mesh11s/sys/dev/usb/serial/ufoma.c (props changed) projects/mesh11s/sys/dev/usb/serial/uftdi.c (props changed) projects/mesh11s/sys/dev/usb/serial/uftdi_reg.h (props changed) projects/mesh11s/sys/dev/usb/serial/ugensa.c (props changed) projects/mesh11s/sys/dev/usb/serial/uipaq.c (props changed) projects/mesh11s/sys/dev/usb/serial/ulpt.c (props changed) projects/mesh11s/sys/dev/usb/serial/umct.c (props changed) projects/mesh11s/sys/dev/usb/serial/umodem.c (props changed) projects/mesh11s/sys/dev/usb/serial/umoscom.c (props changed) projects/mesh11s/sys/dev/usb/serial/uplcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/usb_serial.c (props changed) projects/mesh11s/sys/dev/usb/serial/usb_serial.h (props changed) projects/mesh11s/sys/dev/usb/serial/uslcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/uvisor.c (props changed) projects/mesh11s/sys/dev/usb/serial/uvscom.c (props changed) projects/mesh11s/sys/dev/usb/storage/rio500_usb.h (props changed) projects/mesh11s/sys/dev/usb/storage/umass.c (props changed) projects/mesh11s/sys/dev/usb/storage/urio.c (props changed) projects/mesh11s/sys/dev/usb/storage/ustorage_fs.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template.h (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_cdce.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_msc.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_mtp.c (props changed) projects/mesh11s/sys/dev/usb/ufm_ioctl.h (props changed) projects/mesh11s/sys/dev/usb/usb.h (props changed) projects/mesh11s/sys/dev/usb/usb_bus.h (props changed) projects/mesh11s/sys/dev/usb/usb_busdma.c (props changed) projects/mesh11s/sys/dev/usb/usb_busdma.h (props changed) projects/mesh11s/sys/dev/usb/usb_cdc.h (props changed) projects/mesh11s/sys/dev/usb/usb_compat_linux.c (props changed) projects/mesh11s/sys/dev/usb/usb_compat_linux.h (props changed) projects/mesh11s/sys/dev/usb/usb_controller.h (props changed) projects/mesh11s/sys/dev/usb/usb_core.c (props changed) projects/mesh11s/sys/dev/usb/usb_core.h (props changed) projects/mesh11s/sys/dev/usb/usb_debug.c (props changed) projects/mesh11s/sys/dev/usb/usb_debug.h (props changed) projects/mesh11s/sys/dev/usb/usb_defs.h (props changed) projects/mesh11s/sys/dev/usb/usb_dev.c (props changed) projects/mesh11s/sys/dev/usb/usb_dev.h (props changed) projects/mesh11s/sys/dev/usb/usb_device.c (props changed) projects/mesh11s/sys/dev/usb/usb_device.h (props changed) projects/mesh11s/sys/dev/usb/usb_dynamic.c (props changed) projects/mesh11s/sys/dev/usb/usb_dynamic.h (props changed) projects/mesh11s/sys/dev/usb/usb_endian.h (props changed) projects/mesh11s/sys/dev/usb/usb_error.c (props changed) projects/mesh11s/sys/dev/usb/usb_error.h (props changed) projects/mesh11s/sys/dev/usb/usb_generic.c (props changed) projects/mesh11s/sys/dev/usb/usb_generic.h (props changed) projects/mesh11s/sys/dev/usb/usb_handle_request.c (props changed) projects/mesh11s/sys/dev/usb/usb_handle_request.h (props changed) projects/mesh11s/sys/dev/usb/usb_hid.c (props changed) projects/mesh11s/sys/dev/usb/usb_hid.h (props changed) projects/mesh11s/sys/dev/usb/usb_hub.c (props changed) projects/mesh11s/sys/dev/usb/usb_hub.h (props changed) projects/mesh11s/sys/dev/usb/usb_if.m (props changed) projects/mesh11s/sys/dev/usb/usb_ioctl.h (props changed) projects/mesh11s/sys/dev/usb/usb_lookup.c (props changed) projects/mesh11s/sys/dev/usb/usb_lookup.h (props changed) projects/mesh11s/sys/dev/usb/usb_mbuf.c (props changed) projects/mesh11s/sys/dev/usb/usb_mbuf.h (props changed) projects/mesh11s/sys/dev/usb/usb_mfunc.h (props changed) projects/mesh11s/sys/dev/usb/usb_msctest.c (props changed) projects/mesh11s/sys/dev/usb/usb_msctest.h (props changed) projects/mesh11s/sys/dev/usb/usb_parse.c (props changed) projects/mesh11s/sys/dev/usb/usb_parse.h (props changed) projects/mesh11s/sys/dev/usb/usb_pci.h (props changed) projects/mesh11s/sys/dev/usb/usb_process.c (props changed) projects/mesh11s/sys/dev/usb/usb_process.h (props changed) projects/mesh11s/sys/dev/usb/usb_request.c (props changed) projects/mesh11s/sys/dev/usb/usb_request.h (props changed) projects/mesh11s/sys/dev/usb/usb_revision.h (props changed) projects/mesh11s/sys/dev/usb/usb_transfer.c (props changed) projects/mesh11s/sys/dev/usb/usb_transfer.h (props changed) projects/mesh11s/sys/dev/usb/usb_util.c (props changed) projects/mesh11s/sys/dev/usb/usb_util.h (props changed) projects/mesh11s/sys/dev/usb/usbdevs (props changed) projects/mesh11s/sys/dev/usb/usbhid.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rum.c (contents, props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumfw.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumvar.h (contents, props changed) projects/mesh11s/sys/dev/usb/wlan/if_uath.c projects/mesh11s/sys/dev/usb/wlan/if_uathvar.h projects/mesh11s/sys/dev/usb/wlan/if_ural.c (contents, props changed) projects/mesh11s/sys/dev/usb/wlan/if_uralreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_uralvar.h (contents, props changed) projects/mesh11s/sys/dev/usb/wlan/if_zyd.c (contents, props changed) projects/mesh11s/sys/dev/usb/wlan/if_zydfw.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zydreg.h (contents, props changed) projects/mesh11s/sys/dev/wi/if_wi.c projects/mesh11s/sys/dev/wi/if_wivar.h projects/mesh11s/sys/dev/wpi/if_wpi.c projects/mesh11s/sys/dev/wpi/if_wpivar.h projects/mesh11s/sys/dev/xen/netfront/ (props changed) projects/mesh11s/sys/dev/xen/xenpci/ (props changed) projects/mesh11s/sys/i386/conf/GENERIC projects/mesh11s/sys/i386/i386/identcpu.c projects/mesh11s/sys/i386/i386/local_apic.c projects/mesh11s/sys/i386/i386/mp_machdep.c projects/mesh11s/sys/i386/include/apicvar.h projects/mesh11s/sys/i386/include/clock.h projects/mesh11s/sys/i386/include/smp.h projects/mesh11s/sys/i386/include/specialreg.h projects/mesh11s/sys/i386/isa/clock.c projects/mesh11s/sys/i386/linux/linux_sysvec.c projects/mesh11s/sys/isa/atrtc.c projects/mesh11s/sys/kern/init_sysent.c projects/mesh11s/sys/kern/kern_jail.c projects/mesh11s/sys/kern/kern_mib.c projects/mesh11s/sys/kern/kern_osd.c projects/mesh11s/sys/kern/kern_sysctl.c projects/mesh11s/sys/kern/kern_vimage.c projects/mesh11s/sys/kern/sched_ule.c projects/mesh11s/sys/kern/subr_smp.c projects/mesh11s/sys/kern/subr_witness.c projects/mesh11s/sys/kern/syscalls.c projects/mesh11s/sys/kern/syscalls.master projects/mesh11s/sys/kern/systrace_args.c projects/mesh11s/sys/kern/uipc_socket.c projects/mesh11s/sys/legacy/dev/ata/ata-usb.c (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudio.c (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudio.h (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) projects/mesh11s/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) projects/mesh11s/sys/legacy/dev/usb/ (props changed) projects/mesh11s/sys/legacy/dev/usb/ehci_ixp4xx.c (props changed) projects/mesh11s/sys/mips/include/pmap.h projects/mesh11s/sys/mips/mips/pmap.c projects/mesh11s/sys/modules/Makefile projects/mesh11s/sys/modules/dtrace/dtnfsclient/ (props changed) projects/mesh11s/sys/modules/ip6_mroute_mod/ (props changed) projects/mesh11s/sys/modules/ipmi/ipmi_linux/ (props changed) projects/mesh11s/sys/net/ieee8023ad_lacp.c projects/mesh11s/sys/net/if.c projects/mesh11s/sys/net/if_bridge.c projects/mesh11s/sys/net/if_gif.c projects/mesh11s/sys/net/if_gif.h projects/mesh11s/sys/net/if_lagg.c projects/mesh11s/sys/net/if_mib.c projects/mesh11s/sys/net/if_var.h projects/mesh11s/sys/net/route.c projects/mesh11s/sys/net/vnet.h projects/mesh11s/sys/net80211/ieee80211.c projects/mesh11s/sys/net80211/ieee80211_ddb.c projects/mesh11s/sys/net80211/ieee80211_freebsd.h projects/mesh11s/sys/net80211/ieee80211_ioctl.c projects/mesh11s/sys/net80211/ieee80211_node.c projects/mesh11s/sys/net80211/ieee80211_node.h projects/mesh11s/sys/net80211/ieee80211_proto.c projects/mesh11s/sys/net80211/ieee80211_scan.c projects/mesh11s/sys/net80211/ieee80211_scan.h projects/mesh11s/sys/net80211/ieee80211_scan_sta.c projects/mesh11s/sys/net80211/ieee80211_var.h projects/mesh11s/sys/netinet/icmp6.h projects/mesh11s/sys/netinet/igmp.c projects/mesh11s/sys/netinet/in_mcast.c projects/mesh11s/sys/netinet/in_pcb.c projects/mesh11s/sys/netinet/in_pcb.h projects/mesh11s/sys/netinet/ip_carp.c projects/mesh11s/sys/netinet/ip_divert.c projects/mesh11s/sys/netinet/ip_fw.h projects/mesh11s/sys/netinet/ip_fw_pfil.c projects/mesh11s/sys/netinet/ip_input.c projects/mesh11s/sys/netinet/ip_mroute.c projects/mesh11s/sys/netinet/raw_ip.c projects/mesh11s/sys/netinet/tcp_subr.c projects/mesh11s/sys/netinet/tcp_syncache.c projects/mesh11s/sys/netinet/tcp_syncache.h projects/mesh11s/sys/netinet/tcp_timewait.c projects/mesh11s/sys/netinet/tcp_var.h projects/mesh11s/sys/netinet/udp_usrreq.c projects/mesh11s/sys/netinet/vinet.h projects/mesh11s/sys/netinet6/icmp6.c projects/mesh11s/sys/netinet6/in6.c projects/mesh11s/sys/netinet6/in6.h projects/mesh11s/sys/netinet6/in6_ifattach.c projects/mesh11s/sys/netinet6/in6_pcb.c projects/mesh11s/sys/netinet6/in6_proto.c projects/mesh11s/sys/netinet6/in6_var.h projects/mesh11s/sys/netinet6/ip6_input.c projects/mesh11s/sys/netinet6/ip6_mroute.c projects/mesh11s/sys/netinet6/ip6_output.c projects/mesh11s/sys/netinet6/ip6_var.h projects/mesh11s/sys/netinet6/mld6.c projects/mesh11s/sys/netinet6/mld6_var.h projects/mesh11s/sys/netinet6/nd6.c projects/mesh11s/sys/netinet6/raw_ip6.c projects/mesh11s/sys/netinet6/udp6_usrreq.c projects/mesh11s/sys/netinet6/vinet6.h projects/mesh11s/sys/netipsec/ipsec.c projects/mesh11s/sys/netipsec/key.c projects/mesh11s/sys/netipsec/vipsec.h projects/mesh11s/sys/pc98/conf/GENERIC projects/mesh11s/sys/security/mac/mac_atalk.c projects/mesh11s/sys/security/mac/mac_audit.c projects/mesh11s/sys/security/mac/mac_cred.c projects/mesh11s/sys/security/mac/mac_inet.c projects/mesh11s/sys/security/mac/mac_inet6.c projects/mesh11s/sys/security/mac/mac_internal.h projects/mesh11s/sys/security/mac/mac_net.c projects/mesh11s/sys/security/mac/mac_pipe.c projects/mesh11s/sys/security/mac/mac_posix_sem.c projects/mesh11s/sys/security/mac/mac_posix_shm.c projects/mesh11s/sys/security/mac/mac_priv.c projects/mesh11s/sys/security/mac/mac_process.c projects/mesh11s/sys/security/mac/mac_socket.c projects/mesh11s/sys/security/mac/mac_system.c projects/mesh11s/sys/security/mac/mac_sysv_msg.c projects/mesh11s/sys/security/mac/mac_sysv_sem.c projects/mesh11s/sys/security/mac/mac_sysv_shm.c projects/mesh11s/sys/security/mac/mac_vfs.c projects/mesh11s/sys/sys/jail.h projects/mesh11s/sys/sys/ktr.h projects/mesh11s/sys/sys/osd.h projects/mesh11s/sys/sys/param.h projects/mesh11s/sys/sys/priv.h projects/mesh11s/sys/sys/smp.h projects/mesh11s/sys/sys/socketvar.h projects/mesh11s/sys/sys/syscall.h projects/mesh11s/sys/sys/syscall.mk projects/mesh11s/sys/sys/syscallsubr.h projects/mesh11s/sys/sys/sysctl.h projects/mesh11s/sys/sys/sysproto.h projects/mesh11s/sys/sys/vimage.h projects/mesh11s/sys/xen/evtchn.h (props changed) projects/mesh11s/sys/xen/hypervisor.h (props changed) projects/mesh11s/sys/xen/xen_intr.h (props changed) projects/mesh11s/tools/regression/lib/msun/test-conj.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs.h (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5210.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5211.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5212.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5416.c (props changed) projects/mesh11s/usr.bin/csup/ (props changed) projects/mesh11s/usr.bin/du/du.c projects/mesh11s/usr.bin/ncal/Makefile projects/mesh11s/usr.bin/ncal/ncal.1 projects/mesh11s/usr.bin/ncal/ncal.c projects/mesh11s/usr.bin/netstat/inet6.c projects/mesh11s/usr.bin/procstat/ (props changed) projects/mesh11s/usr.sbin/dumpcis/cardinfo.h (props changed) projects/mesh11s/usr.sbin/dumpcis/cis.h (props changed) projects/mesh11s/usr.sbin/ifmcstat/ifmcstat.c projects/mesh11s/usr.sbin/jail/jail.c projects/mesh11s/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/mesh11s/usr.sbin/makefs/getid.c (props changed) projects/mesh11s/usr.sbin/mtest/Makefile projects/mesh11s/usr.sbin/mtest/mtest.8 projects/mesh11s/usr.sbin/mtest/mtest.c projects/mesh11s/usr.sbin/zic/ (props changed) Modified: projects/mesh11s/UPDATING ============================================================================== --- projects/mesh11s/UPDATING Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/UPDATING Sat May 2 18:47:23 2009 (r191750) @@ -22,6 +22,100 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090430: + The layout of the following structs has changed: sysctl_oid, + socket, ifnet, inpcbinfo, tcpcb, syncache_head, vnet_inet, + vnet_inet6 and vnet_ipfw. Most modules need to be rebuild or + panics may be experienced. World rebuild is required for + correctly checking networking state from userland. + Bump __FreeBSD_version to 800085. + +20090429: + MLDv2 and Source-Specific Multicast (SSM) have been merged + to the IPv6 stack. VIMAGE hooks are in but not yet used. + The implementation of SSM within FreeBSD's IPv6 stack closely + follows the IPv4 implementation. + + For kernel developers: + + * The most important changes are that the ip6_output() and + ip6_input() paths no longer take the IN6_MULTI_LOCK, + and this lock has been downgraded to a non-recursive mutex. + + * As with the changes to the IPv4 stack to support SSM, filtering + of inbound multicast traffic must now be performed by transport + protocols within the IPv6 stack. This does not apply to TCP and + SCTP, however, it does apply to UDP in IPv6 and raw IPv6. + + * The KPIs used by IPv6 multicast are similar to those used by + the IPv4 stack, with the following differences: + * im6o_mc_filter() is analogous to imo_multicast_filter(). + * The legacy KAME entry points in6_joingroup and in6_leavegroup() + are shimmed to in6_mc_join() and in6_mc_leave() respectively. + * IN6_LOOKUP_MULTI() has been deprecated and removed. + * IPv6 relies on MLD for the DAD mechanism. KAME's internal KPIs + for MLDv1 have an additional 'timer' argument which is used to + jitter the initial membership report for the solicited-node + multicast membership on-link. + * This is not strictly needed for MLDv2, which already jitters + its report transmissions. However, the 'timer' argument is + preserved in case MLDv1 is active on the interface. + + * The KAME linked-list based IPv6 membership implementation has + been refactored to use a vector similar to that used by the IPv4 + stack. + Code which maintains a list of its own multicast memberships + internally, e.g. carp, has been updated to reflect the new + semantics. + + * There is a known Lock Order Reversal (LOR) due to in6_setscope() + acquiring the IF_AFDATA_LOCK and being called within ip6_output(). + Whilst MLDv2 tries to avoid this otherwise benign LOR, it is an + implementation constraint which needs to be addressed in HEAD. + + For application developers: + + * The changes are broadly similar to those made for the IPv4 + stack. + + * The use of IPv4 and IPv6 multicast socket options on the same + socket, using mapped addresses, HAS NOT been tested or supported. + + * There are a number of issues with the implementation of various + IPv6 multicast APIs which need to be resolved in the API surface + before the implementation is fully compatible with KAME userland + use, and these are mostly to do with interface index treatment. + + * The literature available discusses the use of either the delta / ASM + API with setsockopt(2)/getsockopt(2), or the full-state / ASM API + using setsourcefilter(3)/getsourcefilter(3). For more information + please refer to RFC 3768, 'Socket Interface Extensions for + Multicast Source Filters'. + + * Applications which use the published RFC 3678 APIs should be fine. + + For systems administrators: + + * The mtest(8) utility has been refactored to support IPv6, in + addition to IPv4. Interface addresses are no longer accepted + as arguments, their names must be used instead. The utility + will map the interface name to its first IPv4 address as + returned by getifaddrs(3). + + * The ifmcstat(8) utility has also been updated to print the MLDv2 + endpoint state and source filter lists via sysctl(3). + + * The net.inet6.ip6.mcast.loop sysctl may be tuned to 0 to disable + loopback of IPv6 multicast datagrams by default; it defaults to 1 + to preserve the existing behaviour. Disabling multicast loopback is + recommended for optimal system performance. + + * The IPv6 MROUTING code has been changed to examine this sysctl + instead of attempting to perform a group lookup before looping + back forwarded datagrams. + + Bump __FreeBSD_version to 800084. + 20090422: Implement low-level Bluetooth HCI API. Bump __FreeBSD_version to 800083. Modified: projects/mesh11s/bin/rm/rm.c ============================================================================== --- projects/mesh11s/bin/rm/rm.c Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/bin/rm/rm.c Sat May 2 18:47:23 2009 (r191750) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; int rflag, Iflag; uid_t uid; +volatile sig_atomic_t info; int check(char *, char *, struct stat *); int check2(char **); @@ -68,6 +69,7 @@ void checkslash(char **); void rm_file(char **); int rm_overwrite(char *, struct stat *); void rm_tree(char **); +static void siginfo(int __unused); void usage(void); /* @@ -150,6 +152,7 @@ main(int argc, char *argv[]) checkslash(argv); uid = geteuid(); + (void)signal(SIGINFO, siginfo); if (*argv) { stdin_ok = isatty(STDIN_FILENO); @@ -266,6 +269,11 @@ rm_tree(char **argv) if (rval == 0 && vflag) (void)printf("%s\n", p->fts_path); + if (rval == 0 && info) { + info = 0; + (void)printf("%s\n", + p->fts_path); + } continue; } break; @@ -276,6 +284,11 @@ rm_tree(char **argv) if (vflag) (void)printf("%s\n", p->fts_path); + if (info) { + info = 0; + (void)printf("%s\n", + p->fts_path); + } continue; } break; @@ -297,6 +310,11 @@ rm_tree(char **argv) if (rval == 0 && vflag) (void)printf("%s\n", p->fts_path); + if (rval == 0 && info) { + info = 0; + (void)printf("%s\n", + p->fts_path); + } continue; } } @@ -369,6 +387,10 @@ rm_file(char **argv) } if (vflag && rval == 0) (void)printf("%s\n", f); + if (info && rval == 0) { + info = 0; + (void)printf("%s\n", f); + } } } @@ -592,3 +614,10 @@ usage(void) " unlink file"); exit(EX_USAGE); } + +static void +siginfo(int sig __unused) +{ + + info = 1; +} Modified: projects/mesh11s/lib/libc/net/sourcefilter.c ============================================================================== --- projects/mesh11s/lib/libc/net/sourcefilter.c Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/lib/libc/net/sourcefilter.c Sat May 2 18:47:23 2009 (r191750) @@ -337,7 +337,7 @@ getsourcefilter(int s, uint32_t interfac { struct __msfilterreq msfr; sockunion_t *psu; - int err, level, optlen, optname; + int err, level, nsrcs, optlen, optname; if (interface == 0 || group == NULL || numsrc == NULL || fmode == NULL) { @@ -345,6 +345,7 @@ getsourcefilter(int s, uint32_t interfac return (-1); } + nsrcs = *numsrc; *numsrc = 0; *fmode = 0; @@ -382,7 +383,7 @@ getsourcefilter(int s, uint32_t interfac memset(&msfr, 0, optlen); msfr.msfr_ifindex = interface; msfr.msfr_fmode = 0; - msfr.msfr_nsrcs = *numsrc; + msfr.msfr_nsrcs = nsrcs; memcpy(&msfr.msfr_group, &psu->ss, psu->ss.ss_len); /* Modified: projects/mesh11s/lib/libc/sys/Makefile.inc ============================================================================== --- projects/mesh11s/lib/libc/sys/Makefile.inc Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/lib/libc/sys/Makefile.inc Sat May 2 18:47:23 2009 (r191750) @@ -137,7 +137,10 @@ MLINKS+=getsockopt.2 setsockopt.2 MLINKS+=gettimeofday.2 settimeofday.2 MLINKS+=getuid.2 geteuid.2 MLINKS+=intro.2 errno.2 -MLINKS+=jail.2 jail_attach.2 +MLINKS+=jail.2 jail_attach.2 \ + jail.2 jail_get.2 \ + jail.2 jail_remove.2 \ + jail.2 jail_set.2 MLINKS+=kldunload.2 kldunloadf.2 MLINKS+=kqueue.2 kevent.2 MLINKS+=link.2 linkat.2 Modified: projects/mesh11s/lib/libc/sys/Symbol.map ============================================================================== --- projects/mesh11s/lib/libc/sys/Symbol.map Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/lib/libc/sys/Symbol.map Sat May 2 18:47:23 2009 (r191750) @@ -344,6 +344,9 @@ FBSD_1.1 { fexecve; fstatat; futimesat; + jail_get; + jail_set; + jail_remove; linkat; mkdirat; mkfifoat; Modified: projects/mesh11s/lib/libc/sys/jail.2 ============================================================================== --- projects/mesh11s/lib/libc/sys/jail.2 Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/lib/libc/sys/jail.2 Sat May 2 18:47:23 2009 (r191750) @@ -1,19 +1,40 @@ +.\" Copyright (c) 1999 Poul-Henning Kamp. +.\" Copyright (c) 2009 James Gritton. +.\" All rights reserved. .\" -.\" ---------------------------------------------------------------------------- -.\" "THE BEER-WARE LICENSE" (Revision 42): -.\" wrote this file. As long as you retain this notice you -.\" can do whatever you want with this stuff. If we meet some day, and you think -.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp -.\" ---------------------------------------------------------------------------- +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd January 6, 2009 +.Dd April 29, 2009 .Dt JAIL 2 .Os .Sh NAME -.Nm jail , jail_attach -.Nd imprison current process and future descendants +.Nm jail , +.Nm jail_get , +.Nm jail_set , +.Nm jail_remove , +.Nm jail_attach +.Nd create and manage system jails .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -23,6 +44,13 @@ .Fn jail "struct jail *jail" .Ft int .Fn jail_attach "int jid" +.Ft int +.Fn jail_remove "int jid" +.In sys/uio.h +.Ft int +.Fn jail_get "struct iovec *iov" "u_int niov" "int flags" +.Ft int +.Fn jail_set "struct iovec *iov" "u_int niov" "int flags" .Sh DESCRIPTION The .Fn jail @@ -78,20 +106,147 @@ pointers can be set to an arrays of IPv4 the prison, or NULL if none. IPv4 addresses must be in network byte order. .Pp +This is equivalent to the +.Fn jail_set +system call (see below), with the parameters +.Va path , +.Va host.hostname , +.Va name , +.Va ip4.addr , +and +.Va ip6.addr , +and with the +.Dv JAIL_ATTACH +flag. +.Pp +The +.Fn jail_set +system call creates a new jail, or modifies an existing one, and optionally +locks the current process in it. +Jail parameters are passed as an array of name-value pairs in the array +.Fa iov , +containing +.Fa niov +elements. +Parameter names are a null-terminated string, and values may be strings, +integers, or other arbitrary data. +Some parameters are boolean, and do not have a value (their length is zero) +but are set by the name alone with or without a +.Dq no +prefix, e.g. +.Va persist +or +.Va nopersist . +Any parameters not set will be given default values, generally based on +the current environment. +.Pp +Jails have a set of core parameters, and modules can add their own jail +parameters. +The current set of available parameters, and their formats, can be +retrieved via the +.Va security.jail.param +sysctl MIB entry. +Notable parameters include those mentioned in the +.Fn jail +description above, as well as +.Va jid +and +.Va name , +which identify the jail being created or modified. +See +.Xr jail 8 +for more information on the core jail parameters. +.Pp +The +.Fa flags +arguments consists of one or more of the following flags: +.Bl -tag -width indent +.It Dv JAIL_CREATE +Create a new jail. +If a +.Va jid +or +.Va name +parameters exists, they must not refer to an existing jail. +.It Dv JAIL_UPDATE +Modify an existing jail. +One of the +.Va jid +or +.Va name +parameters must exist, and must refer to an existing jail. +If both +.Dv JAIL_CREATE +and +.Dv JAIL_UPDATE +are set, a jail will be created if it does not yet exist, and modified if it +does exist. +.It Dv JAIL_ATTACH +In addition to creating or modifying the jail, attach the current process to +it, as with the +.Fn jail_attach +system call. +.It Dv JAIL_DYING +Allow setting a jail that is in the process of being removed. +.El +.Pp +The +.Fn jail_get +system call retrieves jail parameters, using the same name-value list as +.Fn jail_set +in the +.Fa iov +and +.Fa niov +arguments. +The jail to read can be specified by either +.Va jid +or +.Va name +by including those parameters in the list. +If they are included but are not intended to be the search key, they +should be cleared (zero and the empty string respectively). +.Pp +The special parameter +.Va lastjid +can be used to retrieve a list of all jails. +It will fetch the jail with the jid above and closest to the passed value. +The first jail (usually but not always jid 1) can be found by passing a +.Va lastjid +of zero. +.Pp +The +.Fa flags +arguments consists of one or more following flags: +.Bl -tag -width indent +.It Dv JAIL_DYING +Allow getting a jail that is in the process of being removed. +.El +.Pp The .Fn jail_attach system call attaches the current process to an existing jail, identified by .Fa jid . +.Pp +The +.Fn jail_remove +system call removes the jail identified by +.Fa jid . +It will kill all processes belonging to the jail, and remove any children +of that jail. .Sh RETURN VALUES If successful, -.Fn jail -returns a non-negative integer, termed the jail identifier (JID). -It returns \-1 on failure, and sets +.Fn jail , +.Fn jail_set , +and +.Fn jail_get +return a non-negative integer, termed the jail identifier (JID). +They return \-1 on failure, and set .Va errno to indicate the error. .Pp -.Rv -std jail_attach +.Rv -std jail_attach jail_remove .Sh PRISON? Once a process has been put in a prison, it and its descendants cannot escape the prison. @@ -136,15 +291,111 @@ The system call will fail if: .Bl -tag -width Er +.It Bq Er EPERM +This process is not allowed to create a jail. +.It Bq Er EFAULT +.Fa jail +points to an address outside the allocated address space of the process. .It Bq Er EINVAL The version number of the argument is not correct. .It Bq Er EAGAIN No free JID could be found. .El .Pp +The +.Fn jail_set +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EPERM +This process is not allowed to create a jail. +.It Bq Er EPERM +A jail parameter was set to a less restrictive value then the current +environment. +.It Bq Er EFAULT +.Fa Iov , +or one of the addresses contained within it, +points to an address outside the allocated address space of the process. +.It Bq Er ENOENT +The jail referred to by a +.Va jid +or +.Va name +parameter does not exist, and the +.Dv JAIL_CREATE +flag is not set. +.It Bq Er EEXIST +The jail referred to by a +.Va jid +or +.Va name +parameter exists, and the +.Dv JAIL_UPDATE +flag is not set. +.It Bq Er EINVAL +A supplied parameter is the wrong size. +.It Bq Er EINVAL +A supplied parameter is out of range. +.It Bq Er EINVAL +A supplied string parameter is not null-terminated. +.It Bq Er EINVAL +A supplied parameter name does not match any known parameters. +.It Bq Er EINVAL +One of the +.Dv JAIL_CREATE +or +.Dv JAIL_UPDATE +flags is not set. +.It Bq Er ENAMETOOLONG +A supplied string parameter is longer than allowed. +.It Bq Er EAGAIN +There are no jail IDs left. +.El +.Pp +The +.Fn jail_get +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +.Fa Iov , +or one of the addresses contained within it, +points to an address outside the allocated address space of the process. +.It Bq Er ENOENT +The jail referred to by a +.Va jid +or +.Va name +parameter does not exist. +.It Bq Er ENOENT +The +.Va lastjid +parameter is greater than the highest current jail ID. +.It Bq Er EINVAL +A supplied parameter is the wrong size. +.It Bq Er EINVAL +A supplied parameter name does not match any known parameters. +.El +.Pp +The +.Fn jail_attach +and +.Fn jail_remove +system calls +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The jail specified by +.Fa jid +does not exist. +.El +.Pp Further -.Fn jail -calls +.Fn jail , +.Fn jail_set , +and +.Fn jail_attach +call .Xr chroot 2 internally, so it can fail for all the same reasons. Please consult the @@ -152,7 +403,8 @@ Please consult the manual page for details. .Sh SEE ALSO .Xr chdir 2 , -.Xr chroot 2 +.Xr chroot 2 , +.Xr jail 8 .Sh HISTORY The .Fn jail @@ -162,6 +414,13 @@ The .Fn jail_attach system call appeared in .Fx 5.1 . +The +.Fn jail_set , +.Fn jail_get , +and +.Fn jail_remove +system calls appeared in +.Fx 8.0 . .Sh AUTHORS The jail feature was written by .An Poul-Henning Kamp @@ -169,3 +428,5 @@ for R&D Associates .Dq Li http://www.rndassociates.com/ who contributed it to .Fx . +.An James Gritton +added the extensible jail parameters. Modified: projects/mesh11s/sbin/geom/class/journal/gjournal.8 ============================================================================== --- projects/mesh11s/sbin/geom/class/journal/gjournal.8 Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sbin/geom/class/journal/gjournal.8 Sat May 2 18:47:23 2009 (r191750) @@ -162,7 +162,8 @@ Hardcode provider names in metadata. Specifies size of the journal if only one provider is used for both data and journal. The default is one gigabyte. -Size should be chosen based on provider's load, and not on its size. +Size should be chosen based on provider's load, and not on its size; +recommended minimum is twice the size of the physical memory installed. It is not recommended to use .Nm for small file systems (e.g.: only few gigabytes big). Modified: projects/mesh11s/sbin/ifconfig/iflagg.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/iflagg.c Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sbin/ifconfig/iflagg.c Sat May 2 18:47:23 2009 (r191750) @@ -167,8 +167,7 @@ lagg_status(int s) for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++) printf("\t\tlaggproto %s\n", lpr[i].lpr_name); } - } else if (isport) - printf("\tlagg: laggdev %s\n", rp.rp_ifname); + } } static struct cmd lagg_cmds[] = { Modified: projects/mesh11s/sbin/newfs/newfs.8 ============================================================================== --- projects/mesh11s/sbin/newfs/newfs.8 Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sbin/newfs/newfs.8 Sat May 2 18:47:23 2009 (r191750) @@ -85,6 +85,9 @@ wear levelling algorithms. NB: Erasing may take as long time as writing every sector on the disk. .It Fl J Enable journaling on the new file system via gjournal. +See +.Xr gjournal 8 +for details. .It Fl L Ar volname Add a volume label to the new file system. .It Fl N @@ -278,6 +281,7 @@ on file systems that contain many small .Xr dump 8 , .Xr dumpfs 8 , .Xr fsck 8 , +.Xr gjournal 8 , .Xr mount 8 , .Xr tunefs 8 , .Xr gvinum 8 Modified: projects/mesh11s/sbin/tunefs/tunefs.8 ============================================================================== --- projects/mesh11s/sbin/tunefs/tunefs.8 Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sbin/tunefs/tunefs.8 Sat May 2 18:47:23 2009 (r191750) @@ -89,7 +89,7 @@ this parameter should be set higher. .It Fl f Ar avgfilesize Specify the expected average file size. .It Fl J Cm enable | disable -Turn on/off GJournal flag. +Turn on/off gjournal flag. .It Fl L Ar volname Add/modify an optional file system volume label. .It Fl l Cm enable | disable @@ -145,6 +145,7 @@ specified mount point. .Sh SEE ALSO .Xr fs 5 , .Xr dumpfs 8 , +.Xr gjournal 8 , .Xr newfs 8 .Rs .%A M. McKusick Modified: projects/mesh11s/share/man/man4/ng_hole.4 ============================================================================== --- projects/mesh11s/share/man/man4/ng_hole.4 Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/share/man/man4/ng_hole.4 Sat May 2 18:47:23 2009 (r191750) @@ -58,20 +58,20 @@ as long as the name is unique. This node type supports the generic control messages, plus the following: .Bl -tag -width indent -.It Dv NGM_BPF_GET_STATS +.It Dv NGM_HOLE_GET_STATS This command takes an .Tn ASCII string argument, the hook name, and returns the statistics associated with the hook as a .Vt "struct ng_hole_hookstat" . -.It Dv NGM_BPF_CLR_STATS +.It Dv NGM_HOLE_CLR_STATS This command takes an .Tn ASCII string argument, the hook name, and clears the statistics associated with the hook. -.It Dv NGM_BPF_GETCLR_STATS +.It Dv NGM_HOLE_GETCLR_STATS This command is identical to -.Dv NGM_BPF_GET_STATS , +.Dv NGM_HOLE_GET_STATS , except that the statistics are also atomically cleared. .El .Sh SHUTDOWN Modified: projects/mesh11s/share/man/man4/u3g.4 ============================================================================== --- projects/mesh11s/share/man/man4/u3g.4 Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/share/man/man4/u3g.4 Sat May 2 18:47:23 2009 (r191750) @@ -66,13 +66,13 @@ Qualcomm Inc. CDMA MSM .It Huawei B190, E220 ('') .It -Novatal U740, MC950D, X950D, etc. +Novatel U740, MC950D, X950D, etc. .It Sierra MC875U, MC8775U, etc. .El .Pp (See -.Pa /sys/dev/u3g.c +.Pa /sys/dev/usb/serial/u3g.c for the complete list of supported cards for each vendor mentioned above.) .Pp Modified: projects/mesh11s/share/misc/bsd-family-tree ============================================================================== --- projects/mesh11s/share/misc/bsd-family-tree Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/share/misc/bsd-family-tree Sat May 2 18:47:23 2009 (r191750) @@ -227,7 +227,7 @@ FreeBSD 5.2 | | | | | | | | | FreeBSD 7.1 | | | | | | | | | DragonFly 2.2.0 - | V | | | | + | V | NetBSD 5.0 OpenBSD 4.5 | | | | | | FreeBSD 8 -current | NetBSD -current OpenBSD -current | | | | | | @@ -496,6 +496,8 @@ OpenBSD 4.4 2008-11-01 [OBD] FreeBSD 6.4 2008-11-28 [FBD] FreeBSD 7.1 2009-01-04 [FBD] DragonFly 2.2.0 2009-02-17 [DFB] +NetBSD 5.0 2009-04-29 [NBD] +OpenBSD 4.5 2009-05-01 [OBD] Bibliography ------------------------ Modified: projects/mesh11s/sys/amd64/amd64/identcpu.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/identcpu.c Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sys/amd64/amd64/identcpu.c Sat May 2 18:47:23 2009 (r191750) @@ -106,9 +106,6 @@ static struct { { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ }; -int cpu_cores; -int cpu_logical; - extern int pq_l2size; extern int pq_l2nways; @@ -195,7 +192,6 @@ printcpuinfo(void) cpu_vendor_id == CPU_VENDOR_CENTAUR) { printf(" Stepping = %u", cpu_id & 0xf); if (cpu_high > 0) { - u_int cmp = 1, htt = 1; /* * Here we should probably set up flags indicating @@ -400,28 +396,6 @@ printcpuinfo(void) if (tsc_is_invariant) printf("\n TSC: P-state invariant"); - /* - * If this CPU supports HTT or CMP then mention the - * number of physical/logical cores it contains. - */ - if (cpu_feature & CPUID_HTT) - htt = (cpu_procinfo & CPUID_HTT_CORES) >> 16; - if (cpu_vendor_id == CPU_VENDOR_AMD && - (amd_feature2 & AMDID2_CMP)) - cmp = (cpu_procinfo2 & AMDID_CMP_CORES) + 1; - else if (cpu_vendor_id == CPU_VENDOR_INTEL && - (cpu_high >= 4)) { - cpuid_count(4, 0, regs); - if ((regs[0] & 0x1f) != 0) - cmp = ((regs[0] >> 26) & 0x3f) + 1; - } - cpu_cores = cmp; - cpu_logical = htt / cmp; - if (cmp > 1) - printf("\n Cores per package: %d", cmp); - if ((htt / cmp) > 1) - printf("\n Logical CPUs per core: %d", - cpu_logical); } } /* Avoid ugly blank lines: only print newline when we have to. */ Modified: projects/mesh11s/sys/amd64/amd64/local_apic.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/local_apic.c Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sys/amd64/amd64/local_apic.c Sat May 2 18:47:23 2009 (r191750) @@ -112,7 +112,7 @@ struct lapic { u_long la_stat_ticks; u_long la_prof_ticks; /* Include IDT_SYSCALL to make indexing easier. */ - u_int la_ioint_irqs[APIC_NUM_IOINTS + 1]; + int la_ioint_irqs[APIC_NUM_IOINTS + 1]; } static lapics[MAX_APIC_ID + 1]; /* XXX: should thermal be an NMI? */ @@ -254,6 +254,8 @@ lapic_create(u_int apic_id, int boot_cpu lapics[apic_id].la_lvts[i] = lvts[i]; lapics[apic_id].la_lvts[i].lvt_active = 0; } + for (i = 0; i <= APIC_NUM_IOINTS; i++) + lapics[apic_id].la_ioint_irqs[i] = -1; lapics[apic_id].la_ioint_irqs[IDT_SYSCALL - APIC_IO_INTS] = IRQ_SYSCALL; lapics[apic_id].la_ioint_irqs[APIC_TIMER_INT - APIC_IO_INTS] = IRQ_TIMER; @@ -363,11 +365,15 @@ int lapic_setup_clock(void) { u_long value; + int i; /* Can't drive the timer without a local APIC. */ if (lapic == NULL) return (0); + if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) + return (0); + /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -807,7 +813,7 @@ apic_alloc_vector(u_int apic_id, u_int i */ mtx_lock_spin(&icu_lock); for (vector = 0; vector < APIC_NUM_IOINTS; vector++) { - if (lapics[apic_id].la_ioint_irqs[vector] != 0) + if (lapics[apic_id].la_ioint_irqs[vector] != -1) continue; lapics[apic_id].la_ioint_irqs[vector] = irq; mtx_unlock_spin(&icu_lock); @@ -847,7 +853,7 @@ apic_alloc_vectors(u_int apic_id, u_int for (vector = 0; vector < APIC_NUM_IOINTS; vector++) { /* Vector is in use, end run. */ - if (lapics[apic_id].la_ioint_irqs[vector] != 0) { + if (lapics[apic_id].la_ioint_irqs[vector] != -1) { run = 0; first = 0; continue; @@ -932,7 +938,7 @@ apic_free_vector(u_int apic_id, u_int ve sched_bind(td, apic_cpuid(apic_id)); thread_unlock(td); mtx_lock_spin(&icu_lock); - lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = 0; + lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = -1; mtx_unlock_spin(&icu_lock); thread_lock(td); sched_unbind(td); @@ -944,11 +950,15 @@ apic_free_vector(u_int apic_id, u_int ve u_int apic_idt_to_irq(u_int apic_id, u_int vector) { + int irq; KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL && vector <= APIC_IO_INTS + APIC_NUM_IOINTS, ("Vector %u does not map to an IRQ line", vector)); - return (lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS]); + irq = lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS]; + if (irq < 0) + irq = 0; + return (irq); } #ifdef DDB @@ -974,7 +984,7 @@ DB_SHOW_COMMAND(apic, db_show_apic) db_printf("Interrupts bound to lapic %u\n", apic_id); for (i = 0; i < APIC_NUM_IOINTS + 1 && !db_pager_quit; i++) { irq = lapics[apic_id].la_ioint_irqs[i]; - if (irq == 0 || irq == IRQ_SYSCALL) + if (irq == -1 || irq == IRQ_SYSCALL) continue; db_printf("vec 0x%2x -> ", i + APIC_IO_INTS); if (irq == IRQ_TIMER) Modified: projects/mesh11s/sys/amd64/amd64/mp_machdep.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/mp_machdep.c Sat May 2 18:06:15 2009 (r191749) +++ projects/mesh11s/sys/amd64/amd64/mp_machdep.c Sat May 2 18:47:23 2009 (r191750) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -160,6 +161,8 @@ int apic_cpuids[MAX_APIC_ID + 1]; static volatile u_int cpu_ipi_pending[MAXCPU]; static u_int boot_address; +static int cpu_logical; +static int cpu_cores; static void assign_cpu_ids(void); static void set_interrupt_apic_ids(void); @@ -181,13 +184,148 @@ mem_range_AP_init(void) mem_range_softc.mr_op->initAP(&mem_range_softc); } -struct cpu_group * -cpu_topo(void) +static void +topo_probe_0xb(void) { + int logical; + int p[4]; + int bits; + int type; + int cnt; + int i; + int x; + + /* We only support two levels for now. */ + for (i = 0; i < 3; i++) { + cpuid_count(0x0B, i, p); + bits = p[0] & 0x1f; + logical = p[1] &= 0xffff; + type = (p[2] >> 8) & 0xff; + if (type == 0 || logical == 0) + break; + for (cnt = 0, x = 0; x <= MAX_APIC_ID; x++) { + if (!cpu_info[x].cpu_present || + cpu_info[x].cpu_disabled) + continue; + if (x >> bits == boot_cpu_id >> bits) + cnt++; + } + if (type == CPUID_TYPE_SMT) + cpu_logical = cnt; + else if (type == CPUID_TYPE_CORE) + cpu_cores = cnt; + } + if (cpu_logical == 0) + cpu_logical = 1; + cpu_cores /= cpu_logical; +} + +static void +topo_probe_0x4(void) +{ + u_int threads_per_cache, p[4]; + u_int htt, cmp; + int i; + + htt = cmp = 1; + /* + * If this CPU supports HTT or CMP then mention the + * number of physical/logical cores it contains. + */ + if (cpu_feature & CPUID_HTT) + htt = (cpu_procinfo & CPUID_HTT_CORES) >> 16; + if (cpu_vendor_id == CPU_VENDOR_AMD && (amd_feature2 & AMDID2_CMP)) + cmp = (cpu_procinfo2 & AMDID_CMP_CORES) + 1; + else if (cpu_vendor_id == CPU_VENDOR_INTEL && (cpu_high >= 4)) { + cpuid_count(4, 0, p); + if ((p[0] & 0x1f) != 0) + cmp = ((p[0] >> 26) & 0x3f) + 1; + } + cpu_cores = cmp; + cpu_logical = htt / cmp; + + /* Setup the initial logical CPUs info. */ + if (cpu_feature & CPUID_HTT) + logical_cpus = (cpu_procinfo & CPUID_HTT_CORES) >> 16; + + /* + * Work out if hyperthreading is *really* enabled. This + * is made really ugly by the fact that processors lie: Dual + * core processors claim to be hyperthreaded even when they're + * not, presumably because they want to be treated the same + * way as HTT with respect to per-cpu software licensing. + * At the time of writing (May 12, 2005) the only hyperthreaded + * cpus are from Intel, and Intel's dual-core processors can be + * identified via the "deterministic cache parameters" cpuid + * calls. + */ + /* + * First determine if this is an Intel processor which claims + * to have hyperthreading support. + */ + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * If the "deterministic cache parameters" cpuid calls + * are available, use them. + */ + if (cpu_high >= 4) { + /* Ask the processor about the L1 cache. */ + for (i = 0; i < 1; i++) { + cpuid_count(4, i, p); + threads_per_cache = ((p[0] & 0x3ffc000) >> 14) + 1; + if (hyperthreading_cpus < threads_per_cache) + hyperthreading_cpus = threads_per_cache; + if ((p[0] & 0x1f) == 0) + break; + } + } + + /* + * If the deterministic cache parameters are not + * available, or if no caches were reported to exist, + * just accept what the HTT flag indicated. + */ + if (hyperthreading_cpus == 0) + hyperthreading_cpus = logical_cpus; + } +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sat May 2 18:58:55 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 401EE1065670; Sat, 2 May 2009 18:58:55 +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 2EA738FC17; Sat, 2 May 2009 18:58:55 +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 n42Iwtrh092604; Sat, 2 May 2009 18:58:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n42Iwtj9092603; Sat, 2 May 2009 18:58:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905021858.n42Iwtj9092603@svn.freebsd.org> From: Rui Paulo Date: Sat, 2 May 2009 18:58:55 +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: r191751 - projects/mesh11s/sys/dev/ipw 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: Sat, 02 May 2009 18:58:55 -0000 Author: rpaulo Date: Sat May 2 18:58:54 2009 New Revision: 191751 URL: http://svn.freebsd.org/changeset/base/191751 Log: Make this build by adding MBSS. Modified: projects/mesh11s/sys/dev/ipw/if_ipw.c Modified: projects/mesh11s/sys/dev/ipw/if_ipw.c ============================================================================== --- projects/mesh11s/sys/dev/ipw/if_ipw.c Sat May 2 18:47:23 2009 (r191750) +++ projects/mesh11s/sys/dev/ipw/if_ipw.c Sat May 2 18:58:54 2009 (r191751) @@ -2441,7 +2441,7 @@ ipw_init_locked(struct ipw_softc *sc) fail: ipw_stop_locked(sc); sc->flags &=~ IPW_FLAG_INIT_LOCKED; -} + static int ipw_config(struct ipw_softc *sc) @@ -2460,6 +2460,7 @@ ipw_config(struct ipw_softc *sc) case IEEE80211_M_STA: case IEEE80211_M_HOSTAP: case IEEE80211_M_WDS: /* XXX */ + case IEEE80211_M_MBSS: /* XXX */ data = htole32(IPW_MODE_BSS); break; case IEEE80211_M_IBSS: From owner-svn-src-projects@FreeBSD.ORG Sat May 2 20:13:38 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 5B3DF106564A; Sat, 2 May 2009 20:13:38 +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 4841D8FC0A; Sat, 2 May 2009 20:13:38 +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 n42KDbVA094038; Sat, 2 May 2009 20:13:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n42KDbE5094037; Sat, 2 May 2009 20:13:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905022013.n42KDbE5094037@svn.freebsd.org> From: Rui Paulo Date: Sat, 2 May 2009 20:13:37 +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: r191752 - projects/mesh11s/sys/dev/ipw 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: Sat, 02 May 2009 20:13:38 -0000 Author: rpaulo Date: Sat May 2 20:13:37 2009 New Revision: 191752 URL: http://svn.freebsd.org/changeset/base/191752 Log: Fix previous commit. Modified: projects/mesh11s/sys/dev/ipw/if_ipw.c Modified: projects/mesh11s/sys/dev/ipw/if_ipw.c ============================================================================== --- projects/mesh11s/sys/dev/ipw/if_ipw.c Sat May 2 18:58:54 2009 (r191751) +++ projects/mesh11s/sys/dev/ipw/if_ipw.c Sat May 2 20:13:37 2009 (r191752) @@ -2441,7 +2441,7 @@ ipw_init_locked(struct ipw_softc *sc) fail: ipw_stop_locked(sc); sc->flags &=~ IPW_FLAG_INIT_LOCKED; - +} static int ipw_config(struct ipw_softc *sc) From owner-svn-src-projects@FreeBSD.ORG Sat May 2 20:39:44 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 3EB9C106564A; Sat, 2 May 2009 20:39:44 +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 2DAA68FC0C; Sat, 2 May 2009 20:39:44 +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 n42Kdikx094768; Sat, 2 May 2009 20:39:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n42KdiWA094767; Sat, 2 May 2009 20:39:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200905022039.n42KdiWA094767@svn.freebsd.org> From: Rui Paulo Date: Sat, 2 May 2009 20:39:44 +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: r191758 - projects/mesh11s/sys/dev/wpi 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: Sat, 02 May 2009 20:39:44 -0000 Author: rpaulo Date: Sat May 2 20:39:43 2009 New Revision: 191758 URL: http://svn.freebsd.org/changeset/base/191758 Log: Handle MBSS in a switch. Modified: projects/mesh11s/sys/dev/wpi/if_wpi.c Modified: projects/mesh11s/sys/dev/wpi/if_wpi.c ============================================================================== --- projects/mesh11s/sys/dev/wpi/if_wpi.c Sat May 2 20:28:55 2009 (r191757) +++ projects/mesh11s/sys/dev/wpi/if_wpi.c Sat May 2 20:39:43 2009 (r191758) @@ -2808,6 +2808,7 @@ wpi_config(struct wpi_softc *sc) switch (ic->ic_opmode) { case IEEE80211_M_STA: case IEEE80211_M_WDS: /* No know setup, use STA for now */ + case IEEE80211_M_MBSS: /* XXX */ sc->config.mode = WPI_MODE_STA; sc->config.filter |= htole32(WPI_FILTER_MULTICAST); break;