Index: drm_drv.h =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/drm_drv.h,v retrieving revision 1.4 diff -u -r1.4 drm_drv.h --- drm_drv.h 6 May 2002 19:31:27 -0000 1.4 +++ drm_drv.h 15 Aug 2002 23:35:30 -0000 @@ -138,7 +138,6 @@ #include #include #include -#include "dev/drm/drm_linux.h" #endif #endif /* __FreeBSD__ */ #endif @@ -1418,6 +1417,9 @@ #ifdef __FreeBSD__ #if DRM_LINUX +#define LINUX_IOCTL_DRM_MIN 0x6400 +#define LINUX_IOCTL_DRM_MAX 0x64ff + static linux_ioctl_function_t DRM( linux_ioctl); static struct linux_ioctl_handler DRM( handler) = {DRM( linux_ioctl), LINUX_IOCTL_DRM_MIN, LINUX_IOCTL_DRM_MAX}; SYSINIT (DRM( register), SI_SUB_KLD, SI_ORDER_MIDDLE, linux_ioctl_register_handler, &DRM( handler)); @@ -1430,7 +1432,8 @@ DRM(linux_ioctl)(DRM_OS_STRUCTPROC *p, struct linux_ioctl_args* args) { #if (__FreeBSD_version >= 500000) - struct file *fp = p->td_proc->p_fd->fd_ofiles[args->fd]; + struct file *fp; + int error; #else struct file *fp = p->p_fd->fd_ofiles[args->fd]; #endif @@ -1439,7 +1442,15 @@ /* * Pass the ioctl off to our standard handler. */ - return(fo_ioctl(fp, cmd, data, p)); +#if (__FreeBSD_version >= 500000) + if ((error = fget(p, args->fd, &fp)) != 0) + return (error); +#endif + error = fo_ioctl(fp, cmd, data, p); +#if (__FreeBSD_version >= 500000) + fdrop(fp, p); +#endif + return error; } #endif /* DRM_LINUX */ #endif /* __FreeBSD__ */