mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
This commit is contained in:
commit
b22364c8ee
4487 changed files with 225750 additions and 103497 deletions
|
|
@ -11,6 +11,7 @@ header-y += netfilter_arp/
|
|||
header-y += netfilter_bridge/
|
||||
header-y += netfilter_ipv4/
|
||||
header-y += netfilter_ipv6/
|
||||
header-y += usb/
|
||||
|
||||
header-y += affs_hardblocks.h
|
||||
header-y += aio_abi.h
|
||||
|
|
@ -61,7 +62,6 @@ header-y += fd.h
|
|||
header-y += fdreg.h
|
||||
header-y += fib_rules.h
|
||||
header-y += fuse.h
|
||||
header-y += futex.h
|
||||
header-y += genetlink.h
|
||||
header-y += gen_stats.h
|
||||
header-y += gigaset_dev.h
|
||||
|
|
@ -70,7 +70,6 @@ header-y += hysdn_if.h
|
|||
header-y += i2c-dev.h
|
||||
header-y += i8k.h
|
||||
header-y += icmp.h
|
||||
header-y += if_addr.h
|
||||
header-y += if_arcnet.h
|
||||
header-y += if_arp.h
|
||||
header-y += if_bonding.h
|
||||
|
|
@ -80,7 +79,6 @@ header-y += if_fddi.h
|
|||
header-y += if.h
|
||||
header-y += if_hippi.h
|
||||
header-y += if_infiniband.h
|
||||
header-y += if_link.h
|
||||
header-y += if_packet.h
|
||||
header-y += if_plip.h
|
||||
header-y += if_ppp.h
|
||||
|
|
@ -120,7 +118,6 @@ header-y += nfs4_mount.h
|
|||
header-y += nfs_mount.h
|
||||
header-y += oom.h
|
||||
header-y += param.h
|
||||
header-y += pci_ids.h
|
||||
header-y += pci_regs.h
|
||||
header-y += personality.h
|
||||
header-y += pfkeyv2.h
|
||||
|
|
@ -131,7 +128,6 @@ header-y += posix_types.h
|
|||
header-y += ppdev.h
|
||||
header-y += prctl.h
|
||||
header-y += ps2esdi.h
|
||||
header-y += qic117.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += quotaio_v1.h
|
||||
header-y += quotaio_v2.h
|
||||
|
|
@ -139,7 +135,6 @@ header-y += radeonfb.h
|
|||
header-y += raw.h
|
||||
header-y += resource.h
|
||||
header-y += rose.h
|
||||
header-y += sctp.h
|
||||
header-y += smbno.h
|
||||
header-y += snmp.h
|
||||
header-y += sockios.h
|
||||
|
|
@ -163,7 +158,6 @@ header-y += vt.h
|
|||
header-y += wireless.h
|
||||
header-y += xattr.h
|
||||
header-y += x25.h
|
||||
header-y += zorro_ids.h
|
||||
|
||||
unifdef-y += acct.h
|
||||
unifdef-y += adb.h
|
||||
|
|
@ -203,6 +197,7 @@ unifdef-y += fb.h
|
|||
unifdef-y += fcntl.h
|
||||
unifdef-y += filter.h
|
||||
unifdef-y += flat.h
|
||||
unifdef-y += futex.h
|
||||
unifdef-y += fs.h
|
||||
unifdef-y += gameport.h
|
||||
unifdef-y += generic_serial.h
|
||||
|
|
@ -217,6 +212,7 @@ unifdef-y += hpet.h
|
|||
unifdef-y += i2c.h
|
||||
unifdef-y += i2o-dev.h
|
||||
unifdef-y += icmpv6.h
|
||||
unifdef-y += if_addr.h
|
||||
unifdef-y += if_bridge.h
|
||||
unifdef-y += if_ec.h
|
||||
unifdef-y += if_eql.h
|
||||
|
|
@ -224,6 +220,7 @@ unifdef-y += if_ether.h
|
|||
unifdef-y += if_fddi.h
|
||||
unifdef-y += if_frad.h
|
||||
unifdef-y += if_ltalk.h
|
||||
unifdef-y += if_link.h
|
||||
unifdef-y += if_pppox.h
|
||||
unifdef-y += if_shaper.h
|
||||
unifdef-y += if_tr.h
|
||||
|
|
@ -330,7 +327,6 @@ unifdef-y += udp.h
|
|||
unifdef-y += uinput.h
|
||||
unifdef-y += uio.h
|
||||
unifdef-y += unistd.h
|
||||
unifdef-y += usb_ch9.h
|
||||
unifdef-y += usbdevice_fs.h
|
||||
unifdef-y += user.h
|
||||
unifdef-y += utsname.h
|
||||
|
|
|
|||
|
|
@ -47,171 +47,12 @@ enum acpi_irq_model_id {
|
|||
ACPI_IRQ_MODEL_PIC = 0,
|
||||
ACPI_IRQ_MODEL_IOAPIC,
|
||||
ACPI_IRQ_MODEL_IOSAPIC,
|
||||
ACPI_IRQ_MODEL_PLATFORM,
|
||||
ACPI_IRQ_MODEL_COUNT
|
||||
};
|
||||
|
||||
extern enum acpi_irq_model_id acpi_irq_model;
|
||||
|
||||
|
||||
/* Root System Description Pointer (RSDP) */
|
||||
|
||||
struct acpi_table_rsdp {
|
||||
char signature[8];
|
||||
u8 checksum;
|
||||
char oem_id[6];
|
||||
u8 revision;
|
||||
u32 rsdt_address;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi20_table_rsdp {
|
||||
char signature[8];
|
||||
u8 checksum;
|
||||
char oem_id[6];
|
||||
u8 revision;
|
||||
u32 rsdt_address;
|
||||
u32 length;
|
||||
u64 xsdt_address;
|
||||
u8 ext_checksum;
|
||||
u8 reserved[3];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
typedef struct {
|
||||
u8 type;
|
||||
u8 length;
|
||||
} __attribute__ ((packed)) acpi_table_entry_header;
|
||||
|
||||
/* Root System Description Table (RSDT) */
|
||||
|
||||
struct acpi_table_rsdt {
|
||||
struct acpi_table_header header;
|
||||
u32 entry[8];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Extended System Description Table (XSDT) */
|
||||
|
||||
struct acpi_table_xsdt {
|
||||
struct acpi_table_header header;
|
||||
u64 entry[1];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Fixed ACPI Description Table (FADT) */
|
||||
|
||||
struct acpi_table_fadt {
|
||||
struct acpi_table_header header;
|
||||
u32 facs_addr;
|
||||
u32 dsdt_addr;
|
||||
/* ... */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Multiple APIC Description Table (MADT) */
|
||||
|
||||
struct acpi_table_madt {
|
||||
struct acpi_table_header header;
|
||||
u32 lapic_address;
|
||||
struct {
|
||||
u32 pcat_compat:1;
|
||||
u32 reserved:31;
|
||||
} flags;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
enum acpi_madt_entry_id {
|
||||
ACPI_MADT_LAPIC = 0,
|
||||
ACPI_MADT_IOAPIC,
|
||||
ACPI_MADT_INT_SRC_OVR,
|
||||
ACPI_MADT_NMI_SRC,
|
||||
ACPI_MADT_LAPIC_NMI,
|
||||
ACPI_MADT_LAPIC_ADDR_OVR,
|
||||
ACPI_MADT_IOSAPIC,
|
||||
ACPI_MADT_LSAPIC,
|
||||
ACPI_MADT_PLAT_INT_SRC,
|
||||
ACPI_MADT_ENTRY_COUNT
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
u16 polarity:2;
|
||||
u16 trigger:2;
|
||||
u16 reserved:12;
|
||||
} __attribute__ ((packed)) acpi_interrupt_flags;
|
||||
|
||||
struct acpi_table_lapic {
|
||||
acpi_table_entry_header header;
|
||||
u8 acpi_id;
|
||||
u8 id;
|
||||
struct {
|
||||
u32 enabled:1;
|
||||
u32 reserved:31;
|
||||
} flags;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_ioapic {
|
||||
acpi_table_entry_header header;
|
||||
u8 id;
|
||||
u8 reserved;
|
||||
u32 address;
|
||||
u32 global_irq_base;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_int_src_ovr {
|
||||
acpi_table_entry_header header;
|
||||
u8 bus;
|
||||
u8 bus_irq;
|
||||
u32 global_irq;
|
||||
acpi_interrupt_flags flags;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_nmi_src {
|
||||
acpi_table_entry_header header;
|
||||
acpi_interrupt_flags flags;
|
||||
u32 global_irq;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_lapic_nmi {
|
||||
acpi_table_entry_header header;
|
||||
u8 acpi_id;
|
||||
acpi_interrupt_flags flags;
|
||||
u8 lint;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_lapic_addr_ovr {
|
||||
acpi_table_entry_header header;
|
||||
u8 reserved[2];
|
||||
u64 address;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_iosapic {
|
||||
acpi_table_entry_header header;
|
||||
u8 id;
|
||||
u8 reserved;
|
||||
u32 global_irq_base;
|
||||
u64 address;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_lsapic {
|
||||
acpi_table_entry_header header;
|
||||
u8 acpi_id;
|
||||
u8 id;
|
||||
u8 eid;
|
||||
u8 reserved[3];
|
||||
struct {
|
||||
u32 enabled:1;
|
||||
u32 reserved:31;
|
||||
} flags;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_plat_int_src {
|
||||
acpi_table_entry_header header;
|
||||
acpi_interrupt_flags flags;
|
||||
u8 type; /* See acpi_interrupt_type */
|
||||
u8 id;
|
||||
u8 eid;
|
||||
u8 iosapic_vector;
|
||||
u32 global_irq;
|
||||
struct {
|
||||
u32 cpei_override_flag:1;
|
||||
u32 reserved:31;
|
||||
} plint_flags;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
enum acpi_interrupt_id {
|
||||
ACPI_INTERRUPT_PMI = 1,
|
||||
ACPI_INTERRUPT_INIT,
|
||||
|
|
@ -221,89 +62,6 @@ enum acpi_interrupt_id {
|
|||
|
||||
#define ACPI_SPACE_MEM 0
|
||||
|
||||
struct acpi_gen_regaddr {
|
||||
u8 space_id;
|
||||
u8 bit_width;
|
||||
u8 bit_offset;
|
||||
u8 resv;
|
||||
u32 addrl;
|
||||
u32 addrh;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_hpet {
|
||||
struct acpi_table_header header;
|
||||
u32 id;
|
||||
struct acpi_gen_regaddr addr;
|
||||
u8 number;
|
||||
u16 min_tick;
|
||||
u8 page_protect;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/*
|
||||
* Simple Boot Flags
|
||||
* http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx
|
||||
*/
|
||||
struct acpi_table_sbf
|
||||
{
|
||||
u8 sbf_signature[4];
|
||||
u32 sbf_len;
|
||||
u8 sbf_revision;
|
||||
u8 sbf_csum;
|
||||
u8 sbf_oemid[6];
|
||||
u8 sbf_oemtable[8];
|
||||
u8 sbf_revdata[4];
|
||||
u8 sbf_creator[4];
|
||||
u8 sbf_crearev[4];
|
||||
u8 sbf_cmos;
|
||||
u8 sbf_spare[3];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/*
|
||||
* System Resource Affinity Table (SRAT)
|
||||
* http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx
|
||||
*/
|
||||
|
||||
struct acpi_table_srat {
|
||||
struct acpi_table_header header;
|
||||
u32 table_revision;
|
||||
u64 reserved;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
enum acpi_srat_entry_id {
|
||||
ACPI_SRAT_PROCESSOR_AFFINITY = 0,
|
||||
ACPI_SRAT_MEMORY_AFFINITY,
|
||||
ACPI_SRAT_ENTRY_COUNT
|
||||
};
|
||||
|
||||
struct acpi_table_processor_affinity {
|
||||
acpi_table_entry_header header;
|
||||
u8 proximity_domain;
|
||||
u8 apic_id;
|
||||
struct {
|
||||
u32 enabled:1;
|
||||
u32 reserved:31;
|
||||
} flags;
|
||||
u8 lsapic_eid;
|
||||
u8 reserved[7];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct acpi_table_memory_affinity {
|
||||
acpi_table_entry_header header;
|
||||
u8 proximity_domain;
|
||||
u8 reserved1[5];
|
||||
u32 base_addr_lo;
|
||||
u32 base_addr_hi;
|
||||
u32 length_lo;
|
||||
u32 length_hi;
|
||||
u32 memory_type; /* See acpi_address_range_id */
|
||||
struct {
|
||||
u32 enabled:1;
|
||||
u32 hot_pluggable:1;
|
||||
u32 reserved:30;
|
||||
} flags;
|
||||
u64 reserved2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
enum acpi_address_range_id {
|
||||
ACPI_ADDRESS_RANGE_MEMORY = 1,
|
||||
ACPI_ADDRESS_RANGE_RESERVED = 2,
|
||||
|
|
@ -312,84 +70,12 @@ enum acpi_address_range_id {
|
|||
ACPI_ADDRESS_RANGE_COUNT
|
||||
};
|
||||
|
||||
/*
|
||||
* System Locality Information Table (SLIT)
|
||||
* see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf
|
||||
*/
|
||||
|
||||
struct acpi_table_slit {
|
||||
struct acpi_table_header header;
|
||||
u64 localities;
|
||||
u8 entry[1]; /* real size = localities^2 */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Smart Battery Description Table (SBST) */
|
||||
|
||||
struct acpi_table_sbst {
|
||||
struct acpi_table_header header;
|
||||
u32 warning; /* Warn user */
|
||||
u32 low; /* Critical sleep */
|
||||
u32 critical; /* Critical shutdown */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Embedded Controller Boot Resources Table (ECDT) */
|
||||
|
||||
struct acpi_table_ecdt {
|
||||
struct acpi_table_header header;
|
||||
struct acpi_generic_address ec_control;
|
||||
struct acpi_generic_address ec_data;
|
||||
u32 uid;
|
||||
u8 gpe_bit;
|
||||
char ec_id[0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* PCI MMCONFIG */
|
||||
|
||||
/* Defined in PCI Firmware Specification 3.0 */
|
||||
struct acpi_table_mcfg_config {
|
||||
u32 base_address;
|
||||
u32 base_reserved;
|
||||
u16 pci_segment_group_number;
|
||||
u8 start_bus_number;
|
||||
u8 end_bus_number;
|
||||
u8 reserved[4];
|
||||
} __attribute__ ((packed));
|
||||
struct acpi_table_mcfg {
|
||||
struct acpi_table_header header;
|
||||
u8 reserved[8];
|
||||
struct acpi_table_mcfg_config config[0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Table Handlers */
|
||||
|
||||
enum acpi_table_id {
|
||||
ACPI_TABLE_UNKNOWN = 0,
|
||||
ACPI_APIC,
|
||||
ACPI_BOOT,
|
||||
ACPI_DBGP,
|
||||
ACPI_DSDT,
|
||||
ACPI_ECDT,
|
||||
ACPI_ETDT,
|
||||
ACPI_FADT,
|
||||
ACPI_FACS,
|
||||
ACPI_OEMX,
|
||||
ACPI_PSDT,
|
||||
ACPI_SBST,
|
||||
ACPI_SLIT,
|
||||
ACPI_SPCR,
|
||||
ACPI_SRAT,
|
||||
ACPI_SSDT,
|
||||
ACPI_SPMI,
|
||||
ACPI_HPET,
|
||||
ACPI_MCFG,
|
||||
ACPI_TABLE_COUNT
|
||||
};
|
||||
typedef int (*acpi_table_handler) (struct acpi_table_header *table);
|
||||
|
||||
typedef int (*acpi_table_handler) (unsigned long phys_addr, unsigned long size);
|
||||
|
||||
extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
|
||||
|
||||
typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const unsigned long end);
|
||||
typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
|
||||
|
||||
char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
|
||||
unsigned long acpi_find_rsdp (void);
|
||||
|
|
@ -398,14 +84,12 @@ int acpi_boot_table_init (void);
|
|||
int acpi_numa_init (void);
|
||||
|
||||
int acpi_table_init (void);
|
||||
int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler);
|
||||
int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header);
|
||||
int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
|
||||
int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
|
||||
int acpi_parse_mcfg (unsigned long phys_addr, unsigned long size);
|
||||
void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
|
||||
void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
|
||||
void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
|
||||
int acpi_table_parse (char *id, acpi_table_handler handler);
|
||||
int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
|
||||
int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
|
||||
int acpi_parse_mcfg (struct acpi_table_header *header);
|
||||
void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
|
||||
void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
|
||||
|
||||
/* the following four functions are architecture-dependent */
|
||||
#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
|
||||
|
|
@ -416,8 +100,8 @@ void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
|
|||
#define acpi_numa_arch_fixup() do {} while (0)
|
||||
#else
|
||||
void acpi_numa_slit_init (struct acpi_table_slit *slit);
|
||||
void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa);
|
||||
void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma);
|
||||
void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
|
||||
void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
|
||||
void acpi_numa_arch_fixup(void);
|
||||
#endif
|
||||
|
||||
|
|
@ -432,7 +116,7 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
|
|||
|
||||
extern int acpi_mp_config;
|
||||
|
||||
extern struct acpi_table_mcfg_config *pci_mmcfg_config;
|
||||
extern struct acpi_mcfg_allocation *pci_mmcfg_config;
|
||||
extern int pci_mmcfg_config_num;
|
||||
|
||||
extern int sbf_port;
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ struct kiocb {
|
|||
wait_queue_t ki_wait;
|
||||
loff_t ki_pos;
|
||||
|
||||
atomic_t ki_bio_count; /* num bio used for this iocb */
|
||||
void *private;
|
||||
/* State that we remember to be able to restart/retry */
|
||||
unsigned short ki_opcode;
|
||||
|
|
|
|||
62
include/linux/apm-emulation.h
Normal file
62
include/linux/apm-emulation.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* -*- linux-c -*-
|
||||
*
|
||||
* (C) 2003 zecke@handhelds.org
|
||||
*
|
||||
* GPL version 2
|
||||
*
|
||||
* based on arch/arm/kernel/apm.c
|
||||
* factor out the information needed by architectures to provide
|
||||
* apm status
|
||||
*/
|
||||
#ifndef __LINUX_APM_EMULATION_H
|
||||
#define __LINUX_APM_EMULATION_H
|
||||
|
||||
#include <linux/apm_bios.h>
|
||||
|
||||
/*
|
||||
* This structure gets filled in by the machine specific 'get_power_status'
|
||||
* implementation. Any fields which are not set default to a safe value.
|
||||
*/
|
||||
struct apm_power_info {
|
||||
unsigned char ac_line_status;
|
||||
#define APM_AC_OFFLINE 0
|
||||
#define APM_AC_ONLINE 1
|
||||
#define APM_AC_BACKUP 2
|
||||
#define APM_AC_UNKNOWN 0xff
|
||||
|
||||
unsigned char battery_status;
|
||||
#define APM_BATTERY_STATUS_HIGH 0
|
||||
#define APM_BATTERY_STATUS_LOW 1
|
||||
#define APM_BATTERY_STATUS_CRITICAL 2
|
||||
#define APM_BATTERY_STATUS_CHARGING 3
|
||||
#define APM_BATTERY_STATUS_NOT_PRESENT 4
|
||||
#define APM_BATTERY_STATUS_UNKNOWN 0xff
|
||||
|
||||
unsigned char battery_flag;
|
||||
#define APM_BATTERY_FLAG_HIGH (1 << 0)
|
||||
#define APM_BATTERY_FLAG_LOW (1 << 1)
|
||||
#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
|
||||
#define APM_BATTERY_FLAG_CHARGING (1 << 3)
|
||||
#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
|
||||
#define APM_BATTERY_FLAG_UNKNOWN 0xff
|
||||
|
||||
int battery_life;
|
||||
int time;
|
||||
int units;
|
||||
#define APM_UNITS_MINS 0
|
||||
#define APM_UNITS_SECS 1
|
||||
#define APM_UNITS_UNKNOWN -1
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* This allows machines to provide their own "apm get power status" function.
|
||||
*/
|
||||
extern void (*apm_get_power_status)(struct apm_power_info *);
|
||||
|
||||
/*
|
||||
* Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND)
|
||||
*/
|
||||
void apm_queue_event(apm_event_t event);
|
||||
|
||||
#endif /* __LINUX_APM_EMULATION_H */
|
||||
|
|
@ -44,9 +44,9 @@ enum {
|
|||
ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */
|
||||
|
||||
ATA_ID_WORDS = 256,
|
||||
ATA_ID_SERNO_OFS = 10,
|
||||
ATA_ID_FW_REV_OFS = 23,
|
||||
ATA_ID_PROD_OFS = 27,
|
||||
ATA_ID_SERNO = 10,
|
||||
ATA_ID_FW_REV = 23,
|
||||
ATA_ID_PROD = 27,
|
||||
ATA_ID_OLD_PIO_MODES = 51,
|
||||
ATA_ID_FIELD_VALID = 53,
|
||||
ATA_ID_MWDMA_MODES = 63,
|
||||
|
|
@ -58,8 +58,11 @@ enum {
|
|||
ATA_ID_MAJOR_VER = 80,
|
||||
ATA_ID_PIO4 = (1 << 1),
|
||||
|
||||
ATA_ID_SERNO_LEN = 20,
|
||||
ATA_ID_FW_REV_LEN = 8,
|
||||
ATA_ID_PROD_LEN = 40,
|
||||
|
||||
ATA_PCI_CTL_OFS = 2,
|
||||
ATA_SERNO_LEN = 20,
|
||||
ATA_UDMA0 = (1 << 0),
|
||||
ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
|
||||
ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
|
||||
|
|
@ -296,6 +299,8 @@ struct ata_taskfile {
|
|||
#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
|
||||
#define ata_id_removeable(id) ((id)[0] & (1 << 7))
|
||||
#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
|
||||
#define ata_id_iordy_disable(id) ((id)[49] & (1 << 10))
|
||||
#define ata_id_has_iordy(id) ((id)[49] & (1 << 9))
|
||||
#define ata_id_u32(id,n) \
|
||||
(((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
|
||||
#define ata_id_u64(id,n) \
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@
|
|||
#ifndef _LINUX_ATMARP_H
|
||||
#define _LINUX_ATMARP_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ struct backlight_device {
|
|||
};
|
||||
|
||||
extern struct backlight_device *backlight_device_register(const char *name,
|
||||
void *devdata, struct backlight_properties *bp);
|
||||
struct device *dev,void *devdata,struct backlight_properties *bp);
|
||||
extern void backlight_device_unregister(struct backlight_device *bd);
|
||||
|
||||
#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev)
|
||||
|
|
|
|||
|
|
@ -309,6 +309,7 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
|
|||
gfp_t);
|
||||
extern void bio_set_pages_dirty(struct bio *bio);
|
||||
extern void bio_check_pages_dirty(struct bio *bio);
|
||||
extern void bio_release_pages(struct bio *bio);
|
||||
extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
|
||||
extern int bio_uncopy_user(struct bio *);
|
||||
void zero_fill_bio(struct bio *bio);
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ static inline unsigned long hweight_long(unsigned long w)
|
|||
return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* rol32 - rotate a 32-bit value left
|
||||
*
|
||||
* @word: value to rotate
|
||||
* @shift: bits to roll
|
||||
*/
|
||||
|
|
@ -42,9 +41,8 @@ static inline __u32 rol32(__u32 word, unsigned int shift)
|
|||
return (word << shift) | (word >> (32 - shift));
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* ror32 - rotate a 32-bit value right
|
||||
*
|
||||
* @word: value to rotate
|
||||
* @shift: bits to roll
|
||||
*/
|
||||
|
|
|
|||
15
include/linux/bitrev.h
Normal file
15
include/linux/bitrev.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef _LINUX_BITREV_H
|
||||
#define _LINUX_BITREV_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
extern u8 const byte_rev_table[256];
|
||||
|
||||
static inline u8 bitrev8(u8 byte)
|
||||
{
|
||||
return byte_rev_table[byte];
|
||||
}
|
||||
|
||||
extern u32 bitrev32(u32 in);
|
||||
|
||||
#endif /* _LINUX_BITREV_H */
|
||||
|
|
@ -331,10 +331,6 @@ struct request_pm_state
|
|||
|
||||
#include <linux/elevator.h>
|
||||
|
||||
typedef int (merge_request_fn) (request_queue_t *, struct request *,
|
||||
struct bio *);
|
||||
typedef int (merge_requests_fn) (request_queue_t *, struct request *,
|
||||
struct request *);
|
||||
typedef void (request_fn_proc) (request_queue_t *q);
|
||||
typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
|
||||
typedef int (prep_rq_fn) (request_queue_t *, struct request *);
|
||||
|
|
@ -342,7 +338,6 @@ typedef void (unplug_fn) (request_queue_t *);
|
|||
|
||||
struct bio_vec;
|
||||
typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *);
|
||||
typedef void (activity_fn) (void *data, int rw);
|
||||
typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *);
|
||||
typedef void (prepare_flush_fn) (request_queue_t *, struct request *);
|
||||
typedef void (softirq_done_fn)(struct request *);
|
||||
|
|
@ -377,14 +372,10 @@ struct request_queue
|
|||
struct request_list rq;
|
||||
|
||||
request_fn_proc *request_fn;
|
||||
merge_request_fn *back_merge_fn;
|
||||
merge_request_fn *front_merge_fn;
|
||||
merge_requests_fn *merge_requests_fn;
|
||||
make_request_fn *make_request_fn;
|
||||
prep_rq_fn *prep_rq_fn;
|
||||
unplug_fn *unplug_fn;
|
||||
merge_bvec_fn *merge_bvec_fn;
|
||||
activity_fn *activity_fn;
|
||||
issue_flush_fn *issue_flush_fn;
|
||||
prepare_flush_fn *prepare_flush_fn;
|
||||
softirq_done_fn *softirq_done_fn;
|
||||
|
|
@ -411,8 +402,6 @@ struct request_queue
|
|||
*/
|
||||
void *queuedata;
|
||||
|
||||
void *activity_data;
|
||||
|
||||
/*
|
||||
* queue needs bounce pages for pages above this limit
|
||||
*/
|
||||
|
|
@ -652,6 +641,11 @@ extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __
|
|||
extern int sg_scsi_ioctl(struct file *, struct request_queue *,
|
||||
struct gendisk *, struct scsi_ioctl_command __user *);
|
||||
|
||||
/*
|
||||
* Temporary export, until SCSI gets fixed up.
|
||||
*/
|
||||
extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *);
|
||||
|
||||
/*
|
||||
* A queue has just exitted congestion. Note this in the global counter of
|
||||
* congested queues, and wake up anyone who was waiting for requests to be
|
||||
|
|
@ -677,9 +671,8 @@ extern void blk_sync_queue(struct request_queue *q);
|
|||
extern void __blk_stop_queue(request_queue_t *q);
|
||||
extern void blk_run_queue(request_queue_t *);
|
||||
extern void blk_start_queueing(request_queue_t *);
|
||||
extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
|
||||
extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long);
|
||||
extern int blk_rq_unmap_user(struct request *);
|
||||
extern int blk_rq_unmap_user(struct bio *);
|
||||
extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t);
|
||||
extern int blk_rq_map_user_iov(request_queue_t *, struct request *,
|
||||
struct sg_iovec *, int, unsigned int);
|
||||
|
|
|
|||
47
include/linux/bug.h
Normal file
47
include/linux/bug.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#ifndef _LINUX_BUG_H
|
||||
#define _LINUX_BUG_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <asm/bug.h>
|
||||
|
||||
enum bug_trap_type {
|
||||
BUG_TRAP_TYPE_NONE = 0,
|
||||
BUG_TRAP_TYPE_WARN = 1,
|
||||
BUG_TRAP_TYPE_BUG = 2,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG
|
||||
#include <asm-generic/bug.h>
|
||||
|
||||
static inline int is_warning_bug(const struct bug_entry *bug)
|
||||
{
|
||||
return bug->flags & BUGFLAG_WARNING;
|
||||
}
|
||||
|
||||
const struct bug_entry *find_bug(unsigned long bugaddr);
|
||||
|
||||
enum bug_trap_type report_bug(unsigned long bug_addr);
|
||||
|
||||
int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
|
||||
struct module *);
|
||||
void module_bug_cleanup(struct module *);
|
||||
|
||||
/* These are defined by the architecture */
|
||||
int is_valid_bugaddr(unsigned long addr);
|
||||
|
||||
#else /* !CONFIG_GENERIC_BUG */
|
||||
|
||||
static inline enum bug_trap_type report_bug(unsigned long bug_addr)
|
||||
{
|
||||
return BUG_TRAP_TYPE_BUG;
|
||||
}
|
||||
static inline int module_bug_finalize(const Elf_Ehdr *hdr,
|
||||
const Elf_Shdr *sechdrs,
|
||||
struct module *mod)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void module_bug_cleanup(struct module *mod) {}
|
||||
|
||||
#endif /* CONFIG_GENERIC_BUG */
|
||||
#endif /* _LINUX_BUG_H */
|
||||
|
|
@ -6,6 +6,10 @@
|
|||
#include <linux/kdev_t.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
struct file_operations;
|
||||
struct inode;
|
||||
struct module;
|
||||
|
||||
struct cdev {
|
||||
struct kobject kobj;
|
||||
struct module *owner;
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles)
|
|||
* Unless you're the timekeeping code, you should not be using this!
|
||||
*/
|
||||
static inline void clocksource_calculate_interval(struct clocksource *c,
|
||||
unsigned long length_nsec)
|
||||
unsigned long length_nsec)
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ void coda_sysctl_clean(void);
|
|||
|
||||
#define CODA_ALLOC(ptr, cast, size) do { \
|
||||
if (size < PAGE_SIZE) \
|
||||
ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \
|
||||
ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
|
||||
else \
|
||||
ptr = (cast)vmalloc((unsigned long) size); \
|
||||
if (!ptr) \
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ extern void __chk_io_ptr(void __iomem *);
|
|||
#error no compiler-gcc.h file for this gcc version
|
||||
#elif __GNUC__ == 4
|
||||
# include <linux/compiler-gcc4.h>
|
||||
#elif __GNUC__ == 3
|
||||
#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
|
||||
# include <linux/compiler-gcc3.h>
|
||||
#else
|
||||
# error Sorry, your compiler is too old/not recognized.
|
||||
|
|
|
|||
|
|
@ -160,31 +160,6 @@ struct configfs_group_operations {
|
|||
void (*drop_item)(struct config_group *group, struct config_item *item);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Use these macros to make defining attributes easier. See include/linux/device.h
|
||||
* for examples..
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#define __ATTR(_name,_mode,_show,_store) { \
|
||||
.attr = {.ca_name = __stringify(_name), .ca_mode = _mode, .ca_owner = THIS_MODULE }, \
|
||||
.show = _show, \
|
||||
.store = _store, \
|
||||
}
|
||||
|
||||
#define __ATTR_RO(_name) { \
|
||||
.attr = { .ca_name = __stringify(_name), .ca_mode = 0444, .ca_owner = THIS_MODULE }, \
|
||||
.show = _name##_show, \
|
||||
}
|
||||
|
||||
#define __ATTR_NULL { .attr = { .name = NULL } }
|
||||
|
||||
#define attr_name(_attr) (_attr).attr.name
|
||||
#endif
|
||||
|
||||
|
||||
struct configfs_subsystem {
|
||||
struct config_group su_group;
|
||||
struct semaphore su_sem;
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ struct cn_callback_data {
|
|||
struct cn_callback_entry {
|
||||
struct list_head callback_entry;
|
||||
struct cn_callback *cb;
|
||||
struct delayed_work work;
|
||||
struct work_struct work;
|
||||
struct cn_queue_dev *pdev;
|
||||
|
||||
struct cn_callback_id id;
|
||||
|
|
|
|||
|
|
@ -172,6 +172,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
|
|||
unsigned int relation);
|
||||
|
||||
|
||||
extern int cpufreq_driver_getavg(struct cpufreq_policy *policy);
|
||||
|
||||
int cpufreq_register_governor(struct cpufreq_governor *governor);
|
||||
void cpufreq_unregister_governor(struct cpufreq_governor *governor);
|
||||
|
||||
|
|
@ -204,6 +206,7 @@ struct cpufreq_driver {
|
|||
unsigned int (*get) (unsigned int cpu);
|
||||
|
||||
/* optional */
|
||||
unsigned int (*getavg) (unsigned int cpu);
|
||||
int (*exit) (struct cpufreq_policy *policy);
|
||||
int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
|
||||
int (*resume) (struct cpufreq_policy *policy);
|
||||
|
|
|
|||
|
|
@ -30,10 +30,19 @@ void cpuset_update_task_memory_state(void);
|
|||
nodes_subset((nodes), current->mems_allowed)
|
||||
int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
|
||||
|
||||
extern int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask);
|
||||
static int inline cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
|
||||
extern int __cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask);
|
||||
extern int __cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask);
|
||||
|
||||
static int inline cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask)
|
||||
{
|
||||
return number_of_cpusets <= 1 || __cpuset_zone_allowed(z, gfp_mask);
|
||||
return number_of_cpusets <= 1 ||
|
||||
__cpuset_zone_allowed_softwall(z, gfp_mask);
|
||||
}
|
||||
|
||||
static int inline cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
|
||||
{
|
||||
return number_of_cpusets <= 1 ||
|
||||
__cpuset_zone_allowed_hardwall(z, gfp_mask);
|
||||
}
|
||||
|
||||
extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
|
||||
|
|
@ -46,7 +55,7 @@ extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
|
|||
extern int cpuset_memory_pressure_enabled;
|
||||
extern void __cpuset_memory_pressure_bump(void);
|
||||
|
||||
extern const struct file_operations proc_cpuset_operations;
|
||||
extern struct file_operations proc_cpuset_operations;
|
||||
extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
|
||||
|
||||
extern void cpuset_lock(void);
|
||||
|
|
@ -94,7 +103,12 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
|
||||
static inline int cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
#define _LINUX_CRC32_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/bitrev.h>
|
||||
|
||||
extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
|
||||
extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
|
||||
extern u32 bitreverse(u32 in);
|
||||
|
||||
#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length)
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ extern u32 bitreverse(u32 in);
|
|||
* is in bit nr 0], thus it must be reversed before use. Except for
|
||||
* nics that bit swap the result internally...
|
||||
*/
|
||||
#define ether_crc(length, data) bitreverse(crc32_le(~0, data, length))
|
||||
#define ether_crc(length, data) bitrev32(crc32_le(~0, data, length))
|
||||
#define ether_crc_le(length, data) crc32_le(~0, data, length)
|
||||
|
||||
#endif /* _LINUX_CRC32_H */
|
||||
|
|
|
|||
|
|
@ -51,15 +51,9 @@
|
|||
/*
|
||||
* Transform masks and values (for crt_flags).
|
||||
*/
|
||||
#define CRYPTO_TFM_MODE_MASK 0x000000ff
|
||||
#define CRYPTO_TFM_REQ_MASK 0x000fff00
|
||||
#define CRYPTO_TFM_RES_MASK 0xfff00000
|
||||
|
||||
#define CRYPTO_TFM_MODE_ECB 0x00000001
|
||||
#define CRYPTO_TFM_MODE_CBC 0x00000002
|
||||
#define CRYPTO_TFM_MODE_CFB 0x00000004
|
||||
#define CRYPTO_TFM_MODE_CTR 0x00000008
|
||||
|
||||
#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
|
||||
#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
|
||||
#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
|
||||
|
|
@ -71,12 +65,8 @@
|
|||
/*
|
||||
* Miscellaneous stuff.
|
||||
*/
|
||||
#define CRYPTO_UNSPEC 0
|
||||
#define CRYPTO_MAX_ALG_NAME 64
|
||||
|
||||
#define CRYPTO_DIR_ENCRYPT 1
|
||||
#define CRYPTO_DIR_DECRYPT 0
|
||||
|
||||
/*
|
||||
* The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual
|
||||
* declaration) is used to ensure that the crypto_tfm context structure is
|
||||
|
|
@ -148,19 +138,6 @@ struct cipher_alg {
|
|||
unsigned int keylen);
|
||||
void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
|
||||
void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
|
||||
|
||||
unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
};
|
||||
|
||||
struct digest_alg {
|
||||
|
|
@ -243,11 +220,6 @@ int crypto_unregister_alg(struct crypto_alg *alg);
|
|||
#ifdef CONFIG_CRYPTO
|
||||
int crypto_has_alg(const char *name, u32 type, u32 mask);
|
||||
#else
|
||||
static inline int crypto_alg_available(const char *name, u32 flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -339,13 +311,18 @@ struct crypto_tfm {
|
|||
void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
|
||||
};
|
||||
|
||||
#define crypto_cipher crypto_tfm
|
||||
#define crypto_comp crypto_tfm
|
||||
|
||||
struct crypto_blkcipher {
|
||||
struct crypto_tfm base;
|
||||
};
|
||||
|
||||
struct crypto_cipher {
|
||||
struct crypto_tfm base;
|
||||
};
|
||||
|
||||
struct crypto_comp {
|
||||
struct crypto_tfm base;
|
||||
};
|
||||
|
||||
struct crypto_hash {
|
||||
struct crypto_tfm base;
|
||||
};
|
||||
|
|
@ -395,40 +372,11 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
|
|||
return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
|
||||
}
|
||||
|
||||
static unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
|
||||
__deprecated;
|
||||
static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->__crt_alg->cra_cipher.cia_min_keysize;
|
||||
}
|
||||
|
||||
static unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
|
||||
__deprecated;
|
||||
static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->__crt_alg->cra_cipher.cia_max_keysize;
|
||||
}
|
||||
|
||||
static unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) __deprecated;
|
||||
static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_ivsize;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->__crt_alg->cra_blocksize;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
|
||||
return tfm->__crt_alg->cra_digest.dia_digestsize;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->__crt_alg->cra_alignmask;
|
||||
|
|
@ -633,7 +581,7 @@ static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name,
|
|||
|
||||
static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm)
|
||||
{
|
||||
return tfm;
|
||||
return &tfm->base;
|
||||
}
|
||||
|
||||
static inline void crypto_free_cipher(struct crypto_cipher *tfm)
|
||||
|
|
@ -809,76 +757,6 @@ static inline int crypto_hash_setkey(struct crypto_hash *hash,
|
|||
return crypto_hash_crt(hash)->setkey(hash, key, keylen);
|
||||
}
|
||||
|
||||
static int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv) __deprecated;
|
||||
static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv);
|
||||
}
|
||||
|
||||
static int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv) __deprecated;
|
||||
static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv);
|
||||
}
|
||||
|
||||
static void crypto_cipher_set_iv(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int len) __deprecated;
|
||||
static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int len)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
memcpy(tfm->crt_cipher.cit_iv, src, len);
|
||||
}
|
||||
|
||||
static void crypto_cipher_get_iv(struct crypto_tfm *tfm,
|
||||
u8 *dst, unsigned int len) __deprecated;
|
||||
static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
|
||||
u8 *dst, unsigned int len)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
memcpy(dst, tfm->crt_cipher.cit_iv, len);
|
||||
}
|
||||
|
||||
static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
return (struct crypto_comp *)tfm;
|
||||
|
|
@ -903,7 +781,7 @@ static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
|
|||
|
||||
static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm)
|
||||
{
|
||||
return tfm;
|
||||
return &tfm->base;
|
||||
}
|
||||
|
||||
static inline void crypto_free_comp(struct crypto_comp *tfm)
|
||||
|
|
@ -934,14 +812,16 @@ static inline int crypto_comp_compress(struct crypto_comp *tfm,
|
|||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
{
|
||||
return crypto_comp_crt(tfm)->cot_compress(tfm, src, slen, dst, dlen);
|
||||
return crypto_comp_crt(tfm)->cot_compress(crypto_comp_tfm(tfm),
|
||||
src, slen, dst, dlen);
|
||||
}
|
||||
|
||||
static inline int crypto_comp_decompress(struct crypto_comp *tfm,
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
{
|
||||
return crypto_comp_crt(tfm)->cot_decompress(tfm, src, slen, dst, dlen);
|
||||
return crypto_comp_crt(tfm)->cot_decompress(crypto_comp_tfm(tfm),
|
||||
src, slen, dst, dlen);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_CRYPTO_H */
|
||||
|
|
|
|||
|
|
@ -176,20 +176,20 @@ enum {
|
|||
};
|
||||
|
||||
/* DCCP features (RFC 4340 section 6.4) */
|
||||
enum {
|
||||
DCCPF_RESERVED = 0,
|
||||
DCCPF_CCID = 1,
|
||||
enum {
|
||||
DCCPF_RESERVED = 0,
|
||||
DCCPF_CCID = 1,
|
||||
DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
|
||||
DCCPF_SEQUENCE_WINDOW = 3,
|
||||
DCCPF_SEQUENCE_WINDOW = 3,
|
||||
DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */
|
||||
DCCPF_ACK_RATIO = 5,
|
||||
DCCPF_SEND_ACK_VECTOR = 6,
|
||||
DCCPF_SEND_NDP_COUNT = 7,
|
||||
DCCPF_ACK_RATIO = 5,
|
||||
DCCPF_SEND_ACK_VECTOR = 6,
|
||||
DCCPF_SEND_NDP_COUNT = 7,
|
||||
DCCPF_MIN_CSUM_COVER = 8,
|
||||
DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */
|
||||
/* 10-127 reserved */
|
||||
DCCPF_MIN_CCID_SPECIFIC = 128,
|
||||
DCCPF_MAX_CCID_SPECIFIC = 255,
|
||||
/* 10-127 reserved */
|
||||
DCCPF_MIN_CCID_SPECIFIC = 128,
|
||||
DCCPF_MAX_CCID_SPECIFIC = 255,
|
||||
};
|
||||
|
||||
/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
|
||||
|
|
@ -427,7 +427,7 @@ struct dccp_service_list {
|
|||
};
|
||||
|
||||
#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1)
|
||||
#define DCCP_SERVICE_CODE_IS_ABSENT 0
|
||||
#define DCCP_SERVICE_CODE_IS_ABSENT 0
|
||||
|
||||
static inline int dccp_list_has_service(const struct dccp_service_list *sl,
|
||||
const __be32 service)
|
||||
|
|
@ -436,7 +436,7 @@ static inline int dccp_list_has_service(const struct dccp_service_list *sl,
|
|||
u32 i = sl->dccpsl_nr;
|
||||
while (i--)
|
||||
if (sl->dccpsl_list[i] == service)
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -511,7 +511,7 @@ struct dccp_sock {
|
|||
__u8 dccps_hc_tx_insert_options:1;
|
||||
struct timer_list dccps_xmit_timer;
|
||||
};
|
||||
|
||||
|
||||
static inline struct dccp_sock *dccp_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct dccp_sock *)sk;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ extern int debug_locks_off(void);
|
|||
int __ret = 0; \
|
||||
\
|
||||
if (unlikely(c)) { \
|
||||
if (debug_locks_silent || debug_locks_off()) \
|
||||
if (debug_locks_off() && !debug_locks_silent) \
|
||||
WARN_ON(1); \
|
||||
__ret = 1; \
|
||||
} \
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
|
|||
* The map function must return:
|
||||
* < 0: error
|
||||
* = 0: The target will handle the io by resubmitting it later
|
||||
* > 0: simple remap complete
|
||||
* = 1: simple remap complete
|
||||
* = 2: The target wants to push back the io
|
||||
*/
|
||||
typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
|
||||
union map_info *map_context);
|
||||
|
|
@ -50,6 +51,7 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
|
|||
* 0 : ended successfully
|
||||
* 1 : for some reason the io has still not completed (eg,
|
||||
* multipath target might want to requeue a failed io).
|
||||
* 2 : The target wants to push back the io
|
||||
*/
|
||||
typedef int (*dm_endio_fn) (struct dm_target *ti,
|
||||
struct bio *bio, int error,
|
||||
|
|
@ -173,7 +175,7 @@ void *dm_get_mdptr(struct mapped_device *md);
|
|||
/*
|
||||
* A device can still be used while suspended, but I/O is deferred.
|
||||
*/
|
||||
int dm_suspend(struct mapped_device *md, int with_lockfs);
|
||||
int dm_suspend(struct mapped_device *md, unsigned suspend_flags);
|
||||
int dm_resume(struct mapped_device *md);
|
||||
|
||||
/*
|
||||
|
|
@ -188,6 +190,7 @@ int dm_wait_event(struct mapped_device *md, int event_nr);
|
|||
const char *dm_device_name(struct mapped_device *md);
|
||||
struct gendisk *dm_disk(struct mapped_device *md);
|
||||
int dm_suspended(struct mapped_device *md);
|
||||
int dm_noflush_suspending(struct dm_target *ti);
|
||||
|
||||
/*
|
||||
* Geometry functions.
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ struct device_driver {
|
|||
struct klist_node knode_bus;
|
||||
|
||||
struct module * owner;
|
||||
const char * mod_name; /* used for built-in modules */
|
||||
|
||||
int (*probe) (struct device * dev);
|
||||
int (*remove) (struct device * dev);
|
||||
|
|
@ -327,6 +328,13 @@ extern struct class_device *class_device_create(struct class *cls,
|
|||
__attribute__((format(printf,5,6)));
|
||||
extern void class_device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
struct device_type {
|
||||
struct device_attribute *attrs;
|
||||
int (*uevent)(struct device *dev, char **envp, int num_envp,
|
||||
char *buffer, int buffer_size);
|
||||
void (*release)(struct device *dev);
|
||||
};
|
||||
|
||||
/* interface for exporting device attributes */
|
||||
struct device_attribute {
|
||||
struct attribute attr;
|
||||
|
|
@ -346,6 +354,41 @@ extern int __must_check device_create_bin_file(struct device *dev,
|
|||
struct bin_attribute *attr);
|
||||
extern void device_remove_bin_file(struct device *dev,
|
||||
struct bin_attribute *attr);
|
||||
|
||||
/* device resource management */
|
||||
typedef void (*dr_release_t)(struct device *dev, void *res);
|
||||
typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
|
||||
|
||||
#ifdef CONFIG_DEBUG_DEVRES
|
||||
extern void * __devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
|
||||
const char *name);
|
||||
#define devres_alloc(release, size, gfp) \
|
||||
__devres_alloc(release, size, gfp, #release)
|
||||
#else
|
||||
extern void * devres_alloc(dr_release_t release, size_t size, gfp_t gfp);
|
||||
#endif
|
||||
extern void devres_free(void *res);
|
||||
extern void devres_add(struct device *dev, void *res);
|
||||
extern void * devres_find(struct device *dev, dr_release_t release,
|
||||
dr_match_t match, void *match_data);
|
||||
extern void * devres_get(struct device *dev, void *new_res,
|
||||
dr_match_t match, void *match_data);
|
||||
extern void * devres_remove(struct device *dev, dr_release_t release,
|
||||
dr_match_t match, void *match_data);
|
||||
extern int devres_destroy(struct device *dev, dr_release_t release,
|
||||
dr_match_t match, void *match_data);
|
||||
|
||||
/* devres group */
|
||||
extern void * __must_check devres_open_group(struct device *dev, void *id,
|
||||
gfp_t gfp);
|
||||
extern void devres_close_group(struct device *dev, void *id);
|
||||
extern void devres_remove_group(struct device *dev, void *id);
|
||||
extern int devres_release_group(struct device *dev, void *id);
|
||||
|
||||
/* managed kzalloc/kfree for device drivers, no kmalloc, always use kzalloc */
|
||||
extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
|
||||
extern void devm_kfree(struct device *dev, void *p);
|
||||
|
||||
struct device {
|
||||
struct klist klist_children;
|
||||
struct klist_node knode_parent; /* node in sibling list */
|
||||
|
|
@ -355,6 +398,7 @@ struct device {
|
|||
|
||||
struct kobject kobj;
|
||||
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
|
||||
struct device_type *type;
|
||||
unsigned is_registered:1;
|
||||
struct device_attribute uevent_attr;
|
||||
struct device_attribute *devt_attr;
|
||||
|
|
@ -388,11 +432,15 @@ struct device {
|
|||
/* arch specific additions */
|
||||
struct dev_archdata archdata;
|
||||
|
||||
spinlock_t devres_lock;
|
||||
struct list_head devres_head;
|
||||
|
||||
/* class_device migration path */
|
||||
struct list_head node;
|
||||
struct class *class; /* optional*/
|
||||
struct class *class;
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
struct attribute_group **groups; /* optional groups */
|
||||
int uevent_suppress;
|
||||
|
||||
void (*release)(struct device * dev);
|
||||
};
|
||||
|
|
@ -433,6 +481,8 @@ static inline int device_is_registered(struct device *dev)
|
|||
return dev->is_registered;
|
||||
}
|
||||
|
||||
void driver_init(void);
|
||||
|
||||
/*
|
||||
* High level routines for use by the bus drivers
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -285,9 +285,9 @@ typedef char ioctl_struct[308];
|
|||
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_VERSION_MAJOR 4
|
||||
#define DM_VERSION_MINOR 10
|
||||
#define DM_VERSION_MINOR 11
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2006-09-14)"
|
||||
#define DM_VERSION_EXTRA "-ioctl (2006-10-12)"
|
||||
|
||||
/* Status bits */
|
||||
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
|
||||
|
|
@ -323,4 +323,9 @@ typedef char ioctl_struct[308];
|
|||
*/
|
||||
#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
|
||||
|
||||
/*
|
||||
* Set this to suspend without flushing queued ios.
|
||||
*/
|
||||
#define DM_NOFLUSH_FLAG (1 << 11) /* In */
|
||||
|
||||
#endif /* _LINUX_DM_IOCTL_H */
|
||||
|
|
|
|||
|
|
@ -66,6 +66,33 @@ dma_mark_declared_memory_occupied(struct device *dev,
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Managed DMA API
|
||||
*/
|
||||
extern void *dmam_alloc_coherent(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, gfp_t gfp);
|
||||
extern void dmam_free_coherent(struct device *dev, size_t size, void *vaddr,
|
||||
dma_addr_t dma_handle);
|
||||
extern void *dmam_alloc_noncoherent(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, gfp_t gfp);
|
||||
extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr,
|
||||
dma_addr_t dma_handle);
|
||||
#ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
|
||||
extern int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
|
||||
dma_addr_t device_addr, size_t size,
|
||||
int flags);
|
||||
extern void dmam_release_declared_memory(struct device *dev);
|
||||
#else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
|
||||
static inline int dmam_declare_coherent_memory(struct device *dev,
|
||||
dma_addr_t bus_addr, dma_addr_t device_addr,
|
||||
size_t size, gfp_t gfp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void dmam_release_declared_memory(struct device *dev)
|
||||
{
|
||||
}
|
||||
#endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,12 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
|
|||
|
||||
void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
|
||||
|
||||
/*
|
||||
* Managed DMA pool
|
||||
*/
|
||||
struct dma_pool *dmam_pool_create(const char *name, struct device *dev,
|
||||
size_t size, size_t align, size_t allocation);
|
||||
void dmam_pool_destroy(struct dma_pool *pool);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void);
|
|||
extern void efi_initialize_iomem_resources(struct resource *code_resource,
|
||||
struct resource *data_resource);
|
||||
extern unsigned long efi_get_time(void);
|
||||
extern int __init efi_set_rtc_mmss(unsigned long nowtime);
|
||||
extern int efi_set_rtc_mmss(unsigned long nowtime);
|
||||
extern int is_available_memory(efi_memory_desc_t * md);
|
||||
extern struct efi_memory_map memmap;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,10 +61,20 @@ struct eisa_driver {
|
|||
|
||||
#define to_eisa_driver(drv) container_of(drv,struct eisa_driver, driver)
|
||||
|
||||
/* These external functions are only available when EISA support is enabled. */
|
||||
#ifdef CONFIG_EISA
|
||||
|
||||
extern struct bus_type eisa_bus_type;
|
||||
int eisa_driver_register (struct eisa_driver *edrv);
|
||||
void eisa_driver_unregister (struct eisa_driver *edrv);
|
||||
|
||||
#else /* !CONFIG_EISA */
|
||||
|
||||
static inline int eisa_driver_register (struct eisa_driver *edrv) { return 0; }
|
||||
static inline void eisa_driver_unregister (struct eisa_driver *edrv) { }
|
||||
|
||||
#endif /* !CONFIG_EISA */
|
||||
|
||||
/* Mimics pci.h... */
|
||||
static inline void *eisa_get_drvdata (struct eisa_device *edev)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc
|
|||
|
||||
typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int);
|
||||
|
||||
typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *);
|
||||
|
||||
typedef int (elevator_dispatch_fn) (request_queue_t *, int);
|
||||
|
||||
typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
|
||||
|
|
@ -33,6 +35,7 @@ struct elevator_ops
|
|||
elevator_merge_fn *elevator_merge_fn;
|
||||
elevator_merged_fn *elevator_merged_fn;
|
||||
elevator_merge_req_fn *elevator_merge_req_fn;
|
||||
elevator_allow_merge_fn *elevator_allow_merge_fn;
|
||||
|
||||
elevator_dispatch_fn *elevator_dispatch_fn;
|
||||
elevator_add_req_fn *elevator_add_req_fn;
|
||||
|
|
|
|||
84
include/linux/fault-inject.h
Normal file
84
include/linux/fault-inject.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#ifndef _LINUX_FAULT_INJECT_H
|
||||
#define _LINUX_FAULT_INJECT_H
|
||||
|
||||
#ifdef CONFIG_FAULT_INJECTION
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
/*
|
||||
* For explanation of the elements of this struct, see
|
||||
* Documentation/fault-injection/fault-injection.txt
|
||||
*/
|
||||
struct fault_attr {
|
||||
unsigned long probability;
|
||||
unsigned long interval;
|
||||
atomic_t times;
|
||||
atomic_t space;
|
||||
unsigned long verbose;
|
||||
u32 task_filter;
|
||||
unsigned long stacktrace_depth;
|
||||
unsigned long require_start;
|
||||
unsigned long require_end;
|
||||
unsigned long reject_start;
|
||||
unsigned long reject_end;
|
||||
|
||||
unsigned long count;
|
||||
|
||||
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
|
||||
|
||||
struct {
|
||||
struct dentry *dir;
|
||||
|
||||
struct dentry *probability_file;
|
||||
struct dentry *interval_file;
|
||||
struct dentry *times_file;
|
||||
struct dentry *space_file;
|
||||
struct dentry *verbose_file;
|
||||
struct dentry *task_filter_file;
|
||||
struct dentry *stacktrace_depth_file;
|
||||
struct dentry *require_start_file;
|
||||
struct dentry *require_end_file;
|
||||
struct dentry *reject_start_file;
|
||||
struct dentry *reject_end_file;
|
||||
} dentries;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#define FAULT_ATTR_INITIALIZER { \
|
||||
.interval = 1, \
|
||||
.times = ATOMIC_INIT(1), \
|
||||
.require_end = ULONG_MAX, \
|
||||
.stacktrace_depth = 32, \
|
||||
.verbose = 2, \
|
||||
}
|
||||
|
||||
#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
|
||||
int setup_fault_attr(struct fault_attr *attr, char *str);
|
||||
void should_fail_srandom(unsigned long entropy);
|
||||
bool should_fail(struct fault_attr *attr, ssize_t size);
|
||||
|
||||
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
|
||||
|
||||
int init_fault_attr_dentries(struct fault_attr *attr, const char *name);
|
||||
void cleanup_fault_attr_dentries(struct fault_attr *attr);
|
||||
|
||||
#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
|
||||
|
||||
static inline int init_fault_attr_dentries(struct fault_attr *attr,
|
||||
const char *name)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
|
||||
|
||||
#endif /* CONFIG_FAULT_INJECTION */
|
||||
|
||||
#endif /* _LINUX_FAULT_INJECT_H */
|
||||
|
|
@ -929,8 +929,6 @@ extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max)
|
|||
#define FB_MODE_IS_FIRST 16
|
||||
#define FB_MODE_IS_FROM_VAR 32
|
||||
|
||||
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 fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
|
||||
struct fb_info *info);
|
||||
|
|
@ -970,11 +968,11 @@ extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
|
|||
/* drivers/video/fbcmap.c */
|
||||
extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
|
||||
extern void fb_dealloc_cmap(struct fb_cmap *cmap);
|
||||
extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to);
|
||||
extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to);
|
||||
extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to);
|
||||
extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to);
|
||||
extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info);
|
||||
extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info);
|
||||
extern struct fb_cmap *fb_default_cmap(int len);
|
||||
extern const struct fb_cmap *fb_default_cmap(int len);
|
||||
extern void fb_invert_cmaps(void);
|
||||
|
||||
struct fb_videomode {
|
||||
|
|
|
|||
|
|
@ -26,19 +26,12 @@ struct embedded_fd_set {
|
|||
unsigned long fds_bits[1];
|
||||
};
|
||||
|
||||
/*
|
||||
* More than this number of fds: we use a separately allocated fd_set
|
||||
*/
|
||||
#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
|
||||
|
||||
struct fdtable {
|
||||
unsigned int max_fds;
|
||||
int max_fdset;
|
||||
struct file ** fd; /* current fd array */
|
||||
fd_set *close_on_exec;
|
||||
fd_set *open_fds;
|
||||
struct rcu_head rcu;
|
||||
struct files_struct *free_files;
|
||||
struct fdtable *next;
|
||||
};
|
||||
|
||||
|
|
@ -83,16 +76,15 @@ extern int get_unused_fd(void);
|
|||
extern void FASTCALL(put_unused_fd(unsigned int fd));
|
||||
struct kmem_cache;
|
||||
|
||||
extern struct file ** alloc_fd_array(int);
|
||||
extern void free_fd_array(struct file **, int);
|
||||
|
||||
extern fd_set *alloc_fdset(int);
|
||||
extern void free_fdset(fd_set *, int);
|
||||
|
||||
extern int expand_files(struct files_struct *, int nr);
|
||||
extern void free_fdtable(struct fdtable *fdt);
|
||||
extern void free_fdtable_rcu(struct rcu_head *rcu);
|
||||
extern void __init files_defer_init(void);
|
||||
|
||||
static inline void free_fdtable(struct fdtable *fdt)
|
||||
{
|
||||
call_rcu(&fdt->rcu, free_fdtable_rcu);
|
||||
}
|
||||
|
||||
static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
|
||||
{
|
||||
struct file * file = NULL;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
/* Freezer declarations */
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/*
|
||||
* Check if a process has been frozen
|
||||
|
|
@ -14,16 +16,15 @@ static inline int frozen(struct task_struct *p)
|
|||
*/
|
||||
static inline int freezing(struct task_struct *p)
|
||||
{
|
||||
return p->flags & PF_FREEZE;
|
||||
return test_tsk_thread_flag(p, TIF_FREEZE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Request that a process be frozen
|
||||
* FIXME: SMP problem. We may not modify other process' flags!
|
||||
*/
|
||||
static inline void freeze(struct task_struct *p)
|
||||
{
|
||||
p->flags |= PF_FREEZE;
|
||||
set_tsk_thread_flag(p, TIF_FREEZE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -31,7 +32,7 @@ static inline void freeze(struct task_struct *p)
|
|||
*/
|
||||
static inline void do_not_freeze(struct task_struct *p)
|
||||
{
|
||||
p->flags &= ~PF_FREEZE;
|
||||
clear_tsk_thread_flag(p, TIF_FREEZE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -52,7 +53,9 @@ static inline int thaw_process(struct task_struct *p)
|
|||
*/
|
||||
static inline void frozen_process(struct task_struct *p)
|
||||
{
|
||||
p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
|
||||
p->flags |= PF_FROZEN;
|
||||
wmb();
|
||||
clear_tsk_thread_flag(p, TIF_FREEZE);
|
||||
}
|
||||
|
||||
extern void refrigerator(void);
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ extern int dir_notify_enable;
|
|||
#define MS_PRIVATE (1<<18) /* change to private */
|
||||
#define MS_SLAVE (1<<19) /* change to slave */
|
||||
#define MS_SHARED (1<<20) /* change to shared */
|
||||
#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
|
||||
#define MS_ACTIVE (1<<30)
|
||||
#define MS_NOUSER (1<<31)
|
||||
|
||||
|
|
@ -269,6 +270,7 @@ extern int dir_notify_enable;
|
|||
#include <linux/types.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/stat.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/kobject.h>
|
||||
|
|
@ -424,6 +426,7 @@ struct address_space_operations {
|
|||
/* migrate the contents of a page to the specified target */
|
||||
int (*migratepage) (struct address_space *,
|
||||
struct page *, struct page *);
|
||||
int (*launder_page) (struct page *);
|
||||
};
|
||||
|
||||
struct backing_dev_info;
|
||||
|
|
@ -456,7 +459,7 @@ struct block_device {
|
|||
struct inode * bd_inode; /* will die */
|
||||
int bd_openers;
|
||||
struct mutex bd_mutex; /* open/close mutex */
|
||||
struct mutex bd_mount_mutex; /* mount mutex */
|
||||
struct semaphore bd_mount_sem;
|
||||
struct list_head bd_inodes;
|
||||
void * bd_holder;
|
||||
int bd_holders;
|
||||
|
|
@ -481,21 +484,6 @@ struct block_device {
|
|||
unsigned long bd_private;
|
||||
};
|
||||
|
||||
/*
|
||||
* bdev->bd_mutex nesting subclasses for the lock validator:
|
||||
*
|
||||
* 0: normal
|
||||
* 1: 'whole'
|
||||
* 2: 'partition'
|
||||
*/
|
||||
enum bdev_bd_mutex_lock_class
|
||||
{
|
||||
BD_MUTEX_NORMAL,
|
||||
BD_MUTEX_WHOLE,
|
||||
BD_MUTEX_PARTITION
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Radix-tree tags, for tagging dirty and writeback pages within the pagecache
|
||||
* radix trees
|
||||
|
|
@ -726,8 +714,9 @@ struct file {
|
|||
struct list_head fu_list;
|
||||
struct rcu_head fu_rcuhead;
|
||||
} f_u;
|
||||
struct dentry *f_dentry;
|
||||
struct vfsmount *f_vfsmnt;
|
||||
struct path f_path;
|
||||
#define f_dentry f_path.dentry
|
||||
#define f_vfsmnt f_path.mnt
|
||||
const struct file_operations *f_op;
|
||||
atomic_t f_count;
|
||||
unsigned int f_flags;
|
||||
|
|
@ -1239,7 +1228,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
|
|||
static inline void file_accessed(struct file *file)
|
||||
{
|
||||
if (!(file->f_flags & O_NOATIME))
|
||||
touch_atime(file->f_vfsmnt, file->f_dentry);
|
||||
touch_atime(file->f_path.mnt, file->f_path.dentry);
|
||||
}
|
||||
|
||||
int sync_inode(struct inode *inode, struct writeback_control *wbc);
|
||||
|
|
@ -1499,7 +1488,6 @@ extern void bd_set_size(struct block_device *, loff_t size);
|
|||
extern void bd_forget(struct inode *inode);
|
||||
extern void bdput(struct block_device *);
|
||||
extern struct block_device *open_by_devnum(dev_t, unsigned);
|
||||
extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
|
||||
extern const struct address_space_operations def_blk_aops;
|
||||
#else
|
||||
static inline void bd_forget(struct inode *inode) {}
|
||||
|
|
@ -1517,7 +1505,6 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
|
|||
extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
|
||||
extern int blkdev_get(struct block_device *, mode_t, unsigned);
|
||||
extern int blkdev_put(struct block_device *);
|
||||
extern int blkdev_put_partition(struct block_device *);
|
||||
extern int bd_claim(struct block_device *, void *);
|
||||
extern void bd_release(struct block_device *);
|
||||
#ifdef CONFIG_SYSFS
|
||||
|
|
@ -1632,7 +1619,7 @@ static inline void put_write_access(struct inode * inode)
|
|||
static inline void allow_write_access(struct file *file)
|
||||
{
|
||||
if (file)
|
||||
atomic_inc(&file->f_dentry->d_inode->i_writecount);
|
||||
atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
|
||||
}
|
||||
extern int do_pipe(int *);
|
||||
extern struct file *create_read_pipe(struct file *f);
|
||||
|
|
|
|||
31
include/linux/fs_stack.h
Normal file
31
include/linux/fs_stack.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef _LINUX_FS_STACK_H
|
||||
#define _LINUX_FS_STACK_H
|
||||
|
||||
/* This file defines generic functions used primarily by stackable
|
||||
* filesystems; none of these functions require i_mutex to be held.
|
||||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
|
||||
/* externs for fs/stack.c */
|
||||
extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
|
||||
int (*get_nlinks)(struct inode *));
|
||||
|
||||
extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
|
||||
|
||||
/* inlines */
|
||||
static inline void fsstack_copy_attr_atime(struct inode *dest,
|
||||
const struct inode *src)
|
||||
{
|
||||
dest->i_atime = src->i_atime;
|
||||
}
|
||||
|
||||
static inline void fsstack_copy_attr_times(struct inode *dest,
|
||||
const struct inode *src)
|
||||
{
|
||||
dest->i_atime = src->i_atime;
|
||||
dest->i_mtime = src->i_mtime;
|
||||
dest->i_ctime = src->i_ctime;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_FS_STACK_H */
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
#define _FSL_DEVICE_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/phy.h>
|
||||
|
||||
/*
|
||||
* Some conventions on how we handle peripherals on Freescale chips
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ static inline void fsnotify_open(struct dentry *dentry)
|
|||
*/
|
||||
static inline void fsnotify_close(struct file *file)
|
||||
{
|
||||
struct dentry *dentry = file->f_dentry;
|
||||
struct dentry *dentry = file->f_path.dentry;
|
||||
struct inode *inode = dentry->d_inode;
|
||||
const char *name = dentry->d_name.name;
|
||||
mode_t mode = file->f_mode;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ struct robust_list_head {
|
|||
*/
|
||||
#define ROBUST_LIST_LIMIT 2048
|
||||
|
||||
#ifdef __KERNEL__
|
||||
long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
|
||||
u32 __user *uaddr2, u32 val2, u32 val3);
|
||||
|
||||
|
|
@ -110,6 +111,7 @@ static inline void exit_pi_state_list(struct task_struct *curr)
|
|||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
|
||||
#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ static inline void gameport_set_phys(struct gameport *gameport,
|
|||
|
||||
static inline struct gameport *gameport_allocate_port(void)
|
||||
{
|
||||
struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL);
|
||||
struct gameport *gameport = kzalloc(sizeof(struct gameport), GFP_KERNEL);
|
||||
|
||||
return gameport;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void gs_hangup(struct tty_struct *tty);
|
|||
int gs_block_til_ready(void *port, struct file *filp);
|
||||
void gs_close(struct tty_struct *tty, struct file *filp);
|
||||
void gs_set_termios (struct tty_struct * tty,
|
||||
struct termios * old_termios);
|
||||
struct ktermios * old_termios);
|
||||
int gs_init_port(struct gs_port *port);
|
||||
int gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
|
||||
int gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ struct hd_struct {
|
|||
struct kobject *holder_dir;
|
||||
unsigned ios[2], sectors[2]; /* READs and WRITEs */
|
||||
int policy, partno;
|
||||
#ifdef CONFIG_FAIL_MAKE_REQUEST
|
||||
int make_it_fail;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define GENHD_FL_REMOVABLE 1
|
||||
|
|
@ -90,6 +93,7 @@ struct hd_struct {
|
|||
#define GENHD_FL_CD 8
|
||||
#define GENHD_FL_UP 16
|
||||
#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
|
||||
#define GENHD_FL_FAIL 64
|
||||
|
||||
struct disk_stats {
|
||||
unsigned long sectors[2]; /* READs and WRITEs */
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ struct vm_area_struct;
|
|||
#ifdef CONFIG_NUMA
|
||||
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
|
||||
#else
|
||||
#define GFP_THISNODE 0
|
||||
#define GFP_THISNODE ((__force gfp_t)0)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,13 +60,15 @@
|
|||
#define TAG_MASK 0xf8
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Command Header sizes for IOCTL commands
|
||||
*/
|
||||
|
||||
#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(u8))
|
||||
#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(u8))
|
||||
#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(u8))
|
||||
#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8))
|
||||
#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8))
|
||||
#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8))
|
||||
|
||||
#define IDE_DRIVE_TASK_INVALID -1
|
||||
#define IDE_DRIVE_TASK_NO_DATA 0
|
||||
|
|
|
|||
45
include/linux/hid-debug.h
Normal file
45
include/linux/hid-debug.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef __HID_DEBUG_H
|
||||
#define __HID_DEBUG_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
|
||||
void hid_dump_input(struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *);
|
||||
void hid_dump_field(struct hid_field *, int);
|
||||
void hid_resolv_usage(unsigned);
|
||||
void hid_resolv_event(__u8, __u16);
|
||||
|
||||
#else
|
||||
|
||||
#define hid_dump_input(a,b) do { } while (0)
|
||||
#define hid_dump_device(c) do { } while (0)
|
||||
#define hid_dump_field(a,b) do { } while (0)
|
||||
#define hid_resolv_usage(a) do { } while (0)
|
||||
#define hid_resolv_event(a,b) do { } while (0)
|
||||
|
||||
#endif /* CONFIG_HID_DEBUG */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
521
include/linux/hid.h
Normal file
521
include/linux/hid.h
Normal file
|
|
@ -0,0 +1,521 @@
|
|||
#ifndef __HID_H
|
||||
#define __HID_H
|
||||
|
||||
/*
|
||||
* $Id: hid.h,v 1.24 2001/12/27 10:37:41 vojtech Exp $
|
||||
*
|
||||
* Copyright (c) 1999 Andreas Gal
|
||||
* Copyright (c) 2000-2001 Vojtech Pavlik
|
||||
* Copyright (c) 2006 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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@ucw.cz>, or by paper mail:
|
||||
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
/*
|
||||
* USB HID (Human Interface Device) interface class code
|
||||
*/
|
||||
|
||||
#define USB_INTERFACE_CLASS_HID 3
|
||||
|
||||
/*
|
||||
* USB HID interface subclass and protocol codes
|
||||
*/
|
||||
|
||||
#define USB_INTERFACE_SUBCLASS_BOOT 1
|
||||
#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
|
||||
#define USB_INTERFACE_PROTOCOL_MOUSE 2
|
||||
|
||||
/*
|
||||
* HID class requests
|
||||
*/
|
||||
|
||||
#define HID_REQ_GET_REPORT 0x01
|
||||
#define HID_REQ_GET_IDLE 0x02
|
||||
#define HID_REQ_GET_PROTOCOL 0x03
|
||||
#define HID_REQ_SET_REPORT 0x09
|
||||
#define HID_REQ_SET_IDLE 0x0A
|
||||
#define HID_REQ_SET_PROTOCOL 0x0B
|
||||
|
||||
/*
|
||||
* HID class descriptor types
|
||||
*/
|
||||
|
||||
#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
|
||||
#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
|
||||
#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
|
||||
|
||||
/*
|
||||
* We parse each description item into this structure. Short items data
|
||||
* values are expanded to 32-bit signed int, long items contain a pointer
|
||||
* into the data area.
|
||||
*/
|
||||
|
||||
struct hid_item {
|
||||
unsigned format;
|
||||
__u8 size;
|
||||
__u8 type;
|
||||
__u8 tag;
|
||||
union {
|
||||
__u8 u8;
|
||||
__s8 s8;
|
||||
__u16 u16;
|
||||
__s16 s16;
|
||||
__u32 u32;
|
||||
__s32 s32;
|
||||
__u8 *longdata;
|
||||
} data;
|
||||
};
|
||||
|
||||
/*
|
||||
* HID report item format
|
||||
*/
|
||||
|
||||
#define HID_ITEM_FORMAT_SHORT 0
|
||||
#define HID_ITEM_FORMAT_LONG 1
|
||||
|
||||
/*
|
||||
* Special tag indicating long items
|
||||
*/
|
||||
|
||||
#define HID_ITEM_TAG_LONG 15
|
||||
|
||||
/*
|
||||
* HID report descriptor item type (prefix bit 2,3)
|
||||
*/
|
||||
|
||||
#define HID_ITEM_TYPE_MAIN 0
|
||||
#define HID_ITEM_TYPE_GLOBAL 1
|
||||
#define HID_ITEM_TYPE_LOCAL 2
|
||||
#define HID_ITEM_TYPE_RESERVED 3
|
||||
|
||||
/*
|
||||
* HID report descriptor main item tags
|
||||
*/
|
||||
|
||||
#define HID_MAIN_ITEM_TAG_INPUT 8
|
||||
#define HID_MAIN_ITEM_TAG_OUTPUT 9
|
||||
#define HID_MAIN_ITEM_TAG_FEATURE 11
|
||||
#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10
|
||||
#define HID_MAIN_ITEM_TAG_END_COLLECTION 12
|
||||
|
||||
/*
|
||||
* HID report descriptor main item contents
|
||||
*/
|
||||
|
||||
#define HID_MAIN_ITEM_CONSTANT 0x001
|
||||
#define HID_MAIN_ITEM_VARIABLE 0x002
|
||||
#define HID_MAIN_ITEM_RELATIVE 0x004
|
||||
#define HID_MAIN_ITEM_WRAP 0x008
|
||||
#define HID_MAIN_ITEM_NONLINEAR 0x010
|
||||
#define HID_MAIN_ITEM_NO_PREFERRED 0x020
|
||||
#define HID_MAIN_ITEM_NULL_STATE 0x040
|
||||
#define HID_MAIN_ITEM_VOLATILE 0x080
|
||||
#define HID_MAIN_ITEM_BUFFERED_BYTE 0x100
|
||||
|
||||
/*
|
||||
* HID report descriptor collection item types
|
||||
*/
|
||||
|
||||
#define HID_COLLECTION_PHYSICAL 0
|
||||
#define HID_COLLECTION_APPLICATION 1
|
||||
#define HID_COLLECTION_LOGICAL 2
|
||||
|
||||
/*
|
||||
* HID report descriptor global item tags
|
||||
*/
|
||||
|
||||
#define HID_GLOBAL_ITEM_TAG_USAGE_PAGE 0
|
||||
#define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM 1
|
||||
#define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM 2
|
||||
#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM 3
|
||||
#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM 4
|
||||
#define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT 5
|
||||
#define HID_GLOBAL_ITEM_TAG_UNIT 6
|
||||
#define HID_GLOBAL_ITEM_TAG_REPORT_SIZE 7
|
||||
#define HID_GLOBAL_ITEM_TAG_REPORT_ID 8
|
||||
#define HID_GLOBAL_ITEM_TAG_REPORT_COUNT 9
|
||||
#define HID_GLOBAL_ITEM_TAG_PUSH 10
|
||||
#define HID_GLOBAL_ITEM_TAG_POP 11
|
||||
|
||||
/*
|
||||
* HID report descriptor local item tags
|
||||
*/
|
||||
|
||||
#define HID_LOCAL_ITEM_TAG_USAGE 0
|
||||
#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM 1
|
||||
#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM 2
|
||||
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX 3
|
||||
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4
|
||||
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5
|
||||
#define HID_LOCAL_ITEM_TAG_STRING_INDEX 7
|
||||
#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM 8
|
||||
#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM 9
|
||||
#define HID_LOCAL_ITEM_TAG_DELIMITER 10
|
||||
|
||||
/*
|
||||
* HID usage tables
|
||||
*/
|
||||
|
||||
#define HID_USAGE_PAGE 0xffff0000
|
||||
|
||||
#define HID_UP_UNDEFINED 0x00000000
|
||||
#define HID_UP_GENDESK 0x00010000
|
||||
#define HID_UP_SIMULATION 0x00020000
|
||||
#define HID_UP_KEYBOARD 0x00070000
|
||||
#define HID_UP_LED 0x00080000
|
||||
#define HID_UP_BUTTON 0x00090000
|
||||
#define HID_UP_ORDINAL 0x000a0000
|
||||
#define HID_UP_CONSUMER 0x000c0000
|
||||
#define HID_UP_DIGITIZER 0x000d0000
|
||||
#define HID_UP_PID 0x000f0000
|
||||
#define HID_UP_HPVENDOR 0xff7f0000
|
||||
#define HID_UP_MSVENDOR 0xff000000
|
||||
#define HID_UP_CUSTOM 0x00ff0000
|
||||
#define HID_UP_LOGIVENDOR 0xffbc0000
|
||||
|
||||
#define HID_USAGE 0x0000ffff
|
||||
|
||||
#define HID_GD_POINTER 0x00010001
|
||||
#define HID_GD_MOUSE 0x00010002
|
||||
#define HID_GD_JOYSTICK 0x00010004
|
||||
#define HID_GD_GAMEPAD 0x00010005
|
||||
#define HID_GD_KEYBOARD 0x00010006
|
||||
#define HID_GD_KEYPAD 0x00010007
|
||||
#define HID_GD_MULTIAXIS 0x00010008
|
||||
#define HID_GD_X 0x00010030
|
||||
#define HID_GD_Y 0x00010031
|
||||
#define HID_GD_Z 0x00010032
|
||||
#define HID_GD_RX 0x00010033
|
||||
#define HID_GD_RY 0x00010034
|
||||
#define HID_GD_RZ 0x00010035
|
||||
#define HID_GD_SLIDER 0x00010036
|
||||
#define HID_GD_DIAL 0x00010037
|
||||
#define HID_GD_WHEEL 0x00010038
|
||||
#define HID_GD_HATSWITCH 0x00010039
|
||||
#define HID_GD_BUFFER 0x0001003a
|
||||
#define HID_GD_BYTECOUNT 0x0001003b
|
||||
#define HID_GD_MOTION 0x0001003c
|
||||
#define HID_GD_START 0x0001003d
|
||||
#define HID_GD_SELECT 0x0001003e
|
||||
#define HID_GD_VX 0x00010040
|
||||
#define HID_GD_VY 0x00010041
|
||||
#define HID_GD_VZ 0x00010042
|
||||
#define HID_GD_VBRX 0x00010043
|
||||
#define HID_GD_VBRY 0x00010044
|
||||
#define HID_GD_VBRZ 0x00010045
|
||||
#define HID_GD_VNO 0x00010046
|
||||
#define HID_GD_FEATURE 0x00010047
|
||||
#define HID_GD_UP 0x00010090
|
||||
#define HID_GD_DOWN 0x00010091
|
||||
#define HID_GD_RIGHT 0x00010092
|
||||
#define HID_GD_LEFT 0x00010093
|
||||
|
||||
/*
|
||||
* HID report types --- Ouch! HID spec says 1 2 3!
|
||||
*/
|
||||
|
||||
#define HID_INPUT_REPORT 0
|
||||
#define HID_OUTPUT_REPORT 1
|
||||
#define HID_FEATURE_REPORT 2
|
||||
|
||||
/*
|
||||
* HID device quirks.
|
||||
*/
|
||||
|
||||
#define HID_QUIRK_INVERT 0x00000001
|
||||
#define HID_QUIRK_NOTOUCH 0x00000002
|
||||
#define HID_QUIRK_IGNORE 0x00000004
|
||||
#define HID_QUIRK_NOGET 0x00000008
|
||||
#define HID_QUIRK_HIDDEV 0x00000010
|
||||
#define HID_QUIRK_BADPAD 0x00000020
|
||||
#define HID_QUIRK_MULTI_INPUT 0x00000040
|
||||
#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080
|
||||
#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
|
||||
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
|
||||
#define HID_QUIRK_MIGHTYMOUSE 0x00000400
|
||||
#define HID_QUIRK_CYMOTION 0x00000800
|
||||
#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000
|
||||
#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000
|
||||
#define HID_QUIRK_INVERT_HWHEEL 0x00004000
|
||||
#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
|
||||
#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000
|
||||
#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000
|
||||
#define HID_QUIRK_IGNORE_MOUSE 0x00040000
|
||||
#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000
|
||||
|
||||
/*
|
||||
* This is the global environment of the parser. This information is
|
||||
* persistent for main-items. The global environment can be saved and
|
||||
* restored with PUSH/POP statements.
|
||||
*/
|
||||
|
||||
struct hid_global {
|
||||
unsigned usage_page;
|
||||
__s32 logical_minimum;
|
||||
__s32 logical_maximum;
|
||||
__s32 physical_minimum;
|
||||
__s32 physical_maximum;
|
||||
__s32 unit_exponent;
|
||||
unsigned unit;
|
||||
unsigned report_id;
|
||||
unsigned report_size;
|
||||
unsigned report_count;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is the local environment. It is persistent up the next main-item.
|
||||
*/
|
||||
|
||||
#define HID_MAX_DESCRIPTOR_SIZE 4096
|
||||
#define HID_MAX_USAGES 1024
|
||||
#define HID_DEFAULT_NUM_COLLECTIONS 16
|
||||
|
||||
struct hid_local {
|
||||
unsigned usage[HID_MAX_USAGES]; /* usage array */
|
||||
unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
|
||||
unsigned usage_index;
|
||||
unsigned usage_minimum;
|
||||
unsigned delimiter_depth;
|
||||
unsigned delimiter_branch;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is the collection stack. We climb up the stack to determine
|
||||
* application and function of each field.
|
||||
*/
|
||||
|
||||
struct hid_collection {
|
||||
unsigned type;
|
||||
unsigned usage;
|
||||
unsigned level;
|
||||
};
|
||||
|
||||
struct hid_usage {
|
||||
unsigned hid; /* hid usage code */
|
||||
unsigned collection_index; /* index into collection array */
|
||||
/* hidinput data */
|
||||
__u16 code; /* input driver code */
|
||||
__u8 type; /* input driver type */
|
||||
__s8 hat_min; /* hat switch fun */
|
||||
__s8 hat_max; /* ditto */
|
||||
__s8 hat_dir; /* ditto */
|
||||
};
|
||||
|
||||
struct hid_input;
|
||||
|
||||
struct hid_field {
|
||||
unsigned physical; /* physical usage for this field */
|
||||
unsigned logical; /* logical usage for this field */
|
||||
unsigned application; /* application usage for this field */
|
||||
struct hid_usage *usage; /* usage table for this function */
|
||||
unsigned maxusage; /* maximum usage index */
|
||||
unsigned flags; /* main-item flags (i.e. volatile,array,constant) */
|
||||
unsigned report_offset; /* bit offset in the report */
|
||||
unsigned report_size; /* size of this field in the report */
|
||||
unsigned report_count; /* number of this field in the report */
|
||||
unsigned report_type; /* (input,output,feature) */
|
||||
__s32 *value; /* last known value(s) */
|
||||
__s32 logical_minimum;
|
||||
__s32 logical_maximum;
|
||||
__s32 physical_minimum;
|
||||
__s32 physical_maximum;
|
||||
__s32 unit_exponent;
|
||||
unsigned unit;
|
||||
struct hid_report *report; /* associated report */
|
||||
unsigned index; /* index into report->field[] */
|
||||
/* hidinput data */
|
||||
struct hid_input *hidinput; /* associated input structure */
|
||||
__u16 dpad; /* dpad input code */
|
||||
};
|
||||
|
||||
#define HID_MAX_FIELDS 64
|
||||
|
||||
struct hid_report {
|
||||
struct list_head list;
|
||||
unsigned id; /* id of this report */
|
||||
unsigned type; /* report type */
|
||||
struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */
|
||||
unsigned maxfield; /* maximum valid field index */
|
||||
unsigned size; /* size of the report (bits) */
|
||||
struct hid_device *device; /* associated device */
|
||||
};
|
||||
|
||||
struct hid_report_enum {
|
||||
unsigned numbered;
|
||||
struct list_head report_list;
|
||||
struct hid_report *report_id_hash[256];
|
||||
};
|
||||
|
||||
#define HID_REPORT_TYPES 3
|
||||
|
||||
#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */
|
||||
#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */
|
||||
#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
|
||||
#define HID_OUTPUT_FIFO_SIZE 64
|
||||
|
||||
struct hid_control_fifo {
|
||||
unsigned char dir;
|
||||
struct hid_report *report;
|
||||
};
|
||||
|
||||
#define HID_CLAIMED_INPUT 1
|
||||
#define HID_CLAIMED_HIDDEV 2
|
||||
|
||||
#define HID_CTRL_RUNNING 1
|
||||
#define HID_OUT_RUNNING 2
|
||||
#define HID_IN_RUNNING 3
|
||||
#define HID_RESET_PENDING 4
|
||||
#define HID_SUSPENDED 5
|
||||
#define HID_CLEAR_HALT 6
|
||||
|
||||
struct hid_input {
|
||||
struct list_head list;
|
||||
struct hid_report *report;
|
||||
struct input_dev *input;
|
||||
};
|
||||
|
||||
struct hid_device { /* device report descriptor */
|
||||
__u8 *rdesc;
|
||||
unsigned rsize;
|
||||
struct hid_collection *collection; /* List of HID collections */
|
||||
unsigned collection_size; /* Number of allocated hid_collections */
|
||||
unsigned maxcollection; /* Number of parsed collections */
|
||||
unsigned maxapplication; /* Number of applications */
|
||||
unsigned short bus; /* BUS ID */
|
||||
unsigned short vendor; /* Vendor ID */
|
||||
unsigned short product; /* Product ID */
|
||||
unsigned version; /* HID version */
|
||||
unsigned country; /* HID country */
|
||||
struct hid_report_enum report_enum[HID_REPORT_TYPES];
|
||||
|
||||
struct device *dev; /* device */
|
||||
|
||||
unsigned claimed; /* Claimed by hidinput, hiddev? */
|
||||
unsigned quirks; /* Various quirks the device can pull on us */
|
||||
|
||||
struct list_head inputs; /* The list of inputs */
|
||||
void *hiddev; /* The hiddev structure */
|
||||
int minor; /* Hiddev minor number */
|
||||
|
||||
wait_queue_head_t wait; /* For sleeping */
|
||||
|
||||
int open; /* is the device open by anyone? */
|
||||
char name[128]; /* Device name */
|
||||
char phys[64]; /* Device physical location */
|
||||
char uniq[64]; /* Device unique identifier (serial #) */
|
||||
|
||||
void *driver_data;
|
||||
|
||||
/* device-specific function pointers */
|
||||
int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
|
||||
int (*hid_open) (struct hid_device *);
|
||||
void (*hid_close) (struct hid_device *);
|
||||
|
||||
/* hiddev event handler */
|
||||
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
|
||||
struct hid_usage *, __s32);
|
||||
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
|
||||
#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
|
||||
unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
|
||||
unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
|
||||
#endif
|
||||
};
|
||||
|
||||
#define HID_GLOBAL_STACK_SIZE 4
|
||||
#define HID_COLLECTION_STACK_SIZE 4
|
||||
|
||||
struct hid_parser {
|
||||
struct hid_global global;
|
||||
struct hid_global global_stack[HID_GLOBAL_STACK_SIZE];
|
||||
unsigned global_stack_ptr;
|
||||
struct hid_local local;
|
||||
unsigned collection_stack[HID_COLLECTION_STACK_SIZE];
|
||||
unsigned collection_stack_ptr;
|
||||
struct hid_device *device;
|
||||
};
|
||||
|
||||
struct hid_class_descriptor {
|
||||
__u8 bDescriptorType;
|
||||
__u16 wDescriptorLength;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct hid_descriptor {
|
||||
__u8 bLength;
|
||||
__u8 bDescriptorType;
|
||||
__u16 bcdHID;
|
||||
__u8 bCountryCode;
|
||||
__u8 bNumDescriptors;
|
||||
|
||||
struct hid_class_descriptor desc[1];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
|
||||
/* We ignore a few input applications that are not widely used */
|
||||
#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
|
||||
|
||||
/* HID core API */
|
||||
extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
|
||||
extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
|
||||
extern int hidinput_connect(struct hid_device *);
|
||||
extern void hidinput_disconnect(struct hid_device *);
|
||||
|
||||
int hid_set_field(struct hid_field *, unsigned, __s32);
|
||||
int hid_input_report(struct hid_device *, int type, u8 *, int, int);
|
||||
int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
|
||||
void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt);
|
||||
void hid_output_report(struct hid_report *report, __u8 *data);
|
||||
void hid_free_device(struct hid_device *device);
|
||||
struct hid_device *hid_parse_report(__u8 *start, unsigned size);
|
||||
|
||||
#ifdef CONFIG_HID_FF
|
||||
int hid_ff_init(struct hid_device *hid);
|
||||
|
||||
int hid_lgff_init(struct hid_device *hid);
|
||||
int hid_plff_init(struct hid_device *hid);
|
||||
int hid_tmff_init(struct hid_device *hid);
|
||||
int hid_zpff_init(struct hid_device *hid);
|
||||
#ifdef CONFIG_HID_PID
|
||||
int hid_pidff_init(struct hid_device *hid);
|
||||
#else
|
||||
static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
|
||||
#endif
|
||||
|
||||
#else
|
||||
static inline int hid_ff_init(struct hid_device *hid) { return -1; }
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#else
|
||||
#define dbg(format, arg...) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#endif
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#include <asm/cacheflush.h>
|
||||
|
||||
#ifndef ARCH_HAS_FLUSH_ANON_PAGE
|
||||
static inline void flush_anon_page(struct page *page, unsigned long vmaddr)
|
||||
static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
|
@ -96,7 +96,10 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse
|
|||
kunmap_atomic(kaddr, KM_USER0);
|
||||
}
|
||||
|
||||
static inline void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr)
|
||||
#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
|
||||
|
||||
static inline void copy_user_highpage(struct page *to, struct page *from,
|
||||
unsigned long vaddr, struct vm_area_struct *vma)
|
||||
{
|
||||
char *vfrom, *vto;
|
||||
|
||||
|
|
@ -109,6 +112,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign
|
|||
smp_wmb();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static inline void copy_highpage(struct page *to, struct page *from)
|
||||
{
|
||||
char *vfrom, *vto;
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
/* --- Defines for bit-adapters --------------------------------------- */
|
||||
/*
|
||||
* This struct contains the hw-dependent functions of bit-style adapters to
|
||||
* This struct contains the hw-dependent functions of bit-style adapters to
|
||||
* manipulate the line states, and to init any hw-specific features. This is
|
||||
* only used if you have more than one hw-type of adapter running.
|
||||
* only used if you have more than one hw-type of adapter running.
|
||||
*/
|
||||
struct i2c_algo_bit_data {
|
||||
void *data; /* private data for lowlevel routines */
|
||||
|
|
@ -44,6 +44,5 @@ struct i2c_algo_bit_data {
|
|||
};
|
||||
|
||||
int i2c_bit_add_bus(struct i2c_adapter *);
|
||||
int i2c_bit_del_bus(struct i2c_adapter *);
|
||||
|
||||
#endif /* _LINUX_I2C_ALGO_BIT_H */
|
||||
|
|
|
|||
|
|
@ -1,72 +0,0 @@
|
|||
/* ------------------------------------------------------------------------- */
|
||||
/* i2c-algo-ite.h i2c driver algorithms for ITE IIC adapters */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Copyright (C) 1995-97 Simon G. Vogl
|
||||
1998-99 Hans Berglund
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
|
||||
Frodo Looijaard <frodol@dds.nl> */
|
||||
|
||||
/* Modifications by MontaVista Software, 2001
|
||||
Changes made to support the ITE IIC peripheral */
|
||||
|
||||
|
||||
#ifndef I2C_ALGO_ITE_H
|
||||
#define I2C_ALGO_ITE_H 1
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* Example of a sequential read request:
|
||||
struct i2c_iic_msg s_msg;
|
||||
|
||||
s_msg.addr=device_address;
|
||||
s_msg.len=length;
|
||||
s_msg.buf=buffer;
|
||||
s_msg.waddr=word_address;
|
||||
ioctl(file,I2C_SREAD, &s_msg);
|
||||
*/
|
||||
#define I2C_SREAD 0x780 /* SREAD ioctl command */
|
||||
|
||||
struct i2c_iic_msg {
|
||||
__u16 addr; /* device address */
|
||||
__u16 waddr; /* word address */
|
||||
short len; /* msg length */
|
||||
char *buf; /* pointer to msg data */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct i2c_adapter;
|
||||
|
||||
struct i2c_algo_iic_data {
|
||||
void *data; /* private data for lolevel routines */
|
||||
void (*setiic) (void *data, int ctl, int val);
|
||||
int (*getiic) (void *data, int ctl);
|
||||
int (*getown) (void *data);
|
||||
int (*getclock) (void *data);
|
||||
void (*waitforpin) (void);
|
||||
|
||||
/* local settings */
|
||||
int udelay;
|
||||
int mdelay;
|
||||
int timeout;
|
||||
};
|
||||
|
||||
int i2c_iic_add_bus(struct i2c_adapter *);
|
||||
int i2c_iic_del_bus(struct i2c_adapter *);
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* I2C_ALGO_ITE_H */
|
||||
|
|
@ -10,6 +10,5 @@ struct i2c_algo_pca_data {
|
|||
};
|
||||
|
||||
int i2c_pca_add_bus(struct i2c_adapter *);
|
||||
int i2c_pca_del_bus(struct i2c_adapter *);
|
||||
|
||||
#endif /* _LINUX_I2C_ALGO_PCA_H */
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct i2c_algo_pcf_data {
|
|||
int (*getpcf) (void *data, int ctl);
|
||||
int (*getown) (void *data);
|
||||
int (*getclock) (void *data);
|
||||
void (*waitforpin) (void);
|
||||
void (*waitforpin) (void);
|
||||
|
||||
/* local settings */
|
||||
int udelay;
|
||||
|
|
@ -39,6 +39,5 @@ struct i2c_algo_pcf_data {
|
|||
};
|
||||
|
||||
int i2c_pcf_add_bus(struct i2c_adapter *);
|
||||
int i2c_pcf_del_bus(struct i2c_adapter *);
|
||||
|
||||
#endif /* _LINUX_I2C_ALGO_PCF_H */
|
||||
|
|
|
|||
|
|
@ -22,6 +22,5 @@ struct i2c_algo_sgi_data {
|
|||
};
|
||||
|
||||
int i2c_sgi_add_bus(struct i2c_adapter *);
|
||||
int i2c_sgi_del_bus(struct i2c_adapter *);
|
||||
|
||||
#endif /* I2C_ALGO_SGI_H */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* ------------------------------------------------------------------------- */
|
||||
/* */
|
||||
/* */
|
||||
/* i2c-id.h - identifier values for i2c drivers and adapters */
|
||||
/* */
|
||||
/* */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Copyright (C) 1995-1999 Simon G. Vogl
|
||||
|
||||
|
|
@ -40,10 +40,10 @@
|
|||
#define I2C_DRIVERID_SAA7120 11 /* video encoder */
|
||||
#define I2C_DRIVERID_SAA7121 12 /* video encoder */
|
||||
#define I2C_DRIVERID_SAA7185B 13 /* video encoder */
|
||||
#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */
|
||||
#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */
|
||||
#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */
|
||||
#define I2C_DRIVERID_PCF8582C 16 /* eeprom */
|
||||
#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */
|
||||
#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */
|
||||
#define I2C_DRIVERID_TEA6300 18 /* audio mixer */
|
||||
#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */
|
||||
#define I2C_DRIVERID_TDA9850 20 /* audio mixer */
|
||||
|
|
@ -82,9 +82,8 @@
|
|||
#define I2C_DRIVERID_STM41T00 52 /* real time clock */
|
||||
#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */
|
||||
#define I2C_DRIVERID_ADV7170 54 /* video encoder */
|
||||
#define I2C_DRIVERID_RADEON 55 /* I2C bus on Radeon boards */
|
||||
#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
|
||||
#define I2C_DRIVERID_SAA7191 57 /* video encoder */
|
||||
#define I2C_DRIVERID_SAA7191 57 /* video decoder */
|
||||
#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
|
||||
#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */
|
||||
#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */
|
||||
|
|
@ -116,6 +115,8 @@
|
|||
#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
|
||||
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
|
||||
#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
|
||||
#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
|
||||
#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
|
||||
|
||||
#define I2C_DRIVERID_I2CDEV 900
|
||||
#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
|
||||
|
|
@ -132,7 +133,6 @@
|
|||
#define I2C_DRIVERID_ADM1021 1008
|
||||
#define I2C_DRIVERID_ADM9240 1009
|
||||
#define I2C_DRIVERID_LTC1710 1010
|
||||
#define I2C_DRIVERID_ICSPLL 1012
|
||||
#define I2C_DRIVERID_BT869 1013
|
||||
#define I2C_DRIVERID_MAXILIFE 1014
|
||||
#define I2C_DRIVERID_MATORB 1015
|
||||
|
|
@ -144,7 +144,6 @@
|
|||
#define I2C_DRIVERID_MTP008 1023
|
||||
#define I2C_DRIVERID_DS1621 1024
|
||||
#define I2C_DRIVERID_ADM1024 1025
|
||||
#define I2C_DRIVERID_IT87 1026
|
||||
#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
|
||||
#define I2C_DRIVERID_FSCPOS 1028
|
||||
#define I2C_DRIVERID_FSCSCY 1029
|
||||
|
|
@ -159,12 +158,13 @@
|
|||
#define I2C_DRIVERID_ASB100 1043
|
||||
#define I2C_DRIVERID_FSCHER 1046
|
||||
#define I2C_DRIVERID_W83L785TS 1047
|
||||
#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */
|
||||
|
||||
/*
|
||||
* ---- Adapter types ----------------------------------------------------
|
||||
*/
|
||||
|
||||
/* --- Bit algorithm adapters */
|
||||
/* --- Bit algorithm adapters */
|
||||
#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
|
||||
#define I2C_HW_B_SER 0x010002 /* Serial line interface */
|
||||
#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
|
||||
|
|
@ -212,9 +212,6 @@
|
|||
/* --- MPC8xx PowerPC adapters */
|
||||
#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */
|
||||
|
||||
/* --- ITE based algorithms */
|
||||
#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */
|
||||
|
||||
/* --- PowerPC on-chip adapters */
|
||||
#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */
|
||||
|
||||
|
|
@ -250,6 +247,7 @@
|
|||
#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
|
||||
#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */
|
||||
#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
|
||||
#define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */
|
||||
|
||||
/* --- ISA pseudo-adapter */
|
||||
#define I2C_HW_ISA 0x050000
|
||||
|
|
|
|||
43
include/linux/i2c-pnx.h
Normal file
43
include/linux/i2c-pnx.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Header file for I2C support on PNX010x/4008.
|
||||
*
|
||||
* Author: Dennis Kovalev <dkovalev@ru.mvista.com>
|
||||
*
|
||||
* 2004-2006 (c) MontaVista Software, Inc. This file is licensed under
|
||||
* the terms of the GNU General Public License version 2. This program
|
||||
* is licensed "as is" without any warranty of any kind, whether express
|
||||
* or implied.
|
||||
*/
|
||||
|
||||
#ifndef __I2C_PNX_H__
|
||||
#define __I2C_PNX_H__
|
||||
|
||||
#include <asm/arch/i2c.h>
|
||||
|
||||
struct i2c_pnx_mif {
|
||||
int ret; /* Return value */
|
||||
int mode; /* Interface mode */
|
||||
struct completion complete; /* I/O completion */
|
||||
struct timer_list timer; /* Timeout */
|
||||
char * buf; /* Data buffer */
|
||||
int len; /* Length of data buffer */
|
||||
};
|
||||
|
||||
struct i2c_pnx_algo_data {
|
||||
u32 base;
|
||||
u32 ioaddr;
|
||||
int irq;
|
||||
struct i2c_pnx_mif mif;
|
||||
int last;
|
||||
};
|
||||
|
||||
struct i2c_pnx_data {
|
||||
int (*suspend) (struct platform_device *pdev, pm_message_t state);
|
||||
int (*resume) (struct platform_device *pdev);
|
||||
u32 (*calculate_input_freq) (struct platform_device *pdev);
|
||||
int (*set_clock_run) (struct platform_device *pdev);
|
||||
int (*set_clock_stop) (struct platform_device *pdev);
|
||||
struct i2c_adapter *adapter;
|
||||
};
|
||||
|
||||
#endif /* __I2C_PNX_H__ */
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/* ------------------------------------------------------------------------- */
|
||||
/* */
|
||||
/* */
|
||||
/* i2c.h - definitions for the i2c-bus interface */
|
||||
/* */
|
||||
/* */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Copyright (C) 1995-2000 Simon G. Vogl
|
||||
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#define _LINUX_I2C_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#ifdef __KERNEL__
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/module.h>
|
||||
#include <linux/i2c-id.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
|
@ -53,8 +53,8 @@ union i2c_smbus_data;
|
|||
|
||||
/*
|
||||
* The master routines are the ones normally used to transmit data to devices
|
||||
* on a bus (or read from them). Apart from two basic transfer functions to
|
||||
* transmit one message at a time, a more complex version can be used to
|
||||
* on a bus (or read from them). Apart from two basic transfer functions to
|
||||
* transmit one message at a time, a more complex version can be used to
|
||||
* transmit an arbitrary number of messages without interruption.
|
||||
*/
|
||||
extern int i2c_master_send(struct i2c_client *,const char* ,int);
|
||||
|
|
@ -67,10 +67,10 @@ extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
|
|||
|
||||
/* This is the very generalized SMBus access routine. You probably do not
|
||||
want to use this, though; one of the functions below may be much easier,
|
||||
and probably just as fast.
|
||||
and probably just as fast.
|
||||
Note that we use i2c_adapter here, because you do not need a specific
|
||||
smbus adapter to call this function. */
|
||||
extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr,
|
||||
extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr,
|
||||
unsigned short flags,
|
||||
char read_write, u8 command, int size,
|
||||
union i2c_smbus_data * data);
|
||||
|
|
@ -112,14 +112,14 @@ struct i2c_driver {
|
|||
|
||||
/* Notifies the driver that a new bus has appeared. This routine
|
||||
* can be used by the driver to test if the bus meets its conditions
|
||||
* & seek for the presence of the chip(s) it supports. If found, it
|
||||
* & seek for the presence of the chip(s) it supports. If found, it
|
||||
* registers the client(s) that are on the bus to the i2c admin. via
|
||||
* i2c_attach_client.
|
||||
*/
|
||||
int (*attach_adapter)(struct i2c_adapter *);
|
||||
int (*detach_adapter)(struct i2c_adapter *);
|
||||
|
||||
/* tells the driver that a client is about to be deleted & gives it
|
||||
/* tells the driver that a client is about to be deleted & gives it
|
||||
* the chance to remove its private data. Also, if the client struct
|
||||
* has been dynamically allocated by the driver in the function above,
|
||||
* it must be freed here.
|
||||
|
|
@ -139,13 +139,13 @@ struct i2c_driver {
|
|||
#define I2C_NAME_SIZE 50
|
||||
|
||||
/*
|
||||
* i2c_client identifies a single device (i.e. chip) that is connected to an
|
||||
* i2c_client identifies a single device (i.e. chip) that is connected to an
|
||||
* i2c bus. The behaviour is defined by the routines of the driver. This
|
||||
* function is mainly used for lookup & other admin. functions.
|
||||
*/
|
||||
struct i2c_client {
|
||||
unsigned int flags; /* div., see below */
|
||||
unsigned short addr; /* chip address - NOTE: 7bit */
|
||||
unsigned short addr; /* chip address - NOTE: 7bit */
|
||||
/* addresses are stored in the */
|
||||
/* _LOWER_ 7 bits */
|
||||
struct i2c_adapter *adapter; /* the adapter we sit on */
|
||||
|
|
@ -182,14 +182,14 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
|
|||
*/
|
||||
struct i2c_algorithm {
|
||||
/* If an adapter algorithm can't do I2C-level access, set master_xfer
|
||||
to NULL. If an adapter algorithm can do SMBus access, set
|
||||
to NULL. If an adapter algorithm can do SMBus access, set
|
||||
smbus_xfer. If set to NULL, the SMBus protocol is simulated
|
||||
using common I2C messages */
|
||||
/* master_xfer should return the number of messages successfully
|
||||
processed, or a negative value on error */
|
||||
int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
|
||||
int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
|
||||
int num);
|
||||
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
|
||||
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
|
||||
unsigned short flags, char read_write,
|
||||
u8 command, int size, union i2c_smbus_data * data);
|
||||
|
||||
|
|
@ -216,6 +216,7 @@ struct i2c_adapter {
|
|||
int (*client_unregister)(struct i2c_client *);
|
||||
|
||||
/* data fields that are valid for all devices */
|
||||
u8 level; /* nesting level for lockdep */
|
||||
struct mutex bus_lock;
|
||||
struct mutex clist_lock;
|
||||
|
||||
|
|
@ -316,7 +317,7 @@ extern int i2c_check_addr (struct i2c_adapter *adapter, int addr);
|
|||
* It will only call found_proc if some client is connected at the
|
||||
* specific address (unless a 'force' matched);
|
||||
*/
|
||||
extern int i2c_probe(struct i2c_adapter *adapter,
|
||||
extern int i2c_probe(struct i2c_adapter *adapter,
|
||||
struct i2c_client_address_data *address_data,
|
||||
int (*found_proc) (struct i2c_adapter *, int, int));
|
||||
|
||||
|
|
@ -352,15 +353,15 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
|
|||
*/
|
||||
struct i2c_msg {
|
||||
__u16 addr; /* slave address */
|
||||
__u16 flags;
|
||||
__u16 flags;
|
||||
#define I2C_M_TEN 0x10 /* we have a ten bit chip address */
|
||||
#define I2C_M_RD 0x01
|
||||
#define I2C_M_NOSTART 0x4000
|
||||
#define I2C_M_REV_DIR_ADDR 0x2000
|
||||
#define I2C_M_IGNORE_NAK 0x1000
|
||||
#define I2C_M_NO_RD_ACK 0x0800
|
||||
__u16 len; /* msg length */
|
||||
__u8 *buf; /* pointer to msg data */
|
||||
__u16 len; /* msg length */
|
||||
__u8 *buf; /* pointer to msg data */
|
||||
};
|
||||
|
||||
/* To determine what functionality is present */
|
||||
|
|
@ -370,16 +371,16 @@ struct i2c_msg {
|
|||
#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
|
||||
#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
|
||||
#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
|
||||
#define I2C_FUNC_SMBUS_QUICK 0x00010000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
|
||||
#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
|
||||
#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
|
||||
#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
|
||||
#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
|
||||
#define I2C_FUNC_SMBUS_QUICK 0x00010000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
|
||||
#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
|
||||
#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
|
||||
#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
|
||||
#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
|
||||
#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
|
||||
#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
|
||||
#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
|
||||
|
|
@ -406,10 +407,10 @@ struct i2c_msg {
|
|||
I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
|
||||
I2C_FUNC_SMBUS_I2C_BLOCK)
|
||||
|
||||
/*
|
||||
* Data for SMBus Messages
|
||||
/*
|
||||
* Data for SMBus Messages
|
||||
*/
|
||||
#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
|
||||
#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
|
||||
union i2c_smbus_data {
|
||||
__u8 byte;
|
||||
__u16 word;
|
||||
|
|
@ -421,11 +422,11 @@ union i2c_smbus_data {
|
|||
#define I2C_SMBUS_READ 1
|
||||
#define I2C_SMBUS_WRITE 0
|
||||
|
||||
/* SMBus transaction types (size parameter in the above functions)
|
||||
/* SMBus transaction types (size parameter in the above functions)
|
||||
Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
|
||||
#define I2C_SMBUS_QUICK 0
|
||||
#define I2C_SMBUS_BYTE 1
|
||||
#define I2C_SMBUS_BYTE_DATA 2
|
||||
#define I2C_SMBUS_BYTE_DATA 2
|
||||
#define I2C_SMBUS_WORD_DATA 3
|
||||
#define I2C_SMBUS_PROC_CALL 4
|
||||
#define I2C_SMBUS_BLOCK_DATA 5
|
||||
|
|
@ -434,15 +435,15 @@ union i2c_smbus_data {
|
|||
|
||||
|
||||
/* ----- commands for the ioctl like i2c_command call:
|
||||
* note that additional calls are defined in the algorithm and hw
|
||||
* dependent layers - these can be listed here, or see the
|
||||
* note that additional calls are defined in the algorithm and hw
|
||||
* dependent layers - these can be listed here, or see the
|
||||
* corresponding header files.
|
||||
*/
|
||||
/* -> bit-adapter specific ioctls */
|
||||
#define I2C_RETRIES 0x0701 /* number of times a device address */
|
||||
/* should be polled when not */
|
||||
/* acknowledging */
|
||||
#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */
|
||||
/* acknowledging */
|
||||
#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */
|
||||
|
||||
|
||||
/* this is for i2c-dev.c */
|
||||
|
|
|
|||
|
|
@ -24,12 +24,13 @@
|
|||
#define MAX_I2O_CONTROLLERS 32
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* I2O Control IOCTLs and structures
|
||||
*/
|
||||
#define I2O_MAGIC_NUMBER 'i'
|
||||
#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS])
|
||||
#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
|
||||
#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
|
||||
#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
|
||||
#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
|
||||
|
|
@ -37,7 +38,7 @@
|
|||
#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
|
||||
#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
|
||||
#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
|
||||
#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32)
|
||||
#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
|
||||
#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
|
||||
#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
|
||||
#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
#include <linux/device.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/completion.h>
|
||||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
#include <acpi/acpi.h>
|
||||
#endif
|
||||
#include <asm/byteorder.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/io.h>
|
||||
|
|
@ -541,6 +544,11 @@ typedef enum {
|
|||
struct ide_driver_s;
|
||||
struct ide_settings_s;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
struct ide_acpi_drive_link;
|
||||
struct ide_acpi_hwif_link;
|
||||
#endif
|
||||
|
||||
typedef struct ide_drive_s {
|
||||
char name[4]; /* drive name, such as "hda" */
|
||||
char driver_req[10]; /* requests specific driver */
|
||||
|
|
@ -637,6 +645,9 @@ typedef struct ide_drive_s {
|
|||
|
||||
int lun; /* logical unit */
|
||||
int crc_count; /* crc counter to reduce drive speed */
|
||||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
struct ide_acpi_drive_link *acpidata;
|
||||
#endif
|
||||
struct list_head list;
|
||||
struct device gendev;
|
||||
struct completion gendev_rel_comp; /* to deal with device release() */
|
||||
|
|
@ -796,6 +807,7 @@ typedef struct hwif_s {
|
|||
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
|
||||
unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
|
||||
unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
|
||||
unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */
|
||||
|
||||
struct device gendev;
|
||||
struct completion gendev_rel_comp; /* To deal with device release() */
|
||||
|
|
@ -804,7 +816,9 @@ typedef struct hwif_s {
|
|||
|
||||
unsigned dma;
|
||||
|
||||
void (*led_act)(void *data, int rw);
|
||||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
struct ide_acpi_hwif_link *acpidata;
|
||||
#endif
|
||||
} ____cacheline_internodealigned_in_smp ide_hwif_t;
|
||||
|
||||
/*
|
||||
|
|
@ -1193,8 +1207,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
|
|||
extern int ideprobe_init(void);
|
||||
|
||||
extern void ide_scan_pcibus(int scan_direction) __init;
|
||||
extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner);
|
||||
#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
|
||||
extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name);
|
||||
#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME)
|
||||
void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
|
||||
extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
|
||||
|
||||
|
|
@ -1299,6 +1313,18 @@ static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
|
|||
static inline void ide_release_dma(ide_hwif_t *drive) {;}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IDEACPI
|
||||
extern int ide_acpi_exec_tfs(ide_drive_t *drive);
|
||||
extern void ide_acpi_get_timing(ide_hwif_t *hwif);
|
||||
extern void ide_acpi_push_timing(ide_hwif_t *hwif);
|
||||
extern void ide_acpi_init(ide_hwif_t *hwif);
|
||||
#else
|
||||
static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
|
||||
static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
|
||||
static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
|
||||
static inline void ide_acpi_init(ide_hwif_t *hwif) { ; }
|
||||
#endif
|
||||
|
||||
extern int ide_hwif_request_regions(ide_hwif_t *hwif);
|
||||
extern void ide_hwif_release_regions(ide_hwif_t* hwif);
|
||||
extern void ide_unregister (unsigned int index);
|
||||
|
|
|
|||
|
|
@ -52,4 +52,10 @@ struct ifa_cacheinfo
|
|||
__u32 tstamp; /* updated timestamp, hundredths of seconds */
|
||||
};
|
||||
|
||||
/* backwards compatibility for userspace */
|
||||
#ifndef __KERNEL__
|
||||
#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
|
||||
#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ struct fddihdr
|
|||
} __attribute__ ((packed));
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
/* Define FDDI statistics structure */
|
||||
struct fddi_statistics {
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,12 @@ enum
|
|||
|
||||
#define IFLA_MAX (__IFLA_MAX - 1)
|
||||
|
||||
/* backwards compatibility for userspace */
|
||||
#ifndef __KERNEL__
|
||||
#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
|
||||
#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
|
||||
#endif
|
||||
|
||||
/* ifi_flags.
|
||||
|
||||
IFF_* flags.
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ struct sockaddr_ll
|
|||
#define PACKET_RX_RING 5
|
||||
#define PACKET_STATISTICS 6
|
||||
#define PACKET_COPY_THRESH 7
|
||||
#define PACKET_AUXDATA 8
|
||||
|
||||
struct tpacket_stats
|
||||
{
|
||||
|
|
@ -48,6 +49,15 @@ struct tpacket_stats
|
|||
unsigned int tp_drops;
|
||||
};
|
||||
|
||||
struct tpacket_auxdata
|
||||
{
|
||||
__u32 tp_status;
|
||||
__u32 tp_len;
|
||||
__u32 tp_snaplen;
|
||||
__u16 tp_mac;
|
||||
__u16 tp_net;
|
||||
};
|
||||
|
||||
struct tpacket_hdr
|
||||
{
|
||||
unsigned long tp_status;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _IF_TUNNEL_H_
|
||||
#define _IF_TUNNEL_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
|
||||
#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
|
||||
#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ extern void setup_arch(char **);
|
|||
#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s)
|
||||
#define fs_initcall(fn) __define_initcall("5",fn,5)
|
||||
#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s)
|
||||
#define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs)
|
||||
#define device_initcall(fn) __define_initcall("6",fn,6)
|
||||
#define device_initcall_sync(fn) __define_initcall("6s",fn,6s)
|
||||
#define late_initcall(fn) __define_initcall("7",fn,7)
|
||||
|
|
|
|||
|
|
@ -7,16 +7,15 @@
|
|||
#include <linux/utsname.h>
|
||||
#include <linux/lockdep.h>
|
||||
#include <linux/ipc.h>
|
||||
#include <linux/pid_namespace.h>
|
||||
|
||||
#define INIT_FDTABLE \
|
||||
{ \
|
||||
.max_fds = NR_OPEN_DEFAULT, \
|
||||
.max_fdset = EMBEDDED_FD_SET_SIZE, \
|
||||
.fd = &init_files.fd_array[0], \
|
||||
.close_on_exec = (fd_set *)&init_files.close_on_exec_init, \
|
||||
.open_fds = (fd_set *)&init_files.open_fds_init, \
|
||||
.rcu = RCU_HEAD_INIT, \
|
||||
.free_files = NULL, \
|
||||
.next = NULL, \
|
||||
}
|
||||
|
||||
|
|
@ -57,25 +56,27 @@
|
|||
.cpu_vm_mask = CPU_MASK_ALL, \
|
||||
}
|
||||
|
||||
#define INIT_SIGNALS(sig) { \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
#define INIT_SIGNALS(sig) { \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
|
||||
.shared_pending = { \
|
||||
.shared_pending = { \
|
||||
.list = LIST_HEAD_INIT(sig.shared_pending.list), \
|
||||
.signal = {{0}}}, \
|
||||
.signal = {{0}}}, \
|
||||
.posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
|
||||
.cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
|
||||
.rlim = INIT_RLIMITS, \
|
||||
.pgrp = 1, \
|
||||
.session = 1, \
|
||||
.tty_old_pgrp = 0, \
|
||||
{ .__session = 1}, \
|
||||
}
|
||||
|
||||
extern struct nsproxy init_nsproxy;
|
||||
#define INIT_NSPROXY(nsproxy) { \
|
||||
.pid_ns = &init_pid_ns, \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \
|
||||
.uts_ns = &init_uts_ns, \
|
||||
.namespace = NULL, \
|
||||
.mnt_ns = NULL, \
|
||||
INIT_IPC_NS(ipc_ns) \
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -491,6 +491,21 @@ struct input_absinfo {
|
|||
#define KEY_DIGITS 0x19d
|
||||
#define KEY_TEEN 0x19e
|
||||
#define KEY_TWEN 0x19f
|
||||
#define KEY_VIDEOPHONE 0x1a0
|
||||
#define KEY_GAMES 0x1a1
|
||||
#define KEY_ZOOMIN 0x1a2
|
||||
#define KEY_ZOOMOUT 0x1a3
|
||||
#define KEY_ZOOMRESET 0x1a4
|
||||
#define KEY_WORDPROCESSOR 0x1a5
|
||||
#define KEY_EDITOR 0x1a6
|
||||
#define KEY_SPREADSHEET 0x1a7
|
||||
#define KEY_GRAPHICSEDITOR 0x1a8
|
||||
#define KEY_PRESENTATION 0x1a9
|
||||
#define KEY_DATABASE 0x1aa
|
||||
#define KEY_NEWS 0x1ab
|
||||
#define KEY_VOICEMAIL 0x1ac
|
||||
#define KEY_ADDRESSBOOK 0x1ad
|
||||
#define KEY_MESSENGER 0x1ae
|
||||
|
||||
#define KEY_DEL_EOL 0x1c0
|
||||
#define KEY_DEL_EOS 0x1c1
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/irqflags.h>
|
||||
#include <linux/bottom_half.h>
|
||||
#include <linux/device.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/system.h>
|
||||
|
|
@ -83,6 +84,11 @@ extern int request_irq(unsigned int, irq_handler_t handler,
|
|||
unsigned long, const char *, void *);
|
||||
extern void free_irq(unsigned int, void *);
|
||||
|
||||
extern int devm_request_irq(struct device *dev, unsigned int irq,
|
||||
irq_handler_t handler, unsigned long irqflags,
|
||||
const char *devname, void *dev_id);
|
||||
extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
|
||||
|
||||
/*
|
||||
* On lockdep we dont want to enable hardirqs in hardirq
|
||||
* context. Use local_irq_enable_in_hardirq() to annotate
|
||||
|
|
@ -231,7 +237,8 @@ enum
|
|||
NET_TX_SOFTIRQ,
|
||||
NET_RX_SOFTIRQ,
|
||||
BLOCK_SOFTIRQ,
|
||||
TASKLET_SOFTIRQ
|
||||
TASKLET_SOFTIRQ,
|
||||
SCHED_SOFTIRQ,
|
||||
};
|
||||
|
||||
/* softirq mask and active fields moved to irq_cpustat_t in
|
||||
|
|
|
|||
|
|
@ -22,12 +22,33 @@
|
|||
#include <asm/io.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
struct device;
|
||||
|
||||
void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
|
||||
void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
|
||||
|
||||
int ioremap_page_range(unsigned long addr, unsigned long end,
|
||||
unsigned long phys_addr, pgprot_t prot);
|
||||
|
||||
/*
|
||||
* Managed iomap interface
|
||||
*/
|
||||
void __iomem * devm_ioport_map(struct device *dev, unsigned long port,
|
||||
unsigned int nr);
|
||||
void devm_ioport_unmap(struct device *dev, void __iomem *addr);
|
||||
|
||||
void __iomem * devm_ioremap(struct device *dev, unsigned long offset,
|
||||
unsigned long size);
|
||||
void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset,
|
||||
unsigned long size);
|
||||
void devm_iounmap(struct device *dev, void __iomem *addr);
|
||||
|
||||
void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
|
||||
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
|
||||
void __iomem * const * pcim_iomap_table(struct pci_dev *pdev);
|
||||
|
||||
int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name);
|
||||
|
||||
/**
|
||||
* check_signature - find BIOS signatures
|
||||
* @io_addr: mmio address to check
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ struct resource_list {
|
|||
#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */
|
||||
#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */
|
||||
|
||||
/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
|
||||
#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
|
||||
|
||||
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
|
||||
extern struct resource ioport_resource;
|
||||
extern struct resource iomem_resource;
|
||||
|
|
@ -134,4 +137,24 @@ static inline int __deprecated check_region(resource_size_t s,
|
|||
{
|
||||
return __check_region(&ioport_resource, s, n);
|
||||
}
|
||||
|
||||
/* Wrappers for managed devices */
|
||||
struct device;
|
||||
#define devm_request_region(dev,start,n,name) \
|
||||
__devm_request_region(dev, &ioport_resource, (start), (n), (name))
|
||||
#define devm_request_mem_region(dev,start,n,name) \
|
||||
__devm_request_region(dev, &iomem_resource, (start), (n), (name))
|
||||
|
||||
extern struct resource * __devm_request_region(struct device *dev,
|
||||
struct resource *parent, resource_size_t start,
|
||||
resource_size_t n, const char *name);
|
||||
|
||||
#define devm_release_region(start,n) \
|
||||
__devm_release_region(dev, &ioport_resource, (start), (n))
|
||||
#define devm_release_mem_region(start,n) \
|
||||
__devm_release_region(dev, &iomem_resource, (start), (n))
|
||||
|
||||
extern void __devm_release_region(struct device *dev, struct resource *parent,
|
||||
resource_size_t start, resource_size_t n);
|
||||
|
||||
#endif /* _LINUX_IOPORT_H */
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ typedef void fastcall (*irq_flow_handler_t)(unsigned int irq,
|
|||
#define IRQ_MOVE_PENDING 0x40000000 /* need to re-target IRQ destination */
|
||||
|
||||
struct proc_dir_entry;
|
||||
struct msi_desc;
|
||||
|
||||
/**
|
||||
* struct irq_chip - hardware interrupt chip descriptor
|
||||
|
|
@ -148,6 +149,7 @@ struct irq_chip {
|
|||
struct irq_desc {
|
||||
irq_flow_handler_t handle_irq;
|
||||
struct irq_chip *chip;
|
||||
struct msi_desc *msi_desc;
|
||||
void *handler_data;
|
||||
void *chip_data;
|
||||
struct irqaction *action; /* IRQ action list */
|
||||
|
|
@ -373,10 +375,12 @@ extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
|
|||
extern int set_irq_data(unsigned int irq, void *data);
|
||||
extern int set_irq_chip_data(unsigned int irq, void *data);
|
||||
extern int set_irq_type(unsigned int irq, unsigned int type);
|
||||
extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
|
||||
|
||||
#define get_irq_chip(irq) (irq_desc[irq].chip)
|
||||
#define get_irq_chip_data(irq) (irq_desc[irq].chip_data)
|
||||
#define get_irq_data(irq) (irq_desc[irq].handler_data)
|
||||
#define get_irq_msi(irq) (irq_desc[irq].msi_desc)
|
||||
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
|
|
|
|||
|
|
@ -511,8 +511,8 @@ typedef struct modem_info {
|
|||
#endif
|
||||
struct tty_struct *tty; /* Pointer to corresponding tty */
|
||||
atemu emu; /* AT-emulator data */
|
||||
struct termios normal_termios; /* For saving termios structs */
|
||||
struct termios callout_termios;
|
||||
struct ktermios normal_termios; /* For saving termios structs */
|
||||
struct ktermios callout_termios;
|
||||
wait_queue_head_t open_wait, close_wait;
|
||||
struct semaphore write_sem;
|
||||
spinlock_t readlock;
|
||||
|
|
@ -525,8 +525,8 @@ typedef struct _isdn_modem {
|
|||
int refcount; /* Number of opens */
|
||||
struct tty_driver *tty_modem; /* tty-device */
|
||||
struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
|
||||
struct termios *modem_termios[ISDN_MAX_CHANNELS];
|
||||
struct termios *modem_termios_locked[ISDN_MAX_CHANNELS];
|
||||
struct ktermios *modem_termios[ISDN_MAX_CHANNELS];
|
||||
struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS];
|
||||
modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
|
||||
} isdn_modem_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@
|
|||
* communication with the slave board will always be on a per port
|
||||
* basis.
|
||||
*/
|
||||
typedef struct {
|
||||
struct stliport {
|
||||
unsigned long magic;
|
||||
int portnr;
|
||||
int panelnr;
|
||||
int brdnr;
|
||||
unsigned int portnr;
|
||||
unsigned int panelnr;
|
||||
unsigned int brdnr;
|
||||
unsigned long state;
|
||||
int devnr;
|
||||
unsigned int devnr;
|
||||
int flags;
|
||||
int baud_base;
|
||||
int custom_divisor;
|
||||
|
|
@ -72,7 +72,7 @@ typedef struct {
|
|||
wait_queue_head_t close_wait;
|
||||
wait_queue_head_t raw_wait;
|
||||
struct work_struct tqhangup;
|
||||
asysigs_t asig;
|
||||
struct asysigs asig;
|
||||
unsigned long addr;
|
||||
unsigned long rxoffset;
|
||||
unsigned long txoffset;
|
||||
|
|
@ -83,31 +83,31 @@ typedef struct {
|
|||
unsigned char reqbit;
|
||||
unsigned char portidx;
|
||||
unsigned char portbit;
|
||||
} stliport_t;
|
||||
};
|
||||
|
||||
/*
|
||||
* Use a structure of function pointers to do board level operations.
|
||||
* These include, enable/disable, paging shared memory, interrupting, etc.
|
||||
*/
|
||||
typedef struct stlibrd {
|
||||
struct stlibrd {
|
||||
unsigned long magic;
|
||||
int brdnr;
|
||||
int brdtype;
|
||||
int state;
|
||||
int nrpanels;
|
||||
int nrports;
|
||||
int nrdevs;
|
||||
unsigned int brdnr;
|
||||
unsigned int brdtype;
|
||||
unsigned int state;
|
||||
unsigned int nrpanels;
|
||||
unsigned int nrports;
|
||||
unsigned int nrdevs;
|
||||
unsigned int iobase;
|
||||
int iosize;
|
||||
unsigned long memaddr;
|
||||
void __iomem *membase;
|
||||
int memsize;
|
||||
unsigned long memsize;
|
||||
int pagesize;
|
||||
int hostoffset;
|
||||
int slaveoffset;
|
||||
int bitsize;
|
||||
int enabval;
|
||||
int panels[STL_MAXPANELS];
|
||||
unsigned int panels[STL_MAXPANELS];
|
||||
int panelids[STL_MAXPANELS];
|
||||
void (*init)(struct stlibrd *brdp);
|
||||
void (*enable)(struct stlibrd *brdp);
|
||||
|
|
@ -116,8 +116,8 @@ typedef struct stlibrd {
|
|||
void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
|
||||
void (*intr)(struct stlibrd *brdp);
|
||||
void (*reset)(struct stlibrd *brdp);
|
||||
stliport_t *ports[STL_MAXPORTS];
|
||||
} stlibrd_t;
|
||||
struct stliport *ports[STL_MAXPORTS];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -13,10 +13,12 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/log2.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <asm/bug.h>
|
||||
|
||||
extern const char linux_banner[];
|
||||
extern const char linux_proc_banner[];
|
||||
|
||||
#define INT_MAX ((int)(~0U>>1))
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
|
|
@ -157,20 +159,6 @@ static inline int printk(const char *s, ...) { return 0; }
|
|||
|
||||
unsigned long int_sqrt(unsigned long);
|
||||
|
||||
static inline int __attribute_pure__ long_log2(unsigned long x)
|
||||
{
|
||||
int r = 0;
|
||||
for (x >>= 1; x > 0; x >>= 1)
|
||||
r++;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__attribute_const__ roundup_pow_of_two(unsigned long x)
|
||||
{
|
||||
return 1UL << fls_long(x - 1);
|
||||
}
|
||||
|
||||
extern int printk_ratelimit(void);
|
||||
extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
|
||||
extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
|
||||
|
|
|
|||
|
|
@ -74,9 +74,13 @@ extern void kobject_init(struct kobject *);
|
|||
extern void kobject_cleanup(struct kobject *);
|
||||
|
||||
extern int __must_check kobject_add(struct kobject *);
|
||||
extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *);
|
||||
extern void kobject_del(struct kobject *);
|
||||
|
||||
extern int __must_check kobject_rename(struct kobject *, const char *new_name);
|
||||
extern int __must_check kobject_shadow_rename(struct kobject *kobj,
|
||||
struct dentry *new_parent,
|
||||
const char *new_name);
|
||||
extern int __must_check kobject_move(struct kobject *, struct kobject *);
|
||||
|
||||
extern int __must_check kobject_register(struct kobject *);
|
||||
|
|
@ -265,8 +269,8 @@ extern int __must_check subsys_create_file(struct subsystem * ,
|
|||
struct subsys_attribute *);
|
||||
|
||||
#if defined(CONFIG_HOTPLUG)
|
||||
void kobject_uevent(struct kobject *kobj, enum kobject_action action);
|
||||
void kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
|
||||
int kobject_uevent(struct kobject *kobj, enum kobject_action action);
|
||||
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
|
||||
char *envp[]);
|
||||
|
||||
int add_uevent_var(char **envp, int num_envp, int *cur_index,
|
||||
|
|
@ -274,11 +278,12 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index,
|
|||
const char *format, ...)
|
||||
__attribute__((format (printf, 7, 8)));
|
||||
#else
|
||||
static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { }
|
||||
static inline void kobject_uevent_env(struct kobject *kobj,
|
||||
static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action)
|
||||
{ return 0; }
|
||||
static inline int kobject_uevent_env(struct kobject *kobj,
|
||||
enum kobject_action action,
|
||||
char *envp[])
|
||||
{ }
|
||||
{ return 0; }
|
||||
|
||||
static inline int add_uevent_var(char **envp, int num_envp, int *cur_index,
|
||||
char *buffer, int buffer_size, int *cur_len,
|
||||
|
|
|
|||
240
include/linux/kvm.h
Normal file
240
include/linux/kvm.h
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
#ifndef __LINUX_KVM_H
|
||||
#define __LINUX_KVM_H
|
||||
|
||||
/*
|
||||
* Userspace interface for /dev/kvm - kernel based virtual machine
|
||||
*
|
||||
* Note: this interface is considered experimental and may change without
|
||||
* notice.
|
||||
*/
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define KVM_API_VERSION 2
|
||||
|
||||
/*
|
||||
* Architectural interrupt line count, and the size of the bitmap needed
|
||||
* to hold them.
|
||||
*/
|
||||
#define KVM_NR_INTERRUPTS 256
|
||||
#define KVM_IRQ_BITMAP_SIZE_BYTES ((KVM_NR_INTERRUPTS + 7) / 8)
|
||||
#define KVM_IRQ_BITMAP_SIZE(type) (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type))
|
||||
|
||||
|
||||
/* for KVM_CREATE_MEMORY_REGION */
|
||||
struct kvm_memory_region {
|
||||
__u32 slot;
|
||||
__u32 flags;
|
||||
__u64 guest_phys_addr;
|
||||
__u64 memory_size; /* bytes */
|
||||
};
|
||||
|
||||
/* for kvm_memory_region::flags */
|
||||
#define KVM_MEM_LOG_DIRTY_PAGES 1UL
|
||||
|
||||
|
||||
#define KVM_EXIT_TYPE_FAIL_ENTRY 1
|
||||
#define KVM_EXIT_TYPE_VM_EXIT 2
|
||||
|
||||
enum kvm_exit_reason {
|
||||
KVM_EXIT_UNKNOWN = 0,
|
||||
KVM_EXIT_EXCEPTION = 1,
|
||||
KVM_EXIT_IO = 2,
|
||||
KVM_EXIT_CPUID = 3,
|
||||
KVM_EXIT_DEBUG = 4,
|
||||
KVM_EXIT_HLT = 5,
|
||||
KVM_EXIT_MMIO = 6,
|
||||
KVM_EXIT_IRQ_WINDOW_OPEN = 7,
|
||||
KVM_EXIT_SHUTDOWN = 8,
|
||||
};
|
||||
|
||||
/* for KVM_RUN */
|
||||
struct kvm_run {
|
||||
/* in */
|
||||
__u32 vcpu;
|
||||
__u32 emulated; /* skip current instruction */
|
||||
__u32 mmio_completed; /* mmio request completed */
|
||||
__u8 request_interrupt_window;
|
||||
__u8 padding1[3];
|
||||
|
||||
/* out */
|
||||
__u32 exit_type;
|
||||
__u32 exit_reason;
|
||||
__u32 instruction_length;
|
||||
__u8 ready_for_interrupt_injection;
|
||||
__u8 if_flag;
|
||||
__u16 padding2;
|
||||
__u64 cr8;
|
||||
__u64 apic_base;
|
||||
|
||||
union {
|
||||
/* KVM_EXIT_UNKNOWN */
|
||||
struct {
|
||||
__u32 hardware_exit_reason;
|
||||
} hw;
|
||||
/* KVM_EXIT_EXCEPTION */
|
||||
struct {
|
||||
__u32 exception;
|
||||
__u32 error_code;
|
||||
} ex;
|
||||
/* KVM_EXIT_IO */
|
||||
struct {
|
||||
#define KVM_EXIT_IO_IN 0
|
||||
#define KVM_EXIT_IO_OUT 1
|
||||
__u8 direction;
|
||||
__u8 size; /* bytes */
|
||||
__u8 string;
|
||||
__u8 string_down;
|
||||
__u8 rep;
|
||||
__u8 pad;
|
||||
__u16 port;
|
||||
__u64 count;
|
||||
union {
|
||||
__u64 address;
|
||||
__u32 value;
|
||||
};
|
||||
} io;
|
||||
struct {
|
||||
} debug;
|
||||
/* KVM_EXIT_MMIO */
|
||||
struct {
|
||||
__u64 phys_addr;
|
||||
__u8 data[8];
|
||||
__u32 len;
|
||||
__u8 is_write;
|
||||
} mmio;
|
||||
};
|
||||
};
|
||||
|
||||
/* for KVM_GET_REGS and KVM_SET_REGS */
|
||||
struct kvm_regs {
|
||||
/* in */
|
||||
__u32 vcpu;
|
||||
__u32 padding;
|
||||
|
||||
/* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
|
||||
__u64 rax, rbx, rcx, rdx;
|
||||
__u64 rsi, rdi, rsp, rbp;
|
||||
__u64 r8, r9, r10, r11;
|
||||
__u64 r12, r13, r14, r15;
|
||||
__u64 rip, rflags;
|
||||
};
|
||||
|
||||
struct kvm_segment {
|
||||
__u64 base;
|
||||
__u32 limit;
|
||||
__u16 selector;
|
||||
__u8 type;
|
||||
__u8 present, dpl, db, s, l, g, avl;
|
||||
__u8 unusable;
|
||||
__u8 padding;
|
||||
};
|
||||
|
||||
struct kvm_dtable {
|
||||
__u64 base;
|
||||
__u16 limit;
|
||||
__u16 padding[3];
|
||||
};
|
||||
|
||||
/* for KVM_GET_SREGS and KVM_SET_SREGS */
|
||||
struct kvm_sregs {
|
||||
/* in */
|
||||
__u32 vcpu;
|
||||
__u32 padding;
|
||||
|
||||
/* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
|
||||
struct kvm_segment cs, ds, es, fs, gs, ss;
|
||||
struct kvm_segment tr, ldt;
|
||||
struct kvm_dtable gdt, idt;
|
||||
__u64 cr0, cr2, cr3, cr4, cr8;
|
||||
__u64 efer;
|
||||
__u64 apic_base;
|
||||
__u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
|
||||
};
|
||||
|
||||
struct kvm_msr_entry {
|
||||
__u32 index;
|
||||
__u32 reserved;
|
||||
__u64 data;
|
||||
};
|
||||
|
||||
/* for KVM_GET_MSRS and KVM_SET_MSRS */
|
||||
struct kvm_msrs {
|
||||
__u32 vcpu;
|
||||
__u32 nmsrs; /* number of msrs in entries */
|
||||
|
||||
struct kvm_msr_entry entries[0];
|
||||
};
|
||||
|
||||
/* for KVM_GET_MSR_INDEX_LIST */
|
||||
struct kvm_msr_list {
|
||||
__u32 nmsrs; /* number of msrs in entries */
|
||||
__u32 indices[0];
|
||||
};
|
||||
|
||||
/* for KVM_TRANSLATE */
|
||||
struct kvm_translation {
|
||||
/* in */
|
||||
__u64 linear_address;
|
||||
__u32 vcpu;
|
||||
__u32 padding;
|
||||
|
||||
/* out */
|
||||
__u64 physical_address;
|
||||
__u8 valid;
|
||||
__u8 writeable;
|
||||
__u8 usermode;
|
||||
};
|
||||
|
||||
/* for KVM_INTERRUPT */
|
||||
struct kvm_interrupt {
|
||||
/* in */
|
||||
__u32 vcpu;
|
||||
__u32 irq;
|
||||
};
|
||||
|
||||
struct kvm_breakpoint {
|
||||
__u32 enabled;
|
||||
__u32 padding;
|
||||
__u64 address;
|
||||
};
|
||||
|
||||
/* for KVM_DEBUG_GUEST */
|
||||
struct kvm_debug_guest {
|
||||
/* int */
|
||||
__u32 vcpu;
|
||||
__u32 enabled;
|
||||
struct kvm_breakpoint breakpoints[4];
|
||||
__u32 singlestep;
|
||||
};
|
||||
|
||||
/* for KVM_GET_DIRTY_LOG */
|
||||
struct kvm_dirty_log {
|
||||
__u32 slot;
|
||||
__u32 padding;
|
||||
union {
|
||||
void __user *dirty_bitmap; /* one bit per page */
|
||||
__u64 padding;
|
||||
};
|
||||
};
|
||||
|
||||
#define KVMIO 0xAE
|
||||
|
||||
#define KVM_GET_API_VERSION _IO(KVMIO, 1)
|
||||
#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run)
|
||||
#define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs)
|
||||
#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs)
|
||||
#define KVM_GET_SREGS _IOWR(KVMIO, 5, struct kvm_sregs)
|
||||
#define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs)
|
||||
#define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation)
|
||||
#define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt)
|
||||
#define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest)
|
||||
#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region)
|
||||
#define KVM_CREATE_VCPU _IOW(KVMIO, 11, int /* vcpu_slot */)
|
||||
#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log)
|
||||
#define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs)
|
||||
#define KVM_SET_MSRS _IOWR(KVMIO, 14, struct kvm_msrs)
|
||||
#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list)
|
||||
|
||||
#endif
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <linux/pci.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <asm/scatterlist.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/ata.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <scsi/scsi_host.h>
|
||||
|
|
@ -54,8 +54,6 @@
|
|||
#undef ATA_VERBOSE_DEBUG /* yet more debugging output */
|
||||
#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
|
||||
#undef ATA_NDEBUG /* define to disable quick runtime checks */
|
||||
#define ATA_ENABLE_PATA /* define to enable PATA support in some
|
||||
* low-level drivers */
|
||||
|
||||
|
||||
/* note: prints function name for you */
|
||||
|
|
@ -109,10 +107,6 @@ static inline u32 ata_msg_init(int dval, int default_msg_enable_bits)
|
|||
#define ATA_TAG_POISON 0xfafbfcfdU
|
||||
|
||||
/* move to PCI layer? */
|
||||
#define PCI_VDEVICE(vendor, device) \
|
||||
PCI_VENDOR_ID_##vendor, (device), \
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0
|
||||
|
||||
static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
|
||||
{
|
||||
return &pdev->dev;
|
||||
|
|
@ -177,6 +171,7 @@ enum {
|
|||
* Register FIS clearing BSY */
|
||||
ATA_FLAG_DEBUGMSG = (1 << 13),
|
||||
ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
|
||||
ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
|
||||
|
||||
/* The following flag belongs to ap->pflags but is kept in
|
||||
* ap->flags because it's referenced in many LLDs and will be
|
||||
|
|
@ -307,7 +302,7 @@ enum {
|
|||
* most devices.
|
||||
*/
|
||||
ATA_SPINUP_WAIT = 8000,
|
||||
|
||||
|
||||
/* Horkage types. May be set by libata or controller on drives
|
||||
(some horkage may be drive/controller pair dependant */
|
||||
|
||||
|
|
@ -351,21 +346,21 @@ typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes);
|
|||
typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
|
||||
|
||||
struct ata_ioports {
|
||||
unsigned long cmd_addr;
|
||||
unsigned long data_addr;
|
||||
unsigned long error_addr;
|
||||
unsigned long feature_addr;
|
||||
unsigned long nsect_addr;
|
||||
unsigned long lbal_addr;
|
||||
unsigned long lbam_addr;
|
||||
unsigned long lbah_addr;
|
||||
unsigned long device_addr;
|
||||
unsigned long status_addr;
|
||||
unsigned long command_addr;
|
||||
unsigned long altstatus_addr;
|
||||
unsigned long ctl_addr;
|
||||
unsigned long bmdma_addr;
|
||||
unsigned long scr_addr;
|
||||
void __iomem *cmd_addr;
|
||||
void __iomem *data_addr;
|
||||
void __iomem *error_addr;
|
||||
void __iomem *feature_addr;
|
||||
void __iomem *nsect_addr;
|
||||
void __iomem *lbal_addr;
|
||||
void __iomem *lbam_addr;
|
||||
void __iomem *lbah_addr;
|
||||
void __iomem *device_addr;
|
||||
void __iomem *status_addr;
|
||||
void __iomem *command_addr;
|
||||
void __iomem *altstatus_addr;
|
||||
void __iomem *ctl_addr;
|
||||
void __iomem *bmdma_addr;
|
||||
void __iomem *scr_addr;
|
||||
};
|
||||
|
||||
struct ata_probe_ent {
|
||||
|
|
@ -384,7 +379,7 @@ struct ata_probe_ent {
|
|||
unsigned int irq_flags;
|
||||
unsigned long port_flags;
|
||||
unsigned long _host_flags;
|
||||
void __iomem *mmio_base;
|
||||
void __iomem * const *iomap;
|
||||
void *private_data;
|
||||
|
||||
/* port_info for the secondary port. Together with irq2, it's
|
||||
|
|
@ -401,7 +396,7 @@ struct ata_host {
|
|||
struct device *dev;
|
||||
unsigned long irq;
|
||||
unsigned long irq2;
|
||||
void __iomem *mmio_base;
|
||||
void __iomem * const *iomap;
|
||||
unsigned int n_ports;
|
||||
void *private_data;
|
||||
const struct ata_port_operations *ops;
|
||||
|
|
@ -430,9 +425,6 @@ struct ata_queued_cmd {
|
|||
|
||||
unsigned int pad_len;
|
||||
|
||||
unsigned int nsect;
|
||||
unsigned int cursect;
|
||||
|
||||
unsigned int nbytes;
|
||||
unsigned int curbytes;
|
||||
|
||||
|
|
@ -612,11 +604,11 @@ struct ata_port_operations {
|
|||
void (*dev_select)(struct ata_port *ap, unsigned int device);
|
||||
|
||||
void (*phy_reset) (struct ata_port *ap); /* obsolete */
|
||||
void (*set_mode) (struct ata_port *ap);
|
||||
int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev);
|
||||
|
||||
void (*post_set_mode) (struct ata_port *ap);
|
||||
|
||||
int (*check_atapi_dma) (struct ata_queued_cmd *qc);
|
||||
int (*check_atapi_dma) (struct ata_queued_cmd *qc);
|
||||
|
||||
void (*bmdma_setup) (struct ata_queued_cmd *qc);
|
||||
void (*bmdma_start) (struct ata_queued_cmd *qc);
|
||||
|
|
@ -638,6 +630,8 @@ struct ata_port_operations {
|
|||
|
||||
irq_handler_t irq_handler;
|
||||
void (*irq_clear) (struct ata_port *);
|
||||
u8 (*irq_on) (struct ata_port *);
|
||||
u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
|
||||
|
||||
u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
|
||||
void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
|
||||
|
|
@ -719,20 +713,18 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
|
|||
unsigned int n_ports);
|
||||
extern void ata_pci_remove_one (struct pci_dev *pdev);
|
||||
extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||
extern void ata_pci_device_do_resume(struct pci_dev *pdev);
|
||||
extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
|
||||
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||
extern int ata_pci_device_resume(struct pci_dev *pdev);
|
||||
extern int ata_pci_clear_simplex(struct pci_dev *pdev);
|
||||
#endif /* CONFIG_PCI */
|
||||
extern int ata_device_add(const struct ata_probe_ent *ent);
|
||||
extern void ata_port_detach(struct ata_port *ap);
|
||||
extern void ata_host_detach(struct ata_host *host);
|
||||
extern void ata_host_init(struct ata_host *, struct device *,
|
||||
unsigned long, const struct ata_port_operations *);
|
||||
extern void ata_host_remove(struct ata_host *host);
|
||||
extern int ata_scsi_detect(struct scsi_host_template *sht);
|
||||
extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
|
||||
extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
|
||||
extern int ata_scsi_release(struct Scsi_Host *host);
|
||||
extern void ata_sas_port_destroy(struct ata_port *);
|
||||
extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
|
||||
struct ata_port_info *, struct Scsi_Host *);
|
||||
|
|
@ -775,15 +767,11 @@ extern u8 ata_check_status(struct ata_port *ap);
|
|||
extern u8 ata_altstatus(struct ata_port *ap);
|
||||
extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
|
||||
extern int ata_port_start (struct ata_port *ap);
|
||||
extern void ata_port_stop (struct ata_port *ap);
|
||||
extern void ata_host_stop (struct ata_host *host);
|
||||
extern irqreturn_t ata_interrupt (int irq, void *dev_instance);
|
||||
extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
|
||||
unsigned int buflen, int write_data);
|
||||
extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf,
|
||||
unsigned int buflen, int write_data);
|
||||
extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
|
||||
unsigned int buflen, int write_data);
|
||||
extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
|
||||
unsigned int buflen, int write_data);
|
||||
extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
|
||||
unsigned int buflen, int write_data);
|
||||
extern void ata_qc_prep(struct ata_queued_cmd *qc);
|
||||
extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
|
||||
extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
|
||||
|
|
@ -825,6 +813,10 @@ extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
|
|||
extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
|
||||
int queue_depth);
|
||||
extern struct ata_device *ata_dev_pair(struct ata_device *adev);
|
||||
extern u8 ata_irq_on(struct ata_port *ap);
|
||||
extern u8 ata_dummy_irq_on(struct ata_port *ap);
|
||||
extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq);
|
||||
extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq);
|
||||
|
||||
/*
|
||||
* Timing helpers
|
||||
|
|
@ -863,7 +855,6 @@ struct pci_bits {
|
|||
unsigned long val;
|
||||
};
|
||||
|
||||
extern void ata_pci_host_stop (struct ata_host *host);
|
||||
extern struct ata_probe_ent *
|
||||
ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
|
||||
extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
|
||||
|
|
@ -1053,6 +1044,8 @@ static inline void ata_pause(struct ata_port *ap)
|
|||
/**
|
||||
* ata_busy_wait - Wait for a port status register
|
||||
* @ap: Port to wait for.
|
||||
* @bits: bits that must be clear
|
||||
* @max: number of 10uS waits to perform
|
||||
*
|
||||
* Waits up to max*10 microseconds for the selected bits in the port's
|
||||
* status register to be cleared.
|
||||
|
|
@ -1093,10 +1086,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
|
|||
u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
|
||||
|
||||
if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) {
|
||||
unsigned long l = ap->ioaddr.status_addr;
|
||||
if (ata_msg_warn(ap))
|
||||
printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n",
|
||||
status, l);
|
||||
printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n",
|
||||
status, ap->ioaddr.status_addr);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
@ -1143,12 +1135,14 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
|
|||
|
||||
static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
|
||||
{
|
||||
qc->dma_dir = DMA_NONE;
|
||||
qc->__sg = NULL;
|
||||
qc->flags = 0;
|
||||
qc->cursect = qc->cursg = qc->cursg_ofs = 0;
|
||||
qc->nsect = 0;
|
||||
qc->cursg = qc->cursg_ofs = 0;
|
||||
qc->nbytes = qc->curbytes = 0;
|
||||
qc->n_elem = 0;
|
||||
qc->err_mask = 0;
|
||||
qc->pad_len = 0;
|
||||
|
||||
ata_tf_init(qc->dev, &qc->tf);
|
||||
|
||||
|
|
@ -1157,51 +1151,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
|
|||
qc->result_tf.feature = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ata_irq_ack - Acknowledge a device interrupt.
|
||||
* @ap: Port on which interrupts are enabled.
|
||||
*
|
||||
* Wait up to 10 ms for legacy IDE device to become idle (BUSY
|
||||
* or BUSY+DRQ clear). Obtain dma status and port status from
|
||||
* device. Clear the interrupt. Return port status.
|
||||
*
|
||||
* LOCKING:
|
||||
*/
|
||||
|
||||
static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
|
||||
{
|
||||
unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
|
||||
u8 host_stat, post_stat, status;
|
||||
|
||||
status = ata_busy_wait(ap, bits, 1000);
|
||||
if (status & bits)
|
||||
if (ata_msg_err(ap))
|
||||
printk(KERN_ERR "abnormal status 0x%X\n", status);
|
||||
|
||||
/* get controller status; clear intr, err bits */
|
||||
if (ap->flags & ATA_FLAG_MMIO) {
|
||||
void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
|
||||
host_stat = readb(mmio + ATA_DMA_STATUS);
|
||||
writeb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
|
||||
mmio + ATA_DMA_STATUS);
|
||||
|
||||
post_stat = readb(mmio + ATA_DMA_STATUS);
|
||||
} else {
|
||||
host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
|
||||
outb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
|
||||
ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
|
||||
|
||||
post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
|
||||
}
|
||||
|
||||
if (ata_msg_intr(ap))
|
||||
printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n",
|
||||
__FUNCTION__,
|
||||
host_stat, post_stat, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int ata_try_flush_cache(const struct ata_device *dev)
|
||||
{
|
||||
return ata_id_wcache_enabled(dev->id) ||
|
||||
|
|
@ -1229,14 +1178,14 @@ static inline unsigned int __ac_err_mask(u8 status)
|
|||
static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
|
||||
{
|
||||
ap->pad_dma = 0;
|
||||
ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
|
||||
&ap->pad_dma, GFP_KERNEL);
|
||||
ap->pad = dmam_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
|
||||
&ap->pad_dma, GFP_KERNEL);
|
||||
return (ap->pad == NULL) ? -ENOMEM : 0;
|
||||
}
|
||||
|
||||
static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
|
||||
{
|
||||
dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
|
||||
dmam_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
|
||||
}
|
||||
|
||||
static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
|
||||
|
|
|
|||
|
|
@ -227,13 +227,13 @@ static inline void list_replace_init(struct list_head *old,
|
|||
INIT_LIST_HEAD(old);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* list_replace_rcu - replace old entry by new one
|
||||
* @old : the element to be replaced
|
||||
* @new : the new element to insert
|
||||
*
|
||||
* The old entry will be replaced with the new entry atomically.
|
||||
* Note: 'old' should not be empty.
|
||||
* The @old entry will be replaced with the @new entry atomically.
|
||||
* Note: @old should not be empty.
|
||||
*/
|
||||
static inline void list_replace_rcu(struct list_head *old,
|
||||
struct list_head *new)
|
||||
|
|
@ -680,12 +680,12 @@ static inline void hlist_del_init(struct hlist_node *n)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* hlist_replace_rcu - replace old entry by new one
|
||||
* @old : the element to be replaced
|
||||
* @new : the new element to insert
|
||||
*
|
||||
* The old entry will be replaced with the new entry atomically.
|
||||
* The @old entry will be replaced with the @new entry atomically.
|
||||
*/
|
||||
static inline void hlist_replace_rcu(struct hlist_node *old,
|
||||
struct hlist_node *new)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ struct svc_rqst;
|
|||
* This is the set of functions for lockd->nfsd communication
|
||||
*/
|
||||
struct nlmsvc_binding {
|
||||
u32 (*fopen)(struct svc_rqst *,
|
||||
__be32 (*fopen)(struct svc_rqst *,
|
||||
struct nfs_fh *,
|
||||
struct file **);
|
||||
void (*fclose)(struct file *);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
|
|||
unsigned long nlmsvc_retry_blocked(void);
|
||||
void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
|
||||
nlm_host_match_fn_t match);
|
||||
void nlmsvc_grant_reply(struct nlm_cookie *, u32);
|
||||
void nlmsvc_grant_reply(struct nlm_cookie *, __be32);
|
||||
|
||||
/*
|
||||
* File handling for the server personality
|
||||
|
|
@ -206,7 +206,7 @@ void nlmsvc_invalidate_all(void);
|
|||
static __inline__ struct inode *
|
||||
nlmsvc_file_inode(struct nlm_file *file)
|
||||
{
|
||||
return file->f_file->f_dentry->d_inode;
|
||||
return file->f_file->f_path.dentry->d_inode;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
* Arguments for all calls to statd
|
||||
*/
|
||||
struct nsm_args {
|
||||
u32 addr; /* remote address */
|
||||
__be32 addr; /* remote address */
|
||||
u32 prog; /* RPC callback info */
|
||||
u32 vers;
|
||||
u32 proc;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ typedef struct nlm_args nlm_args;
|
|||
*/
|
||||
struct nlm_res {
|
||||
struct nlm_cookie cookie;
|
||||
u32 status;
|
||||
__be32 status;
|
||||
struct nlm_lock lock;
|
||||
};
|
||||
|
||||
|
|
@ -80,9 +80,9 @@ struct nlm_reboot {
|
|||
char * mon;
|
||||
int len;
|
||||
u32 state;
|
||||
u32 addr;
|
||||
u32 vers;
|
||||
u32 proto;
|
||||
__be32 addr;
|
||||
__be32 vers;
|
||||
__be32 proto;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -281,15 +281,25 @@ struct lock_class_key { };
|
|||
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
|
||||
extern void early_init_irq_lock_class(void);
|
||||
#else
|
||||
# define early_init_irq_lock_class() do { } while (0)
|
||||
static inline void early_init_irq_lock_class(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TRACE_IRQFLAGS
|
||||
extern void early_boot_irqs_off(void);
|
||||
extern void early_boot_irqs_on(void);
|
||||
extern void print_irqtrace_events(struct task_struct *curr);
|
||||
#else
|
||||
# define early_boot_irqs_off() do { } while (0)
|
||||
# define early_boot_irqs_on() do { } while (0)
|
||||
static inline void early_boot_irqs_off(void)
|
||||
{
|
||||
}
|
||||
static inline void early_boot_irqs_on(void)
|
||||
{
|
||||
}
|
||||
static inline void print_irqtrace_events(struct task_struct *curr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
168
include/linux/log2.h
Normal file
168
include/linux/log2.h
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/* Integer base 2 logarithm calculation
|
||||
*
|
||||
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_LOG2_H
|
||||
#define _LINUX_LOG2_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
/*
|
||||
* deal with unrepresentable constant logarithms
|
||||
*/
|
||||
extern __attribute__((const, noreturn))
|
||||
int ____ilog2_NaN(void);
|
||||
|
||||
/*
|
||||
* non-constant log of base 2 calculators
|
||||
* - the arch may override these in asm/bitops.h if they can be implemented
|
||||
* more efficiently than using fls() and fls64()
|
||||
* - the arch is not required to handle n==0 if implementing the fallback
|
||||
*/
|
||||
#ifndef CONFIG_ARCH_HAS_ILOG2_U32
|
||||
static inline __attribute__((const))
|
||||
int __ilog2_u32(u32 n)
|
||||
{
|
||||
return fls(n) - 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ARCH_HAS_ILOG2_U64
|
||||
static inline __attribute__((const))
|
||||
int __ilog2_u64(u64 n)
|
||||
{
|
||||
return fls64(n) - 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Determine whether some value is a power of two, where zero is
|
||||
* *not* considered a power of two.
|
||||
*/
|
||||
|
||||
static inline __attribute__((const))
|
||||
bool is_power_of_2(unsigned long n)
|
||||
{
|
||||
return (n != 0 && ((n & (n - 1)) == 0));
|
||||
}
|
||||
|
||||
/*
|
||||
* round up to nearest power of two
|
||||
*/
|
||||
static inline __attribute__((const))
|
||||
unsigned long __roundup_pow_of_two(unsigned long n)
|
||||
{
|
||||
return 1UL << fls_long(n - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
|
||||
* @n - parameter
|
||||
*
|
||||
* constant-capable log of base 2 calculation
|
||||
* - this can be used to initialise global variables from constant data, hence
|
||||
* the massive ternary operator construction
|
||||
*
|
||||
* selects the appropriately-sized optimised version depending on sizeof(n)
|
||||
*/
|
||||
#define ilog2(n) \
|
||||
( \
|
||||
__builtin_constant_p(n) ? ( \
|
||||
(n) < 1 ? ____ilog2_NaN() : \
|
||||
(n) & (1ULL << 63) ? 63 : \
|
||||
(n) & (1ULL << 62) ? 62 : \
|
||||
(n) & (1ULL << 61) ? 61 : \
|
||||
(n) & (1ULL << 60) ? 60 : \
|
||||
(n) & (1ULL << 59) ? 59 : \
|
||||
(n) & (1ULL << 58) ? 58 : \
|
||||
(n) & (1ULL << 57) ? 57 : \
|
||||
(n) & (1ULL << 56) ? 56 : \
|
||||
(n) & (1ULL << 55) ? 55 : \
|
||||
(n) & (1ULL << 54) ? 54 : \
|
||||
(n) & (1ULL << 53) ? 53 : \
|
||||
(n) & (1ULL << 52) ? 52 : \
|
||||
(n) & (1ULL << 51) ? 51 : \
|
||||
(n) & (1ULL << 50) ? 50 : \
|
||||
(n) & (1ULL << 49) ? 49 : \
|
||||
(n) & (1ULL << 48) ? 48 : \
|
||||
(n) & (1ULL << 47) ? 47 : \
|
||||
(n) & (1ULL << 46) ? 46 : \
|
||||
(n) & (1ULL << 45) ? 45 : \
|
||||
(n) & (1ULL << 44) ? 44 : \
|
||||
(n) & (1ULL << 43) ? 43 : \
|
||||
(n) & (1ULL << 42) ? 42 : \
|
||||
(n) & (1ULL << 41) ? 41 : \
|
||||
(n) & (1ULL << 40) ? 40 : \
|
||||
(n) & (1ULL << 39) ? 39 : \
|
||||
(n) & (1ULL << 38) ? 38 : \
|
||||
(n) & (1ULL << 37) ? 37 : \
|
||||
(n) & (1ULL << 36) ? 36 : \
|
||||
(n) & (1ULL << 35) ? 35 : \
|
||||
(n) & (1ULL << 34) ? 34 : \
|
||||
(n) & (1ULL << 33) ? 33 : \
|
||||
(n) & (1ULL << 32) ? 32 : \
|
||||
(n) & (1ULL << 31) ? 31 : \
|
||||
(n) & (1ULL << 30) ? 30 : \
|
||||
(n) & (1ULL << 29) ? 29 : \
|
||||
(n) & (1ULL << 28) ? 28 : \
|
||||
(n) & (1ULL << 27) ? 27 : \
|
||||
(n) & (1ULL << 26) ? 26 : \
|
||||
(n) & (1ULL << 25) ? 25 : \
|
||||
(n) & (1ULL << 24) ? 24 : \
|
||||
(n) & (1ULL << 23) ? 23 : \
|
||||
(n) & (1ULL << 22) ? 22 : \
|
||||
(n) & (1ULL << 21) ? 21 : \
|
||||
(n) & (1ULL << 20) ? 20 : \
|
||||
(n) & (1ULL << 19) ? 19 : \
|
||||
(n) & (1ULL << 18) ? 18 : \
|
||||
(n) & (1ULL << 17) ? 17 : \
|
||||
(n) & (1ULL << 16) ? 16 : \
|
||||
(n) & (1ULL << 15) ? 15 : \
|
||||
(n) & (1ULL << 14) ? 14 : \
|
||||
(n) & (1ULL << 13) ? 13 : \
|
||||
(n) & (1ULL << 12) ? 12 : \
|
||||
(n) & (1ULL << 11) ? 11 : \
|
||||
(n) & (1ULL << 10) ? 10 : \
|
||||
(n) & (1ULL << 9) ? 9 : \
|
||||
(n) & (1ULL << 8) ? 8 : \
|
||||
(n) & (1ULL << 7) ? 7 : \
|
||||
(n) & (1ULL << 6) ? 6 : \
|
||||
(n) & (1ULL << 5) ? 5 : \
|
||||
(n) & (1ULL << 4) ? 4 : \
|
||||
(n) & (1ULL << 3) ? 3 : \
|
||||
(n) & (1ULL << 2) ? 2 : \
|
||||
(n) & (1ULL << 1) ? 1 : \
|
||||
(n) & (1ULL << 0) ? 0 : \
|
||||
____ilog2_NaN() \
|
||||
) : \
|
||||
(sizeof(n) <= 4) ? \
|
||||
__ilog2_u32(n) : \
|
||||
__ilog2_u64(n) \
|
||||
)
|
||||
|
||||
/**
|
||||
* roundup_pow_of_two - round the given value up to nearest power of two
|
||||
* @n - parameter
|
||||
*
|
||||
* round the given balue up to the nearest power of two
|
||||
* - the result is undefined when n == 0
|
||||
* - this can be used to initialise global variables from constant data
|
||||
*/
|
||||
#define roundup_pow_of_two(n) \
|
||||
( \
|
||||
__builtin_constant_p(n) ? ( \
|
||||
(n == 1) ? 0 : \
|
||||
(1UL << (ilog2((n) - 1) + 1)) \
|
||||
) : \
|
||||
__roundup_pow_of_two(n) \
|
||||
)
|
||||
|
||||
#endif /* _LINUX_LOG2_H */
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#define ADFS_SUPER_MAGIC 0xadf5
|
||||
#define AFFS_SUPER_MAGIC 0xadff
|
||||
#define AFS_SUPER_MAGIC 0x5346414F
|
||||
#define AUTOFS_SUPER_MAGIC 0x0187
|
||||
#define CODA_SUPER_MAGIC 0x73757245
|
||||
#define EFS_SUPER_MAGIC 0x414A53
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ extern unsigned int kobjsize(const void *objp);
|
|||
#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
|
||||
#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
|
||||
#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
|
||||
#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */
|
||||
|
||||
#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
|
||||
#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
|
||||
|
|
@ -978,7 +979,8 @@ extern int early_pfn_to_nid(unsigned long pfn);
|
|||
#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
|
||||
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
|
||||
extern void set_dma_reserve(unsigned long new_dma_reserve);
|
||||
extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long);
|
||||
extern void memmap_init_zone(unsigned long, int, unsigned long,
|
||||
unsigned long, enum memmap_context);
|
||||
extern void setup_per_zone_pages_min(void);
|
||||
extern void mem_init(void);
|
||||
extern void show_mem(void);
|
||||
|
|
@ -1028,6 +1030,9 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
|
|||
unsigned long addr, unsigned long len, pgoff_t pgoff);
|
||||
extern void exit_mmap(struct mm_struct *);
|
||||
extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
|
||||
extern int install_special_mapping(struct mm_struct *mm,
|
||||
unsigned long addr, unsigned long len,
|
||||
unsigned long flags, struct page **pages);
|
||||
|
||||
extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ struct mmc_card {
|
|||
#define MMC_STATE_SDCARD (1<<3) /* is an SD card */
|
||||
#define MMC_STATE_READONLY (1<<4) /* card is read-only */
|
||||
#define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */
|
||||
#define MMC_STATE_BLOCKADDR (1<<6) /* card uses block-addressing */
|
||||
u32 raw_cid[4]; /* raw card CID */
|
||||
u32 raw_csd[4]; /* raw card CSD */
|
||||
u32 raw_scr[2]; /* raw card SCR */
|
||||
|
|
@ -87,6 +88,7 @@ struct mmc_card {
|
|||
#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
|
||||
#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
|
||||
#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
|
||||
#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR)
|
||||
|
||||
#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
|
||||
#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
|
||||
|
|
@ -94,6 +96,7 @@ struct mmc_card {
|
|||
#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
|
||||
#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
|
||||
#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
|
||||
#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
|
||||
|
||||
#define mmc_card_name(c) ((c)->cid.prod_name)
|
||||
#define mmc_card_id(c) ((c)->dev.bus_id)
|
||||
|
|
|
|||
|
|
@ -92,8 +92,10 @@ struct mmc_host {
|
|||
unsigned int max_seg_size; /* see blk_queue_max_segment_size */
|
||||
unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
|
||||
unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */
|
||||
unsigned short max_sectors; /* see blk_queue_max_sectors */
|
||||
unsigned short unused;
|
||||
unsigned int max_req_size; /* maximum number of bytes in one req */
|
||||
unsigned int max_blk_size; /* maximum size of one mmc block */
|
||||
unsigned int max_blk_count; /* maximum number of blocks in one req */
|
||||
|
||||
/* private data */
|
||||
struct mmc_ios ios; /* current io bus settings */
|
||||
|
|
@ -106,8 +108,9 @@ struct mmc_host {
|
|||
struct list_head cards; /* devices attached to this host */
|
||||
|
||||
wait_queue_head_t wq;
|
||||
spinlock_t lock; /* card_busy lock */
|
||||
struct mmc_card *card_busy; /* the MMC card claiming host */
|
||||
spinlock_t lock; /* claimed lock */
|
||||
unsigned int claimed:1; /* host exclusively claimed */
|
||||
|
||||
struct mmc_card *card_selected; /* the selected MMC card */
|
||||
|
||||
struct delayed_work detect;
|
||||
|
|
@ -126,6 +129,7 @@ static inline void *mmc_priv(struct mmc_host *host)
|
|||
}
|
||||
|
||||
#define mmc_dev(x) ((x)->parent)
|
||||
#define mmc_classdev(x) (&(x)->class_dev)
|
||||
#define mmc_hostname(x) ((x)->class_dev.bus_id)
|
||||
|
||||
extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ struct mmc_command {
|
|||
#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
|
||||
#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
|
||||
#define MMC_RSP_R3 (MMC_RSP_PRESENT)
|
||||
#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC)
|
||||
#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
|
||||
#define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
|
||||
|
||||
#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,12 @@
|
|||
#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */
|
||||
|
||||
/* SD commands type argument response */
|
||||
/* class 8 */
|
||||
/* class 0 */
|
||||
/* This is basically the same command as for MMC with some quirks. */
|
||||
#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
|
||||
#define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
|
||||
|
||||
/* class 10 */
|
||||
#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
|
||||
|
||||
/* Application commands */
|
||||
|
|
@ -114,6 +117,14 @@
|
|||
* [3:0] Function group 1
|
||||
*/
|
||||
|
||||
/*
|
||||
* SD_SEND_IF_COND argument format:
|
||||
*
|
||||
* [31:12] Reserved (0)
|
||||
* [11:8] Host Voltage Supply Flags
|
||||
* [7:0] Check Pattern (0xAA)
|
||||
*/
|
||||
|
||||
/*
|
||||
MMC status in R1
|
||||
Type
|
||||
|
|
|
|||
|
|
@ -450,9 +450,13 @@ void build_all_zonelists(void);
|
|||
void wakeup_kswapd(struct zone *zone, int order);
|
||||
int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
|
||||
int classzone_idx, int alloc_flags);
|
||||
|
||||
enum memmap_context {
|
||||
MEMMAP_EARLY,
|
||||
MEMMAP_HOTPLUG,
|
||||
};
|
||||
extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
|
||||
unsigned long size);
|
||||
unsigned long size,
|
||||
enum memmap_context context);
|
||||
|
||||
#ifdef CONFIG_HAVE_MEMORY_PRESENT
|
||||
void memory_present(int nid, unsigned long start, unsigned long end);
|
||||
|
|
|
|||
42
include/linux/mnt_namespace.h
Normal file
42
include/linux/mnt_namespace.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#ifndef _NAMESPACE_H_
|
||||
#define _NAMESPACE_H_
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/mount.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/nsproxy.h>
|
||||
|
||||
struct mnt_namespace {
|
||||
atomic_t count;
|
||||
struct vfsmount * root;
|
||||
struct list_head list;
|
||||
wait_queue_head_t poll;
|
||||
int event;
|
||||
};
|
||||
|
||||
extern int copy_mnt_ns(int, struct task_struct *);
|
||||
extern void __put_mnt_ns(struct mnt_namespace *ns);
|
||||
extern struct mnt_namespace *dup_mnt_ns(struct task_struct *,
|
||||
struct fs_struct *);
|
||||
|
||||
static inline void put_mnt_ns(struct mnt_namespace *ns)
|
||||
{
|
||||
if (atomic_dec_and_lock(&ns->count, &vfsmount_lock))
|
||||
/* releases vfsmount_lock */
|
||||
__put_mnt_ns(ns);
|
||||
}
|
||||
|
||||
static inline void exit_mnt_ns(struct task_struct *p)
|
||||
{
|
||||
struct mnt_namespace *ns = p->nsproxy->mnt_ns;
|
||||
if (ns)
|
||||
put_mnt_ns(ns);
|
||||
}
|
||||
|
||||
static inline void get_mnt_ns(struct mnt_namespace *ns)
|
||||
{
|
||||
atomic_inc(&ns->count);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -58,6 +58,7 @@ struct module_kobject
|
|||
{
|
||||
struct kobject kobj;
|
||||
struct module *mod;
|
||||
struct kobject *drivers_dir;
|
||||
};
|
||||
|
||||
/* These are either module local, or the kernel's dummy ones. */
|
||||
|
|
@ -263,7 +264,7 @@ struct module
|
|||
struct module_attribute *modinfo_attrs;
|
||||
const char *version;
|
||||
const char *srcversion;
|
||||
struct kobject *drivers_dir;
|
||||
struct kobject *holders_dir;
|
||||
|
||||
/* Exported symbols */
|
||||
const struct kernel_symbol *syms;
|
||||
|
|
@ -319,6 +320,13 @@ struct module
|
|||
|
||||
unsigned int taints; /* same bits as kernel:tainted */
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG
|
||||
/* Support for BUG */
|
||||
struct list_head bug_list;
|
||||
struct bug_entry *bug_table;
|
||||
unsigned num_bugs;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MODULE_UNLOAD
|
||||
/* Reference counts */
|
||||
struct module_ref ref[NR_CPUS];
|
||||
|
|
|
|||
|
|
@ -20,13 +20,14 @@
|
|||
struct super_block;
|
||||
struct vfsmount;
|
||||
struct dentry;
|
||||
struct namespace;
|
||||
struct mnt_namespace;
|
||||
|
||||
#define MNT_NOSUID 0x01
|
||||
#define MNT_NODEV 0x02
|
||||
#define MNT_NOEXEC 0x04
|
||||
#define MNT_NOATIME 0x08
|
||||
#define MNT_NODIRATIME 0x10
|
||||
#define MNT_RELATIME 0x20
|
||||
|
||||
#define MNT_SHRINKABLE 0x100
|
||||
|
||||
|
|
@ -52,7 +53,7 @@ struct vfsmount {
|
|||
struct list_head mnt_slave_list;/* list of slave mounts */
|
||||
struct list_head mnt_slave; /* slave list entry */
|
||||
struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
|
||||
struct namespace *mnt_namespace; /* containing namespace */
|
||||
struct mnt_namespace *mnt_ns; /* containing namespace */
|
||||
int mnt_pinned;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,10 @@ struct msi_msg {
|
|||
u32 data; /* 16 bits of msi message data */
|
||||
};
|
||||
|
||||
/* Heper functions */
|
||||
/* Helper functions */
|
||||
extern void mask_msi_irq(unsigned int irq);
|
||||
extern void unmask_msi_irq(unsigned int irq);
|
||||
extern void read_msi_msg(unsigned int irq, struct msi_msg *msg);
|
||||
|
||||
extern void write_msi_msg(unsigned int irq, struct msi_msg *msg);
|
||||
|
||||
struct msi_desc {
|
||||
|
|
@ -42,7 +41,7 @@ struct msi_desc {
|
|||
/*
|
||||
* The arch hook for setup up msi irqs
|
||||
*/
|
||||
int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev);
|
||||
int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
|
||||
void arch_teardown_msi_irq(unsigned int irq);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ struct mtd_blktrans_dev {
|
|||
struct mtd_info *mtd;
|
||||
struct mutex lock;
|
||||
int devnum;
|
||||
int blksize;
|
||||
unsigned long size;
|
||||
int readonly;
|
||||
void *blkcore_priv; /* gendisk in 2.5, devfs_handle in 2.4 */
|
||||
|
|
@ -36,6 +35,8 @@ struct mtd_blktrans_ops {
|
|||
char *name;
|
||||
int major;
|
||||
int part_bits;
|
||||
int blksize;
|
||||
int blkshift;
|
||||
|
||||
/* Access functions */
|
||||
int (*readsect)(struct mtd_blktrans_dev *dev,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#define MTD_CHAR_MAJOR 90
|
||||
#define MTD_BLOCK_MAJOR 31
|
||||
#define MAX_MTD_DEVICES 16
|
||||
#define MAX_MTD_DEVICES 32
|
||||
|
||||
#define MTD_ERASE_PENDING 0x01
|
||||
#define MTD_ERASING 0x02
|
||||
|
|
@ -75,15 +75,12 @@ typedef enum {
|
|||
* struct mtd_oob_ops - oob operation operands
|
||||
* @mode: operation mode
|
||||
*
|
||||
* @len: number of bytes to write/read. When a data buffer is given
|
||||
* (datbuf != NULL) this is the number of data bytes. When
|
||||
* no data buffer is available this is the number of oob bytes.
|
||||
* @len: number of data bytes to write/read
|
||||
*
|
||||
* @retlen: number of bytes written/read. When a data buffer is given
|
||||
* (datbuf != NULL) this is the number of data bytes. When
|
||||
* no data buffer is available this is the number of oob bytes.
|
||||
* @retlen: number of data bytes written/read
|
||||
*
|
||||
* @ooblen: number of oob bytes per page
|
||||
* @ooblen: number of oob bytes to write/read
|
||||
* @oobretlen: number of oob bytes written/read
|
||||
* @ooboffs: offset of oob data in the oob area (only relevant when
|
||||
* mode = MTD_OOB_PLACE)
|
||||
* @datbuf: data buffer - if NULL only oob data are read/written
|
||||
|
|
@ -94,6 +91,7 @@ struct mtd_oob_ops {
|
|||
size_t len;
|
||||
size_t retlen;
|
||||
size_t ooblen;
|
||||
size_t oobretlen;
|
||||
uint32_t ooboffs;
|
||||
uint8_t *datbuf;
|
||||
uint8_t *oobbuf;
|
||||
|
|
@ -202,11 +200,20 @@ struct mtd_info {
|
|||
|
||||
/* ECC status information */
|
||||
struct mtd_ecc_stats ecc_stats;
|
||||
/* Subpage shift (NAND) */
|
||||
int subpage_sft;
|
||||
|
||||
void *priv;
|
||||
|
||||
struct module *owner;
|
||||
int usecount;
|
||||
|
||||
/* If the driver is something smart, like UBI, it may need to maintain
|
||||
* its own reference counting. The below functions are only for driver.
|
||||
* The driver may register its callbacks. These callbacks are not
|
||||
* supposed to be called by MTD users */
|
||||
int (*get_device) (struct mtd_info *mtd);
|
||||
void (*put_device) (struct mtd_info *mtd);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -216,6 +223,7 @@ extern int add_mtd_device(struct mtd_info *mtd);
|
|||
extern int del_mtd_device (struct mtd_info *mtd);
|
||||
|
||||
extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
|
||||
extern struct mtd_info *get_mtd_device_nm(const char *name);
|
||||
|
||||
extern void put_mtd_device(struct mtd_info *mtd);
|
||||
|
||||
|
|
|
|||
|
|
@ -166,6 +166,9 @@ typedef enum {
|
|||
* for all large page devices, as they do not support
|
||||
* autoincrement.*/
|
||||
#define NAND_NO_READRDY 0x00000100
|
||||
/* Chip does not allow subpage writes */
|
||||
#define NAND_NO_SUBPAGE_WRITE 0x00000200
|
||||
|
||||
|
||||
/* Options valid for Samsung large page devices */
|
||||
#define NAND_SAMSUNG_LP_OPTIONS \
|
||||
|
|
@ -193,6 +196,9 @@ typedef enum {
|
|||
/* Nand scan has allocated controller struct */
|
||||
#define NAND_CONTROLLER_ALLOC 0x80000000
|
||||
|
||||
/* Cell info constants */
|
||||
#define NAND_CI_CHIPNR_MSK 0x03
|
||||
#define NAND_CI_CELLTYPE_MSK 0x0C
|
||||
|
||||
/*
|
||||
* nand_state_t - chip states
|
||||
|
|
@ -286,9 +292,7 @@ struct nand_ecc_ctrl {
|
|||
* struct nand_buffers - buffer structure for read/write
|
||||
* @ecccalc: buffer for calculated ecc
|
||||
* @ecccode: buffer for ecc read from flash
|
||||
* @oobwbuf: buffer for write oob data
|
||||
* @databuf: buffer for data - dynamically sized
|
||||
* @oobrbuf: buffer to read oob data
|
||||
*
|
||||
* Do not change the order of buffers. databuf and oobrbuf must be in
|
||||
* consecutive order.
|
||||
|
|
@ -296,9 +300,7 @@ struct nand_ecc_ctrl {
|
|||
struct nand_buffers {
|
||||
uint8_t ecccalc[NAND_MAX_OOBSIZE];
|
||||
uint8_t ecccode[NAND_MAX_OOBSIZE];
|
||||
uint8_t oobwbuf[NAND_MAX_OOBSIZE];
|
||||
uint8_t databuf[NAND_MAX_PAGESIZE];
|
||||
uint8_t oobrbuf[NAND_MAX_OOBSIZE];
|
||||
uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -345,6 +347,7 @@ struct nand_buffers {
|
|||
* @chipsize: [INTERN] the size of one chip for multichip arrays
|
||||
* @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
|
||||
* @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf
|
||||
* @subpagesize: [INTERN] holds the subpagesize
|
||||
* @ecclayout: [REPLACEABLE] the default ecc placement scheme
|
||||
* @bbt: [INTERN] bad block table pointer
|
||||
* @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
|
||||
|
|
@ -392,6 +395,8 @@ struct nand_chip {
|
|||
unsigned long chipsize;
|
||||
int pagemask;
|
||||
int pagebuf;
|
||||
int subpagesize;
|
||||
uint8_t cellinfo;
|
||||
int badblockpos;
|
||||
|
||||
nand_state_t state;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#define __LINUX_MTD_ONENAND_H
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/mtd/onenand_regs.h>
|
||||
#include <linux/mtd/bbm.h>
|
||||
|
||||
|
|
@ -33,7 +34,6 @@ typedef enum {
|
|||
FL_WRITING,
|
||||
FL_ERASING,
|
||||
FL_SYNCING,
|
||||
FL_UNLOCKING,
|
||||
FL_LOCKING,
|
||||
FL_RESETING,
|
||||
FL_OTPING,
|
||||
|
|
@ -88,6 +88,7 @@ struct onenand_bufferram {
|
|||
* operation is in progress
|
||||
* @state: [INTERN] the current state of the OneNAND device
|
||||
* @page_buf: data buffer
|
||||
* @subpagesize: [INTERN] holds the subpagesize
|
||||
* @ecclayout: [REPLACEABLE] the default ecc placement scheme
|
||||
* @bbm: [REPLACEABLE] pointer to Bad Block Management
|
||||
* @priv: [OPTIONAL] pointer to private chip date
|
||||
|
|
@ -120,11 +121,15 @@ struct onenand_chip {
|
|||
int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
|
||||
int (*scan_bbt)(struct mtd_info *mtd);
|
||||
|
||||
struct completion complete;
|
||||
int irq;
|
||||
|
||||
spinlock_t chip_lock;
|
||||
wait_queue_head_t wq;
|
||||
onenand_state_t state;
|
||||
unsigned char *page_buf;
|
||||
|
||||
int subpagesize;
|
||||
struct nand_ecclayout *ecclayout;
|
||||
|
||||
void *bbm;
|
||||
|
|
@ -138,6 +143,7 @@ struct onenand_chip {
|
|||
#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
|
||||
#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
|
||||
#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
|
||||
#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1)
|
||||
|
||||
#define ONENAND_GET_SYS_CFG1(this) \
|
||||
(this->read_word(this->base + ONENAND_REG_SYS_CFG1))
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@
|
|||
* ECC Status Reigser FF00h (R)
|
||||
*/
|
||||
#define ONENAND_ECC_1BIT (1 << 0)
|
||||
#define ONENAND_ECC_1BIT_ALL (0x5555)
|
||||
#define ONENAND_ECC_2BIT (1 << 1)
|
||||
#define ONENAND_ECC_2BIT_ALL (0xAAAA)
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue