diff options
| author | David S. Miller <davem@nuts.davemloft.net> | 2005-01-10 05:04:15 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2005-01-10 05:04:15 -0800 |
| commit | 240cdcf7cc2bdc55bc13a065dc737efc5e3d54ba (patch) | |
| tree | 005fab276d9c68b5081377a2dd25601a3e2d585d /include/linux | |
| parent | 0526ab7788b28c58352e0deae17568dc7b071435 (diff) | |
| parent | 73ef2d644741787f8054e69c4c52d471bd68617f (diff) | |
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/debugfs.h | 90 | ||||
| -rw-r--r-- | include/linux/device.h | 7 | ||||
| -rw-r--r-- | include/linux/gfp.h | 1 | ||||
| -rw-r--r-- | include/linux/i2c-algo-sgi.h | 27 | ||||
| -rw-r--r-- | include/linux/i2c-algo-sibyte.h | 33 | ||||
| -rw-r--r-- | include/linux/i2c-id.h | 16 | ||||
| -rw-r--r-- | include/linux/if_ether.h | 2 | ||||
| -rw-r--r-- | include/linux/kobject.h | 2 | ||||
| -rw-r--r-- | include/linux/miscdevice.h | 5 | ||||
| -rw-r--r-- | include/linux/module.h | 19 | ||||
| -rw-r--r-- | include/linux/pci.h | 37 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 8 | ||||
| -rw-r--r-- | include/linux/ptrace.h | 1 | ||||
| -rw-r--r-- | include/linux/sysfs.h | 6 | ||||
| -rw-r--r-- | include/linux/usb.h | 94 | ||||
| -rw-r--r-- | include/linux/usb_ch9.h | 27 |
16 files changed, 305 insertions, 70 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h new file mode 100644 index 000000000000..6dc7e3eca188 --- /dev/null +++ b/include/linux/debugfs.h @@ -0,0 +1,90 @@ +/* + * debugfs.h - a tiny little debug file system + * + * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> + * Copyright (C) 2004 IBM Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + * + * debugfs is for people to use instead of /proc or /sys. + * See Documentation/DocBook/kernel-api for more details. + */ + +#ifndef _DEBUGFS_H_ +#define _DEBUGFS_H_ + +#if defined(CONFIG_DEBUG_FS) +struct dentry *debugfs_create_file(const char *name, mode_t mode, + struct dentry *parent, void *data, + struct file_operations *fops); + +struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); + +void debugfs_remove(struct dentry *dentry); + +struct dentry *debugfs_create_u8(const char *name, mode_t mode, + struct dentry *parent, u8 *value); +struct dentry *debugfs_create_u16(const char *name, mode_t mode, + struct dentry *parent, u16 *value); +struct dentry *debugfs_create_u32(const char *name, mode_t mode, + struct dentry *parent, u32 *value); +struct dentry *debugfs_create_bool(const char *name, mode_t mode, + struct dentry *parent, u32 *value); + +#else +/* + * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled + * so users have a chance to detect if there was a real error or not. We don't + * want to duplicate the design decision mistakes of procfs and devfs again. + */ + +static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, + struct dentry *parent, + void *data, + struct file_operations *fops) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_dir(const char *name, + struct dentry *parent) +{ + return ERR_PTR(-ENODEV); +} + +static inline void debugfs_remove(struct dentry *dentry) +{ } + +static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, + struct dentry *parent, + u8 *value) +{ + return ERR_PTR(-ENODEV); +} + +#endif + +#endif diff --git a/include/linux/device.h b/include/linux/device.h index c64cec37dd69..2c5d57283d5a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -228,7 +228,10 @@ extern int class_device_create_file(struct class_device *, const struct class_device_attribute *); extern void class_device_remove_file(struct class_device *, const struct class_device_attribute *); - +extern int class_device_create_bin_file(struct class_device *, + struct bin_attribute *); +extern void class_device_remove_bin_file(struct class_device *, + struct bin_attribute *); struct class_interface { struct list_head node; @@ -382,6 +385,8 @@ extern struct device platform_bus; extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); extern int platform_get_irq(struct platform_device *, unsigned int); +extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *); +extern int platform_get_irq_byname(struct platform_device *, char *); extern int platform_add_devices(struct platform_device **, int); extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 823589766569..b526b21bad1c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -53,7 +53,6 @@ struct vm_area_struct; #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS) #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM) -#define GFP_HIGHZERO (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM | __GFP_ZERO) /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some platforms, used as appropriate on others */ diff --git a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h new file mode 100644 index 000000000000..4a0113d64064 --- /dev/null +++ b/include/linux/i2c-algo-sgi.h @@ -0,0 +1,27 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License version 2 as published by the Free Software Foundation. + * + * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org> + */ + +#ifndef I2C_ALGO_SGI_H +#define I2C_ALGO_SGI_H 1 + +#include <linux/i2c.h> + +struct i2c_algo_sgi_data { + void *data; /* private data for lowlevel routines */ + unsigned (*getctrl)(void *data); + void (*setctrl)(void *data, unsigned val); + unsigned (*rdata)(void *data); + void (*wdata)(void *data, unsigned val); + + int xfer_timeout; + int ack_timeout; +}; + +int i2c_sgi_add_bus(struct i2c_adapter *); +int i2c_sgi_del_bus(struct i2c_adapter *); + +#endif /* I2C_ALGO_SGI_H */ diff --git a/include/linux/i2c-algo-sibyte.h b/include/linux/i2c-algo-sibyte.h new file mode 100644 index 000000000000..03914ded8614 --- /dev/null +++ b/include/linux/i2c-algo-sibyte.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2001,2002,2003 Broadcom Corporation + * + * 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. + */ + +#ifndef I2C_ALGO_SIBYTE_H +#define I2C_ALGO_SIBYTE_H 1 + +#include <linux/i2c.h> + +struct i2c_algo_sibyte_data { + void *data; /* private data */ + int bus; /* which bus */ + void *reg_base; /* CSR base */ +}; + +int i2c_sibyte_add_bus(struct i2c_adapter *, int speed); +int i2c_sibyte_del_bus(struct i2c_adapter *); + +#endif /* I2C_ALGO_SIBYTE_H */ diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c75219a37bb5..bfa2d557d47a 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -109,6 +109,7 @@ #define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ #define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */ #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ +#define I2C_DRIVERID_SAA7114H 64 /* video decoder */ #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ @@ -166,6 +167,7 @@ #define I2C_DRIVERID_ASB100 1043 #define I2C_DRIVERID_FSCHER 1046 #define I2C_DRIVERID_W83L785TS 1047 +#define I2C_DRIVERID_SMSC47B397 1050 /* * ---- Adapter types ---------------------------------------------------- @@ -193,9 +195,12 @@ #define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */ #define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */ #define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */ -#define I2C_ALGO_OCP_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ +#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ #define I2C_ALGO_PCA 0x150000 /* PCA 9564 style adapters */ +#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */ +#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */ + #define I2C_ALGO_EXP 0x800000 /* experimental */ #define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */ @@ -258,8 +263,15 @@ /* --- PowerPC on-chip adapters */ #define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */ +/* --- Broadcom SiByte adapters */ +#define I2C_HW_SIBYTE 0x00 + +/* --- SGI adapters */ +#define I2C_HW_SGI_VINO 0x00 +#define I2C_HW_SGI_MACE 0x01 + /* --- XSCALE on-chip adapters */ -#define I2C_HW_IOP321 0x00 +#define I2C_HW_IOP3XX 0x00 /* --- SMBus only adapters */ #define I2C_HW_SMBUS_PIIX4 0x00 diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 75c1a290c8c2..b5b58e9c054c 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -69,7 +69,7 @@ #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport * over Ethernet */ -#define ETH_P_EDP2 0x88A2 /* Coraid EDP2 */ +#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ /* * Non DIX types. Won't clash for 1500 types. diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 187ac79e1f17..c22c8724a8dc 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -167,6 +167,8 @@ struct subsystem _varname##_subsys = { \ } \ } +/* The global /sys/kernel/ subsystem for people to chain off of */ +extern struct subsystem kernel_subsys; /** * Helpers for setting the kset of registered objects. diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 209f6ffbd588..14ceebfc1efa 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -31,14 +31,15 @@ #define HPET_MINOR 228 struct device; +struct class_device; -struct miscdevice -{ +struct miscdevice { int minor; const char *name; struct file_operations *fops; struct list_head list; struct device *dev; + struct class_device *class; char devfs_name[64]; }; diff --git a/include/linux/module.h b/include/linux/module.h index f49654225267..7c66600fc66b 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -48,8 +48,9 @@ struct module; struct module_attribute { struct attribute attr; - ssize_t (*show)(struct module *, char *); - ssize_t (*store)(struct module *, const char *, size_t count); + ssize_t (*show)(struct module_attribute *, struct module *, char *); + ssize_t (*store)(struct module_attribute *, struct module *, + const char *, size_t count); }; struct module_kobject @@ -222,18 +223,18 @@ enum module_state #define MODULE_SECT_NAME_LEN 32 struct module_sect_attr { - struct attribute attr; + struct module_attribute mattr; char name[MODULE_SECT_NAME_LEN]; unsigned long address; }; -struct module_sections +struct module_sect_attrs { - struct kobject kobj; + struct attribute_group grp; struct module_sect_attr attrs[0]; }; -struct param_kobject; +struct module_param_attrs; struct module { @@ -246,8 +247,8 @@ struct module char name[MODULE_NAME_LEN]; /* Sysfs stuff. */ - struct module_kobject *mkobj; - struct param_kobject *params_kobject; + struct module_kobject mkobj; + struct module_param_attrs *param_attrs; /* Exported symbols */ const struct kernel_symbol *syms; @@ -308,7 +309,7 @@ struct module char *strtab; /* Section attributes */ - struct module_sections *sect_attrs; + struct module_sect_attrs *sect_attrs; #endif /* Per-cpu data. */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 6e0973f334b1..5d38124ff4ac 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -364,6 +364,20 @@ #define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ #define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ +#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ +#define PCI_EXP_LNKCTL 16 /* Link Control */ +#define PCI_EXP_LNKSTA 18 /* Link Status */ +#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ +#define PCI_EXP_SLTCTL 24 /* Slot Control */ +#define PCI_EXP_SLTSTA 26 /* Slot Status */ +#define PCI_EXP_RTCTL 28 /* Root Control */ +#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ +#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ +#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */ +#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */ +#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ +#define PCI_EXP_RTCAP 30 /* Root Capabilities */ +#define PCI_EXP_RTSTA 32 /* Root Status */ /* Extended Capabilities (PCI-X 2.0 and Express) */ #define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) @@ -480,6 +494,14 @@ enum pci_mmap_state { #define DEVICE_COUNT_COMPATIBLE 4 #define DEVICE_COUNT_RESOURCE 12 +typedef int __bitwise pci_power_t; + +#define PCI_D0 ((pci_power_t __force) 0) +#define PCI_D1 ((pci_power_t __force) 1) +#define PCI_D2 ((pci_power_t __force) 2) +#define PCI_D3hot ((pci_power_t __force) 3) +#define PCI_D3cold ((pci_power_t __force) 4) + /* * The pci_dev structure is used to describe PCI devices. */ @@ -508,7 +530,7 @@ struct pci_dev { this if your device has broken DMA or supports 64-bit transfers. */ - u32 current_state; /* Current operating state. In ACPI-speak, + pci_power_t current_state; /* Current operating state. In ACPI-speak, this is D0-D3, D0 being fully functional, and D3 being off. */ @@ -539,6 +561,7 @@ struct pci_dev { u32 saved_config_space[16]; /* config space saved at suspend time */ struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ int rom_attr_enabled; /* has display of the rom attribute been enabled? */ + struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ #ifdef CONFIG_PCI_NAMES #define PCI_NAME_SIZE 96 #define PCI_NAME_HALF __stringify(43) /* less than half to handle slop */ @@ -593,6 +616,8 @@ struct pci_bus { unsigned short pad2; struct device *bridge; struct class_device class_dev; + struct bin_attribute *legacy_io; /* legacy I/O for this bus */ + struct bin_attribute *legacy_mem; /* legacy mem */ }; #define pci_bus_b(n) list_entry(n, struct pci_bus, node) @@ -797,8 +822,9 @@ void pci_remove_rom(struct pci_dev *pdev); /* Power management related routines */ int pci_save_state(struct pci_dev *dev); int pci_restore_state(struct pci_dev *dev); -int pci_set_power_state(struct pci_dev *dev, int state); -int pci_enable_wake(struct pci_dev *dev, u32 state, int enable); +int pci_set_power_state(struct pci_dev *dev, pci_power_t state); +pci_power_t pci_choose_state(struct pci_dev *dev, u32 state); +int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ void pci_bus_assign_resources(struct pci_bus *bus); @@ -925,8 +951,9 @@ static inline const struct pci_device_id *pci_match_device(const struct pci_devi /* Power management related routines */ static inline int pci_save_state(struct pci_dev *dev) { return 0; } static inline int pci_restore_state(struct pci_dev *dev) { return 0; } -static inline int pci_set_power_state(struct pci_dev *dev, int state) { return 0; } -static inline int pci_enable_wake(struct pci_dev *dev, u32 state, int enable) { return 0; } +static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) { return 0; } +static inline pci_power_t pci_choose_state(struct pci_dev *dev, u32 state) { return PCI_D0; } +static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } #define isa_bridge ((struct pci_dev *)NULL) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index db0ba81bd689..f36775e68710 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -506,6 +506,8 @@ # define PCI_DEVICE_ID_AMD_VIPER_7449 PCI_DEVICE_ID_AMD_OPUS_7449 #define PCI_DEVICE_ID_AMD_8111_LAN 0x7462 #define PCI_DEVICE_ID_AMD_8111_IDE 0x7469 +#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a +#define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d #define PCI_DEVICE_ID_AMD_8151_0 0x7454 #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 @@ -595,6 +597,7 @@ #define PCI_DEVICE_ID_SI_6202 0x0002 #define PCI_DEVICE_ID_SI_503 0x0008 #define PCI_DEVICE_ID_SI_ACPI 0x0009 +#define PCI_DEVICE_ID_SI_SMBUS 0x0016 #define PCI_DEVICE_ID_SI_LPC 0x0018 #define PCI_DEVICE_ID_SI_5597_VGA 0x0200 #define PCI_DEVICE_ID_SI_6205 0x0205 @@ -1110,7 +1113,6 @@ #define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0 #define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da -#define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 #define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 @@ -1118,6 +1120,7 @@ #define PCI_DEVICE_ID_NVIDIA_NVENET_7 0x00df #define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA 0x00e3 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS 0x00e4 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE 0x00e5 #define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee @@ -1146,6 +1149,7 @@ #define PCI_DEVICE_ID_NVIDIA_IGEFORCE2 0x01a0 #define PCI_DEVICE_ID_NVIDIA_NFORCE 0x01a4 #define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO 0x01b1 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4 #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc #define PCI_DEVICE_ID_NVIDIA_NVENET_1 0x01c3 #define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0 @@ -2074,9 +2078,11 @@ #define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902 #define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01 #define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10 +#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25 #define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01 #define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02 #define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03 +#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04 #define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 #define PCI_VENDOR_ID_DUNORD 0x5544 diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index f18247125091..a373fc254df2 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -87,6 +87,7 @@ extern void ptrace_notify(int exit_code); extern void __ptrace_link(struct task_struct *child, struct task_struct *new_parent); extern void __ptrace_unlink(struct task_struct *child); +extern void ptrace_untrace(struct task_struct *child); static inline void ptrace_link(struct task_struct *child, struct task_struct *new_parent) diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index d12ee2b1eaef..6f502ff7902a 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -2,6 +2,7 @@ * sysfs.h - definitions for the device driver filesystem * * Copyright (c) 2001,2002 Patrick Mochel + * Copyright (c) 2004 Silicon Graphics, Inc. * * Please see Documentation/filesystems/sysfs.txt for more information. */ @@ -47,11 +48,16 @@ struct attribute_group { #define attr_name(_attr) (_attr).attr.name +struct vm_area_struct; + struct bin_attribute { struct attribute attr; size_t size; + void *private; ssize_t (*read)(struct kobject *, char *, loff_t, size_t); ssize_t (*write)(struct kobject *, char *, loff_t, size_t); + int (*mmap)(struct kobject *, struct bin_attribute *attr, + struct vm_area_struct *vma); }; struct sysfs_ops { diff --git a/include/linux/usb.h b/include/linux/usb.h index 18ee0751a32b..7dbcc054c7dc 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -40,9 +40,22 @@ struct usb_driver; * Devices may also have class-specific or vendor-specific descriptors. */ -/* host-side wrapper for parsed endpoint descriptors */ +/** + * struct usb_host_endpoint - host-side endpoint descriptor and queue + * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder + * @urb_list: urbs queued to this endpoint; maintained by usbcore + * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) + * with one or more transfer descriptors (TDs) per urb + * @extra: descriptors following this endpoint in the configuration + * @extralen: how many bytes of "extra" are valid + * + * USB requests are always queued to a given endpoint, identified by a + * descriptor within an active interface in a given USB configuration. + */ struct usb_host_endpoint { struct usb_endpoint_descriptor desc; + struct list_head urb_list; + void *hcpriv; unsigned char *extra; /* Extra descriptors */ int extralen; @@ -224,11 +237,6 @@ struct usb_host_config { int extralen; }; -// FIXME remove; exported only for drivers/usb/misc/auserwald.c -// prefer usb_device->epnum[0..31] -extern struct usb_endpoint_descriptor * - usb_epnum_to_ep_desc(struct usb_device *dev, unsigned epnum); - int __usb_get_extra_descriptor(char *buffer, unsigned size, unsigned char type, void **ptr); #define usb_get_extra_descriptor(ifpoint,type,ptr)\ @@ -311,25 +319,25 @@ struct usb_device { struct semaphore serialize; unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */ - int epmaxpacketin[16]; /* INput endpoint specific maximums */ - int epmaxpacketout[16]; /* OUTput endpoint specific maximums */ struct usb_device *parent; /* our hub, unless we're the root */ struct usb_bus *bus; /* Bus we're part of */ + struct usb_host_endpoint ep0; struct device dev; /* Generic device interface */ struct usb_device_descriptor descriptor;/* Descriptor */ struct usb_host_config *config; /* All of the configs */ + struct usb_host_config *actconfig;/* the active configuration */ + struct usb_host_endpoint *ep_in[16]; + struct usb_host_endpoint *ep_out[16]; char **rawdescriptors; /* Raw descriptors for each config */ int have_langid; /* whether string_langid is valid yet */ int string_langid; /* language ID for strings */ - void *hcpriv; /* Host Controller private data */ - struct list_head filelist; struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ @@ -360,6 +368,8 @@ extern int usb_reset_device(struct usb_device *dev); extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); +/*-------------------------------------------------------------------------*/ + /* for drivers using iso endpoints */ extern int usb_get_current_frame_number (struct usb_device *usb_dev); @@ -729,8 +739,8 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); * to poll for transfers. After the URB has been submitted, the interval * field reflects how the transfer was actually scheduled. * The polling interval may be more frequent than requested. - * For example, some controllers have a maximum interval of 32 microseconds, - * while others support intervals of up to 1024 microseconds. + * For example, some controllers have a maximum interval of 32 milliseconds, + * while others support intervals of up to 1024 milliseconds. * Isochronous URBs also have transfer intervals. (Note that for isochronous * endpoints, as well as high speed interrupt endpoints, the encoding of * the transfer interval in the endpoint descriptor is logarithmic. @@ -1040,55 +1050,35 @@ void usb_sg_wait (struct usb_sg_request *io); /* -------------------------------------------------------------------------- */ /* - * Calling this entity a "pipe" is glorifying it. A USB pipe - * is something embarrassingly simple: it basically consists - * of the following information: - * - device number (7 bits) - * - endpoint number (4 bits) - * - current Data0/1 state (1 bit) [Historical; now gone] - * - direction (1 bit) - * - speed (1 bit) [Historical and specific to USB 1.1; now gone.] - * - max packet size (2 bits: 8, 16, 32 or 64) [Historical; now gone.] - * - pipe type (2 bits: control, interrupt, bulk, isochronous) - * - * That's 18 bits. Really. Nothing more. And the USB people have - * documented these eighteen bits as some kind of glorious - * virtual data structure. - * - * Let's not fall in that trap. We'll just encode it as a simple - * unsigned int. The encoding is: + * For various legacy reasons, Linux has a small cookie that's paired with + * a struct usb_device to identify an endpoint queue. Queue characteristics + * are defined by the endpoint's descriptor. This cookie is called a "pipe", + * an unsigned int encoded as: * - * - max size: bits 0-1 [Historical; now gone.] * - direction: bit 7 (0 = Host-to-Device [Out], * 1 = Device-to-Host [In] ... * like endpoint bEndpointAddress) - * - device: bits 8-14 ... bit positions known to uhci-hcd + * - device address: bits 8-14 ... bit positions known to uhci-hcd * - endpoint: bits 15-18 ... bit positions known to uhci-hcd - * - Data0/1: bit 19 [Historical; now gone. ] - * - lowspeed: bit 26 [Historical; now gone. ] * - pipe type: bits 30-31 (00 = isochronous, 01 = interrupt, * 10 = control, 11 = bulk) * - * Why? Because it's arbitrary, and whatever encoding we select is really - * up to us. This one happens to share a lot of bit positions with the UHCI - * specification, so that much of the uhci driver can just mask the bits - * appropriately. + * Given the device address and endpoint descriptor, pipes are redundant. */ /* NOTE: these are not the standard USB_ENDPOINT_XFER_* values!! */ +/* (yet ... they're the values used by usbfs) */ #define PIPE_ISOCHRONOUS 0 #define PIPE_INTERRUPT 1 #define PIPE_CONTROL 2 #define PIPE_BULK 3 -#define usb_maxpacket(dev, pipe, out) (out \ - ? (dev)->epmaxpacketout[usb_pipeendpoint(pipe)] \ - : (dev)->epmaxpacketin [usb_pipeendpoint(pipe)] ) - #define usb_pipein(pipe) ((pipe) & USB_DIR_IN) #define usb_pipeout(pipe) (!usb_pipein(pipe)) + #define usb_pipedevice(pipe) (((pipe) >> 8) & 0x7f) #define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf) + #define usb_pipetype(pipe) (((pipe) >> 30) & 3) #define usb_pipeisoc(pipe) (usb_pipetype((pipe)) == PIPE_ISOCHRONOUS) #define usb_pipeint(pipe) (usb_pipetype((pipe)) == PIPE_INTERRUPT) @@ -1116,6 +1106,28 @@ static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int en #define usb_sndintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) #define usb_rcvintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) +/*-------------------------------------------------------------------------*/ + +static inline __u16 +usb_maxpacket(struct usb_device *udev, int pipe, int is_out) +{ + struct usb_host_endpoint *ep; + unsigned epnum = usb_pipeendpoint(pipe); + + if (is_out) { + WARN_ON(usb_pipein(pipe)); + ep = udev->ep_out[epnum]; + } else { + WARN_ON(usb_pipeout(pipe)); + ep = udev->ep_in[epnum]; + } + if (!ep) + return 0; + + /* NOTE: only 0x07ff bits are for packet size... */ + return le16_to_cpu(ep->desc.wMaxPacketSize); +} + /* -------------------------------------------------------------------------- */ #ifdef DEBUG diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index c1aa8d8f67ce..f5fe94e09a03 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h @@ -79,6 +79,7 @@ #define USB_DEVICE_B_HNP_ENABLE 3 /* dev may initiate HNP */ #define USB_DEVICE_A_HNP_SUPPORT 4 /* RH port supports HNP */ #define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* other RH port does */ +#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ @@ -156,14 +157,14 @@ struct usb_device_descriptor { __u8 bLength; __u8 bDescriptorType; - __u16 bcdUSB; + __le16 bcdUSB; __u8 bDeviceClass; __u8 bDeviceSubClass; __u8 bDeviceProtocol; __u8 bMaxPacketSize0; - __u16 idVendor; - __u16 idProduct; - __u16 bcdDevice; + __le16 idVendor; + __le16 idProduct; + __le16 bcdDevice; __u8 iManufacturer; __u8 iProduct; __u8 iSerialNumber; @@ -208,7 +209,7 @@ struct usb_config_descriptor { __u8 bLength; __u8 bDescriptorType; - __u16 wTotalLength; + __le16 wTotalLength; __u8 bNumInterfaces; __u8 bConfigurationValue; __u8 iConfiguration; @@ -264,7 +265,7 @@ struct usb_endpoint_descriptor { __u8 bEndpointAddress; __u8 bmAttributes; - __u16 wMaxPacketSize; + __le16 wMaxPacketSize; __u8 bInterval; // NOTE: these two are _only_ in audio endpoints. @@ -297,7 +298,7 @@ struct usb_qualifier_descriptor { __u8 bLength; __u8 bDescriptorType; - __u16 bcdUSB; + __le16 bcdUSB; __u8 bDeviceClass; __u8 bDeviceSubClass; __u8 bDeviceProtocol; @@ -323,6 +324,18 @@ struct usb_otg_descriptor { /*-------------------------------------------------------------------------*/ +/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */ +struct usb_debug_descriptor { + __u8 bLength; + __u8 bDescriptorType; + + /* bulk endpoints with 8 byte maxpacket */ + __u8 bDebugInEndpoint; + __u8 bDebugOutEndpoint; +}; + +/*-------------------------------------------------------------------------*/ + /* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ struct usb_interface_assoc_descriptor { __u8 bLength; |
