Deleted Added
full compact
tdfx_pci.c (112569) tdfx_pci.c (115494)
1/*
2 * Copyright (c) 2000-2001 by Coleman Kane <cokane@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
1/*
2 * Copyright (c) 2000-2001 by Coleman Kane <cokane@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $FreeBSD: head/sys/dev/tdfx/tdfx_pci.c 112569 2003-03-25 00:07:06Z jake $
31 * $FreeBSD: head/sys/dev/tdfx/tdfx_pci.c 115494 2003-05-31 18:57:41Z phk $
32 */
33
34/* 3dfx driver for FreeBSD 4.x - Finished 11 May 2000, 12:25AM ET
35 *
36 * Copyright (C) 2000-2001, by Coleman Kane <cokane@FreeBSD.org>,
37 * based upon the 3dfx driver written for linux, by Daryll Straus, Jon Taylor,
38 * and Jens Axboe, located at http://linux.3dfx.com.
39 */

--- 709 unchanged lines hidden (view full) ---

749 return tdfx_query_update(cmd, piod);
750 break;
751 default:
752 /* In case we are thrown a bogus sub-command! */
753#ifdef DEBUG
754 printf("Bad Sub-cmd: 0x%x\n", _IOC_NR(cmd));
755#endif
756 return -EINVAL;
32 */
33
34/* 3dfx driver for FreeBSD 4.x - Finished 11 May 2000, 12:25AM ET
35 *
36 * Copyright (C) 2000-2001, by Coleman Kane <cokane@FreeBSD.org>,
37 * based upon the 3dfx driver written for linux, by Daryll Straus, Jon Taylor,
38 * and Jens Axboe, located at http://linux.3dfx.com.
39 */

--- 709 unchanged lines hidden (view full) ---

749 return tdfx_query_update(cmd, piod);
750 break;
751 default:
752 /* In case we are thrown a bogus sub-command! */
753#ifdef DEBUG
754 printf("Bad Sub-cmd: 0x%x\n", _IOC_NR(cmd));
755#endif
756 return -EINVAL;
757 };
757 }
758}
759
760static int
761tdfx_do_pio(u_int cmd, struct tdfx_pio_data *piod)
762{
763 /* Two types of PIO, INPUT and OUTPUT, as the name suggests */
764 switch(_IOC_DIR(cmd)) {
765 case IOCV_OUT:
766 return tdfx_do_pio_rd(piod);
767 break;
768 case IOCV_IN:
769 return tdfx_do_pio_wt(piod);
770 break;
771 default:
772 return -EINVAL;
758}
759
760static int
761tdfx_do_pio(u_int cmd, struct tdfx_pio_data *piod)
762{
763 /* Two types of PIO, INPUT and OUTPUT, as the name suggests */
764 switch(_IOC_DIR(cmd)) {
765 case IOCV_OUT:
766 return tdfx_do_pio_rd(piod);
767 break;
768 case IOCV_IN:
769 return tdfx_do_pio_wt(piod);
770 break;
771 default:
772 return -EINVAL;
773 };
773 }
774}
775
776/* Calls to ioctl(2) eventually end up here. Unhandled ioctls return an ENXIO,
777 * normally, you would read in the data pointed to by data, then write your
778 * output to it. The ioctl *should* normally return zero if everything is
779 * alright, but 3dfx didn't make it that way...
780 *
781 * For all of the ioctl code, in the event of a real error,

--- 83 unchanged lines hidden ---
774}
775
776/* Calls to ioctl(2) eventually end up here. Unhandled ioctls return an ENXIO,
777 * normally, you would read in the data pointed to by data, then write your
778 * output to it. The ioctl *should* normally return zero if everything is
779 * alright, but 3dfx didn't make it that way...
780 *
781 * For all of the ioctl code, in the event of a real error,

--- 83 unchanged lines hidden ---