From owner-svn-src-stable@FreeBSD.ORG Mon May 10 18:47:53 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29F7A1065680; Mon, 10 May 2010 18:47:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 17E888FC27; Mon, 10 May 2010 18:47:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIlqZ9036273; Mon, 10 May 2010 18:47:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIlqSE036270; Mon, 10 May 2010 18:47:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101847.o4AIlqSE036270@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207863 - in stable/8/sys: sparc64/include sparc64/sparc64 sun4v/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 18:47:53 -0000 Author: marius Date: Mon May 10 18:47:52 2010 New Revision: 207863 URL: http://svn.freebsd.org/changeset/base/207863 Log: MFC: r207243 Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for obtaining the initiator ID to be used for SPI controllers from the Open Firmware device tree. Modified: stable/8/sys/sparc64/include/ofw_machdep.h stable/8/sys/sparc64/sparc64/ofw_machdep.c stable/8/sys/sun4v/include/ofw_machdep.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/sparc64/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sparc64/include/ofw_machdep.h Mon May 10 18:46:37 2010 (r207862) +++ stable/8/sys/sparc64/include/ofw_machdep.h Mon May 10 18:47:52 2010 (r207863) @@ -36,6 +36,7 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); int ofw_entry(void *); void ofw_exit(void *); Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ofw_machdep.c Mon May 10 18:46:37 2010 (r207862) +++ stable/8/sys/sparc64/sparc64/ofw_machdep.c Mon May 10 18:47:52 2010 (r207863) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 - 2009 by Marius Strobl . + * Copyright (c) 2005 - 2010 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,19 @@ OF_getetheraddr(device_t dev, u_char *ad bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } +u_int +OF_getscsinitid(device_t dev) +{ + phandle_t node; + uint32_t id; + + for (node = ofw_bus_get_node(dev); node != 0; node = OF_parent(node)) + if (OF_getprop(node, "scsi-initiator-id", &id, + sizeof(id)) > 0) + return (id); + return (7); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { Modified: stable/8/sys/sun4v/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sun4v/include/ofw_machdep.h Mon May 10 18:46:37 2010 (r207862) +++ stable/8/sys/sun4v/include/ofw_machdep.h Mon May 10 18:47:52 2010 (r207863) @@ -36,6 +36,7 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); int ofw_entry(void *); void ofw_exit(void *);