summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/802_11.h191
-rw-r--r--include/linux/acpi.h90
-rw-r--r--include/linux/agp_backend.h224
-rw-r--r--include/linux/agpgart.h216
-rw-r--r--include/linux/blk.h10
-rw-r--r--include/linux/blkdev.h67
-rw-r--r--include/linux/bootmem.h32
-rw-r--r--include/linux/cache.h28
-rw-r--r--include/linux/cdrom.h59
-rw-r--r--include/linux/coda_proc.h8
-rw-r--r--include/linux/cycx_drv.h1
-rw-r--r--include/linux/ext2_fs.h1
-rw-r--r--include/linux/fb.h69
-rw-r--r--include/linux/fs.h42
-rw-r--r--include/linux/ftape.h3
-rw-r--r--include/linux/highmem.h3
-rw-r--r--include/linux/i2c.h1
-rw-r--r--include/linux/ide.h97
-rw-r--r--include/linux/if_arp.h2
-rw-r--r--include/linux/ioport.h4
-rw-r--r--include/linux/ipc.h4
-rw-r--r--include/linux/irq.h23
-rw-r--r--include/linux/isapnp.h1
-rw-r--r--include/linux/iso_fs.h2
-rw-r--r--include/linux/joystick.h115
-rw-r--r--include/linux/mm.h126
-rw-r--r--include/linux/mman.h1
-rw-r--r--include/linux/mmzone.h115
-rw-r--r--include/linux/module.h4
-rw-r--r--include/linux/mount.h5
-rw-r--r--include/linux/msg.h2
-rw-r--r--include/linux/ncp_fs.h56
-rw-r--r--include/linux/ncp_fs_sb.h26
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/nfs.h80
-rw-r--r--include/linux/nfs3.h61
-rw-r--r--include/linux/nfs_fs.h4
-rw-r--r--include/linux/nfsd/const.h54
-rw-r--r--include/linux/nfsd/export.h11
-rw-r--r--include/linux/nfsd/nfsd.h26
-rw-r--r--include/linux/nfsd/nfsfh.h140
-rw-r--r--include/linux/nfsd/stats.h8
-rw-r--r--include/linux/nfsd/syscall.h11
-rw-r--r--include/linux/nfsd/xdr3.h116
-rw-r--r--include/linux/nls.h3
-rw-r--r--include/linux/pagemap.h8
-rw-r--r--include/linux/pci.h12
-rw-r--r--include/linux/pci_ids.h133
-rw-r--r--include/linux/pipe_fs_i.h4
-rw-r--r--include/linux/proc_fs.h97
-rw-r--r--include/linux/quota.h6
-rw-r--r--include/linux/quotaops.h27
-rw-r--r--include/linux/resource.h7
-rw-r--r--include/linux/sched.h16
-rw-r--r--include/linux/serial.h8
-rw-r--r--include/linux/serialP.h11
-rw-r--r--include/linux/slab.h2
-rw-r--r--include/linux/swap.h19
-rw-r--r--include/linux/sysctl.h6
-rw-r--r--include/linux/udf_fs.h4
-rw-r--r--include/linux/ufs_fs.h1
-rw-r--r--include/linux/umsdos_fs.h2
-rw-r--r--include/linux/umsdos_fs_i.h10
-rw-r--r--include/linux/videodev.h3
-rw-r--r--include/linux/vmalloc.h6
-rw-r--r--include/linux/wanrouter.h2
-rw-r--r--include/linux/wireless.h147
67 files changed, 1892 insertions, 783 deletions
diff --git a/include/linux/802_11.h b/include/linux/802_11.h
new file mode 100644
index 000000000..cff47601a
--- /dev/null
+++ b/include/linux/802_11.h
@@ -0,0 +1,191 @@
+#ifndef IEEE_802_11
+#define IEEE_802_11
+
+#include <linux/types.h>
+
+enum ieee_802_11_link_status_failure_reason {
+ reserved0, Unspecified=1, Previous_not_valid,
+ Sender_Quits_ESS_or_IBSS,
+ Due_Inactivity, AP_Overload,
+ Class_2_from_NonAuth,
+ Class_3_from_NonAuth,
+ Sender_Quits_BSS,
+ Association_requester_not_authenticated,
+ Reserved10
+};
+
+
+#define IEEE_802_11_LINK_STATUS_FAILURE_REASON_STRINGS \
+{ \
+ {reserved0, 0xff," Reserved reason "},\
+ {Unspecified, 0xff," Unspecified Reason "},\
+ {Previous_not_valid, 0xff," Previous Authentication no longer valid "},\
+ {Sender_Quits_ESS_or_IBSS,0xff," Deauthenticated because sending station is leaving (has left) IBSS or ESS "},\
+ {Due_Inactivity, 0xff," Disassociated due to inactivity "},\
+ {AP_Overload, 0xff," Disassociated because AP is unable to handle all currently associated stations "},\
+ {Class_2_from_NonAuth, 0xff," Class 2 frame received from non-Authenticated station"},\
+ {Class_3_from_NonAuth, 0xff," Class 3 frame received from non­Associated station"},\
+ {Sender_Quits_BSS, 0xff," Disassociated because sending station is leaving (has left) BSS"},\
+ {Association_requester_not_authenticated,0xff," Station requesting (Re)Association is not Authenticated with responding station"},\
+ {Reserved10, 0xff," Reserved"},\
+ {0,0,NULL}\
+};
+
+
+
+struct ieee_802_11_header {
+ u16 frame_control;// needs to be subtyped
+ u16 duration;
+ u8 mac1[6];
+ u8 mac2[6];
+ u8 mac3[6];
+ u16 SeqCtl;
+ u8 mac4[6];
+ u16 gapLen;
+ u8 gap[8];
+};
+
+
+struct ieee_802_3_header {
+
+ u16 status;
+ u16 payload_length;
+ u8 dst_mac[6];
+ u8 src_mac[6];
+
+};
+
+#define P80211_OUI_LEN 3
+
+struct ieee_802_11_snap_header {
+
+ u8 dsap; /* always 0xAA */
+ u8 ssap; /* always 0xAA */
+ u8 ctrl; /* always 0x03 */
+ u8 oui[P80211_OUI_LEN]; /* organizational universal id */
+
+} __attribute__ ((packed));
+
+#define P80211_LLC_OUI_LEN 3
+
+struct ieee_802_11_802_1H_header {
+
+ u8 dsap;
+ u8 ssap; /* always 0xAA */
+ u8 ctrl; /* always 0x03 */
+ u8 oui[P80211_OUI_LEN]; /* organizational universal id */
+ u16 unknown1; /* packet type ID fields */
+ u16 unknown2; /* here is something like length in some cases */
+} __attribute__ ((packed));
+
+struct ieee_802_11_802_2_header {
+
+ u8 dsap;
+ u8 ssap; /* always 0xAA */
+ u8 ctrl; /* always 0x03 */
+ u8 oui[P80211_OUI_LEN]; /* organizational universal id */
+ u8 type; /* packet type ID field. i guess, */
+
+} __attribute__ ((packed));
+
+
+
+// following is incoplete and may be incorrect and need reorganization
+
+#define ieee_802_11_frame_type_Management 0x00
+#define ieee_802_11_frame_type_Control 0x01
+#define ieee_802_11_frame_type_Data 0x10
+#define ieee_802_11_frame_type_Reserved 0x11
+
+#define ieee_802_11_frame_subtype_Association_Req 0x0 // Association Request
+#define ieee_802_11_frame_subtype_Association_Resp 0x1 // Association Response
+#define ieee_802_11_frame_subtype_Reassociation_Req 0x2 // Reassociation Request
+#define ieee_802_11_frame_subtype_Reassociation_Resp 0x3 // Reassociation Response
+#define ieee_802_11_frame_subtype_Probe_Req 0x4 // Probe Request
+#define ieee_802_11_frame_subtype_Probe_Resp 0x5 // Probe Response
+#define ieee_802_11_frame_subtype_Beacon 0x8 // Beacon
+#define ieee_802_11_frame_subtype_ATIM 0x9 // ATIM
+#define ieee_802_11_frame_subtype_Disassociation 0xA // Disassociation
+#define ieee_802_11_frame_subtype_Authentication 0xB // Authentication
+#define ieee_802_11_frame_subtype_Deauthentication 0xC // Deauthentication
+#define ieee_802_11_frame_subtype_PS_Poll 0xA // PS-Poll
+#define ieee_802_11_frame_subtype_RTS 0xB // RTS
+#define ieee_802_11_frame_subtype_CTS 0xC // CTS
+#define ieee_802_11_frame_subtype_ACK 0xD // ACK
+#define ieee_802_11_frame_subtype_CFEnd 0xE // CF-End
+#define ieee_802_11_frame_subtype_CFEnd_CFAck 0xF // CF-End + CF-Ack
+#define ieee_802_11_frame_subtype_Data 0x0 // Data
+#define ieee_802_11_frame_subtype_Data_CFAck 0x1 // Data + CF-Ack
+#define ieee_802_11_frame_subtype_Data_CF_Poll 0x2 // Data + CF-Poll
+#define ieee_802_11_frame_subtype_Data_CF_AckCF_Poll 0x3 // Data + CF-Ack + CF-Poll
+#define ieee_802_11_frame_subtype_NullFunction 0x4 // Null Function (no data)
+#define ieee_802_11_frame_subtype_CF_Ack 0x5 // CF-Ack (no data)
+#define ieee_802_11_frame_subtype_CF_Poll 0x6 // CF-Poll (no data)
+#define ieee_802_11_frame_subtype_CF_AckCF_Poll 0x7 // CF-Ack + CF-Poll (no data)
+
+
+#define ieee_802_11_frame_subtype_strings {\
+ { ieee_802_11_frame_subtype_Association_Req, 0xF,"f Association Request"},\
+ { ieee_802_11_frame_subtype_Association_Resp, 0xF,"1 Association Response"},\
+ { ieee_802_11_frame_subtype_Reassociation_Req, 0xF,"2 Reassociation Request"},\
+ { ieee_802_11_frame_subtype_Reassociation_Resp, 0xF,"3 Reassociation Response"},\
+ { ieee_802_11_frame_subtype_Probe_Req , 0xF,"4 Probe Request"},\
+ { ieee_802_11_frame_subtype_Probe_Resp , 0xF,"5 Probe Response"},\
+ { ieee_802_11_frame_subtype_Beacon , 0xF,"8 Beacon"},\
+ { ieee_802_11_frame_subtype_ATIM , 0xF,"9 ATIM"},\
+ { ieee_802_11_frame_subtype_Disassociation, 0xF,"A Disassociation"},\
+ { ieee_802_11_frame_subtype_Authentication, 0xF,"B Authentication"},\
+ { ieee_802_11_frame_subtype_Deauthentication, 0xF,"C Deauthentication"},\
+ { ieee_802_11_frame_subtype_PS_Poll , 0xF,"A PS-Poll"},\
+ { ieee_802_11_frame_subtype_RTS , 0xF,"B RTS"},\
+ { ieee_802_11_frame_subtype_CTS , 0xF,"C CTS"},\
+ { ieee_802_11_frame_subtype_ACK , 0xF,"D ACK"},\
+ { ieee_802_11_frame_subtype_CFEnd , 0xF,"E CF-End"},\
+ { ieee_802_11_frame_subtype_CFEnd_CFAck , 0xF,"F CF-End + CF-Ack"},\
+ { ieee_802_11_frame_subtype_Data , 0xF,"0 Data"},\
+ { ieee_802_11_frame_subtype_Data_CFAck , 0xF,"1 Data + CF-Ack"},\
+ { ieee_802_11_frame_subtype_Data_CFPoll , 0xF,"2 Data + CF-Poll"},\
+ { ieee_802_11_frame_subtype_Data_CFAck_CFPoll, 0xF,"3 Data + CF-Ack + CF-Poll"},\
+ { ieee_802_11_frame_subtype_Null_Function , 0xF,"4 Null Function (no data)"},\
+ { ieee_802_11_frame_subtype_CFAck , 0xF,"5 CF-Ack (no data)"},\
+ { ieee_802_11_frame_subtype_CFPoll , 0xF,"6 CF-Poll (no data)"},\
+ { ieee_802_11_frame_subtype_CFAck_CFPoll, 0xF,"y7 CF-Ack + CF-Poll (no data)"},\
+ { 0,0,NULL}\
+}
+struct ieee_802_11_frame_subtype_class {
+ u8 subtype;
+ u8 mask;
+ u8 class;
+ u8 type;
+};
+#define ieee_802_11_frame_subtype_classes {\
+ { ieee_802_11_frame_subtype_Association_Req, 0xF,2,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Association_Resp, 0xF,2,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Reassociation_Req, 0xF,2,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Reassociation_Resp, 0xF,2,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Probe_Req , 0xF,1,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Probe_Resp , 0xF,1,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Beacon , 0xF,1,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_ATIM , 0xF,1,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Disassociation, 0xF,2,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Authentication, 0xF,1,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_Deauthentication, 0xF,3,ieee_802_11_frame_type_Management},\
+ { ieee_802_11_frame_subtype_PS-Poll , 0xF,3,ieee_802_11_frame_type_Control},\
+ { ieee_802_11_frame_subtype_RTS , 0xF,1,ieee_802_11_frame_type_Control},\
+ { ieee_802_11_frame_subtype_CTS , 0xF,1,ieee_802_11_frame_type_Control},\
+ { ieee_802_11_frame_subtype_ACK , 0xF,1,ieee_802_11_frame_type_Control},\
+ { ieee_802_11_frame_subtype_CFEnd , 0xF,1,ieee_802_11_frame_type_Control},\
+ { ieee_802_11_frame_subtype_CFEnd_CFAck , 0xF,1,ieee_802_11_frame_type_Control},\
+ { ieee_802_11_frame_subtype_Data , 0xF,3,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_Data_CFAck , 0xF,3,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_Data_CF_Poll 0xF,3,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_Data_CF_AckCF_Poll, 0xF,3,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_NullFunction 0xF,1,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_CF_Ack , 0xF,1,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_CF_Poll , 0xF,1,ieee_802_11_frame_type_Data},\
+ { ieee_802_11_frame_subtype_CF_AckCF_Poll, 0xF,1,ieee_802_11_frame_type_Data},\
+ { 0,0,NULL}\
+}
+
+
+#endif \ No newline at end of file
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 138831b4a..22a3f3779 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -23,35 +23,39 @@
#include <linux/types.h>
#include <linux/ioctl.h>
-
#ifdef __KERNEL__
-
+#include <linux/config.h>
#include <linux/sched.h>
#include <linux/wait.h>
+#endif /* __KERNEL__ */
/*
- * Device types
+ * System sleep states
*/
enum
{
- ACPI_SYS_DEV, /* system device (fan, KB controller, ...) */
- ACPI_PCI_DEV, /* generic PCI device */
- ACPI_PCI_BUS, /* PCI bus */
- ACPI_ISA_DEV, /* generic ISA device */
- ACPI_ISA_BUS, /* ISA bus */
- ACPI_USB_DEV, /* generic USB device */
- ACPI_USB_HUB, /* USB hub device */
- ACPI_USB_CTRL, /* USB controller */
- ACPI_SCSI_DEV, /* generic SCSI device */
- ACPI_SCSI_CTRL, /* SCSI controller */
+ ACPI_S0, /* working */
+ ACPI_S1, /* sleep */
+ ACPI_S2, /* sleep */
+ ACPI_S3, /* sleep */
+ ACPI_S4, /* non-volatile sleep */
+ ACPI_S5, /* soft-off */
};
-typedef int acpi_dev_t;
+typedef int acpi_sstate_t;
/*
- * Device addresses
+ * Device states
*/
-#define ACPI_PCI_ADR(dev) ((dev)->bus->number << 16 | (dev)->devfn)
+enum
+{
+ ACPI_D0, /* fully-on */
+ ACPI_D1, /* partial-on */
+ ACPI_D2, /* partial-on */
+ ACPI_D3, /* fully-off */
+};
+
+typedef int acpi_dstate_t;
/*
* HID (PnP) values
@@ -70,18 +74,31 @@ enum
typedef int acpi_hid_t;
+#ifdef __KERNEL__
+
/*
- * Device states
+ * Device types
*/
enum
{
- ACPI_D0, /* fully-on */
- ACPI_D1, /* partial-on */
- ACPI_D2, /* partial-on */
- ACPI_D3, /* fully-off */
+ ACPI_SYS_DEV, /* system device (fan, KB controller, ...) */
+ ACPI_PCI_DEV, /* generic PCI device */
+ ACPI_PCI_BUS, /* PCI bus */
+ ACPI_ISA_DEV, /* generic ISA device */
+ ACPI_ISA_BUS, /* ISA bus */
+ ACPI_USB_DEV, /* generic USB device */
+ ACPI_USB_HUB, /* USB hub device */
+ ACPI_USB_CTRL, /* USB controller */
+ ACPI_SCSI_DEV, /* generic SCSI device */
+ ACPI_SCSI_CTRL, /* SCSI controller */
};
-typedef int acpi_dstate_t;
+typedef int acpi_dev_t;
+
+/*
+ * Device addresses
+ */
+#define ACPI_PCI_ADR(dev) ((dev)->bus->number << 16 | (dev)->devfn)
struct acpi_dev;
@@ -120,7 +137,7 @@ struct acpi_dev
#ifdef CONFIG_ACPI
-extern wait_queue_head_t acpi_idle_wait;
+extern wait_queue_head_t acpi_control_wait;
/*
* Register a device with the ACPI subsystem
@@ -152,8 +169,8 @@ extern inline void acpi_dev_idle(struct acpi_dev *dev)
{
if (dev) {
dev->idle = jiffies;
- if (waitqueue_active(&acpi_idle_wait))
- wake_up(&acpi_idle_wait);
+ if (waitqueue_active(&acpi_control_wait))
+ wake_up(&acpi_control_wait);
}
}
@@ -216,6 +233,8 @@ extern void (*acpi_power_off)(void);
/* strangess to avoid integer overflow */
#define ACPI_uS_TO_TMR_TICKS(val) \
(((val) * (ACPI_TMR_HZ / 10000)) / 100)
+#define ACPI_TMR_TICKS_TO_uS(ticks) \
+ (((ticks) * 100) / (ACPI_TMR_HZ / 10000))
/* CPU cycles -> PM timer cycles, looks somewhat heuristic but
(ticks = 3/11 * CPU_MHz + 2) comes pretty close for my systems
@@ -241,6 +260,16 @@ extern void (*acpi_power_off)(void);
/* FACS flags */
#define ACPI_S4BIOS 0x00000001
+/* processor block offsets */
+#define ACPI_P_CNT 0x00000000
+#define ACPI_P_LVL2 0x00000004
+#define ACPI_P_LVL3 0x00000005
+
+/* C-state latencies (microseconds) */
+#define ACPI_MAX_P_LVL2_LAT 100
+#define ACPI_MAX_P_LVL3_LAT 1000
+#define ACPI_INFINITE_LAT (~0UL)
+
struct acpi_rsdp {
__u32 signature[2];
__u8 checksum;
@@ -330,14 +359,15 @@ enum
ACPI_GPE_ENABLE,
ACPI_GPE_LEVEL,
ACPI_EVENT,
- ACPI_P_LVL2,
- ACPI_P_LVL3,
+ ACPI_P_BLK,
ACPI_P_LVL2_LAT,
ACPI_P_LVL3_LAT,
+ ACPI_S0_SLP_TYP,
+ ACPI_S1_SLP_TYP,
ACPI_S5_SLP_TYP,
+ ACPI_SLEEP,
};
-#define ACPI_P_LVL_DISABLED 0x80
#define ACPI_SLP_TYP_DISABLED (~0UL)
/*
@@ -362,9 +392,7 @@ enum
#define ACPI_PIIX4_S5_MASK (0x0000 << 10)
#define ACPI_PIIX4_PM_TMR 0x0008
#define ACPI_PIIX4_GPE0 0x000c
-#define ACPI_PIIX4_P_CNT 0x0010
-#define ACPI_PIIX4_P_LVL2 0x0014
-#define ACPI_PIIX4_P_LVL3 0x0015
+#define ACPI_PIIX4_P_BLK 0x0010
#define ACPI_PIIX4_PM1_EVT_LEN 0x04
#define ACPI_PIIX4_PM1_CNT_LEN 0x02
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
new file mode 100644
index 000000000..d2ae68864
--- /dev/null
+++ b/include/linux/agp_backend.h
@@ -0,0 +1,224 @@
+/*
+ * AGPGART module version 0.99
+ * Copyright (C) 1999 Jeff Hartmann
+ * Copyright (C) 1999 Precision Insight, Inc.
+ * Copyright (C) 1999 Xi Graphics, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _AGP_BACKEND_H
+#define _AGP_BACKEND_H 1
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define AGPGART_VERSION_MAJOR 0
+#define AGPGART_VERSION_MINOR 99
+
+enum chipset_type {
+ NOT_SUPPORTED,
+ INTEL_GENERIC,
+ INTEL_LX,
+ INTEL_BX,
+ INTEL_GX,
+ INTEL_I810,
+ VIA_GENERIC,
+ VIA_VP3,
+ VIA_MVP3,
+ VIA_APOLLO_PRO,
+ SIS_GENERIC,
+ AMD_GENERIC,
+ AMD_IRONGATE,
+ ALI_M1541,
+ ALI_GENERIC
+};
+
+typedef struct _agp_version {
+ u16 major;
+ u16 minor;
+} agp_version;
+
+typedef struct _agp_kern_info {
+ agp_version version;
+ struct pci_dev *device;
+ enum chipset_type chipset;
+ unsigned long mode;
+ off_t aper_base;
+ size_t aper_size;
+ int max_memory; /* In pages */
+ int current_memory;
+} agp_kern_info;
+
+/*
+ * The agp_memory structure has information
+ * about the block of agp memory allocated.
+ * A caller may manipulate the next and prev
+ * pointers to link each allocated item into
+ * a list. These pointers are ignored by the
+ * backend. Everything else should never be
+ * written to, but the caller may read any of
+ * the items to detrimine the status of this
+ * block of agp memory.
+ *
+ */
+
+typedef struct _agp_memory {
+ int key;
+ struct _agp_memory *next;
+ struct _agp_memory *prev;
+ size_t page_count;
+ int num_scratch_pages;
+ unsigned long *memory;
+ off_t pg_start;
+ u32 type;
+ u8 is_bound;
+ u8 is_flushed;
+} agp_memory;
+
+#define AGP_NORMAL_MEMORY 0
+
+extern void agp_free_memory(agp_memory *);
+
+/*
+ * agp_free_memory :
+ *
+ * This function frees memory associated with
+ * an agp_memory pointer. It is the only function
+ * that can be called when the backend is not owned
+ * by the caller. (So it can free memory on client
+ * death.)
+ *
+ * It takes an agp_memory pointer as an argument.
+ *
+ */
+
+extern agp_memory *agp_allocate_memory(size_t, u32);
+
+/*
+ * agp_allocate_memory :
+ *
+ * This function allocates a group of pages of
+ * a certain type.
+ *
+ * It takes a size_t argument of the number of pages, and
+ * an u32 argument of the type of memory to be allocated.
+ * Every agp bridge device will allow you to allocate
+ * AGP_NORMAL_MEMORY which maps to physical ram. Any other
+ * type is device dependant.
+ *
+ * It returns NULL whenever memory is unavailable.
+ *
+ */
+
+extern void agp_copy_info(agp_kern_info *);
+
+/*
+ * agp_copy_info :
+ *
+ * This function copies information about the
+ * agp bridge device and the state of the agp
+ * backend into an agp_kern_info pointer.
+ *
+ * It takes an agp_kern_info pointer as an
+ * argument. The caller should insure that
+ * this pointer is valid.
+ *
+ */
+
+extern int agp_bind_memory(agp_memory *, off_t);
+
+/*
+ * agp_bind_memory :
+ *
+ * This function binds an agp_memory structure
+ * into the graphics aperture translation table.
+ *
+ * It takes an agp_memory pointer and an offset into
+ * the graphics aperture translation table as arguments
+ *
+ * It returns -EINVAL if the pointer == NULL.
+ * It returns -EBUSY if the area of the table
+ * requested is already in use.
+ *
+ */
+
+extern int agp_unbind_memory(agp_memory *);
+
+/*
+ * agp_unbind_memory :
+ *
+ * This function removes an agp_memory structure
+ * from the graphics aperture translation table.
+ *
+ * It takes an agp_memory pointer as an argument.
+ *
+ * It returns -EINVAL if this piece of agp_memory
+ * is not currently bound to the graphics aperture
+ * translation table or if the agp_memory
+ * pointer == NULL
+ *
+ */
+
+extern void agp_enable(u32);
+
+/*
+ * agp_enable :
+ *
+ * This function initializes the agp point-to-point
+ * connection.
+ *
+ * It takes an agp mode register as an argument
+ *
+ */
+
+extern int agp_backend_acquire(void);
+
+/*
+ * agp_backend_acquire :
+ *
+ * This Function attempts to acquire the agp
+ * backend.
+ *
+ * returns -EBUSY if agp is in use,
+ * returns 0 if the caller owns the agp backend
+ */
+
+extern void agp_backend_release(void);
+
+/*
+ * agp_backend_release :
+ *
+ * This Function releases the lock on the agp
+ * backend.
+ *
+ * The caller must insure that the graphics
+ * aperture translation table is read for use
+ * by another entity. (Ensure that all memory
+ * it bound is unbound.)
+ *
+ */
+
+#endif /* _AGP_BACKEND_H */
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
new file mode 100644
index 000000000..86617386e
--- /dev/null
+++ b/include/linux/agpgart.h
@@ -0,0 +1,216 @@
+/*
+ * AGPGART module version 0.99
+ * Copyright (C) 1999 Jeff Hartmann
+ * Copyright (C) 1999 Precision Insight, Inc.
+ * Copyright (C) 1999 Xi Graphics, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _AGP_H
+#define _AGP_H 1
+
+#define AGPIOC_BASE 'A'
+#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, agp_info*)
+#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
+#define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
+#define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, agp_setup*)
+#define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, agp_region*)
+#define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, agp_region*)
+#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, agp_allocate*)
+#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
+#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, agp_bind*)
+#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, agp_unbind*)
+
+#define AGP_DEVICE "/dev/agpgart"
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef __KERNEL__
+#include <linux/types.h>
+#include <asm/types.h>
+
+typedef struct _agp_version {
+ __u16 major;
+ __u16 minor;
+} agp_version;
+
+typedef struct _agp_info {
+ agp_version version; /* version of the driver */
+ __u32 bridge_id; /* bridge vendor/device */
+ __u32 agp_mode; /* mode info of bridge */
+ off_t aper_base; /* base of aperture */
+ size_t aper_size; /* size of aperture */
+ size_t pg_total; /* max pages (swap + system) */
+ size_t pg_system; /* max pages (system) */
+ size_t pg_used; /* current pages used */
+} agp_info;
+
+typedef struct _agp_setup {
+ __u32 agp_mode; /* mode info of bridge */
+} agp_setup;
+
+/*
+ * The "prot" down below needs still a "sleep" flag somehow ...
+ */
+typedef struct _agp_segment {
+ off_t pg_start; /* starting page to populate */
+ size_t pg_count; /* number of pages */
+ int prot; /* prot flags for mmap */
+} agp_segment;
+
+typedef struct _agp_region {
+ pid_t pid; /* pid of process */
+ size_t seg_count; /* number of segments */
+ struct _agp_segment *seg_list;
+} agp_region;
+
+typedef struct _agp_allocate {
+ int key; /* tag of allocation */
+ size_t pg_count; /* number of pages */
+ __u32 type; /* 0 == normal, other devspec */
+} agp_allocate;
+
+typedef struct _agp_bind {
+ int key; /* tag of allocation */
+ off_t pg_start; /* starting page to populate */
+} agp_bind;
+
+typedef struct _agp_unbind {
+ int key; /* tag of allocation */
+ __u32 priority; /* priority for paging out */
+} agp_unbind;
+
+#else /* __KERNEL__ */
+
+#define AGPGART_MINOR 175
+
+#define AGP_UNLOCK() up(&(agp_fe.agp_mutex));
+#define AGP_LOCK() down(&(agp_fe.agp_mutex));
+#define AGP_LOCK_INIT() sema_init(&(agp_fe.agp_mutex), 1)
+
+#ifndef _AGP_BACKEND_H
+typedef struct _agp_version {
+ u16 major;
+ u16 minor;
+} agp_version;
+
+#endif
+
+typedef struct _agp_info {
+ agp_version version; /* version of the driver */
+ u32 bridge_id; /* bridge vendor/device */
+ u32 agp_mode; /* mode info of bridge */
+ off_t aper_base; /* base of aperture */
+ size_t aper_size; /* size of aperture */
+ size_t pg_total; /* max pages (swap + system) */
+ size_t pg_system; /* max pages (system) */
+ size_t pg_used; /* current pages used */
+} agp_info;
+
+typedef struct _agp_setup {
+ u32 agp_mode; /* mode info of bridge */
+} agp_setup;
+
+/*
+ * The "prot" down below needs still a "sleep" flag somehow ...
+ */
+typedef struct _agp_segment {
+ off_t pg_start; /* starting page to populate */
+ size_t pg_count; /* number of pages */
+ int prot; /* prot flags for mmap */
+} agp_segment;
+
+typedef struct _agp_segment_priv {
+ off_t pg_start;
+ size_t pg_count;
+ pgprot_t prot;
+} agp_segment_priv;
+
+typedef struct _agp_region {
+ pid_t pid; /* pid of process */
+ size_t seg_count; /* number of segments */
+ struct _agp_segment *seg_list;
+} agp_region;
+
+typedef struct _agp_allocate {
+ int key; /* tag of allocation */
+ size_t pg_count; /* number of pages */
+ u32 type; /* 0 == normal, other devspec */
+} agp_allocate;
+
+typedef struct _agp_bind {
+ int key; /* tag of allocation */
+ off_t pg_start; /* starting page to populate */
+} agp_bind;
+
+typedef struct _agp_unbind {
+ int key; /* tag of allocation */
+ u32 priority; /* priority for paging out */
+} agp_unbind;
+
+typedef struct _agp_client {
+ struct _agp_client *next;
+ struct _agp_client *prev;
+ pid_t pid;
+ int num_segments;
+ agp_segment_priv **segments;
+} agp_client;
+
+typedef struct _agp_controller {
+ struct _agp_controller *next;
+ struct _agp_controller *prev;
+ pid_t pid;
+ int num_clients;
+ agp_memory *pool;
+ agp_client *clients;
+} agp_controller;
+
+#define AGP_FF_ALLOW_CLIENT 0
+#define AGP_FF_ALLOW_CONTROLLER 1
+#define AGP_FF_IS_CLIENT 2
+#define AGP_FF_IS_CONTROLLER 3
+#define AGP_FF_IS_VALID 4
+
+typedef struct _agp_file_private {
+ struct _agp_file_private *next;
+ struct _agp_file_private *prev;
+ pid_t my_pid;
+ u32 access_flags;
+} agp_file_private;
+
+struct agp_front_data {
+ struct semaphore agp_mutex;
+ agp_controller *current_controller;
+ agp_controller *controllers;
+ agp_file_private *file_priv_list;
+ u8 used_by_controller;
+ u8 backend_acquired;
+};
+
+#endif /* __KERNEL__ */
+
+#endif /* _AGP_H */
diff --git a/include/linux/blk.h b/include/linux/blk.h
index d0db1bce6..594f891af 100644
--- a/include/linux/blk.h
+++ b/include/linux/blk.h
@@ -157,9 +157,7 @@ static void floppy_off(unsigned int nr);
#elif (SCSI_DISK_MAJOR(MAJOR_NR))
#define DEVICE_NAME "scsidisk"
-#define DEVICE_INTR do_sd
#define TIMEOUT_VALUE (2*HZ)
-#define DEVICE_REQUEST do_sd_request
#define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 4)) + (MINOR(device) >> 4))
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
@@ -184,8 +182,6 @@ static void floppy_off(unsigned int nr);
#elif (MAJOR_NR == SCSI_CDROM_MAJOR)
#define DEVICE_NAME "CD-ROM"
-#define DEVICE_INTR do_sr
-#define DEVICE_REQUEST do_sr_request
#define DEVICE_NR(device) (MINOR(device))
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
@@ -387,7 +383,7 @@ static void floppy_off(unsigned int nr);
#if !defined(IDE_DRIVER)
#ifndef CURRENT
-#define CURRENT (blk_dev[MAJOR_NR].current_request)
+#define CURRENT (blk_dev[MAJOR_NR].request_queue.current_request)
#endif
#ifndef DEVICE_NAME
@@ -421,7 +417,9 @@ else \
#endif /* DEVICE_TIMEOUT */
-static void (DEVICE_REQUEST)(void);
+#ifdef DEVICE_REQUEST
+static void (DEVICE_REQUEST)(request_queue_t *);
+#endif
#ifdef DEVICE_INTR
#define CLEAR_INTR SET_INTR(NULL)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0567e080e..77d31cc9a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -27,6 +27,7 @@ struct request {
unsigned long nr_sectors;
unsigned long nr_segments;
unsigned long current_nr_sectors;
+ void * special;
char * buffer;
struct semaphore * sem;
struct buffer_head * bh;
@@ -34,19 +35,57 @@ struct request {
struct request * next;
};
-typedef void (request_fn_proc) (void);
-typedef struct request ** (queue_proc) (kdev_t dev);
+typedef struct request_queue request_queue_t;
+typedef int (merge_request_fn) (request_queue_t *,
+ struct request * req,
+ struct buffer_head *);
+typedef int (merge_requests_fn) (request_queue_t *,
+ struct request * req,
+ struct request * req2);
+typedef void (request_fn_proc) (request_queue_t *);
+typedef request_queue_t * (queue_proc) (kdev_t dev);
+
+struct request_queue
+{
+ struct request * current_request;
+ request_fn_proc * request_fn;
+ merge_request_fn * merge_fn;
+ merge_requests_fn * merge_requests_fn;
+ /*
+ * The queue owner gets to use this for whatever they like.
+ * ll_rw_blk doesn't touch it.
+ */
+ void * queuedata;
+
+ /*
+ * This is used to remove the plug when tq_disk runs.
+ */
+ struct tq_struct plug_tq;
+ /*
+ * Boolean that indicates whether this queue is plugged or not.
+ */
+ char plugged;
+
+ /*
+ * Boolean that indicates whether current_request is active or
+ * not.
+ */
+ char head_active;
+
+ /*
+ * Boolean that indicates whether we should use plugging on
+ * this queue or not.
+ */
+ char use_plug;
+};
struct blk_dev_struct {
- request_fn_proc *request_fn;
/*
* queue_proc has to be atomic
*/
+ request_queue_t request_queue;
queue_proc *queue;
void *data;
- struct request *current_request;
- struct request plug;
- struct tq_struct plug_tq;
};
struct sec_size {
@@ -54,6 +93,14 @@ struct sec_size {
unsigned block_size_bits;
};
+/*
+ * Used to indicate the default queue for drivers that don't bother
+ * to implement multiple queues. We have this access macro here
+ * so as to eliminate the need for each and every block device
+ * driver to know about the internal structure of blk_dev[].
+ */
+#define BLK_DEFAULT_QUEUE(_MAJOR) &blk_dev[_MAJOR].request_queue
+
extern struct sec_size * blk_sec[MAX_BLKDEV];
extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
extern wait_queue_head_t wait_for_request;
@@ -61,6 +108,14 @@ extern void resetup_one_dev(struct gendisk *dev, int drive);
extern void unplug_device(void * data);
extern void make_request(int major,int rw, struct buffer_head * bh);
+/*
+ * Access functions for manipulating queue properties
+ */
+extern void blk_init_queue(request_queue_t *, request_fn_proc *);
+extern void blk_cleanup_queue(request_queue_t *);
+extern void blk_queue_headactive(request_queue_t *, int);
+extern void blk_queue_pluggable(request_queue_t *, int);
+
/* md needs this function to remap requests */
extern int md_map (int minor, kdev_t *rdev, unsigned long *rsector, unsigned long size);
extern int md_make_request (int minor, int rw, struct buffer_head * bh);
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index c789e769c..7b51fcb54 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -1,8 +1,13 @@
+/*
+ * Discontiguous memory support, Kanoj Sarcar, SGI, Nov 1999
+ */
#ifndef _LINUX_BOOTMEM_H
#define _LINUX_BOOTMEM_H
#include <asm/pgtable.h>
#include <asm/dma.h>
+#include <linux/cache.h>
+#include <linux/init.h>
/*
* simple boot-time physical memory area allocator.
@@ -10,18 +15,45 @@
extern unsigned long max_low_pfn;
+/*
+ * node_bootmem_map is a map pointer - the bits represent all physical
+ * memory pages (including holes) on the node.
+ */
+typedef struct bootmem_data {
+ unsigned long node_boot_start;
+ unsigned long node_low_pfn;
+ void *node_bootmem_map;
+ unsigned long last_offset;
+ unsigned long last_pos;
+} bootmem_data_t;
+
+extern unsigned long __init bootmem_bootmap_pages (unsigned long);
extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
extern void __init free_bootmem (unsigned long addr, unsigned long size);
extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal);
#define alloc_bootmem(x) \
__alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_low(x) \
+ __alloc_bootmem((x), SMP_CACHE_BYTES, 0)
#define alloc_bootmem_pages(x) \
__alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
#define alloc_bootmem_low_pages(x) \
__alloc_bootmem((x), PAGE_SIZE, 0)
extern unsigned long __init free_all_bootmem (void);
+extern unsigned long __init init_bootmem_node (int nid, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn);
+extern void __init reserve_bootmem_node (int nid, unsigned long physaddr, unsigned long size);
+extern void __init free_bootmem_node (int nid, unsigned long addr, unsigned long size);
+extern unsigned long __init free_all_bootmem_node (int nid);
+extern void * __init __alloc_bootmem_node (int nid, unsigned long size, unsigned long align, unsigned long goal);
+#define alloc_bootmem_node(nid, x) \
+ __alloc_bootmem_node((nid), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_node(nid, x) \
+ __alloc_bootmem_node((nid), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_low_pages_node(nid, x) \
+ __alloc_bootmem_node((nid), (x), PAGE_SIZE, 0)
+
#endif /* _LINUX_BOOTMEM_H */
diff --git a/include/linux/cache.h b/include/linux/cache.h
new file mode 100644
index 000000000..2030eb72b
--- /dev/null
+++ b/include/linux/cache.h
@@ -0,0 +1,28 @@
+#ifndef __LINUX_CACHE_H
+#define __LINUX_CACHE_H
+
+#include <asm/cache.h>
+
+#ifndef L1_CACHE_ALIGN
+#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+#endif
+
+#ifndef SMP_CACHE_BYTES
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#endif
+
+#ifndef ____cacheline_aligned
+#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
+#endif
+
+#ifndef __cacheline_aligned
+#ifdef MODULE
+#define __cacheline_aligned ____cacheline_aligned
+#else
+#define __cacheline_aligned \
+ __attribute__((__aligned__(SMP_CACHE_BYTES), \
+ __section__(".data.cacheline_aligned")))
+#endif
+#endif /* __cacheline_aligned */
+
+#endif /* __LINUX_CACHE_H */
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index 9331f9a2d..b125ee4d6 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -12,6 +12,7 @@
#define _LINUX_CDROM_H
#include <linux/types.h>
+#include <asm/byteorder.h>
/*******************************************************
* As of Linux 2.1.x, all Linux CD-ROM application programs will use this
@@ -269,11 +270,12 @@ struct cdrom_blk
/* for CDROM_PACKET_COMMAND ioctl */
struct cdrom_generic_command
{
- unsigned char cmd[CDROM_PACKET_SIZE];
- unsigned char *buffer;
- unsigned int buflen;
- int stat;
- void *reserved[4];
+ unsigned char cmd[CDROM_PACKET_SIZE];
+ unsigned char *buffer;
+ unsigned int buflen;
+ int stat;
+ struct request_sense *sense;
+ void *reserved[3];
};
@@ -584,6 +586,8 @@ typedef union {
#define DVD_LU_SEND_TITLE_KEY 7
#define DVD_LU_SEND_ASF 8
#define DVD_INVALIDATE_AGID 9
+#define DVD_LU_SEND_RPC_STATE 10
+#define DVD_HOST_SEND_RPC_STATE 11
/* State data */
typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
@@ -643,6 +647,19 @@ struct dvd_lu_send_asf {
unsigned asf : 1;
};
+struct dvd_host_send_rpcstate {
+ __u8 type;
+ __u8 pdrc;
+};
+
+struct dvd_lu_send_rpcstate {
+ __u8 type : 2;
+ __u8 vra : 3;
+ __u8 ucca : 3;
+ __u8 region_mask;
+ __u8 rpc_scheme;
+};
+
typedef union {
__u8 type;
@@ -653,8 +670,40 @@ typedef union {
struct dvd_send_key hsk;
struct dvd_lu_send_title_key lstk;
struct dvd_lu_send_asf lsasf;
+ struct dvd_host_send_rpcstate hrpcs;
+ struct dvd_lu_send_rpcstate lrpcs;
} dvd_authinfo;
+struct request_sense {
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 valid : 1;
+ __u8 error_code : 7;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 error_code : 7;
+ __u8 valid : 1;
+#endif
+ __u8 segment_number;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 ili : 1;
+ __u8 reserved2 : 1;
+ __u8 sense_key : 4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 sense_key : 4;
+ __u8 reserved2 : 1;
+ __u8 ili : 1;
+ __u8 reserved1 : 2;
+#endif
+ __u8 information[4];
+ __u8 add_sense_len;
+ __u8 command_info[4];
+ __u8 asc;
+ __u8 ascq;
+ __u8 fruc;
+ __u8 sks[3];
+ __u8 asb[46];
+};
+
#ifdef __KERNEL__
struct cdrom_write_settings {
diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h
index 7c4ca8a04..99cee973f 100644
--- a/include/linux/coda_proc.h
+++ b/include/linux/coda_proc.h
@@ -133,13 +133,13 @@ int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
/* these functions are called to form the content of /proc/fs/coda/... files */
int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
- int length, int dummy );
+ int length);
int coda_upcall_stats_get_info( char * buffer, char ** start, off_t offset,
- int length, int dummy );
+ int length);
int coda_permission_stats_get_info( char * buffer, char ** start, off_t offset,
- int length, int dummy );
+ int length);
int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset,
- int length, int dummy );
+ int length);
#endif /* _CODA_PROC_H */
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h
index b38cfe77f..b456e1f15 100644
--- a/include/linux/cycx_drv.h
+++ b/include/linux/cycx_drv.h
@@ -53,6 +53,7 @@ typedef struct cycxhw {
/* Function Prototypes */
extern int cycx_setup (cycxhw_t *hw, void *sfm, u32 len);
+extern int cycx_down (cycxhw_t *hw);
extern int cycx_peek (cycxhw_t *hw, u32 addr, void *buf, u32 len);
extern int cycx_poke (cycxhw_t *hw, u32 addr, void *buf, u32 len);
extern int cycx_exec (u32 addr);
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 1ed6fe5e1..836038e59 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -615,6 +615,7 @@ extern struct inode_operations ext2_file_inode_operations;
/* symlink.c */
extern struct inode_operations ext2_symlink_inode_operations;
+extern struct inode_operations ext2_fast_symlink_inode_operations;
#endif /* __KERNEL__ */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 8c008b8de..78fb24d23 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1,6 +1,7 @@
#ifndef _LINUX_FB_H
#define _LINUX_FB_H
+#include <linux/tty.h>
#include <asm/types.h>
/* Definitions of frame buffers */
@@ -254,61 +255,6 @@ struct fb_ops {
int (*fb_rasterimg)(struct fb_info *info, int start);
};
-
- /*
- * This is the interface between the low-level console driver and the
- * low-level frame buffer device
- */
-
-struct display {
- /* Filled in by the frame buffer device */
-
- struct fb_var_screeninfo var; /* variable infos. yoffset and vmode */
- /* are updated by fbcon.c */
- struct fb_cmap cmap; /* colormap */
- char *screen_base; /* pointer to top of virtual screen */
- /* (virtual address) */
- int visual;
- int type; /* see FB_TYPE_* */
- int type_aux; /* Interleave for interleaved Planes */
- u_short ypanstep; /* zero if no hardware ypan */
- u_short ywrapstep; /* zero if no hardware ywrap */
- u_long line_length; /* length of a line in bytes */
- u_short can_soft_blank; /* zero if no hardware blanking */
- u_short inverse; /* != 0 text black on white as default */
- struct display_switch *dispsw; /* low level operations */
- void *dispsw_data; /* optional dispsw helper data */
-
-#if 0
- struct fb_fix_cursorinfo fcrsr;
- struct fb_var_cursorinfo *vcrsr;
- struct fb_cursorstate crsrstate;
-#endif
-
- /* Filled in by the low-level console driver */
-
- struct vc_data *conp; /* pointer to console data */
- struct fb_info *fb_info; /* frame buffer for this console */
- int vrows; /* number of virtual rows */
- unsigned short cursor_x; /* current cursor position */
- unsigned short cursor_y;
- int fgcol; /* text colors */
- int bgcol;
- u_long next_line; /* offset to one line below */
- u_long next_plane; /* offset to next plane */
- u_char *fontdata; /* Font associated to this display */
- unsigned short _fontheightlog;
- unsigned short _fontwidthlog;
- unsigned short _fontheight;
- unsigned short _fontwidth;
- int userfont; /* != 0 if fontdata kmalloc()ed */
- u_short scrollmode; /* Scroll Method */
- short yscroll; /* Hardware scrolling */
- unsigned char fgshift, bgshift;
- unsigned short charmask; /* 0xff or 0x1ff */
-};
-
-
struct fb_info {
char modename[40]; /* default video mode */
kdev_t node;
@@ -408,20 +354,17 @@ extern int fbgen_switch(int con, struct fb_info *info);
extern void fbgen_blank(int blank, struct fb_info *info);
-/* drivers/char/fbmem.c */
+/* drivers/video/fbmem.c */
extern int register_framebuffer(struct fb_info *fb_info);
extern int unregister_framebuffer(const struct fb_info *fb_info);
-extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
- const struct fb_info *fb_info);
-extern int fbmon_dpms(const struct fb_info *fb_info);
-
extern int num_registered_fb;
extern struct fb_info *registered_fb[FB_MAX];
-extern char con2fb_map[MAX_NR_CONSOLES];
-/* drivers/video/fbcon.c */
-extern struct display fb_display[MAX_NR_CONSOLES];
+/* drivers/video/fbmon.c */
+extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
+ const struct fb_info *fb_info);
+extern int fbmon_dpms(const struct fb_info *fb_info);
/* drivers/video/fbcmap.c */
extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 348cf02e2..57ba941dd 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -18,10 +18,10 @@
#include <linux/list.h>
#include <linux/dcache.h>
#include <linux/stat.h>
+#include <linux/cache.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
-#include <asm/cache.h>
struct poll_table_struct;
@@ -62,6 +62,7 @@ extern int max_super_blocks, nr_super_blocks;
#define READ 0
#define WRITE 1
#define READA 2 /* read-ahead - don't block if no resources */
+#define SPECIAL 4 /* For non-blockdevice requests in request queue */
#define WRITERAW 5 /* raw write - don't play with buffer lists */
@@ -543,14 +544,12 @@ struct super_block {
unsigned long s_blocksize;
unsigned char s_blocksize_bits;
unsigned char s_lock;
- unsigned char s_rd_only;
unsigned char s_dirt;
struct file_system_type *s_type;
struct super_operations *s_op;
struct dquot_operations *dq_op;
unsigned long s_flags;
unsigned long s_magic;
- unsigned long s_time;
struct dentry *s_root;
wait_queue_head_t s_wait;
@@ -639,7 +638,7 @@ struct inode_operations {
/*
* the order of these functions within the VFS template has been
* changed because SMP locking has changed: from now on all get_block,
- * readpage, writepage and flushpage functions are supposed to do
+ * readpage and writepage functions are supposed to do
* whatever locking they need to get proper SMP operation - for
* now in most cases this means a lock/unlock_kernel at entry/exit.
* [The new order is also slightly more logical :)]
@@ -651,13 +650,11 @@ struct inode_operations {
*/
int (*get_block) (struct inode *, long, struct buffer_head *, int);
- int (*readpage) (struct file *, struct page *);
- int (*writepage) (struct file *, struct page *);
- int (*flushpage) (struct inode *, struct page *, unsigned long);
+ int (*readpage) (struct dentry *, struct page *);
+ int (*writepage) (struct dentry *, struct page *);
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int);
- int (*smap) (struct inode *,int);
int (*revalidate) (struct dentry *);
};
@@ -678,11 +675,11 @@ struct super_operations {
struct dquot_operations {
void (*initialize) (struct inode *, short);
void (*drop) (struct inode *);
- int (*alloc_block) (const struct inode *, unsigned long, uid_t, char);
- int (*alloc_inode) (const struct inode *, unsigned long, uid_t);
+ int (*alloc_block) (const struct inode *, unsigned long, char);
+ int (*alloc_inode) (const struct inode *, unsigned long);
void (*free_block) (const struct inode *, unsigned long);
void (*free_inode) (const struct inode *, unsigned long);
- int (*transfer) (struct inode *, struct iattr *, char, uid_t);
+ int (*transfer) (struct dentry *, struct iattr *);
};
struct file_system_type {
@@ -735,7 +732,7 @@ extern inline int locks_verify_area(int read_write, struct inode *inode,
asmlinkage long sys_open(const char *, int, int);
asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */
extern int do_close(unsigned int, int); /* yes, it's really unsigned */
-extern int do_truncate(struct dentry *, unsigned long);
+extern int do_truncate(struct dentry *, loff_t start);
extern int get_unused_fd(void);
extern void put_unused_fd(unsigned int);
@@ -946,17 +943,28 @@ extern int brw_page(int, struct page *, kdev_t, int [], int);
typedef int (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *);
/* Generic buffer handling for block filesystems.. */
-extern int block_read_full_page(struct file *, struct page *);
-extern int block_write_full_page (struct file *, struct page *);
+extern int block_read_full_page(struct dentry *, struct page *);
+extern int block_write_full_page (struct dentry *, struct page *);
extern int block_write_partial_page (struct file *, struct page *, unsigned long, unsigned long, const char *);
extern int block_write_cont_page (struct file *, struct page *, unsigned long, unsigned long, const char *);
-extern int block_flushpage(struct inode *, struct page *, unsigned long);
+extern int block_write_zero_range(struct inode *, struct page *, unsigned, unsigned, unsigned, const char *);
+extern inline int block_write_range(struct inode *inode, struct page *page,
+ unsigned from, unsigned len,const char *buf)
+{
+ return block_write_zero_range(inode, page, from, from, from+len, buf);
+}
+extern int block_flushpage(struct page *, unsigned long);
+extern int block_symlink(struct inode *, const char *, int);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *, writepage_t);
-extern void do_generic_file_read(struct file * filp, loff_t *ppos, read_descriptor_t * desc, read_actor_t actor);
+extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t);
+extern int vfs_readlink(struct dentry *, char *, int, char *);
+extern struct dentry *vfs_follow_link(struct dentry *, struct dentry *, unsigned, char *);
+extern int page_readlink(struct dentry *, char *, int);
+extern struct dentry *page_follow_link(struct dentry *, struct dentry *, unsigned);
extern struct super_block *get_super(kdev_t);
struct super_block *get_empty_super(void);
@@ -983,7 +991,7 @@ extern ssize_t block_write(struct file *, const char *, size_t, loff_t *);
extern int block_fsync(struct file *, struct dentry *);
extern int file_fsync(struct file *, struct dentry *);
-extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start, unsigned long end);
+extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start_idx, unsigned long end_idx);
extern int inode_change_ok(struct inode *, struct iattr *);
extern void inode_setattr(struct inode *, struct iattr *);
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
index a26f2e51b..d9ab7df58 100644
--- a/include/linux/ftape.h
+++ b/include/linux/ftape.h
@@ -40,9 +40,6 @@
#include <linux/types.h>
#include <linux/version.h>
#include <linux/config.h>
-#if LINUX_VERSION_CODE <= KERNEL_VER(1,2,13)
-typedef daddr_t __kernel_daddr_t; /* needed for mtio.h */
-#endif
#include <linux/mtio.h>
#define FT_SECTOR(x) (x+1) /* sector offset into real sector */
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 4e8e98224..2e31d77f2 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -2,8 +2,7 @@
#define _LINUX_HIGHMEM_H
#include <linux/config.h>
-#include <linux/pagemap.h>
-#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#ifdef CONFIG_HIGHMEM
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index f5e1a3015..60e08d0d3 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -42,6 +42,7 @@ struct i2c_device;
#define I2C_BUSID_PARPORT 2 /* Bit banging on a parallel port */
#define I2C_BUSID_BUZ 3
#define I2C_BUSID_ZORAN 4
+#define I2C_BUSID_CYBER2000 5 /* I2C bus on a Cyber2000 */
/*
* struct for a driver for a i2c chip (tuner, soundprocessor,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 10cfa1605..cd813e9c6 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -227,11 +227,11 @@ typedef union {
unsigned set_multmode : 1; /* set multmode count */
unsigned set_tune : 1; /* tune interface for drive */
unsigned reserved : 4; /* unused */
- } b;
- } special_t;
+ } b;
+} special_t;
typedef struct ide_drive_s {
- struct request *queue; /* request queue */
+ request_queue_t queue; /* request queue */
struct ide_drive_s *next; /* circular list of hwgroup drives */
unsigned long sleep; /* sleep until this time */
unsigned long service_start; /* time we started last request */
@@ -299,7 +299,9 @@ typedef struct ide_drive_s {
thresholds_t smart_thresholds;
values_t smart_values;
#endif
- } ide_drive_t;
+ int last_lun; /* last logical unit */
+ int forced_lun; /* if hdxlun was given at boot */
+} ide_drive_t;
/*
* An ide_dmaproc_t() initiates/aborts DMA read/write operations on a drive.
@@ -317,11 +319,10 @@ typedef enum { ide_dma_read, ide_dma_write, ide_dma_begin,
ide_dma_off, ide_dma_off_quietly, ide_dma_test_irq,
ide_dma_bad_drive, ide_dma_good_drive,
ide_dma_lostirq, ide_dma_timeout
- } ide_dma_action_t;
+} ide_dma_action_t;
typedef int (ide_dmaproc_t)(ide_dma_action_t, ide_drive_t *);
-
/*
* An ide_tuneproc_t() is used to set the speed of an IDE interface
* to a particular PIO mode. The "byte" parameter is used
@@ -350,7 +351,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
ide_qd6580, ide_umc8672, ide_ht6560b,
ide_pdc4030, ide_rz1000, ide_trm290,
ide_cmd646, ide_cy82c693, ide_4drives
- } hwif_chipset_t;
+} hwif_chipset_t;
typedef struct ide_pci_devid_s {
unsigned short vid;
@@ -396,12 +397,20 @@ typedef struct hwif_s {
#if (DISK_RECOVERY_TIME > 0)
unsigned long last_time; /* time when previous rq was done */
#endif
- } ide_hwif_t;
+} ide_hwif_t;
+
+ /*
+ * Status returned from various ide_ functions
+ */
+typedef enum {
+ ide_stopped, /* no drive operation was started */
+ ide_started /* a drive operation was started, and a handler was set */
+} ide_startstop_t;
/*
* internal ide interrupt handler type
*/
-typedef void (ide_handler_t)(ide_drive_t *);
+typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
/*
* when ide_timer_expiry fires, invoke a handler of this type
@@ -410,9 +419,9 @@ typedef void (ide_handler_t)(ide_drive_t *);
typedef int (ide_expiry_t)(ide_drive_t *);
typedef struct hwgroup_s {
- spinlock_t spinlock; /* protects "busy" and "handler" */
ide_handler_t *handler;/* irq handler, if active */
- int busy; /* BOOL: protects all fields below */
+ volatile int busy; /* BOOL: protects all fields below */
+ int sleeping; /* BOOL: wake us up on timer expiry */
ide_drive_t *drive; /* current drive */
ide_hwif_t *hwif; /* ptr to current hwif in linked-list */
struct request *rq; /* current request */
@@ -420,7 +429,7 @@ typedef struct hwgroup_s {
struct request wrq; /* local copy of current write rq */
unsigned long poll_timeout; /* timeout value during long polls */
ide_expiry_t *expiry; /* queried upon timeouts */
- } ide_hwgroup_t;
+} ide_hwgroup_t;
/*
* configurable drive settings
@@ -504,7 +513,7 @@ read_proc_t proc_ide_read_geometry;
#define IDE_SUBDRIVER_VERSION 1
typedef int (ide_cleanup_proc)(ide_drive_t *);
-typedef void (ide_do_request_proc)(ide_drive_t *, struct request *, unsigned long);
+typedef ide_startstop_t (ide_do_request_proc)(ide_drive_t *, struct request *, unsigned long);
typedef void (ide_end_request_proc)(byte, ide_hwgroup_t *);
typedef int (ide_ioctl_proc)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);
typedef int (ide_open_proc)(struct inode *, struct file *, ide_drive_t *);
@@ -512,7 +521,7 @@ typedef void (ide_release_proc)(struct inode *, struct file *, ide_drive_t *);
typedef int (ide_check_media_change_proc)(ide_drive_t *);
typedef void (ide_pre_reset_proc)(ide_drive_t *);
typedef unsigned long (ide_capacity_proc)(ide_drive_t *);
-typedef void (ide_special_proc)(ide_drive_t *);
+typedef ide_startstop_t (ide_special_proc)(ide_drive_t *);
typedef void (ide_setting_proc)(ide_drive_t *);
typedef struct ide_driver_s {
@@ -533,7 +542,7 @@ typedef struct ide_driver_s {
ide_capacity_proc *capacity;
ide_special_proc *special;
ide_proc_entry_t *proc;
- } ide_driver_t;
+} ide_driver_t;
#define DRIVER(drive) ((ide_driver_t *)((drive)->driver))
@@ -600,9 +609,9 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat);
/*
* ide_error() takes action based on the error returned by the controller.
- * The calling function must return afterwards, to restart the request.
+ * The caller should return immediately after invoking this.
*/
-void ide_error (ide_drive_t *drive, const char *msg, byte stat);
+ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
/*
* Issue a simple drive command
@@ -622,10 +631,13 @@ void ide_fixstring (byte *s, const int bytecount, const int byteswap);
* This routine busy-waits for the drive status to be not "busy".
* It then checks the status for all of the "good" bits and none
* of the "bad" bits, and if all is okay it returns 0. All other
- * cases return 1 after invoking ide_error() -- caller should return.
- *
+ * cases return 1 after doing "*startstop = ide_error()", and the
+ * caller should return the updated value of "startstop" in this case.
+ * "startstop" is unchanged when the function returns 0;
*/
-int ide_wait_stat (ide_drive_t *drive, byte good, byte bad, unsigned long timeout);
+int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, byte good, byte bad, unsigned long timeout);
+
+int ide_wait_noerr (ide_drive_t *drive, byte good, byte bad, unsigned long timeout);
/*
* This routine is called from the partition-table code in genhd.c
@@ -647,7 +659,7 @@ unsigned long current_capacity (ide_drive_t *drive);
* Start a reset operation for an IDE interface.
* The caller should return immediately after invoking this.
*/
-void ide_do_reset (ide_drive_t *);
+ide_startstop_t ide_do_reset (ide_drive_t *);
/*
* This function is intended to be used prior to invoking ide_do_drive_cmd().
@@ -657,12 +669,12 @@ void ide_init_drive_cmd (struct request *rq);
/*
* "action" parameter type for ide_do_drive_cmd() below.
*/
-typedef enum
- {ide_wait, /* insert rq at end of list, and wait for it */
- ide_next, /* insert rq immediately after current request */
- ide_preempt, /* insert rq in front of current request */
- ide_end} /* insert rq at end of list, but don't wait for it */
- ide_action_t;
+typedef enum {
+ ide_wait, /* insert rq at end of list, and wait for it */
+ ide_next, /* insert rq immediately after current request */
+ ide_preempt, /* insert rq in front of current request */
+ ide_end /* insert rq at end of list, but don't wait for it */
+} ide_action_t;
/*
* This function issues a special IDE device request
@@ -703,7 +715,11 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err);
int ide_wait_cmd (ide_drive_t *drive, int cmd, int nsect, int feature, int sectors, byte *buf);
void ide_delay_50ms (void);
+
+int ide_driveid_update (ide_drive_t *drive);
+int ide_ata66_check (ide_drive_t *drive, int cmd, int nsect, int feature);
int ide_config_drive_speed (ide_drive_t *drive, byte speed);
+int set_transfer (ide_drive_t *drive, int cmd, int nsect, int feature);
/*
* ide_system_bus_speed() returns what we think is the system VESA/PCI
@@ -717,7 +733,7 @@ int ide_system_bus_speed (void);
* ide_multwrite() transfers a block of up to mcount sectors of data
* to a drive as part of a disk multwrite operation.
*/
-void ide_multwrite (ide_drive_t *drive, unsigned int mcount);
+int ide_multwrite (ide_drive_t *drive, unsigned int mcount);
/*
* ide_stall_queue() can be used by a drive to give excess bandwidth back
@@ -728,7 +744,7 @@ void ide_stall_queue (ide_drive_t *drive, unsigned long timeout);
/*
* ide_get_queue() returns the queue which corresponds to a given device.
*/
-struct request **ide_get_queue (kdev_t dev);
+request_queue_t *ide_get_queue (kdev_t dev);
/*
* CompactFlash cards and their brethern pretend to be removable hard disks,
@@ -741,33 +757,33 @@ int ide_spin_wait_hwgroup(ide_drive_t *drive, unsigned long *flags);
void ide_timer_expiry (unsigned long data);
void ide_intr (int irq, void *dev_id, struct pt_regs *regs);
void ide_geninit (struct gendisk *gd);
-void do_ide0_request (void);
+void do_ide0_request (request_queue_t * q);
#if MAX_HWIFS > 1
-void do_ide1_request (void);
+void do_ide1_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 2
-void do_ide2_request (void);
+void do_ide2_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 3
-void do_ide3_request (void);
+void do_ide3_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 4
-void do_ide4_request (void);
+void do_ide4_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 5
-void do_ide5_request (void);
+void do_ide5_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 6
-void do_ide6_request (void);
+void do_ide6_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 7
-void do_ide7_request (void);
+void do_ide7_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 8
-void do_ide8_request (void);
+void do_ide8_request (request_queue_t * q);
#endif
#if MAX_HWIFS > 9
-void do_ide9_request (void);
+void do_ide9_request (request_queue_t * q);
#endif
void ide_init_subdrivers (void);
@@ -812,6 +828,7 @@ int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
#else /* CONFIG_BLK_DEV_OFFBOARD */
# define OFF_BOARD NEVER_BOARD
#endif /* CONFIG_BLK_DEV_OFFBOARD */
+
unsigned long ide_find_free_region (unsigned short size) __init;
void ide_scan_pcibus (void) __init;
#endif
@@ -819,7 +836,7 @@ void ide_scan_pcibus (void) __init;
#define BAD_DMA_DRIVE 0
#define GOOD_DMA_DRIVE 1
int ide_build_dmatable (ide_drive_t *drive, ide_dma_action_t func);
-void ide_dma_intr (ide_drive_t *drive);
+ide_startstop_t ide_dma_intr (ide_drive_t *drive);
int check_drive_lists (ide_drive_t *drive, int good_bad);
int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive);
int ide_release_dma (ide_hwif_t *hwif);
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 18873a97f..817449276 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -76,7 +76,7 @@
#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
/* 787->799 reserved for fibrechannel media types */
-
+#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
/* ARP protocol opcodes. */
#define ARPOP_REQUEST 1 /* ARP request */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index cf5f36775..6c5349546 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -83,7 +83,9 @@ extern int release_resource(struct resource *new);
extern int allocate_resource(struct resource *root, struct resource *new,
unsigned long size,
unsigned long min, unsigned long max,
- unsigned long align);
+ unsigned long align,
+ void (*alignf)(void *, struct resource *, unsigned long),
+ void *alignf_data);
/* Convenience shorthand with allocation */
#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 56bcb9780..0aec0d93c 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -38,10 +38,6 @@ struct ipc_perm
#ifdef __KERNEL__
-/* special shmsegs[id] values */
-#define IPC_UNUSED ((void *) -1)
-#define IPC_NOID ((void *) -2) /* being allocated/destroyed */
-
#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
#endif /* __KERNEL__ */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 4063fe743..f8a16d730 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -42,7 +42,7 @@ typedef struct {
independent code */
struct irqaction *action; /* IRQ action list */
unsigned int depth; /* Disable depth for nested irq disables */
-} irq_desc_t;
+} ____cacheline_aligned irq_desc_t;
#include <asm/hw_irq.h> /* the arch dependent stuff */
@@ -52,27 +52,6 @@ extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
extern spinlock_t irq_controller_lock;
extern int setup_irq(unsigned int , struct irqaction * );
-#ifdef __SMP__
-
-#include <asm/atomic.h>
-
-static inline void irq_enter(int cpu, unsigned int irq)
-{
- hardirq_enter(cpu);
- while (test_bit(0,&global_irq_lock)) {
- /* nothing */;
- }
-}
-
-static inline void irq_exit(int cpu, unsigned int irq)
-{
- hardirq_exit(cpu);
-}
-#else
-#define irq_enter(cpu, irq) (++local_irq_count[cpu])
-#define irq_exit(cpu, irq) (--local_irq_count[cpu])
-#endif
-
extern hw_irq_controller no_irq_type; /* needed in every arch ? */
#endif /* __asm_h */
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index e5b426d07..1ec294a3b 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -23,6 +23,7 @@
#define LINUX_ISAPNP_H
#include <linux/config.h>
+#include <linux/errno.h>
/*
* Configuration registers (TODO: change by specification)
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h
index e5b3a3d7b..80a8b27f4 100644
--- a/include/linux/iso_fs.h
+++ b/include/linux/iso_fs.h
@@ -178,7 +178,7 @@ extern int iso_date(char *, int);
extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
-extern char * get_rock_ridge_symlink(struct inode *);
+extern int rock_ridge_symlink_readpage(struct dentry *, struct page *);
extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *);
int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *);
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 0aa715cb3..b5b39d0f5 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -4,7 +4,9 @@
/*
* /usr/include/linux/joystick.h Version 1.2
*
- * Copyright (C) 1996-1998 Vojtech Pavlik
+ * Copyright (C) 1996-1999 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
*/
/*
@@ -34,7 +36,7 @@
* Version
*/
-#define JS_VERSION 0x01020d
+#define JS_VERSION 0x01020f
/*
* Types and constants for reading from /dev/js
@@ -128,64 +130,61 @@ struct JS_DATA_SAVE_TYPE {
#include <linux/version.h>
-#ifndef KERNEL_VERSION
-#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-#endif
-
-#ifndef LINUX_VERSION_CODE
-#error "You need to use at least 2.0 Linux kernel."
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
+#error "You need to use at least v2.2 Linux kernel."
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,0)
-#error "You need to use at least 2.0 Linux kernel."
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
-#define JS_HAS_RDTSC (current_cpu_data.x86_capability & 0x10)
-#include <linux/init.h>
-#else
-#ifdef MODULE
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,35)
-#define JS_HAS_RDTSC (x86_capability & 0x10)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
+#include <asm/spinlock.h>
+typedef struct wait_queue *wait_queue_head_t;
+#define __setup(a,b)
+#define BASE_ADDRESS(x,i) ((x)->base_address[i])
+#define DECLARE_WAITQUEUE(x,y) struct wait_queue x = { y, NULL }
+#define init_waitqueue_head(x) do { *(x) = NULL; } while (0)
+#define __set_current_state(x) current->state = x
+#define SETUP_PARAM char *str, int *ints
+#define SETUP_PARSE(x) do {} while (0)
#else
-#define JS_HAS_RDTSC 0
-#endif
-#else
-#define JS_HAS_RDTSC (x86_capability & 0x10)
-#endif
-#define __initdata
-#define __init
-#define __cli cli
-#define __save_flags(flags) save_flags(flags)
-#define __restore_flags(flags) restore_flags(flags)
-#define spin_lock_irqsave(x, flags) do { save_flags(flags); cli(); } while (0)
-#define spin_unlock_irqrestore(x, flags) restore_flags(flags)
-#define spin_lock_init(x) do { } while (0)
-typedef struct { int something; } spinlock_t;
-#define SPIN_LOCK_UNLOCKED { 0 }
-#define MODULE_AUTHOR(x)
-#define MODULE_PARM(x,y)
-#define MODULE_SUPPORTED_DEVICE(x)
-#define signal_pending(x) (((x)->signal) & ~((x)->blocked))
+#include <linux/spinlock.h>
+#define BASE_ADDRESS(x,i) ((x)->resource[i].start)
+#define SETUP_PARAM char *str
+#define SETUP_PARSE(x) int ints[x]; get_options(str, x, ints)
#endif
+#define PCI_VENDOR_ID_AUREAL 0x12eb
+
/*
* Parport stuff
*/
-#define USE_PARPORT
-
#include <linux/parport.h>
-#include <linux/parport_pc.h>
+
+#define JS_PAR_STATUS_INVERT (0x80)
+#define JS_PAR_CTRL_INVERT (0x04)
#define JS_PAR_DATA_IN(y) parport_read_data(y->port)
#define JS_PAR_DATA_OUT(x,y) parport_write_data(y->port, x)
#define JS_PAR_STATUS(y) parport_read_status(y->port)
+
+#ifndef PARPORT_NEED_GENERIC_OPS
#define JS_PAR_CTRL_IN(y) parport_read_control(y->port)
-#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x)
-#define JS_PAR_ECTRL_OUT(x,y) outb(x, ECONTROL(y->port))
+#else
+#define JS_PAR_CTRL_IN(y) inb(y->port->base+2)
+#endif
-#define JS_PAR_STATUS_INVERT (0x80)
-#define JS_PAR_CTRL_INVERT (0x04)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
+#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x)
+#define JS_PAR_ECTRL_OUT(x,y) parport_write_econtrol(y->port, x)
+#else
+#define JS_PAR_CTRL_OUT(x,y) \
+ do { \
+ if ((x) & 0x20) parport_data_reverse(y->port); \
+ else parport_data_forward(y->port); \
+ parport_write_control(y->port, (x) & ~0x20); \
+ } while (0)
+#define JS_PAR_ECTRL_OUT(x,y) /*parport sets PS/2 mode on ECR chips */
+#define PARPORT_MODE_PCPS2 PARPORT_MODE_TRISTATE
+#define PARPORT_MODE_PCECPPS2 PARPORT_MODE_TRISTATE
+#endif
/*
* Internal types
@@ -194,8 +193,6 @@ typedef struct { int something; } spinlock_t;
struct js_dev;
typedef int (*js_read_func)(void *info, int **axes, int **buttons);
-typedef unsigned int (*js_time_func)(void);
-typedef int (*js_delta_func)(unsigned int x, unsigned int y);
typedef int (*js_ops_func)(struct js_dev *dev);
struct js_data {
@@ -239,20 +236,14 @@ struct js_port {
struct js_corr **corr;
void *info;
int ndevs;
+ int fail;
+ int total;
};
/*
* Sub-module interface
*/
-extern unsigned int js_time_speed;
-extern js_time_func js_get_time;
-extern js_delta_func js_delta;
-
-extern unsigned int js_time_speed_a;
-extern js_time_func js_get_time_a;
-extern js_delta_func js_delta_a;
-
extern struct js_port *js_register_port(struct js_port *port, void *info,
int devs, int infos, js_read_func read);
extern struct js_port *js_unregister_port(struct js_port *port);
@@ -270,19 +261,19 @@ extern int js_am_init(void);
extern int js_an_init(void);
extern int js_as_init(void);
extern int js_console_init(void);
+extern int js_cr_init(void);
extern int js_db9_init(void);
extern int js_gr_init(void);
extern int js_l4_init(void);
extern int js_lt_init(void);
+extern int js_mag_init(void);
+extern int js_pci_init(void);
extern int js_sw_init(void);
+extern int js_sball_init(void);
+extern int js_orb_init(void);
extern int js_tm_init(void);
-
-extern void js_am_setup(char *str, int *ints);
-extern void js_an_setup(char *str, int *ints);
-extern void js_as_setup(char *str, int *ints);
-extern void js_console_setup(char *str, int *ints);
-extern void js_db9_setup(char *str, int *ints);
-extern void js_l4_setup(char *str, int *ints);
+extern int js_tg_init(void);
+extern int js_war_init(void);
#endif /* __KERNEL__ */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b53688676..a9d66b90b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -9,6 +9,7 @@
#include <linux/config.h>
#include <linux/string.h>
#include <linux/list.h>
+#include <linux/mmzone.h>
extern unsigned long max_mapnr;
extern unsigned long num_physpages;
@@ -16,6 +17,7 @@ extern void * high_memory;
extern int page_cluster;
#include <asm/page.h>
+#include <asm/pgtable.h>
#include <asm/atomic.h>
/*
@@ -127,7 +129,6 @@ typedef struct {
* is used for linear searches (eg. clock algorithm scans).
*/
typedef struct page {
- /* these must be first (free area handling) */
struct list_head list;
struct address_space *mapping;
unsigned long index;
@@ -139,6 +140,7 @@ typedef struct page {
struct page **pprev_hash;
struct buffer_head * buffers;
unsigned long virtual; /* nonzero if kmapped */
+ struct zone_struct *zone;
} mem_map_t;
#define get_page(p) atomic_inc(&(p)->count)
@@ -152,8 +154,10 @@ typedef struct page {
#define PG_error 1
#define PG_referenced 2
#define PG_uptodate 3
+#define PG__unused_00 4
#define PG_decr_after 5
-#define PG_DMA 7
+#define PG_unused_01 6
+#define PG__unused_02 7
#define PG_slab 8
#define PG_swap_cache 9
#define PG_skip 10
@@ -179,7 +183,7 @@ typedef struct page {
#define ClearPageError(page) clear_bit(PG_error, &(page)->flags)
#define PageReferenced(page) test_bit(PG_referenced, &(page)->flags)
#define PageDecrAfter(page) test_bit(PG_decr_after, &(page)->flags)
-#define PageDMA(page) test_bit(PG_DMA, &(page)->flags)
+#define PageDMA(page) (contig_page_data.node_zones + ZONE_DMA == (page)->zone)
#define PageSlab(page) test_bit(PG_slab, &(page)->flags)
#define PageSwapCache(page) test_bit(PG_swap_cache, &(page)->flags)
#define PageReserved(page) test_bit(PG_reserved, &(page)->flags)
@@ -216,8 +220,8 @@ typedef struct page {
* PG_reserved is set for a page which must never be accessed (which
* may not even be present).
*
- * PG_DMA is set for those pages which lie in the range of
- * physical addresses capable of carrying DMA transfers.
+ * PG_DMA has been removed, page->zone now tells exactly wether the
+ * page is suited to do DMAing into.
*
* Multiple processes may "see" the same page. E.g. for untouched
* mappings of /dev/null, all processes see the same page full of
@@ -283,19 +287,49 @@ typedef struct page {
extern mem_map_t * mem_map;
/*
- * This is timing-critical - most of the time in getting a new page
- * goes to clearing the page. If you want a page without the clearing
- * overhead, just use __get_free_page() directly..
- *
- * We have two allocation namespaces - the *get*page*() variants
- * return virtual kernel addresses to the allocated page(s), the
- * alloc_page*() variants return 'struct page *'.
+ * There is only one page-allocator function, and two main namespaces to
+ * it. The alloc_page*() variants return 'struct page *' and as such
+ * can allocate highmem pages, the *get*page*() variants return
+ * virtual kernel addresses to the allocated page(s).
*/
-#define __get_free_page(gfp_mask) __get_free_pages((gfp_mask),0)
-#define __get_dma_pages(gfp_mask, order) __get_free_pages((gfp_mask) | GFP_DMA,(order))
-extern unsigned long FASTCALL(__get_free_pages(int gfp_mask, unsigned long order));
-extern struct page * FASTCALL(alloc_pages(int gfp_mask, unsigned long order));
-#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
+extern struct page * FASTCALL(__alloc_pages(zonelist_t *zonelist, unsigned long order));
+extern struct page * alloc_pages_node(int nid, int gfp_mask, unsigned long order);
+
+#ifndef CONFIG_DISCONTIGMEM
+extern inline struct page * alloc_pages(int gfp_mask, unsigned long order)
+{
+ /* temporary check. */
+ if (contig_page_data.node_zonelists[gfp_mask].gfp_mask != (gfp_mask))
+ BUG();
+ /*
+ * Gets optimized away by the compiler.
+ */
+ if (order >= MAX_ORDER)
+ return NULL;
+ return __alloc_pages(contig_page_data.node_zonelists+(gfp_mask), order);
+}
+#else /* !CONFIG_DISCONTIGMEM */
+extern struct page * alloc_pages(int gfp_mask, unsigned long order);
+#endif /* !CONFIG_DISCONTIGMEM */
+
+#define alloc_page(gfp_mask) \
+ alloc_pages(gfp_mask, 0)
+
+extern inline unsigned long __get_free_pages (int gfp_mask, unsigned long order)
+{
+ struct page * page;
+
+ page = alloc_pages(gfp_mask, order);
+ if (!page)
+ return 0;
+ return page_address(page);
+}
+
+#define __get_free_page(gfp_mask) \
+ __get_free_pages((gfp_mask),0)
+
+#define __get_dma_pages(gfp_mask, order) \
+ __get_free_pages((gfp_mask) | GFP_DMA,(order))
extern inline unsigned long get_zeroed_page(int gfp_mask)
{
@@ -312,13 +346,36 @@ extern inline unsigned long get_zeroed_page(int gfp_mask)
*/
#define get_free_page get_zeroed_page
-/* memory.c & swap.c*/
+/*
+ * There is only one 'core' page-freeing function.
+ */
+extern void FASTCALL(__free_pages_ok(struct page * page, unsigned long order));
+
+extern inline void __free_pages(struct page *page, unsigned long order)
+{
+ if (!put_page_testzero(page))
+ return;
+ __free_pages_ok(page, order);
+}
+
+#define __free_page(page) __free_pages(page, 0)
+
+extern inline void free_pages(unsigned long addr, unsigned long order)
+{
+ unsigned long map_nr;
+
+#ifdef CONFIG_DISCONTIGMEM
+ if (addr == 0) return;
+#endif
+ map_nr = MAP_NR(addr);
+ if (map_nr < max_mapnr)
+ __free_pages(mem_map + map_nr, order);
+}
#define free_page(addr) free_pages((addr),0)
-extern int FASTCALL(free_pages(unsigned long addr, unsigned long order));
-extern int FASTCALL(__free_page(struct page *));
extern void show_free_areas(void);
+extern void show_free_areas_node(int nid);
extern struct page * put_dirty_page(struct task_struct * tsk, struct page *page,
unsigned long address);
@@ -329,7 +386,7 @@ extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct
extern int remap_page_range(unsigned long from, unsigned long to, unsigned long size, pgprot_t prot);
extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t prot);
extern int vmap_page_range (unsigned long from, unsigned long size, unsigned long vaddr);
-extern void vmtruncate(struct inode * inode, unsigned long offset);
+extern void vmtruncate(struct inode * inode, loff_t offset);
extern int handle_mm_fault(struct task_struct *tsk,struct vm_area_struct *vma, unsigned long address, int write_access);
extern int make_pages_present(unsigned long addr, unsigned long end);
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
@@ -341,6 +398,8 @@ extern int check_pgt_cache(void);
extern void paging_init(void);
extern void free_area_init(unsigned int * zones_size);
+extern void free_area_init_node(int nid, pg_data_t *pgdat,
+ unsigned int * zones_size, unsigned long zone_start_paddr);
extern void mem_init(void);
extern void show_mem(void);
extern void oom(struct task_struct * tsk);
@@ -355,8 +414,23 @@ extern void build_mmap_avl(struct mm_struct *);
extern void exit_mmap(struct mm_struct *);
extern unsigned long get_unmapped_area(unsigned long, unsigned long);
-extern unsigned long do_mmap(struct file *, unsigned long, unsigned long,
- unsigned long, unsigned long, unsigned long);
+extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long prot,
+ unsigned long flag, unsigned long pgoff);
+
+extern inline unsigned long do_mmap(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long prot,
+ unsigned long flag, unsigned long offset)
+{
+ unsigned long ret = -EINVAL;
+ if ((offset + PAGE_ALIGN(len)) < offset)
+ goto out;
+ if (!(offset & ~PAGE_MASK))
+ ret = do_mmap_pgoff(file, addr, len, prot, flag, offset >> PAGE_SHIFT);
+out:
+ return ret;
+}
+
extern int do_munmap(unsigned long, size_t);
extern unsigned long do_brk(unsigned long, unsigned long);
@@ -364,8 +438,7 @@ extern unsigned long do_brk(unsigned long, unsigned long);
extern void remove_inode_page(struct page *);
extern unsigned long page_unuse(struct page *);
extern int shrink_mmap(int, int);
-extern void truncate_inode_pages(struct inode *, unsigned long);
-extern void put_cached_page(unsigned long);
+extern void truncate_inode_pages(struct inode *, loff_t);
/*
* GFP bitmasks..
@@ -407,7 +480,7 @@ extern void put_cached_page(unsigned long);
#define GFP_DMA __GFP_DMA
/* Flag - indicates that the buffer can be taken from high memory which is not
- directly addressable by the kernel */
+ permanently mapped by the kernel */
#define GFP_HIGHMEM __GFP_HIGHMEM
@@ -456,7 +529,6 @@ extern struct vm_area_struct *find_extend_vma(struct task_struct *tsk, unsigned
#define vmlist_modify_lock(mm) vmlist_access_lock(mm)
#define vmlist_modify_unlock(mm) vmlist_access_unlock(mm)
-
#endif /* __KERNEL__ */
#endif
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 3bc0430bc..73d4c2ade 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -4,5 +4,6 @@
#include <asm/mman.h>
#define MREMAP_MAYMOVE 1
+#define MREMAP_FIXED 2
#endif /* _LINUX_MMAN_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
new file mode 100644
index 000000000..79c206282
--- /dev/null
+++ b/include/linux/mmzone.h
@@ -0,0 +1,115 @@
+#ifndef _LINUX_MMZONE_H
+#define _LINUX_MMZONE_H
+
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+
+#include <linux/config.h>
+#include <linux/spinlock.h>
+#include <linux/list.h>
+
+/*
+ * Free memory management - zoned buddy allocator.
+ */
+
+#if CONFIG_AP1000
+/* the AP+ needs to allocate 8MB contiguous, aligned chunks of ram
+ for the ring buffers */
+#define MAX_ORDER 12
+#else
+#define MAX_ORDER 10
+#endif
+
+typedef struct free_area_struct {
+ struct list_head free_list;
+ unsigned int * map;
+} free_area_t;
+
+typedef struct zone_struct {
+ /*
+ * Commonly accessed fields:
+ */
+ spinlock_t lock;
+ unsigned long offset;
+ unsigned long free_pages;
+ int low_on_memory;
+ unsigned long pages_low, pages_high;
+
+ /*
+ * free areas of different sizes
+ */
+ free_area_t free_area[MAX_ORDER];
+
+ /*
+ * rarely used fields:
+ */
+ char * name;
+ unsigned long size;
+} zone_t;
+
+#define ZONE_DMA 0
+#define ZONE_NORMAL 1
+#define ZONE_HIGHMEM 2
+#define MAX_NR_ZONES 3
+
+/*
+ * One allocation request operates on a zonelist. A zonelist
+ * is a list of zones, the first one is the 'goal' of the
+ * allocation, the other zones are fallback zones, in decreasing
+ * priority.
+ *
+ * Right now a zonelist takes up less than a cacheline. We never
+ * modify it apart from boot-up, and only a few indices are used,
+ * so despite the zonelist table being relatively big, the cache
+ * footprint of this construct is very small.
+ */
+typedef struct zonelist_struct {
+ zone_t * zones [MAX_NR_ZONES+1]; // NULL delimited
+ int gfp_mask;
+} zonelist_t;
+
+#define NR_GFPINDEX 0x100
+
+struct bootmem_data;
+typedef struct pglist_data {
+ zone_t node_zones[MAX_NR_ZONES];
+ zonelist_t node_zonelists[NR_GFPINDEX];
+ struct page *node_mem_map;
+ unsigned long *valid_addr_bitmap;
+ struct bootmem_data *bdata;
+} pg_data_t;
+
+extern int numnodes;
+
+#ifndef CONFIG_DISCONTIGMEM
+
+extern pg_data_t contig_page_data;
+
+#define NODE_DATA(nid) (&contig_page_data)
+#define NODE_MEM_MAP(nid) mem_map
+
+#else /* !CONFIG_DISCONTIGMEM */
+
+#include <asm/mmzone.h>
+
+#endif /* !CONFIG_DISCONTIGMEM */
+
+#define MAP_ALIGN(x) ((((x) % sizeof(mem_map_t)) == 0) ? (x) : ((x) + \
+ sizeof(mem_map_t) - ((x) % sizeof(mem_map_t))))
+
+#ifdef CONFIG_DISCONTIGMEM
+
+#define LOCAL_MAP_NR(kvaddr) \
+ (((unsigned long)(kvaddr)-LOCAL_BASE_ADDR((kvaddr))) >> PAGE_SHIFT)
+#define MAP_NR(kaddr) (LOCAL_MAP_NR((kaddr)) + \
+ (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
+ sizeof(mem_map_t)))
+#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) >= \
+ numnodes) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \
+ NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap)))
+
+#endif /* CONFIG_DISCONTIGMEM */
+
+#endif /* !__ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* _LINUX_MMZONE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index a0fc64c88..ce2d3aa98 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -102,6 +102,7 @@ struct module_info
#define MOD_VISITED 8
#define MOD_USED_ONCE 16
#define MOD_JUST_FREED 32
+#define MOD_INITIALIZING 64
/* Values for query_module's which. */
@@ -111,6 +112,9 @@ struct module_info
#define QM_SYMBOLS 4
#define QM_INFO 5
+/* Can the module be queried? */
+#define MOD_CAN_QUERY(mod) (((mod)->flags & (MOD_RUNNING | MOD_INITIALIZING)) && !((mod)->flags & MOD_DELETED))
+
/* When struct module is extended, we must test whether the new member
is present in the header received from insmod before we can use it.
This function returns true if the member is present. */
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 423119f09..86dc89c47 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -17,11 +17,12 @@
struct quota_mount_options
{
unsigned int flags; /* Flags for diskquotas on this device */
- struct semaphore semaphore; /* lock device while I/O in progress */
+ struct semaphore dqio_sem; /* lock device while I/O in progress */
+ struct semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device */
struct file *files[MAXQUOTAS]; /* fp's to quotafiles */
time_t inode_expire[MAXQUOTAS]; /* expiretime for inode-quota */
time_t block_expire[MAXQUOTAS]; /* expiretime for block-quota */
- char rsquash[MAXQUOTAS]; /* for quotas treat root as any other user */
+ char rsquash[MAXQUOTAS]; /* for quotas threat root as any other user */
};
struct vfsmount
diff --git a/include/linux/msg.h b/include/linux/msg.h
index b3284bfa1..38d10dd72 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -45,7 +45,7 @@ struct msginfo {
unsigned short msgseg;
};
-#define MSGMNI 128 /* <= IPCMNI */ /* max # of msg queue identifiers */
+#define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
#define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
#define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 11acbd7b7..0ce8596ed 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -213,7 +213,7 @@ static inline void ncp_kfree_s(void *obj, int size)
#endif /* DEBUG_NCP_MALLOC */
/* linux/fs/ncpfs/inode.c */
-int ncp_notify_change(struct dentry *, struct iattr *attr);
+int ncp_notify_change(struct dentry *, struct iattr *);
struct super_block *ncp_read_super(struct super_block *, void *, int);
struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);
void ncp_update_inode(struct inode *, struct ncp_entry_info *);
@@ -250,54 +250,24 @@ int ncp_mmap(struct file *, struct vm_area_struct *);
/* linux/fs/ncpfs/ncplib_kernel.c */
int ncp_make_closed(struct inode *);
-static inline void str_upper(char *name)
-{
- while (*name) {
- if (*name >= 'a' && *name <= 'z') {
- *name -= ('a' - 'A');
- }
- name++;
- }
-}
-
-static inline void str_lower(char *name)
-{
- while (*name) {
- if (*name >= 'A' && *name <= 'Z') {
- *name += ('a' - 'A');
- }
- name++;
- }
-}
+#define ncp_namespace(i) (NCP_SERVER(i)->name_space[NCP_FINFO(i)->volNumber])
-static inline int ncp_namespace(struct inode *inode)
+static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator)
{
- struct ncp_server *server = NCP_SERVER(inode);
- return server->name_space[NCP_FINFO(inode)->volNumber];
-}
-
-static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator) {
-#if defined(CONFIG_NCPFS_NFS_NS) || defined(CONFIG_NCPFS_OS2_NS)
+#ifdef CONFIG_NCPFS_SMALLDOS
int ns = ncp_namespace(i);
-#endif
-#if defined(CONFIG_NCPFS_SMALLDOS) && defined(CONFIG_NCPFS_OS2_NS)
- if ((ns == NW_NS_OS2) && (nscreator == NW_NS_DOS))
- return 0;
-#endif
- return
+
+ if ((ns == NW_NS_DOS)
#ifdef CONFIG_NCPFS_OS2_NS
- (ns == NW_NS_OS2) ||
-#endif /* CONFIG_NCPFS_OS2_NS */
-#ifdef CONFIG_NCPFS_NFS_NS
- (ns == NW_NS_NFS) ||
-#endif /* CONFIG_NCPFS_NFS_NS */
- 0;
+ || ((ns == NW_NS_OS2) && (nscreator == NW_NS_DOS))
+#endif /* CONFIG_NCPFS_OS2_NS */
+ )
+ return 0;
+#endif /* CONFIG_NCPFS_SMALLDOS */
+ return 1;
}
-static inline int ncp_preserve_case(struct inode *i)
-{
- return ncp_preserve_entry_case(i, NW_NS_OS2);
-}
+#define ncp_preserve_case(i) (ncp_namespace(i) != NW_NS_DOS)
static inline int ncp_case_sensitive(struct inode *i)
{
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index 6f71f8e37..46f100eb4 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -52,23 +52,23 @@ struct ncp_server {
int root_setuped;
-/* info for packet signing */
- int sign_wanted; /* 1=Server needs signed packets */
- int sign_active; /* 0=don't do signing, 1=do */
+ /* info for packet signing */
+ int sign_wanted; /* 1=Server needs signed packets */
+ int sign_active; /* 0=don't do signing, 1=do */
char sign_root[8]; /* generated from password and encr. key */
char sign_last[16];
/* Authentication info: NDS or BINDERY, username */
struct {
- int auth_type;
- size_t object_name_len;
- void* object_name;
- int object_type;
+ int auth_type;
+ size_t object_name_len;
+ void* object_name;
+ int object_type;
} auth;
/* Password info */
struct {
- size_t len;
- void* data;
+ size_t len;
+ void* data;
} priv;
/* nls info: codepage for volume and charset for I/O */
@@ -77,10 +77,18 @@ struct ncp_server {
/* maximum age in jiffies */
int dentry_ttl;
+
+ /* miscellaneous */
+ unsigned int flags;
};
#define ncp_sb_info ncp_server
+#define NCP_FLAG_UTF8 1
+
+#define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag))
+#define NCP_SET_FLAG(server, flag) ((server)->flags |= (flag))
+#define NCP_IS_FLAG(server, flag) ((server)->flags & (flag))
static inline int ncp_conn_valid(struct ncp_server *server)
{
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 75d6f872d..59e67a859 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -391,7 +391,6 @@ extern __inline__ int unregister_gifconf(unsigned int family)
#define HAVE_NETIF_RX 1
extern void netif_rx(struct sk_buff *skb);
extern void net_bh(void);
-extern int dev_get_info(char *buffer, char **start, off_t offset, int length, int dummy);
extern int dev_ioctl(unsigned int cmd, void *);
extern int dev_change_flags(struct net_device *, unsigned);
extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev);
@@ -423,7 +422,6 @@ extern void ether_setup(struct net_device *dev);
extern void fddi_setup(struct net_device *dev);
extern void tr_setup(struct net_device *dev);
extern void fc_setup(struct net_device *dev);
-extern void tr_freedev(struct net_device *dev);
extern void fc_freedev(struct net_device *dev);
extern int ether_config(struct net_device *dev, struct ifmap *map);
/* Support for loadable net-drivers */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index c188fc808..e476cdbf9 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -1,5 +1,8 @@
/*
* NFS protocol definitions
+ *
+ * This file contains constants mostly for Version 2 of the protocol,
+ * but also has a couple of NFSv3 bits in (notably the error codes).
*/
#ifndef _LINUX_NFS_H
#define _LINUX_NFS_H
@@ -24,30 +27,50 @@
#define NFSMODE_FIFO 0010000
-enum nfs_stat {
- NFS_OK = 0,
- NFSERR_PERM = 1,
- NFSERR_NOENT = 2,
- NFSERR_IO = 5,
- NFSERR_NXIO = 6,
- NFSERR_EAGAIN = 11,
- NFSERR_ACCES = 13,
- NFSERR_EXIST = 17,
- NFSERR_XDEV = 18,
- NFSERR_NODEV = 19,
- NFSERR_NOTDIR = 20,
- NFSERR_ISDIR = 21,
- NFSERR_INVAL = 22, /* that Sun forgot */
- NFSERR_FBIG = 27,
- NFSERR_NOSPC = 28,
- NFSERR_ROFS = 30,
- NFSERR_OPNOTSUPP = 45,
- NFSERR_NAMETOOLONG = 63,
- NFSERR_NOTEMPTY = 66,
- NFSERR_DQUOT = 69,
- NFSERR_STALE = 70,
- NFSERR_WFLUSH = 99
-};
+/*
+ * NFS stats. The good thing with these values is that NFSv3 errors are
+ * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
+ * no-one uses anyway), so we can happily mix code as long as we make sure
+ * no NFSv3 errors are returned to NFSv2 clients.
+ * Error codes that have a `--' in the v2 column are not part of the
+ * standard, but seem to be widely used nevertheless.
+ */
+ enum nfs_stat {
+ NFS_OK = 0, /* v2 v3 */
+ NFSERR_PERM = 1, /* v2 v3 */
+ NFSERR_NOENT = 2, /* v2 v3 */
+ NFSERR_IO = 5, /* v2 v3 */
+ NFSERR_NXIO = 6, /* v2 v3 */
+ NFSERR_EAGAIN = 11, /* v2 v3 */
+ NFSERR_ACCES = 13, /* v2 v3 */
+ NFSERR_EXIST = 17, /* v2 v3 */
+ NFSERR_XDEV = 18, /* v3 */
+ NFSERR_NODEV = 19, /* v2 v3 */
+ NFSERR_NOTDIR = 20, /* v2 v3 */
+ NFSERR_ISDIR = 21, /* v2 v3 */
+ NFSERR_INVAL = 22, /* v2 v3 that Sun forgot */
+ NFSERR_FBIG = 27, /* v2 v3 */
+ NFSERR_NOSPC = 28, /* v2 v3 */
+ NFSERR_ROFS = 30, /* v2 v3 */
+ NFSERR_MLINK = 31, /* v3 */
+ NFSERR_OPNOTSUPP = 45, /* v2 v3 */
+ NFSERR_NAMETOOLONG = 63, /* v2 v3 */
+ NFSERR_NOTEMPTY = 66, /* v2 v3 */
+ NFSERR_DQUOT = 69, /* v2 v3 */
+ NFSERR_STALE = 70, /* v2 v3 */
+ NFSERR_REMOTE = 71, /* v2 v3 */
+ NFSERR_WFLUSH = 99, /* v2 */
+ NFSERR_BADHANDLE = 10001, /* v3 */
+ NFSERR_NOT_SYNC = 10002, /* v3 */
+ NFSERR_BAD_COOKIE = 10003, /* v3 */
+ NFSERR_NOTSUPP = 10004, /* v3 */
+ NFSERR_TOOSMALL = 10005, /* v3 */
+ NFSERR_SERVERFAULT = 10006, /* v3 */
+ NFSERR_BADTYPE = 10007, /* v3 */
+ NFSERR_JUKEBOX = 10008 /* v3 */
+ };
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
enum nfs_ftype {
NFNON = 0,
@@ -93,7 +116,14 @@ struct nfs_fh {
#define NFS_MNT_PORT 627
#define NFS_MNTPROC_MNT 1
#define NFS_MNTPROC_UMNT 3
-#endif
+
+/*
+ * This is really a general kernel constant, but since nothing like
+ * this is defined in the kernel headers, I have to do it here.
+ */
+#define NFS_OFFSET_MAX ((__s64)((~(__u64)0) >> 1))
+
+#endif /* __KERNEL__ */
#if defined(__KERNEL__) || defined(NFS_NEED_KERNEL_TYPES)
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
index 94ec44b6a..cf5405b35 100644
--- a/include/linux/nfs3.h
+++ b/include/linux/nfs3.h
@@ -12,7 +12,6 @@
#define NFS3_MAXPATHLEN PATH_MAX
#define NFS3_MAXNAMLEN NAME_MAX
#define NFS3_MAXGROUPS 16
-#define NFS3_FHSIZE NFS_FHSIZE
#define NFS3_COOKIESIZE 4
#define NFS3_FIFO_DEV (-1)
#define NFS3MODE_FMT 0170000
@@ -25,38 +24,28 @@
#define NFS3MODE_FIFO 0010000
-enum nfs3_stat {
- NFS3_OK = 0,
- NFS3ERR_PERM = 1,
- NFS3ERR_NOENT = 2,
- NFS3ERR_IO = 5,
- NFS3ERR_NXIO = 6,
- NFS3ERR_EAGAIN = 11,
- NFS3ERR_ACCES = 13,
- NFS3ERR_EXIST = 17,
- NFS3ERR_XDEV = 18, /* new in NFSv3 */
- NFS3ERR_NODEV = 19,
- NFS3ERR_NOTDIR = 20,
- NFS3ERR_ISDIR = 21,
- NFS3ERR_INVAL = 22, /* new in NFSv3 */
- NFS3ERR_FBIG = 27,
- NFS3ERR_NOSPC = 28,
- NFS3ERR_ROFS = 30,
- NFS3ERR_MLINK = 31, /* new in NFSv3 */
- NFS3ERR_NAMETOOLONG = 63,
- NFS3ERR_NOTEMPTY = 66,
- NFS3ERR_DQUOT = 69,
- NFS3ERR_STALE = 70,
- NFS3ERR_REMOTE = 71, /* new in NFSv3 */
- NFS3ERR_BADHANDLE = 10001,/* ditto */
- NFS3ERR_NOT_SYNC = 10002,/* ditto */
- NFS3ERR_BAD_COOKIE = 10003,/* ditto */
- NFS3ERR_NOTSUPP = 10004,/* ditto */
- NFS3ERR_TOOSMALL = 10005,/* ditto */
- NFS3ERR_SERVERFAULT = 10006,/* ditto */
- NFS3ERR_BADTYPE = 10007,/* ditto */
- NFS3ERR_JUKEBOX = 10008,/* ditto */
-};
+/* Flags for access() call */
+#define NFS3_ACCESS_READ 0x0001
+#define NFS3_ACCESS_LOOKUP 0x0002
+#define NFS3_ACCESS_MODIFY 0x0004
+#define NFS3_ACCESS_EXTEND 0x0008
+#define NFS3_ACCESS_DELETE 0x0010
+#define NFS3_ACCESS_EXECUTE 0x0020
+
+/* Flags for create mode */
+#define NFS3_CREATE_UNCHECKED 0
+#define NFS3_CREATE_GUARDED 1
+#define NFS3_CREATE_EXCLUSIVE 2
+
+/* NFSv3 file system properties */
+#define NFS3_FSF_LINK 0x0001
+#define NFS3_FSF_SYMLINK 0x0002
+#define NFS3_FSF_HOMOGENEOUS 0x0008
+#define NFS3_FSF_CANSETTIME 0x0010
+/* Some shorthands. See fs/nfsd/nfs3proc.c */
+#define NFS3_FSF_DEFAULT 0x001B
+#define NFS3_FSF_BILLYBOY 0x0018
+#define NFS3_FSF_READONLY 0x0008
enum nfs3_ftype {
NF3NON = 0,
@@ -92,10 +81,8 @@ enum nfs3_ftype {
#if defined(__KERNEL__) || defined(NFS_NEED_KERNEL_TYPES)
-struct nfs3_fh {
- __u32 size;
- __u8 data[NFS3_FHSIZE];
-};
+/* Number of 32bit words in post_op_attr */
+#define NFS3_POST_OP_ATTR_WORDS 22
struct nfs3_fattr {
enum nfs3_ftype type;
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index df6b7c8df..f2a114a58 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -212,7 +212,7 @@ extern int nfs_lock(struct file *, int, struct file_lock *);
/*
* linux/fs/nfs/write.c
*/
-extern int nfs_writepage(struct file *, struct page *);
+extern int nfs_writepage(struct dentry *, struct page *);
extern int nfs_check_failed_request(struct inode *);
/*
@@ -233,7 +233,7 @@ extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned
/*
* linux/fs/nfs/read.c
*/
-extern int nfs_readpage(struct file *, struct page *);
+extern int nfs_readpage(struct dentry *, struct page *);
/*
* linux/fs/mount_clnt.c
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h
index 0727e1288..22c7ff1e8 100644
--- a/include/linux/nfsd/const.h
+++ b/include/linux/nfsd/const.h
@@ -1,19 +1,14 @@
/*
- * include/linux/nfsd/nfsconst.h
+ * include/linux/nfsd/const.h
*
* Various constants related to NFS.
*
- * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
*/
-#ifndef __NFSCONST_H__
-#define __NFSCONST_H__
+#ifndef _LINUX_NFSD_CONST_H
+#define _LINUX_NFSD_CONST_H
-#include <linux/limits.h>
-#include <linux/types.h>
-#include <linux/unistd.h>
-#include <linux/dirent.h>
-#include <linux/fs.h>
#include <linux/nfs.h>
/*
@@ -33,7 +28,7 @@
#define NFS3_MAXPATHLEN PATH_MAX
#define NFS3_MAXNAMLEN NAME_MAX
-#define NFS3_FHSIZE NFS_FHSIZE
+#define NFS3_FHSIZE 64
#define NFS3_COOKIEVERFSIZE 8
#define NFS3_CREATEVERFSIZE 8
#define NFS3_WRITEVERFSIZE 8
@@ -44,43 +39,6 @@
# define NFS_SUPER_MAGIC 0x6969
#endif
-/*
- * NFS stats. The good thing with these values is that NFSv3 errors are
- * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
- * no-one uses anyway), so we can happily mix code as long as we make sure
- * no NFSv3 errors are returned to NFSv2 clients.
- */
-#define NFS_OK 0 /* v2 v3 */
-#define NFSERR_PERM 1 /* v2 v3 */
-#define NFSERR_NOENT 2 /* v2 v3 */
-#define NFSERR_IO 5 /* v2 v3 */
-#define NFSERR_NXIO 6 /* v2 v3 */
-#define NFSERR_ACCES 13 /* v2 v3 */
-#define NFSERR_EXIST 17 /* v2 v3 */
-#define NFSERR_XDEV 18 /* v3 */
-#define NFSERR_NODEV 19 /* v2 v3 */
-#define NFSERR_NOTDIR 20 /* v2 v3 */
-#define NFSERR_ISDIR 21 /* v2 v3 */
-#define NFSERR_INVAL 22 /* v3 */
-#define NFSERR_FBIG 27 /* v2 v3 */
-#define NFSERR_NOSPC 28 /* v2 v3 */
-#define NFSERR_ROFS 30 /* v2 v3 */
-#define NFSERR_MLINK 31 /* v3 */
-#define NFSERR_NAMETOOLONG 63 /* v2 v3 */
-#define NFSERR_NOTEMPTY 66 /* v2 v3 */
-#define NFSERR_DQUOT 69 /* v2 v3 */
-#define NFSERR_STALE 70 /* v2 v3 */
-#define NFSERR_REMOTE 71 /* v3 */
-#define NFSERR_WFLUSH 99 /* v2 */
-#define NFSERR_BADHANDLE 10001 /* v3 */
-#define NFSERR_NOT_SYNC 10002 /* v3 */
-#define NFSERR_BAD_COOKIE 10003 /* v3 */
-#define NFSERR_NOTSUPP 10004 /* v3 */
-#define NFSERR_TOOSMALL 10005 /* v3 */
-#define NFSERR_SERVERFAULT 10006 /* v3 */
-#define NFSERR_BADTYPE 10007 /* v3 */
-#define NFSERR_JUKEBOX 10008 /* v3 */
-
#endif /* __KERNEL__ */
-#endif /* __NFSCONST_H__ */
+#endif /* _LINUX_NFSD_CONST_H */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 1f3a61486..febb7c741 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -4,16 +4,17 @@
* Public declarations for NFS exports. The definitions for the
* syscall interface are in nfsctl.h
*
- * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
*/
#ifndef NFSD_EXPORT_H
#define NFSD_EXPORT_H
-#include <linux/types.h>
-#include <linux/socket.h>
-#include <linux/in.h>
-#include <linux/fs.h>
+#include <asm/types.h>
+#ifdef __KERNEL__
+# include <linux/types.h>
+# include <linux/in.h>
+#endif
/*
* Important limits for the exports stuff.
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 4c32fe530..25b95ee44 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -4,12 +4,13 @@
* Hodge-podge collection of knfsd-related stuff.
* I will sort this out later.
*
- * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
*/
#ifndef LINUX_NFSD_NFSD_H
#define LINUX_NFSD_NFSD_H
+#include <linux/config.h>
#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/dirent.h>
@@ -24,7 +25,7 @@
/*
* nfsd version
*/
-#define NFSD_VERSION "0.4"
+#define NFSD_VERSION "0.5"
#ifdef __KERNEL__
/*
@@ -61,6 +62,9 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
* Procedure table for NFSv2
*/
extern struct svc_procedure nfsd_procedures2[];
+#ifdef CONFIG_NFSD_V3
+extern struct svc_procedure nfsd_procedures3[];
+#endif /* CONFIG_NFSD_V3 */
extern struct svc_program nfsd_program;
/*
@@ -74,11 +78,20 @@ void nfsd_racache_init(void);
void nfsd_racache_shutdown(void);
int nfsd_lookup(struct svc_rqst *, struct svc_fh *,
const char *, int, struct svc_fh *);
+#ifdef CONFIG_NFSD_V3
+int nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *);
+#endif /* CONFIG_NFSD_V3 */
int nfsd_setattr(struct svc_rqst *, struct svc_fh *,
struct iattr *);
int nfsd_create(struct svc_rqst *, struct svc_fh *,
char *name, int len, struct iattr *attrs,
int type, dev_t rdev, struct svc_fh *res);
+#ifdef CONFIG_NFSD_V3
+int nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
+ char *name, int len, struct iattr *attrs,
+ struct svc_fh *res, int createmode,
+ u32 *verifier);
+#endif /* CONFIG_NFSD_V3 */
int nfsd_open(struct svc_rqst *, struct svc_fh *, int,
int, struct file *);
void nfsd_close(struct file *);
@@ -90,7 +103,7 @@ int nfsd_readlink(struct svc_rqst *, struct svc_fh *,
char *, int *);
int nfsd_symlink(struct svc_rqst *, struct svc_fh *,
char *name, int len, char *path, int plen,
- struct svc_fh *res);
+ struct svc_fh *res, struct iattr *);
int nfsd_link(struct svc_rqst *, struct svc_fh *,
char *, int, struct svc_fh *);
int nfsd_rename(struct svc_rqst *,
@@ -104,9 +117,13 @@ int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
unsigned long size);
int nfsd_readdir(struct svc_rqst *, struct svc_fh *,
loff_t, encode_dent_fn,
- u32 *buffer, int *countp);
+ u32 *buffer, int *countp, u32 *verf);
int nfsd_statfs(struct svc_rqst *, struct svc_fh *,
struct statfs *);
+#ifdef CONFIG_NFSD_V3
+int nfsd_commit(struct svc_rqst *, struct svc_fh *,
+ off_t, unsigned long);
+#endif /* CONFIG_NFSD_V3 */
int nfsd_notify_change(struct inode *, struct iattr *);
int nfsd_permission(struct svc_export *, struct dentry *, int);
@@ -146,6 +163,7 @@ extern u32 nfs_ok,
nfserr_rofs,
nfserr_mlink,
nfserr_nametoolong,
+ nfserr_notempty,
nfserr_dquot,
nfserr_stale,
nfserr_remote,
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index ca34d85e3..ac73ca409 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -11,12 +11,16 @@
* Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
*/
-#ifndef NFSD_FH_H
-#define NFSD_FH_H
+#ifndef _LINUX_NFSD_FH_H
+#define _LINUX_NFSD_FH_H
-#include <linux/types.h>
-#include <linux/string.h>
-#include <linux/fs.h>
+#include <asm/types.h>
+#ifdef __KERNEL__
+# include <linux/config.h>
+# include <linux/types.h>
+# include <linux/string.h>
+# include <linux/fs.h>
+#endif
#include <linux/nfsd/const.h>
#include <linux/nfsd/debug.h>
@@ -83,12 +87,33 @@ typedef struct svc_fh {
struct knfs_fh fh_handle; /* FH data */
struct dentry * fh_dentry; /* validated dentry */
struct svc_export * fh_export; /* export pointer */
- size_t fh_pre_size; /* size before operation */
- time_t fh_pre_mtime; /* mtime before oper */
- time_t fh_pre_ctime; /* ctime before oper */
- unsigned long fh_post_version;/* inode version after oper */
+#ifdef CONFIG_NFSD_V3
+ unsigned char fh_post_saved; /* post-op attrs saved */
+ unsigned char fh_pre_saved; /* pre-op attrs saved */
+#endif /* CONFIG_NFSD_V3 */
unsigned char fh_locked; /* inode locked by us */
unsigned char fh_dverified; /* dentry has been checked */
+
+#ifdef CONFIG_NFSD_V3
+ /* Pre-op attributes saved during fh_lock */
+ __u64 fh_pre_size; /* size before operation */
+ time_t fh_pre_mtime; /* mtime before oper */
+ time_t fh_pre_ctime; /* ctime before oper */
+
+ /* Post-op attributes saved in fh_unlock */
+ umode_t fh_post_mode; /* i_mode */
+ nlink_t fh_post_nlink; /* i_nlink */
+ uid_t fh_post_uid; /* i_uid */
+ gid_t fh_post_gid; /* i_gid */
+ __u64 fh_post_size; /* i_size */
+ unsigned long fh_post_blocks; /* i_blocks */
+ unsigned long fh_post_blksize;/* i_blksize */
+ kdev_t fh_post_rdev; /* i_rdev */
+ time_t fh_post_atime; /* i_atime */
+ time_t fh_post_mtime; /* i_mtime */
+ time_t fh_post_ctime; /* i_ctime */
+#endif /* CONFIG_NFSD_V3 */
+
} svc_fh;
/*
@@ -129,6 +154,53 @@ fh_init(struct svc_fh *fhp)
return fhp;
}
+#ifdef CONFIG_NFSD_V3
+/*
+ * Fill in the pre_op attr for the wcc data
+ */
+static inline void
+fill_pre_wcc(struct svc_fh *fhp)
+{
+ struct inode *inode;
+
+ inode = fhp->fh_dentry->d_inode;
+ if (!fhp->fh_pre_saved) {
+ fhp->fh_pre_mtime = inode->i_mtime;
+ fhp->fh_pre_ctime = inode->i_ctime;
+ fhp->fh_pre_size = inode->i_size;
+ fhp->fh_pre_saved = 1;
+ }
+ fhp->fh_locked = 1;
+}
+
+/*
+ * Fill in the post_op attr for the wcc data
+ */
+static inline void
+fill_post_wcc(struct svc_fh *fhp)
+{
+ struct inode *inode = fhp->fh_dentry->d_inode;
+
+ if (fhp->fh_post_saved)
+ printk("nfsd: inode locked twice during operation.\n");
+
+ fhp->fh_post_mode = inode->i_mode;
+ fhp->fh_post_nlink = inode->i_nlink;
+ fhp->fh_post_uid = inode->i_uid;
+ fhp->fh_post_gid = inode->i_gid;
+ fhp->fh_post_size = inode->i_size;
+ fhp->fh_post_blksize = inode->i_blksize;
+ fhp->fh_post_blocks = inode->i_blocks;
+ fhp->fh_post_rdev = inode->i_rdev;
+ fhp->fh_post_atime = inode->i_atime;
+ fhp->fh_post_mtime = inode->i_mtime;
+ fhp->fh_post_ctime = inode->i_ctime;
+ fhp->fh_post_saved = 1;
+ fhp->fh_locked = 0;
+}
+#endif /* CONFIG_NFSD_V3 */
+
+
/*
* Lock a file handle/inode
*/
@@ -138,10 +210,9 @@ fh_lock(struct svc_fh *fhp)
struct dentry *dentry = fhp->fh_dentry;
struct inode *inode;
- /*
dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n",
- SVCFH_DEV(fhp), SVCFH_INO(fhp), fhp->fh_locked);
- */
+ SVCFH_DEV(fhp), (long)SVCFH_INO(fhp), fhp->fh_locked);
+
if (!fhp->fh_dverified) {
printk(KERN_ERR "fh_lock: fh not verified!\n");
return;
@@ -154,9 +225,11 @@ fh_lock(struct svc_fh *fhp)
inode = dentry->d_inode;
down(&inode->i_sem);
- if (!fhp->fh_pre_mtime)
- fhp->fh_pre_mtime = inode->i_mtime;
+#ifdef CONFIG_NFSD_V3
+ fill_pre_wcc(fhp);
+#else
fhp->fh_locked = 1;
+#endif /* CONFIG_NFSD_V3 */
}
/*
@@ -169,44 +242,19 @@ fh_unlock(struct svc_fh *fhp)
printk(KERN_ERR "fh_unlock: fh not verified!\n");
if (fhp->fh_locked) {
+#ifdef CONFIG_NFSD_V3
+ fill_post_wcc(fhp);
+ up(&fhp->fh_dentry->d_inode->i_sem);
+#else
struct dentry *dentry = fhp->fh_dentry;
struct inode *inode = dentry->d_inode;
- if (!fhp->fh_post_version)
- fhp->fh_post_version = inode->i_version;
fhp->fh_locked = 0;
up(&inode->i_sem);
+#endif /* CONFIG_NFSD_V3 */
}
}
-
-/*
- * Release an inode
- */
-#if 0
-#define fh_put(fhp) __fh_put(fhp, __FILE__, __LINE__)
-
-static inline void
-__fh_put(struct svc_fh *fhp, char *file, int line)
-{
- struct dentry *dentry;
-
- if (!fhp->fh_dverified)
- return;
-
- dentry = fhp->fh_dentry;
- if (!dentry->d_count) {
- printk("nfsd: trying to free free dentry in %s:%d\n"
- " file %s/%s\n",
- file, line,
- dentry->d_parent->d_name.name, dentry->d_name.name);
- } else {
- fh_unlock(fhp);
- fhp->fh_dverified = 0;
- dput(dentry);
- }
-}
-#endif
-
#endif /* __KERNEL__ */
-#endif /* NFSD_FH_H */
+
+#endif /* _LINUX_NFSD_FH_H */
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index 4ce3f06cd..4169a1e21 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -13,11 +13,11 @@ struct nfsd_stats {
unsigned int rchits; /* repcache hits */
unsigned int rcmisses; /* repcache hits */
unsigned int rcnocache; /* uncached reqs */
- unsigned int fh_cached; /* dentry cached */
- unsigned int fh_valid; /* dentry validated */
- unsigned int fh_fixup; /* dentry fixup validated */
- unsigned int fh_lookup; /* new lookup required */
unsigned int fh_stale; /* FH stale error */
+ unsigned int fh_lookup; /* dentry cached */
+ unsigned int fh_anon; /* anon file dentry returned */
+ unsigned int fh_nocache_dir; /* filehandle not foudn in dcache */
+ unsigned int fh_nocache_nondir; /* filehandle not foudn in dcache */
};
#ifdef __KERNEL__
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 019d33f76..1d42ec550 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -3,15 +3,18 @@
*
* This file holds all declarations for the knfsd syscall interface.
*
- * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
*/
#ifndef NFSD_SYSCALL_H
#define NFSD_SYSCALL_H
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/socket.h>
+#include <asm/types.h>
+#ifdef __KERNEL__
+# include <linux/config.h>
+# include <linux/types.h>
+# include <linux/in.h>
+#endif
#include <linux/posix_types.h>
#include <linux/nfsd/const.h>
#include <linux/nfsd/export.h>
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 54e11c549..7b787bb93 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -3,17 +3,18 @@
*
* XDR types for NFSv3 in nfsd.
*
- * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
+ * Copyright (C) 1996-1998, Olaf Kirch <okir@monad.swb.de>
*/
-#ifndef LINUX_NFSD_XDR3_H
-#define LINUX_NFSD_XDR3_H
+#ifndef _LINUX_NFSD_XDR3_H
+#define _LINUX_NFSD_XDR3_H
#include <linux/nfsd/xdr.h>
struct nfsd3_sattrargs {
struct svc_fh fh;
struct iattr attrs;
+ int check_guard;
time_t guardtime;
};
@@ -88,7 +89,7 @@ struct nfsd3_symlinkargs {
struct nfsd3_readdirargs {
struct svc_fh fh;
- __u32 cookie;
+ __u64 cookie;
__u32 dircount;
__u32 count;
__u32 * verf;
@@ -97,7 +98,7 @@ struct nfsd3_readdirargs {
struct nfsd3_commitargs {
struct svc_fh fh;
__u64 offset;
- __u64 count;
+ __u32 count;
};
struct nfsd3_attrstat {
@@ -105,7 +106,8 @@ struct nfsd3_attrstat {
struct svc_fh fh;
};
-struct nfsd3_lookupres {
+/* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */
+struct nfsd3_diropres {
__u32 status;
struct svc_fh dirfh;
struct svc_fh fh;
@@ -137,12 +139,6 @@ struct nfsd3_writeres {
int committed;
};
-struct nfsd3_createres {
- __u32 status;
- struct svc_fh dirfh;
- struct svc_fh fh;
-};
-
struct nfsd3_renameres {
__u32 status;
struct svc_fh ffh;
@@ -158,10 +154,11 @@ struct nfsd3_linkres {
struct nfsd3_readdirres {
__u32 status;
struct svc_fh fh;
- __u32 * list_end;
+ int count;
+ __u32 verf[2];
};
-struct nfsd3_statfsres {
+struct nfsd3_fsstatres {
__u32 status;
struct statfs stats;
__u32 invarsec;
@@ -184,6 +181,8 @@ struct nfsd3_pathconfres {
__u32 status;
__u32 p_link_max;
__u32 p_name_max;
+ __u32 p_no_trunc;
+ __u32 p_chown_restricted;
__u32 p_case_insensitive;
__u32 p_case_preserving;
};
@@ -194,7 +193,7 @@ struct nfsd3_commitres {
};
/* dummy type for release */
-struct nfsd3_fhandle2 {
+struct nfsd3_fhandle_pair {
__u32 dummy;
struct svc_fh fh1;
struct svc_fh fh2;
@@ -213,16 +212,15 @@ union nfsd3_xdrstore {
struct nfsd3_linkargs linkargs;
struct nfsd3_symlinkargs symlinkargs;
struct nfsd3_readdirargs readdirargs;
- struct nfsd3_lookupres lookupres;
+ struct nfsd3_diropres diropres;
struct nfsd3_accessres accessres;
struct nfsd3_readlinkres readlinkres;
struct nfsd3_readres readres;
struct nfsd3_writeres writeres;
- struct nfsd3_createres createres;
struct nfsd3_renameres renameres;
struct nfsd3_linkres linkres;
struct nfsd3_readdirres readdirres;
- struct nfsd3_statfsres statfsres;
+ struct nfsd3_fsstatres fsstatres;
struct nfsd3_fsinfores fsinfores;
struct nfsd3_pathconfres pathconfres;
struct nfsd3_commitres commitres;
@@ -230,39 +228,87 @@ union nfsd3_xdrstore {
#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
-void nfsxdr_init(void);
-
int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct svc_fh *);
-int nfs3svc_decode_sattr3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *,
struct nfsd3_sattrargs *);
-int nfs3svc_decode_dirop3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *,
struct nfsd3_diropargs *);
-int nfs3svc_decode_read3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *,
+ struct nfsd3_accessargs *);
+int nfs3svc_decode_readargs(struct svc_rqst *, u32 *,
struct nfsd3_readargs *);
-int nfs3svc_decode_write3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *,
struct nfsd3_writeargs *);
-int nfs3svc_decode_create3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_createargs(struct svc_rqst *, u32 *,
+ struct nfsd3_createargs *);
+int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *,
struct nfsd3_createargs *);
-int nfs3svc_decode_rename3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *,
+ struct nfsd3_mknodargs *);
+int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *,
struct nfsd3_renameargs *);
-int nfs3svc_decode_link3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *,
struct nfsd3_linkargs *);
-int nfs3svc_decode_symlink3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *,
struct nfsd3_symlinkargs *);
-int nfs3svc_decode_readdir3args(struct svc_rqst *, u32 *,
+int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *,
struct nfsd3_readdirargs *);
+int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *,
+ struct nfsd3_readdirargs *);
+int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *,
+ struct nfsd3_commitargs *);
+int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *);
+int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *,
+ struct nfsd3_attrstat *);
+int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *,
+ struct nfsd3_attrstat *);
+int nfs3svc_encode_diropres(struct svc_rqst *, u32 *,
+ struct nfsd3_diropres *);
+int nfs3svc_encode_accessres(struct svc_rqst *, u32 *,
+ struct nfsd3_accessres *);
int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *,
struct nfsd3_readlinkres *);
int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *);
-int nfs3svc_encode_statfsres(struct svc_rqst *, u32 *,
- struct nfsd3_statfsres *);
+int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *);
+int nfs3svc_encode_createres(struct svc_rqst *, u32 *,
+ struct nfsd3_diropres *);
+int nfs3svc_encode_renameres(struct svc_rqst *, u32 *,
+ struct nfsd3_renameres *);
+int nfs3svc_encode_linkres(struct svc_rqst *, u32 *,
+ struct nfsd3_linkres *);
int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *,
struct nfsd3_readdirres *);
+int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *,
+ struct nfsd3_fsstatres *);
+int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *,
+ struct nfsd3_fsinfores *);
+int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *,
+ struct nfsd3_pathconfres *);
+int nfs3svc_encode_commitres(struct svc_rqst *, u32 *,
+ struct nfsd3_commitres *);
+
int nfs3svc_release_fhandle(struct svc_rqst *, u32 *,
- struct nfsd_fhandle *);
+ struct nfsd3_attrstat *);
int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *,
- struct nfsd3_fhandle2 *);
+ struct nfsd3_fhandle_pair *);
int nfs3svc_encode_entry(struct readdir_cd *, const char *name,
- int namlen, unsigned long offset, ino_t ino);
+ int namlen, off_t offset, ino_t ino);
+int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name,
+ int namlen, off_t offset, ino_t ino);
+
+#ifdef __KERNEL__
+
+/*
+ * This is needed in nfs_readdir for encoding NFS3 directory cookies.
+ */
+static inline u32 *
+enc64(u32 *p, u64 val)
+{
+ *p++ = htonl(val >> 32);
+ *p++ = htonl(val & 0xffffffff);
+ return p;
+}
+
+#endif /* __KERNEL__ */
-#endif /* LINUX_NFSD_XDR3_H */
+#endif /* _LINUX_NFSD_XDR3_H */
diff --git a/include/linux/nls.h b/include/linux/nls.h
index efcd58920..9e39d3cd4 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -7,7 +7,8 @@ struct nls_table {
char *charset;
unsigned char **page_uni2charset;
struct nls_unicode *charset2uni;
-
+ unsigned char *charset2lower;
+ unsigned char *charset2upper;
void (*inc_use_count) (void);
void (*dec_use_count) (void);
struct nls_table *next;
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 66b558627..53bc365d2 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -13,6 +13,7 @@
#include <asm/system.h>
#include <asm/pgtable.h>
+#include <linux/highmem.h>
/*
* The page cache can done in larger chunks than
@@ -79,7 +80,6 @@ extern void lock_page(struct page *page);
extern void __add_page_to_hash_queue(struct page * page, struct page **p);
extern void add_to_page_cache(struct page * page, struct address_space *mapping, unsigned long index);
-extern int add_to_page_cache_unique(struct page * page, struct address_space *mapping, unsigned long index, struct page **hash);
extern inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long index)
{
@@ -117,4 +117,10 @@ extern inline void wait_on_page(struct page * page)
___wait_on_page(page);
}
+extern struct page * grab_cache_page (struct address_space *, unsigned long);
+
+typedef int filler_t(void *, struct page*);
+
+extern struct page *read_cache_page(struct address_space *, unsigned long,
+ filler_t *, void *);
#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 96a9dd076..0335bd565 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -3,7 +3,7 @@
*
* PCI defines and function prototypes
* Copyright 1994, Drew Eckhardt
- * Copyright 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ * Copyright 1997--1999 Martin Mares <mj@suse.cz>
*
* For more information, please consult the following manuals (look at
* http://www.pcisig.com/ for how to get them):
@@ -404,11 +404,20 @@ struct pci_ops {
int (*write_dword)(struct pci_dev *, int where, u32 val);
};
+struct pbus_set_ranges_data
+{
+ int found_vga;
+ unsigned long io_start, io_end;
+ unsigned long mem_start, mem_end;
+};
+
void pcibios_init(void);
void pcibios_fixup_bus(struct pci_bus *);
+void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
int pcibios_enable_device(struct pci_dev *);
char *pcibios_setup (char *str);
+void pcibios_align_resource(void *, struct resource *, unsigned long);
void pcibios_update_resource(struct pci_dev *, struct resource *,
struct resource *, int);
void pcibios_update_irq(struct pci_dev *, int irq);
@@ -441,6 +450,7 @@ struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
int pci_proc_attach_device(struct pci_dev *dev);
int pci_proc_detach_device(struct pci_dev *dev);
void pci_name_device(struct pci_dev *dev);
+char *pci_class_name(u32 class);
void pci_read_bridge_bases(struct pci_bus *child);
struct resource *pci_find_parent_resource(struct pci_dev *dev, struct resource *res);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3015837a3..7e0979b98 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -27,32 +27,37 @@
#define PCI_BASE_CLASS_DISPLAY 0x03
#define PCI_CLASS_DISPLAY_VGA 0x0300
#define PCI_CLASS_DISPLAY_XGA 0x0301
+#define PCI_CLASS_DISPLAY_3D 0x0302
#define PCI_CLASS_DISPLAY_OTHER 0x0380
#define PCI_BASE_CLASS_MULTIMEDIA 0x04
#define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400
#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401
+#define PCI_CLASS_MULTIMEDIA_PHONE 0x0402
#define PCI_CLASS_MULTIMEDIA_OTHER 0x0480
#define PCI_BASE_CLASS_MEMORY 0x05
-#define PCI_CLASS_MEMORY_RAM 0x0500
-#define PCI_CLASS_MEMORY_FLASH 0x0501
-#define PCI_CLASS_MEMORY_OTHER 0x0580
+#define PCI_CLASS_MEMORY_RAM 0x0500
+#define PCI_CLASS_MEMORY_FLASH 0x0501
+#define PCI_CLASS_MEMORY_OTHER 0x0580
#define PCI_BASE_CLASS_BRIDGE 0x06
-#define PCI_CLASS_BRIDGE_HOST 0x0600
-#define PCI_CLASS_BRIDGE_ISA 0x0601
-#define PCI_CLASS_BRIDGE_EISA 0x0602
-#define PCI_CLASS_BRIDGE_MC 0x0603
-#define PCI_CLASS_BRIDGE_PCI 0x0604
-#define PCI_CLASS_BRIDGE_PCMCIA 0x0605
-#define PCI_CLASS_BRIDGE_NUBUS 0x0606
-#define PCI_CLASS_BRIDGE_CARDBUS 0x0607
-#define PCI_CLASS_BRIDGE_OTHER 0x0680
+#define PCI_CLASS_BRIDGE_HOST 0x0600
+#define PCI_CLASS_BRIDGE_ISA 0x0601
+#define PCI_CLASS_BRIDGE_EISA 0x0602
+#define PCI_CLASS_BRIDGE_MC 0x0603
+#define PCI_CLASS_BRIDGE_PCI 0x0604
+#define PCI_CLASS_BRIDGE_PCMCIA 0x0605
+#define PCI_CLASS_BRIDGE_NUBUS 0x0606
+#define PCI_CLASS_BRIDGE_CARDBUS 0x0607
+#define PCI_CLASS_BRIDGE_RACEWAY 0x0608
+#define PCI_CLASS_BRIDGE_OTHER 0x0680
#define PCI_BASE_CLASS_COMMUNICATION 0x07
#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700
#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701
+#define PCI_CLASS_COMMUNICATION_MULTISERIAL 0x0702
+#define PCI_CLASS_COMMUNICATION_MODEM 0x0703
#define PCI_CLASS_COMMUNICATION_OTHER 0x0780
#define PCI_BASE_CLASS_SYSTEM 0x08
@@ -60,17 +65,20 @@
#define PCI_CLASS_SYSTEM_DMA 0x0801
#define PCI_CLASS_SYSTEM_TIMER 0x0802
#define PCI_CLASS_SYSTEM_RTC 0x0803
+#define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804
#define PCI_CLASS_SYSTEM_OTHER 0x0880
#define PCI_BASE_CLASS_INPUT 0x09
#define PCI_CLASS_INPUT_KEYBOARD 0x0900
#define PCI_CLASS_INPUT_PEN 0x0901
#define PCI_CLASS_INPUT_MOUSE 0x0902
+#define PCI_CLASS_INPUT_SCANNER 0x0903
+#define PCI_CLASS_INPUT_GAMEPORT 0x0904
#define PCI_CLASS_INPUT_OTHER 0x0980
#define PCI_BASE_CLASS_DOCKING 0x0a
#define PCI_CLASS_DOCKING_GENERIC 0x0a00
-#define PCI_CLASS_DOCKING_OTHER 0x0a01
+#define PCI_CLASS_DOCKING_OTHER 0x0a80
#define PCI_BASE_CLASS_PROCESSOR 0x0b
#define PCI_CLASS_PROCESSOR_386 0x0b00
@@ -78,6 +86,7 @@
#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02
#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10
#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20
+#define PCI_CLASS_PROCESSOR_MIPS 0x0b30
#define PCI_CLASS_PROCESSOR_CO 0x0b40
#define PCI_BASE_CLASS_SERIAL 0x0c
@@ -86,11 +95,25 @@
#define PCI_CLASS_SERIAL_SSA 0x0c02
#define PCI_CLASS_SERIAL_USB 0x0c03
#define PCI_CLASS_SERIAL_FIBER 0x0c04
+#define PCI_CLASS_SERIAL_SMBUS 0x0c05
#define PCI_BASE_CLASS_INTELLIGENT 0x0e
#define PCI_CLASS_INTELLIGENT_I2O 0x0e00
-#define PCI_CLASS_HOT_SWAP_CONTROLLER 0xff00
+#define PCI_BASE_CLASS_SATELLITE 0x0f
+#define PCI_CLASS_SATELLITE_TV 0x0f00
+#define PCI_CLASS_SATELLITE_AUDIO 0x0f01
+#define PCI_CLASS_SATELLITE_VOICE 0x0f03
+#define PCI_CLASS_SATELLITE_DATA 0x0f04
+
+#define PCI_BASE_CLASS_CRYPT 0x10
+#define PCI_CLASS_CRYPT_NETWORK 0x1000
+#define PCI_CLASS_CRYPT_ENTERTAINMENT 0x1001
+#define PCI_CLASS_CRYPT_OTHER 0x1080
+
+#define PCI_BASE_CLASS_SIGNAL_PROCESSING 0x11
+#define PCI_CLASS_SP_DPIO 0x1100
+#define PCI_CLASS_SP_OTHER 0x1180
#define PCI_CLASS_OTHERS 0xff
@@ -287,8 +310,10 @@
#define PCI_DEVICE_ID_SI_501 0x0406
#define PCI_DEVICE_ID_SI_496 0x0496
#define PCI_DEVICE_ID_SI_530 0x0530
+#define PCI_DEVICE_ID_SI_540 0x0540
#define PCI_DEVICE_ID_SI_601 0x0601
#define PCI_DEVICE_ID_SI_620 0x0620
+#define PCI_DEVICE_ID_SI_630 0x0630
#define PCI_DEVICE_ID_SI_5107 0x5107
#define PCI_DEVICE_ID_SI_5511 0x5511
#define PCI_DEVICE_ID_SI_5513 0x5513
@@ -433,6 +458,10 @@
#define PCI_VENDOR_ID_LEADTEK 0x107d
#define PCI_DEVICE_ID_LEADTEK_805 0x0000
+#define PCI_VENDOR_ID_INTERPHASE 0x107e
+#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
+#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
+
#define PCI_VENDOR_ID_CONTAQ 0x1080
#define PCI_DEVICE_ID_CONTAQ_82C599 0x0600
#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
@@ -706,10 +735,10 @@
#define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424
#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
-#define PCI_VENDOR_ID_SK 0x1148
-#define PCI_DEVICE_ID_SK_FP 0x4000
-#define PCI_DEVICE_ID_SK_TR 0x4200
-#define PCI_DEVICE_ID_SK_GE 0x4300
+#define PCI_VENDOR_ID_SYSKONNECT 0x1148
+#define PCI_DEVICE_ID_SYSKONNECT_FP 0x4000
+#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
+#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
#define PCI_VENDOR_ID_VMIC 0x114a
#define PCI_DEVICE_ID_VMIC_VME 0x7587
@@ -782,6 +811,7 @@
#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
#define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000
#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
+#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
#define PCI_VENDOR_ID_AURAVISION 0x11d1
#define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7
@@ -873,9 +903,13 @@
#define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000
#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371
+#define PCI_VENDOR_ID_ROCKWELL 0x127A
+
#define PCI_VENDOR_ID_ALTEON 0x12ae
#define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001
+#define PCI_VENDOR_ID_USR 0x12B9
+
#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002
@@ -892,30 +926,65 @@
#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
+#define PCI_SUBVENDOR_ID_CHASE_PCIFAST 0x12E0
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST4 0x0031
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST8 0x0021
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16 0x0011
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC 0x0041
+#define PCI_SUBVENDOR_ID_CHASE_PCIRAS 0x124D
+#define PCI_SUBDEVICE_ID_CHASE_PCIRAS4 0xF001
+#define PCI_SUBDEVICE_ID_CHASE_PCIRAS8 0xF010
+
#define PCI_VENDOR_ID_CBOARDS 0x1307
#define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001
#define PCI_VENDOR_ID_SIIG 0x131f
+#define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000
+#define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001
+#define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002
#define PCI_DEVICE_ID_SIIG_1S1P_10x_550 0x1010
#define PCI_DEVICE_ID_SIIG_1S1P_10x_650 0x1011
#define PCI_DEVICE_ID_SIIG_1S1P_10x_850 0x1012
#define PCI_DEVICE_ID_SIIG_1P_10x 0x1020
#define PCI_DEVICE_ID_SIIG_2P_10x 0x1021
+#define PCI_DEVICE_ID_SIIG_2S_10x_550 0x1030
+#define PCI_DEVICE_ID_SIIG_2S_10x_650 0x1031
+#define PCI_DEVICE_ID_SIIG_2S_10x_850 0x1032
#define PCI_DEVICE_ID_SIIG_2S1P_10x_550 0x1034
#define PCI_DEVICE_ID_SIIG_2S1P_10x_650 0x1035
#define PCI_DEVICE_ID_SIIG_2S1P_10x_850 0x1036
+#define PCI_DEVICE_ID_SIIG_4S_10x_550 0x1050
+#define PCI_DEVICE_ID_SIIG_4S_10x_650 0x1051
+#define PCI_DEVICE_ID_SIIG_4S_10x_850 0x1052
+#define PCI_DEVICE_ID_SIIG_1S_20x_550 0x2000
+#define PCI_DEVICE_ID_SIIG_1S_20x_650 0x2001
+#define PCI_DEVICE_ID_SIIG_1S_20x_850 0x2002
#define PCI_DEVICE_ID_SIIG_1P_20x 0x2020
#define PCI_DEVICE_ID_SIIG_2P_20x 0x2021
+#define PCI_DEVICE_ID_SIIG_2S_20x_550 0x2030
+#define PCI_DEVICE_ID_SIIG_2S_20x_650 0x2031
+#define PCI_DEVICE_ID_SIIG_2S_20x_850 0x2032
#define PCI_DEVICE_ID_SIIG_2P1S_20x_550 0x2040
#define PCI_DEVICE_ID_SIIG_2P1S_20x_650 0x2041
#define PCI_DEVICE_ID_SIIG_2P1S_20x_850 0x2042
#define PCI_DEVICE_ID_SIIG_1S1P_20x_550 0x2010
#define PCI_DEVICE_ID_SIIG_1S1P_20x_650 0x2011
#define PCI_DEVICE_ID_SIIG_1S1P_20x_850 0x2012
+#define PCI_DEVICE_ID_SIIG_4S_20x_550 0x2050
+#define PCI_DEVICE_ID_SIIG_4S_20x_650 0x2051
+#define PCI_DEVICE_ID_SIIG_4S_20x_850 0x2052
#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060
#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061
#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062
+#define PCI_VENDOR_ID_QUATECH 0x135C
+#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
+#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
+#define PCI_DEVICE_ID_QUATECH_DSC200 0x0030
+#define PCI_DEVICE_ID_QUATECH_QSC200 0x0040
+#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
+#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
+
#define PCI_VENDOR_ID_SEALEVEL 0x135e
#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101
#define PCI_DEVICE_ID_SEALEVEL_UCOMM2 0x7201
@@ -928,11 +997,18 @@
#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
#define PCI_VENDOR_ID_LAVA 0x1407
+#define PCI_DEVICE_ID_LAVA_DUAL_SERIAL 0x0100
#define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000
#define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002 /* The Lava Dual Parallel is */
#define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003 /* two PCI devices on a card */
#define PCI_DEVICE_ID_LAVA_BOCA_IOPPAR 0x8800
+#define PCI_VENDOR_ID_TIMEDIA 0x1409
+#define PCI_DEVICE_ID_TIMEDIA_1889 0x7168
+
+#define PCI_VENDOR_ID_OXSEMI 0x1415
+#define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501
+
#define PCI_VENDOR_ID_PANACOM 0x14d4
#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400
#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402
@@ -1021,8 +1097,6 @@
#define PCI_DEVICE_ID_INTEL_82371AB 0x7111
#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112
#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113
-#define PCI_VENDOR_ID_COMPUTONE 0x8e0e
-#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291
#define PCI_DEVICE_ID_INTEL_82443LX_0 0x7180
#define PCI_DEVICE_ID_INTEL_82443LX_1 0x7181
@@ -1033,6 +1107,14 @@
#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
+#define PCI_VENDOR_ID_COMPUTONE 0x8e0e
+#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291
+#define PCI_DEVICE_ID_COMPUTONE_PG 0x0302
+#define PCI_SUBVENDOR_ID_COMPUTONE 0x8e0e
+#define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001
+#define PCI_SUBDEVICE_ID_COMPUTONE_PG8 0x0002
+#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003
+
#define PCI_VENDOR_ID_KTI 0x8e2e
#define PCI_DEVICE_ID_KTI_ET32P2 0x3000
@@ -1098,15 +1180,4 @@
#define PCI_DEVICE_ID_ARK_STINGARK 0xa099
#define PCI_DEVICE_ID_ARK_2000MT 0xa0a1
-#define PCI_VENDOR_ID_INTERPHASE 0x107e
-#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
-#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
-
-#define PCI_VENDOR_ID_INTERPHASE 0x107e
-#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
-#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
-
-#define PCI_VENDOR_ID_INTERPHASE 0x107e
-#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
-#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index eb2d91054..25210f8e5 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -7,6 +7,8 @@ struct pipe_inode_info {
unsigned int start;
unsigned int readers;
unsigned int writers;
+ unsigned int waiting_readers;
+ unsigned int waiting_writers;
};
/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual
@@ -20,6 +22,8 @@ struct pipe_inode_info {
#define PIPE_LEN(inode) ((inode).i_size)
#define PIPE_READERS(inode) ((inode).i_pipe->readers)
#define PIPE_WRITERS(inode) ((inode).i_pipe->writers)
+#define PIPE_WAITING_READERS(inode) ((inode).i_pipe->waiting_readers)
+#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers)
#define PIPE_EMPTY(inode) (PIPE_LEN(inode) == 0)
#define PIPE_FULL(inode) (PIPE_LEN(inode) == PIPE_SIZE)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index d0e57016f..a061d647d 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -53,7 +53,7 @@ typedef int (read_proc_t)(char *page, char **start, off_t off,
int count, int *eof, void *data);
typedef int (write_proc_t)(struct file *file, const char *buffer,
unsigned long count, void *data);
-typedef int (get_info_t)(char *, char **, off_t, int, int);
+typedef int (get_info_t)(char *, char **, off_t, int);
struct proc_dir_entry {
unsigned short low_ino;
@@ -71,24 +71,18 @@ struct proc_dir_entry {
void *data;
read_proc_t *read_proc;
write_proc_t *write_proc;
- int (*readlink_proc)(struct proc_dir_entry *de, char *page);
unsigned int count; /* use count */
int deleted; /* delete flag */
+ kdev_t rdev;
};
#define PROC_INODE_PROPER(inode) ((inode)->i_ino & ~0xffff)
-#define PROC_INODE_OPENPROM(inode) \
- ((inode->i_ino >= PROC_OPENPROM_FIRST) \
- && (inode->i_ino < PROC_OPENPROM_FIRST + PROC_NOPENPROM))
#ifdef CONFIG_PROC_FS
extern struct proc_dir_entry proc_root;
extern struct proc_dir_entry *proc_root_fs;
extern struct proc_dir_entry *proc_net;
-extern struct proc_dir_entry proc_sys;
-extern struct proc_dir_entry proc_openprom;
-extern struct proc_dir_entry *proc_mca;
extern struct proc_dir_entry *proc_bus;
extern struct proc_dir_entry *proc_root_driver;
extern struct proc_dir_entry proc_root_kcore;
@@ -101,62 +95,15 @@ void proc_pid_delete_inode(struct inode *inode);
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
-extern int proc_unregister(struct proc_dir_entry *, int);
extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent);
extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
-
-/*
- * retrieve the proc_dir_entry associated with /proc/driver/$module_name
- */
-extern inline
-struct proc_dir_entry *proc_driver_find (const char *module_name)
-{
- struct proc_dir_entry *p;
-
- p = proc_root_driver->subdir;
- while (p != NULL) {
- if (strcmp (p->name, module_name) == 0)
- return p;
-
- p = p->next;
- }
- return NULL;
-}
-
-
-/*
- * remove /proc/driver/$module_name, and all its contents
- */
-extern inline int proc_driver_unregister(const char *module_name)
-{
- remove_proc_entry (module_name, proc_root_driver);
- return 0;
-}
-
-
-/*
- * create driver-specific playground directory, /proc/driver/$module_name
- */
-extern inline int proc_driver_register(const char *module_name)
-{
- struct proc_dir_entry *p;
-
- p = create_proc_entry (module_name, S_IFDIR, proc_root_driver);
-
- return (p == NULL) ? -1 : 0;
-}
-
extern struct super_block *proc_super_blocks;
-extern struct dentry_operations proc_dentry_operations;
extern struct super_block *proc_read_super(struct super_block *,void *,int);
extern int init_proc_fs(void);
extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *);
-extern int proc_statfs(struct super_block *, struct statfs *, int);
-extern void proc_read_inode(struct inode *);
-extern void proc_write_inode(struct inode *);
extern int proc_match(int, const char *,struct proc_dir_entry *);
@@ -178,22 +125,11 @@ struct openpromfs_dev {
mode_t mode;
char name[32];
};
-extern struct inode_operations *
-proc_openprom_register(int (*readdir)(struct file *, void *, filldir_t),
- struct dentry * (*lookup)(struct inode *, struct dentry *),
- void (*use)(struct inode *, int),
- struct openpromfs_dev ***);
-extern void proc_openprom_deregister(void);
-extern void (*proc_openprom_use)(struct inode *,int);
extern int proc_openprom_regdev(struct openpromfs_dev *);
extern int proc_openprom_unregdev(struct openpromfs_dev *);
-extern struct inode_operations proc_dir_inode_operations;
-extern struct inode_operations proc_file_inode_operations;
-extern struct inode_operations proc_openprom_inode_operations;
extern struct inode_operations proc_sys_inode_operations;
extern struct inode_operations proc_kcore_inode_operations;
-extern struct inode_operations proc_profile_inode_operations;
extern struct inode_operations proc_kmsg_inode_operations;
#if CONFIG_AP1000
extern struct inode_operations proc_ringbuf_inode_operations;
@@ -213,6 +149,12 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver);
*/
extern void proc_device_tree_init(void);
+extern struct proc_dir_entry *proc_symlink(const char *,
+ struct proc_dir_entry *,char *);
+extern struct proc_dir_entry *proc_mknod(const char *,mode_t,
+ struct proc_dir_entry *,kdev_t);
+extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
+
extern inline struct proc_dir_entry *create_proc_read_entry(const char *name,
mode_t mode, struct proc_dir_entry *base,
read_proc_t *read_proc, void * data)
@@ -247,7 +189,6 @@ extern inline void proc_net_remove(const char *name)
#else
extern inline int proc_register(struct proc_dir_entry *a, struct proc_dir_entry *b) { return 0; }
-extern inline int proc_unregister(struct proc_dir_entry *a, int b) { return 0; }
extern inline struct proc_dir_entry *proc_net_create(const char *name, mode_t mode,
get_info_t *get_info) {return NULL;}
extern inline void proc_net_remove(const char *name) {}
@@ -256,6 +197,12 @@ extern inline struct proc_dir_entry *create_proc_entry(const char *name,
mode_t mode, struct proc_dir_entry *parent) { return NULL; }
extern inline void remove_proc_entry(const char *name, struct proc_dir_entry *parent) {};
+extern inline proc_dir_entry *proc_symlink(const char *name,
+ struct proc_dir_entry *parent,char *dest) {return NULL;}
+extern inline proc_dir_entry *proc_mknod(const char *name,mode_t mode,
+ struct proc_dir_entry *parent,kdev_t rdev) {return NULL;}
+extern struct proc_dir_entry *proc_mkdir(const char *name,
+ struct proc_dir_entry *parent) {return NULL;}
extern inline struct proc_dir_entry *create_proc_read_entry(const char *name,
mode_t mode, struct proc_dir_entry *base,
@@ -268,22 +215,6 @@ extern inline struct proc_dir_entry *create_proc_info_entry(const char *name,
extern inline void proc_tty_register_driver(struct tty_driver *driver) {};
extern inline void proc_tty_unregister_driver(struct tty_driver *driver) {};
-extern inline
-struct proc_dir_entry *proc_driver_find (const char *module_name)
-{
- return NULL;
-}
-
-extern inline int proc_driver_unregister(const char *module_name)
-{
- return 0;
-}
-
-extern inline int proc_driver_register(const char *module_name)
-{
- return 0;
-}
-
extern struct proc_dir_entry proc_root;
#endif /* CONFIG_PROC_FS */
diff --git a/include/linux/quota.h b/include/linux/quota.h
index a3e76e138..ad2380019 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -44,8 +44,8 @@
/*
* Convert diskblocks to blocks and the other way around.
*/
-#define dbtob(num) (num << 10)
-#define btodb(num) (num >> 10)
+#define dbtob(num) (num << BLOCK_SIZE_BITS)
+#define btodb(num) (num >> BLOCK_SIZE_BITS)
/*
* Convert count of filesystem blocks to diskquota blocks, meant
@@ -202,7 +202,7 @@ struct dquot {
# /* nodep */ include <sys/cdefs.h>
__BEGIN_DECLS
-int quotactl __P ((int, const char *, int, caddr_t));
+long quotactl __P ((int, const char *, int, caddr_t));
__END_DECLS
#endif /* __KERNEL__ */
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index b31daec41..17371e58c 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -23,16 +23,13 @@ extern void invalidate_dquots(kdev_t dev, short type);
extern int quota_off(kdev_t dev, short type);
extern int sync_dquots(kdev_t dev, short type);
-extern int dquot_alloc_block(const struct inode *inode, unsigned long number,
- uid_t initiator, char warn);
-extern int dquot_alloc_inode(const struct inode *inode, unsigned long number,
- uid_t initiator);
+extern int dquot_alloc_block(const struct inode *inode, unsigned long number, char prealloc);
+extern int dquot_alloc_inode(const struct inode *inode, unsigned long number);
extern void dquot_free_block(const struct inode *inode, unsigned long number);
extern void dquot_free_inode(const struct inode *inode, unsigned long number);
-extern int dquot_transfer(struct inode *inode, struct iattr *iattr,
- char direction, uid_t initiator);
+extern int dquot_transfer(struct dentry *dentry, struct iattr *iattr);
/*
* Operations supported for diskquotas.
@@ -54,8 +51,7 @@ extern __inline__ void DQUOT_DROP(struct inode *inode)
extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct inode *inode, int nr)
{
if (sb->dq_op) {
- if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize),
- current->fsuid, 0) == NO_QUOTA)
+ if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), 1) == NO_QUOTA)
return 1;
}
return 0;
@@ -64,8 +60,7 @@ extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct
extern __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct inode *inode, int nr)
{
if (sb->dq_op) {
- if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize),
- current->fsuid, 1) == NO_QUOTA)
+ if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), 0) == NO_QUOTA)
return 1;
}
return 0;
@@ -75,7 +70,7 @@ extern __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode *in
{
if (sb->dq_op) {
sb->dq_op->initialize (inode, -1);
- if (sb->dq_op->alloc_inode (inode, 1, current->fsuid))
+ if (sb->dq_op->alloc_inode (inode, 1))
return 1;
}
inode->i_flags |= S_QUOTA;
@@ -99,17 +94,11 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr)
int error = -EDQUOT;
if (dentry->d_inode->i_sb->dq_op) {
- if (IS_QUOTAINIT(dentry->d_inode) == 0)
- dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1);
- if (dentry->d_inode->i_sb->dq_op->transfer(dentry->d_inode, iattr, 0, current->fsuid))
- goto out;
- error = notify_change(dentry, iattr);
- if (error)
- dentry->d_inode->i_sb->dq_op->transfer(dentry->d_inode, iattr, 1, current->fsuid);
+ dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1);
+ error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr);
} else {
error = notify_change(dentry, iattr);
}
-out:
return error;
}
diff --git a/include/linux/resource.h b/include/linux/resource.h
index 5b38bb9e9..0b7585f25 100644
--- a/include/linux/resource.h
+++ b/include/linux/resource.h
@@ -37,13 +37,6 @@ struct rusage {
long ru_nivcsw; /* involuntary " */
};
-/*
- * SuS says limits have to be unsigned.
- *
- * Which makes a ton more sense anyway.
- */
-#define RLIM_INFINITY (~0UL)
-
struct rlimit {
unsigned long rlim_cur;
unsigned long rlim_max;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 26ef161ec..d9a6b2e18 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -84,20 +84,20 @@ extern int last_pid;
#define TASK_EXCLUSIVE 32
#define __set_task_state(tsk, state_value) \
- do { tsk->state = state_value; } while (0)
+ do { (tsk)->state = (state_value); } while (0)
#ifdef __SMP__
#define set_task_state(tsk, state_value) \
- set_mb(tsk->state, state_value)
+ set_mb((tsk)->state, (state_value))
#else
#define set_task_state(tsk, state_value) \
- __set_task_state(tsk, state_value)
+ __set_task_state((tsk), (state_value))
#endif
#define __set_current_state(state_value) \
- do { current->state = state_value; } while (0)
+ do { current->state = (state_value); } while (0)
#ifdef __SMP__
#define set_current_state(state_value) \
- set_mb(current->state, state_value)
+ set_mb(current->state, (state_value))
#else
#define set_current_state(state_value) \
__set_current_state(state_value)
@@ -498,6 +498,7 @@ extern unsigned long prof_shift;
#define CURRENT_TIME (xtime.tv_sec)
extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode));
+extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode));
extern void FASTCALL(sleep_on(wait_queue_head_t *q));
extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q,
signed long timeout));
@@ -507,9 +508,12 @@ extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q,
extern void FASTCALL(wake_up_process(struct task_struct * tsk));
#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
+#define wake_up_sync(x) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE)
+#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE)
extern int in_group_p(gid_t);
+extern int in_egroup_p(gid_t);
extern void release(struct task_struct * p);
@@ -847,7 +851,7 @@ static inline int task_lock(struct task_struct *p)
down(&p->exit_sem);
if (p->p_pptr)
return 1;
- /* He's dead, Jim. You take his wallet, I'll take tricoder... */
+ /* He's dead, Jim. You take his wallet, I'll take the tricorder... */
up(&p->exit_sem);
return 0;
}
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 7149f5b35..bfeee939c 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -20,7 +20,8 @@ struct serial_struct {
int custom_divisor;
int baud_base;
unsigned short close_delay;
- char reserved_char[2];
+ char io_type;
+ char reserved_char[1];
int hub6;
unsigned short closing_wait; /* time to wait before closing */
unsigned short closing_wait2; /* no longer used... */
@@ -68,6 +69,11 @@ struct async_icount {
#define PORT_16850 12
#define PORT_MAX 12
+#define SERIAL_IO_PORT 0
+#define SERIAL_IO_HUB6 1
+#define SERIAL_IO_MEM 2
+#define SERIAL_IO_GSC 3
+
struct serial_uart_config {
char *name;
int dfl_xmit_fifo_size;
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index 11643f8a0..3fdadb4a1 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -45,6 +45,7 @@ struct serial_state {
struct async_icount icount;
struct termios normal_termios;
struct termios callout_termios;
+ int io_type;
struct async_struct *info;
};
@@ -80,6 +81,7 @@ struct async_struct {
int xmit_cnt;
u8 *iomem_base;
u16 iomem_reg_shift;
+ int io_type;
struct tq_struct tqueue;
#ifdef DECLARE_WAITQUEUE
wait_queue_head_t open_wait;
@@ -99,6 +101,10 @@ struct async_struct {
#define SERIAL_MAGIC 0x5301
#define SSTATE_MAGIC 0x5302
+/*
+ * The size of the serial xmit buffer is 1 page, or 4096 bytes
+ */
+#define SERIAL_XMIT_SIZE 4096
/*
* Events are used to schedule things to happen at timer-interrupt
@@ -132,7 +138,6 @@ struct rs_multiport_struct {
#define ALPHA_KLUDGE_MCR 0
#endif
-#ifdef CONFIG_PCI
/*
* Structures and definitions for PCI support
*/
@@ -147,8 +152,9 @@ struct pci_board {
int base_baud;
int uart_offset;
int reg_shift;
- void (*init_fn)(struct pci_dev *dev, struct pci_board *board,
+ int (*init_fn)(struct pci_dev *dev, struct pci_board *board,
int enable);
+ int first_uart_offset;
};
struct pci_board_inst {
@@ -159,7 +165,6 @@ struct pci_board_inst {
#ifndef PCI_ANY_ID
#define PCI_ANY_ID (~0)
#endif
-#endif
#define SPCI_FL_BASE_MASK 0x0007
#define SPCI_FL_BASE0 0x0000
diff --git a/include/linux/slab.h b/include/linux/slab.h
index fa344d816..97f6923da 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -12,7 +12,7 @@
typedef struct kmem_cache_s kmem_cache_t;
#include <linux/mm.h>
-#include <asm/cache.h>
+#include <linux/cache.h>
/* flags for kmem_cache_alloc() */
#define SLAB_BUFFER GFP_BUFFER
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 8e9e72989..18ea45e63 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -1,6 +1,7 @@
#ifndef _LINUX_SWAP_H
#define _LINUX_SWAP_H
+#include <linux/spinlock.h>
#include <asm/page.h>
#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
@@ -48,6 +49,7 @@ union swap_header {
struct swap_info_struct {
unsigned int flags;
kdev_t swap_device;
+ spinlock_t sdev_lock;
struct dentry * swap_file;
unsigned short * swap_map;
unsigned int lowest_bit;
@@ -94,19 +96,17 @@ extern void rw_swap_page_nolock(int, swp_entry_t, char *, int);
/* linux/mm/swap_state.c */
extern void show_swap_cache_info(void);
extern void add_to_swap_cache(struct page *, swp_entry_t);
-extern int swap_duplicate(swp_entry_t);
extern int swap_check_entry(unsigned long);
extern struct page * lookup_swap_cache(swp_entry_t);
extern struct page * read_swap_cache_async(swp_entry_t, int);
#define read_swap_cache(entry) read_swap_cache_async(entry, 1);
-extern int swap_count(struct page *);
-extern swp_entry_t acquire_swap_entry(struct page *page);
/*
* Make these inline later once they are working properly.
*/
extern void __delete_from_swap_cache(struct page *page);
extern void delete_from_swap_cache(struct page *page);
+extern void delete_from_swap_cache_nolock(struct page *page);
extern void free_page_and_swap_cache(struct page *page);
/* linux/mm/swapfile.c */
@@ -115,6 +115,12 @@ extern struct swap_info_struct swap_info[];
extern int is_swap_partition(kdev_t);
extern void si_swapinfo(struct sysinfo *);
extern swp_entry_t __get_swap_page(unsigned short);
+extern void get_swaphandle_info(swp_entry_t, unsigned long *, kdev_t *,
+ struct inode **);
+extern int swap_duplicate(swp_entry_t);
+extern int swap_count(struct page *);
+extern swp_entry_t acquire_swap_entry(struct page *page);
+extern int valid_swaphandles(swp_entry_t, unsigned long *);
#define get_swap_page() __get_swap_page(1)
extern void __swap_free(swp_entry_t, unsigned short);
#define swap_free(entry) __swap_free((entry), 1)
@@ -173,6 +179,13 @@ do { \
spin_unlock(&pagemap_lru_lock); \
} while (0)
+extern spinlock_t swaplock;
+
+#define swap_list_lock() spin_lock(&swaplock)
+#define swap_list_unlock() spin_unlock(&swaplock)
+#define swap_device_lock(p) spin_lock(&p->sdev_lock)
+#define swap_device_unlock(p) spin_unlock(&p->sdev_lock)
+
#endif /* __KERNEL__*/
#endif /* _LINUX_SWAP_H */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index ce76c926d..ab92bbece 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -97,7 +97,7 @@ enum
KERN_RTSIGNR=32, /* Number of rt sigs queued */
KERN_RTSIGMAX=33, /* Max queuable */
- KERN_SHMMAX=34, /* int: Maximum shared memory segment */
+ KERN_SHMMAX=34, /* long: Maximum shared memory segment */
KERN_MSGMAX=35, /* int: Maximum size of a messege */
KERN_MSGMNB=36, /* int: Maximum message queue size */
KERN_MSGPOOL=37, /* int: Maximum system message pool size */
@@ -106,7 +106,9 @@ enum
KERN_RANDOM=40, /* Random driver */
KERN_SHMALL=41, /* int: Maximum size of shared memory */
KERN_MSGMNI=42, /* int: msg queue identifiers */
- KERN_SEM=43 /* int: sysv semaphore limits */
+ KERN_SEM=43, /* struct: sysv semaphore limits */
+ KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */
+ KERN_SHMMNI=45 /* int: shm array identifiers */
};
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
index 9c0b764a2..e3dbdd5fd 100644
--- a/include/linux/udf_fs.h
+++ b/include/linux/udf_fs.h
@@ -30,8 +30,8 @@
#define UDF_DEFAULT_PREALLOC_BLOCKS 8
#define UDF_DEFAULT_PREALLOC_DIR_BLOCKS 0
-#define UDFFS_DATE "99/10/29"
-#define UDFFS_VERSION "0.8.9.3"
+#define UDFFS_DATE "99/11/18"
+#define UDFFS_VERSION "0.8.9.4"
#define UDFFS_DEBUG
#ifdef UDFFS_DEBUG
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index d938298a3..b650d7897 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -563,6 +563,7 @@ extern void ufs_write_super (struct super_block *);
/* symlink.c */
extern struct inode_operations ufs_symlink_inode_operations;
+extern struct inode_operations ufs_fast_symlink_inode_operations;
/* truncate.c */
extern void ufs_truncate (struct inode *);
diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h
index 395226a23..d4a675e78 100644
--- a/include/linux/umsdos_fs.h
+++ b/include/linux/umsdos_fs.h
@@ -2,7 +2,7 @@
#define LINUX_UMSDOS_FS_H
-#define UMS_DEBUG 1 /* define for check_* functions */
+/*#define UMS_DEBUG 1 // define for check_* functions */
/*#define UMSDOS_DEBUG 1*/
#define UMSDOS_PARANOIA 1
diff --git a/include/linux/umsdos_fs_i.h b/include/linux/umsdos_fs_i.h
index 96135ec0f..e123efb10 100644
--- a/include/linux/umsdos_fs_i.h
+++ b/include/linux/umsdos_fs_i.h
@@ -47,15 +47,13 @@ struct dir_locking_info {
* Only one at a time, although one
* may recursively lock, so it is a counter
*/
- long pid; /* pid of the process owning the creation */
- /* lock */
+ long pid; /* pid of the process owning the creation
+ * lock */
};
struct umsdos_inode_info {
- union {
- struct msdos_inode_info msdos_info;
- struct dir_locking_info dir_info;
- } u;
+ struct msdos_inode_info msdos_info;
+ struct dir_locking_info dir_info;
int i_patched; /* Inode has been patched */
int i_is_hlink; /* Resolved hardlink inode? */
unsigned long i_emd_owner; /* Is this the EMD file inode? */
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index f58bf97dd..d9cedda12 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -175,6 +175,7 @@ struct video_window
struct video_clip *clips; /* Set only */
int clipcount;
#define VIDEO_WINDOW_INTERLACE 1
+#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
#define VIDEO_CLIP_BITMAP -1
/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
#define VIDEO_CLIPMAP_SIZE (128 * 625)
@@ -353,6 +354,8 @@ struct video_code
#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */
#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */
#define VID_HARDWARE_CPIA 24
+#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */
+#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */
/*
* Initialiser list
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 0aba8360c..d360d41bc 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -6,6 +6,10 @@
#include <asm/pgtable.h>
+/* bits in vm_struct->flags */
+#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
+#define VM_ALLOC 0x00000002 /* vmalloc() */
+
struct vm_struct {
unsigned long flags;
void * addr;
@@ -13,7 +17,7 @@ struct vm_struct {
struct vm_struct * next;
};
-struct vm_struct * get_vm_area(unsigned long size);
+struct vm_struct * get_vm_area(unsigned long size, unsigned long flags);
void vfree(void * addr);
void * vmalloc_prot(unsigned long size, pgprot_t prot);
void * vmalloc_uncached(unsigned long size);
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 993579d8c..accecf8d2 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -363,7 +363,7 @@ typedef struct wan_device
struct wan_device* next; /* -> next device */
struct net_device* dev; /* list of network interfaces */
unsigned ndev; /* number of interfaces */
- struct proc_dir_entry dent; /* proc filesystem entry */
+ struct proc_dir_entry *dent; /* proc filesystem entry */
} wan_device_t;
/* Public functions available for device drivers */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index acc0619eb..868f812ac 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1,7 +1,7 @@
/*
* This file define a set of standard wireless extensions
*
- * Version : 8 28.7.99
+ * Version : 9 16.10.99
*
* Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
*/
@@ -63,7 +63,7 @@
* (there is some stuff that will be added in the future...)
* I just plan to increment with each new version.
*/
-#define WIRELESS_EXT 8
+#define WIRELESS_EXT 9
/*
* Changes :
@@ -96,6 +96,14 @@
* - Changed my e-mail address
* - More 802.11 support (nickname, rate, rts, frag)
* - List index in frequencies
+ *
+ * V8 to V9
+ * --------
+ * - Support for 'mode of operation' (ad-hoc, managed...)
+ * - Support for unicast and multicast power saving
+ * - Change encoding to support larger tokens (>64 bits)
+ * - Updated iw_params (disable, flags) and use it for NWID
+ * - Extracted iw_point from iwreq for clarity
*/
/* -------------------------- IOCTL LIST -------------------------- */
@@ -103,12 +111,12 @@
/* Basic operations */
#define SIOCSIWNAME 0x8B00 /* Unused ??? */
#define SIOCGIWNAME 0x8B01 /* get name */
-#define SIOCSIWNWID 0x8B02 /* set network id */
+#define SIOCSIWNWID 0x8B02 /* set network id (the cell) */
#define SIOCGIWNWID 0x8B03 /* get network id */
#define SIOCSIWFREQ 0x8B04 /* set channel/frequency */
#define SIOCGIWFREQ 0x8B05 /* get channel/frequency */
-#define SIOCSIWENCODE 0x8B06 /* set encoding info */
-#define SIOCGIWENCODE 0x8B07 /* get encoding info */
+#define SIOCSIWMODE 0x8B06 /* set operation mode */
+#define SIOCGIWMODE 0x8B07 /* get operation mode */
#define SIOCSIWSENS 0x8B08 /* set sensitivity */
#define SIOCGIWSENS 0x8B09 /* get sensitivity */
@@ -146,11 +154,18 @@
#define SIOCSIWFRAG 0x8B24 /* set fragmentation thr (bytes) */
#define SIOCGIWFRAG 0x8B25 /* get fragmentation thr (bytes) */
+/* Encoding stuff (scrambling, hardware security, WEP...) */
+#define SIOCSIWENCODE 0x8B2A /* set encoding token & mode */
+#define SIOCGIWENCODE 0x8B2B /* get encoding token & mode */
+/* Power saving stuff (power management, unicast and multicast) */
+#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
+#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
+
/* ------------------------- IOCTL STUFF ------------------------- */
/* The first and the last (range) */
#define SIOCIWFIRST 0x8B00
-#define SIOCIWLAST 0x8B25
+#define SIOCIWLAST 0x8B30
/* Even : get (world access), odd : set (root access) */
#define IW_IS_SET(cmd) (!((cmd) & 0x1))
@@ -200,10 +215,67 @@
/* Maximum size of the ESSID and NICKN strings */
#define IW_ESSID_MAX_SIZE 32
+/* Modes of operation */
+#define IW_MODE_AUTO 0 /* Let the driver decides */
+#define IW_MODE_ADHOC 1 /* Single cell network */
+#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
+#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
+#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
+#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
+
+/* Maximum number of size of encoding token available
+ * they are listed in the range structure */
+#define IW_MAX_ENCODING_SIZES 8
+
+/* Maximum size of the encoding token in bytes */
+#define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */
+
+/* Flags for encoding (along with the token) */
+#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
+#define IW_ENCODE_FLAGS 0xF000 /* Flags defined below */
+#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
+#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
+#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
+#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
+
+/* Power management flags available (along with the value, if any) */
+#define IW_POWER_ON 0x0000 /* No details... */
+#define IW_POWER_TYPE 0xF000 /* Type of parameter */
+#define IW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
+#define IW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
+#define IW_POWER_MODE 0x0F00 /* Power Management mode */
+#define IW_POWER_UNICAST_R 0x0100 /* Receive only unicast messages */
+#define IW_POWER_MULTICAST_R 0x0200 /* Receive only multicast messages */
+#define IW_POWER_ALL_R 0x0300 /* Receive all messages though PM */
+#define IW_POWER_FORCE_S 0x0400 /* Force PM procedure for sending unicast */
+#define IW_POWER_REPEATER 0x0800 /* Repeat broadcast messages in PM period */
+
/****************************** TYPES ******************************/
/* --------------------------- SUBTYPES --------------------------- */
/*
+ * Generic format for most parameters that fit in an int
+ */
+struct iw_param
+{
+ __s32 value; /* The value of the parameter itself */
+ __u8 fixed; /* Hardware should not use auto select */
+ __u8 disabled; /* Disable the feature */
+ __u16 flags; /* Various specifc flags (if any) */
+};
+
+/*
+ * For all data larger than 16 octets, we need to use a
+ * pointer to memory alocated in user space.
+ */
+struct iw_point
+{
+ caddr_t pointer; /* Pointer to the data (in user space) */
+ __u16 length; /* number of fields or size in bytes */
+ __u16 flags; /* Optional params */
+};
+
+/*
* A frequency
* For numbers lower than 10^9, we encode the number in 'm' and
* set 'e' to 0
@@ -223,7 +295,7 @@ struct iw_freq
*/
struct iw_quality
{
- __u8 qual; /* link quality (SNR or better...) */
+ __u8 qual; /* link quality (%retries, SNR or better...) */
__u8 level; /* signal level */
__u8 noise; /* noise level */
__u8 updated; /* Flags to know if updated */
@@ -240,33 +312,13 @@ struct iw_discarded
__u32 misc; /* Others cases */
};
-/*
- * Encoding information (setting and so on)
- * Encoding might be hardware encryption, scrambing or others
- */
-struct iw_encoding
-{
- __u8 method; /* Algorithm number / key used */
- __u64 code; /* Data/key used for algorithm */
-};
-
-/*
- * Generic format for parameters
- */
-struct iw_param
-{
- __s32 value; /* The value of the parameter itself */
- __u8 fixed; /* Hardware should not use auto select */
-};
-
-
/* ------------------------ WIRELESS STATS ------------------------ */
/*
* Wireless statistics (used for /proc/net/wireless)
*/
struct iw_statistics
{
- __u8 status; /* Status
+ __u16 status; /* Status
* - device dependent for now */
struct iw_quality qual; /* Quality of the link
@@ -295,37 +347,28 @@ struct iwreq
union
{
/* Config - generic */
- char name[IFNAMSIZ];
+ char name[IFNAMSIZ];
/* Name : used to verify the presence of wireless extensions.
* Name of the protocol/provider... */
- struct /* network id (or domain) : used to to */
- { /* create logical channels on the air */
- __u32 nwid; /* value */
- __u8 on; /* active/unactive nwid */
- } nwid;
-
+ struct iw_point essid; /* Extended network name */
+ struct iw_param nwid; /* network id (or domain - the cell) */
struct iw_freq freq; /* frequency or channel :
* 0-1000 = channel
* > 1000 = frequency in Hz */
- struct iw_encoding encoding; /* Encoding stuff */
-
- __u32 sensitivity; /* Obsolete, but compatible */
struct iw_param sens; /* signal level threshold */
struct iw_param bitrate; /* default bit rate */
struct iw_param rts; /* RTS threshold threshold */
struct iw_param frag; /* Fragmentation threshold */
+ __u32 mode; /* Operation mode */
+
+ struct iw_point encoding; /* Encoding stuff : tokens */
+ struct iw_param power; /* PM duration/timeout */
struct sockaddr ap_addr; /* Access point address */
- struct /* For all data bigger than 16 octets */
- {
- caddr_t pointer; /* Pointer to the data
- * (in user space) */
- __u16 length; /* fields or byte size */
- __u16 flags; /* Optional params */
- } data;
+ struct iw_point data; /* Other large parameters */
} u;
};
@@ -366,9 +409,6 @@ struct iw_range
/* Quality of link & SNR stuff */
struct iw_quality max_qual; /* Quality of the link */
- /* Encoder stuff */
- struct iw_encoding max_encoding; /* Encoding max range */
-
/* Rates */
__u8 num_bitrates; /* Number of entries in the list */
__s32 bitrate[IW_MAX_BITRATES]; /* list, in bps */
@@ -380,6 +420,17 @@ struct iw_range
/* Frag threshold */
__s32 min_frag; /* Minimal frag threshold */
__s32 max_frag; /* Maximal frag threshold */
+
+ /* Power Management duration & timeout */
+ __s32 min_pmd; /* Minimal PM duration */
+ __s32 max_pmd; /* Maximal PM duration */
+ __s32 min_pmt; /* Minimal PM timeout */
+ __s32 max_pmt; /* Maximal PM timeout */
+
+ /* Encoder stuff */
+ __u16 encoding_size[IW_MAX_ENCODING_SIZES]; /* Different token sizes */
+ __u8 num_encoding_sizes; /* Number of entry in the list */
+ __u8 max_encoding_tokens; /* Max number of tokens */
};
/*