File trinity-r1254856-replace-linux-headers.diff of Package kdeutils3

Index: ciscode.h
===================================================================
--- ciscode.h	(revision 1054174)
+++ ciscode.h	(revision 1254856)
@@ -1,19 +1,15 @@
 /*
- * ciscode.h 1.31 1999/02/16 01:16:46
+ * ciscode.h
  *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License
- * at http://www.mozilla.org/MPL/
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and
- * limitations under the License. 
+ * The initial developer of the original code is David A. Hinds
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
  *
- * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * (C) 1999		David A. Hinds
  */
 
 #ifndef _LINUX_CISCODE_H
@@ -26,6 +22,9 @@
 #define PRODID_3COM_3CCFEM556		0x0556
 #define PRODID_3COM_3C562		0x0562
 
+#define MANFID_ACCTON			0x01bf
+#define PRODID_ACCTON_EN2226		0x010a
+
 #define MANFID_ADAPTEC			0x012f
 #define PRODID_ADAPTEC_SCSI		0x0001
 
@@ -46,6 +45,10 @@
 #define PRODID_INTEL_DUAL_RS232		0x0301
 #define PRODID_INTEL_2PLUS		0x8422
 
+#define MANFID_KME			0x0032
+#define PRODID_KME_KXLC005_A		0x0704
+#define PRODID_KME_KXLC005_B		0x2904
+
 #define MANFID_LINKSYS			0x0143
 #define PRODID_LINKSYS_PCMLM28		0xc0ab
 #define PRODID_LINKSYS_3400		0x3341
@@ -59,8 +62,14 @@
 #define MANFID_MOTOROLA			0x0109
 #define PRODID_MOTOROLA_MARINER		0x0501
 
+#define MANFID_NATINST			0x010b
+#define PRODID_NATINST_QUAD_RS232	0xd180
+
 #define MANFID_NEW_MEDIA		0x0057
 
+#define MANFID_NOKIA			0x0124
+#define PRODID_NOKIA_CARDPHONE		0x0900
+
 #define MANFID_OLICOM			0x0121
 #define PRODID_OLICOM_OC2231		0x3122
 #define PRODID_OLICOM_OC2232		0x3222
@@ -72,25 +81,51 @@
 #define PRODID_OSITECH_JACK_144		0x0001
 #define PRODID_OSITECH_JACK_288		0x0002
 #define PRODID_OSITECH_JACK_336		0x0007
+#define PRODID_OSITECH_SEVEN		0x0008
 
+#define MANFID_OXSEMI			0x0279
+
+#define MANFID_PIONEER			0x000b
+
 #define MANFID_PSION			0x016c
+#define PRODID_PSION_NET100		0x0023
 
 #define MANFID_QUATECH			0x0137
+#define PRODID_QUATECH_SPP100		0x0003
 #define PRODID_QUATECH_DUAL_RS232	0x0012
 #define PRODID_QUATECH_DUAL_RS232_D1	0x0007
+#define PRODID_QUATECH_DUAL_RS232_D2	0x0052
+#define PRODID_QUATECH_DUAL_RS232_G	0x004d
 #define PRODID_QUATECH_QUAD_RS232	0x001b
+#define PRODID_QUATECH_DUAL_RS422	0x000e
+#define PRODID_QUATECH_QUAD_RS422	0x0045
 
 #define MANFID_SMC			0x0108
 #define PRODID_SMC_ETHER		0x0105
 
 #define MANFID_SOCKET			0x0104
 #define PRODID_SOCKET_DUAL_RS232	0x0006
+#define PRODID_SOCKET_EIO		0x000a
 #define PRODID_SOCKET_LPE		0x000d
+#define PRODID_SOCKET_LPE_CF		0x0075
 
 #define MANFID_SUNDISK			0x0045
 
 #define MANFID_TDK			0x0105
+#define PRODID_TDK_CF010		0x0900
+#define PRODID_TDK_NP9610		0x0d0a
+#define PRODID_TDK_MN3200		0x0e0a
+#define PRODID_TDK_GN3410		0x4815
 
+#define MANFID_TOSHIBA			0x0098
+
+#define MANFID_UNGERMANN		0x02c0
+
 #define MANFID_XIRCOM			0x0105
 
+#define MANFID_POSSIO			0x030c
+#define PRODID_POSSIO_GCC		0x0003
+
+#define MANFID_NEC			0x0010
+
 #endif /* _LINUX_CISCODE_H */
Index: cs_types.h
===================================================================
--- cs_types.h	(revision 1054174)
+++ cs_types.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * cs_types.h 1.13 1998/07/14 00:52:20
+ * cs_types.h 1.18 2000/06/12 21:55:40
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,20 +12,42 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Contributor:  Apple Computer, Inc.  Portions � 2000 Apple Computer, 
+ * Inc. All rights reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_CS_TYPES_H
 #define _LINUX_CS_TYPES_H
 
 #ifdef __linux__
+#ifdef __KERNEL__
 #include <linux/types.h>
+#else
+#include <sys/types.h>
 #endif
+#endif
 
 typedef u_short	socket_t;
 typedef u_short	ioaddr_t;
+#ifdef __MACOSX__
+typedef u_int	cs_event_t;
+#else
 typedef u_int	event_t;
+#endif
 typedef u_char	cisdata_t;
 typedef u_short	page_t;
 
Index: bulkmem.h
===================================================================
--- bulkmem.h	(revision 1054174)
+++ bulkmem.h	(revision 1254856)
@@ -1,10 +1,10 @@
 /*
  * Definitions for bulk memory services
  *
- * bulkmem.h 1.8 1998/05/10 12:10:34
+ * bulkmem.h 1.12 2000/06/12 21:55:41
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -14,8 +14,22 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Contributor:  Apple Computer, Inc.  Portions � 2000 Apple Computer, 
+ * Inc. All rights reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  * bulkmem.h 1.3 1995/05/27 04:49:49
  */
 
Index: cisreg.h
===================================================================
--- cisreg.h	(revision 1054174)
+++ cisreg.h	(revision 1254856)
@@ -1,25 +1,23 @@
 /*
- * cisreg.h 1.11 1998/09/11 08:54:47
+ * cisreg.h
  *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License
- * at http://www.mozilla.org/MPL/
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and
- * limitations under the License. 
+ * The initial developer of the original code is David A. Hinds
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
  *
- * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * (C) 1999             David A. Hinds
  */
 
 #ifndef _LINUX_CISREG_H
 #define _LINUX_CISREG_H
 
-/* Offsets from ConfigBase for CIS registers */
+/*
+ * Offsets from ConfigBase for CIS registers
+ */
 #define CISREG_COR		0x00
 #define CISREG_CCSR		0x02
 #define CISREG_PRR		0x04
@@ -102,4 +100,21 @@
 #define FEMR_PWM_ENA		0x0040
 #define FEMR_WKUP_MASK		0x4000
 
+/*
+ * Indirect Addressing Registers for Zoomed Video: these are addresses
+ * in common memory space
+ */
+#define CISREG_ICTRL0		0x02	/* control registers */
+#define CISREG_ICTRL1		0x03
+#define CISREG_IADDR0		0x04	/* address registers */
+#define CISREG_IADDR1		0x05
+#define CISREG_IADDR2		0x06
+#define CISREG_IADDR3		0x07
+#define CISREG_IDATA0		0x08	/* data registers */
+#define CISREG_IDATA1		0x09
+
+#define ICTRL0_COMMON		0x01
+#define ICTRL0_AUTOINC		0x02
+#define ICTRL0_BYTEGRAN		0x04
+
 #endif /* _LINUX_CISREG_H */
Index: driver_ops.h
===================================================================
--- driver_ops.h	(revision 1054174)
+++ driver_ops.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * driver_ops.h 1.11 1998/11/18 07:01:50
+ * driver_ops.h 1.14 1999/10/25 20:23:17
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,8 +12,19 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dhinds@pcmcia.sourceforge.org>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_DRIVER_OPS_H
Index: mem_op.h
===================================================================
--- mem_op.h	(revision 1054174)
+++ mem_op.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * mem_op.h 1.8 1998/07/17 10:12:23
+ * mem_op.h 1.13 2000/06/12 21:55:40
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,13 +12,26 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_MEM_OP_H
 #define _LINUX_MEM_OP_H
 
+#include <asm/uaccess.h>
+
 /*
    If UNSAFE_MEMCPY is defined, we use the (optimized) system routines
    to copy between a card and kernel memory.  These routines do 32-bit
@@ -36,7 +49,7 @@
     size_t odd = (n & 3);
     n -= odd;
     while (n) {
-	put_user(readl_ns(from), (int *)to);
+	put_user(__raw_readl(from), (int *)to);
 	(char *)from += 4; (char *)to += 4; n -= 4;
     }
     while (odd--)
@@ -51,7 +64,7 @@
     n -= odd;
     while (n) {
 	get_user(l, (int *)from);
-	writel_ns(l, to);
+	__raw_writel(l, to);
 	(char *)to += 4; (char *)from += 4; n -= 4;
     }
     while (odd--) {
@@ -67,8 +80,10 @@
     size_t odd = (n & 1);
     n -= odd;
     while (n) {
-	*(u_short *)to = readw_ns(from);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	*(u_short *)to = __raw_readw(from);
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd)
 	*(u_char *)to = readb(from);
@@ -79,8 +94,10 @@
     size_t odd = (n & 1);
     n -= odd;
     while (n) {
-	writew_ns(*(u_short *)from, to);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	__raw_writew(*(u_short *)from, to);
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd)
 	writeb(*(u_char *)from, to);
@@ -91,8 +108,10 @@
     size_t odd = (n & 1);
     n -= odd;
     while (n) {
-	put_user(readw_ns(from), (short *)to);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	put_user(__raw_readw(from), (short *)to);
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd)
 	put_user(readb(from), (char *)to);
@@ -106,8 +125,10 @@
     n -= odd;
     while (n) {
 	get_user(s, (short *)from);
-	writew_ns(s, to);
-	(char *)to += 2; (char *)from += 2; n -= 2;
+	__raw_writew(s, to);
+	to = (void *)((long)to + 2);
+	from = (const void *)((long)from + 2);
+	n -= 2;
     }
     if (odd) {
 	get_user(c, (char *)from);
Index: k_compat.h
===================================================================
--- k_compat.h	(revision 1054174)
+++ k_compat.h	(revision 1254856)
@@ -1,246 +1,222 @@
-/*
- * k_compat.h 1.74 1999/01/07 03:46:29
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License
- * at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and
- * limitations under the License. 
- *
- * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
- */
+/*======================================================================
 
+    The contents of this file are subject to the Mozilla Public
+    License Version 1.1 (the "License"); you may not use this file
+    except in compliance with the License. You may obtain a copy of
+    the License at http://www.mozilla.org/MPL/
+
+    Software distributed under the License is distributed on an "AS
+    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    implied. See the License for the specific language governing
+    rights and limitations under the License.
+
+    The initial developer of the original code is David A. Hinds
+    <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+    are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+
+    Contributor:  Apple Computer, Inc.  Portions � 2000 Apple Computer, 
+    Inc. All rights reserved.
+
+    Alternatively, the contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL"), in which
+    case the provisions of the GPL are applicable instead of the
+    above.  If you wish to allow the use of your version of this file
+    only under the terms of the GPL and not to allow others to use
+    your version of this file under the MPL, indicate your decision
+    by deleting the provisions above and replace them with the notice
+    and other provisions required by the GPL.  If you do not delete
+    the provisions above, a recipient may use your version of this
+    file under either the MPL or the GPL.
+
+======================================================================*/
+
 #ifndef _LINUX_K_COMPAT_H
 #define _LINUX_K_COMPAT_H
 
-#define __LINUX__
-#define VERSION(v,p,s)		(((v)<<16)+(p<<8)+s)
+#include <IOKit/assert.h>
+#include <IOKit/IOLib.h>
+#include <libkern/OSByteOrder.h>
+#include <sys/errno.h>
 
-#define RUN_AT(x)		(jiffies+(x))
-#define CONST			const
-#define ALLOC_SKB(len)		dev_alloc_skb(len+2)
-#define DEVICE(req)		((req)->rq_dev)
-#define GET_PACKET(dev, skb, count) \
-		skb_reserve((skb), 2); \
-		BLOCK_INPUT(skb_put((skb), (count)), (count)); \
-		(skb)->protocol = eth_type_trans((skb), (dev))
+typedef unsigned char	u8;
+typedef unsigned short	u16;
+typedef unsigned int	u32;
 
-#define BLK_DEV_HDR		"linux/blk.h"
-#define NEW_MULTICAST
+#define printk IOLog
+#define KERN_INFO	"IOPCCard info:   "
+#define KERN_NOTICE	"IOPCCard notice: "
+#define KERN_DEBUG	"IOPCCard debug:  "
 
-#define FREE_IRQ(i,d)		free_irq(i, d)
-#define REQUEST_IRQ(i,h,f,n,d)	request_irq(i,h,f,n,d)
-#define IRQ(a,b,c)		(a,b,c)
-#define DEV_ID			dev_id
+#define MODULE_PARM(a,b)
+#define MODULE_AUTHOR(a)
+#define MODULE_DESCRIPTION(a)
 
-#if (LINUX_VERSION_CODE < VERSION(2,0,16))
-#define init_waitqueue(p)	(*(p) = NULL)
-#endif
+#define MOD_DEC_USE_COUNT
+#define MOD_INC_USE_COUNT
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,4)) && !defined(__alpha__)
-#define FS_SIZE_T		int
-#define U_FS_SIZE_T		int
-#else
-#if (LINUX_VERSION_CODE < VERSION(2,1,60))
-#define FS_SIZE_T		long
-#define U_FS_SIZE_T		unsigned long
-#else
-#define FS_SIZE_T		ssize_t
-#define U_FS_SIZE_T		size_t
-#endif
-#endif
+#define __init
+#define __exit
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,25))
-#define net_device_stats	enet_statistics
-#endif
+// we don't need these if we are always inside the workloop
+#define ACQUIRE_RESOURCE_LOCK
+#define RELEASE_RESOURCE_LOCK
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,31))
-#define FS_RELEASE_T		void
-#else
-#define FS_RELEASE_T		int
-#endif
+#define NR_IRQS			256
+#define PCI_INTERRUPT_LINE	0x3c
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,38))
-#define test_and_set_bit	set_bit
-#endif
+#define PCI_CACHE_LINE_SIZE	0xc
+#define PCI_LATENCY_TIMER	0xd
+#define PCI_BASE_ADDRESS_0	0x10
+#define PCI_COMMAND		0x4
+#define PCI_COMMAND_IO		0x1
+#define PCI_COMMAND_MEMORY	0x2
+#define PCI_COMMAND_MASTER	0x4
+#define PCI_COMMAND_WAIT	0x80
 
-#if (LINUX_VERSION_CODE > VERSION(2,1,16))
-#define AUTOCONF_INCLUDED
-#define EXPORT_SYMTAB
-#endif
-#ifdef CONFIG_MODVERSIONS
-#define MODVERSIONS 1
-#include <linux/modversions.h>
-#endif
-#include <linux/module.h>
+#define PCI_HEADER_TYPE		0xe
+#define PCI_CLASS_REVISION	0x8
+#define PCI_VENDOR_ID		0x0
+#define PCI_DEVICE_ID		0x2
+#define PCI_STATUS		0x6
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,18))
-#define MODULE_PARM(a,b)	extern int __bogus_decl
-#undef  GET_USE_COUNT
-#define GET_USE_COUNT(m)	mod_use_count_
-#endif
+#define PCI_CLASS_BRIDGE_CARDBUS	0x0607
+#define PCI_CLASS_BRIDGE_PCMCIA		0x0605
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,0))
-#define copy_from_user		memcpy_fromfs
-#define copy_to_user		memcpy_tofs
+#define PCI_BASE_ADDRESS_SPACE_IO 	0x1
+#define PCI_BASE_ADDRESS_SPACE_MEMORY	0x0
+#define PCI_BASE_ADDRESS_MEM_PREFETCH	0x8
+#define PCI_BASE_ADDRESS_MEM_MASK 	(~0x0fUL)
+#define PCI_BASE_ADDRESS_SPACE		0x1
+#define PCI_BASE_ADDRESS_IO_MASK	(~0x03UL)
+#define	PCI_INTERRUPT_PIN		0x3d
 
-#if (!defined(__alpha__) || (LINUX_VERSION_CODE < VERSION(2,0,34)))
-#define ioremap(a,b) \
-    (((a) < 0x100000) ? (void *)((u_long)(a)) : vremap(a,b))
-#define iounmap(v) \
-    do { if ((u_long)(v) > 0x100000) vfree(v); } while (0)
-#endif
-/* This is evil... throw away the built-in get_user in 2.0 */
-#include <asm/segment.h>
-#undef get_user
+struct pt_regs {};
 
-#ifdef __alpha__
-#define get_user(x, ptr) 	((x) = __get_user((ptr), sizeof(*(ptr))))
-#undef get_fs_long
-#undef put_fs_long
-#define get_fs_long(ptr)	__get_user((ptr), sizeof(int))
-#define put_fs_long(x, ptr)	__put_user((x), (ptr), sizeof(int))
-#else
-#define get_user(x, ptr) \
-		((sizeof(*ptr) == 4) ? (x = get_fs_long(ptr)) : \
-		 (sizeof(*ptr) == 2) ? (x = get_fs_word(ptr)) : \
-		 (x = get_fs_byte(ptr)))
-#endif
+#define HZ		100
 
-#else /* 2.1.X */
-#include <asm/uaccess.h>
-#endif
+extern void delay_for_interval(natural_t interval, natural_t scale_factor);
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,45))
-#define F_INODE(file)		((file)->f_inode)
-#else
-#define F_INODE(file)		((file)->f_dentry->d_inode)
-#endif
+#define mdelay(i)	delay_for_interval((i), kMillisecondScale)
+#define udelay(i)	delay_for_interval((i), kMicrosecondScale)
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,51))
-#define INVALIDATE_INODES(r)	invalidate_inodes(r)
-#else
-#define INVALIDATE_INODES(r) \
-		do { struct super_block *sb = get_super(r); \
-		if (sb) invalidate_inodes(sb); } while (0)
-#endif
+struct timer_list {
+        unsigned long expires;
+        void (*function)(unsigned long);
+        unsigned long data;
+};
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,60))
-#define IRQ_MAP(irq, dev)	irq2dev_map[irq] = dev
-#define FOPS(i,f,b,c,p)		(i,f,b,c)
-#define FPOS			(file->f_pos)
-#else
-#define IRQ_MAP(irq, dev)	while (0)
-#define FOPS(i,f,b,c,p)		(f,b,c,p)
-#define FPOS			(*ppos)
-#endif
+extern void IOPCCardAddTimer(struct timer_list * timer);
+extern int IOPCCardDeleteTimer(struct timer_list * timer);
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,68))
-#define signal_pending(cur)	((cur)->signal & ~(cur)->blocked)
-#endif
+#define jiffies (0)	// just cheat on the whole jiffies thing :-)
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,86))
-#define DEV_KFREE_SKB(skb)	dev_kfree_skb(skb, FREE_WRITE)
-#else
-#define DEV_KFREE_SKB(skb)	dev_kfree_skb(skb)
-#endif
+#define add_timer(t)	IOPCCardAddTimer(t)
+#define del_timer(t)	IOPCCardDeleteTimer(t)
+#define mod_timer(a, b)	do { del_timer(a); (a)->expires = (b); add_timer(a); } while (0)
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,89))
-#define POLL_WAIT(f, q, w)	poll_wait(q, w)
-#else
-#define POLL_WAIT(f, q, w)	poll_wait(f, q, w)
-#endif
+extern void *kern_os_malloc(size_t size);
+extern void *kern_os_realloc(void * addr, size_t size);
+extern void kern_os_free(void * addr);
 
-#include <asm/byteorder.h>
-#ifndef le16_to_cpu
-#define le16_to_cpu(x)		(x)
-#define le32_to_cpu(x)		(x)
-#define cpu_to_le16(x)		(x)
-#define cpu_to_le32(x)		(x)
-#endif
+#define kmalloc(s, x) kern_os_malloc(s)
+#define krealloc(a, s, x) kern_os_realloc(a, s)
+#define kfree(a) kern_os_free(a)
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,90))
-#define spin_lock(l) do { } while (0)
-#define spin_unlock(l) do { } while (0)
-#define spin_lock_irqsave(l,f) do { save_flags(f); cli(); } while (0)
-#define spin_unlock_irqrestore(l,f) do { restore_flags(f); } while (0)
-#else
-#include <asm/spinlock.h>
-#endif
+#define le16_to_cpu(x)	OSSwapLittleToHostInt16(x)
+#define le32_to_cpu(x)	OSSwapLittleToHostInt32(x)
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,104))
-#define mdelay(x) { int i; for (i=0;i<x;i++) udelay(1000); }
-#endif
+//MACOSXXX - all this needs to be cleaned up
+typedef struct wait_queue *wait_queue_head_t;
+#define init_waitqueue_head(p)	DEBUG(0, "init_waitqueue_head stubbed out!\n");
 
 #define wacquire(w)		do { } while (0)
 #define wrelease(w)		do { } while (0)
-#define wsleep(w)		interruptible_sleep_on(w)
-#define wakeup(w)		wake_up_interruptible(w)
-#define wsleeptimeout(w,t)	interruptible_sleep_on_timeout(w,t)
-#if (LINUX_VERSION_CODE < VERSION(2,1,127))
-#define interruptible_sleep_on_timeout(w,t) \
-    ({(current->timeout=jiffies+(t));wsleep(w);current->timeout;})
-#define schedule_timeout(t) \
-    do { current->timeout = jiffies+(t); schedule(); } while (0)
-#endif
+#define wsleep(w)		DEBUG(0, "wsleep stubbed out!\n");
+#define wsleeptimeout(w,t)	DEBUG(0, "wsleeptimeout stubbed out!\n");
+#define wakeup(w)		DEBUG(0, "wakeup stubbed out!\n");
 
-#include <asm/io.h>
-#ifndef readw_ns
-#ifdef __powerpc__
-#define readw_ns(p)		ld_be16((volatile unsigned short *)(p))
-#define readl_ns(p)		ld_be32((volatile unsigned *)(p))
-#define writew_ns(v,p)		st_le16((volatile unsigned short *)(p),(v))
-#define writel_ns(v,p)		st_le32((volatile unsigned *)(p),(v))
-#define inw_ns(p)		in_be16((unsigned short *)((p)+_IO_BASE))
-#define inl_ns(p)		in_be32((unsigned *)((p)+_IO_BASE))
-#define outw_ns(v,p)		out_be16((unsigned short *)((p)+_IO_BASE),(v))
-#define outl_ns(v,p)		out_be32((unsigned *)((p)+_IO_BASE),(v))
-#else
-#define readw_ns(p)		readw(p)
-#define readl_ns(p)		readl(p)
-#define writew_ns(v,p)		writew(v,p)
-#define writel_ns(v,p)		writel(v,p)
-#define inw_ns(p)		inw(p)
-#define inl_ns(p)		inl(p)
-#define outw_ns(v,p)		outw(v,p)
-#define outl_ns(v,p)		outl(v,p)
-#endif
-#endif
-#ifndef insw_ns
-#define insw_ns(p,b,l)		insw(p,b,l)
-#define insl_ns(p,b,l)		insl(p,b,l)
-#define outsw_ns(p,b,l)		outsw(p,b,l)
-#define outsl_ns(p,b,l)		outsl(p,b,l)
-#endif
+extern u_char IOPCCardReadByte(void *virt);
+extern u_long IOPCCardReadLong(void *virt);
+extern void IOPCCardWriteByte(void *virt, u_char value);
+extern void IOPCCardWriteLong(void *virt, u_int value);
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,93))
-#include <linux/bios32.h>
-#endif
-#include <linux/pci.h>
-#ifndef PCI_FUNC
-#define PCI_FUNC(devfn)		((devfn)&7)
-#define PCI_SLOT(devfn)		((devfn)>>3)
-#define PCI_DEVFN(dev,fn)	(((dev)<<3)|((fn)&7))
-#endif
+#define readb(a)		IOPCCardReadByte(a)
+#define readl(a)		IOPCCardReadLong(a)
+#define writeb(v, a)		IOPCCardWriteByte(a, v)
+#define writel(v, a)		IOPCCardWriteLong(a, v)
 
-#if (LINUX_VERSION_CODE > VERSION(2,1,117))
-#define NULL_FLUSH		NULL,
-#else
-#define NULL_FLUSH
-#endif
+extern void *IOPCCardIORemap(u_long paddr, u_long size);
+extern void IOPCCardIOUnmap(void *vaddr);
 
-#if (LINUX_VERSION_CODE < VERSION(2,1,126))
-#define SCSI_DISK0_MAJOR	SCSI_DISK_MAJOR
-#endif
+#define ioremap(p, s)	IOPCCardIORemap(p, s)
+#define iounmap(v)	IOPCCardIOUnmap(v)
 
-typedef unsigned long k_time_t;
-#define ACQUIRE_RESOURCE_LOCK do {} while (0)
-#define RELEASE_RESOURCE_LOCK do {} while (0)
+#ifdef IOPCCARD_IN_IOKIT_CODE
 
+class IOPCIDevice;
+class IOPCCardBridge;
+class IOCardBusDevice;
+class IOPCCard16Device;
+
+extern int init_i82365(IOPCCardBridge *bus, IOPCIDevice *bridge, IOVirtualAddress device_regs);
+extern int init_pcmcia_cs(void);
+
+#else /* !IOPCCARD_IN_IOKIT_CODE */
+
+typedef struct IOPCIDevice	IOPCIDevice;
+typedef struct IOPCCardBridge	IOPCCardBridge;
+#define        IOCardBusDevice	IOPCIDevice	// subclassing C style
+typedef struct IOPCCard16Device	IOPCCard16Device;
+
+extern IOCardBusDevice *IOPCCardCreateCardBusNub(IOPCCardBridge *bus, unsigned int socket, unsigned int function);
+extern void IOPCCardRetainNub(void *nub);
+extern void IOPCCardReleaseNub(void *nub);
+
+extern int IOPCCardAddCSCInterruptHandlers(IOPCCardBridge *bus, unsigned int socket, unsigned int irq,
+					   u_int (*top_handler)(u_int), u_int (*bottom_handler)(u_int), 
+					   u_int (*enable_functional)(u_int), u_int (*disable_functional)(u_int),
+					   const char* name);
+extern int IOPCCardRemoveCSCInterruptHandlers(IOPCCardBridge *bus, unsigned int socket);
+
+// MACOSXXX - i82365.c and cardbus.c currently use these differently :-)
+// the #defines are in those files for now
+extern int IOPCCardReadConfigByte(IOPCIDevice *bus, int r, u_char *v);
+extern int IOPCCardWriteConfigByte(IOPCIDevice *bus, int r, u_char v);
+extern int IOPCCardReadConfigWord(IOPCIDevice *bus, int r, u_short *v);
+extern int IOPCCardWriteConfigWord(IOPCIDevice *bus, int r, u_short v);
+extern int IOPCCardReadConfigLong(IOPCIDevice *bus, int r, u_int *v);
+extern int IOPCCardWriteConfigLong(IOPCIDevice *bus, int r, u_int v);
+
+// MACOSXXX these need to use IOPCCardBridge *bus, if we have multiple controllers
+// on different pci bridges, the current code breaks down, this is currently
+// not really an issue on laptops :-)
+
+extern int check_mem_region(u_long base, u_long num);
+extern void request_mem_region(u_long base, u_long num, char *name);
+extern void release_mem_region(u_long base, u_long num);
+
+extern int check_io_region(u_long base, u_long num);
+extern void request_io_region(u_long base, u_long num, char *name);
+extern void release_io_region(u_long base, u_long num);
+
+#define check_region(a, l) 	check_io_region(a, l)
+#define request_region(a, l, n)	request_io_region(a, l, n)
+#define release_region(a, l)	release_io_region(a, l)
+
+extern int configure_i82365(IOPCCardBridge *pccard_nub, IOPCIDevice *bridge_nub, void * device_regs);
+
+#endif /* IOPCCARD_IN_IOKIT_CODE */
+
+/* Flags for device state, from ds.h */
+#define DEV_PRESENT		0x01
+#define DEV_CONFIG		0x02
+#define DEV_STALE_CONFIG	0x04	/* release on close */
+#define DEV_STALE_LINK		0x08	/* detach on release */
+#define DEV_CONFIG_PENDING	0x10
+#define DEV_RELEASE_PENDING	0x20
+#define DEV_SUSPEND		0x40
+#define DEV_BUSY		0x80
+
+#define DEV_OK(state) (((state) & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))
+
 #endif /* _LINUX_K_COMPAT_H */
Index: cistpl.h
===================================================================
--- cistpl.h	(revision 1054174)
+++ cistpl.h	(revision 1254856)
@@ -1,19 +1,15 @@
 /*
- * cistpl.h 1.27 1998/09/30 18:08:46
+ * cistpl.h
  *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License
- * at http://www.mozilla.org/MPL/
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and
- * limitations under the License. 
+ * The initial developer of the original code is David A. Hinds
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
  *
- * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * (C) 1999             David A. Hinds
  */
 
 #ifndef _LINUX_CISTPL_H
@@ -22,10 +18,13 @@
 #define CISTPL_NULL		0x00
 #define CISTPL_DEVICE		0x01
 #define CISTPL_LONGLINK_CB	0x02
+#define CISTPL_INDIRECT		0x03
 #define CISTPL_CONFIG_CB	0x04
 #define CISTPL_CFTABLE_ENTRY_CB	0x05
 #define CISTPL_LONGLINK_MFC	0x06
 #define CISTPL_BAR		0x07
+#define CISTPL_PWR_MGMNT	0x08
+#define CISTPL_EXTDEVICE	0x09
 #define CISTPL_CHECKSUM		0x10
 #define CISTPL_LONGLINK_A	0x11
 #define CISTPL_LONGLINK_C	0x12
@@ -54,8 +53,10 @@
 #define CISTPL_BYTEORDER	0x43
 #define CISTPL_DATE		0x44
 #define CISTPL_BATTERY		0x45
+#define CISTPL_FORMAT_A		0x47
 /* Layer 3 tuples */
 #define CISTPL_ORG		0x46
+#define CISTPL_SPCL		0x90
 
 typedef struct cistpl_longlink_t {
     u_int	addr;
@@ -161,7 +162,7 @@
 
 typedef struct cistpl_funce_t {
     u_char	type;
-    u_char	data[1];
+    u_char	data[0];
 } cistpl_funce_t;
 
 /*======================================================================
@@ -170,24 +171,25 @@
 
 ======================================================================*/
 
-#define CISTPL_FUNCE_SERIAL		0x00
-#define CISTPL_FUNCE_SERIAL_DATA	0x08
-#define CISTPL_FUNCE_SERIAL_FAX		0x09
-#define CISTPL_FUNCE_SERIAL_VOICE	0x0a
-#define CISTPL_FUNCE_CAP		0x01
-#define CISTPL_FUNCE_CAP_DATA		0x05
-#define CISTPL_FUNCE_CAP_FAX		0x06
-#define CISTPL_FUNCE_CAP_VOICE		0x07
-#define CISTPL_FUNCE_SERV_DATA		0x02
-#define CISTPL_FUNCE_SERV_FAX_1		0x13
-#define CISTPL_FUNCE_SERV_FAX_2		0x23
-#define CISTPL_FUNCE_SERV_FAX_3		0x33
-#define CISTPL_FUNCE_SERV_VOICE		0x84
+#define CISTPL_FUNCE_SERIAL_IF		0x00
+#define CISTPL_FUNCE_SERIAL_CAP		0x01
+#define CISTPL_FUNCE_SERIAL_SERV_DATA	0x02
+#define CISTPL_FUNCE_SERIAL_SERV_FAX	0x03
+#define CISTPL_FUNCE_SERIAL_SERV_VOICE	0x04
+#define CISTPL_FUNCE_SERIAL_CAP_DATA	0x05
+#define CISTPL_FUNCE_SERIAL_CAP_FAX	0x06
+#define CISTPL_FUNCE_SERIAL_CAP_VOICE	0x07
+#define CISTPL_FUNCE_SERIAL_IF_DATA	0x08
+#define CISTPL_FUNCE_SERIAL_IF_FAX	0x09
+#define CISTPL_FUNCE_SERIAL_IF_VOICE	0x0a
 
 /* UART identification */
 #define CISTPL_SERIAL_UART_8250		0x00
 #define CISTPL_SERIAL_UART_16450	0x01
 #define CISTPL_SERIAL_UART_16550	0x02
+#define CISTPL_SERIAL_UART_8251		0x03
+#define CISTPL_SERIAL_UART_8530		0x04
+#define CISTPL_SERIAL_UART_85230	0x05
 
 /* UART capabilities */
 #define CISTPL_SERIAL_UART_SPACE	0x01
@@ -211,10 +213,38 @@
 typedef struct cistpl_modem_cap_t {
     u_char	flow;
     u_char	cmd_buf;
-    u_int	rcv_buf:24;
-    u_int	xmit_buf:24;
+    u_char	rcv_buf_0, rcv_buf_1, rcv_buf_2;
+    u_char	xmit_buf_0, xmit_buf_1, xmit_buf_2;
 } cistpl_modem_cap_t;
 
+#define CISTPL_SERIAL_MOD_103		0x01
+#define CISTPL_SERIAL_MOD_V21		0x02
+#define CISTPL_SERIAL_MOD_V23		0x04
+#define CISTPL_SERIAL_MOD_V22		0x08
+#define CISTPL_SERIAL_MOD_212A		0x10
+#define CISTPL_SERIAL_MOD_V22BIS	0x20
+#define CISTPL_SERIAL_MOD_V26		0x40
+#define CISTPL_SERIAL_MOD_V26BIS	0x80
+#define CISTPL_SERIAL_MOD_V27BIS	0x01
+#define CISTPL_SERIAL_MOD_V29		0x02
+#define CISTPL_SERIAL_MOD_V32		0x04
+#define CISTPL_SERIAL_MOD_V32BIS	0x08
+#define CISTPL_SERIAL_MOD_V34		0x10
+
+#define CISTPL_SERIAL_ERR_MNP2_4	0x01
+#define CISTPL_SERIAL_ERR_V42_LAPM	0x02
+
+#define CISTPL_SERIAL_CMPR_V42BIS	0x01
+#define CISTPL_SERIAL_CMPR_MNP5		0x02
+
+#define CISTPL_SERIAL_CMD_AT1		0x01
+#define CISTPL_SERIAL_CMD_AT2		0x02
+#define CISTPL_SERIAL_CMD_AT3		0x04
+#define CISTPL_SERIAL_CMD_MNP_AT	0x08
+#define CISTPL_SERIAL_CMD_V25BIS	0x10
+#define CISTPL_SERIAL_CMD_V25A		0x20
+#define CISTPL_SERIAL_CMD_DMCL		0x40
+
 typedef struct cistpl_data_serv_t {
     u_char	max_data_0;
     u_char	max_data_1;
@@ -226,7 +256,7 @@
     u_char	escape;
     u_char	encrypt;
     u_char	misc_features;
-    u_char	ccitt_code[1];
+    u_char	ccitt_code[0];
 } cistpl_data_serv_t;
 
 typedef struct cistpl_fax_serv_t {
@@ -236,7 +266,7 @@
     u_char	encrypt;
     u_char	features_0;
     u_char	features_1;
-    u_char	ccitt_code[1];
+    u_char	ccitt_code[0];
 } cistpl_fax_serv_t;
 
 typedef struct cistpl_voice_serv_t {
@@ -486,6 +516,21 @@
 #define CISTPL_ORG_APPSPEC	0x01
 #define CISTPL_ORG_XIP		0x02
 
+typedef struct cistpl_format_t {
+    u_char	type;
+    u_char	edc;
+    u_int	offset;
+    u_int	length;
+} cistpl_format_t;
+
+#define CISTPL_FORMAT_DISK	0x00
+#define CISTPL_FORMAT_MEM	0x01
+
+#define CISTPL_EDC_NONE		0x00
+#define CISTPL_EDC_CKSUM	0x01
+#define CISTPL_EDC_CRC		0x02
+#define CISTPL_EDC_PCC		0x03
+
 typedef union cisparse_t {
     cistpl_device_t		device;
     cistpl_checksum_t		checksum;
@@ -504,6 +549,7 @@
     cistpl_device_geo_t		device_geo;
     cistpl_vers_2_t		vers_2;
     cistpl_org_t		org;
+    cistpl_format_t		format;
 } cisparse_t;
 
 typedef struct tuple_t {
@@ -540,4 +586,20 @@
     cisdata_t	Data[CISTPL_MAX_CIS_SIZE];
 } cisdump_t;
 
+int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple);
+int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
+int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple);
+int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse);
+
+int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info);
+int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis);
+
+/* don't use outside of PCMCIA core yet */
+int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *tuple);
+int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple);
+int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
+int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
+
+int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info);
+
 #endif /* LINUX_CISTPL_H */
Index: cs.h
===================================================================
--- cs.h	(revision 1054174)
+++ cs.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * cs.h 1.63 1998/12/09 07:36:24
+ * cs.h 1.71 2000/08/29 00:54:20
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,8 +12,22 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Contributor:  Apple Computer, Inc.  Portions � 2000 Apple Computer, 
+ * Inc. All rights reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_CS_H
@@ -52,6 +66,10 @@
     } resource;
 } adjust_t;
 
+#ifdef __MACOSX__
+#define CS_ADJUST_FAKE_HANDLE ((void *)0x12345678)
+#endif
+
 /* Action field */
 #define REMOVE_MANAGED_RESOURCE		1
 #define ADD_MANAGED_RESOURCE		2
@@ -87,6 +105,7 @@
     void	*buffer;
     void	*misc;
     void	*client_data;
+    struct bus_operations *bus;
 } event_callback_args_t;
 
 /* for GetConfigurationInfo */
@@ -108,6 +127,10 @@
     ioaddr_t	NumPorts2;
     u_int	Attributes2;
     u_int	IOAddrLines;
+#ifdef __MACOSX__
+    void *	PCCardNub;
+    void *	CardBusNub;	// per function
+#endif
 } config_info_t;
 
 /* For CardValues field */
@@ -130,8 +153,13 @@
     dev_info_t	*dev_info;
     u_int	Attributes;
     u_int	EventMask;
+#ifdef __MACOSX__
+    int		(*event_handler)(cs_event_t event, int priority,
+				 event_callback_args_t *);
+#else
     int		(*event_handler)(event_t event, int priority,
 				 event_callback_args_t *);
+#endif
     event_callback_args_t event_callback_args;
     u_int	Version;
 } client_reg_t;
@@ -239,12 +267,7 @@
 #define PRESENT_IOBASE_3	0x100
 #define PRESENT_IOSIZE		0x200
 
-/* Attributes for Request/GetConfiguration */
-#define CONF_ENABLE_IRQ		0x01
-#define EXCLUSIVE_USE		0x02
-#define VALID_CLIENT		0x04
-
-/* For MapMemPage */
+/* For GetMemPage, MapMemPage */
 typedef struct memreq_t {
     u_int	CardOffset;
     page_t	Page;
@@ -280,6 +303,7 @@
 #define WIN_SHARED		0x0040
 #define WIN_FIRST_SHARED	0x0080
 #define WIN_USE_WAIT		0x0100
+#define WIN_STRICT_ALIGN	0x0200
 #define WIN_MAP_BELOW_1MB	0x0400
 #define WIN_PREFETCH		0x0800
 #define WIN_CACHEABLE		0x1000
@@ -298,8 +322,13 @@
 
 typedef struct cs_status_t {
     u_char	Function;
+#ifdef __MACOSX__
+    cs_event_t 	CardState;
+    cs_event_t	SocketState;
+#else
     event_t 	CardState;
     event_t	SocketState;
+#endif
 } cs_status_t;
 
 typedef struct error_info_t {
@@ -386,14 +415,21 @@
 
 #define CS_BAD_TUPLE		0x40
 
-#ifdef __KERNEL__
 
+//MACOSX #ifdef __KERNEL__
+#ifdef KERNEL
+
+
 /*
  *  Calls to set up low-level "Socket Services" drivers
  */
 
 typedef int (*ss_entry_t)(u_int sock, u_int cmd, void *arg);
+#ifdef __MACOSX__
+extern int register_ss_entry(int ssock, int esock, ss_entry_t entry);
+#else
 extern int register_ss_entry(int nsock, ss_entry_t entry);
+#endif
 extern void unregister_ss_entry(ss_entry_t entry);
 
 /*
@@ -417,14 +453,19 @@
     RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
     SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
     WriteMemory, BindDevice, BindMTD, ReportError,
-    SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS
+    SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
+    GetFirstWindow, GetNextWindow, GetMemPage
 };
 
 #ifdef IN_CARD_SERVICES
 extern int CardServices(int func, void *a1, void *a2, void *a3);
 #else
+#ifndef __MACOSX__  
+// for macosx we disable direct access to CardServices() call,
+// drivers should instead go thru the device nub (ie, the workloop)
 extern int CardServices(int func, ...);
 #endif
+#endif
 
 #ifdef __BEOS__
 #define SS_MODULE_NAME(s)	("busses/pcmcia/" s "/v1")
Index: ftl.h
===================================================================
--- ftl.h	(revision 1054174)
+++ ftl.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * ftl.h 1.4 1998/05/10 12:10:34
+ * ftl.h 1.8 2000/06/12 21:55:40
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,8 +12,19 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_FTL_H
Index: ss.h
===================================================================
--- ss.h	(revision 1054174)
+++ ss.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * ss.h 1.18 1998/10/01 20:54:49
+ * ss.h 1.28 2000/06/12 21:55:40
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,8 +12,22 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Contributor:  Apple Computer, Inc.  Portions � 2000 Apple Computer, 
+ * Inc. All rights reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_SS_H
@@ -40,6 +54,7 @@
 #define SS_CARDBUS	0x0800
 #define SS_3VCARD	0x1000
 #define SS_XVCARD	0x2000
+#define SS_PENDING	0x4000
 
 /* for InquireSocket */
 typedef struct socket_cap_t {
@@ -48,10 +63,23 @@
     u_int	map_size;
     u_char	pci_irq;
     u_char	cardbus;
+#ifdef __MACOSX__
+    IOPCIDevice		*bridge_nub;
+    IOPCCardBridge	*pccard_nub;
+    IOCardBusDevice	*cardbus_nub[8];
+#else
+    struct pci_bus *cb_bus;
+    struct bus_operations *bus;
+#endif
 } socket_cap_t;
 
-/* InquireSocket features */
-#define SS_HAS_PAGE_REGS	0x0001
+/* InquireSocket capabilities */
+#define SS_CAP_PAGE_REGS	0x0001
+#define SS_CAP_VIRTUAL_BUS	0x0002
+#define SS_CAP_MEM_ALIGN	0x0004
+#define SS_CAP_STATIC_MAP	0x0008
+#define SS_CAP_PCCARD		0x4000
+#define SS_CAP_CARDBUS		0x8000
 
 /* for GetSocket, SetSocket */
 typedef struct socket_state_t {
@@ -61,7 +89,7 @@
     u_char	io_irq;
 } socket_state_t;
 
-/* Various card configuration flags */
+/* Socket configuration flags */
 #define SS_PWR_AUTO	0x0010
 #define SS_IOCARD	0x0020
 #define SS_RESET	0x0040
Index: ds.h
===================================================================
--- ds.h	(revision 1054174)
+++ ds.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * ds.h 1.49 1998/08/03 19:12:23
+ * ds.h 1.55 1999/10/25 20:23:17
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,8 +12,19 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dhinds@pcmcia.sourceforge.org>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU Public License version 2 (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_DS_H
@@ -28,6 +39,12 @@
     cisparse_t		parse;
 } tuple_parse_t;
 
+typedef struct win_info_t {
+    window_handle_t	handle;
+    win_req_t		window;
+    memreq_t		map;
+} win_info_t;
+    
 typedef struct bind_info_t {
     dev_info_t		dev_info;
     u_char		function;
@@ -56,6 +73,7 @@
     region_info_t	region;
     bind_info_t		bind_info;
     mtd_info_t		mtd_info;
+    win_info_t		win_info;
     cisdump_t		cisdump;
 } ds_ioctl_arg_t;
 
@@ -77,6 +95,9 @@
 #define DS_GET_FIRST_REGION		_IOWR('d', 16, region_info_t)
 #define DS_GET_NEXT_REGION		_IOWR('d', 17, region_info_t)
 #define DS_REPLACE_CIS			_IOWR('d', 18, cisdump_t)
+#define DS_GET_FIRST_WINDOW		_IOR ('d', 19, win_info_t)
+#define DS_GET_NEXT_WINDOW		_IOWR('d', 20, win_info_t)
+#define DS_GET_MEM_PAGE			_IOWR('d', 21, win_info_t)
 
 #define DS_BIND_REQUEST			_IOWR('d', 60, bind_info_t)
 #define DS_GET_DEVICE_INFO		_IOWR('d', 61, bind_info_t) 
@@ -89,7 +110,7 @@
 typedef struct dev_link_t {
     dev_node_t		*dev;
     u_int		state, open;
-    struct wait_queue	*pending;
+    wait_queue_head_t	pending;
     struct timer_list	release;
     client_handle_t	handle;
     io_req_t		io;
Index: memory.h
===================================================================
--- memory.h	(revision 1054174)
+++ memory.h	(revision 1254856)
@@ -1,8 +1,8 @@
 /*
- * memory.h 1.3 1998/05/10 12:10:34
+ * memory.h 1.8 2001/08/24 12:16:13
  *
  * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
+ * Version 1.1 (the "License"); you may not use this file except in
  * compliance with the License. You may obtain a copy of the License
  * at http://www.mozilla.org/MPL/
  *
@@ -12,8 +12,19 @@
  * limitations under the License. 
  *
  * The initial developer of the original code is David A. Hinds
- * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
- * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
+ * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License version 2 (the "GPL"), in
+ * which case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use
+ * your version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
  */
 
 #ifndef _LINUX_MEMORY_H
openSUSE Build Service is sponsored by