mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
UAPI Disintegration 2012-10-09
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIVAwUAUHPmWhOxKuMESys7AQLCZRAAsZAuAK0MxZ4iuq/+fmy7Uxb1jrzLOYSb 3UgbTgXAjR0WAUHNegVZLX1Xc+12KxvMCj/8sO62Ai+wtgHeDAuUl2T0FbSZjlGK qqx/qQqTFHUfJRbm3Lu9iarZ2K49v1kTDk4C+nC8J9mEEW4WFlVPD10n90j+4hxr ZCEYril7qOQQV65oor3BT2V64+X1WDHriTLugH1o8RziRF9jh6Z2hgZAWnThcGxu lPsmXF2e7jDqGcM3gWtxZWu/yTBPxw549R+JUg4aVKho9WI5ClyjNAKnE7wtd3iW HyrylRH+ch2oeYFa5+xoyopRARUUPmujKaHU+ZI1o++eNzuw5JYiwuMlZBLyUc9I foWMSUw31U7695exyf66HiH7GEKI1PVpgJVNu41eJvl0iWSWCpKCB6Gs8Sw4xnp2 auUCYSniXHNTFhFktjNdIUAn0+1X/b/SEfb/id4GvLp1K98QGOfe8dMCC8hEnXiF 4iIViM8Sv1GB1us5huSjbMeRPbZ3x/loqEpApfgcaqcyrUR29FTE/lFQ4fj9xviL JjckPLMMZb4Ho5wrkCi5NtXJ16mx1qKzbBGDdqzmqaNdN+08rNF//kA9m9hCwgD8 XfAV286DKDC0SllZIG+Uz7YLnSZjNAUhjvWN3ipV+SdT5DGybL3uSW5tYiSAzI2E 3cayGTWINMg= =U9Qq -----END PGP SIGNATURE----- Merge tag 'disintegrate-mtd-20121009' of git://git.infradead.org/users/dhowells/linux-headers UAPI Disintegration 2012-10-09 Conflicts: MAINTAINERS arch/arm/configs/bcmring_defconfig arch/arm/mach-imx/clk-imx51-imx53.c drivers/mtd/nand/Kconfig drivers/mtd/nand/bcm_umi_nand.c drivers/mtd/nand/nand_bcm_umi.h drivers/mtd/nand/orion_nand.c
This commit is contained in:
commit
ffe3150125
10997 changed files with 561095 additions and 275904 deletions
|
|
@ -20,21 +20,16 @@ header-y += netfilter_ipv6/
|
|||
header-y += usb/
|
||||
header-y += wimax/
|
||||
|
||||
objhdr-y += version.h
|
||||
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/a.out.h \
|
||||
$(INSTALL_HDR_PATH)/include/asm-*/a.out.h),)
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
|
||||
header-y += a.out.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm.h \
|
||||
$(INSTALL_HDR_PATH)/include/asm-*/kvm.h),)
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
|
||||
header-y += kvm.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm_para.h \
|
||||
$(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),)
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
|
||||
header-y += kvm_para.h
|
||||
endif
|
||||
|
||||
|
|
@ -84,7 +79,6 @@ header-y += capability.h
|
|||
header-y += capi.h
|
||||
header-y += cciss_defs.h
|
||||
header-y += cciss_ioctl.h
|
||||
header-y += cdk.h
|
||||
header-y += cdrom.h
|
||||
header-y += cgroupstats.h
|
||||
header-y += chio.h
|
||||
|
|
@ -93,7 +87,6 @@ header-y += cn_proc.h
|
|||
header-y += coda.h
|
||||
header-y += coda_psdev.h
|
||||
header-y += coff.h
|
||||
header-y += comstats.h
|
||||
header-y += connector.h
|
||||
header-y += const.h
|
||||
header-y += cramfs_fs.h
|
||||
|
|
@ -140,7 +133,6 @@ header-y += fuse.h
|
|||
header-y += futex.h
|
||||
header-y += gameport.h
|
||||
header-y += gen_stats.h
|
||||
header-y += generic_serial.h
|
||||
header-y += genetlink.h
|
||||
header-y += gfs2_ondisk.h
|
||||
header-y += gigaset_dev.h
|
||||
|
|
@ -195,6 +187,7 @@ header-y += in_route.h
|
|||
header-y += sock_diag.h
|
||||
header-y += inet_diag.h
|
||||
header-y += unix_diag.h
|
||||
header-y += packet_diag.h
|
||||
header-y += inotify.h
|
||||
header-y += input.h
|
||||
header-y += ioctl.h
|
||||
|
|
@ -362,6 +355,7 @@ header-y += sysctl.h
|
|||
header-y += sysinfo.h
|
||||
header-y += taskstats.h
|
||||
header-y += tcp.h
|
||||
header-y += tcp_metrics.h
|
||||
header-y += telephony.h
|
||||
header-y += termios.h
|
||||
header-y += time.h
|
||||
|
|
@ -372,6 +366,7 @@ header-y += tipc.h
|
|||
header-y += tipc_config.h
|
||||
header-y += toshiba.h
|
||||
header-y += tty.h
|
||||
header-y += tty_flags.h
|
||||
header-y += types.h
|
||||
header-y += udf_fs_i.h
|
||||
header-y += udp.h
|
||||
|
|
@ -387,6 +382,7 @@ header-y += utsname.h
|
|||
header-y += uuid.h
|
||||
header-y += uvcvideo.h
|
||||
header-y += v4l2-common.h
|
||||
header-y += v4l2-controls.h
|
||||
header-y += v4l2-dv-timings.h
|
||||
header-y += v4l2-mediabus.h
|
||||
header-y += v4l2-subdev.h
|
||||
|
|
|
|||
|
|
@ -138,9 +138,9 @@ void acpi_penalize_isa_irq(int irq, int active);
|
|||
void acpi_pci_irq_disable (struct pci_dev *dev);
|
||||
|
||||
struct acpi_pci_driver {
|
||||
struct acpi_pci_driver *next;
|
||||
int (*add)(acpi_handle handle);
|
||||
void (*remove)(acpi_handle handle);
|
||||
struct list_head node;
|
||||
int (*add)(struct acpi_pci_root *root);
|
||||
void (*remove)(struct acpi_pci_root *root);
|
||||
};
|
||||
|
||||
int acpi_pci_register_driver(struct acpi_pci_driver *driver);
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@ struct dma_chan;
|
|||
* indicates no delay and the device will be suspended immediately.
|
||||
* @rt: indicates the controller should run the message pump with realtime
|
||||
* priority to minimise the transfer latency on the bus.
|
||||
* @chipselects: list of <num_chipselects> chip select gpios
|
||||
*/
|
||||
struct pl022_ssp_controller {
|
||||
u16 bus_id;
|
||||
|
|
@ -254,6 +255,7 @@ struct pl022_ssp_controller {
|
|||
void *dma_tx_param;
|
||||
int autosuspend_delay;
|
||||
bool rt;
|
||||
int *chipselects;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -205,7 +205,6 @@ struct amba_pl011_data {
|
|||
void *dma_tx_param;
|
||||
void (*init) (void);
|
||||
void (*exit) (void);
|
||||
void (*reset) (void);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ enum {
|
|||
ATA_ID_EIDE_PIO_IORDY = 68,
|
||||
ATA_ID_ADDITIONAL_SUPP = 69,
|
||||
ATA_ID_QUEUE_DEPTH = 75,
|
||||
ATA_ID_SATA_CAPABILITY = 76,
|
||||
ATA_ID_SATA_CAPABILITY_2 = 77,
|
||||
ATA_ID_FEATURE_SUPP = 78,
|
||||
ATA_ID_MAJOR_VER = 80,
|
||||
ATA_ID_COMMAND_SET_1 = 82,
|
||||
ATA_ID_COMMAND_SET_2 = 83,
|
||||
|
|
@ -292,6 +295,13 @@ enum {
|
|||
|
||||
/* READ_LOG_EXT pages */
|
||||
ATA_LOG_SATA_NCQ = 0x10,
|
||||
ATA_LOG_SATA_ID_DEV_DATA = 0x30,
|
||||
ATA_LOG_SATA_SETTINGS = 0x08,
|
||||
ATA_LOG_DEVSLP_MDAT = 0x30,
|
||||
ATA_LOG_DEVSLP_MDAT_MASK = 0x1F,
|
||||
ATA_LOG_DEVSLP_DETO = 0x31,
|
||||
ATA_LOG_DEVSLP_VALID = 0x37,
|
||||
ATA_LOG_DEVSLP_VALID_MASK = 0x80,
|
||||
|
||||
/* READ/WRITE LONG (obsolete) */
|
||||
ATA_CMD_READ_LONG = 0x22,
|
||||
|
|
@ -345,6 +355,7 @@ enum {
|
|||
SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */
|
||||
SATA_AN = 0x05, /* Asynchronous Notification */
|
||||
SATA_SSP = 0x06, /* Software Settings Preservation */
|
||||
SATA_DEVSLP = 0x09, /* Device Sleep */
|
||||
|
||||
/* feature values for SET_MAX */
|
||||
ATA_SET_MAX_ADDR = 0x00,
|
||||
|
|
@ -558,15 +569,17 @@ static inline int ata_is_data(u8 prot)
|
|||
#define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0)
|
||||
#define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9))
|
||||
#define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8))
|
||||
#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
|
||||
#define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8))
|
||||
#define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1)
|
||||
#define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7))
|
||||
#define ata_id_has_atapi_AN(id) \
|
||||
( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
|
||||
((id)[78] & (1 << 5)) )
|
||||
((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
|
||||
((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
|
||||
((id)[ATA_ID_FEATURE_SUPP] & (1 << 5)))
|
||||
#define ata_id_has_fpdma_aa(id) \
|
||||
( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
|
||||
((id)[78] & (1 << 2)) )
|
||||
((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
|
||||
((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
|
||||
((id)[ATA_ID_FEATURE_SUPP] & (1 << 2)))
|
||||
#define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))
|
||||
#define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))
|
||||
#define ata_id_u32(id,n) \
|
||||
|
|
@ -578,11 +591,12 @@ static inline int ata_is_data(u8 prot)
|
|||
((u64) (id)[(n) + 0]) )
|
||||
|
||||
#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
|
||||
#define ata_id_has_da(id) ((id)[77] & (1 << 4))
|
||||
#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4))
|
||||
#define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))
|
||||
|
||||
static inline bool ata_id_has_hipm(const u16 *id)
|
||||
{
|
||||
u16 val = id[76];
|
||||
u16 val = id[ATA_ID_SATA_CAPABILITY];
|
||||
|
||||
if (val == 0 || val == 0xffff)
|
||||
return false;
|
||||
|
|
@ -592,7 +606,7 @@ static inline bool ata_id_has_hipm(const u16 *id)
|
|||
|
||||
static inline bool ata_id_has_dipm(const u16 *id)
|
||||
{
|
||||
u16 val = id[78];
|
||||
u16 val = id[ATA_ID_FEATURE_SUPP];
|
||||
|
||||
if (val == 0 || val == 0xffff)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
struct ssc_device {
|
||||
struct list_head list;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ struct atmel_tc {
|
|||
struct platform_device *pdev;
|
||||
struct resource *iomem;
|
||||
void __iomem *regs;
|
||||
struct atmel_tcb_config *tcb_config;
|
||||
const struct atmel_tcb_config *tcb_config;
|
||||
int irq[3];
|
||||
struct clk *clk[3];
|
||||
struct list_head node;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,31 @@ static inline int atomic_dec_unless_positive(atomic_t *p)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* atomic_dec_if_positive - decrement by 1 if old value positive
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* The function returns the old value of *v minus 1, even if
|
||||
* the atomic variable, v, was not decremented.
|
||||
*/
|
||||
#ifndef atomic_dec_if_positive
|
||||
static inline int atomic_dec_if_positive(atomic_t *v)
|
||||
{
|
||||
int c, old, dec;
|
||||
c = atomic_read(v);
|
||||
for (;;) {
|
||||
dec = c - 1;
|
||||
if (unlikely(dec < 0))
|
||||
break;
|
||||
old = atomic_cmpxchg((v), c, dec);
|
||||
if (likely(old == c))
|
||||
break;
|
||||
c = old;
|
||||
}
|
||||
return dec;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
|
||||
static inline void atomic_or(int i, atomic_t *v)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -442,6 +442,8 @@ struct audit_krule {
|
|||
struct audit_field {
|
||||
u32 type;
|
||||
u32 val;
|
||||
kuid_t uid;
|
||||
kgid_t gid;
|
||||
u32 op;
|
||||
char *lsm_str;
|
||||
void *lsm_rule;
|
||||
|
|
@ -525,10 +527,20 @@ static inline void audit_ptrace(struct task_struct *t)
|
|||
extern unsigned int audit_serial(void);
|
||||
extern int auditsc_get_stamp(struct audit_context *ctx,
|
||||
struct timespec *t, unsigned int *serial);
|
||||
extern int audit_set_loginuid(uid_t loginuid);
|
||||
#define audit_get_loginuid(t) ((t)->loginuid)
|
||||
#define audit_get_sessionid(t) ((t)->sessionid)
|
||||
extern int audit_set_loginuid(kuid_t loginuid);
|
||||
|
||||
static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
|
||||
{
|
||||
return tsk->loginuid;
|
||||
}
|
||||
|
||||
static inline int audit_get_sessionid(struct task_struct *tsk)
|
||||
{
|
||||
return tsk->sessionid;
|
||||
}
|
||||
|
||||
extern void audit_log_task_context(struct audit_buffer *ab);
|
||||
extern void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk);
|
||||
extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
|
||||
extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
|
||||
extern int __audit_bprm(struct linux_binprm *bprm);
|
||||
|
|
@ -623,37 +635,101 @@ static inline void audit_mmap_fd(int fd, int flags)
|
|||
extern int audit_n_rules;
|
||||
extern int audit_signals;
|
||||
#else /* CONFIG_AUDITSYSCALL */
|
||||
#define audit_alloc(t) ({ 0; })
|
||||
#define audit_free(t) do { ; } while (0)
|
||||
#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
|
||||
#define audit_syscall_exit(r) do { ; } while (0)
|
||||
#define audit_dummy_context() 1
|
||||
#define audit_getname(n) do { ; } while (0)
|
||||
#define audit_putname(n) do { ; } while (0)
|
||||
#define __audit_inode(n,d) do { ; } while (0)
|
||||
#define __audit_inode_child(i,p) do { ; } while (0)
|
||||
#define audit_inode(n,d) do { (void)(d); } while (0)
|
||||
#define audit_inode_child(i,p) do { ; } while (0)
|
||||
#define audit_core_dumps(i) do { ; } while (0)
|
||||
#define audit_seccomp(i,s,c) do { ; } while (0)
|
||||
#define auditsc_get_stamp(c,t,s) (0)
|
||||
#define audit_get_loginuid(t) (-1)
|
||||
#define audit_get_sessionid(t) (-1)
|
||||
#define audit_log_task_context(b) do { ; } while (0)
|
||||
#define audit_ipc_obj(i) ((void)0)
|
||||
#define audit_ipc_set_perm(q,u,g,m) ((void)0)
|
||||
#define audit_bprm(p) ({ 0; })
|
||||
#define audit_socketcall(n,a) ((void)0)
|
||||
#define audit_fd_pair(n,a) ((void)0)
|
||||
#define audit_sockaddr(len, addr) ({ 0; })
|
||||
#define audit_mq_open(o,m,a) ((void)0)
|
||||
#define audit_mq_sendrecv(d,l,p,t) ((void)0)
|
||||
#define audit_mq_notify(d,n) ((void)0)
|
||||
#define audit_mq_getsetattr(d,s) ((void)0)
|
||||
#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; })
|
||||
#define audit_log_capset(pid, ncr, ocr) ((void)0)
|
||||
#define audit_mmap_fd(fd, flags) ((void)0)
|
||||
#define audit_ptrace(t) ((void)0)
|
||||
static inline int audit_alloc(struct task_struct *task)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_free(struct task_struct *task)
|
||||
{ }
|
||||
static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
|
||||
unsigned long a1, unsigned long a2,
|
||||
unsigned long a3)
|
||||
{ }
|
||||
static inline void audit_syscall_exit(void *pt_regs)
|
||||
{ }
|
||||
static inline int audit_dummy_context(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
static inline void audit_getname(const char *name)
|
||||
{ }
|
||||
static inline void audit_putname(const char *name)
|
||||
{ }
|
||||
static inline void __audit_inode(const char *name, const struct dentry *dentry)
|
||||
{ }
|
||||
static inline void __audit_inode_child(const struct dentry *dentry,
|
||||
const struct inode *parent)
|
||||
{ }
|
||||
static inline void audit_inode(const char *name, const struct dentry *dentry)
|
||||
{ }
|
||||
static inline void audit_inode_child(const struct dentry *dentry,
|
||||
const struct inode *parent)
|
||||
{ }
|
||||
static inline void audit_core_dumps(long signr)
|
||||
{ }
|
||||
static inline void __audit_seccomp(unsigned long syscall, long signr, int code)
|
||||
{ }
|
||||
static inline void audit_seccomp(unsigned long syscall, long signr, int code)
|
||||
{ }
|
||||
static inline int auditsc_get_stamp(struct audit_context *ctx,
|
||||
struct timespec *t, unsigned int *serial)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
|
||||
{
|
||||
return INVALID_UID;
|
||||
}
|
||||
static inline int audit_get_sessionid(struct task_struct *tsk)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
static inline void audit_log_task_context(struct audit_buffer *ab)
|
||||
{ }
|
||||
static inline void audit_log_task_info(struct audit_buffer *ab,
|
||||
struct task_struct *tsk)
|
||||
{ }
|
||||
static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
{ }
|
||||
static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid,
|
||||
gid_t gid, umode_t mode)
|
||||
{ }
|
||||
static inline int audit_bprm(struct linux_binprm *bprm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_socketcall(int nargs, unsigned long *args)
|
||||
{ }
|
||||
static inline void audit_fd_pair(int fd1, int fd2)
|
||||
{ }
|
||||
static inline int audit_sockaddr(int len, void *addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
|
||||
{ }
|
||||
static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len,
|
||||
unsigned int msg_prio,
|
||||
const struct timespec *abs_timeout)
|
||||
{ }
|
||||
static inline void audit_mq_notify(mqd_t mqdes,
|
||||
const struct sigevent *notification)
|
||||
{ }
|
||||
static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
|
||||
{ }
|
||||
static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
|
||||
const struct cred *new,
|
||||
const struct cred *old)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_log_capset(pid_t pid, const struct cred *new,
|
||||
const struct cred *old)
|
||||
{ }
|
||||
static inline void audit_mmap_fd(int fd, int flags)
|
||||
{ }
|
||||
static inline void audit_ptrace(struct task_struct *t)
|
||||
{ }
|
||||
#define audit_n_rules 0
|
||||
#define audit_signals 0
|
||||
#endif /* CONFIG_AUDITSYSCALL */
|
||||
|
|
@ -677,7 +753,6 @@ extern void audit_log_n_hex(struct audit_buffer *ab,
|
|||
extern void audit_log_n_string(struct audit_buffer *ab,
|
||||
const char *buf,
|
||||
size_t n);
|
||||
#define audit_log_string(a,b) audit_log_n_string(a, b, strlen(b));
|
||||
extern void audit_log_n_untrustedstring(struct audit_buffer *ab,
|
||||
const char *string,
|
||||
size_t n);
|
||||
|
|
@ -694,34 +769,63 @@ extern void audit_log_lost(const char *message);
|
|||
#ifdef CONFIG_SECURITY
|
||||
extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
|
||||
#else
|
||||
#define audit_log_secctx(b,s) do { ; } while (0)
|
||||
static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid)
|
||||
{ }
|
||||
#endif
|
||||
|
||||
extern int audit_update_lsm_rules(void);
|
||||
|
||||
/* Private API (for audit.c only) */
|
||||
extern int audit_filter_user(struct netlink_skb_parms *cb);
|
||||
extern int audit_filter_user(void);
|
||||
extern int audit_filter_type(int type);
|
||||
extern int audit_receive_filter(int type, int pid, int uid, int seq,
|
||||
void *data, size_t datasz, uid_t loginuid,
|
||||
extern int audit_receive_filter(int type, int pid, int seq,
|
||||
void *data, size_t datasz, kuid_t loginuid,
|
||||
u32 sessionid, u32 sid);
|
||||
extern int audit_enabled;
|
||||
#else
|
||||
#define audit_log(c,g,t,f,...) do { ; } while (0)
|
||||
#define audit_log_start(c,g,t) ({ NULL; })
|
||||
#define audit_log_vformat(b,f,a) do { ; } while (0)
|
||||
#define audit_log_format(b,f,...) do { ; } while (0)
|
||||
#define audit_log_end(b) do { ; } while (0)
|
||||
#define audit_log_n_hex(a,b,l) do { ; } while (0)
|
||||
#define audit_log_n_string(a,c,l) do { ; } while (0)
|
||||
#define audit_log_string(a,c) do { ; } while (0)
|
||||
#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
|
||||
#define audit_log_untrustedstring(a,s) do { ; } while (0)
|
||||
#define audit_log_d_path(b, p, d) do { ; } while (0)
|
||||
#define audit_log_key(b, k) do { ; } while (0)
|
||||
#define audit_log_link_denied(o, l) do { ; } while (0)
|
||||
#define audit_log_secctx(b,s) do { ; } while (0)
|
||||
#else /* CONFIG_AUDIT */
|
||||
static inline __printf(4, 5)
|
||||
void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
|
||||
const char *fmt, ...)
|
||||
{ }
|
||||
static inline struct audit_buffer *audit_log_start(struct audit_context *ctx,
|
||||
gfp_t gfp_mask, int type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline __printf(2, 3)
|
||||
void audit_log_format(struct audit_buffer *ab, const char *fmt, ...)
|
||||
{ }
|
||||
static inline void audit_log_end(struct audit_buffer *ab)
|
||||
{ }
|
||||
static inline void audit_log_n_hex(struct audit_buffer *ab,
|
||||
const unsigned char *buf, size_t len)
|
||||
{ }
|
||||
static inline void audit_log_n_string(struct audit_buffer *ab,
|
||||
const char *buf, size_t n)
|
||||
{ }
|
||||
static inline void audit_log_n_untrustedstring(struct audit_buffer *ab,
|
||||
const char *string, size_t n)
|
||||
{ }
|
||||
static inline void audit_log_untrustedstring(struct audit_buffer *ab,
|
||||
const char *string)
|
||||
{ }
|
||||
static inline void audit_log_d_path(struct audit_buffer *ab,
|
||||
const char *prefix,
|
||||
const struct path *path)
|
||||
{ }
|
||||
static inline void audit_log_key(struct audit_buffer *ab, char *key)
|
||||
{ }
|
||||
static inline void audit_log_link_denied(const char *string,
|
||||
const struct path *link)
|
||||
{ }
|
||||
static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid)
|
||||
{ }
|
||||
#define audit_enabled 0
|
||||
#endif
|
||||
#endif /* CONFIG_AUDIT */
|
||||
static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
|
||||
{
|
||||
audit_log_n_string(ab, buf, strlen(buf));
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3,7 +3,20 @@
|
|||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
unsigned bcd2bin(unsigned char val) __attribute_const__;
|
||||
unsigned char bin2bcd(unsigned val) __attribute_const__;
|
||||
#define bcd2bin(x) \
|
||||
(__builtin_constant_p((u8 )(x)) ? \
|
||||
const_bcd2bin(x) : \
|
||||
_bcd2bin(x))
|
||||
|
||||
#define bin2bcd(x) \
|
||||
(__builtin_constant_p((u8 )(x)) ? \
|
||||
const_bin2bcd(x) : \
|
||||
_bin2bcd(x))
|
||||
|
||||
#define const_bcd2bin(x) (((x) & 0x0f) + ((x) >> 4) * 10)
|
||||
#define const_bin2bcd(x) ((((x) / 10) << 4) + (x) % 10)
|
||||
|
||||
unsigned _bcd2bin(unsigned char val) __attribute_const__;
|
||||
unsigned char _bin2bcd(unsigned val) __attribute_const__;
|
||||
|
||||
#endif /* _BCD_H */
|
||||
|
|
|
|||
22
include/linux/bcm2835_timer.h
Normal file
22
include/linux/bcm2835_timer.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright 2012 Simon Arlott
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BCM2835_TIMER_H
|
||||
#define __BCM2835_TIMER_H
|
||||
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
extern struct sys_timer bcm2835_timer;
|
||||
|
||||
#endif
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#include <linux/bcma/bcma_driver_gmac_cmn.h>
|
||||
#include <linux/ssb/ssb.h> /* SPROM sharing */
|
||||
|
||||
#include "bcma_regs.h"
|
||||
#include <linux/bcma/bcma_regs.h>
|
||||
|
||||
struct bcma_device;
|
||||
struct bcma_bus;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ struct linux_binprm {
|
|||
|
||||
/* Function parameter for binfmt->coredump */
|
||||
struct coredump_params {
|
||||
long signr;
|
||||
siginfo_t *siginfo;
|
||||
struct pt_regs *regs;
|
||||
struct file *file;
|
||||
unsigned long limit;
|
||||
|
|
@ -132,7 +132,6 @@ extern int copy_strings_kernel(int argc, const char *const *argv,
|
|||
struct linux_binprm *bprm);
|
||||
extern int prepare_bprm_creds(struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
|
||||
extern void set_binfmt(struct linux_binfmt *new);
|
||||
extern void free_bprm(struct linux_binprm *);
|
||||
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync)
|
|||
* it already be started by driver.
|
||||
*/
|
||||
#define RQ_NOMERGE_FLAGS \
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
|
||||
#define rq_mergeable(rq) \
|
||||
(!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
|
||||
(((rq)->cmd_flags & REQ_DISCARD) || \
|
||||
|
|
@ -894,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
|
|||
extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
|
||||
|
||||
extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
|
||||
extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
|
||||
struct scatterlist *sglist);
|
||||
extern void blk_dump_rq_flags(struct request *, char *);
|
||||
extern long nr_blockdev_pages(void);
|
||||
|
||||
|
|
@ -1139,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector
|
|||
& (lim->discard_granularity - 1);
|
||||
}
|
||||
|
||||
static inline int bdev_discard_alignment(struct block_device *bdev)
|
||||
{
|
||||
struct request_queue *q = bdev_get_queue(bdev);
|
||||
|
||||
if (bdev != bdev->bd_contains)
|
||||
return bdev->bd_part->discard_alignment;
|
||||
|
||||
return q->limits.discard_alignment;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
|
||||
{
|
||||
if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1)
|
||||
|
|
|
|||
|
|
@ -1,292 +0,0 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* cd1400.h -- cd1400 UART hardware info.
|
||||
*
|
||||
* Copyright (C) 1996-1998 Stallion Technologies
|
||||
* Copyright (C) 1994-1996 Greg Ungerer.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
#ifndef _CD1400_H
|
||||
#define _CD1400_H
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the number of async ports per cd1400 uart chip.
|
||||
*/
|
||||
#define CD1400_PORTS 4
|
||||
|
||||
/*
|
||||
* Define the cd1400 uarts internal FIFO sizes.
|
||||
*/
|
||||
#define CD1400_TXFIFOSIZE 12
|
||||
#define CD1400_RXFIFOSIZE 12
|
||||
|
||||
/*
|
||||
* Local RX FIFO thresh hold level. Also define the RTS thresh hold
|
||||
* based on the RX thresh hold.
|
||||
*/
|
||||
#define FIFO_RXTHRESHOLD 6
|
||||
#define FIFO_RTSTHRESHOLD 7
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the cd1400 register addresses. These are all the valid
|
||||
* registers with the cd1400. Some are global, some virtual, some
|
||||
* per port.
|
||||
*/
|
||||
#define GFRCR 0x40
|
||||
#define CAR 0x68
|
||||
#define GCR 0x4b
|
||||
#define SVRR 0x67
|
||||
#define RICR 0x44
|
||||
#define TICR 0x45
|
||||
#define MICR 0x46
|
||||
#define RIR 0x6b
|
||||
#define TIR 0x6a
|
||||
#define MIR 0x69
|
||||
#define PPR 0x7e
|
||||
|
||||
#define RIVR 0x43
|
||||
#define TIVR 0x42
|
||||
#define MIVR 0x41
|
||||
#define TDR 0x63
|
||||
#define RDSR 0x62
|
||||
#define MISR 0x4c
|
||||
#define EOSRR 0x60
|
||||
|
||||
#define LIVR 0x18
|
||||
#define CCR 0x05
|
||||
#define SRER 0x06
|
||||
#define COR1 0x08
|
||||
#define COR2 0x09
|
||||
#define COR3 0x0a
|
||||
#define COR4 0x1e
|
||||
#define COR5 0x1f
|
||||
#define CCSR 0x0b
|
||||
#define RDCR 0x0e
|
||||
#define SCHR1 0x1a
|
||||
#define SCHR2 0x1b
|
||||
#define SCHR3 0x1c
|
||||
#define SCHR4 0x1d
|
||||
#define SCRL 0x22
|
||||
#define SCRH 0x23
|
||||
#define LNC 0x24
|
||||
#define MCOR1 0x15
|
||||
#define MCOR2 0x16
|
||||
#define RTPR 0x21
|
||||
#define MSVR1 0x6c
|
||||
#define MSVR2 0x6d
|
||||
#define PSVR 0x6f
|
||||
#define RBPR 0x78
|
||||
#define RCOR 0x7c
|
||||
#define TBPR 0x72
|
||||
#define TCOR 0x76
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the set of baud rate clock divisors.
|
||||
*/
|
||||
#define CD1400_CLK0 8
|
||||
#define CD1400_CLK1 32
|
||||
#define CD1400_CLK2 128
|
||||
#define CD1400_CLK3 512
|
||||
#define CD1400_CLK4 2048
|
||||
|
||||
#define CD1400_NUMCLKS 5
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the clock pre-scalar value to be a 5 ms clock. This should be
|
||||
* OK for now. It would probably be better to make it 10 ms, but we
|
||||
* can't fit that divisor into 8 bits!
|
||||
*/
|
||||
#define PPR_SCALAR 244
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define values used to set character size options.
|
||||
*/
|
||||
#define COR1_CHL5 0x00
|
||||
#define COR1_CHL6 0x01
|
||||
#define COR1_CHL7 0x02
|
||||
#define COR1_CHL8 0x03
|
||||
|
||||
/*
|
||||
* Define values used to set the number of stop bits.
|
||||
*/
|
||||
#define COR1_STOP1 0x00
|
||||
#define COR1_STOP15 0x04
|
||||
#define COR1_STOP2 0x08
|
||||
|
||||
/*
|
||||
* Define values used to set the parity scheme in use.
|
||||
*/
|
||||
#define COR1_PARNONE 0x00
|
||||
#define COR1_PARFORCE 0x20
|
||||
#define COR1_PARENB 0x40
|
||||
#define COR1_PARIGNORE 0x10
|
||||
|
||||
#define COR1_PARODD 0x80
|
||||
#define COR1_PAREVEN 0x00
|
||||
|
||||
#define COR2_IXM 0x80
|
||||
#define COR2_TXIBE 0x40
|
||||
#define COR2_ETC 0x20
|
||||
#define COR2_LLM 0x10
|
||||
#define COR2_RLM 0x08
|
||||
#define COR2_RTSAO 0x04
|
||||
#define COR2_CTSAE 0x02
|
||||
|
||||
#define COR3_SCDRNG 0x80
|
||||
#define COR3_SCD34 0x40
|
||||
#define COR3_FCT 0x20
|
||||
#define COR3_SCD12 0x10
|
||||
|
||||
/*
|
||||
* Define values used by COR4.
|
||||
*/
|
||||
#define COR4_BRKINT 0x08
|
||||
#define COR4_IGNBRK 0x18
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the modem control register values.
|
||||
* Note that the actual hardware is a little different to the conventional
|
||||
* pin names on the cd1400.
|
||||
*/
|
||||
#define MSVR1_DTR 0x01
|
||||
#define MSVR1_DSR 0x10
|
||||
#define MSVR1_RI 0x20
|
||||
#define MSVR1_CTS 0x40
|
||||
#define MSVR1_DCD 0x80
|
||||
|
||||
#define MSVR2_RTS 0x02
|
||||
#define MSVR2_DSR 0x10
|
||||
#define MSVR2_RI 0x20
|
||||
#define MSVR2_CTS 0x40
|
||||
#define MSVR2_DCD 0x80
|
||||
|
||||
#define MCOR1_DCD 0x80
|
||||
#define MCOR1_CTS 0x40
|
||||
#define MCOR1_RI 0x20
|
||||
#define MCOR1_DSR 0x10
|
||||
|
||||
#define MCOR2_DCD 0x80
|
||||
#define MCOR2_CTS 0x40
|
||||
#define MCOR2_RI 0x20
|
||||
#define MCOR2_DSR 0x10
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the bits used with the service (interrupt) enable register.
|
||||
*/
|
||||
#define SRER_NNDT 0x01
|
||||
#define SRER_TXEMPTY 0x02
|
||||
#define SRER_TXDATA 0x04
|
||||
#define SRER_RXDATA 0x10
|
||||
#define SRER_MODEM 0x80
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define operational commands for the command register.
|
||||
*/
|
||||
#define CCR_RESET 0x80
|
||||
#define CCR_CORCHANGE 0x4e
|
||||
#define CCR_SENDCH 0x20
|
||||
#define CCR_CHANCTRL 0x10
|
||||
|
||||
#define CCR_TXENABLE (CCR_CHANCTRL | 0x08)
|
||||
#define CCR_TXDISABLE (CCR_CHANCTRL | 0x04)
|
||||
#define CCR_RXENABLE (CCR_CHANCTRL | 0x02)
|
||||
#define CCR_RXDISABLE (CCR_CHANCTRL | 0x01)
|
||||
|
||||
#define CCR_SENDSCHR1 (CCR_SENDCH | 0x01)
|
||||
#define CCR_SENDSCHR2 (CCR_SENDCH | 0x02)
|
||||
#define CCR_SENDSCHR3 (CCR_SENDCH | 0x03)
|
||||
#define CCR_SENDSCHR4 (CCR_SENDCH | 0x04)
|
||||
|
||||
#define CCR_RESETCHAN (CCR_RESET | 0x00)
|
||||
#define CCR_RESETFULL (CCR_RESET | 0x01)
|
||||
#define CCR_TXFLUSHFIFO (CCR_RESET | 0x02)
|
||||
|
||||
#define CCR_MAXWAIT 10000
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the valid acknowledgement types (for hw ack cycle).
|
||||
*/
|
||||
#define ACK_TYPMASK 0x07
|
||||
#define ACK_TYPTX 0x02
|
||||
#define ACK_TYPMDM 0x01
|
||||
#define ACK_TYPRXGOOD 0x03
|
||||
#define ACK_TYPRXBAD 0x07
|
||||
|
||||
#define SVRR_RX 0x01
|
||||
#define SVRR_TX 0x02
|
||||
#define SVRR_MDM 0x04
|
||||
|
||||
#define ST_OVERRUN 0x01
|
||||
#define ST_FRAMING 0x02
|
||||
#define ST_PARITY 0x04
|
||||
#define ST_BREAK 0x08
|
||||
#define ST_SCHAR1 0x10
|
||||
#define ST_SCHAR2 0x20
|
||||
#define ST_SCHAR3 0x30
|
||||
#define ST_SCHAR4 0x40
|
||||
#define ST_RANGE 0x70
|
||||
#define ST_SCHARMASK 0x70
|
||||
#define ST_TIMEOUT 0x80
|
||||
|
||||
#define MISR_DCD 0x80
|
||||
#define MISR_CTS 0x40
|
||||
#define MISR_RI 0x20
|
||||
#define MISR_DSR 0x10
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Defines for the CCSR status register.
|
||||
*/
|
||||
#define CCSR_RXENABLED 0x80
|
||||
#define CCSR_RXFLOWON 0x40
|
||||
#define CCSR_RXFLOWOFF 0x20
|
||||
#define CCSR_TXENABLED 0x08
|
||||
#define CCSR_TXFLOWON 0x04
|
||||
#define CCSR_TXFLOWOFF 0x02
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the embedded commands.
|
||||
*/
|
||||
#define ETC_CMD 0x00
|
||||
#define ETC_STARTBREAK 0x81
|
||||
#define ETC_DELAY 0x82
|
||||
#define ETC_STOPBREAK 0x83
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
||||
|
|
@ -1,486 +0,0 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* cdk.h -- CDK interface definitions.
|
||||
*
|
||||
* Copyright (C) 1996-1998 Stallion Technologies
|
||||
* Copyright (C) 1994-1996 Greg Ungerer.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
#ifndef _CDK_H
|
||||
#define _CDK_H
|
||||
/*****************************************************************************/
|
||||
|
||||
#pragma pack(2)
|
||||
|
||||
/*
|
||||
* The following set of definitions is used to communicate with the
|
||||
* shared memory interface of the Stallion intelligent multiport serial
|
||||
* boards. The definitions in this file are taken directly from the
|
||||
* document titled "Generic Stackable Interface, Downloader and
|
||||
* Communications Development Kit".
|
||||
*/
|
||||
|
||||
/*
|
||||
* Define the set of important shared memory addresses. These are
|
||||
* required to initialize the board and get things started. All of these
|
||||
* addresses are relative to the start of the shared memory.
|
||||
*/
|
||||
#define CDK_SIGADDR 0x200
|
||||
#define CDK_FEATADDR 0x280
|
||||
#define CDK_CDKADDR 0x300
|
||||
#define CDK_RDYADDR 0x262
|
||||
|
||||
#define CDK_ALIVEMARKER 13
|
||||
|
||||
/*
|
||||
* On hardware power up the ROMs located on the EasyConnection 8/64 will
|
||||
* fill out the following signature information into shared memory. This
|
||||
* way the host system can quickly determine that the board is present
|
||||
* and is operational.
|
||||
*/
|
||||
typedef struct cdkecpsig {
|
||||
unsigned long magic;
|
||||
unsigned short romver;
|
||||
unsigned short cputype;
|
||||
unsigned char panelid[8];
|
||||
} cdkecpsig_t;
|
||||
|
||||
#define ECP_MAGIC 0x21504345
|
||||
|
||||
/*
|
||||
* On hardware power up the ROMs located on the ONboard, Stallion and
|
||||
* Brumbys will fill out the following signature information into shared
|
||||
* memory. This way the host system can quickly determine that the board
|
||||
* is present and is operational.
|
||||
*/
|
||||
typedef struct cdkonbsig {
|
||||
unsigned short magic0;
|
||||
unsigned short magic1;
|
||||
unsigned short magic2;
|
||||
unsigned short magic3;
|
||||
unsigned short romver;
|
||||
unsigned short memoff;
|
||||
unsigned short memseg;
|
||||
unsigned short amask0;
|
||||
unsigned short pic;
|
||||
unsigned short status;
|
||||
unsigned short btype;
|
||||
unsigned short clkticks;
|
||||
unsigned short clkspeed;
|
||||
unsigned short amask1;
|
||||
unsigned short amask2;
|
||||
} cdkonbsig_t;
|
||||
|
||||
#define ONB_MAGIC0 0xf2a7
|
||||
#define ONB_MAGIC1 0xa149
|
||||
#define ONB_MAGIC2 0x6352
|
||||
#define ONB_MAGIC3 0xf121
|
||||
|
||||
/*
|
||||
* Define the feature area structure. The feature area is the set of
|
||||
* startup parameters used by the slave image when it starts executing.
|
||||
* They allow for the specification of buffer sizes, debug trace, etc.
|
||||
*/
|
||||
typedef struct cdkfeature {
|
||||
unsigned long debug;
|
||||
unsigned long banner;
|
||||
unsigned long etype;
|
||||
unsigned long nrdevs;
|
||||
unsigned long brdspec;
|
||||
unsigned long txrqsize;
|
||||
unsigned long rxrqsize;
|
||||
unsigned long flags;
|
||||
} cdkfeature_t;
|
||||
|
||||
#define ETYP_DDK 0
|
||||
#define ETYP_CDK 1
|
||||
|
||||
/*
|
||||
* Define the CDK header structure. This is the info that the slave
|
||||
* environment sets up after it has been downloaded and started. It
|
||||
* essentially provides a memory map for the shared memory interface.
|
||||
*/
|
||||
typedef struct cdkhdr {
|
||||
unsigned short command;
|
||||
unsigned short status;
|
||||
unsigned short port;
|
||||
unsigned short mode;
|
||||
unsigned long cmd_buf[14];
|
||||
unsigned short alive_cnt;
|
||||
unsigned short intrpt_mode;
|
||||
unsigned char intrpt_id[8];
|
||||
unsigned char ver_release;
|
||||
unsigned char ver_modification;
|
||||
unsigned char ver_fix;
|
||||
unsigned char deadman_restart;
|
||||
unsigned short deadman;
|
||||
unsigned short nrdevs;
|
||||
unsigned long memp;
|
||||
unsigned long hostp;
|
||||
unsigned long slavep;
|
||||
unsigned char hostreq;
|
||||
unsigned char slavereq;
|
||||
unsigned char cmd_reserved[30];
|
||||
} cdkhdr_t;
|
||||
|
||||
#define MODE_DDK 0
|
||||
#define MODE_CDK 1
|
||||
|
||||
#define IMD_INTR 0x0
|
||||
#define IMD_PPINTR 0x1
|
||||
#define IMD_POLL 0xff
|
||||
|
||||
/*
|
||||
* Define the memory mapping structure. This structure is pointed to by
|
||||
* the memp field in the stlcdkhdr struct. As many as these structures
|
||||
* as required are laid out in shared memory to define how the rest of
|
||||
* shared memory is divided up. There will be one for each port.
|
||||
*/
|
||||
typedef struct cdkmem {
|
||||
unsigned short dtype;
|
||||
unsigned long offset;
|
||||
} cdkmem_t;
|
||||
|
||||
#define TYP_UNDEFINED 0x0
|
||||
#define TYP_ASYNCTRL 0x1
|
||||
#define TYP_ASYNC 0x20
|
||||
#define TYP_PARALLEL 0x40
|
||||
#define TYP_SYNCX21 0x60
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Following is a set of defines and structures used to actually deal
|
||||
* with the serial ports on the board. Firstly is the set of commands
|
||||
* that can be applied to ports.
|
||||
*/
|
||||
#define ASYCMD (((unsigned long) 'a') << 8)
|
||||
|
||||
#define A_NULL (ASYCMD | 0)
|
||||
#define A_FLUSH (ASYCMD | 1)
|
||||
#define A_BREAK (ASYCMD | 2)
|
||||
#define A_GETPORT (ASYCMD | 3)
|
||||
#define A_SETPORT (ASYCMD | 4)
|
||||
#define A_SETPORTF (ASYCMD | 5)
|
||||
#define A_SETPORTFTX (ASYCMD | 6)
|
||||
#define A_SETPORTFRX (ASYCMD | 7)
|
||||
#define A_GETSIGNALS (ASYCMD | 8)
|
||||
#define A_SETSIGNALS (ASYCMD | 9)
|
||||
#define A_SETSIGNALSF (ASYCMD | 10)
|
||||
#define A_SETSIGNALSFTX (ASYCMD | 11)
|
||||
#define A_SETSIGNALSFRX (ASYCMD | 12)
|
||||
#define A_GETNOTIFY (ASYCMD | 13)
|
||||
#define A_SETNOTIFY (ASYCMD | 14)
|
||||
#define A_NOTIFY (ASYCMD | 15)
|
||||
#define A_PORTCTRL (ASYCMD | 16)
|
||||
#define A_GETSTATS (ASYCMD | 17)
|
||||
#define A_RQSTATE (ASYCMD | 18)
|
||||
#define A_FLOWSTATE (ASYCMD | 19)
|
||||
#define A_CLEARSTATS (ASYCMD | 20)
|
||||
|
||||
/*
|
||||
* Define those arguments used for simple commands.
|
||||
*/
|
||||
#define FLUSHRX 0x1
|
||||
#define FLUSHTX 0x2
|
||||
|
||||
#define BREAKON -1
|
||||
#define BREAKOFF -2
|
||||
|
||||
/*
|
||||
* Define the port setting structure, and all those defines that go along
|
||||
* with it. Basically this structure defines the characteristics of this
|
||||
* port: baud rate, chars, parity, input/output char cooking etc.
|
||||
*/
|
||||
typedef struct asyport {
|
||||
unsigned long baudout;
|
||||
unsigned long baudin;
|
||||
unsigned long iflag;
|
||||
unsigned long oflag;
|
||||
unsigned long lflag;
|
||||
unsigned long pflag;
|
||||
unsigned long flow;
|
||||
unsigned long spare1;
|
||||
unsigned short vtime;
|
||||
unsigned short vmin;
|
||||
unsigned short txlo;
|
||||
unsigned short txhi;
|
||||
unsigned short rxlo;
|
||||
unsigned short rxhi;
|
||||
unsigned short rxhog;
|
||||
unsigned short spare2;
|
||||
unsigned char csize;
|
||||
unsigned char stopbs;
|
||||
unsigned char parity;
|
||||
unsigned char stopin;
|
||||
unsigned char startin;
|
||||
unsigned char stopout;
|
||||
unsigned char startout;
|
||||
unsigned char parmark;
|
||||
unsigned char brkmark;
|
||||
unsigned char cc[11];
|
||||
} asyport_t;
|
||||
|
||||
#define PT_STOP1 0x0
|
||||
#define PT_STOP15 0x1
|
||||
#define PT_STOP2 0x2
|
||||
|
||||
#define PT_NOPARITY 0x0
|
||||
#define PT_ODDPARITY 0x1
|
||||
#define PT_EVENPARITY 0x2
|
||||
#define PT_MARKPARITY 0x3
|
||||
#define PT_SPACEPARITY 0x4
|
||||
|
||||
#define F_NONE 0x0
|
||||
#define F_IXON 0x1
|
||||
#define F_IXOFF 0x2
|
||||
#define F_IXANY 0x4
|
||||
#define F_IOXANY 0x8
|
||||
#define F_RTSFLOW 0x10
|
||||
#define F_CTSFLOW 0x20
|
||||
#define F_DTRFLOW 0x40
|
||||
#define F_DCDFLOW 0x80
|
||||
#define F_DSROFLOW 0x100
|
||||
#define F_DSRIFLOW 0x200
|
||||
|
||||
#define FI_NORX 0x1
|
||||
#define FI_RAW 0x2
|
||||
#define FI_ISTRIP 0x4
|
||||
#define FI_UCLC 0x8
|
||||
#define FI_INLCR 0x10
|
||||
#define FI_ICRNL 0x20
|
||||
#define FI_IGNCR 0x40
|
||||
#define FI_IGNBREAK 0x80
|
||||
#define FI_DSCRDBREAK 0x100
|
||||
#define FI_1MARKBREAK 0x200
|
||||
#define FI_2MARKBREAK 0x400
|
||||
#define FI_XCHNGBREAK 0x800
|
||||
#define FI_IGNRXERRS 0x1000
|
||||
#define FI_DSCDRXERRS 0x2000
|
||||
#define FI_1MARKRXERRS 0x4000
|
||||
#define FI_2MARKRXERRS 0x8000
|
||||
#define FI_XCHNGRXERRS 0x10000
|
||||
#define FI_DSCRDNULL 0x20000
|
||||
|
||||
#define FO_OLCUC 0x1
|
||||
#define FO_ONLCR 0x2
|
||||
#define FO_OOCRNL 0x4
|
||||
#define FO_ONOCR 0x8
|
||||
#define FO_ONLRET 0x10
|
||||
#define FO_ONL 0x20
|
||||
#define FO_OBS 0x40
|
||||
#define FO_OVT 0x80
|
||||
#define FO_OFF 0x100
|
||||
#define FO_OTAB1 0x200
|
||||
#define FO_OTAB2 0x400
|
||||
#define FO_OTAB3 0x800
|
||||
#define FO_OCR1 0x1000
|
||||
#define FO_OCR2 0x2000
|
||||
#define FO_OCR3 0x4000
|
||||
#define FO_OFILL 0x8000
|
||||
#define FO_ODELL 0x10000
|
||||
|
||||
#define P_RTSLOCK 0x1
|
||||
#define P_CTSLOCK 0x2
|
||||
#define P_MAPRTS 0x4
|
||||
#define P_MAPCTS 0x8
|
||||
#define P_LOOPBACK 0x10
|
||||
#define P_DTRFOLLOW 0x20
|
||||
#define P_FAKEDCD 0x40
|
||||
|
||||
#define P_RXIMIN 0x10000
|
||||
#define P_RXITIME 0x20000
|
||||
#define P_RXTHOLD 0x40000
|
||||
|
||||
/*
|
||||
* Define a structure to communicate serial port signal and data state
|
||||
* information.
|
||||
*/
|
||||
typedef struct asysigs {
|
||||
unsigned long data;
|
||||
unsigned long signal;
|
||||
unsigned long sigvalue;
|
||||
} asysigs_t;
|
||||
|
||||
#define DT_TXBUSY 0x1
|
||||
#define DT_TXEMPTY 0x2
|
||||
#define DT_TXLOW 0x4
|
||||
#define DT_TXHIGH 0x8
|
||||
#define DT_TXFULL 0x10
|
||||
#define DT_TXHOG 0x20
|
||||
#define DT_TXFLOWED 0x40
|
||||
#define DT_TXBREAK 0x80
|
||||
|
||||
#define DT_RXBUSY 0x100
|
||||
#define DT_RXEMPTY 0x200
|
||||
#define DT_RXLOW 0x400
|
||||
#define DT_RXHIGH 0x800
|
||||
#define DT_RXFULL 0x1000
|
||||
#define DT_RXHOG 0x2000
|
||||
#define DT_RXFLOWED 0x4000
|
||||
#define DT_RXBREAK 0x8000
|
||||
|
||||
#define SG_DTR 0x1
|
||||
#define SG_DCD 0x2
|
||||
#define SG_RTS 0x4
|
||||
#define SG_CTS 0x8
|
||||
#define SG_DSR 0x10
|
||||
#define SG_RI 0x20
|
||||
|
||||
/*
|
||||
* Define the notification setting structure. This is used to tell the
|
||||
* port what events we want to be informed about. Fields here use the
|
||||
* same defines as for the asysigs structure above.
|
||||
*/
|
||||
typedef struct asynotify {
|
||||
unsigned long ctrl;
|
||||
unsigned long data;
|
||||
unsigned long signal;
|
||||
unsigned long sigvalue;
|
||||
} asynotify_t;
|
||||
|
||||
/*
|
||||
* Define the port control structure. It is used to do fine grain
|
||||
* control operations on the port.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long rxctrl;
|
||||
unsigned long txctrl;
|
||||
char rximdch;
|
||||
char tximdch;
|
||||
char spare1;
|
||||
char spare2;
|
||||
} asyctrl_t;
|
||||
|
||||
#define CT_ENABLE 0x1
|
||||
#define CT_DISABLE 0x2
|
||||
#define CT_STOP 0x4
|
||||
#define CT_START 0x8
|
||||
#define CT_STARTFLOW 0x10
|
||||
#define CT_STOPFLOW 0x20
|
||||
#define CT_SENDCHR 0x40
|
||||
|
||||
/*
|
||||
* Define the stats structure kept for each port. This is a useful set
|
||||
* of data collected for each port on the slave. The A_GETSTATS command
|
||||
* is used to retrieve this data from the slave.
|
||||
*/
|
||||
typedef struct asystats {
|
||||
unsigned long opens;
|
||||
unsigned long txchars;
|
||||
unsigned long rxchars;
|
||||
unsigned long txringq;
|
||||
unsigned long rxringq;
|
||||
unsigned long txmsgs;
|
||||
unsigned long rxmsgs;
|
||||
unsigned long txflushes;
|
||||
unsigned long rxflushes;
|
||||
unsigned long overruns;
|
||||
unsigned long framing;
|
||||
unsigned long parity;
|
||||
unsigned long ringover;
|
||||
unsigned long lost;
|
||||
unsigned long rxstart;
|
||||
unsigned long rxstop;
|
||||
unsigned long txstart;
|
||||
unsigned long txstop;
|
||||
unsigned long dcdcnt;
|
||||
unsigned long dtrcnt;
|
||||
unsigned long ctscnt;
|
||||
unsigned long rtscnt;
|
||||
unsigned long dsrcnt;
|
||||
unsigned long ricnt;
|
||||
unsigned long txbreaks;
|
||||
unsigned long rxbreaks;
|
||||
unsigned long signals;
|
||||
unsigned long state;
|
||||
unsigned long hwid;
|
||||
} asystats_t;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* All command and control communication with a device on the slave is
|
||||
* via a control block in shared memory. Each device has its own control
|
||||
* block, defined by the following structure. The control block allows
|
||||
* the host to open, close and control the device on the slave.
|
||||
*/
|
||||
typedef struct cdkctrl {
|
||||
unsigned char open;
|
||||
unsigned char close;
|
||||
unsigned long openarg;
|
||||
unsigned long closearg;
|
||||
unsigned long cmd;
|
||||
unsigned long status;
|
||||
unsigned long args[32];
|
||||
} cdkctrl_t;
|
||||
|
||||
/*
|
||||
* Each device on the slave passes data to and from the host via a ring
|
||||
* queue in shared memory. Define a ring queue structure to hold the
|
||||
* vital information about each ring queue. Two ring queues will be
|
||||
* allocated for each port, one for receive data and one for transmit
|
||||
* data.
|
||||
*/
|
||||
typedef struct cdkasyrq {
|
||||
unsigned long offset;
|
||||
unsigned short size;
|
||||
unsigned short head;
|
||||
unsigned short tail;
|
||||
} cdkasyrq_t;
|
||||
|
||||
/*
|
||||
* Each asynchronous port is defined in shared memory by the following
|
||||
* structure. It contains a control block to command a device, and also
|
||||
* the necessary data channel information as well.
|
||||
*/
|
||||
typedef struct cdkasy {
|
||||
cdkctrl_t ctrl;
|
||||
unsigned short notify;
|
||||
asynotify_t changed;
|
||||
unsigned short receive;
|
||||
cdkasyrq_t rxq;
|
||||
unsigned short transmit;
|
||||
cdkasyrq_t txq;
|
||||
} cdkasy_t;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Define the set of ioctls used by the driver to do special things
|
||||
* to the board. These include interrupting it, and initializing
|
||||
* the driver after board startup and shutdown.
|
||||
*/
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define STL_BINTR _IO('s',20)
|
||||
#define STL_BSTART _IO('s',21)
|
||||
#define STL_BSTOP _IO('s',22)
|
||||
#define STL_BRESET _IO('s',23)
|
||||
|
||||
/*
|
||||
* Define a set of ioctl extensions, used to get at special stuff.
|
||||
*/
|
||||
#define STL_GETPFLAG _IO('s',80)
|
||||
#define STL_SETPFLAG _IO('s',81)
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
||||
|
|
@ -12,8 +12,8 @@
|
|||
#ifndef CEPH_FS_H
|
||||
#define CEPH_FS_H
|
||||
|
||||
#include "msgr.h"
|
||||
#include "rados.h"
|
||||
#include <linux/ceph/msgr.h>
|
||||
#include <linux/ceph/rados.h>
|
||||
|
||||
/*
|
||||
* subprotocol versions. when specific messages types or high-level
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef _FS_CEPH_DEBUGFS_H
|
||||
#define _FS_CEPH_DEBUGFS_H
|
||||
|
||||
#include "ceph_debug.h"
|
||||
#include "types.h"
|
||||
#include <linux/ceph/ceph_debug.h>
|
||||
#include <linux/ceph/types.h>
|
||||
|
||||
#define CEPH_DEFINE_SHOW_FUNC(name) \
|
||||
static int name##_open(struct inode *inode, struct file *file) \
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <linux/time.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
#include "types.h"
|
||||
#include <linux/ceph/types.h>
|
||||
|
||||
/*
|
||||
* in all cases,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _FS_CEPH_LIBCEPH_H
|
||||
#define _FS_CEPH_LIBCEPH_H
|
||||
|
||||
#include "ceph_debug.h"
|
||||
#include <linux/ceph/ceph_debug.h>
|
||||
|
||||
#include <asm/unaligned.h>
|
||||
#include <linux/backing-dev.h>
|
||||
|
|
@ -15,12 +15,12 @@
|
|||
#include <linux/writeback.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "messenger.h"
|
||||
#include "msgpool.h"
|
||||
#include "mon_client.h"
|
||||
#include "osd_client.h"
|
||||
#include "ceph_fs.h"
|
||||
#include <linux/ceph/types.h>
|
||||
#include <linux/ceph/messenger.h>
|
||||
#include <linux/ceph/msgpool.h>
|
||||
#include <linux/ceph/mon_client.h>
|
||||
#include <linux/ceph/osd_client.h>
|
||||
#include <linux/ceph/ceph_fs.h>
|
||||
|
||||
/*
|
||||
* mount options
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define _FS_CEPH_MDSMAP_H
|
||||
|
||||
#include <linux/bug.h>
|
||||
#include "types.h"
|
||||
#include <linux/ceph/types.h>
|
||||
|
||||
/*
|
||||
* mds map - describe servers in the mds cluster.
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
#include <linux/uio.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "buffer.h"
|
||||
#include <linux/ceph/types.h>
|
||||
#include <linux/ceph/buffer.h>
|
||||
|
||||
struct ceph_msg;
|
||||
struct ceph_connection;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <linux/kref.h>
|
||||
#include <linux/rbtree.h>
|
||||
|
||||
#include "messenger.h"
|
||||
#include <linux/ceph/messenger.h>
|
||||
|
||||
struct ceph_client;
|
||||
struct ceph_mount_args;
|
||||
|
|
@ -71,7 +71,6 @@ struct ceph_mon_client {
|
|||
int cur_mon; /* last monitor i contacted */
|
||||
unsigned long sub_sent, sub_renew_after;
|
||||
struct ceph_connection con;
|
||||
bool have_fsid;
|
||||
|
||||
/* pending generic requests */
|
||||
struct rb_root generic_request_tree;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define _FS_CEPH_MSGPOOL
|
||||
|
||||
#include <linux/mempool.h>
|
||||
#include "messenger.h"
|
||||
#include <linux/ceph/messenger.h>
|
||||
|
||||
/*
|
||||
* we use memory pools for preallocating messages we may receive, to
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
|
|||
extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
|
||||
struct ceph_msg *msg);
|
||||
|
||||
extern void ceph_calc_raw_layout(struct ceph_osd_client *osdc,
|
||||
extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc,
|
||||
struct ceph_file_layout *layout,
|
||||
u64 snapid,
|
||||
u64 off, u64 *plen, u64 *bno,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
#define _FS_CEPH_OSDMAP_H
|
||||
|
||||
#include <linux/rbtree.h>
|
||||
#include "types.h"
|
||||
#include "ceph_fs.h"
|
||||
#include <linux/ceph/types.h>
|
||||
#include <linux/ceph/ceph_fs.h>
|
||||
#include <linux/crush/crush.h>
|
||||
|
||||
/*
|
||||
|
|
@ -109,9 +109,9 @@ extern struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
|
|||
extern void ceph_osdmap_destroy(struct ceph_osdmap *map);
|
||||
|
||||
/* calculate mapping of a file extent to an object */
|
||||
extern void ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
|
||||
u64 off, u64 *plen,
|
||||
u64 *bno, u64 *oxoff, u64 *oxlen);
|
||||
extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
|
||||
u64 off, u64 *plen,
|
||||
u64 *bno, u64 *oxoff, u64 *oxlen);
|
||||
|
||||
/* calculate mapping of object to a placement group */
|
||||
extern int ceph_calc_object_layout(struct ceph_object_layout *ol,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* (Reliable Autonomic Distributed Object Store).
|
||||
*/
|
||||
|
||||
#include "msgr.h"
|
||||
#include <linux/ceph/msgr.h>
|
||||
|
||||
/*
|
||||
* osdmap encoding versions
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
#include <linux/fcntl.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include "ceph_fs.h"
|
||||
#include "ceph_frag.h"
|
||||
#include "ceph_hash.h"
|
||||
#include <linux/ceph/ceph_fs.h>
|
||||
#include <linux/ceph/ceph_frag.h>
|
||||
#include <linux/ceph/ceph_hash.h>
|
||||
|
||||
/*
|
||||
* Identify inodes by both their ino AND snapshot id (a u64).
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/rwsem.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/xattr.h>
|
||||
|
||||
#ifdef CONFIG_CGROUPS
|
||||
|
||||
|
|
@ -45,17 +46,13 @@ extern const struct file_operations proc_cgroup_operations;
|
|||
|
||||
/* Define the enumeration of all builtin cgroup subsystems */
|
||||
#define SUBSYS(_x) _x ## _subsys_id,
|
||||
#define IS_SUBSYS_ENABLED(option) IS_ENABLED(option)
|
||||
enum cgroup_subsys_id {
|
||||
#include <linux/cgroup_subsys.h>
|
||||
CGROUP_BUILTIN_SUBSYS_COUNT
|
||||
CGROUP_SUBSYS_COUNT,
|
||||
};
|
||||
#undef IS_SUBSYS_ENABLED
|
||||
#undef SUBSYS
|
||||
/*
|
||||
* This define indicates the maximum number of subsystems that can be loaded
|
||||
* at once. We limit to this many since cgroupfs_root has subsys_bits to keep
|
||||
* track of all of them.
|
||||
*/
|
||||
#define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long))
|
||||
|
||||
/* Per-subsystem/per-cgroup state maintained by the system. */
|
||||
struct cgroup_subsys_state {
|
||||
|
|
@ -216,6 +213,9 @@ struct cgroup {
|
|||
/* List of events which userspace want to receive */
|
||||
struct list_head event_list;
|
||||
spinlock_t event_list_lock;
|
||||
|
||||
/* directory xattrs */
|
||||
struct simple_xattrs xattrs;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -309,6 +309,9 @@ struct cftype {
|
|||
/* CFTYPE_* flags */
|
||||
unsigned int flags;
|
||||
|
||||
/* file xattrs */
|
||||
struct simple_xattrs xattrs;
|
||||
|
||||
int (*open)(struct inode *inode, struct file *file);
|
||||
ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft,
|
||||
struct file *file,
|
||||
|
|
@ -394,7 +397,7 @@ struct cftype {
|
|||
*/
|
||||
struct cftype_set {
|
||||
struct list_head node; /* chained at subsys->cftsets */
|
||||
const struct cftype *cfts;
|
||||
struct cftype *cfts;
|
||||
};
|
||||
|
||||
struct cgroup_scanner {
|
||||
|
|
@ -406,8 +409,8 @@ struct cgroup_scanner {
|
|||
void *data;
|
||||
};
|
||||
|
||||
int cgroup_add_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts);
|
||||
int cgroup_rm_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts);
|
||||
int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
|
||||
int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
|
||||
|
||||
int cgroup_is_removed(const struct cgroup *cgrp);
|
||||
|
||||
|
|
@ -496,6 +499,21 @@ struct cgroup_subsys {
|
|||
*/
|
||||
bool __DEPRECATED_clear_css_refs;
|
||||
|
||||
/*
|
||||
* If %false, this subsystem is properly hierarchical -
|
||||
* configuration, resource accounting and restriction on a parent
|
||||
* cgroup cover those of its children. If %true, hierarchy support
|
||||
* is broken in some ways - some subsystems ignore hierarchy
|
||||
* completely while others are only implemented half-way.
|
||||
*
|
||||
* It's now disallowed to create nested cgroups if the subsystem is
|
||||
* broken and cgroup core will emit a warning message on such
|
||||
* cases. Eventually, all subsystems will be made properly
|
||||
* hierarchical and this will go away.
|
||||
*/
|
||||
bool broken_hierarchy;
|
||||
bool warned_broken_hierarchy;
|
||||
|
||||
#define MAX_CGROUP_TYPE_NAMELEN 32
|
||||
const char *name;
|
||||
|
||||
|
|
@ -521,7 +539,9 @@ struct cgroup_subsys {
|
|||
};
|
||||
|
||||
#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys;
|
||||
#define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option)
|
||||
#include <linux/cgroup_subsys.h>
|
||||
#undef IS_SUBSYS_ENABLED
|
||||
#undef SUBSYS
|
||||
|
||||
static inline struct cgroup_subsys_state *cgroup_subsys_state(
|
||||
|
|
|
|||
|
|
@ -7,73 +7,73 @@
|
|||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CPUSETS
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CPUSETS)
|
||||
SUBSYS(cpuset)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_DEBUG
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEBUG)
|
||||
SUBSYS(debug)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_SCHED
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_SCHED)
|
||||
SUBSYS(cpu_cgroup)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_CPUACCT
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_CPUACCT)
|
||||
SUBSYS(cpuacct)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_MEMCG
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_MEMCG)
|
||||
SUBSYS(mem_cgroup)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_DEVICE
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEVICE)
|
||||
SUBSYS(devices)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_FREEZER
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_FREEZER)
|
||||
SUBSYS(freezer)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_NET_CLS_CGROUP
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP)
|
||||
SUBSYS(net_cls)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_BLK_CGROUP)
|
||||
SUBSYS(blkio)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_PERF
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_PERF)
|
||||
SUBSYS(perf)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_NETPRIO_CGROUP
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP)
|
||||
SUBSYS(net_prio)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_HUGETLB
|
||||
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_HUGETLB)
|
||||
SUBSYS(hugetlb)
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
|
||||
#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
|
||||
#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
|
||||
#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
|
||||
|
||||
struct clk_hw;
|
||||
|
||||
|
|
@ -360,6 +361,11 @@ int of_clk_add_provider(struct device_node *np,
|
|||
void of_clk_del_provider(struct device_node *np);
|
||||
struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
|
||||
void *data);
|
||||
struct clk_onecell_data {
|
||||
struct clk **clks;
|
||||
unsigned int clk_num;
|
||||
};
|
||||
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
|
||||
const char *of_clk_get_parent_name(struct device_node *np, int index);
|
||||
void of_clk_init(const struct of_device_id *matches);
|
||||
|
||||
|
|
|
|||
24
include/linux/clk/bcm2835.h
Normal file
24
include/linux/clk/bcm2835.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2010 Broadcom
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_CLK_BCM2835_H_
|
||||
#define __LINUX_CLK_BCM2835_H_
|
||||
|
||||
void __init bcm2835_init_clocks(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -97,6 +97,8 @@ struct clock_event_device {
|
|||
void (*broadcast)(const struct cpumask *mask);
|
||||
void (*set_mode)(enum clock_event_mode mode,
|
||||
struct clock_event_device *);
|
||||
void (*suspend)(struct clock_event_device *);
|
||||
void (*resume)(struct clock_event_device *);
|
||||
unsigned long min_delta_ticks;
|
||||
unsigned long max_delta_ticks;
|
||||
|
||||
|
|
@ -156,6 +158,9 @@ clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec)
|
|||
freq, minsec);
|
||||
}
|
||||
|
||||
extern void clockevents_suspend(void);
|
||||
extern void clockevents_resume(void);
|
||||
|
||||
#ifdef CONFIG_GENERIC_CLOCKEVENTS
|
||||
extern void clockevents_notify(unsigned long reason, void *arg);
|
||||
#else
|
||||
|
|
@ -164,6 +169,9 @@ extern void clockevents_notify(unsigned long reason, void *arg);
|
|||
|
||||
#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
|
||||
|
||||
static inline void clockevents_suspend(void) {}
|
||||
static inline void clockevents_resume(void) {}
|
||||
|
||||
#define clockevents_notify(reason, arg) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
|
|||
extern int fragmentation_index(struct zone *zone, unsigned int order);
|
||||
extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
||||
int order, gfp_t gfp_mask, nodemask_t *mask,
|
||||
bool sync);
|
||||
bool sync, bool *contended, struct page **page);
|
||||
extern int compact_pgdat(pg_data_t *pgdat, int order);
|
||||
extern void reset_isolation_suitable(pg_data_t *pgdat);
|
||||
extern unsigned long compaction_suitable(struct zone *zone, int order);
|
||||
|
||||
/* Do not skip compaction more than 64 times */
|
||||
|
|
@ -61,10 +62,20 @@ static inline bool compaction_deferred(struct zone *zone, int order)
|
|||
return zone->compact_considered < defer_limit;
|
||||
}
|
||||
|
||||
/* Returns true if restarting compaction after many failures */
|
||||
static inline bool compaction_restarting(struct zone *zone, int order)
|
||||
{
|
||||
if (order < zone->compact_order_failed)
|
||||
return false;
|
||||
|
||||
return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT &&
|
||||
zone->compact_considered >= 1UL << zone->compact_defer_shift;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
||||
int order, gfp_t gfp_mask, nodemask_t *nodemask,
|
||||
bool sync)
|
||||
bool sync, bool *contended, struct page **page)
|
||||
{
|
||||
return COMPACT_CONTINUE;
|
||||
}
|
||||
|
|
@ -74,6 +85,10 @@ static inline int compact_pgdat(pg_data_t *pgdat, int order)
|
|||
return COMPACT_CONTINUE;
|
||||
}
|
||||
|
||||
static inline void reset_isolation_suitable(pg_data_t *pgdat)
|
||||
{
|
||||
}
|
||||
|
||||
static inline unsigned long compaction_suitable(struct zone *zone, int order)
|
||||
{
|
||||
return COMPACT_SKIPPED;
|
||||
|
|
|
|||
|
|
@ -160,11 +160,6 @@ struct compat_ustat {
|
|||
char f_fpack[6];
|
||||
};
|
||||
|
||||
typedef union compat_sigval {
|
||||
compat_int_t sival_int;
|
||||
compat_uptr_t sival_ptr;
|
||||
} compat_sigval_t;
|
||||
|
||||
#define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
|
||||
|
||||
typedef struct compat_sigevent {
|
||||
|
|
@ -590,6 +585,9 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
|
|||
unsigned long liovcnt, const struct compat_iovec __user *rvec,
|
||||
unsigned long riovcnt, unsigned long flags);
|
||||
|
||||
asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
|
||||
compat_off_t __user *offset, compat_size_t count);
|
||||
|
||||
#else
|
||||
|
||||
#define is_compat_task() (0)
|
||||
|
|
|
|||
|
|
@ -49,6 +49,13 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 6
|
||||
/*
|
||||
* Tell the optimizer that something else uses this function or variable.
|
||||
*/
|
||||
#define __visible __attribute__((externally_visible))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ > 0
|
||||
#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -278,6 +278,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
|
|||
# define __section(S) __attribute__ ((__section__(#S)))
|
||||
#endif
|
||||
|
||||
#ifndef __visible
|
||||
#define __visible
|
||||
#endif
|
||||
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#ifndef __same_type
|
||||
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
|
|
|
|||
|
|
@ -1,119 +0,0 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* comstats.h -- Serial Port Stats.
|
||||
*
|
||||
* Copyright (C) 1996-1998 Stallion Technologies
|
||||
* Copyright (C) 1994-1996 Greg Ungerer.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
#ifndef _COMSTATS_H
|
||||
#define _COMSTATS_H
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Serial port stats structure. The structure itself is UART
|
||||
* independent, but some fields may be UART/driver specific (for
|
||||
* example state).
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned long brd;
|
||||
unsigned long panel;
|
||||
unsigned long port;
|
||||
unsigned long hwid;
|
||||
unsigned long type;
|
||||
unsigned long txtotal;
|
||||
unsigned long rxtotal;
|
||||
unsigned long txbuffered;
|
||||
unsigned long rxbuffered;
|
||||
unsigned long rxoverrun;
|
||||
unsigned long rxparity;
|
||||
unsigned long rxframing;
|
||||
unsigned long rxlost;
|
||||
unsigned long txbreaks;
|
||||
unsigned long rxbreaks;
|
||||
unsigned long txxon;
|
||||
unsigned long txxoff;
|
||||
unsigned long rxxon;
|
||||
unsigned long rxxoff;
|
||||
unsigned long txctson;
|
||||
unsigned long txctsoff;
|
||||
unsigned long rxrtson;
|
||||
unsigned long rxrtsoff;
|
||||
unsigned long modem;
|
||||
unsigned long state;
|
||||
unsigned long flags;
|
||||
unsigned long ttystate;
|
||||
unsigned long cflags;
|
||||
unsigned long iflags;
|
||||
unsigned long oflags;
|
||||
unsigned long lflags;
|
||||
unsigned long signals;
|
||||
} comstats_t;
|
||||
|
||||
|
||||
/*
|
||||
* Board stats structure. Returns useful info about the board.
|
||||
*/
|
||||
|
||||
#define COM_MAXPANELS 8
|
||||
|
||||
typedef struct {
|
||||
unsigned long panel;
|
||||
unsigned long type;
|
||||
unsigned long hwid;
|
||||
unsigned long nrports;
|
||||
} companel_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned long brd;
|
||||
unsigned long type;
|
||||
unsigned long hwid;
|
||||
unsigned long state;
|
||||
unsigned long ioaddr;
|
||||
unsigned long ioaddr2;
|
||||
unsigned long memaddr;
|
||||
unsigned long irq;
|
||||
unsigned long nrpanels;
|
||||
unsigned long nrports;
|
||||
companel_t panels[COM_MAXPANELS];
|
||||
} combrd_t;
|
||||
|
||||
|
||||
/*
|
||||
* Define the ioctl operations for stats stuff.
|
||||
*/
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define COM_GETPORTSTATS _IO('c',30)
|
||||
#define COM_CLRPORTSTATS _IO('c',31)
|
||||
#define COM_GETBRDSTATS _IO('c',32)
|
||||
|
||||
|
||||
/*
|
||||
* Define the set of ioctls that give user level access to the
|
||||
* private port, panel and board structures. The argument required
|
||||
* will be driver dependent!
|
||||
*/
|
||||
#define COM_READPORT _IO('c',40)
|
||||
#define COM_READBOARD _IO('c',41)
|
||||
#define COM_READPANEL _IO('c',42)
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
||||
|
|
@ -11,5 +11,10 @@
|
|||
*/
|
||||
extern int dump_write(struct file *file, const void *addr, int nr);
|
||||
extern int dump_seek(struct file *file, loff_t off);
|
||||
#ifdef CONFIG_COREDUMP
|
||||
extern void do_coredump(siginfo_t *siginfo, struct pt_regs *regs);
|
||||
#else
|
||||
static inline void do_coredump(siginfo_t *siginfo, struct pt_regs *regs) {}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_COREDUMP_H */
|
||||
|
|
|
|||
|
|
@ -194,6 +194,10 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; }
|
|||
|
||||
#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
|
||||
void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a);
|
||||
#else
|
||||
static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* LGPL2
|
||||
*/
|
||||
|
||||
#include "crush.h"
|
||||
#include <linux/crush/crush.h>
|
||||
|
||||
extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size);
|
||||
extern int crush_do_rule(const struct crush_map *map,
|
||||
|
|
|
|||
|
|
@ -206,6 +206,8 @@ struct dentry_operations {
|
|||
#define DCACHE_MANAGED_DENTRY \
|
||||
(DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
|
||||
|
||||
#define DCACHE_DENTRY_KILLED 0x100000
|
||||
|
||||
extern seqlock_t rename_lock;
|
||||
|
||||
static inline int dname_external(struct dentry *dentry)
|
||||
|
|
|
|||
|
|
@ -536,6 +536,10 @@ extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
|
|||
#else
|
||||
extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp);
|
||||
#endif
|
||||
extern void devres_for_each_res(struct device *dev, dr_release_t release,
|
||||
dr_match_t match, void *match_data,
|
||||
void (*fn)(struct device *, void *, void *),
|
||||
void *data);
|
||||
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,
|
||||
|
|
@ -772,6 +776,13 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
|
|||
dev->power.ignore_children = enable;
|
||||
}
|
||||
|
||||
static inline void dev_pm_syscore_device(struct device *dev, bool val)
|
||||
{
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
dev->power.syscore = val;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void device_lock(struct device *dev)
|
||||
{
|
||||
mutex_lock(&dev->mutex);
|
||||
|
|
@ -891,12 +902,15 @@ extern const char *dev_driver_string(const struct device *dev);
|
|||
|
||||
#ifdef CONFIG_PRINTK
|
||||
|
||||
extern int __dev_printk(const char *level, const struct device *dev,
|
||||
struct va_format *vaf);
|
||||
extern __printf(3, 0)
|
||||
int dev_vprintk_emit(int level, const struct device *dev,
|
||||
const char *fmt, va_list args);
|
||||
extern __printf(3, 4)
|
||||
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
|
||||
|
||||
extern __printf(3, 4)
|
||||
int dev_printk(const char *level, const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
;
|
||||
const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int dev_emerg(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
|
|
@ -914,6 +928,14 @@ int _dev_info(const struct device *dev, const char *fmt, ...);
|
|||
|
||||
#else
|
||||
|
||||
static inline __printf(3, 0)
|
||||
int dev_vprintk_emit(int level, const struct device *dev,
|
||||
const char *fmt, va_list args)
|
||||
{ return 0; }
|
||||
static inline __printf(3, 4)
|
||||
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
|
||||
static inline int __dev_printk(const char *level, const struct device *dev,
|
||||
struct va_format *vaf)
|
||||
{ return 0; }
|
||||
|
|
@ -946,32 +968,6 @@ int _dev_info(const struct device *dev, const char *fmt, ...)
|
|||
|
||||
#endif
|
||||
|
||||
#define dev_level_ratelimited(dev_level, dev, fmt, ...) \
|
||||
do { \
|
||||
static DEFINE_RATELIMIT_STATE(_rs, \
|
||||
DEFAULT_RATELIMIT_INTERVAL, \
|
||||
DEFAULT_RATELIMIT_BURST); \
|
||||
if (__ratelimit(&_rs)) \
|
||||
dev_level(dev, fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define dev_emerg_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_alert_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_crit_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_err_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_warn_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_notice_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_info_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_dbg_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_dbg, dev, fmt, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Stupid hackaround for existing uses of non-printk uses dev_info
|
||||
*
|
||||
|
|
@ -998,6 +994,46 @@ do { \
|
|||
})
|
||||
#endif
|
||||
|
||||
#define dev_level_ratelimited(dev_level, dev, fmt, ...) \
|
||||
do { \
|
||||
static DEFINE_RATELIMIT_STATE(_rs, \
|
||||
DEFAULT_RATELIMIT_INTERVAL, \
|
||||
DEFAULT_RATELIMIT_BURST); \
|
||||
if (__ratelimit(&_rs)) \
|
||||
dev_level(dev, fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define dev_emerg_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_alert_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_crit_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_err_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_warn_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_notice_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
|
||||
#define dev_info_ratelimited(dev, fmt, ...) \
|
||||
dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
|
||||
#define dev_dbg_ratelimited(dev, fmt, ...) \
|
||||
do { \
|
||||
static DEFINE_RATELIMIT_STATE(_rs, \
|
||||
DEFAULT_RATELIMIT_INTERVAL, \
|
||||
DEFAULT_RATELIMIT_BURST); \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
|
||||
if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \
|
||||
__ratelimit(&_rs)) \
|
||||
__dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
|
||||
##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define dev_dbg_ratelimited(dev, fmt, ...) \
|
||||
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifdef VERBOSE_DEBUG
|
||||
#define dev_vdbg dev_dbg
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ struct dma_device {
|
|||
struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
|
||||
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
|
||||
size_t period_len, enum dma_transfer_direction direction,
|
||||
void *context);
|
||||
unsigned long flags, void *context);
|
||||
struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
|
||||
struct dma_chan *chan, struct dma_interleaved_template *xt,
|
||||
unsigned long flags);
|
||||
|
|
@ -653,10 +653,11 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg(
|
|||
|
||||
static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic(
|
||||
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
|
||||
size_t period_len, enum dma_transfer_direction dir)
|
||||
size_t period_len, enum dma_transfer_direction dir,
|
||||
unsigned long flags)
|
||||
{
|
||||
return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
|
||||
period_len, dir, NULL);
|
||||
period_len, dir, flags, NULL);
|
||||
}
|
||||
|
||||
static inline int dmaengine_terminate_all(struct dma_chan *chan)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ enum packet_types {
|
|||
#define NL_INT64(pn, pr, member)
|
||||
#define NL_BIT(pn, pr, member)
|
||||
#define NL_STRING(pn, pr, member, len)
|
||||
#include "drbd_nl.h"
|
||||
#include <linux/drbd_nl.h>
|
||||
P_nl_after_last_packet,
|
||||
};
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ static const int tag_list_sizes[] = {
|
|||
#define NL_INT64(pn, pr, member) + 4 + 8
|
||||
#define NL_BIT(pn, pr, member) + 4 + 1
|
||||
#define NL_STRING(pn, pr, member, len) + 4 + (len)
|
||||
#include "drbd_nl.h"
|
||||
#include <linux/drbd_nl.h>
|
||||
};
|
||||
|
||||
/* The two highest bits are used for the tag type */
|
||||
|
|
@ -62,7 +62,7 @@ enum drbd_tags {
|
|||
#define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr ,
|
||||
#define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr ,
|
||||
#define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr ,
|
||||
#include "drbd_nl.h"
|
||||
#include <linux/drbd_nl.h>
|
||||
};
|
||||
|
||||
struct tag {
|
||||
|
|
@ -78,7 +78,7 @@ static const struct tag tag_descriptions[] = {
|
|||
#define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) },
|
||||
#define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) },
|
||||
#define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) },
|
||||
#include "drbd_nl.h"
|
||||
#include <linux/drbd_nl.h>
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ typedef enum fe_caps {
|
|||
FE_CAN_8VSB = 0x200000,
|
||||
FE_CAN_16VSB = 0x400000,
|
||||
FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
|
||||
FE_CAN_MULTISTREAM = 0x4000000, /* frontend supports multistream filtering */
|
||||
FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */
|
||||
FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
|
||||
FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
|
||||
|
|
@ -121,16 +122,27 @@ typedef enum fe_sec_mini_cmd {
|
|||
} fe_sec_mini_cmd_t;
|
||||
|
||||
|
||||
/**
|
||||
* enum fe_status - enumerates the possible frontend status
|
||||
* @FE_HAS_SIGNAL: found something above the noise level
|
||||
* @FE_HAS_CARRIER: found a DVB signal
|
||||
* @FE_HAS_VITERBI: FEC is stable
|
||||
* @FE_HAS_SYNC: found sync bytes
|
||||
* @FE_HAS_LOCK: everything's working
|
||||
* @FE_TIMEDOUT: no lock within the last ~2 seconds
|
||||
* @FE_REINIT: frontend was reinitialized, application is recommended
|
||||
* to reset DiSEqC, tone and parameters
|
||||
*/
|
||||
|
||||
typedef enum fe_status {
|
||||
FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
|
||||
FE_HAS_CARRIER = 0x02, /* found a DVB signal */
|
||||
FE_HAS_VITERBI = 0x04, /* FEC is stable */
|
||||
FE_HAS_SYNC = 0x08, /* found sync bytes */
|
||||
FE_HAS_LOCK = 0x10, /* everything's working... */
|
||||
FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
|
||||
FE_REINIT = 0x40 /* frontend was reinitialized, */
|
||||
} fe_status_t; /* application is recommended to reset */
|
||||
/* DiSEqC, tone and parameters */
|
||||
FE_HAS_SIGNAL = 0x01,
|
||||
FE_HAS_CARRIER = 0x02,
|
||||
FE_HAS_VITERBI = 0x04,
|
||||
FE_HAS_SYNC = 0x08,
|
||||
FE_HAS_LOCK = 0x10,
|
||||
FE_TIMEDOUT = 0x20,
|
||||
FE_REINIT = 0x40,
|
||||
} fe_status_t;
|
||||
|
||||
typedef enum fe_spectral_inversion {
|
||||
INVERSION_OFF,
|
||||
|
|
@ -152,6 +164,7 @@ typedef enum fe_code_rate {
|
|||
FEC_AUTO,
|
||||
FEC_3_5,
|
||||
FEC_9_10,
|
||||
FEC_2_5,
|
||||
} fe_code_rate_t;
|
||||
|
||||
|
||||
|
|
@ -169,6 +182,7 @@ typedef enum fe_modulation {
|
|||
APSK_16,
|
||||
APSK_32,
|
||||
DQPSK,
|
||||
QAM_4_NR,
|
||||
} fe_modulation_t;
|
||||
|
||||
typedef enum fe_transmit_mode {
|
||||
|
|
@ -179,6 +193,8 @@ typedef enum fe_transmit_mode {
|
|||
TRANSMISSION_MODE_1K,
|
||||
TRANSMISSION_MODE_16K,
|
||||
TRANSMISSION_MODE_32K,
|
||||
TRANSMISSION_MODE_C1,
|
||||
TRANSMISSION_MODE_C3780,
|
||||
} fe_transmit_mode_t;
|
||||
|
||||
#if defined(__DVB_CORE__) || !defined (__KERNEL__)
|
||||
|
|
@ -202,6 +218,9 @@ typedef enum fe_guard_interval {
|
|||
GUARD_INTERVAL_1_128,
|
||||
GUARD_INTERVAL_19_128,
|
||||
GUARD_INTERVAL_19_256,
|
||||
GUARD_INTERVAL_PN420,
|
||||
GUARD_INTERVAL_PN595,
|
||||
GUARD_INTERVAL_PN945,
|
||||
} fe_guard_interval_t;
|
||||
|
||||
|
||||
|
|
@ -213,6 +232,12 @@ typedef enum fe_hierarchy {
|
|||
HIERARCHY_AUTO
|
||||
} fe_hierarchy_t;
|
||||
|
||||
enum fe_interleaving {
|
||||
INTERLEAVING_NONE,
|
||||
INTERLEAVING_AUTO,
|
||||
INTERLEAVING_240,
|
||||
INTERLEAVING_720,
|
||||
};
|
||||
|
||||
#if defined(__DVB_CORE__) || !defined (__KERNEL__)
|
||||
struct dvb_qpsk_parameters {
|
||||
|
|
@ -314,9 +339,9 @@ struct dvb_frontend_event {
|
|||
|
||||
#define DTV_ISDBT_LAYER_ENABLED 41
|
||||
|
||||
#define DTV_ISDBS_TS_ID 42
|
||||
|
||||
#define DTV_DVBT2_PLP_ID 43
|
||||
#define DTV_STREAM_ID 42
|
||||
#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
|
||||
#define DTV_DVBT2_PLP_ID_LEGACY 43
|
||||
|
||||
#define DTV_ENUM_DELSYS 44
|
||||
|
||||
|
|
@ -337,7 +362,10 @@ struct dvb_frontend_event {
|
|||
#define DTV_ATSCMH_SCCC_CODE_MODE_C 58
|
||||
#define DTV_ATSCMH_SCCC_CODE_MODE_D 59
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_ATSCMH_SCCC_CODE_MODE_D
|
||||
#define DTV_INTERLEAVING 60
|
||||
#define DTV_LNA 61
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_LNA
|
||||
|
||||
typedef enum fe_pilot {
|
||||
PILOT_ON,
|
||||
|
|
@ -366,7 +394,7 @@ typedef enum fe_delivery_system {
|
|||
SYS_ISDBC,
|
||||
SYS_ATSC,
|
||||
SYS_ATSCMH,
|
||||
SYS_DMBTH,
|
||||
SYS_DTMB,
|
||||
SYS_CMMB,
|
||||
SYS_DAB,
|
||||
SYS_DVBT2,
|
||||
|
|
@ -374,8 +402,9 @@ typedef enum fe_delivery_system {
|
|||
SYS_DVBC_ANNEX_C,
|
||||
} fe_delivery_system_t;
|
||||
|
||||
|
||||
/* backward compatibility */
|
||||
#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
|
||||
#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
|
||||
|
||||
/* ATSC-MH */
|
||||
|
||||
|
|
@ -409,6 +438,8 @@ enum atscmh_rs_code_mode {
|
|||
ATSCMH_RSCODE_RES = 3,
|
||||
};
|
||||
|
||||
#define NO_STREAM_ID_FILTER (~0U)
|
||||
#define LNA_AUTO (~0U)
|
||||
|
||||
struct dtv_cmds_h {
|
||||
char *name; /* A display name for debugging purposes */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@
|
|||
#define _DVBVERSION_H_
|
||||
|
||||
#define DVB_API_VERSION 5
|
||||
#define DVB_API_VERSION_MINOR 6
|
||||
#define DVB_API_VERSION_MINOR 8
|
||||
|
||||
#endif /*_DVBVERSION_H_*/
|
||||
|
|
|
|||
21
include/linux/efi-bgrt.h
Normal file
21
include/linux/efi-bgrt.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef _LINUX_EFI_BGRT_H
|
||||
#define _LINUX_EFI_BGRT_H
|
||||
|
||||
#ifdef CONFIG_ACPI_BGRT
|
||||
|
||||
#include <linux/acpi.h>
|
||||
|
||||
void efi_bgrt_init(void);
|
||||
|
||||
/* The BGRT data itself; only valid if bgrt_image != NULL. */
|
||||
extern void *bgrt_image;
|
||||
extern size_t bgrt_image_size;
|
||||
extern struct acpi_table_bgrt *bgrt_tab;
|
||||
|
||||
#else /* !CONFIG_ACPI_BGRT */
|
||||
|
||||
static inline void efi_bgrt_init(void) {}
|
||||
|
||||
#endif /* !CONFIG_ACPI_BGRT */
|
||||
|
||||
#endif /* _LINUX_EFI_BGRT_H */
|
||||
|
|
@ -496,6 +496,14 @@ extern void efi_map_pal_code (void);
|
|||
extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
|
||||
extern void efi_gettimeofday (struct timespec *ts);
|
||||
extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */
|
||||
#ifdef CONFIG_X86
|
||||
extern void efi_late_init(void);
|
||||
extern void efi_free_boot_services(void);
|
||||
#else
|
||||
static inline void efi_late_init(void) {}
|
||||
static inline void efi_free_boot_services(void) {}
|
||||
#endif
|
||||
extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr);
|
||||
extern u64 efi_get_iobase (void);
|
||||
extern u32 efi_mem_type (unsigned long phys_addr);
|
||||
extern u64 efi_mem_attributes (unsigned long phys_addr);
|
||||
|
|
@ -503,6 +511,8 @@ extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
|
|||
extern int __init efi_uart_console_only (void);
|
||||
extern void efi_initialize_iomem_resources(struct resource *code_resource,
|
||||
struct resource *data_resource, struct resource *bss_resource);
|
||||
extern unsigned long efi_get_time(void);
|
||||
extern int efi_set_rtc_mmss(unsigned long nowtime);
|
||||
extern void efi_reserve_boot_services(void);
|
||||
extern struct efi_memory_map memmap;
|
||||
|
||||
|
|
|
|||
|
|
@ -372,6 +372,12 @@ typedef struct elf64_shdr {
|
|||
#define NT_PRPSINFO 3
|
||||
#define NT_TASKSTRUCT 4
|
||||
#define NT_AUXV 6
|
||||
/*
|
||||
* Note to userspace developers: size of NT_SIGINFO note may increase
|
||||
* in the future to accomodate more fields, don't assume it is fixed!
|
||||
*/
|
||||
#define NT_SIGINFO 0x53494749
|
||||
#define NT_FILE 0x46494c45
|
||||
#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
|
||||
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
|
||||
#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
|
||||
|
|
@ -387,7 +393,11 @@ typedef struct elf64_shdr {
|
|||
#define NT_S390_PREFIX 0x305 /* s390 prefix register */
|
||||
#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
|
||||
#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
|
||||
#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
|
||||
#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
|
||||
#define NT_ARM_TLS 0x401 /* ARM TLS register */
|
||||
#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
|
||||
#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
|
||||
|
||||
|
||||
/* Note header in a PT_NOTE section */
|
||||
|
|
|
|||
|
|
@ -150,6 +150,17 @@ static inline void eth_broadcast_addr(u8 *addr)
|
|||
memset(addr, 0xff, ETH_ALEN);
|
||||
}
|
||||
|
||||
/**
|
||||
* eth_zero_addr - Assign zero address
|
||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
||||
*
|
||||
* Assign the zero address to the given address array.
|
||||
*/
|
||||
static inline void eth_zero_addr(u8 *addr)
|
||||
{
|
||||
memset(addr, 0x00, ETH_ALEN);
|
||||
}
|
||||
|
||||
/**
|
||||
* eth_hw_addr_random - Generate software assigned random Ethernet and
|
||||
* set device flag
|
||||
|
|
|
|||
|
|
@ -45,8 +45,10 @@ struct ethtool_cmd {
|
|||
* bits) in Mbps. Please use
|
||||
* ethtool_cmd_speed()/_set() to
|
||||
* access it */
|
||||
__u8 eth_tp_mdix;
|
||||
__u8 reserved2;
|
||||
__u8 eth_tp_mdix; /* twisted pair MDI-X status */
|
||||
__u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
|
||||
* link should be renegotiated if necessary
|
||||
*/
|
||||
__u32 lp_advertising; /* Features the link partner advertises */
|
||||
__u32 reserved[2];
|
||||
};
|
||||
|
|
@ -1229,10 +1231,13 @@ struct ethtool_ops {
|
|||
#define AUTONEG_DISABLE 0x00
|
||||
#define AUTONEG_ENABLE 0x01
|
||||
|
||||
/* Mode MDI or MDI-X */
|
||||
#define ETH_TP_MDI_INVALID 0x00
|
||||
#define ETH_TP_MDI 0x01
|
||||
#define ETH_TP_MDI_X 0x02
|
||||
/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
|
||||
* the driver is required to renegotiate link
|
||||
*/
|
||||
#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
|
||||
#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
|
||||
#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
|
||||
#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
|
||||
|
||||
/* Wake-On-Lan options. */
|
||||
#define WAKE_PHY (1 << 0)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#define EPOLL_CTL_ADD 1
|
||||
#define EPOLL_CTL_DEL 2
|
||||
#define EPOLL_CTL_MOD 3
|
||||
#define EPOLL_CTL_DISABLE 4
|
||||
|
||||
/*
|
||||
* Request the handling of system wakeup events so as to prevent system suspends
|
||||
|
|
|
|||
|
|
@ -30,19 +30,19 @@
|
|||
|
||||
/*
|
||||
* The standard cable name is to help support general notifier
|
||||
* and notifee device drivers to share the common names.
|
||||
* and notifiee device drivers to share the common names.
|
||||
* Please use standard cable names unless your notifier device has
|
||||
* a very unique and abnormal cable or
|
||||
* the cable type is supposed to be used with only one unique
|
||||
* pair of notifier/notifee devices.
|
||||
* pair of notifier/notifiee devices.
|
||||
*
|
||||
* Please add any other "standard" cables used with extcon dev.
|
||||
*
|
||||
* You may add a dot and number to specify version or specification
|
||||
* of the specific cable if it is required. (e.g., "Fast-charger.18"
|
||||
* and "Fast-charger.10" for 1.8A and 1.0A chargers)
|
||||
* However, the notifee and notifier should be able to handle such
|
||||
* string and if the notifee can negotiate the protocol or idenify,
|
||||
* However, the notifiee and notifier should be able to handle such
|
||||
* string and if the notifiee can negotiate the protocol or identify,
|
||||
* you don't need such convention. This convention is helpful when
|
||||
* notifier can distinguish but notifiee cannot.
|
||||
*/
|
||||
|
|
@ -76,7 +76,7 @@ struct extcon_cable;
|
|||
* struct extcon_dev - An extcon device represents one external connector.
|
||||
* @name The name of this extcon device. Parent device name is used
|
||||
* if NULL.
|
||||
* @supported_cable Array of supported cable name ending with NULL.
|
||||
* @supported_cable Array of supported cable names ending with NULL.
|
||||
* If supported_cable is NULL, cable name related APIs
|
||||
* are disabled.
|
||||
* @mutually_exclusive Array of mutually exclusive set of cables that cannot
|
||||
|
|
@ -95,7 +95,7 @@ struct extcon_cable;
|
|||
* @state Attach/detach state of this extcon. Do not provide at
|
||||
* register-time
|
||||
* @nh Notifier for the state change events from this extcon
|
||||
* @entry To support list of extcon devices so that uses can search
|
||||
* @entry To support list of extcon devices so that users can search
|
||||
* for extcon devices based on the extcon name.
|
||||
* @lock
|
||||
* @max_supported Internal value to store the number of cables.
|
||||
|
|
@ -199,7 +199,7 @@ extern int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state);
|
|||
/*
|
||||
* get/set_cable_state access each bit of the 32b encoded state value.
|
||||
* They are used to access the status of each cable based on the cable_name
|
||||
* or cable_index, which is retrived by extcon_find_cable_index
|
||||
* or cable_index, which is retrieved by extcon_find_cable_index
|
||||
*/
|
||||
extern int extcon_find_cable_index(struct extcon_dev *sdev,
|
||||
const char *cable_name);
|
||||
|
|
@ -226,9 +226,9 @@ extern int extcon_unregister_interest(struct extcon_specific_cable_nb *nb);
|
|||
|
||||
/*
|
||||
* Following APIs are to monitor every action of a notifier.
|
||||
* Registerer gets notified for every external port of a connection device.
|
||||
* Registrar gets notified for every external port of a connection device.
|
||||
* Probably this could be used to debug an action of notifier; however,
|
||||
* we do not recommend to use this at normal 'notifiee' device drivers who
|
||||
* we do not recommend to use this for normal 'notifiee' device drivers who
|
||||
* want to be notified by a specific external port of the notifier.
|
||||
*/
|
||||
extern int extcon_register_notifier(struct extcon_dev *edev,
|
||||
|
|
|
|||
71
include/linux/extcon/extcon-adc-jack.h
Normal file
71
include/linux/extcon/extcon-adc-jack.h
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* include/linux/extcon/extcon-adc-jack.h
|
||||
*
|
||||
* Analog Jack extcon driver with ADC-based detection capability.
|
||||
*
|
||||
* Copyright (C) 2012 Samsung Electronics
|
||||
* MyungJoo Ham <myungjoo.ham@samsung.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EXTCON_ADC_JACK_H_
|
||||
#define _EXTCON_ADC_JACK_H_ __FILE__
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/extcon.h>
|
||||
|
||||
/**
|
||||
* struct adc_jack_cond - condition to use an extcon state
|
||||
* @state - the corresponding extcon state (if 0, this struct denotes
|
||||
* the last adc_jack_cond element among the array)
|
||||
* @min_adc - min adc value for this condition
|
||||
* @max_adc - max adc value for this condition
|
||||
*
|
||||
* For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means
|
||||
* that if ADC value is between (inclusive) 100 and 200, than the cable 0 and
|
||||
* 1 are attached (1<<0 | 1<<1 == 0x3)
|
||||
*
|
||||
* Note that you don't need to describe condition for "no cable attached"
|
||||
* because when no adc_jack_cond is met, state = 0 is automatically chosen.
|
||||
*/
|
||||
struct adc_jack_cond {
|
||||
u32 state; /* extcon state value. 0 if invalid */
|
||||
u32 min_adc;
|
||||
u32 max_adc;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct adc_jack_pdata - platform data for adc jack device.
|
||||
* @name - name of the extcon device. If null, "adc-jack" is used.
|
||||
* @consumer_channel - Unique name to identify the channel on the consumer
|
||||
* side. This typically describes the channels used within
|
||||
* the consumer. E.g. 'battery_voltage'
|
||||
* @cable_names - array of cable names ending with null.
|
||||
* @adc_contitions - array of struct adc_jack_cond conditions ending
|
||||
* with .state = 0 entry. This describes how to decode
|
||||
* adc values into extcon state.
|
||||
* @irq_flags - irq flags used for the @irq
|
||||
* @handling_delay_ms - in some devices, we need to read ADC value some
|
||||
* milli-seconds after the interrupt occurs. You may
|
||||
* describe such delays with @handling_delay_ms, which
|
||||
* is rounded-off by jiffies.
|
||||
*/
|
||||
struct adc_jack_pdata {
|
||||
const char *name;
|
||||
const char *consumer_channel;
|
||||
/*
|
||||
* The last entry should be NULL
|
||||
*/
|
||||
const char **cable_names;
|
||||
/* The last entry's state should be 0 */
|
||||
struct adc_jack_cond *adc_conditions;
|
||||
|
||||
unsigned long irq_flags;
|
||||
unsigned long handling_delay_ms; /* in ms */
|
||||
};
|
||||
|
||||
#endif /* _EXTCON_ADC_JACK_H */
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
|
||||
#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
|
||||
#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
|
|||
|
|
@ -30,31 +30,11 @@ struct fdtable {
|
|||
struct fdtable *next;
|
||||
};
|
||||
|
||||
static inline void __set_close_on_exec(int fd, struct fdtable *fdt)
|
||||
{
|
||||
__set_bit(fd, fdt->close_on_exec);
|
||||
}
|
||||
|
||||
static inline void __clear_close_on_exec(int fd, struct fdtable *fdt)
|
||||
{
|
||||
__clear_bit(fd, fdt->close_on_exec);
|
||||
}
|
||||
|
||||
static inline bool close_on_exec(int fd, const struct fdtable *fdt)
|
||||
{
|
||||
return test_bit(fd, fdt->close_on_exec);
|
||||
}
|
||||
|
||||
static inline void __set_open_fd(int fd, struct fdtable *fdt)
|
||||
{
|
||||
__set_bit(fd, fdt->open_fds);
|
||||
}
|
||||
|
||||
static inline void __clear_open_fd(int fd, struct fdtable *fdt)
|
||||
{
|
||||
__clear_bit(fd, fdt->open_fds);
|
||||
}
|
||||
|
||||
static inline bool fd_is_open(int fd, const struct fdtable *fdt)
|
||||
{
|
||||
return test_bit(fd, fdt->open_fds);
|
||||
|
|
@ -93,15 +73,8 @@ struct file_operations;
|
|||
struct vfsmount;
|
||||
struct dentry;
|
||||
|
||||
extern int expand_files(struct files_struct *, int nr);
|
||||
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;
|
||||
|
|
@ -122,8 +95,20 @@ struct task_struct;
|
|||
struct files_struct *get_files_struct(struct task_struct *);
|
||||
void put_files_struct(struct files_struct *fs);
|
||||
void reset_files_struct(struct files_struct *);
|
||||
void daemonize_descriptors(void);
|
||||
int unshare_files(struct files_struct **);
|
||||
struct files_struct *dup_fd(struct files_struct *, int *);
|
||||
void do_close_on_exec(struct files_struct *);
|
||||
int iterate_fd(struct files_struct *, unsigned,
|
||||
int (*)(const void *, struct file *, unsigned),
|
||||
const void *);
|
||||
|
||||
extern int __alloc_fd(struct files_struct *files,
|
||||
unsigned start, unsigned end, unsigned flags);
|
||||
extern void __fd_install(struct files_struct *files,
|
||||
unsigned int fd, struct file *file);
|
||||
extern int __close_fd(struct files_struct *files,
|
||||
unsigned int fd);
|
||||
|
||||
extern struct kmem_cache *files_cachep;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,15 +26,44 @@ static inline void fput_light(struct file *file, int fput_needed)
|
|||
fput(file);
|
||||
}
|
||||
|
||||
struct fd {
|
||||
struct file *file;
|
||||
int need_put;
|
||||
};
|
||||
|
||||
static inline void fdput(struct fd fd)
|
||||
{
|
||||
if (fd.need_put)
|
||||
fput(fd.file);
|
||||
}
|
||||
|
||||
extern struct file *fget(unsigned int fd);
|
||||
extern struct file *fget_light(unsigned int fd, int *fput_needed);
|
||||
|
||||
static inline struct fd fdget(unsigned int fd)
|
||||
{
|
||||
int b;
|
||||
struct file *f = fget_light(fd, &b);
|
||||
return (struct fd){f,b};
|
||||
}
|
||||
|
||||
extern struct file *fget_raw(unsigned int fd);
|
||||
extern struct file *fget_raw_light(unsigned int fd, int *fput_needed);
|
||||
|
||||
static inline struct fd fdget_raw(unsigned int fd)
|
||||
{
|
||||
int b;
|
||||
struct file *f = fget_raw_light(fd, &b);
|
||||
return (struct fd){f,b};
|
||||
}
|
||||
|
||||
extern int f_dupfd(unsigned int from, struct file *file, unsigned flags);
|
||||
extern int replace_fd(unsigned fd, struct file *file, unsigned flags);
|
||||
extern void set_close_on_exec(unsigned int fd, int flag);
|
||||
extern bool get_close_on_exec(unsigned int fd);
|
||||
extern void put_filp(struct file *);
|
||||
extern int alloc_fd(unsigned start, unsigned flags);
|
||||
extern int get_unused_fd(void);
|
||||
#define get_unused_fd_flags(flags) alloc_fd(0, (flags))
|
||||
extern int get_unused_fd_flags(unsigned flags);
|
||||
#define get_unused_fd() get_unused_fd_flags(0)
|
||||
extern void put_unused_fd(unsigned int fd);
|
||||
|
||||
extern void fd_install(unsigned int fd, struct file *file);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
|
|||
#define BPF_LSH 0x60
|
||||
#define BPF_RSH 0x70
|
||||
#define BPF_NEG 0x80
|
||||
#define BPF_MOD 0x90
|
||||
#define BPF_XOR 0xa0
|
||||
|
||||
#define BPF_JA 0x00
|
||||
#define BPF_JEQ 0x10
|
||||
#define BPF_JGT 0x20
|
||||
|
|
@ -196,10 +199,14 @@ enum {
|
|||
BPF_S_ALU_MUL_K,
|
||||
BPF_S_ALU_MUL_X,
|
||||
BPF_S_ALU_DIV_X,
|
||||
BPF_S_ALU_MOD_K,
|
||||
BPF_S_ALU_MOD_X,
|
||||
BPF_S_ALU_AND_K,
|
||||
BPF_S_ALU_AND_X,
|
||||
BPF_S_ALU_OR_K,
|
||||
BPF_S_ALU_OR_X,
|
||||
BPF_S_ALU_XOR_K,
|
||||
BPF_S_ALU_XOR_X,
|
||||
BPF_S_ALU_LSH_K,
|
||||
BPF_S_ALU_LSH_X,
|
||||
BPF_S_ALU_RSH_K,
|
||||
|
|
|
|||
|
|
@ -265,8 +265,16 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
|
|||
void *data, size_t length,
|
||||
void *callback_data);
|
||||
/*
|
||||
* Important note: Except for the FCP registers, the callback must guarantee
|
||||
* that either fw_send_response() or kfree() is called on the @request.
|
||||
* This callback handles an inbound request subaction. It is called in
|
||||
* RCU read-side context, therefore must not sleep.
|
||||
*
|
||||
* The callback should not initiate outbound request subactions directly.
|
||||
* Otherwise there is a danger of recursion of inbound and outbound
|
||||
* transactions from and to the local node.
|
||||
*
|
||||
* The callback is responsible that either fw_send_response() or kfree()
|
||||
* is called on the @request, except for FCP registers for which the core
|
||||
* takes care of that.
|
||||
*/
|
||||
typedef void (*fw_address_callback_t)(struct fw_card *card,
|
||||
struct fw_request *request,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ struct firmware {
|
|||
size_t size;
|
||||
const u8 *data;
|
||||
struct page **pages;
|
||||
|
||||
/* firmware loader private fields */
|
||||
void *priv;
|
||||
};
|
||||
|
||||
struct module;
|
||||
|
|
@ -44,6 +47,8 @@ int request_firmware_nowait(
|
|||
void (*cont)(const struct firmware *fw, void *context));
|
||||
|
||||
void release_firmware(const struct firmware *fw);
|
||||
int cache_firmware(const char *name);
|
||||
int uncache_firmware(const char *name);
|
||||
#else
|
||||
static inline int request_firmware(const struct firmware **fw,
|
||||
const char *name,
|
||||
|
|
@ -62,6 +67,16 @@ static inline int request_firmware_nowait(
|
|||
static inline void release_firmware(const struct firmware *fw)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int cache_firmware(const char *name)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
static inline int uncache_firmware(const char *name)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ extern struct frontswap_ops
|
|||
extern void frontswap_shrink(unsigned long);
|
||||
extern unsigned long frontswap_curr_pages(void);
|
||||
extern void frontswap_writethrough(bool);
|
||||
#define FRONTSWAP_HAS_EXCLUSIVE_GETS
|
||||
extern void frontswap_tmem_exclusive_gets(bool);
|
||||
|
||||
extern void __frontswap_init(unsigned type);
|
||||
extern int __frontswap_store(struct page *page);
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ struct inodes_stat_t {
|
|||
#include <linux/cache.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/radix-tree.h>
|
||||
#include <linux/prio_tree.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/pid.h>
|
||||
#include <linux/bug.h>
|
||||
|
|
@ -669,7 +669,7 @@ struct address_space {
|
|||
struct radix_tree_root page_tree; /* radix tree of all pages */
|
||||
spinlock_t tree_lock; /* and lock protecting it */
|
||||
unsigned int i_mmap_writable;/* count VM_SHARED mappings */
|
||||
struct prio_tree_root i_mmap; /* tree of private and shared mappings */
|
||||
struct rb_root i_mmap; /* tree of private and shared mappings */
|
||||
struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
|
||||
struct mutex i_mmap_mutex; /* protect tree, count, list */
|
||||
/* Protected by tree_lock together with the radix tree */
|
||||
|
|
@ -741,7 +741,7 @@ int mapping_tagged(struct address_space *mapping, int tag);
|
|||
*/
|
||||
static inline int mapping_mapped(struct address_space *mapping)
|
||||
{
|
||||
return !prio_tree_empty(&mapping->i_mmap) ||
|
||||
return !RB_EMPTY_ROOT(&mapping->i_mmap) ||
|
||||
!list_empty(&mapping->i_mmap_nonlinear);
|
||||
}
|
||||
|
||||
|
|
@ -1074,7 +1074,11 @@ struct file_handle {
|
|||
unsigned char f_handle[0];
|
||||
};
|
||||
|
||||
#define get_file(x) atomic_long_inc(&(x)->f_count)
|
||||
static inline struct file *get_file(struct file *f)
|
||||
{
|
||||
atomic_long_inc(&f->f_count);
|
||||
return f;
|
||||
}
|
||||
#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
|
||||
#define file_count(x) atomic_long_read(&(x)->f_count)
|
||||
|
||||
|
|
@ -1126,9 +1130,9 @@ static inline int file_check_writeable(struct file *filp)
|
|||
/* Page cache limit. The filesystems should put that into their s_maxbytes
|
||||
limits, otherwise bad things can happen in VM. */
|
||||
#if BITS_PER_LONG==32
|
||||
#define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
|
||||
#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
|
||||
#elif BITS_PER_LONG==64
|
||||
#define MAX_LFS_FILESIZE 0x7fffffffffffffffUL
|
||||
#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffff)
|
||||
#endif
|
||||
|
||||
#define FL_POSIX 1
|
||||
|
|
@ -2548,6 +2552,8 @@ extern int sb_min_blocksize(struct super_block *, int);
|
|||
|
||||
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
|
||||
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
|
||||
extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr,
|
||||
unsigned long size, pgoff_t pgoff);
|
||||
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
|
||||
int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
|
||||
extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@
|
|||
|
||||
#define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI
|
||||
PHY CLK to become stable - 10ms*/
|
||||
#define FSL_USB_PHY_CLK_TIMEOUT 10000 /* uSec */
|
||||
#define FSL_USB_VER_OLD 0
|
||||
#define FSL_USB_VER_1_6 1
|
||||
#define FSL_USB_VER_2_2 2
|
||||
#define FSL_USB_VER_2_4 3
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <linux/kallsyms.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/ktime.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/types.h>
|
||||
|
|
@ -18,6 +19,28 @@
|
|||
|
||||
#include <asm/ftrace.h>
|
||||
|
||||
/*
|
||||
* If the arch supports passing the variable contents of
|
||||
* function_trace_op as the third parameter back from the
|
||||
* mcount call, then the arch should define this as 1.
|
||||
*/
|
||||
#ifndef ARCH_SUPPORTS_FTRACE_OPS
|
||||
#define ARCH_SUPPORTS_FTRACE_OPS 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If the arch's mcount caller does not support all of ftrace's
|
||||
* features, then it must call an indirect function that
|
||||
* does. Or at least does enough to prevent any unwelcomed side effects.
|
||||
*/
|
||||
#if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \
|
||||
!ARCH_SUPPORTS_FTRACE_OPS
|
||||
# define FTRACE_FORCE_LIST_FUNC 1
|
||||
#else
|
||||
# define FTRACE_FORCE_LIST_FUNC 0
|
||||
#endif
|
||||
|
||||
|
||||
struct module;
|
||||
struct ftrace_hash;
|
||||
|
||||
|
|
@ -29,7 +52,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
|
|||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos);
|
||||
|
||||
typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
|
||||
struct ftrace_ops;
|
||||
|
||||
typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
|
||||
struct ftrace_ops *op, struct pt_regs *regs);
|
||||
|
||||
/*
|
||||
* FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are
|
||||
|
|
@ -45,12 +71,33 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
|
|||
* could be controled by following calls:
|
||||
* ftrace_function_local_enable
|
||||
* ftrace_function_local_disable
|
||||
* SAVE_REGS - The ftrace_ops wants regs saved at each function called
|
||||
* and passed to the callback. If this flag is set, but the
|
||||
* architecture does not support passing regs
|
||||
* (ARCH_SUPPORTS_FTRACE_SAVE_REGS is not defined), then the
|
||||
* ftrace_ops will fail to register, unless the next flag
|
||||
* is set.
|
||||
* SAVE_REGS_IF_SUPPORTED - This is the same as SAVE_REGS, but if the
|
||||
* handler can handle an arch that does not save regs
|
||||
* (the handler tests if regs == NULL), then it can set
|
||||
* this flag instead. It will not fail registering the ftrace_ops
|
||||
* but, the regs field will be NULL if the arch does not support
|
||||
* passing regs to the handler.
|
||||
* Note, if this flag is set, the SAVE_REGS flag will automatically
|
||||
* get set upon registering the ftrace_ops, if the arch supports it.
|
||||
* RECURSION_SAFE - The ftrace_ops can set this to tell the ftrace infrastructure
|
||||
* that the call back has its own recursion protection. If it does
|
||||
* not set this, then the ftrace infrastructure will add recursion
|
||||
* protection for the caller.
|
||||
*/
|
||||
enum {
|
||||
FTRACE_OPS_FL_ENABLED = 1 << 0,
|
||||
FTRACE_OPS_FL_GLOBAL = 1 << 1,
|
||||
FTRACE_OPS_FL_DYNAMIC = 1 << 2,
|
||||
FTRACE_OPS_FL_CONTROL = 1 << 3,
|
||||
FTRACE_OPS_FL_ENABLED = 1 << 0,
|
||||
FTRACE_OPS_FL_GLOBAL = 1 << 1,
|
||||
FTRACE_OPS_FL_DYNAMIC = 1 << 2,
|
||||
FTRACE_OPS_FL_CONTROL = 1 << 3,
|
||||
FTRACE_OPS_FL_SAVE_REGS = 1 << 4,
|
||||
FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5,
|
||||
FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6,
|
||||
};
|
||||
|
||||
struct ftrace_ops {
|
||||
|
|
@ -163,7 +210,8 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops)
|
|||
return *this_cpu_ptr(ops->disabled);
|
||||
}
|
||||
|
||||
extern void ftrace_stub(unsigned long a0, unsigned long a1);
|
||||
extern void ftrace_stub(unsigned long a0, unsigned long a1,
|
||||
struct ftrace_ops *op, struct pt_regs *regs);
|
||||
|
||||
#else /* !CONFIG_FUNCTION_TRACER */
|
||||
/*
|
||||
|
|
@ -172,6 +220,10 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1);
|
|||
*/
|
||||
#define register_ftrace_function(ops) ({ 0; })
|
||||
#define unregister_ftrace_function(ops) ({ 0; })
|
||||
static inline int ftrace_nr_registered_ops(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void clear_ftrace_function(void) { }
|
||||
static inline void ftrace_kill(void) { }
|
||||
static inline void ftrace_stop(void) { }
|
||||
|
|
@ -227,12 +279,33 @@ extern void unregister_ftrace_function_probe_all(char *glob);
|
|||
|
||||
extern int ftrace_text_reserved(void *start, void *end);
|
||||
|
||||
extern int ftrace_nr_registered_ops(void);
|
||||
|
||||
/*
|
||||
* The dyn_ftrace record's flags field is split into two parts.
|
||||
* the first part which is '0-FTRACE_REF_MAX' is a counter of
|
||||
* the number of callbacks that have registered the function that
|
||||
* the dyn_ftrace descriptor represents.
|
||||
*
|
||||
* The second part is a mask:
|
||||
* ENABLED - the function is being traced
|
||||
* REGS - the record wants the function to save regs
|
||||
* REGS_EN - the function is set up to save regs.
|
||||
*
|
||||
* When a new ftrace_ops is registered and wants a function to save
|
||||
* pt_regs, the rec->flag REGS is set. When the function has been
|
||||
* set up to save regs, the REG_EN flag is set. Once a function
|
||||
* starts saving regs it will do so until all ftrace_ops are removed
|
||||
* from tracing that function.
|
||||
*/
|
||||
enum {
|
||||
FTRACE_FL_ENABLED = (1 << 30),
|
||||
FTRACE_FL_ENABLED = (1UL << 29),
|
||||
FTRACE_FL_REGS = (1UL << 30),
|
||||
FTRACE_FL_REGS_EN = (1UL << 31)
|
||||
};
|
||||
|
||||
#define FTRACE_FL_MASK (0x3UL << 30)
|
||||
#define FTRACE_REF_MAX ((1 << 30) - 1)
|
||||
#define FTRACE_FL_MASK (0x7UL << 29)
|
||||
#define FTRACE_REF_MAX ((1UL << 29) - 1)
|
||||
|
||||
struct dyn_ftrace {
|
||||
union {
|
||||
|
|
@ -244,6 +317,8 @@ struct dyn_ftrace {
|
|||
};
|
||||
|
||||
int ftrace_force_update(void);
|
||||
int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
|
||||
int remove, int reset);
|
||||
int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
|
||||
int len, int reset);
|
||||
int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
|
||||
|
|
@ -263,9 +338,23 @@ enum {
|
|||
FTRACE_STOP_FUNC_RET = (1 << 4),
|
||||
};
|
||||
|
||||
/*
|
||||
* The FTRACE_UPDATE_* enum is used to pass information back
|
||||
* from the ftrace_update_record() and ftrace_test_record()
|
||||
* functions. These are called by the code update routines
|
||||
* to find out what is to be done for a given function.
|
||||
*
|
||||
* IGNORE - The function is already what we want it to be
|
||||
* MAKE_CALL - Start tracing the function
|
||||
* MODIFY_CALL - Stop saving regs for the function
|
||||
* MODIFY_CALL_REGS - Start saving regs for the function
|
||||
* MAKE_NOP - Stop tracing the function
|
||||
*/
|
||||
enum {
|
||||
FTRACE_UPDATE_IGNORE,
|
||||
FTRACE_UPDATE_MAKE_CALL,
|
||||
FTRACE_UPDATE_MODIFY_CALL,
|
||||
FTRACE_UPDATE_MODIFY_CALL_REGS,
|
||||
FTRACE_UPDATE_MAKE_NOP,
|
||||
};
|
||||
|
||||
|
|
@ -317,7 +406,9 @@ extern int ftrace_dyn_arch_init(void *data);
|
|||
extern void ftrace_replace_code(int enable);
|
||||
extern int ftrace_update_ftrace_func(ftrace_func_t func);
|
||||
extern void ftrace_caller(void);
|
||||
extern void ftrace_regs_caller(void);
|
||||
extern void ftrace_call(void);
|
||||
extern void ftrace_regs_call(void);
|
||||
extern void mcount_call(void);
|
||||
|
||||
void ftrace_modify_all_code(int command);
|
||||
|
|
@ -325,6 +416,15 @@ void ftrace_modify_all_code(int command);
|
|||
#ifndef FTRACE_ADDR
|
||||
#define FTRACE_ADDR ((unsigned long)ftrace_caller)
|
||||
#endif
|
||||
|
||||
#ifndef FTRACE_REGS_ADDR
|
||||
#ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS
|
||||
# define FTRACE_REGS_ADDR ((unsigned long)ftrace_regs_caller)
|
||||
#else
|
||||
# define FTRACE_REGS_ADDR FTRACE_ADDR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
||||
extern void ftrace_graph_caller(void);
|
||||
extern int ftrace_enable_ftrace_graph_caller(void);
|
||||
|
|
@ -380,6 +480,39 @@ extern int ftrace_make_nop(struct module *mod,
|
|||
*/
|
||||
extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr);
|
||||
|
||||
#ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS
|
||||
/**
|
||||
* ftrace_modify_call - convert from one addr to another (no nop)
|
||||
* @rec: the mcount call site record
|
||||
* @old_addr: the address expected to be currently called to
|
||||
* @addr: the address to change to
|
||||
*
|
||||
* This is a very sensitive operation and great care needs
|
||||
* to be taken by the arch. The operation should carefully
|
||||
* read the location, check to see if what is read is indeed
|
||||
* what we expect it to be, and then on success of the compare,
|
||||
* it should write to the location.
|
||||
*
|
||||
* The code segment at @rec->ip should be a caller to @old_addr
|
||||
*
|
||||
* Return must be:
|
||||
* 0 on success
|
||||
* -EFAULT on error reading the location
|
||||
* -EINVAL on a failed compare of the contents
|
||||
* -EPERM on error writing to the location
|
||||
* Any other value will be considered a failure.
|
||||
*/
|
||||
extern int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
|
||||
unsigned long addr);
|
||||
#else
|
||||
/* Should never be called */
|
||||
static inline int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
|
||||
unsigned long addr)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* May be defined in arch */
|
||||
extern int ftrace_arch_read_dyn_info(char *buf, int size);
|
||||
|
||||
|
|
@ -387,7 +520,7 @@ extern int skip_trace(unsigned long ip);
|
|||
|
||||
extern void ftrace_disable_daemon(void);
|
||||
extern void ftrace_enable_daemon(void);
|
||||
#else
|
||||
#else /* CONFIG_DYNAMIC_FTRACE */
|
||||
static inline int skip_trace(unsigned long ip) { return 0; }
|
||||
static inline int ftrace_force_update(void) { return 0; }
|
||||
static inline void ftrace_disable_daemon(void) { }
|
||||
|
|
@ -405,6 +538,10 @@ static inline int ftrace_text_reserved(void *start, void *end)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
static inline unsigned long ftrace_location(unsigned long ip)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Again users of functions that have ftrace_ops may not
|
||||
|
|
@ -413,6 +550,7 @@ static inline int ftrace_text_reserved(void *start, void *end)
|
|||
*/
|
||||
#define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; })
|
||||
#define ftrace_set_early_filter(ops, buf, enable) do { } while (0)
|
||||
#define ftrace_set_filter_ip(ops, ip, remove, reset) ({ -ENODEV; })
|
||||
#define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; })
|
||||
#define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; })
|
||||
#define ftrace_free_filter(ops) do { } while (0)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,20 @@
|
|||
|
||||
#ifndef __GENALLOC_H__
|
||||
#define __GENALLOC_H__
|
||||
/**
|
||||
* Allocation callback function type definition
|
||||
* @map: Pointer to bitmap
|
||||
* @size: The bitmap size in bits
|
||||
* @start: The bitnumber to start searching at
|
||||
* @nr: The number of zeroed bits we're looking for
|
||||
* @data: optional additional data used by @genpool_algo_t
|
||||
*/
|
||||
typedef unsigned long (*genpool_algo_t)(unsigned long *map,
|
||||
unsigned long size,
|
||||
unsigned long start,
|
||||
unsigned int nr,
|
||||
void *data);
|
||||
|
||||
/*
|
||||
* General purpose special memory pool descriptor.
|
||||
*/
|
||||
|
|
@ -36,6 +50,9 @@ struct gen_pool {
|
|||
spinlock_t lock;
|
||||
struct list_head chunks; /* list of chunks in this pool */
|
||||
int min_alloc_order; /* minimum allocation order */
|
||||
|
||||
genpool_algo_t algo; /* allocation function */
|
||||
void *data;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -78,4 +95,14 @@ extern void gen_pool_for_each_chunk(struct gen_pool *,
|
|||
void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
|
||||
extern size_t gen_pool_avail(struct gen_pool *);
|
||||
extern size_t gen_pool_size(struct gen_pool *);
|
||||
|
||||
extern void gen_pool_set_algo(struct gen_pool *pool, genpool_algo_t algo,
|
||||
void *data);
|
||||
|
||||
extern unsigned long gen_pool_first_fit(unsigned long *map, unsigned long size,
|
||||
unsigned long start, unsigned int nr, void *data);
|
||||
|
||||
extern unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size,
|
||||
unsigned long start, unsigned int nr, void *data);
|
||||
|
||||
#endif /* __GENALLOC_H__ */
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* generic_serial.h
|
||||
*
|
||||
* Copyright (C) 1998 R.E.Wolff@BitWizard.nl
|
||||
*
|
||||
* written for the SX serial driver.
|
||||
*
|
||||
* Version 0.1 -- December, 1998.
|
||||
*/
|
||||
|
||||
#ifndef GENERIC_SERIAL_H
|
||||
#define GENERIC_SERIAL_H
|
||||
|
||||
#warning Use of this header is deprecated.
|
||||
#warning Since nobody sets the constants defined here for you, you should not, in any case, use them. Including the header is thus pointless.
|
||||
|
||||
/* Flags */
|
||||
/* Warning: serial.h defines some ASYNC_ flags, they say they are "only"
|
||||
used in serial.c, but they are also used in all other serial drivers.
|
||||
Make sure they don't clash with these here... */
|
||||
#define GS_TX_INTEN 0x00800000
|
||||
#define GS_RX_INTEN 0x00400000
|
||||
#define GS_ACTIVE 0x00200000
|
||||
|
||||
#define GS_TYPE_NORMAL 1
|
||||
|
||||
#define GS_DEBUG_FLUSH 0x00000001
|
||||
#define GS_DEBUG_BTR 0x00000002
|
||||
#define GS_DEBUG_TERMIOS 0x00000004
|
||||
#define GS_DEBUG_STUFF 0x00000008
|
||||
#define GS_DEBUG_CLOSE 0x00000010
|
||||
#define GS_DEBUG_FLOW 0x00000020
|
||||
#define GS_DEBUG_WRITE 0x00000040
|
||||
|
||||
#endif
|
||||
|
|
@ -30,12 +30,7 @@ struct vm_area_struct;
|
|||
#define ___GFP_HARDWALL 0x20000u
|
||||
#define ___GFP_THISNODE 0x40000u
|
||||
#define ___GFP_RECLAIMABLE 0x80000u
|
||||
#ifdef CONFIG_KMEMCHECK
|
||||
#define ___GFP_NOTRACK 0x200000u
|
||||
#else
|
||||
#define ___GFP_NOTRACK 0
|
||||
#endif
|
||||
#define ___GFP_NO_KSWAPD 0x400000u
|
||||
#define ___GFP_OTHER_NODE 0x800000u
|
||||
#define ___GFP_WRITE 0x1000000u
|
||||
|
||||
|
|
@ -90,7 +85,6 @@ struct vm_area_struct;
|
|||
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
|
||||
#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
|
||||
|
||||
#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
|
||||
#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
|
||||
#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
|
||||
|
||||
|
|
@ -120,8 +114,7 @@ struct vm_area_struct;
|
|||
__GFP_MOVABLE)
|
||||
#define GFP_IOFS (__GFP_IO | __GFP_FS)
|
||||
#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
|
||||
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \
|
||||
__GFP_NO_KSWAPD)
|
||||
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN)
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
|
||||
|
|
|
|||
|
|
@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq);
|
|||
struct task_struct;
|
||||
|
||||
#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING)
|
||||
static inline void account_system_vtime(struct task_struct *tsk)
|
||||
static inline void vtime_account(struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
#else
|
||||
extern void account_system_vtime(struct task_struct *tsk);
|
||||
extern void vtime_account(struct task_struct *tsk);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
|
||||
|
|
@ -162,7 +162,7 @@ extern void rcu_nmi_exit(void);
|
|||
*/
|
||||
#define __irq_enter() \
|
||||
do { \
|
||||
account_system_vtime(current); \
|
||||
vtime_account(current); \
|
||||
add_preempt_count(HARDIRQ_OFFSET); \
|
||||
trace_hardirq_enter(); \
|
||||
} while (0)
|
||||
|
|
@ -178,7 +178,7 @@ extern void irq_enter(void);
|
|||
#define __irq_exit() \
|
||||
do { \
|
||||
trace_hardirq_exit(); \
|
||||
account_system_vtime(current); \
|
||||
vtime_account(current); \
|
||||
sub_preempt_count(HARDIRQ_OFFSET); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
|
|
@ -67,4 +67,14 @@ static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
|
|||
{
|
||||
return hash_long((unsigned long)ptr, bits);
|
||||
}
|
||||
|
||||
static inline u32 hash32_ptr(const void *ptr)
|
||||
{
|
||||
unsigned long val = (unsigned long)ptr;
|
||||
|
||||
#if BITS_PER_LONG == 64
|
||||
val ^= (val >> 32);
|
||||
#endif
|
||||
return (u32)val;
|
||||
}
|
||||
#endif /* _LINUX_HASH_H */
|
||||
|
|
|
|||
160
include/linux/hid-sensor-hub.h
Normal file
160
include/linux/hid-sensor-hub.h
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
* HID Sensors Driver
|
||||
* Copyright (c) 2012, Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope 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.,
|
||||
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
#ifndef _HID_SENSORS_HUB_H
|
||||
#define _HID_SENSORS_HUB_H
|
||||
|
||||
#include <linux/hid.h>
|
||||
#include <linux/hid-sensor-ids.h>
|
||||
|
||||
/**
|
||||
* struct hid_sensor_hub_attribute_info - Attribute info
|
||||
* @usage_id: Parent usage id of a physical device.
|
||||
* @attrib_id: Attribute id for this attribute.
|
||||
* @report_id: Report id in which this information resides.
|
||||
* @index: Field index in the report.
|
||||
* @units: Measurment unit for this attribute.
|
||||
* @unit_expo: Exponent used in the data.
|
||||
* @size: Size in bytes for data size.
|
||||
*/
|
||||
struct hid_sensor_hub_attribute_info {
|
||||
u32 usage_id;
|
||||
u32 attrib_id;
|
||||
s32 report_id;
|
||||
s32 index;
|
||||
s32 units;
|
||||
s32 unit_expo;
|
||||
s32 size;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct hid_sensor_hub_device - Stores the hub instance data
|
||||
* @hdev: Stores the hid instance.
|
||||
* @vendor_id: Vendor id of hub device.
|
||||
* @product_id: Product id of hub device.
|
||||
*/
|
||||
struct hid_sensor_hub_device {
|
||||
struct hid_device *hdev;
|
||||
u32 vendor_id;
|
||||
u32 product_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct hid_sensor_hub_callbacks - Client callback functions
|
||||
* @pdev: Platform device instance of the client driver.
|
||||
* @suspend: Suspend callback.
|
||||
* @resume: Resume callback.
|
||||
* @capture_sample: Callback to get a sample.
|
||||
* @send_event: Send notification to indicate all samples are
|
||||
* captured, process and send event
|
||||
*/
|
||||
struct hid_sensor_hub_callbacks {
|
||||
struct platform_device *pdev;
|
||||
int (*suspend)(struct hid_sensor_hub_device *hsdev, void *priv);
|
||||
int (*resume)(struct hid_sensor_hub_device *hsdev, void *priv);
|
||||
int (*capture_sample)(struct hid_sensor_hub_device *hsdev,
|
||||
u32 usage_id, size_t raw_len, char *raw_data,
|
||||
void *priv);
|
||||
int (*send_event)(struct hid_sensor_hub_device *hsdev, u32 usage_id,
|
||||
void *priv);
|
||||
};
|
||||
|
||||
/* Registration functions */
|
||||
|
||||
/**
|
||||
* sensor_hub_register_callback() - Register client callbacks
|
||||
* @hsdev: Hub device instance.
|
||||
* @usage_id: Usage id of the client (E.g. 0x200076 for Gyro).
|
||||
* @usage_callback: Callback function storage
|
||||
*
|
||||
* Used to register callbacks by client processing drivers. Sensor
|
||||
* hub core driver will call these callbacks to offload processing
|
||||
* of data streams and notifications.
|
||||
*/
|
||||
int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
|
||||
u32 usage_id,
|
||||
struct hid_sensor_hub_callbacks *usage_callback);
|
||||
|
||||
/**
|
||||
* sensor_hub_remove_callback() - Remove client callbacks
|
||||
* @hsdev: Hub device instance.
|
||||
* @usage_id: Usage id of the client (E.g. 0x200076 for Gyro).
|
||||
*
|
||||
* If there is a callback registred, this call will remove that
|
||||
* callbacks, so that it will stop data and event notifications.
|
||||
*/
|
||||
int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
|
||||
u32 usage_id);
|
||||
|
||||
|
||||
/* Hid sensor hub core interfaces */
|
||||
|
||||
/**
|
||||
* sensor_hub_input_get_attribute_info() - Get an attribute information
|
||||
* @hsdev: Hub device instance.
|
||||
* @type: Type of this attribute, input/output/feature
|
||||
* @usage_id: Attribute usage id of parent physical device as per spec
|
||||
* @attr_usage_id: Attribute usage id as per spec
|
||||
* @info: return information about attribute after parsing report
|
||||
*
|
||||
* Parses report and returns the attribute information such as report id,
|
||||
* field index, units and exponet etc.
|
||||
*/
|
||||
int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
|
||||
u8 type,
|
||||
u32 usage_id, u32 attr_usage_id,
|
||||
struct hid_sensor_hub_attribute_info *info);
|
||||
|
||||
/**
|
||||
* sensor_hub_input_attr_get_raw_value() - Synchronous read request
|
||||
* @usage_id: Attribute usage id of parent physical device as per spec
|
||||
* @attr_usage_id: Attribute usage id as per spec
|
||||
* @report_id: Report id to look for
|
||||
*
|
||||
* Issues a synchronous read request for an input attribute. Returns
|
||||
* data upto 32 bits. Since client can get events, so this call should
|
||||
* not be used for data paths, this will impact performance.
|
||||
*/
|
||||
|
||||
int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
|
||||
u32 usage_id,
|
||||
u32 attr_usage_id, u32 report_id);
|
||||
/**
|
||||
* sensor_hub_set_feature() - Feature set request
|
||||
* @report_id: Report id to look for
|
||||
* @field_index: Field index inside a report
|
||||
* @value: Value to set
|
||||
*
|
||||
* Used to set a field in feature report. For example this can set polling
|
||||
* interval, sensitivity, activate/deactivate state.
|
||||
*/
|
||||
int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
|
||||
u32 field_index, s32 value);
|
||||
|
||||
/**
|
||||
* sensor_hub_get_feature() - Feature get request
|
||||
* @report_id: Report id to look for
|
||||
* @field_index: Field index inside a report
|
||||
* @value: Place holder for return value
|
||||
*
|
||||
* Used to get a field in feature report. For example this can get polling
|
||||
* interval, sensitivity, activate/deactivate state.
|
||||
*/
|
||||
int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
|
||||
u32 field_index, s32 *value);
|
||||
#endif
|
||||
112
include/linux/hid-sensor-ids.h
Normal file
112
include/linux/hid-sensor-ids.h
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* HID Sensors Driver
|
||||
* Copyright (c) 2012, Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope 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.,
|
||||
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
#ifndef _HID_SENSORS_IDS_H
|
||||
#define _HID_SENSORS_IDS_H
|
||||
|
||||
#define HID_UP_SENSOR 0x00200000
|
||||
#define HID_MAX_PHY_DEVICES 0xFF
|
||||
|
||||
/* Accel 3D (200073) */
|
||||
#define HID_USAGE_SENSOR_ACCEL_3D 0x200073
|
||||
#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453
|
||||
#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454
|
||||
#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455
|
||||
|
||||
/* ALS (200041) */
|
||||
#define HID_USAGE_SENSOR_ALS 0x200041
|
||||
#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1
|
||||
|
||||
/* Gyro 3D: (200076) */
|
||||
#define HID_USAGE_SENSOR_GYRO_3D 0x200076
|
||||
#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457
|
||||
#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
|
||||
#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
|
||||
|
||||
/*ORIENTATION: Compass 3D: (200083) */
|
||||
#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Z 0x200474
|
||||
|
||||
#define HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH 0x200475
|
||||
#define HID_USAGE_SENSOR_ORIENT_COMP_TRUE_NORTH 0x200476
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_NORTH 0x200477
|
||||
#define HID_USAGE_SENSOR_ORIENT_TRUE_NORTH 0x200478
|
||||
|
||||
#define HID_USAGE_SENSOR_ORIENT_DISTANCE 0x200479
|
||||
#define HID_USAGE_SENSOR_ORIENT_DISTANCE_X 0x20047A
|
||||
#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B
|
||||
#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C
|
||||
#define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D
|
||||
#define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E
|
||||
#define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F
|
||||
#define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480
|
||||
#define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481
|
||||
#define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482
|
||||
#define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484
|
||||
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_X_AXIS 0x200485
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Y_AXIS 0x200486
|
||||
#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Z_AXIS 0x200487
|
||||
|
||||
/* Units */
|
||||
#define HID_USAGE_SENSOR_UNITS_NOT_SPECIFIED 0x00
|
||||
#define HID_USAGE_SENSOR_UNITS_LUX 0x01
|
||||
#define HID_USAGE_SENSOR_UNITS_KELVIN 0x01000100
|
||||
#define HID_USAGE_SENSOR_UNITS_FAHRENHEIT 0x03000100
|
||||
#define HID_USAGE_SENSOR_UNITS_PASCAL 0xF1E1
|
||||
#define HID_USAGE_SENSOR_UNITS_NEWTON 0x11E1
|
||||
#define HID_USAGE_SENSOR_UNITS_METERS_PER_SECOND 0x11F0
|
||||
#define HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD 0x11E0
|
||||
#define HID_USAGE_SENSOR_UNITS_FARAD 0xE14F2000
|
||||
#define HID_USAGE_SENSOR_UNITS_AMPERE 0x01001000
|
||||
#define HID_USAGE_SENSOR_UNITS_WATT 0x21d1
|
||||
#define HID_USAGE_SENSOR_UNITS_HENRY 0x21E1E000
|
||||
#define HID_USAGE_SENSOR_UNITS_OHM 0x21D1E000
|
||||
#define HID_USAGE_SENSOR_UNITS_VOLT 0x21D1F000
|
||||
#define HID_USAGE_SENSOR_UNITS_HERTZ 0x01F0
|
||||
#define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SEC_SQRD 0x14E0
|
||||
#define HID_USAGE_SENSOR_UNITS_RADIANS 0x12
|
||||
#define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND 0x12F0
|
||||
#define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SEC_SQRD 0x12E0
|
||||
#define HID_USAGE_SENSOR_UNITS_SECOND 0x0110
|
||||
#define HID_USAGE_SENSOR_UNITS_GAUSS 0x01E1F000
|
||||
#define HID_USAGE_SENSOR_UNITS_GRAM 0x0101
|
||||
#define HID_USAGE_SENSOR_UNITS_CENTIMETER 0x11
|
||||
#define HID_USAGE_SENSOR_UNITS_G 0x1A
|
||||
#define HID_USAGE_SENSOR_UNITS_MILLISECOND 0x19
|
||||
#define HID_USAGE_SENSOR_UNITS_PERCENT 0x17
|
||||
#define HID_USAGE_SENSOR_UNITS_DEGREES 0x14
|
||||
#define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND 0x15
|
||||
|
||||
/* Common selectors */
|
||||
#define HID_USAGE_SENSOR_PROP_REPORT_INTERVAL 0x20030E
|
||||
#define HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS 0x20030F
|
||||
#define HID_USAGE_SENSOR_PROP_SENSITIVITY_RANGE_PCT 0x200310
|
||||
#define HID_USAGE_SENSOR_PROP_SENSITIVITY_REL_PCT 0x200311
|
||||
#define HID_USAGE_SENSOR_PROP_ACCURACY 0x200312
|
||||
#define HID_USAGE_SENSOR_PROP_RESOLUTION 0x200313
|
||||
#define HID_USAGE_SENSOR_PROP_RANGE_MAXIMUM 0x200314
|
||||
#define HID_USAGE_SENSOR_PROP_RANGE_MINIMUM 0x200315
|
||||
#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316
|
||||
#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319
|
||||
|
||||
#endif
|
||||
|
|
@ -414,7 +414,7 @@ struct hid_field {
|
|||
__u16 dpad; /* dpad input code */
|
||||
};
|
||||
|
||||
#define HID_MAX_FIELDS 128
|
||||
#define HID_MAX_FIELDS 256
|
||||
|
||||
struct hid_report {
|
||||
struct list_head list;
|
||||
|
|
@ -626,6 +626,7 @@ struct hid_usage_id {
|
|||
* @report_fixup: called before report descriptor parsing (NULL means nop)
|
||||
* @input_mapping: invoked on input registering before mapping an usage
|
||||
* @input_mapped: invoked on input registering after mapping an usage
|
||||
* @input_configured: invoked just before the device is registered
|
||||
* @feature_mapping: invoked on feature registering
|
||||
* @suspend: invoked on suspend (NULL means nop)
|
||||
* @resume: invoked on resume if device was not reset (NULL means nop)
|
||||
|
|
@ -670,6 +671,8 @@ struct hid_driver {
|
|||
int (*input_mapped)(struct hid_device *hdev,
|
||||
struct hid_input *hidinput, struct hid_field *field,
|
||||
struct hid_usage *usage, unsigned long **bit, int *max);
|
||||
void (*input_configured)(struct hid_device *hdev,
|
||||
struct hid_input *hidinput);
|
||||
void (*feature_mapping)(struct hid_device *hdev,
|
||||
struct hid_field *field,
|
||||
struct hid_usage *usage);
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
|
|||
extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
unsigned long address, pmd_t *pmd,
|
||||
pmd_t orig_pmd);
|
||||
extern pgtable_t get_pmd_huge_pte(struct mm_struct *mm);
|
||||
extern struct page *follow_trans_huge_pmd(struct mm_struct *mm,
|
||||
extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
|
||||
unsigned long addr,
|
||||
pmd_t *pmd,
|
||||
unsigned int flags);
|
||||
|
|
|
|||
|
|
@ -122,12 +122,53 @@
|
|||
#define REG_U32 4
|
||||
#define REG_U64 8
|
||||
|
||||
/*
|
||||
* As we look at expanding the KVP functionality to include
|
||||
* IP injection functionality, we need to maintain binary
|
||||
* compatibility with older daemons.
|
||||
*
|
||||
* The KVP opcodes are defined by the host and it was unfortunate
|
||||
* that I chose to treat the registration operation as part of the
|
||||
* KVP operations defined by the host.
|
||||
* Here is the level of compatibility
|
||||
* (between the user level daemon and the kernel KVP driver) that we
|
||||
* will implement:
|
||||
*
|
||||
* An older daemon will always be supported on a newer driver.
|
||||
* A given user level daemon will require a minimal version of the
|
||||
* kernel driver.
|
||||
* If we cannot handle the version differences, we will fail gracefully
|
||||
* (this can happen when we have a user level daemon that is more
|
||||
* advanced than the KVP driver.
|
||||
*
|
||||
* We will use values used in this handshake for determining if we have
|
||||
* workable user level daemon and the kernel driver. We begin by taking the
|
||||
* registration opcode out of the KVP opcode namespace. We will however,
|
||||
* maintain compatibility with the existing user-level daemon code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Daemon code not supporting IP injection (legacy daemon).
|
||||
*/
|
||||
|
||||
#define KVP_OP_REGISTER 4
|
||||
|
||||
/*
|
||||
* Daemon code supporting IP injection.
|
||||
* The KVP opcode field is used to communicate the
|
||||
* registration information; so define a namespace that
|
||||
* will be distinct from the host defined KVP opcode.
|
||||
*/
|
||||
|
||||
#define KVP_OP_REGISTER1 100
|
||||
|
||||
enum hv_kvp_exchg_op {
|
||||
KVP_OP_GET = 0,
|
||||
KVP_OP_SET,
|
||||
KVP_OP_DELETE,
|
||||
KVP_OP_ENUMERATE,
|
||||
KVP_OP_REGISTER,
|
||||
KVP_OP_GET_IP_INFO,
|
||||
KVP_OP_SET_IP_INFO,
|
||||
KVP_OP_COUNT /* Number of operations, must be last. */
|
||||
};
|
||||
|
||||
|
|
@ -140,6 +181,39 @@ enum hv_kvp_exchg_pool {
|
|||
KVP_POOL_COUNT /* Number of pools, must be last. */
|
||||
};
|
||||
|
||||
/*
|
||||
* Some Hyper-V status codes.
|
||||
*/
|
||||
|
||||
#define HV_S_OK 0x00000000
|
||||
#define HV_E_FAIL 0x80004005
|
||||
#define HV_S_CONT 0x80070103
|
||||
#define HV_ERROR_NOT_SUPPORTED 0x80070032
|
||||
#define HV_ERROR_MACHINE_LOCKED 0x800704F7
|
||||
#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F
|
||||
#define HV_INVALIDARG 0x80070057
|
||||
#define HV_GUID_NOTFOUND 0x80041002
|
||||
|
||||
#define ADDR_FAMILY_NONE 0x00
|
||||
#define ADDR_FAMILY_IPV4 0x01
|
||||
#define ADDR_FAMILY_IPV6 0x02
|
||||
|
||||
#define MAX_ADAPTER_ID_SIZE 128
|
||||
#define MAX_IP_ADDR_SIZE 1024
|
||||
#define MAX_GATEWAY_SIZE 512
|
||||
|
||||
|
||||
struct hv_kvp_ipaddr_value {
|
||||
__u16 adapter_id[MAX_ADAPTER_ID_SIZE];
|
||||
__u8 addr_family;
|
||||
__u8 dhcp_enabled;
|
||||
__u16 ip_addr[MAX_IP_ADDR_SIZE];
|
||||
__u16 sub_net[MAX_IP_ADDR_SIZE];
|
||||
__u16 gate_way[MAX_GATEWAY_SIZE];
|
||||
__u16 dns_addr[MAX_IP_ADDR_SIZE];
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
struct hv_kvp_hdr {
|
||||
__u8 operation;
|
||||
__u8 pool;
|
||||
|
|
@ -181,16 +255,26 @@ struct hv_kvp_register {
|
|||
};
|
||||
|
||||
struct hv_kvp_msg {
|
||||
struct hv_kvp_hdr kvp_hdr;
|
||||
union {
|
||||
struct hv_kvp_hdr kvp_hdr;
|
||||
int error;
|
||||
};
|
||||
union {
|
||||
struct hv_kvp_msg_get kvp_get;
|
||||
struct hv_kvp_msg_set kvp_set;
|
||||
struct hv_kvp_msg_delete kvp_delete;
|
||||
struct hv_kvp_msg_enumerate kvp_enum_data;
|
||||
struct hv_kvp_ipaddr_value kvp_ip_val;
|
||||
struct hv_kvp_register kvp_register;
|
||||
} body;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct hv_kvp_ip_msg {
|
||||
__u8 operation;
|
||||
__u8 pool;
|
||||
struct hv_kvp_ipaddr_value kvp_ip_val;
|
||||
} __attribute__((packed));
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/list.h>
|
||||
|
|
@ -405,7 +489,7 @@ struct vmtransfer_page_range {
|
|||
struct vmtransfer_page_packet_header {
|
||||
struct vmpacket_descriptor d;
|
||||
u16 xfer_pageset_id;
|
||||
bool sender_owns_set;
|
||||
u8 sender_owns_set;
|
||||
u8 reserved;
|
||||
u32 range_cnt;
|
||||
struct vmtransfer_page_range ranges[1];
|
||||
|
|
@ -559,7 +643,7 @@ struct vmbus_channel_query_vmbus_version {
|
|||
/* VMBus Version Supported parameters */
|
||||
struct vmbus_channel_version_supported {
|
||||
struct vmbus_channel_message_header header;
|
||||
bool version_supported;
|
||||
u8 version_supported;
|
||||
} __packed;
|
||||
|
||||
/* Offer Channel parameters */
|
||||
|
|
@ -568,7 +652,7 @@ struct vmbus_channel_offer_channel {
|
|||
struct vmbus_channel_offer offer;
|
||||
u32 child_relid;
|
||||
u8 monitorid;
|
||||
bool monitor_allocated;
|
||||
u8 monitor_allocated;
|
||||
} __packed;
|
||||
|
||||
/* Rescind Offer parameters */
|
||||
|
|
@ -704,7 +788,7 @@ struct vmbus_channel_initiate_contact {
|
|||
|
||||
struct vmbus_channel_version_response {
|
||||
struct vmbus_channel_message_header header;
|
||||
bool version_supported;
|
||||
u8 version_supported;
|
||||
} __packed;
|
||||
|
||||
enum vmbus_channel_state {
|
||||
|
|
@ -977,11 +1061,6 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver);
|
|||
#define ICMSGHDRFLAG_REQUEST 2
|
||||
#define ICMSGHDRFLAG_RESPONSE 4
|
||||
|
||||
#define HV_S_OK 0x00000000
|
||||
#define HV_E_FAIL 0x80004005
|
||||
#define HV_S_CONT 0x80070103
|
||||
#define HV_ERROR_NOT_SUPPORTED 0x80070032
|
||||
#define HV_ERROR_MACHINE_LOCKED 0x800704F7
|
||||
|
||||
/*
|
||||
* While we want to handle util services as regular devices,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@
|
|||
* @values: Array of bitmasks of GPIO settings (low/high) for each
|
||||
* position
|
||||
* @n_values: Number of multiplexer positions (busses to instantiate)
|
||||
* @classes: Optional I2C auto-detection classes
|
||||
* @gpio_chip: Optional GPIO chip name; if set, GPIO pin numbers are given
|
||||
* relative to the base GPIO number of that chip
|
||||
* @gpios: Array of GPIO numbers used to control MUX
|
||||
* @n_gpios: Number of GPIOs used to control MUX
|
||||
* @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
|
||||
|
|
@ -30,6 +33,8 @@ struct i2c_mux_gpio_platform_data {
|
|||
int base_nr;
|
||||
const unsigned *values;
|
||||
int n_values;
|
||||
const unsigned *classes;
|
||||
char *gpio_chip;
|
||||
const unsigned *gpios;
|
||||
int n_gpios;
|
||||
unsigned idle;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
|
||||
struct device *mux_dev,
|
||||
void *mux_priv, u32 force_nr, u32 chan_id,
|
||||
unsigned int class,
|
||||
int (*select) (struct i2c_adapter *,
|
||||
void *mux_dev, u32 chan_id),
|
||||
int (*deselect) (struct i2c_adapter *,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ struct i2c_pnx_mif {
|
|||
struct timer_list timer; /* Timeout */
|
||||
u8 * buf; /* Data buffer */
|
||||
int len; /* Length of data buffer */
|
||||
int order; /* RX Bytes to order via TX */
|
||||
};
|
||||
|
||||
struct i2c_pnx_algo_data {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
|
|||
* The driver.owner field should be set to the module owner of this driver.
|
||||
* The driver.name field should be set to the name of this driver.
|
||||
*
|
||||
* For automatic device detection, both @detect and @address_data must
|
||||
* For automatic device detection, both @detect and @address_list must
|
||||
* be defined. @class should also be set, otherwise only devices forced
|
||||
* with module parameters will be created. The detect function must
|
||||
* fill at least the name field of the i2c_board_info structure it is
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
struct pca954x_platform_mode {
|
||||
int adap_id;
|
||||
unsigned int deselect_on_exit:1;
|
||||
unsigned int class;
|
||||
};
|
||||
|
||||
/* Per mux/switch data, used with i2c_register_board_info */
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
* @setup: optional callback issued once the GPIOs are valid
|
||||
* @teardown: optional callback issued before the GPIOs are invalidated
|
||||
* @context: optional parameter passed to setup() and teardown()
|
||||
* @irq: optional interrupt number
|
||||
*
|
||||
* In addition to the I2C_BOARD_INFO() state appropriate to each chip,
|
||||
* the i2c_board_info used with the pcf875x driver must provide its
|
||||
|
|
@ -39,6 +40,8 @@ struct pcf857x_platform_data {
|
|||
int gpio, unsigned ngpio,
|
||||
void *context);
|
||||
void *context;
|
||||
|
||||
int irq;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_PCF857X_H */
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
|||
|
||||
int twl_get_type(void);
|
||||
int twl_get_version(void);
|
||||
int twl_get_hfclk_rate(void);
|
||||
|
||||
int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
|
||||
int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
|
||||
|
|
@ -561,9 +562,6 @@ struct twl4030_bci_platform_data {
|
|||
|
||||
/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */
|
||||
struct twl4030_gpio_platform_data {
|
||||
int gpio_base;
|
||||
unsigned irq_base, irq_end;
|
||||
|
||||
/* package the two LED signals as output-only GPIOs? */
|
||||
bool use_leds;
|
||||
|
||||
|
|
@ -666,7 +664,7 @@ struct twl4030_codec_data {
|
|||
unsigned int check_defaults:1;
|
||||
unsigned int reset_registers:1;
|
||||
unsigned int hs_extmute:1;
|
||||
void (*set_hs_extmute)(int mute);
|
||||
int hs_extmute_gpio;
|
||||
};
|
||||
|
||||
struct twl4030_vibra_data {
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@
|
|||
#define IDR_SIZE (1 << IDR_BITS)
|
||||
#define IDR_MASK ((1 << IDR_BITS)-1)
|
||||
|
||||
#define MAX_ID_SHIFT (sizeof(int)*8 - 1)
|
||||
#define MAX_ID_BIT (1U << MAX_ID_SHIFT)
|
||||
#define MAX_ID_MASK (MAX_ID_BIT - 1)
|
||||
#define MAX_IDR_SHIFT (sizeof(int)*8 - 1)
|
||||
#define MAX_IDR_BIT (1U << MAX_IDR_SHIFT)
|
||||
#define MAX_IDR_MASK (MAX_IDR_BIT - 1)
|
||||
|
||||
/* Leave the possibility of an incomplete final layer */
|
||||
#define MAX_LEVEL (MAX_ID_SHIFT + IDR_BITS - 1) / IDR_BITS
|
||||
#define MAX_IDR_LEVEL ((MAX_IDR_SHIFT + IDR_BITS - 1) / IDR_BITS)
|
||||
|
||||
/* Number of id_layer structs to leave in free list */
|
||||
#define IDR_FREE_MAX MAX_LEVEL + MAX_LEVEL
|
||||
#define MAX_IDR_FREE (MAX_IDR_LEVEL * 2)
|
||||
|
||||
struct idr_layer {
|
||||
unsigned long bitmap; /* A zero bit means "space here" */
|
||||
|
|
|
|||
|
|
@ -1934,36 +1934,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
|
|||
return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_fhss_chan_to_freq - get channel frequency
|
||||
* @channel: the FHSS channel
|
||||
*
|
||||
* Convert IEEE802.11 FHSS channel to frequency (MHz)
|
||||
* Ref IEEE 802.11-2007 section 14.6
|
||||
*/
|
||||
static inline int ieee80211_fhss_chan_to_freq(int channel)
|
||||
{
|
||||
if ((channel > 1) && (channel < 96))
|
||||
return channel + 2400;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_freq_to_fhss_chan - get channel
|
||||
* @freq: the channels frequency
|
||||
*
|
||||
* Convert frequency (MHz) to IEEE802.11 FHSS channel
|
||||
* Ref IEEE 802.11-2007 section 14.6
|
||||
*/
|
||||
static inline int ieee80211_freq_to_fhss_chan(int freq)
|
||||
{
|
||||
if ((freq > 2401) && (freq < 2496))
|
||||
return freq - 2400;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_dsss_chan_to_freq - get channel center frequency
|
||||
* @channel: the DSSS channel
|
||||
|
|
@ -2000,56 +1970,6 @@ static inline int ieee80211_freq_to_dsss_chan(int freq)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back
|
||||
* Ref IEEE 802.11-2007 section 18.4.6.2
|
||||
*
|
||||
* The channels and frequencies are the same as those defined for DSSS
|
||||
*/
|
||||
#define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan)
|
||||
#define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq)
|
||||
|
||||
/* Convert IEEE802.11 ERP channel to frequency (MHz) and back
|
||||
* Ref IEEE 802.11-2007 section 19.4.2
|
||||
*/
|
||||
#define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan)
|
||||
#define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq)
|
||||
|
||||
/**
|
||||
* ieee80211_ofdm_chan_to_freq - get channel center frequency
|
||||
* @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
|
||||
* @channel: the OFDM channel
|
||||
*
|
||||
* Convert IEEE802.11 OFDM channel to center frequency (MHz)
|
||||
* Ref IEEE 802.11-2007 section 17.3.8.3.2
|
||||
*/
|
||||
static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel)
|
||||
{
|
||||
if ((channel > 0) && (channel <= 200) &&
|
||||
(s_freq >= 4000))
|
||||
return s_freq + (channel * 5);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_freq_to_ofdm_channel - get channel
|
||||
* @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
|
||||
* @freq: the frequency
|
||||
*
|
||||
* Convert frequency (MHz) to IEEE802.11 OFDM channel
|
||||
* Ref IEEE 802.11-2007 section 17.3.8.3.2
|
||||
*
|
||||
* This routine selects the channel with the closest center frequency.
|
||||
*/
|
||||
static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq)
|
||||
{
|
||||
if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) &&
|
||||
(s_freq >= 4000))
|
||||
return (freq + 2 - s_freq) / 5;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_tu_to_usec - convert time units (TU) to microseconds
|
||||
* @tu: the TUs
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
#define ARPHRD_PHONET 820 /* PhoNet media type */
|
||||
#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
|
||||
#define ARPHRD_CAIF 822 /* CAIF media type */
|
||||
#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
|
||||
|
||||
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
|
||||
#define ARPHRD_NONE 0xFFFE /* zero header length */
|
||||
|
|
|
|||
|
|
@ -272,6 +272,22 @@ enum macvlan_mode {
|
|||
|
||||
#define MACVLAN_FLAG_NOPROMISC 1
|
||||
|
||||
/* VXLAN section */
|
||||
enum {
|
||||
IFLA_VXLAN_UNSPEC,
|
||||
IFLA_VXLAN_ID,
|
||||
IFLA_VXLAN_GROUP,
|
||||
IFLA_VXLAN_LINK,
|
||||
IFLA_VXLAN_LOCAL,
|
||||
IFLA_VXLAN_TTL,
|
||||
IFLA_VXLAN_TOS,
|
||||
IFLA_VXLAN_LEARNING,
|
||||
IFLA_VXLAN_AGEING,
|
||||
IFLA_VXLAN_LIMIT,
|
||||
__IFLA_VXLAN_MAX
|
||||
};
|
||||
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
|
||||
|
||||
/* SR-IOV virtual function management section */
|
||||
|
||||
enum {
|
||||
|
|
@ -398,4 +414,22 @@ struct ifla_port_vsi {
|
|||
__u8 pad[3];
|
||||
};
|
||||
|
||||
|
||||
/* IPoIB section */
|
||||
|
||||
enum {
|
||||
IFLA_IPOIB_UNSPEC,
|
||||
IFLA_IPOIB_PKEY,
|
||||
IFLA_IPOIB_MODE,
|
||||
IFLA_IPOIB_UMCAST,
|
||||
__IFLA_IPOIB_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
|
||||
IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
|
||||
};
|
||||
|
||||
#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
|
||||
|
||||
#endif /* _LINUX_IF_LINK_H */
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ struct team_port {
|
|||
struct netpoll *np;
|
||||
#endif
|
||||
|
||||
s32 priority; /* lower number ~ higher priority */
|
||||
u16 queue_id;
|
||||
struct list_head qom_list; /* node in queue override mapping list */
|
||||
long mode_priv[0];
|
||||
};
|
||||
|
||||
|
|
@ -96,21 +99,6 @@ static inline void team_netpoll_send_skb(struct team_port *port,
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
|
||||
sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
|
||||
skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
|
||||
|
||||
skb->dev = port->dev;
|
||||
if (unlikely(netpoll_tx_running(port->dev))) {
|
||||
team_netpoll_send_skb(port, skb);
|
||||
return 0;
|
||||
}
|
||||
return dev_queue_xmit(skb);
|
||||
}
|
||||
|
||||
struct team_mode_ops {
|
||||
int (*init)(struct team *team);
|
||||
void (*exit)(struct team *team);
|
||||
|
|
@ -120,7 +108,7 @@ struct team_mode_ops {
|
|||
bool (*transmit)(struct team *team, struct sk_buff *skb);
|
||||
int (*port_enter)(struct team *team, struct team_port *port);
|
||||
void (*port_leave)(struct team *team, struct team_port *port);
|
||||
void (*port_change_mac)(struct team *team, struct team_port *port);
|
||||
void (*port_change_dev_addr)(struct team *team, struct team_port *port);
|
||||
void (*port_enabled)(struct team *team, struct team_port *port);
|
||||
void (*port_disabled)(struct team *team, struct team_port *port);
|
||||
};
|
||||
|
|
@ -130,6 +118,7 @@ enum team_option_type {
|
|||
TEAM_OPTION_TYPE_STRING,
|
||||
TEAM_OPTION_TYPE_BINARY,
|
||||
TEAM_OPTION_TYPE_BOOL,
|
||||
TEAM_OPTION_TYPE_S32,
|
||||
};
|
||||
|
||||
struct team_option_inst_info {
|
||||
|
|
@ -146,6 +135,7 @@ struct team_gsetter_ctx {
|
|||
u32 len;
|
||||
} bin_val;
|
||||
bool bool_val;
|
||||
s32 s32_val;
|
||||
} data;
|
||||
struct team_option_inst_info *info;
|
||||
};
|
||||
|
|
@ -197,9 +187,26 @@ struct team {
|
|||
|
||||
const struct team_mode *mode;
|
||||
struct team_mode_ops ops;
|
||||
bool queue_override_enabled;
|
||||
struct list_head *qom_lists; /* array of queue override mapping lists */
|
||||
long mode_priv[TEAM_MODE_PRIV_LONGS];
|
||||
};
|
||||
|
||||
static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
|
||||
sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
|
||||
skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
|
||||
|
||||
skb->dev = port->dev;
|
||||
if (unlikely(netpoll_tx_running(team->dev))) {
|
||||
team_netpoll_send_skb(port, skb);
|
||||
return 0;
|
||||
}
|
||||
return dev_queue_xmit(skb);
|
||||
}
|
||||
|
||||
static inline struct hlist_head *team_port_index_hash(struct team *team,
|
||||
int port_index)
|
||||
{
|
||||
|
|
@ -231,7 +238,7 @@ static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
extern int team_port_set_team_mac(struct team_port *port);
|
||||
extern int team_port_set_team_dev_addr(struct team_port *port);
|
||||
extern int team_options_register(struct team *team,
|
||||
const struct team_option *option,
|
||||
size_t option_count);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ enum {
|
|||
IFLA_GRE_TTL,
|
||||
IFLA_GRE_TOS,
|
||||
IFLA_GRE_PMTUDISC,
|
||||
IFLA_GRE_ENCAP_LIMIT,
|
||||
IFLA_GRE_FLOWINFO,
|
||||
IFLA_GRE_FLAGS,
|
||||
__IFLA_GRE_MAX,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
|
|||
/* found in socket.c */
|
||||
extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
|
||||
|
||||
struct vlan_info;
|
||||
|
||||
static inline int is_vlan_dev(struct net_device *dev)
|
||||
{
|
||||
return dev->priv_flags & IFF_802_1Q_VLAN;
|
||||
|
|
@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev,
|
|||
const struct net_device *by_dev);
|
||||
extern void vlan_vids_del_by_dev(struct net_device *dev,
|
||||
const struct net_device *by_dev);
|
||||
|
||||
extern bool vlan_uses_dev(const struct net_device *dev);
|
||||
#else
|
||||
static inline struct net_device *
|
||||
__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
|
||||
|
|
@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev,
|
|||
const struct net_device *by_dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool vlan_uses_dev(const struct net_device *dev)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
|||
173
include/linux/iio/adc/ad_sigma_delta.h
Normal file
173
include/linux/iio/adc/ad_sigma_delta.h
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* Support code for Analog Devices Sigma-Delta ADCs
|
||||
*
|
||||
* Copyright 2012 Analog Devices Inc.
|
||||
* Author: Lars-Peter Clausen <lars@metafoo.de>
|
||||
*
|
||||
* Licensed under the GPL-2.
|
||||
*/
|
||||
#ifndef __AD_SIGMA_DELTA_H__
|
||||
#define __AD_SIGMA_DELTA_H__
|
||||
|
||||
enum ad_sigma_delta_mode {
|
||||
AD_SD_MODE_CONTINUOUS = 0,
|
||||
AD_SD_MODE_SINGLE = 1,
|
||||
AD_SD_MODE_IDLE = 2,
|
||||
AD_SD_MODE_POWERDOWN = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ad_sigma_delta_calib_data - Calibration data for Sigma Delta devices
|
||||
* @mode: Calibration mode.
|
||||
* @channel: Calibration channel.
|
||||
*/
|
||||
struct ad_sd_calib_data {
|
||||
unsigned int mode;
|
||||
unsigned int channel;
|
||||
};
|
||||
|
||||
struct ad_sigma_delta;
|
||||
struct iio_dev;
|
||||
|
||||
/**
|
||||
* struct ad_sigma_delta_info - Sigma Delta driver specific callbacks and options
|
||||
* @set_channel: Will be called to select the current channel, may be NULL.
|
||||
* @set_mode: Will be called to select the current mode, may be NULL.
|
||||
* @postprocess_sample: Is called for each sampled data word, can be used to
|
||||
* modify or drop the sample data, it, may be NULL.
|
||||
* @has_registers: true if the device has writable and readable registers, false
|
||||
* if there is just one read-only sample data shift register.
|
||||
* @addr_shift: Shift of the register address in the communications register.
|
||||
* @read_mask: Mask for the communications register having the read bit set.
|
||||
*/
|
||||
struct ad_sigma_delta_info {
|
||||
int (*set_channel)(struct ad_sigma_delta *, unsigned int channel);
|
||||
int (*set_mode)(struct ad_sigma_delta *, enum ad_sigma_delta_mode mode);
|
||||
int (*postprocess_sample)(struct ad_sigma_delta *, unsigned int raw_sample);
|
||||
bool has_registers;
|
||||
unsigned int addr_shift;
|
||||
unsigned int read_mask;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ad_sigma_delta - Sigma Delta device struct
|
||||
* @spi: The spi device associated with the Sigma Delta device.
|
||||
* @trig: The IIO trigger associated with the Sigma Delta device.
|
||||
*
|
||||
* Most of the fields are private to the sigma delta library code and should not
|
||||
* be accessed by individual drivers.
|
||||
*/
|
||||
struct ad_sigma_delta {
|
||||
struct spi_device *spi;
|
||||
struct iio_trigger *trig;
|
||||
|
||||
/* private: */
|
||||
struct completion completion;
|
||||
bool irq_dis;
|
||||
|
||||
bool bus_locked;
|
||||
|
||||
uint8_t comm;
|
||||
|
||||
const struct ad_sigma_delta_info *info;
|
||||
|
||||
/*
|
||||
* DMA (thus cache coherency maintenance) requires the
|
||||
* transfer buffers to live in their own cache lines.
|
||||
*/
|
||||
uint8_t data[4] ____cacheline_aligned;
|
||||
};
|
||||
|
||||
static inline int ad_sigma_delta_set_channel(struct ad_sigma_delta *sd,
|
||||
unsigned int channel)
|
||||
{
|
||||
if (sd->info->set_channel)
|
||||
return sd->info->set_channel(sd, channel);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ad_sigma_delta_set_mode(struct ad_sigma_delta *sd,
|
||||
unsigned int mode)
|
||||
{
|
||||
if (sd->info->set_mode)
|
||||
return sd->info->set_mode(sd, mode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ad_sigma_delta_postprocess_sample(struct ad_sigma_delta *sd,
|
||||
unsigned int raw_sample)
|
||||
{
|
||||
if (sd->info->postprocess_sample)
|
||||
return sd->info->postprocess_sample(sd, raw_sample);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm);
|
||||
int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
|
||||
unsigned int size, unsigned int val);
|
||||
int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
|
||||
unsigned int size, unsigned int *val);
|
||||
|
||||
int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev,
|
||||
const struct iio_chan_spec *chan, int *val);
|
||||
int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta,
|
||||
const struct ad_sd_calib_data *cd, unsigned int n);
|
||||
int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev,
|
||||
struct spi_device *spi, const struct ad_sigma_delta_info *info);
|
||||
|
||||
int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev);
|
||||
void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev);
|
||||
|
||||
int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
|
||||
|
||||
#define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
|
||||
_storagebits, _shift, _extend_name, _type) \
|
||||
{ \
|
||||
.type = (_type), \
|
||||
.differential = (_channel2 == -1 ? 0 : 1), \
|
||||
.indexed = 1, \
|
||||
.channel = (_channel1), \
|
||||
.channel2 = (_channel2), \
|
||||
.address = (_address), \
|
||||
.extend_name = (_extend_name), \
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT | \
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \
|
||||
.scan_index = (_si), \
|
||||
.scan_type = { \
|
||||
.sign = 'u', \
|
||||
.realbits = (_bits), \
|
||||
.storagebits = (_storagebits), \
|
||||
.shift = (_shift), \
|
||||
.endianness = IIO_BE, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
|
||||
_storagebits, _shift) \
|
||||
__AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
|
||||
_storagebits, _shift, NULL, IIO_VOLTAGE)
|
||||
|
||||
#define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \
|
||||
_storagebits, _shift) \
|
||||
__AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \
|
||||
_storagebits, _shift, "shorted", IIO_VOLTAGE)
|
||||
|
||||
#define AD_SD_CHANNEL(_si, _channel, _address, _bits, \
|
||||
_storagebits, _shift) \
|
||||
__AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
|
||||
_storagebits, _shift, NULL, IIO_VOLTAGE)
|
||||
|
||||
#define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \
|
||||
__AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \
|
||||
_storagebits, _shift, NULL, IIO_TEMP)
|
||||
|
||||
#define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \
|
||||
_shift) \
|
||||
__AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
|
||||
_storagebits, _shift, "supply", IIO_VOLTAGE)
|
||||
|
||||
#endif
|
||||
|
|
@ -36,7 +36,7 @@ struct iio_buffer;
|
|||
* any of them not existing.
|
||||
**/
|
||||
struct iio_buffer_access_funcs {
|
||||
int (*store_to)(struct iio_buffer *buffer, u8 *data, s64 timestamp);
|
||||
int (*store_to)(struct iio_buffer *buffer, u8 *data);
|
||||
int (*read_first_n)(struct iio_buffer *buffer,
|
||||
size_t n,
|
||||
char __user *buf);
|
||||
|
|
@ -118,10 +118,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
|
|||
* iio_push_to_buffer() - push to a registered buffer.
|
||||
* @buffer: IIO buffer structure for device
|
||||
* @data: the data to push to the buffer
|
||||
* @timestamp: timestamp to associate with the data
|
||||
*/
|
||||
int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data,
|
||||
s64 timestamp);
|
||||
int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data);
|
||||
|
||||
int iio_update_demux(struct iio_dev *indio_dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* the Free Software Foundation.
|
||||
*/
|
||||
#ifndef _IIO_INKERN_CONSUMER_H_
|
||||
#define _IIO_INKERN_CONSUMER_H
|
||||
#define _IIO_INKERN_CONSUMER_H_
|
||||
#include <linux/iio/types.h>
|
||||
|
||||
struct iio_dev;
|
||||
|
|
@ -61,7 +61,7 @@ void iio_channel_release_all(struct iio_channel *chan);
|
|||
|
||||
/**
|
||||
* iio_read_channel_raw() - read from a given channel
|
||||
* @channel: The channel being queried.
|
||||
* @chan: The channel being queried.
|
||||
* @val: Value read back.
|
||||
*
|
||||
* Note raw reads from iio channels are in adc counts and hence
|
||||
|
|
@ -70,6 +70,21 @@ void iio_channel_release_all(struct iio_channel *chan);
|
|||
int iio_read_channel_raw(struct iio_channel *chan,
|
||||
int *val);
|
||||
|
||||
/**
|
||||
* iio_read_channel_processed() - read processed value from a given channel
|
||||
* @chan: The channel being queried.
|
||||
* @val: Value read back.
|
||||
*
|
||||
* Returns an error code or 0.
|
||||
*
|
||||
* This function will read a processed value from a channel. A processed value
|
||||
* means that this value will have the correct unit and not some device internal
|
||||
* representation. If the device does not support reporting a processed value
|
||||
* the function will query the raw value and the channels scale and offset and
|
||||
* do the appropriate transformation.
|
||||
*/
|
||||
int iio_read_channel_processed(struct iio_channel *chan, int *val);
|
||||
|
||||
/**
|
||||
* iio_get_channel_type() - get the type of a channel
|
||||
* @channel: The channel being queried.
|
||||
|
|
@ -82,7 +97,7 @@ int iio_get_channel_type(struct iio_channel *channel,
|
|||
|
||||
/**
|
||||
* iio_read_channel_scale() - read the scale value for a channel
|
||||
* @channel: The channel being queried.
|
||||
* @chan: The channel being queried.
|
||||
* @val: First part of value read back.
|
||||
* @val2: Second part of value read back.
|
||||
*
|
||||
|
|
@ -93,4 +108,27 @@ int iio_get_channel_type(struct iio_channel *channel,
|
|||
int iio_read_channel_scale(struct iio_channel *chan, int *val,
|
||||
int *val2);
|
||||
|
||||
/**
|
||||
* iio_convert_raw_to_processed() - Converts a raw value to a processed value
|
||||
* @chan: The channel being queried
|
||||
* @raw: The raw IIO to convert
|
||||
* @processed: The result of the conversion
|
||||
* @scale: Scale factor to apply during the conversion
|
||||
*
|
||||
* Returns an error code or 0.
|
||||
*
|
||||
* This function converts a raw value to processed value for a specific channel.
|
||||
* A raw value is the device internal representation of a sample and the value
|
||||
* returned by iio_read_channel_raw, so the unit of that value is device
|
||||
* depended. A processed value on the other hand is value has a normed unit
|
||||
* according with the IIO specification.
|
||||
*
|
||||
* The scale factor allows to increase the precession of the returned value. For
|
||||
* a scale factor of 1 the function will return the result in the normal IIO
|
||||
* unit for the channel type. E.g. millivolt for voltage channels, if you want
|
||||
* nanovolts instead pass 1000 as the scale factor.
|
||||
*/
|
||||
int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
|
||||
int *processed, unsigned int scale);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@
|
|||
#define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */
|
||||
#define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */
|
||||
#define ADF4350_MAX_MODULUS 4095
|
||||
#define ADF4350_MAX_R_CNT 1023
|
||||
|
||||
|
||||
/**
|
||||
* struct adf4350_platform_data - platform specific information
|
||||
|
|
|
|||
|
|
@ -35,10 +35,13 @@ enum iio_chan_info_enum {
|
|||
IIO_CHAN_INFO_FREQUENCY,
|
||||
IIO_CHAN_INFO_PHASE,
|
||||
IIO_CHAN_INFO_HARDWAREGAIN,
|
||||
IIO_CHAN_INFO_HYSTERESIS,
|
||||
};
|
||||
|
||||
#define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2)
|
||||
#define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1)
|
||||
#define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \
|
||||
IIO_CHAN_INFO_SEPARATE_BIT(type))
|
||||
|
||||
#define IIO_CHAN_INFO_RAW_SEPARATE_BIT \
|
||||
IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW)
|
||||
|
|
@ -100,6 +103,10 @@ enum iio_chan_info_enum {
|
|||
IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN)
|
||||
#define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \
|
||||
IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN)
|
||||
#define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT \
|
||||
IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS)
|
||||
#define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT \
|
||||
IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS)
|
||||
|
||||
enum iio_endian {
|
||||
IIO_CPU,
|
||||
|
|
@ -164,7 +171,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
|
|||
* IIO_ENUM() - Initialize enum extended channel attribute
|
||||
* @_name: Attribute name
|
||||
* @_shared: Whether the attribute is shared between all channels
|
||||
* @_e: Pointer to a iio_enum struct
|
||||
* @_e: Pointer to an iio_enum struct
|
||||
*
|
||||
* This should usually be used together with IIO_ENUM_AVAILABLE()
|
||||
*/
|
||||
|
|
@ -180,9 +187,9 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
|
|||
/**
|
||||
* IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute
|
||||
* @_name: Attribute name ("_available" will be appended to the name)
|
||||
* @_e: Pointer to a iio_enum struct
|
||||
* @_e: Pointer to an iio_enum struct
|
||||
*
|
||||
* Creates a read only attribute which list all the available enum items in a
|
||||
* Creates a read only attribute which lists all the available enum items in a
|
||||
* space separated list. This should usually be used together with IIO_ENUM()
|
||||
*/
|
||||
#define IIO_ENUM_AVAILABLE(_name, _e) \
|
||||
|
|
@ -229,6 +236,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
|
|||
* @indexed: Specify the channel has a numerical index. If not,
|
||||
* the channel index number will be suppressed for sysfs
|
||||
* attributes but not for event codes.
|
||||
* @output: Channel is output.
|
||||
* @differential: Channel is differential.
|
||||
*/
|
||||
struct iio_chan_spec {
|
||||
|
|
@ -255,6 +263,21 @@ struct iio_chan_spec {
|
|||
unsigned differential:1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* iio_channel_has_info() - Checks whether a channel supports a info attribute
|
||||
* @chan: The channel to be queried
|
||||
* @type: Type of the info attribute to be checked
|
||||
*
|
||||
* Returns true if the channels supports reporting values for the given info
|
||||
* attribute type, false otherwise.
|
||||
*/
|
||||
static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
|
||||
enum iio_chan_info_enum type)
|
||||
{
|
||||
return chan->info_mask & IIO_CHAN_INFO_BITS(type);
|
||||
}
|
||||
|
||||
#define IIO_ST(si, rb, sb, sh) \
|
||||
{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh }
|
||||
|
||||
|
|
@ -312,6 +335,9 @@ struct iio_dev;
|
|||
* Meaning is event dependent.
|
||||
* @validate_trigger: function to validate the trigger when the
|
||||
* current trigger gets changed.
|
||||
* @update_scan_mode: function to configure device and scan buffer when
|
||||
* channels have changed
|
||||
* @debugfs_reg_access: function to read or write register value of device
|
||||
**/
|
||||
struct iio_info {
|
||||
struct module *driver_module;
|
||||
|
|
@ -367,10 +393,10 @@ struct iio_info {
|
|||
* scan mask is valid for the device.
|
||||
*/
|
||||
struct iio_buffer_setup_ops {
|
||||
int (*preenable)(struct iio_dev *);
|
||||
int (*postenable)(struct iio_dev *);
|
||||
int (*predisable)(struct iio_dev *);
|
||||
int (*postdisable)(struct iio_dev *);
|
||||
int (*preenable)(struct iio_dev *);
|
||||
int (*postenable)(struct iio_dev *);
|
||||
int (*predisable)(struct iio_dev *);
|
||||
int (*postdisable)(struct iio_dev *);
|
||||
bool (*validate_scan_mask)(struct iio_dev *indio_dev,
|
||||
const unsigned long *scan_mask);
|
||||
};
|
||||
|
|
@ -516,6 +542,31 @@ static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
|
|||
return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* iio_device_set_drvdata() - Set device driver data
|
||||
* @indio_dev: IIO device structure
|
||||
* @data: Driver specific data
|
||||
*
|
||||
* Allows to attach an arbitrary pointer to an IIO device, which can later be
|
||||
* retrieved by iio_device_get_drvdata().
|
||||
*/
|
||||
static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
|
||||
{
|
||||
dev_set_drvdata(&indio_dev->dev, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* iio_device_get_drvdata() - Get device driver data
|
||||
* @indio_dev: IIO device structure
|
||||
*
|
||||
* Returns the data previously set with iio_device_set_drvdata()
|
||||
*/
|
||||
static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
|
||||
{
|
||||
return dev_get_drvdata(&indio_dev->dev);
|
||||
}
|
||||
|
||||
/* Can we make this smaller? */
|
||||
#define IIO_ALIGN L1_CACHE_BYTES
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef __LINUX_IIO_KFIFO_BUF_H__
|
||||
#define __LINUX_IIO_KFIFO_BUF_H__
|
||||
|
||||
#include <linux/kfifo.h>
|
||||
#include <linux/iio/iio.h>
|
||||
|
|
@ -6,3 +8,4 @@
|
|||
struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev);
|
||||
void iio_kfifo_free(struct iio_buffer *r);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
* the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IIO_MACHINE_H__
|
||||
#define __LINUX_IIO_MACHINE_H__
|
||||
|
||||
/**
|
||||
* struct iio_map - description of link between consumer and device channels
|
||||
* @adc_channel_label: Label used to identify the channel on the provider.
|
||||
|
|
@ -22,3 +25,5 @@ struct iio_map {
|
|||
const char *consumer_dev_name;
|
||||
const char *consumer_channel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ struct iio_subirq {
|
|||
* instances of a given device.
|
||||
**/
|
||||
struct iio_trigger_ops {
|
||||
struct module *owner;
|
||||
struct module *owner;
|
||||
int (*set_trigger_state)(struct iio_trigger *trig, bool state);
|
||||
int (*try_reenable)(struct iio_trigger *trig);
|
||||
int (*validate_device)(struct iio_trigger *trig,
|
||||
|
|
@ -39,7 +39,7 @@ struct iio_trigger_ops {
|
|||
|
||||
/**
|
||||
* struct iio_trigger - industrial I/O trigger device
|
||||
*
|
||||
* @ops: [DRIVER] operations structure
|
||||
* @id: [INTERN] unique id number
|
||||
* @name: [DRIVER] unique name
|
||||
* @dev: [DRIVER] associated device (if relevant)
|
||||
|
|
@ -76,19 +76,19 @@ struct iio_trigger {
|
|||
static inline struct iio_trigger *to_iio_trigger(struct device *d)
|
||||
{
|
||||
return container_of(d, struct iio_trigger, dev);
|
||||
};
|
||||
}
|
||||
|
||||
static inline void iio_trigger_put(struct iio_trigger *trig)
|
||||
{
|
||||
module_put(trig->ops->owner);
|
||||
put_device(&trig->dev);
|
||||
};
|
||||
}
|
||||
|
||||
static inline void iio_trigger_get(struct iio_trigger *trig)
|
||||
{
|
||||
get_device(&trig->dev);
|
||||
__module_get(trig->ops->owner);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* iio_trigger_register() - register a trigger with the IIO core
|
||||
|
|
@ -104,7 +104,8 @@ void iio_trigger_unregister(struct iio_trigger *trig_info);
|
|||
|
||||
/**
|
||||
* iio_trigger_poll() - called on a trigger occurring
|
||||
* @trig: trigger which occurred
|
||||
* @trig: trigger which occurred
|
||||
* @time: timestamp when trigger occurred
|
||||
*
|
||||
* Typically called in relevant hardware interrupt handler.
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,15 @@
|
|||
* the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IIO_TRIGGER_CONSUMER_H__
|
||||
#define __LINUX_IIO_TRIGGER_CONSUMER_H__
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct iio_dev;
|
||||
struct iio_trigger;
|
||||
|
||||
/**
|
||||
* struct iio_poll_func - poll function pair
|
||||
*
|
||||
|
|
@ -50,3 +59,5 @@ void iio_trigger_notify_done(struct iio_trigger *trig);
|
|||
*/
|
||||
int iio_triggered_buffer_postenable(struct iio_dev *indio_dev);
|
||||
int iio_triggered_buffer_predisable(struct iio_dev *indio_dev);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -57,5 +57,6 @@ enum iio_modifier {
|
|||
#define IIO_VAL_INT_PLUS_MICRO 2
|
||||
#define IIO_VAL_INT_PLUS_NANO 3
|
||||
#define IIO_VAL_INT_PLUS_MICRO_DB 4
|
||||
#define IIO_VAL_FRACTIONAL 10
|
||||
|
||||
#endif /* _IIO_TYPES_H_ */
|
||||
|
|
|
|||
|
|
@ -39,5 +39,32 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IMA_H */
|
||||
|
||||
#ifdef CONFIG_IMA_APPRAISE
|
||||
extern void ima_inode_post_setattr(struct dentry *dentry);
|
||||
extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
|
||||
const void *xattr_value, size_t xattr_value_len);
|
||||
extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
|
||||
#else
|
||||
static inline void ima_inode_post_setattr(struct dentry *dentry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int ima_inode_setxattr(struct dentry *dentry,
|
||||
const char *xattr_name,
|
||||
const void *xattr_value,
|
||||
size_t xattr_value_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ima_inode_removexattr(struct dentry *dentry,
|
||||
const char *xattr_name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IMA_APPRAISE_H */
|
||||
#endif /* _LINUX_IMA_H */
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue