From owner-p4-projects@FreeBSD.ORG Mon Sep 4 04:02:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4544016A4EA; Mon, 4 Sep 2006 04:02:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E572516A4E8 for ; Mon, 4 Sep 2006 04:02:54 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5ED443D46 for ; Mon, 4 Sep 2006 04:02:54 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8442sYv098170 for ; Mon, 4 Sep 2006 04:02:54 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8442sdY098167 for perforce@freebsd.org; Mon, 4 Sep 2006 04:02:54 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 4 Sep 2006 04:02:54 GMT Message-Id: <200609040402.k8442sdY098167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 105631 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2006 04:02:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=105631 Change 105631 by kmacy@kmacy_storage:sun4v_work_stable on 2006/09/04 04:02:02 add support for obtaining a virtual device handle this allows us to query machine description node attributes for the device (local-mac-address, tx-ino, rx-ino) Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/conf/files.sun4v#4 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/cddl/mdesc.h#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus.h#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus_subr.h#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_if.m#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_subr.c#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_vdevfindval.c#1 add Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/conf/files.sun4v#4 (text+ko) ==== @@ -112,4 +112,4 @@ sun4v/mdesc/mdesc_findname.c standard sun4v/mdesc/mdesc_nodecount.c standard sun4v/mdesc/mdesc_findnodeprop.c standard - +sun4v/mdesc/mdesc_vdevfindval.c standard ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/cddl/mdesc.h#2 (text+ko) ==== @@ -177,6 +177,9 @@ #include extern int md_get_prop_alloc(md_t *, mde_cookie_t, char *, int, uint8_t **); +extern int md_vdev_find_val(device_t dev, char *namep, + uint64_t *valp); + MALLOC_DECLARE(M_MDPROP); extern void mdesc_init(void); ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus.h#2 (text+ko) ==== @@ -34,4 +34,11 @@ return (MDESC_BUS_GET_TYPE(device_get_parent(dev), dev)); } +static __inline uint64_t +mdesc_bus_get_handle(device_t dev) +{ + + return (MDESC_BUS_GET_HANDLE(device_get_parent(dev), dev)); +} + #endif /* !_MACHINE_MDESC_BUS_H_ */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus_subr.h#2 (text+ko) ==== @@ -14,5 +14,6 @@ mdesc_bus_get_compat_t mdesc_bus_gen_get_compat; mdesc_bus_get_name_t mdesc_bus_gen_get_name; mdesc_bus_get_type_t mdesc_bus_gen_get_type; +mdesc_bus_get_handle_t mdesc_bus_gen_get_handle; #endif /* !_MACHINE_MDESC_MDESC_BUS_SUBR_H_ */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_if.m#2 (text+ko) ==== @@ -82,6 +82,13 @@ return (NULL); } + + static uint64_t + mdesc_bus_default_get_handle(device_t bus, device_t dev) + { + + return (0); + } }; # Get the mdesc_bus_devinfo struct for the device dev on the bus. Used for bus @@ -113,3 +120,8 @@ device_t bus; device_t dev; } DEFAULT mdesc_bus_default_get_type; + +METHOD uint64_t get_handle { + device_t bus; + device_t dev; +} DEFAULT mdesc_bus_default_get_handle; ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_subr.c#2 (text+ko) ==== @@ -84,6 +84,21 @@ return (mbd->mbd_type); } +uint64_t +mdesc_bus_gen_get_handle(device_t bus, device_t dev) +{ + const struct mdesc_bus_devinfo *mbd; + + mbd = MDESC_BUS_GET_DEVINFO(bus, dev); + if (mbd == NULL) + return (0); + return (mbd->mbd_handle); +} + + + + +