From owner-svn-src-projects@FreeBSD.ORG Tue Jan 13 07:35:31 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C59EB201; Tue, 13 Jan 2015 07:35:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99DE4328; Tue, 13 Jan 2015 07:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0D7ZVC8034908; Tue, 13 Jan 2015 07:35:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0D7ZVWG034905; Tue, 13 Jan 2015 07:35:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201501130735.t0D7ZVWG034905@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Jan 2015 07:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r277110 - projects/ifnet/sys/net X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 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, 13 Jan 2015 07:35:31 -0000 Author: glebius Date: Tue Jan 13 07:35:30 2015 New Revision: 277110 URL: https://svnweb.freebsd.org/changeset/base/277110 Log: Partial revert of r277068: a normal driver shouldn't be interested in its if_index. Modified: projects/ifnet/sys/net/if.c projects/ifnet/sys/net/if.h Modified: projects/ifnet/sys/net/if.c ============================================================================== --- projects/ifnet/sys/net/if.c Tue Jan 13 07:17:50 2015 (r277109) +++ projects/ifnet/sys/net/if.c Tue Jan 13 07:35:30 2015 (r277110) @@ -1494,23 +1494,18 @@ if_rtdel(struct radix_node *rn, void *ar * Managing different integer values and bitmasks of an ifnet. */ static void -if_getfeature(if_t ifp, ift_feature f, uint64_t **f64, void **ptr, - uint32_t **f32, uint16_t **f16) +if_getfeature(if_t ifp, ift_feature f, uint32_t **f32, uint64_t **f64, + void **ptr) { + if (f32) + *f32 = NULL; if (f64) *f64 = NULL; if (ptr) *ptr = NULL; - if (f32) - *f32 = NULL; - if (f16) - *f16 = NULL; switch (f) { - case IF_INDEX: - *f16 = &ifp->if_index; - break; case IF_FLAGS: *f32 = &ifp->if_flags; break; @@ -1589,7 +1584,7 @@ if_set(if_t ifp, ift_feature f, uint64_t uint64_t *f64; uint32_t *f32; - if_getfeature(ifp, f, &f64, NULL, &f32, NULL); + if_getfeature(ifp, f, &f32, &f64, NULL); KASSERT(f32 != NULL || f64 != NULL, ("%s: no feature %d", __func__, f)); if (f32 != NULL) { KASSERT(set <= UINT32_MAX, @@ -1608,7 +1603,7 @@ if_flagbits(if_t ifp, ift_feature f, uin uint64_t *f64, rv, old; uint32_t *f32; - if_getfeature(ifp, f, &f64, NULL, &f32, NULL); + if_getfeature(ifp, f, &f32, &f64, NULL); if (f32 != NULL) { KASSERT(set <= UINT32_MAX, ("%s: value of 0x%jx for feature %d", @@ -1643,17 +1638,14 @@ if_get(if_t ifp, ift_feature f) { uint64_t *f64; uint32_t *f32; - uint16_t *f16; - if_getfeature(ifp, f, &f64, NULL, &f32, &f16); - KASSERT(f16 != NULL || f32 != NULL || f64 != NULL, + if_getfeature(ifp, f, &f32, &f64, NULL); + KASSERT(f32 != NULL || f64 != NULL, ("%s: no feature %d", __func__, f)); if (f64 != NULL) return (*f64); if (f32 != NULL) return (*f32); - if (f16 != NULL) - return (*f16); return (EDOOFUS); } @@ -1663,7 +1655,7 @@ if_getsoftc(if_t ifp, ift_feature f) { void *ptr; - if_getfeature(ifp, f, NULL, &ptr, NULL, NULL); + if_getfeature(ifp, f, NULL, NULL, &ptr); return (ptr); } Modified: projects/ifnet/sys/net/if.h ============================================================================== --- projects/ifnet/sys/net/if.h Tue Jan 13 07:17:50 2015 (r277109) +++ projects/ifnet/sys/net/if.h Tue Jan 13 07:35:30 2015 (r277110) @@ -568,8 +568,6 @@ typedef enum { } ift_counter; typedef enum { - /* uint16_t */ - IF_INDEX, /* uint32_t */ IF_FLAGS, IF_CAPABILITIES,