From owner-p4-projects@FreeBSD.ORG Wed Nov 12 16:34:36 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0EADD16A4D0; Wed, 12 Nov 2003 16:34:36 -0800 (PST) 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 D369116A4CE for ; Wed, 12 Nov 2003 16:34:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EF4A43F93 for ; Wed, 12 Nov 2003 16:34:33 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hAD0YXXJ035177 for ; Wed, 12 Nov 2003 16:34:33 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hAD0YWIJ035174 for perforce@freebsd.org; Wed, 12 Nov 2003 16:34:32 -0800 (PST) (envelope-from peter@freebsd.org) Message-Id: <200311130034.hAD0YWIJ035174@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 42194 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Thu, 13 Nov 2003 00:34:36 -0000 X-Original-Date: Wed, 12 Nov 2003 16:34:32 -0800 (PST) X-List-Received-Date: Thu, 13 Nov 2003 00:34:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=42194 Change 42194 by peter@peter_daintree on 2003/11/12 16:34:07 IFC @42193 Affected files ... .. //depot/projects/hammer/Makefile.inc1#32 integrate .. //depot/projects/hammer/UPDATING#25 integrate .. //depot/projects/hammer/bin/df/df.c#10 integrate .. //depot/projects/hammer/games/fortune/datfiles/fortunes#14 integrate .. //depot/projects/hammer/gnu/usr.bin/send-pr/send-pr.sh#5 integrate .. //depot/projects/hammer/lib/Makefile#28 integrate .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/Makefile#2 integrate .. //depot/projects/hammer/lib/libdisk/create_chunk.c#13 integrate .. //depot/projects/hammer/lib/libpam/modules/pam_radius/pam_radius.8#4 integrate .. //depot/projects/hammer/lib/libpam/modules/pam_radius/pam_radius.c#6 integrate .. //depot/projects/hammer/lib/libutil/Makefile#5 integrate .. //depot/projects/hammer/sys/dev/acpica/acpi_pci_link.c#6 integrate .. //depot/projects/hammer/sys/dev/drm/drm.h#5 integrate .. //depot/projects/hammer/sys/dev/drm/drmP.h#6 integrate .. //depot/projects/hammer/sys/dev/drm/drm_bufs.h#6 integrate .. //depot/projects/hammer/sys/dev/drm/drm_drv.h#9 integrate .. //depot/projects/hammer/sys/dev/drm/drm_fops.h#7 integrate .. //depot/projects/hammer/sys/dev/drm/drm_ioctl.h#6 integrate .. //depot/projects/hammer/sys/dev/drm/drm_irq.h#2 integrate .. //depot/projects/hammer/sys/dev/drm/drm_os_freebsd.h#9 integrate .. //depot/projects/hammer/sys/dev/drm/mga_dma.c#6 integrate .. //depot/projects/hammer/sys/dev/drm/r128_cce.c#6 integrate .. //depot/projects/hammer/sys/dev/drm/radeon.h#6 integrate .. //depot/projects/hammer/sys/dev/drm/radeon_cp.c#6 integrate .. //depot/projects/hammer/sys/dev/drm/radeon_drm.h#5 integrate .. //depot/projects/hammer/sys/dev/drm/radeon_drv.h#5 integrate .. //depot/projects/hammer/sys/dev/drm/radeon_state.c#5 integrate .. //depot/projects/hammer/sys/i386/i386/apic_vector.s#2 integrate .. //depot/projects/hammer/sys/i386/i386/genassym.c#12 integrate .. //depot/projects/hammer/sys/i386/i386/intr_machdep.c#2 integrate .. //depot/projects/hammer/sys/i386/i386/io_apic.c#4 integrate .. //depot/projects/hammer/sys/i386/i386/local_apic.c#2 integrate .. //depot/projects/hammer/sys/i386/i386/mp_machdep.c#20 integrate .. //depot/projects/hammer/sys/i386/include/apicvar.h#2 integrate .. //depot/projects/hammer/sys/i386/include/clock.h#6 integrate .. //depot/projects/hammer/sys/i386/isa/atpic.c#3 integrate .. //depot/projects/hammer/sys/i386/isa/atpic_vector.s#2 integrate .. //depot/projects/hammer/sys/i386/isa/icu.h#3 integrate .. //depot/projects/hammer/sys/kern/kern_mac.c#24 integrate .. //depot/projects/hammer/sys/kern/kern_timeout.c#8 integrate .. //depot/projects/hammer/sys/kern/subr_turnstile.c#3 integrate .. //depot/projects/hammer/sys/netinet/ip_output.c#21 integrate .. //depot/projects/hammer/sys/netinet/tcp_input.c#17 integrate .. //depot/projects/hammer/sys/netinet/udp_usrreq.c#10 integrate .. //depot/projects/hammer/sys/netinet6/in6_src.c#5 integrate .. //depot/projects/hammer/sys/pci/if_sk.c#13 integrate .. //depot/projects/hammer/sys/pci/if_skreg.h#4 integrate .. //depot/projects/hammer/usr.sbin/traceroute6/traceroute6.8#2 integrate .. //depot/projects/hammer/usr.sbin/traceroute6/traceroute6.c#6 integrate Differences ... ==== //depot/projects/hammer/Makefile.inc1#32 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.395 2003/11/10 09:00:08 harti Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.396 2003/11/12 17:09:12 harti Exp $ # # Make command line options: # -DNO_KERBEROS Do not build Heimdal (Kerberos 5) @@ -818,8 +818,8 @@ _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \ lib/libkvm lib/libmd \ - lib/libncurses lib/libopie lib/libpam lib/libradius \ - lib/librpcsvc \ + lib/libncurses lib/libnetgraph lib/libopie lib/libpam \ + lib/libradius lib/librpcsvc \ lib/libsbuf lib/libtacplus lib/libutil lib/libypclnt \ lib/libz lib/msun ==== //depot/projects/hammer/UPDATING#25 (text+ko) ==== @@ -18,15 +18,25 @@ to maximize performance. 20031112: - Some netgraph string length constants have been changed. This - change requires the netgraph kernel modules and all netgraph - userland components to be in sync. Especially users who require - netgraph to boot need to make sure to have world and kernel in - sync before rebooting. + The statfs structure has been updated with 64-bit fields to allow + accurate reporting of multi-terabyte filesystem sizes. You should + build and boot a new kernel BEFORE doing a `make world' as the new + kernel will know about binaries using the old statfs structure, + but an old kernel will not know about the new system calls that + support the new statfs structure. Running an old kernel after a + `make world' will cause programs such as `df' that do a statfs + system call to fail with a bad system call. + +20031112: + Some netgraph string length constants have been changed. This + change requires the netgraph kernel modules and all netgraph + userland components to be in sync. Especially users who require + netgraph to boot need to make sure to have world and kernel in + sync before rebooting. 20031103: The i386 APIC_IO kernel option has been replaced by - 'device apic'. The ACPI module has also been temporarily + 'device apic'. The ACPI module has also been temporarily disabled, so ACPI must be statically compiled into your kernel using 'device acpi' if you wish to use the ACPI driver. @@ -1405,4 +1415,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.277 2003/11/12 09:11:18 harti Exp $ +$FreeBSD: src/UPDATING,v 1.278 2003/11/12 19:13:02 mckusick Exp $ ==== //depot/projects/hammer/bin/df/df.c#10 (text+ko) ==== @@ -48,7 +48,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: src/bin/df/df.c,v 1.52 2003/11/12 08:01:39 mckusick Exp $"); +__FBSDID("$FreeBSD: src/bin/df/df.c,v 1.53 2003/11/12 21:47:42 kris Exp $"); #include #include @@ -445,7 +445,7 @@ if (hflag) { prthuman(sfsp, used); } else { - (void)printf(" %*qd %*qd %*qd", + (void)printf(" %*jd %*jd %*jd", (u_int)mwp->total, (intmax_t)fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize), (u_int)mwp->used, @@ -458,7 +458,7 @@ if (iflag) { inodes = sfsp->f_files; used = inodes - sfsp->f_ffree; - (void)printf(" %*qd %*qd %4.0f%% ", + (void)printf(" %*jd %*jd %4.0f%% ", (u_int)mwp->iused, (intmax_t)used, (u_int)mwp->ifree, (intmax_t)sfsp->f_ffree, inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0); ==== //depot/projects/hammer/games/fortune/datfiles/fortunes#14 (text+ko) ==== @@ -1,5 +1,5 @@ This fortune brought to you by: -$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.119 2003/10/20 21:22:41 phk Exp $ +$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.120 2003/11/12 20:08:47 phk Exp $ % -- Gifts for Children -- @@ -5687,6 +5687,17 @@ achieve "super shuttle diplomacy" between cool data, perhaps earned by HOST COMPUTER, and warm heart of human being. % +From the Pointless Comparison Collection: + + To give you an idea of how sensitive these antennas are, + if we were to "listen" to one spacecraft in the outer solar + system by Jupiter or Saturn for 1 billion years and add up + all the signal we collected, it would be enough power to + set off the flash bulb on your camera once. + + -- Peter Doms, manager of the Deep Space Network + systems program at JPL. +% From the Pro 350 Pocket Service Guide, p. 49, Step 5 of the instructions on removing an I/O board from the card cage, comes a new experience in sound: ==== //depot/projects/hammer/gnu/usr.bin/send-pr/send-pr.sh#5 (text+ko) ==== @@ -20,7 +20,7 @@ # along with GNU GNATS; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # -# $FreeBSD: src/gnu/usr.bin/send-pr/send-pr.sh,v 1.34 2003/11/02 17:35:33 ceri Exp $ +# $FreeBSD: src/gnu/usr.bin/send-pr/send-pr.sh,v 1.35 2003/11/12 23:08:23 ceri Exp $ # The version of this send-pr. VERSION=3.113 @@ -262,7 +262,7 @@ # Catch some signals. ($xs kludge needed by Sun /bin/sh) xs=0 trap 'rm -f $REF $TEMP; exit $xs' 0 -trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15 +trap 'echo "$COMMAND: Aborting ... saving unfinished PR into /tmp/pr.$$"; rm -f $REF ; mv $TEMP /tmp/pr.$$; xs=1; exit' 1 2 3 13 15 # If they told us to use a specific file, then do so. if [ -n "$IN_FILE" ]; then ==== //depot/projects/hammer/lib/Makefile#28 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/Makefile,v 1.175 2003/11/10 09:18:04 harti Exp $ +# $FreeBSD: src/lib/Makefile,v 1.176 2003/11/12 17:09:13 harti Exp $ # To satisfy shared library or ELF linkage when only the libraries being # built are visible: @@ -11,6 +11,7 @@ # msun must be built before libg++ and libstdc++. # libmd must be built before libatm, libopie, libradius, and libtacplus. # libncurses must be built before libdialog, libedit and libreadline. +# libnetgraph must be built before libbsnmp/modules/snmp_netgraph. # libopie must be built before libpam. # libradius must be built before libpam. # librpcsvc must be built before libpam. @@ -21,14 +22,14 @@ # # Otherwise, the SUBDIR list should be in alphabetical order. -SUBDIR= ${_csu} libcom_err libcrypt libkvm msun libmd \ - libncurses libradius librpcsvc libsbuf libtacplus libutil libypclnt \ +SUBDIR= ${_csu} libcom_err libcrypt libkvm msun libmd libncurses \ + libnetgraph libradius librpcsvc libsbuf libtacplus libutil libypclnt \ ${_compat} libalias ${_libatm} ${_libbind} \ ${_libbluetooth} libbsnmp libbz2 libc ${_libc_r} \ libcalendar libcam libcompat libdevinfo libdevstat ${_libdisk} \ libedit libexpat libfetch libform libftpio libgeom ${_libio} libipsec \ libipx libisc libkiconv libmenu ${_libmilter} ${_libmp} ${_libncp} \ - libnetgraph ${_libngatm} libopie libpam libpanel libpcap \ + ${_libngatm} libopie libpam libpanel libpcap \ ${_libpthread} ${_libsdp} ${_libsm} ${_libsmb} ${_libsmdb} \ ${_libsmutil} libstand libtelnet ${_libthr} libufs libugidfw \ ${_libusbhid} ${_libvgl} libwrap libxpg4 liby libz ==== //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/lib/libbsnmp/modules/snmp_netgraph/Makefile,v 1.2 2003/11/10 13:43:26 harti Exp $ +# $FreeBSD: src/lib/libbsnmp/modules/snmp_netgraph/Makefile,v 1.3 2003/11/12 17:09:13 harti Exp $ # # Author: Harti Brandt @@ -12,6 +12,9 @@ DEFS= ${MOD}_tree.def INCS= snmp_${MOD}.h +DPADD= ${LIBNETGRAPH} +LDADD= -lnetgraph + CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I${.CURDIR} .include ==== //depot/projects/hammer/lib/libdisk/create_chunk.c#13 (text+ko) ==== @@ -8,7 +8,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libdisk/create_chunk.c,v 1.82 2003/11/02 08:39:08 marcel Exp $"); +__FBSDID("$FreeBSD: src/lib/libdisk/create_chunk.c,v 1.83 2003/11/12 17:44:37 marcel Exp $"); #include #include @@ -159,8 +159,12 @@ max = NDOSPART; #endif for (j = 1; j <= max; j++) { +#ifdef __ia64__ sprintf(c2->oname, "%s%c%d", c1->name, (c1->type == whole) ? 'p' : 's', j); +#else + sprintf(c2->oname, "%ss%d", c1->name, j); +#endif for (c3 = c1->part; c3; c3 = c3->next) if (c3 != c2 && !strcmp(c3->name, c2->oname)) goto match; ==== //depot/projects/hammer/lib/libpam/modules/pam_radius/pam_radius.8#4 (text+ko) ==== @@ -36,7 +36,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.8,v 1.13 2002/11/29 15:57:50 ru Exp $ +.\" $FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.8,v 1.14 2003/11/12 17:47:23 sobomax Exp $ .\" .Dd October 28, 2002 .Dt PAM_RADIUS 8 @@ -100,6 +100,10 @@ in the system databases equal to the supplied one (as determined by call to .Xr getpwnam 3 ) , the authentication will fail. +.It Cm nas_ipaddr Ns Op No = Ns Ar address +specifies a NAS IP address to be sent. +If option is present, but there is no value provided then IP address +corresponding to the current hostname will be used. .El .Sh FILES .Bl -tag -width /etc/radius.conf -compact ==== //depot/projects/hammer/lib/libpam/modules/pam_radius/pam_radius.c#6 (text+ko) ==== @@ -35,9 +35,12 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.c,v 1.17 2003/07/21 19:56:28 des Exp $"); +__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.c,v 1.19 2003/11/12 23:36:17 sobomax Exp $"); #include +#include +#include +#include #include #include #include @@ -54,12 +57,14 @@ #define PAM_OPT_CONF "conf" #define PAM_OPT_TEMPLATE_USER "template_user" #define PAM_OPT_NAS_ID "nas_id" +#define PAM_OPT_NAS_IPADDR "nas_ipaddr" #define MAX_CHALLENGE_MSGS 10 #define PASSWORD_PROMPT "RADIUS Password:" static int build_access_request(struct rad_handle *, const char *, - const char *, const char *, const void *, size_t); + const char *, const char *, const char *, const void *, + size_t); static int do_accept(pam_handle_t *, struct rad_handle *); static int do_challenge(pam_handle_t *, struct rad_handle *, const char *); @@ -70,16 +75,28 @@ */ static int build_access_request(struct rad_handle *radh, const char *user, - const char *pass, const char *nas_id, const void *state, size_t state_len) + const char *pass, const char *nas_id, const char *nas_ipaddr, + const void *state, size_t state_len) { - char host[MAXHOSTNAMELEN]; + int error; + char host[MAXHOSTNAMELEN]; + struct sockaddr_in *haddr; + struct addrinfo hints; + struct addrinfo *res; if (rad_create_request(radh, RAD_ACCESS_REQUEST) == -1) { syslog(LOG_CRIT, "rad_create_request: %s", rad_strerror(radh)); return (-1); } - if (nas_id == NULL && gethostname(host, sizeof host) != -1) - nas_id = host; + if (nas_id == NULL || + (nas_ipaddr != NULL && strlen(nas_ipaddr) == 0)) { + if (gethostname(host, sizeof host) != -1) { + if (nas_id == NULL) + nas_id = host; + if (nas_ipaddr != NULL && strlen(nas_ipaddr) == 0) + nas_ipaddr = host; + } + } if ((user != NULL && rad_put_string(radh, RAD_USER_NAME, user) == -1) || (pass != NULL && @@ -89,6 +106,22 @@ syslog(LOG_CRIT, "rad_put_string: %s", rad_strerror(radh)); return (-1); } + if (nas_ipaddr != NULL) { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_INET; + if (getaddrinfo(nas_ipaddr, NULL, &hints, &res) == 0 && + res != NULL) { + (struct sockaddr *)haddr = res->ai_addr; + error = rad_put_addr(radh, RAD_NAS_IP_ADDRESS, + haddr->sin_addr); + freeaddrinfo(res); + if (error == -1) { + syslog(LOG_CRIT, "rad_put_addr: %s", + rad_strerror(radh)); + return (-1); + } + } + } if (state != NULL && rad_put_attr(radh, RAD_STATE, state, state_len) == -1) { syslog(LOG_CRIT, "rad_put_attr: %s", rad_strerror(radh)); @@ -197,7 +230,7 @@ conv->appdata_ptr)) != PAM_SUCCESS) return (retval); if (build_access_request(radh, user, resp[num_msgs-1].resp, NULL, - state, statelen) == -1) + NULL, state, statelen) == -1) return (PAM_SERVICE_ERR); memset(resp[num_msgs-1].resp, 0, strlen(resp[num_msgs-1].resp)); free(resp[num_msgs-1].resp); @@ -213,13 +246,14 @@ { struct rad_handle *radh; const char *user, *tmpuser, *pass; - const char *conf_file, *template_user, *nas_id; + const char *conf_file, *template_user, *nas_id, *nas_ipaddr; int retval; int e; conf_file = openpam_get_option(pamh, PAM_OPT_CONF); template_user = openpam_get_option(pamh, PAM_OPT_TEMPLATE_USER); nas_id = openpam_get_option(pamh, PAM_OPT_NAS_ID); + nas_ipaddr = openpam_get_option(pamh, PAM_OPT_NAS_IPADDR); retval = pam_get_user(pamh, &user, NULL); if (retval != PAM_SUCCESS) @@ -249,7 +283,8 @@ PAM_LOG("Radius config file read"); - if (build_access_request(radh, user, pass, nas_id, NULL, 0) == -1) { + if (build_access_request(radh, user, pass, nas_id, nas_ipaddr, NULL, + 0) == -1) { rad_close(radh); return (PAM_SERVICE_ERR); } ==== //depot/projects/hammer/lib/libutil/Makefile#5 (text+ko) ==== @@ -1,8 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libutil/Makefile,v 1.52 2003/10/18 09:58:39 markm Exp $ +# $FreeBSD: src/lib/libutil/Makefile,v 1.53 2003/11/12 21:56:07 rwatson Exp $ LIB= util -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 SHLIBDIR?= /lib CFLAGS+=-DLIBC_SCCS -I${.CURDIR} -I${.CURDIR}/../libc/gen/ CFLAGS+=-DINET6 ==== //depot/projects/hammer/sys/dev/acpica/acpi_pci_link.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.7 2003/08/24 17:48:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.8 2003/11/12 19:46:17 jhb Exp $"); #include "opt_acpi.h" #include @@ -120,7 +120,7 @@ break; default: - printf("unkown,"); + printf("unknown,"); break; } @@ -134,7 +134,7 @@ break; default: - printf("unkown,"); + printf("unknown,"); break; } @@ -148,7 +148,7 @@ break; default: - printf("unkown"); + printf("unknown"); break; } ==== //depot/projects/hammer/sys/dev/drm/drm.h#5 (text+ko) ==== @@ -1,6 +1,14 @@ -/* drm.h -- Header for Direct Rendering Manager -*- linux-c -*- - * Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com +/** + * \file drm.h + * Header for the Direct Rendering Manager + * + * \author Rickard E. (Rik) Faith * + * \par Acknowledgments: + * Dec 1999, Richard Henderson , move to generic \c cmpxchg. + */ + +/* * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * All rights reserved. @@ -24,15 +32,10 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * - * Authors: - * Rickard E. (Rik) Faith - * - * Acknowledgements: - * Dec 1999, Richard Henderson , move to generic cmpxchg. - * - * $FreeBSD: src/sys/dev/drm/drm.h,v 1.5 2003/10/24 01:48:16 anholt Exp $ + * $FreeBSD: src/sys/dev/drm/drm.h,v 1.6 2003/11/12 20:56:30 anholt Exp $ */ + #ifndef _DRM_H_ #define _DRM_H_ @@ -79,29 +82,42 @@ #define DRM_DEV_GID 0 #endif -#define DRM_NAME "drm" /* Name in kernel, /dev, and /proc */ -#define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */ -#define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */ -#define DRM_RAM_PERCENT 10 /* How much system ram can we lock? */ +#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0) +#ifdef __OpenBSD__ +#define DRM_MAJOR 81 +#endif +#if defined(__linux__) || defined(__NetBSD__) +#define DRM_MAJOR 226 +#endif +#define DRM_MAX_MINOR 15 +#endif +#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ +#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ +#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ +#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ -#define _DRM_LOCK_HELD 0x80000000 /* Hardware lock is held */ -#define _DRM_LOCK_CONT 0x40000000 /* Hardware lock is contended */ +#define _DRM_LOCK_HELD 0x80000000 /**< Hardware lock is held */ +#define _DRM_LOCK_CONT 0x40000000 /**< Hardware lock is contended */ #define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) + typedef unsigned long drm_handle_t; typedef unsigned int drm_context_t; typedef unsigned int drm_drawable_t; typedef unsigned int drm_magic_t; -/* Warning: If you change this structure, make sure you change - * XF86DRIClipRectRec in the server as well */ -/* KW: Actually it's illegal to change either for +/** + * Cliprect. + * + * \warning: If you change this structure, make sure you change + * XF86DRIClipRectRec in the server as well + * + * \note KW: Actually it's illegal to change either for * backwards-compatibility reasons. */ - typedef struct drm_clip_rect { unsigned short x1; unsigned short y1; @@ -109,6 +125,10 @@ unsigned short y2; } drm_clip_rect_t; + +/** + * Texture region, + */ typedef struct drm_tex_region { unsigned char next; unsigned char prev; @@ -117,32 +137,52 @@ unsigned int age; } drm_tex_region_t; + +/** + * DRM_IOCTL_VERSION ioctl argument type. + * + * \sa drmGetVersion(). + */ typedef struct drm_version { - int version_major; /* Major version */ - int version_minor; /* Minor version */ - int version_patchlevel;/* Patch level */ - size_t name_len; /* Length of name buffer */ - char *name; /* Name of driver */ - size_t date_len; /* Length of date buffer */ - char *date; /* User-space buffer to hold date */ - size_t desc_len; /* Length of desc buffer */ - char *desc; /* User-space buffer to hold desc */ + int version_major; /**< Major version */ + int version_minor; /**< Minor version */ + int version_patchlevel;/**< Patch level */ + size_t name_len; /**< Length of name buffer */ + char *name; /**< Name of driver */ + size_t date_len; /**< Length of date buffer */ + char *date; /**< User-space buffer to hold date */ + size_t desc_len; /**< Length of desc buffer */ + char *desc; /**< User-space buffer to hold desc */ } drm_version_t; + +/** + * DRM_IOCTL_GET_UNIQUE ioctl argument type. + * + * \sa drmGetBusid() and drmSetBusId(). + */ typedef struct drm_unique { - size_t unique_len; /* Length of unique */ - char *unique; /* Unique name for driver instantiation */ + size_t unique_len; /**< Length of unique */ + char *unique; /**< Unique name for driver instantiation */ } drm_unique_t; + typedef struct drm_list { - int count; /* Length of user-space structures */ + int count; /**< Length of user-space structures */ drm_version_t *version; } drm_list_t; + typedef struct drm_block { int unused; } drm_block_t; + +/** + * DRM_IOCTL_CONTROL ioctl argument type. + * + * \sa drmCtlInstHandler() and drmCtlUninstHandler(). + */ typedef struct drm_control { enum { DRM_ADD_COMMAND, @@ -153,49 +193,70 @@ int irq; } drm_control_t; + +/** + * Type of memory to map. + */ typedef enum drm_map_type { - _DRM_FRAME_BUFFER = 0, /* WC (no caching), no core dump */ - _DRM_REGISTERS = 1, /* no caching, no core dump */ - _DRM_SHM = 2, /* shared, cached */ - _DRM_AGP = 3, /* AGP/GART */ - _DRM_SCATTER_GATHER = 4 /* Scatter/gather memory for PCI DMA */ + _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ + _DRM_REGISTERS = 1, /**< no caching, no core dump */ + _DRM_SHM = 2, /**< shared, cached */ + _DRM_AGP = 3, /**< AGP/GART */ + _DRM_SCATTER_GATHER = 4 /**< Scatter/gather memory for PCI DMA */ } drm_map_type_t; + +/** + * Memory mapping flags. + */ typedef enum drm_map_flags { - _DRM_RESTRICTED = 0x01, /* Cannot be mapped to user-virtual */ + _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ _DRM_READ_ONLY = 0x02, - _DRM_LOCKED = 0x04, /* shared, cached, locked */ - _DRM_KERNEL = 0x08, /* kernel requires access */ - _DRM_WRITE_COMBINING = 0x10, /* use write-combining if available */ - _DRM_CONTAINS_LOCK = 0x20, /* SHM page that contains lock */ - _DRM_REMOVABLE = 0x40 /* Removable mapping */ + _DRM_LOCKED = 0x04, /**< shared, cached, locked */ + _DRM_KERNEL = 0x08, /**< kernel requires access */ + _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ + _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ + _DRM_REMOVABLE = 0x40 /**< Removable mapping */ } drm_map_flags_t; + typedef struct drm_ctx_priv_map { - unsigned int ctx_id; /* Context requesting private mapping */ - void *handle; /* Handle of map */ + unsigned int ctx_id; /**< Context requesting private mapping */ + void *handle; /**< Handle of map */ } drm_ctx_priv_map_t; + +/** + * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls + * argument type. + * + * \sa drmAddMap(). + */ typedef struct drm_map { - unsigned long offset; /* Requested physical address (0 for SAREA)*/ - unsigned long size; /* Requested physical size (bytes) */ - drm_map_type_t type; /* Type of memory to map */ - drm_map_flags_t flags; /* Flags */ - void *handle; /* User-space: "Handle" to pass to mmap */ - /* Kernel-space: kernel-virtual address */ - int mtrr; /* MTRR slot used */ - /* Private data */ + unsigned long offset; /**< Requested physical address (0 for SAREA)*/ + unsigned long size; /**< Requested physical size (bytes) */ + drm_map_type_t type; /**< Type of memory to map */ + drm_map_flags_t flags; /**< Flags */ + void *handle; /**< User-space: "Handle" to pass to mmap() */ + /**< Kernel-space: kernel-virtual address */ + int mtrr; /**< MTRR slot used */ + /* Private data */ } drm_map_t; + +/** + * DRM_IOCTL_GET_CLIENT ioctl argument type. + */ typedef struct drm_client { - int idx; /* Which client desired? */ - int auth; /* Is client authenticated? */ - unsigned long pid; /* Process id */ - unsigned long uid; /* User id */ - unsigned long magic; /* Magic */ - unsigned long iocs; /* Ioctl count */ + int idx; /**< Which client desired? */ + int auth; /**< Is client authenticated? */ + unsigned long pid; /**< Process ID */ + unsigned long uid; /**< User ID */ + unsigned long magic; /**< Magic */ + unsigned long iocs; /**< Ioctl count */ } drm_client_t; + typedef enum { _DRM_STAT_LOCK, _DRM_STAT_OPENS, @@ -203,20 +264,24 @@ _DRM_STAT_IOCTLS, _DRM_STAT_LOCKS, _DRM_STAT_UNLOCKS, - _DRM_STAT_VALUE, /* Generic value */ - _DRM_STAT_BYTE, /* Generic byte counter (1024bytes/K) */ - _DRM_STAT_COUNT, /* Generic non-byte counter (1000/k) */ + _DRM_STAT_VALUE, /**< Generic value */ + _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ + _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ - _DRM_STAT_IRQ, /* IRQ */ - _DRM_STAT_PRIMARY, /* Primary DMA bytes */ - _DRM_STAT_SECONDARY, /* Secondary DMA bytes */ - _DRM_STAT_DMA, /* DMA */ - _DRM_STAT_SPECIAL, /* Special DMA (e.g., priority or polled) */ - _DRM_STAT_MISSED /* Missed DMA opportunity */ + _DRM_STAT_IRQ, /**< IRQ */ + _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ + _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ + _DRM_STAT_DMA, /**< DMA */ + _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ + _DRM_STAT_MISSED /**< Missed DMA opportunity */ /* Add to the *END* of the list */ } drm_stat_type_t; + +/** + * DRM_IOCTL_GET_STATS ioctl argument type. + */ typedef struct drm_stats { unsigned long count; struct { @@ -225,137 +290,220 @@ } data[15]; } drm_stats_t; + +/** + * Hardware locking flags. + */ typedef enum drm_lock_flags { - _DRM_LOCK_READY = 0x01, /* Wait until hardware is ready for DMA */ - _DRM_LOCK_QUIESCENT = 0x02, /* Wait until hardware quiescent */ - _DRM_LOCK_FLUSH = 0x04, /* Flush this context's DMA queue first */ - _DRM_LOCK_FLUSH_ALL = 0x08, /* Flush all DMA queues first */ + _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ + _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ + _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ + _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ /* These *HALT* flags aren't supported yet -- they will be used to support the full-screen DGA-like mode. */ - _DRM_HALT_ALL_QUEUES = 0x10, /* Halt all current and future queues */ - _DRM_HALT_CUR_QUEUES = 0x20 /* Halt all current queues */ + _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ + _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ } drm_lock_flags_t; + +/** + * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. + * + * \sa drmGetLock() and drmUnlock(). + */ typedef struct drm_lock { int context; drm_lock_flags_t flags; } drm_lock_t; -typedef enum drm_dma_flags { /* These values *MUST* match xf86drm.h */ - /* Flags for DMA buffer dispatch */ - _DRM_DMA_BLOCK = 0x01, /* Block until buffer dispatched. - Note, the buffer may not yet have - been processed by the hardware -- - getting a hardware lock with the - hardware quiescent will ensure - that the buffer has been - processed. */ - _DRM_DMA_WHILE_LOCKED = 0x02, /* Dispatch while lock held */ - _DRM_DMA_PRIORITY = 0x04, /* High priority dispatch */ + +/** + * DMA flags + * + * \warning + * These values \e must match xf86drm.h. + * + * \sa drm_dma. + */ +typedef enum drm_dma_flags { + /* Flags for DMA buffer dispatch */ + _DRM_DMA_BLOCK = 0x01, /**< + * Block until buffer dispatched. + * + * \note The buffer may not yet have + * been processed by the hardware -- + * getting a hardware lock with the + * hardware quiescent will ensure + * that the buffer has been + * processed. + */ + _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ + _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ - /* Flags for DMA buffer request */ - _DRM_DMA_WAIT = 0x10, /* Wait for free buffers */ - _DRM_DMA_SMALLER_OK = 0x20, /* Smaller-than-requested buffers ok */ - _DRM_DMA_LARGER_OK = 0x40 /* Larger-than-requested buffers ok */ + /* Flags for DMA buffer request */ + _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ + _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ + _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ } drm_dma_flags_t; + +/** + * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. + * + * \sa drmAddBufs(). + */ typedef struct drm_buf_desc { - int count; /* Number of buffers of this size */ - int size; /* Size in bytes */ - int low_mark; /* Low water mark */ - int high_mark; /* High water mark */ + int count; /**< Number of buffers of this size */ + int size; /**< Size in bytes */ + int low_mark; /**< Low water mark */ + int high_mark; /**< High water mark */ enum { - _DRM_PAGE_ALIGN = 0x01, /* Align on page boundaries for DMA */ - _DRM_AGP_BUFFER = 0x02, /* Buffer is in agp space */ - _DRM_SG_BUFFER = 0x04 /* Scatter/gather memory buffer */ + _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ + _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ + _DRM_SG_BUFFER = 0x04 /**< Scatter/gather memory buffer */ } flags; - unsigned long agp_start; /* Start address of where the agp buffers - * are in the agp aperture */ + unsigned long agp_start; /**< + * Start address of where the AGP buffers are + * in the AGP aperture + */ } drm_buf_desc_t; + +/** + * DRM_IOCTL_INFO_BUFS ioctl argument type. + */ typedef struct drm_buf_info { - int count; /* Entries in list */ + int count; /**< Entries in list */ drm_buf_desc_t *list; } drm_buf_info_t; + +/** + * DRM_IOCTL_FREE_BUFS ioctl argument type. + */ typedef struct drm_buf_free { int count; int *list; } drm_buf_free_t; + +/** + * Buffer information + * + * \sa drm_buf_map. + */ typedef struct drm_buf_pub { - int idx; /* Index into master buflist */ - int total; /* Buffer size */ - int used; /* Amount of buffer in use (for DMA) */ - void *address; /* Address of buffer */ + int idx; /**< Index into the master buffer list */ + int total; /**< Buffer size */ + int used; /**< Amount of buffer in use (for DMA) */ + void *address; /**< Address of buffer */ } drm_buf_pub_t; + +/** + * DRM_IOCTL_MAP_BUFS ioctl argument type. + */ typedef struct drm_buf_map { - int count; /* Length of buflist */ - void *virtual; /* Mmaped area in user-virtual */ - drm_buf_pub_t *list; /* Buffer information */ + int count; /**< Length of the buffer list */ + void *virtual; /**< Mmap'd area in user-virtual */ + drm_buf_pub_t *list; /**< Buffer information */ } drm_buf_map_t; + +/** + * DRM_IOCTL_DMA ioctl argument type. + * + * Indices here refer to the offset into the buffer list in drm_buf_get. + * + * \sa drmDMA(). + */ typedef struct drm_dma { - /* Indices here refer to the offset into - buflist in drm_buf_get_t. */ - int context; /* Context handle */ - int send_count; /* Number of buffers to send */ - int *send_indices; /* List of handles to buffers */ - int *send_sizes; /* Lengths of data to send */ - drm_dma_flags_t flags; /* Flags */ - int request_count; /* Number of buffers requested */ - int request_size; /* Desired size for buffers */ - int *request_indices; /* Buffer information */ + int context; /**< Context handle */ + int send_count; /**< Number of buffers to send */ + int *send_indices; /**< List of handles to buffers */ + int *send_sizes; /**< Lengths of data to send */ + drm_dma_flags_t flags; /**< Flags */ + int request_count; /**< Number of buffers requested */ + int request_size; /**< Desired size for buffers */ + int *request_indices; /**< Buffer information */ int *request_sizes; - int granted_count; /* Number of buffers granted */ + int granted_count; /**< Number of buffers granted */ } drm_dma_t; + typedef enum { _DRM_CONTEXT_PRESERVED = 0x01, _DRM_CONTEXT_2DONLY = 0x02 } drm_ctx_flags_t; + +/** + * DRM_IOCTL_ADD_CTX ioctl argument type. + * + * \sa drmCreateContext() and drmDestroyContext(). + */ typedef struct drm_ctx { drm_context_t handle; drm_ctx_flags_t flags; } drm_ctx_t; + +/** + * DRM_IOCTL_RES_CTX ioctl argument type. + */ typedef struct drm_ctx_res { int count; drm_ctx_t *contexts; } drm_ctx_res_t; + +/** + * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. >>> TRUNCATED FOR MAIL (1000 lines) <<<