From owner-freebsd-hackers Mon Mar 26 22:41: 6 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from one.net (ip-216-23-55-134.adsl.one.net [216.23.55.134]) by hub.freebsd.org (Postfix) with ESMTP id 54A4337B71B for ; Mon, 26 Mar 2001 22:41:02 -0800 (PST) (envelope-from cokane@one.net) Received: (from cokane@localhost) by one.net (8.11.3/8.11.3) id f2R6tO500947; Tue, 27 Mar 2001 01:55:24 -0500 (EST) (envelope-from cokane) Date: Tue, 27 Mar 2001 01:55:24 -0500 From: Coleman Kane To: Alfred Perlstein Cc: Roger Hardiman , hackers@FreeBSD.ORG Subject: Re: Porting a Linux driver to FreeBSD with ioctl return values Message-ID: <20010327015524.A863@cokane.yi.org> References: <3ABF45B6.DF5A0B7F@cs.strath.ac.uk> <20010326094016.C9431@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" X-Mailer: Mutt 1.0.1i In-Reply-To: <20010326094016.C9431@fw.wintelcom.net>; from bright@wintelcom.net on Mon, Mar 26, 2001 at 09:40:16AM -0800 X-Vim: vim:tw=70:ts=4:sw=4 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Yeah, that's basically what I had to do in tdfx. You can take a look int src/sys/dev/tdfx/tdfx_pci.c under tdfx_ioctl(...) to get an idea of what needs to be done, if you need more info. Tdfx basically implements the API from device_3dfx in Linux. Alfred Perlstein had the audacity to say: >=20 > * Roger Hardiman [010326 05:37] wrote: > > Hi, > > I'm porting the some linux telephony API drivers over > > to FreeBSD. > >=20 > > But the author of the linux driver used the 'hack' of > > returning values from the ioctls as the error result. > >=20 > > eg volume =3D ioctl (fd, IXJ_GET_VOLUME) > >=20 > > instead of using > > error =3D ioctl (fd, IXJ_GET_VOLUME, &volume); > >=20 > >=20 > > Naturally I want to keep the API the same on FreeBSD > > so existing apps will compile without change. > > But right now it looks like I cannot do this. > >=20 > > Is there anything I can do in the FreeBSD driver > > or in existing source to help, without imposing > > a new 'BSD' API. >=20 > I just woke up.... er, try this: >=20 > p->p_retval[0] =3D your_return_value; >=20 > in your ioctl code... or are you saying that the ioctl code > spams over it? >=20 > --=20 > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > Represent yourself, show up at BABUG http://www.babug.org/ >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message >=20 --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE6wDlbERViMObJ880RAUUPAJ4uyJAv1O1fv7Jfulh7RchiuFxx7QCgmrrJ E44VivqCPTk8oCXQdIECalU= =bTJ2 -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message