summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/amigaffs.h7
-rw-r--r--include/linux/dp83840.h41
-rw-r--r--include/linux/eeprom.h135
-rw-r--r--include/linux/fs.h11
-rw-r--r--include/linux/gameport.h30
-rw-r--r--include/linux/hiddev.h194
-rw-r--r--include/linux/input.h513
-rw-r--r--include/linux/irda.h17
-rw-r--r--include/linux/ite_gpio.h66
-rw-r--r--include/linux/ixjuser.h113
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/module.h10
-rw-r--r--include/linux/mount.h4
-rw-r--r--include/linux/quotaops.h12
-rw-r--r--include/linux/sysctl.h6
-rw-r--r--include/linux/wait.h5
16 files changed, 930 insertions, 239 deletions
diff --git a/include/linux/amigaffs.h b/include/linux/amigaffs.h
index 3f7fe28e62cc..3a264a7e9063 100644
--- a/include/linux/amigaffs.h
+++ b/include/linux/amigaffs.h
@@ -121,13 +121,6 @@ affs_unlock_ext(struct inode *inode)
up(&AFFS_INODE->i_ext_lock);
}
-
-#define MIN(a, b) ({ \
- typeof(a) _a = (a); \
- typeof(b) _b = (b); \
- _a < _b ? _a : _b; \
-})
-
#ifdef __LITTLE_ENDIAN
#define BO_EXBITS 0x18UL
#elif defined(__BIG_ENDIAN)
diff --git a/include/linux/dp83840.h b/include/linux/dp83840.h
new file mode 100644
index 000000000000..1ca8e5754608
--- /dev/null
+++ b/include/linux/dp83840.h
@@ -0,0 +1,41 @@
+/*
+ * linux/dp83840.h: definitions for DP83840 MII-compatible transceivers
+ *
+ * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com)
+ */
+#ifndef __LINUX_DP83840_H
+#define __LINUX_DP83840_H
+
+#include <linux/mii.h>
+
+/*
+ * Data sheets and programming docs for the DP83840 are available at
+ * from http://www.national.com/
+ *
+ * The DP83840 is capable of both 10 and 100Mbps ethernet, in both
+ * half and full duplex mode. It also supports auto negotiation.
+ *
+ * But.... THIS THING IS A PAIN IN THE ASS TO PROGRAM!
+ * Debugging eeprom burnt code is more fun than programming this chip!
+ */
+
+/* First, the MII register numbers (actually DP83840 register numbers). */
+#define MII_CSCONFIG 0x17 /* CS configuration */
+
+/* The Carrier Sense config register. */
+#define CSCONFIG_RESV1 0x0001 /* Unused... */
+#define CSCONFIG_LED4 0x0002 /* Pin for full-dplx LED4 */
+#define CSCONFIG_LED1 0x0004 /* Pin for conn-status LED1 */
+#define CSCONFIG_RESV2 0x0008 /* Unused... */
+#define CSCONFIG_TCVDISAB 0x0010 /* Turns off the transceiver */
+#define CSCONFIG_DFBYPASS 0x0020 /* Bypass disconnect function */
+#define CSCONFIG_GLFORCE 0x0040 /* Good link force for 100mbps */
+#define CSCONFIG_CLKTRISTATE 0x0080 /* Tristate 25m clock */
+#define CSCONFIG_RESV3 0x0700 /* Unused... */
+#define CSCONFIG_ENCODE 0x0800 /* 1=MLT-3, 0=binary */
+#define CSCONFIG_RENABLE 0x1000 /* Repeater mode enable */
+#define CSCONFIG_TCDISABLE 0x2000 /* Disable timeout counter */
+#define CSCONFIG_RESV4 0x4000 /* Unused... */
+#define CSCONFIG_NDISABLE 0x8000 /* Disable NRZI */
+
+#endif /* __LINUX_DP83840_H */
diff --git a/include/linux/eeprom.h b/include/linux/eeprom.h
new file mode 100644
index 000000000000..ef070e148042
--- /dev/null
+++ b/include/linux/eeprom.h
@@ -0,0 +1,135 @@
+/* credit winbond-840.c
+ */
+struct eeprom_ops {
+ void (*set_cs)(void *ee);
+ void (*clear_cs)(void *ee);
+};
+
+#define EEPOL_EEDI 0x01
+#define EEPOL_EEDO 0x02
+#define EEPOL_EECLK 0x04
+#define EEPOL_EESEL 0x08
+
+struct eeprom {
+ void *dev;
+ struct eeprom_ops *ops;
+
+ long addr;
+
+ unsigned ee_addr_bits;
+
+ unsigned eesel;
+ unsigned eeclk;
+ unsigned eedo;
+ unsigned eedi;
+ unsigned polarity;
+ unsigned ee_state;
+
+ spinlock_t *lock;
+ u32 *cache;
+};
+
+
+u8 eeprom_readb(struct eeprom *ee, unsigned address);
+void eeprom_read(struct eeprom *ee, unsigned address, u8 *bytes,
+ unsigned count);
+void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data);
+void eeprom_write(struct eeprom *ee, unsigned address, u8 *bytes,
+ unsigned count);
+
+/* The EEPROM commands include the alway-set leading bit. */
+enum EEPROM_Cmds {
+ EE_WriteCmd=(5 << 6), EE_ReadCmd=(6 << 6), EE_EraseCmd=(7 << 6),
+};
+
+void setup_ee_mem_bitbanger(struct eeprom *ee, long memaddr, int eesel_bit, int eeclk_bit, int eedo_bit, int eedi_bit, unsigned polarity)
+{
+ ee->addr = memaddr;
+ ee->eesel = 1 << eesel_bit;
+ ee->eeclk = 1 << eeclk_bit;
+ ee->eedo = 1 << eedo_bit;
+ ee->eedi = 1 << eedi_bit;
+
+ ee->polarity = polarity;
+
+ *ee->cache = readl(ee->addr);
+}
+
+/* foo. put this in a .c file */
+static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol)
+{
+ long flags;
+ u32 data;
+
+ spin_lock_irqsave(ee->lock, flags);
+ data = *ee->cache;
+
+ data &= ~mask;
+ if (pol)
+ data |= mask;
+
+ *ee->cache = data;
+//printk("update: %08x\n", data);
+ writel(data, ee->addr);
+ spin_unlock_irqrestore(ee->lock, flags);
+}
+
+void eeprom_clk_lo(struct eeprom *ee)
+{
+ int pol = !!(ee->polarity & EEPOL_EECLK);
+
+ eeprom_update(ee, ee->eeclk, pol);
+ udelay(2);
+}
+
+void eeprom_clk_hi(struct eeprom *ee)
+{
+ int pol = !!(ee->polarity & EEPOL_EECLK);
+
+ eeprom_update(ee, ee->eeclk, !pol);
+ udelay(2);
+}
+
+void eeprom_send_addr(struct eeprom *ee, unsigned address)
+{
+ int pol = !!(ee->polarity & EEPOL_EEDI);
+ unsigned i;
+ address |= 6 << 6;
+
+ /* Shift the read command bits out. */
+ for (i=0; i<11; i++) {
+ eeprom_update(ee, ee->eedi, ((address >> 10) & 1) ^ pol);
+ address <<= 1;
+ eeprom_clk_hi(ee);
+ eeprom_clk_lo(ee);
+ }
+ eeprom_update(ee, ee->eedi, pol);
+}
+
+u16 eeprom_readw(struct eeprom *ee, unsigned address)
+{
+ unsigned i;
+ u16 res = 0;
+
+ eeprom_clk_lo(ee);
+ eeprom_update(ee, ee->eesel, 1 ^ !!(ee->polarity & EEPOL_EESEL));
+ eeprom_send_addr(ee, address);
+
+ for (i=0; i<16; i++) {
+ u32 data;
+ eeprom_clk_hi(ee);
+ res <<= 1;
+ data = readl(ee->addr);
+//printk("eeprom_readw: %08x\n", data);
+ res |= !!(data & ee->eedo) ^ !!(ee->polarity & EEPOL_EEDO);
+ eeprom_clk_lo(ee);
+ }
+ eeprom_update(ee, ee->eesel, 0 ^ !!(ee->polarity & EEPOL_EESEL));
+
+ return res;
+}
+
+
+void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data)
+{
+}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index dfe64dc82c10..b73ddd8ade82 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -111,10 +111,10 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
#define MS_NOUSER (1<<31)
/*
- * Flags that can be altered by MS_REMOUNT
+ * Superblock flags that can be altered by MS_REMOUNT
*/
-#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|\
- MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|\
+ MS_NODIRATIME)
/*
* Old magic mount flag and mask
@@ -130,6 +130,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
#define S_APPEND 8 /* Append-only file */
#define S_IMMUTABLE 16 /* Immutable file */
#define S_DEAD 32 /* removed, but still open directory */
+#define S_NOQUOTA 64 /* Inode is not counted to quota */
/*
* Note that nosuid etc flags are inode-specific: setting some file-system
@@ -147,13 +148,11 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
-#define IS_NOSUID(inode) __IS_FLG(inode, MS_NOSUID)
-#define IS_NODEV(inode) __IS_FLG(inode, MS_NODEV)
-#define IS_NOEXEC(inode) __IS_FLG(inode, MS_NOEXEC)
#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || ((inode)->i_flags & S_SYNC))
#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
#define IS_QUOTAINIT(inode) ((inode)->i_flags & S_QUOTA)
+#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
#define IS_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME))
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 457521681ab1..4e341f1fdbe9 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -2,7 +2,7 @@
#define _GAMEPORT_H
/*
- * $Id: gameport.h,v 1.8 2000/06/03 20:18:52 vojtech Exp $
+ * $Id: gameport.h,v 1.11 2001/04/26 10:24:46 vojtech Exp $
*
* Copyright (c) 1999-2000 Vojtech Pavlik
*
@@ -12,24 +12,25 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
#include <linux/sched.h>
+#include <linux/delay.h>
#include <asm/io.h>
struct gameport;
@@ -37,26 +38,21 @@ struct gameport;
struct gameport {
void *private;
- void *driver;
int number;
int io;
- int size;
int speed;
int fuzz;
- int type;
- struct pci_dev *pci;
void (*trigger)(struct gameport *);
unsigned char (*read)(struct gameport *);
- int (*cooked_read)(struct gameport *, int *, int *);
- int (*calibrate)(struct gameport *, int *, int *);
+ int (*cooked_read)(struct gameport *, int *, int *);
+ int (*calibrate)(struct gameport *, int *, int *);
int (*open)(struct gameport *, int);
void (*close)(struct gameport *);
struct gameport_dev *dev;
-
struct gameport *next;
};
@@ -74,8 +70,14 @@ int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode)
void gameport_close(struct gameport *gameport);
void gameport_rescan(struct gameport *gameport);
+#if defined(CONFIG_INPUT_GAMEPORT) || defined(CONFIG_INPUT_GAMEPORT_MODULE)
void gameport_register_port(struct gameport *gameport);
void gameport_unregister_port(struct gameport *gameport);
+#else
+void __inline__ gameport_register_port(struct gameport *gameport) { return; }
+void __inline__ gameport_unregister_port(struct gameport *gameport) { return; }
+#endif
+
void gameport_register_device(struct gameport_dev *dev);
void gameport_unregister_device(struct gameport_dev *dev);
@@ -83,10 +85,6 @@ void gameport_unregister_device(struct gameport_dev *dev);
#define GAMEPORT_MODE_RAW 1
#define GAMEPORT_MODE_COOKED 2
-#define GAMEPORT_ISA 0
-#define GAMEPORT_PNP 1
-#define GAMEPORT_EXT 2
-
#define GAMEPORT_ID_VENDOR_ANALOG 0x0001
#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002
#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
new file mode 100644
index 000000000000..cffc0323325d
--- /dev/null
+++ b/include/linux/hiddev.h
@@ -0,0 +1,194 @@
+#ifndef _HIDDEV_H
+#define _HIDDEV_H
+
+/*
+ * $Id: hiddev.h,v 1.2 2001/04/26 11:26:09 vojtech Exp $
+ *
+ * Copyright (c) 1999-2000 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+
+/*
+ * The event structure itself
+ */
+
+struct hiddev_event {
+ unsigned hid;
+ signed int value;
+};
+
+struct hiddev_devinfo {
+ unsigned int bustype;
+ unsigned int busnum;
+ unsigned int devnum;
+ unsigned int ifnum;
+ short vendor;
+ short product;
+ short version;
+ unsigned num_applications;
+};
+
+#define HID_STRING_SIZE 256
+struct hiddev_string_descriptor {
+ int index;
+ char value[HID_STRING_SIZE];
+};
+
+struct hiddev_report_info {
+ unsigned report_type;
+ unsigned report_id;
+ unsigned num_fields;
+};
+
+/* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and
+ * report_id. Set report_id to REPORT_ID_UNKNOWN if the rest of the fields
+ * are unknown. Otherwise use a usage_ref struct filled in from a previous
+ * successful GUSAGE/SUSAGE call to save time. To actually send a value
+ * to the device, perform a SUSAGE first, followed by a SREPORT. If an
+ * INITREPORT is done, a GREPORT isn't necessary before a GUSAGE.
+ */
+#define HID_REPORT_ID_UNKNOWN 0xffffffff
+#define HID_REPORT_ID_FIRST 0x00000100
+#define HID_REPORT_ID_NEXT 0x00000200
+#define HID_REPORT_ID_MASK 0x000000ff
+#define HID_REPORT_ID_MAX 0x000000ff
+
+#define HID_REPORT_TYPE_INPUT 1
+#define HID_REPORT_TYPE_OUTPUT 2
+#define HID_REPORT_TYPE_FEATURE 3
+#define HID_REPORT_TYPE_MIN 1
+#define HID_REPORT_TYPE_MAX 3
+
+struct hiddev_field_info {
+ unsigned report_type;
+ unsigned report_id;
+ unsigned field_index;
+ unsigned maxusage;
+ unsigned flags;
+ unsigned physical; /* physical usage for this field */
+ unsigned logical; /* logical usage for this field */
+ unsigned application; /* application usage for this field */
+ __s32 logical_minimum;
+ __s32 logical_maximum;
+ __s32 physical_minimum;
+ __s32 physical_maximum;
+ unsigned unit_exponent;
+ unsigned unit;
+};
+
+/* Fill in report_type, report_id and field_index to get the information on a
+ * field.
+ */
+#define HID_FIELD_CONSTANT 0x001
+#define HID_FIELD_VARIABLE 0x002
+#define HID_FIELD_RELATIVE 0x004
+#define HID_FIELD_WRAP 0x008
+#define HID_FIELD_NONLINEAR 0x010
+#define HID_FIELD_NO_PREFERRED 0x020
+#define HID_FIELD_NULL_STATE 0x040
+#define HID_FIELD_VOLATILE 0x080
+#define HID_FIELD_BUFFERED_BYTE 0x100
+
+struct hiddev_usage_ref {
+ unsigned report_type;
+ unsigned report_id;
+ unsigned field_index;
+ unsigned usage_index;
+ unsigned usage_code;
+ __s32 value;
+};
+
+
+/*
+ * Protocol version.
+ */
+
+#define HID_VERSION 0x010002
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+#define HIDIOCGVERSION _IOR('H', 0x01, int)
+#define HIDIOCAPPLICATION _IO('H', 0x02)
+#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
+#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
+#define HIDIOCINITREPORT _IO('H', 0x05)
+#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
+#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
+#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
+#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
+#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
+#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
+#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
+
+/* To traverse the input report descriptor info for a HID device, perform the
+ * following:
+ *
+ * rinfo.report_type = HID_REPORT_TYPE_INPUT;
+ * rinfo.report_id = HID_REPORT_ID_FIRST;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ *
+ * while (ret >= 0) {
+ * for (i = 0; i < rinfo.num_fields; i++) {
+ * finfo.report_type = rinfo.report_type;
+ * finfo.report_id = rinfo.report_id;
+ * finfo.field_index = i;
+ * ioctl(fd, HIDIOCGFIELDINFO, &finfo);
+ * for (j = 0; j < finfo.maxusage; j++) {
+ * uref.field_index = i;
+ * uref.usage_index = j;
+ * ioctl(fd, HIDIOCGUCODE, &uref);
+ * ioctl(fd, HIDIOCGUSAGE, &uref);
+ * }
+ * }
+ * uref.report_id |= HID_REPORT_ID_NEXT;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &uref);
+ * }
+ */
+
+
+#ifdef __KERNEL__
+
+/*
+ * In-kernel definitions.
+ */
+
+#ifdef CONFIG_USB_HIDDEV
+int hiddev_connect(struct hid_device *);
+void hiddev_disconnect(struct hid_device *);
+void hiddev_hid_event(struct hid_device *, unsigned int usage, int value);
+int __init hiddev_init(void);
+void __exit hiddev_exit(void);
+#else
+static inline void *hiddev_connect(struct hid_device *hid) { return NULL; }
+static inline void hiddev_disconnect(struct hid_device *hid) { }
+static inline void hiddev_event(struct hid_device *hid, unsigned int usage, int value) { }
+static inline int hiddev_init(void) { return 0; }
+static inline void hiddev_exit(void) { }
+#endif
+
+#endif
+#endif
diff --git a/include/linux/input.h b/include/linux/input.h
index 277ee6c58957..3f961ae82a17 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -2,7 +2,7 @@
#define _INPUT_H
/*
- * $Id: input.h,v 1.18 2000/07/25 21:36:56 vojtech Exp $
+ * $Id: input.h,v 1.34 2001/05/28 09:06:44 vojtech Exp $
*
* Copyright (c) 1999-2000 Vojtech Pavlik
*
@@ -12,18 +12,18 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
@@ -34,6 +34,7 @@
#else
#include <sys/time.h>
#include <sys/ioctl.h>
+#include <asm/types.h>
#endif
/*
@@ -57,7 +58,7 @@ struct input_event {
* IOCTLs (0x00 - 0x7f)
*/
-#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
+#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
#define EVIOCGID _IOR('E', 0x02, short[4]) /* get device ID */
#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
#define EVIOCSREP _IOW('E', 0x03, int[2]) /* get repeat settings */
@@ -65,9 +66,16 @@ struct input_event {
#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
#define EVIOCGKEY _IOR('E', 0x05, int[2]) /* get key value */
#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
+#define EVIOCGBUS _IOR('E', 0x07, short[4]) /* get bus address */
#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
-#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, int[5]) /* get abs value/limits */
+#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, int[5]) /* get abs value/limits */
+
+#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
+#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
+#define EVIOCSGAIN _IOW('E', 0x82, unsigned short) /* Set overall gain */
+#define EVIOCSAUTOCENTER _IOW('E', 0x83, unsigned short) /* Enable or disable auto-centering */
+#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
/*
* Event types
@@ -77,187 +85,189 @@ struct input_event {
#define EV_KEY 0x01
#define EV_REL 0x02
#define EV_ABS 0x03
+#define EV_MSC 0x04
#define EV_LED 0x11
#define EV_SND 0x12
#define EV_REP 0x14
+#define EV_FF 0x15
#define EV_MAX 0x1f
/*
* Keys and buttons
*/
-#define KEY_RESERVED 0
-#define KEY_ESC 1
-#define KEY_1 2
-#define KEY_2 3
-#define KEY_3 4
-#define KEY_4 5
-#define KEY_5 6
-#define KEY_6 7
-#define KEY_7 8
-#define KEY_8 9
-#define KEY_9 10
-#define KEY_0 11
-#define KEY_MINUS 12
-#define KEY_EQUAL 13
-#define KEY_BACKSPACE 14
-#define KEY_TAB 15
-#define KEY_Q 16
-#define KEY_W 17
-#define KEY_E 18
-#define KEY_R 19
-#define KEY_T 20
-#define KEY_Y 21
-#define KEY_U 22
-#define KEY_I 23
-#define KEY_O 24
-#define KEY_P 25
-#define KEY_LEFTBRACE 26
-#define KEY_RIGHTBRACE 27
-#define KEY_ENTER 28
-#define KEY_LEFTCTRL 29
-#define KEY_A 30
-#define KEY_S 31
-#define KEY_D 32
-#define KEY_F 33
-#define KEY_G 34
-#define KEY_H 35
-#define KEY_J 36
-#define KEY_K 37
-#define KEY_L 38
-#define KEY_SEMICOLON 39
-#define KEY_APOSTROPHE 40
-#define KEY_GRAVE 41
-#define KEY_LEFTSHIFT 42
-#define KEY_BACKSLASH 43
-#define KEY_Z 44
-#define KEY_X 45
-#define KEY_C 46
-#define KEY_V 47
-#define KEY_B 48
-#define KEY_N 49
-#define KEY_M 50
-#define KEY_COMMA 51
-#define KEY_DOT 52
-#define KEY_SLASH 53
-#define KEY_RIGHTSHIFT 54
-#define KEY_KPASTERISK 55
-#define KEY_LEFTALT 56
-#define KEY_SPACE 57
-#define KEY_CAPSLOCK 58
-#define KEY_F1 59
-#define KEY_F2 60
-#define KEY_F3 61
-#define KEY_F4 62
-#define KEY_F5 63
-#define KEY_F6 64
-#define KEY_F7 65
-#define KEY_F8 66
-#define KEY_F9 67
-#define KEY_F10 68
-#define KEY_NUMLOCK 69
-#define KEY_SCROLLLOCK 70
-#define KEY_KP7 71
-#define KEY_KP8 72
-#define KEY_KP9 73
-#define KEY_KPMINUS 74
-#define KEY_KP4 75
-#define KEY_KP5 76
-#define KEY_KP6 77
-#define KEY_KPPLUS 78
-#define KEY_KP1 79
-#define KEY_KP2 80
-#define KEY_KP3 81
-#define KEY_KP0 82
-#define KEY_KPDOT 83
+#define KEY_RESERVED 0
+#define KEY_ESC 1
+#define KEY_1 2
+#define KEY_2 3
+#define KEY_3 4
+#define KEY_4 5
+#define KEY_5 6
+#define KEY_6 7
+#define KEY_7 8
+#define KEY_8 9
+#define KEY_9 10
+#define KEY_0 11
+#define KEY_MINUS 12
+#define KEY_EQUAL 13
+#define KEY_BACKSPACE 14
+#define KEY_TAB 15
+#define KEY_Q 16
+#define KEY_W 17
+#define KEY_E 18
+#define KEY_R 19
+#define KEY_T 20
+#define KEY_Y 21
+#define KEY_U 22
+#define KEY_I 23
+#define KEY_O 24
+#define KEY_P 25
+#define KEY_LEFTBRACE 26
+#define KEY_RIGHTBRACE 27
+#define KEY_ENTER 28
+#define KEY_LEFTCTRL 29
+#define KEY_A 30
+#define KEY_S 31
+#define KEY_D 32
+#define KEY_F 33
+#define KEY_G 34
+#define KEY_H 35
+#define KEY_J 36
+#define KEY_K 37
+#define KEY_L 38
+#define KEY_SEMICOLON 39
+#define KEY_APOSTROPHE 40
+#define KEY_GRAVE 41
+#define KEY_LEFTSHIFT 42
+#define KEY_BACKSLASH 43
+#define KEY_Z 44
+#define KEY_X 45
+#define KEY_C 46
+#define KEY_V 47
+#define KEY_B 48
+#define KEY_N 49
+#define KEY_M 50
+#define KEY_COMMA 51
+#define KEY_DOT 52
+#define KEY_SLASH 53
+#define KEY_RIGHTSHIFT 54
+#define KEY_KPASTERISK 55
+#define KEY_LEFTALT 56
+#define KEY_SPACE 57
+#define KEY_CAPSLOCK 58
+#define KEY_F1 59
+#define KEY_F2 60
+#define KEY_F3 61
+#define KEY_F4 62
+#define KEY_F5 63
+#define KEY_F6 64
+#define KEY_F7 65
+#define KEY_F8 66
+#define KEY_F9 67
+#define KEY_F10 68
+#define KEY_NUMLOCK 69
+#define KEY_SCROLLLOCK 70
+#define KEY_KP7 71
+#define KEY_KP8 72
+#define KEY_KP9 73
+#define KEY_KPMINUS 74
+#define KEY_KP4 75
+#define KEY_KP5 76
+#define KEY_KP6 77
+#define KEY_KPPLUS 78
+#define KEY_KP1 79
+#define KEY_KP2 80
+#define KEY_KP3 81
+#define KEY_KP0 82
+#define KEY_KPDOT 83
#define KEY_103RD 84
-#define KEY_F13 85
-#define KEY_102ND 86
-#define KEY_F11 87
-#define KEY_F12 88
-#define KEY_F14 89
-#define KEY_F15 90
-#define KEY_F16 91
-#define KEY_F17 92
-#define KEY_F18 93
-#define KEY_F19 94
-#define KEY_F20 95
-#define KEY_KPENTER 96
-#define KEY_RIGHTCTRL 97
-#define KEY_KPSLASH 98
-#define KEY_SYSRQ 99
-#define KEY_RIGHTALT 100
-#define KEY_LINEFEED 101
-#define KEY_HOME 102
-#define KEY_UP 103
-#define KEY_PAGEUP 104
-#define KEY_LEFT 105
-#define KEY_RIGHT 106
-#define KEY_END 107
-#define KEY_DOWN 108
-#define KEY_PAGEDOWN 109
-#define KEY_INSERT 110
-#define KEY_DELETE 111
-#define KEY_MACRO 112
-#define KEY_MUTE 113
-#define KEY_VOLUMEDOWN 114
-#define KEY_VOLUMEUP 115
-#define KEY_POWER 116
-#define KEY_KPEQUAL 117
-#define KEY_KPPLUSMINUS 118
-#define KEY_PAUSE 119
-#define KEY_F21 120
-#define KEY_F22 121
-#define KEY_F23 122
-#define KEY_F24 123
+#define KEY_F13 85
+#define KEY_102ND 86
+#define KEY_F11 87
+#define KEY_F12 88
+#define KEY_F14 89
+#define KEY_F15 90
+#define KEY_F16 91
+#define KEY_F17 92
+#define KEY_F18 93
+#define KEY_F19 94
+#define KEY_F20 95
+#define KEY_KPENTER 96
+#define KEY_RIGHTCTRL 97
+#define KEY_KPSLASH 98
+#define KEY_SYSRQ 99
+#define KEY_RIGHTALT 100
+#define KEY_LINEFEED 101
+#define KEY_HOME 102
+#define KEY_UP 103
+#define KEY_PAGEUP 104
+#define KEY_LEFT 105
+#define KEY_RIGHT 106
+#define KEY_END 107
+#define KEY_DOWN 108
+#define KEY_PAGEDOWN 109
+#define KEY_INSERT 110
+#define KEY_DELETE 111
+#define KEY_MACRO 112
+#define KEY_MUTE 113
+#define KEY_VOLUMEDOWN 114
+#define KEY_VOLUMEUP 115
+#define KEY_POWER 116
+#define KEY_KPEQUAL 117
+#define KEY_KPPLUSMINUS 118
+#define KEY_PAUSE 119
+#define KEY_F21 120
+#define KEY_F22 121
+#define KEY_F23 122
+#define KEY_F24 123
#define KEY_KPCOMMA 124
-#define KEY_LEFTMETA 125
-#define KEY_RIGHTMETA 126
-#define KEY_COMPOSE 127
-
-#define KEY_STOP 128
-#define KEY_AGAIN 129
-#define KEY_PROPS 130
-#define KEY_UNDO 131
-#define KEY_FRONT 132
-#define KEY_COPY 133
-#define KEY_OPEN 134
-#define KEY_PASTE 135
-#define KEY_FIND 136
-#define KEY_CUT 137
-#define KEY_HELP 138
-#define KEY_MENU 139
-#define KEY_CALC 140
-#define KEY_SETUP 141
-#define KEY_SLEEP 142
-#define KEY_WAKEUP 143
-#define KEY_FILE 144
-#define KEY_SENDFILE 145
-#define KEY_DELETEFILE 146
-#define KEY_XFER 147
-#define KEY_PROG1 148
-#define KEY_PROG2 149
-#define KEY_WWW 150
-#define KEY_MSDOS 151
-#define KEY_COFFEE 152
-#define KEY_DIRECTION 153
-#define KEY_CYCLEWINDOWS 154
+#define KEY_LEFTMETA 125
+#define KEY_RIGHTMETA 126
+#define KEY_COMPOSE 127
+
+#define KEY_STOP 128
+#define KEY_AGAIN 129
+#define KEY_PROPS 130
+#define KEY_UNDO 131
+#define KEY_FRONT 132
+#define KEY_COPY 133
+#define KEY_OPEN 134
+#define KEY_PASTE 135
+#define KEY_FIND 136
+#define KEY_CUT 137
+#define KEY_HELP 138
+#define KEY_MENU 139
+#define KEY_CALC 140
+#define KEY_SETUP 141
+#define KEY_SLEEP 142
+#define KEY_WAKEUP 143
+#define KEY_FILE 144
+#define KEY_SENDFILE 145
+#define KEY_DELETEFILE 146
+#define KEY_XFER 147
+#define KEY_PROG1 148
+#define KEY_PROG2 149
+#define KEY_WWW 150
+#define KEY_MSDOS 151
+#define KEY_COFFEE 152
+#define KEY_DIRECTION 153
+#define KEY_CYCLEWINDOWS 154
#define KEY_MAIL 155
#define KEY_BOOKMARKS 156
#define KEY_COMPUTER 157
#define KEY_BACK 158
#define KEY_FORWARD 159
-#define KEY_CLOSECD 160
-#define KEY_EJECTCD 161
-#define KEY_EJECTCLOSECD 162
-#define KEY_NEXTSONG 163
-#define KEY_PLAYPAUSE 164
-#define KEY_PREVIOUSSONG 165
-#define KEY_STOPCD 166
-#define KEY_RECORD 167
-#define KEY_REWIND 168
+#define KEY_CLOSECD 160
+#define KEY_EJECTCD 161
+#define KEY_EJECTCLOSECD 162
+#define KEY_NEXTSONG 163
+#define KEY_PLAYPAUSE 164
+#define KEY_PREVIOUSSONG 165
+#define KEY_STOPCD 166
+#define KEY_RECORD 167
+#define KEY_REWIND 168
#define KEY_PHONE 169
-
+#define KEY_ISO 170
#define KEY_CONFIG 171
#define KEY_HOMEPAGE 172
#define KEY_REFRESH 173
@@ -288,7 +298,14 @@ struct input_event {
#define KEY_LANG8 197
#define KEY_LANG9 198
-#define KEY_UNKNOWN 200
+#define KEY_PLAYCD 200
+#define KEY_PAUSECD 201
+#define KEY_PROG3 202
+#define KEY_PROG4 203
+#define KEY_SUSPEND 205
+#define KEY_CLOSE 206
+
+#define KEY_UNKNOWN 220
#define BTN_MISC 0x100
#define BTN_0 0x100
@@ -324,6 +341,7 @@ struct input_event {
#define BTN_BASE4 0x129
#define BTN_BASE5 0x12a
#define BTN_BASE6 0x12b
+#define BTN_DEAD 0x12f
#define BTN_GAMEPAD 0x130
#define BTN_A 0x130
@@ -339,6 +357,8 @@ struct input_event {
#define BTN_SELECT 0x13a
#define BTN_START 0x13b
#define BTN_MODE 0x13c
+#define BTN_THUMBL 0x13d
+#define BTN_THUMBR 0x13e
#define BTN_DIGI 0x140
#define BTN_TOOL_PEN 0x140
@@ -399,6 +419,13 @@ struct input_event {
#define ABS_MAX 0x1f
/*
+ * Misc events
+ */
+
+#define MSC_SERIAL 0x00
+#define MSC_MAX 0x07
+
+/*
* LEDs
*/
@@ -407,6 +434,10 @@ struct input_event {
#define LED_SCROLLL 0x02
#define LED_COMPOSE 0x03
#define LED_KANA 0x04
+#define LED_SLEEP 0x05
+#define LED_SUSPEND 0x06
+#define LED_MUTE 0x07
+#define LED_MISC 0x08
#define LED_MAX 0x0f
/*
@@ -448,6 +479,135 @@ struct input_event {
#define BUS_ADB 0x17
#define BUS_I2C 0x18
+/*
+ * Structures used in ioctls to upload effects to a device
+ * The first structures are not passed directly by using ioctls.
+ * They are sub-structures of the actually sent structure (called ff_effect)
+ */
+
+struct ff_replay {
+ __u16 length; /* Duration of an effect */
+ __u16 delay; /* Time to wait before to start playing an effect */
+};
+
+struct ff_trigger {
+ __u16 button; /* Number of button triggering an effect */
+ __u16 interval; /* Time to wait before an effect can be re-triggered */
+};
+
+struct ff_shape {
+ __u16 attack_length; /* Duration of attack */
+ __s16 attack_level; /* Level at beginning of attack */
+ __u16 fade_length; /* Duration of fade */
+ __s16 fade_level; /* Level at end of fade */
+};
+
+/* FF_CONSTANT */
+struct ff_constant_effect {
+ __s16 level; /* Strength of effect */
+ __u16 direction; /* Direction of effect (see periodic effects) */
+ struct ff_shape shape;
+};
+
+/* FF_SPRING of FF_FRICTION */
+struct ff_interactive_effect {
+/* Axis along which effect must be created. If null, the field named direction
+ * is used
+ * It is a bit array (ie to enable axes X and Y, use BIT(ABS_X) | BIT(ABS_Y)
+ */
+ __u16 axis;
+ __u16 direction;
+
+ __s16 right_saturation; /* Max level when joystick is on the right */
+ __s16 left_saturation; /* Max level when joystick in on the left */
+
+ __s16 right_coeff; /* Indicates how fast the force grows when the
+ joystick moves to the right */
+ __s16 left_coeff; /* Same for left side */
+
+ __u16 deadband; /* Size of area where no force is produced */
+ __s16 center; /* Position of dead dead zone */
+
+};
+
+/* FF_PERIODIC */
+struct ff_periodic_effect {
+ __u16 waveform; /* Kind of wave (sine, square...) */
+ __u16 period;
+ __s16 magnitude; /* Peak value */
+ __s16 offset; /* Mean value of wave (roughly) */
+ __u16 phase; /* 'Horizontal' shift */
+ __u16 direction; /* Direction. 0 deg -> 0x0000
+ 90 deg -> 0x4000 */
+
+ struct ff_shape shape;
+};
+
+/*
+ * Structure sent through ioctl from the application to the driver
+ */
+struct ff_effect {
+ __u16 type;
+/* Following field denotes the unique id assigned to an effect.
+ * It is set by the driver.
+ */
+ __s16 id;
+
+ struct ff_trigger trigger;
+ struct ff_replay replay;
+
+ union {
+ struct ff_constant_effect constant;
+ struct ff_periodic_effect periodic;
+ struct ff_interactive_effect interactive;
+ } u;
+};
+
+/*
+ * Buttons that can trigger effects. Use for example FF_BTN(BTN_TRIGGER) to
+ * access the bitmap.
+ */
+
+#define FF_BTN(x) ((x) - BTN_MISC + FF_BTN_OFFSET)
+#define FF_BTN_OFFSET 0x00
+
+/*
+ * Force feedback axis mappings. Use FF_ABS() to access the bitmap.
+ */
+
+#define FF_ABS(x) ((x) + FF_ABS_OFFSET)
+#define FF_ABS_OFFSET 0x40
+
+/*
+ * Force feedback effect types
+ */
+
+#define FF_RUMBLE 0x50
+#define FF_PERIODIC 0x51
+#define FF_CONSTANT 0x52
+#define FF_SPRING 0x53
+#define FF_FRICTION 0x54
+
+/*
+ * Force feedback periodic effect types
+ */
+
+#define FF_SQUARE 0x58
+#define FF_TRIANGLE 0x59
+#define FF_SINE 0x5a
+#define FF_SAW_UP 0x5b
+#define FF_SAW_DOWN 0x5c
+#define FF_CUSTOM 0x5d
+
+/*
+ * Set ff device properties
+ */
+
+#define FF_GAIN 0x60
+#define FF_AUTOCENTER 0x61
+
+#define FF_MAX 0x7f
+
#ifdef __KERNEL__
/*
@@ -476,8 +636,11 @@ struct input_dev {
unsigned long keybit[NBITS(KEY_MAX)];
unsigned long relbit[NBITS(REL_MAX)];
unsigned long absbit[NBITS(ABS_MAX)];
+ unsigned long mscbit[NBITS(MSC_MAX)];
unsigned long ledbit[NBITS(LED_MAX)];
unsigned long sndbit[NBITS(SND_MAX)];
+ unsigned long ffbit[NBITS(FF_MAX)];
+ int ff_effects_max;
unsigned int keycodemax;
unsigned int keycodesize;
@@ -492,7 +655,7 @@ struct input_dev {
unsigned long key[NBITS(KEY_MAX)];
unsigned long led[NBITS(LED_MAX)];
unsigned long snd[NBITS(SND_MAX)];
-
+
int absmax[ABS_MAX + 1];
int absmin[ABS_MAX + 1];
int absfuzz[ABS_MAX + 1];
@@ -501,6 +664,8 @@ struct input_dev {
int (*open)(struct input_dev *dev);
void (*close)(struct input_dev *dev);
int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
+ int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect);
+ int (*erase_effect)(struct input_dev *dev, int effect_id);
struct input_handle *handle;
struct input_dev *next;
@@ -526,7 +691,7 @@ struct input_handle {
void *private;
int open;
-
+
struct input_dev *dev;
struct input_handler *handler;
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 40aec1c8db1d..50370a7e70da 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -92,10 +92,15 @@ enum {
#define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
-#define IAS_MAX_STRING 256
-#define IAS_MAX_OCTET_STRING 1024
-#define IAS_MAX_CLASSNAME 64
-#define IAS_MAX_ATTRIBNAME 256
+#define IAS_MAX_STRING 256 /* See IrLMP 1.1, 4.3.3.2 */
+#define IAS_MAX_OCTET_STRING 1024 /* See IrLMP 1.1, 4.3.3.2 */
+#define IAS_MAX_CLASSNAME 60 /* See IrLMP 1.1, 4.3.1 */
+#define IAS_MAX_ATTRIBNAME 60 /* See IrLMP 1.1, 4.3.3.1 */
+#define IAS_MAX_ATTRIBNUMBER 256 /* See IrLMP 1.1, 4.3.3.1 */
+/* For user space backward compatibility - may be fixed in kernel 2.5.X
+ * Note : need 60+1 ('\0'), make it 64 for alignement - Jean II */
+#define IAS_EXPORT_CLASSNAME 64
+#define IAS_EXPORT_ATTRIBNAME 256
/* Attribute type needed for struct irda_ias_set */
#define IAS_MISSING 0
@@ -126,8 +131,8 @@ struct irda_device_list {
};
struct irda_ias_set {
- char irda_class_name[IAS_MAX_CLASSNAME];
- char irda_attrib_name[IAS_MAX_ATTRIBNAME];
+ char irda_class_name[IAS_EXPORT_CLASSNAME];
+ char irda_attrib_name[IAS_EXPORT_ATTRIBNAME];
unsigned int irda_attrib_type;
union {
unsigned int irda_attrib_int;
diff --git a/include/linux/ite_gpio.h b/include/linux/ite_gpio.h
new file mode 100644
index 000000000000..b123a14292d3
--- /dev/null
+++ b/include/linux/ite_gpio.h
@@ -0,0 +1,66 @@
+/*
+ * FILE NAME ite_gpio.h
+ *
+ * BRIEF MODULE DESCRIPTION
+ * Generic gpio.
+ *
+ * Author: MontaVista Software, Inc. <source@mvista.com>
+ * Hai-Pao Fan <haipao@mvista.com>
+ *
+ * Copyright 2001 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ITE_GPIO_H
+#define __ITE_GPIO_H
+
+#include <linux/ioctl.h>
+
+struct ite_gpio_ioctl_data {
+ __u32 device;
+ __u32 mask;
+ __u32 data;
+};
+
+#define ITE_GPIO_IOCTL_BASE 'Z'
+
+#define ITE_GPIO_IN _IOWR(ITE_GPIO_IOCTL_BASE, 0, struct ite_gpio_ioctl_data)
+#define ITE_GPIO_OUT _IOW (ITE_GPIO_IOCTL_BASE, 1, struct ite_gpio_ioctl_data)
+#define ITE_GPIO_INT_CTRL _IOW (ITE_GPIO_IOCTL_BASE, 2, struct ite_gpio_ioctl_data)
+#define ITE_GPIO_IN_STATUS _IOW (ITE_GPIO_IOCTL_BASE, 3, struct ite_gpio_ioctl_data)
+#define ITE_GPIO_OUT_STATUS _IOW (ITE_GPIO_IOCTL_BASE, 4, struct ite_gpio_ioctl_data)
+#define ITE_GPIO_GEN_CTRL _IOW (ITE_GPIO_IOCTL_BASE, 5, struct ite_gpio_ioctl_data)
+#define ITE_GPIO_INT_WAIT _IOW (ITE_GPIO_IOCTL_BASE, 6, struct ite_gpio_ioctl_data)
+
+#define ITE_GPIO_PORTA 0x01
+#define ITE_GPIO_PORTB 0x02
+#define ITE_GPIO_PORTC 0x04
+
+extern int ite_gpio_in(__u32 device, __u32 mask, volatile __u32 *data);
+extern int ite_gpio_out(__u32 device, __u32 mask, __u32 data);
+extern int ite_gpio_int_ctrl(__u32 device, __u32 mask, __u32 data);
+extern int ite_gpio_in_status(__u32 device, __u32 mask, volatile __u32 *data);
+extern int ite_gpio_out_status(__u32 device, __u32 mask, __u32 data);
+extern int ite_gpio_gen_ctrl(__u32 device, __u32 mask, __u32 data);
+extern int ite_gpio_int_wait(__u32 device, __u32 mask, __u32 data);
+
+#endif
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
index 5310a15e0149..94e30d6709c8 100644
--- a/include/linux/ixjuser.h
+++ b/include/linux/ixjuser.h
@@ -1,11 +1,16 @@
+#ifndef __LINUX_IXJUSER_H
+#define __LINUX_IXJUSER_H
+
/******************************************************************************
*
* ixjuser.h
*
- * Device Driver for the Internet PhoneJACK and
- * Internet LineJACK Telephony Cards.
+ * Device Driver for Quicknet Technologies, Inc.'s Telephony cards
+ * including the Internet PhoneJACK, Internet PhoneJACK Lite,
+ * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and
+ * SmartCABLE
*
- * (c) Copyright 1999 Quicknet Technologies, Inc.
+ * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -37,14 +42,14 @@
*
*****************************************************************************/
-static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 3.11 2000/03/30 22:06:48 eokerson Exp $";
+static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 4.1 2001/08/05 00:17:37 craigs Exp $";
-#include "telephony.h"
+#include <linux/telephony.h>
/******************************************************************************
*
-* IOCTL's used for the Quicknet Cards
+* IOCTL's used for the Quicknet Telephony Cards
*
* If you use the IXJCTL_TESTRAM command, the card must be power cycled to
* reset the SRAM values before futher use.
@@ -135,6 +140,7 @@ typedef struct {
} IXJ_FILTER_CADENCE;
#define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *)
+#define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *)
#define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int)
#define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *)
#define IXJCTL_PLAY_CID _IO ('q', 0xD7)
@@ -366,7 +372,7 @@ typedef struct {
* This group of IOCTLs deal with the Acoustic Echo Cancellation settings
* of the DSP
*
-* Issueing the IXJCTL_AEC_START command with a value of AEC_OFF has the
+* Issuing the IXJCTL_AEC_START command with a value of AEC_OFF has the
* same effect as IXJCTL_AEC_STOP. This is to simplify slider bar
* controls. IXJCTL_AEC_GET_LEVEL returns the current setting of the AEC.
******************************************************************************/
@@ -379,11 +385,12 @@ typedef struct {
#define AEC_MED 2
#define AEC_HIGH 3
#define AEC_AUTO 4
+#define AEC_AGC 5
/******************************************************************************
*
* Call Progress Tones, DTMF, etc.
-* IXJCTL_DTMF_OOB determines if dtmf signaling is sent as Out-Of-Band
-* only. If you pass a 1, dtmf is suppressed from the audio stream.
+* IXJCTL_DTMF_OOB determines if DTMF signaling is sent as Out-Of-Band
+* only. If you pass a 1, DTMF is suppressed from the audio stream.
* Tone on and off times are in 250 microsecond intervals so
* ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360);
* will set the tone on time of board ixj1 to 360 * 250us = 90ms
@@ -407,10 +414,10 @@ typedef struct {
#define IXJCTL_CPT_STOP PHONE_CPT_STOP
/******************************************************************************
-* LineJack specific IOCTLs
+* LineJACK specific IOCTLs
*
* The lsb 4 bits of the LED argument represent the state of each of the 4
-* LED's on the LineJack
+* LED's on the LineJACK
******************************************************************************/
#define IXJCTL_SET_LED _IOW ('q', 0xCE, int)
@@ -423,8 +430,8 @@ typedef struct {
* as the parameter to the mixer command to change the mixer settings.
*
******************************************************************************/
-#define MIXER_MASTER_L 0x0100
-#define MIXER_MASTER_R 0x0200
+#define MIXER_MASTER_L 0x0000
+#define MIXER_MASTER_R 0x0100
#define ATT00DB 0x00
#define ATT02DB 0x01
#define ATT04DB 0x02
@@ -535,9 +542,9 @@ typedef struct {
******************************************************************************/
#define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD0, int)
-#define DAA_US 1 //PITA 8kHz
-#define DAA_UK 2 //ISAR34 8kHz
-#define DAA_FRANCE 3 //
+#define DAA_US 1 /*PITA 8kHz */
+#define DAA_UK 2 /*ISAR34 8kHz */
+#define DAA_FRANCE 3 /* */
#define DAA_GERMANY 4
#define DAA_AUSTRALIA 5
#define DAA_JAPAN 6
@@ -575,14 +582,14 @@ typedef struct {
******************************************************************************/
#define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int)
-#define AGRR00DB 0x00 // Analog gain in receive direction 0dB
-#define AGRR3_5DB 0x10 // Analog gain in receive direction 3.5dB
-#define AGRR06DB 0x30 // Analog gain in receive direction 6dB
+#define AGRR00DB 0x00 /* Analog gain in receive direction 0dB */
+#define AGRR3_5DB 0x10 /* Analog gain in receive direction 3.5dB */
+#define AGRR06DB 0x30 /* Analog gain in receive direction 6dB */
-#define AGX00DB 0x00 // Analog gain in transmit direction 0dB
-#define AGX_6DB 0x04 // Analog gain in transmit direction -6dB
-#define AGX3_5DB 0x08 // Analog gain in transmit direction 3.5dB
-#define AGX_2_5B 0x0C // Analog gain in transmit direction -2.5dB
+#define AGX00DB 0x00 /* Analog gain in transmit direction 0dB */
+#define AGX_6DB 0x04 /* Analog gain in transmit direction -6dB */
+#define AGX3_5DB 0x08 /* Analog gain in transmit direction 3.5dB */
+#define AGX_2_5B 0x0C /* Analog gain in transmit direction -2.5dB */
#define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3)
@@ -639,6 +646,52 @@ typedef struct {
#define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long)
#define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long)
#define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7)
+#define IXJCTL_DTMF_PRESCALE _IOW ('q', 0xE8, int)
+
+/******************************************************************************
+*
+* This ioctl allows the user application to control what events the driver
+* will send signals for, and what signals it will send for which event.
+* By default, if signaling is enabled, all events will send SIGIO when
+* they occur. To disable signals for an event set the signal to 0.
+*
+******************************************************************************/
+typedef enum {
+ SIG_DTMF_READY,
+ SIG_HOOKSTATE,
+ SIG_FLASH,
+ SIG_PSTN_RING,
+ SIG_CALLER_ID,
+ SIG_PSTN_WINK,
+ SIG_F0, SIG_F1, SIG_F2, SIG_F3,
+ SIG_FC0, SIG_FC1, SIG_FC2, SIG_FC3,
+ SIG_READ_READY = 33,
+ SIG_WRITE_READY = 34
+} IXJ_SIGEVENT;
+
+typedef struct {
+ unsigned int event;
+ int signal;
+} IXJ_SIGDEF;
+
+#define IXJCTL_SIGCTL _IOW ('q', 0xE9, IXJ_SIGDEF *)
+
+/******************************************************************************
+*
+* These ioctls allow the user application to change the gain in the
+* Smart Cable of the Internet Phone Card. Sending -1 as a value will cause
+* return value to be the current setting. Valid values to set are 0x00 - 0x1F
+*
+* 11111 = +12 dB
+* 10111 = 0 dB
+* 00000 = -34.5 dB
+*
+* IXJCTL_SC_RXG sets the Receive gain
+* IXJCTL_SC_TXG sets the Transmit gain
+*
+******************************************************************************/
+#define IXJCTL_SC_RXG _IOW ('q', 0xEA, int)
+#define IXJCTL_SC_TXG _IOW ('q', 0xEB, int)
/******************************************************************************
*
@@ -653,3 +706,17 @@ typedef struct {
#define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int)
#define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int)
+
+/******************************************************************************
+ *
+ * new structure for accessing raw filter information
+ *
+ ******************************************************************************/
+
+typedef struct {
+ unsigned int filter;
+ char enable;
+ unsigned int coeff[19];
+} IXJ_FILTER_RAW;
+
+#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index cd9e83570b0b..4d0143310aca 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -64,6 +64,11 @@ extern int sprintf(char * buf, const char * fmt, ...);
extern int vsprintf(char *buf, const char *, va_list);
extern int snprintf(char * buf, size_t size, const char *fmt, ...);
extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+
+extern int sscanf(const char *, const char *, ...)
+ __attribute__ ((format (scanf,2,3)));
+extern int vsscanf(const char *, const char *, va_list);
+
extern int get_option(char **str, int *pint);
extern char *get_options(char *str, int nints, int *ints);
extern unsigned long long memparse(char *ptr, char **retptr);
diff --git a/include/linux/module.h b/include/linux/module.h
index 11192e9a1650..7dc117a3329c 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -130,6 +130,16 @@ struct module_info
((unsigned long)(&((struct module *)0L)->member + 1) \
<= (mod)->size_of_struct)
+/*
+ * Ditto for archdata. Assumes mod->archdata_start and mod->archdata_end
+ * are validated elsewhere.
+ */
+#define mod_archdata_member_present(mod, type, member) \
+ (((unsigned long)(&((type *)0L)->member) + \
+ sizeof(((type *)0L)->member)) <= \
+ ((mod)->archdata_end - (mod)->archdata_start))
+
+
/* Check if an address p with number of entries n is within the body of module m */
#define mod_bound(p, n, m) ((unsigned long)(p) >= ((unsigned long)(m) + ((m)->size_of_struct)) && \
(unsigned long)((p)+(n)) <= (unsigned long)(m) + (m)->size)
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 2fee6724727a..2d4fd336cbe6 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -12,6 +12,10 @@
#define _LINUX_MOUNT_H
#ifdef __KERNEL__
+#define MNT_NOSUID 1
+#define MNT_NODEV 2
+#define MNT_NOEXEC 4
+
struct vfsmount
{
struct list_head mnt_hash;
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 308a21c004b6..a97d3f4c55d8 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -37,8 +37,10 @@ extern int dquot_transfer(struct dentry *dentry, struct iattr *iattr);
*/
static __inline__ void DQUOT_INIT(struct inode *inode)
{
- if (inode->i_sb && inode->i_sb->dq_op)
- inode->i_sb->dq_op->initialize(inode, -1);
+ if (!IS_NOQUOTA(inode)) {
+ if (inode->i_sb && inode->i_sb->dq_op)
+ inode->i_sb->dq_op->initialize(inode, -1);
+ }
}
static __inline__ void DQUOT_DROP(struct inode *inode)
@@ -70,7 +72,7 @@ static __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct ino
static __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode *inode)
{
if (sb->dq_op) {
- sb->dq_op->initialize (inode, -1);
+ DQUOT_INIT(inode);
if (sb->dq_op->alloc_inode (inode, 1))
return 1;
}
@@ -94,8 +96,8 @@ static __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr)
{
int error = -EDQUOT;
- if (dentry->d_inode->i_sb->dq_op) {
- dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1);
+ if (dentry->d_inode->i_sb->dq_op && !IS_NOQUOTA(dentry->d_inode)) {
+ DQUOT_INIT(dentry->d_inode);
error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr);
} else {
error = notify_change(dentry, iattr);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 0849bd3f617f..63523dce1d0c 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -61,7 +61,7 @@ enum
CTL_FS=5, /* Filesystems */
CTL_DEBUG=6, /* Debugging */
CTL_DEV=7, /* Devices */
- CTL_BUS=8, /* Buses */
+ CTL_BUS=8, /* Busses */
CTL_ABI=9 /* Binary emulation */
};
@@ -119,7 +119,8 @@ enum
KERN_SHMPATH=48, /* string: path to shm fs */
KERN_HOTPLUG=49, /* string: path to hotplug policy agent */
KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
- KERN_S390_USER_DEBUG_LOGGING=51 /* int: dumps of user faults */
+ KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
+ KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
};
@@ -473,6 +474,7 @@ enum {
NET_DECNET_DR_COUNT = 8,
NET_DECNET_DST_GC_INTERVAL = 9,
NET_DECNET_CONF = 10,
+ NET_DECNET_NO_FC_MAX_CWND = 11,
NET_DECNET_DEBUG_LEVEL = 255
};
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 61cd98962bbe..52906444f233 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -14,6 +14,7 @@
#include <linux/list.h>
#include <linux/stddef.h>
#include <linux/spinlock.h>
+#include <linux/config.h>
#include <asm/page.h>
#include <asm/processor.h>
@@ -21,7 +22,11 @@
/*
* Debug control. Slow but useful.
*/
+#if defined(CONFIG_DEBUG_WAITQ)
+#define WAITQUEUE_DEBUG 1
+#else
#define WAITQUEUE_DEBUG 0
+#endif
struct __wait_queue {
unsigned int flags;