mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
Merge branch 'linus' into sched/core
Merge reason: update to latest upstream Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
commit
c9494727cf
5698 changed files with 386924 additions and 170811 deletions
|
|
@ -126,6 +126,7 @@ header-y += nfs2.h
|
|||
header-y += nfs4_mount.h
|
||||
header-y += nfs_mount.h
|
||||
header-y += nl80211.h
|
||||
header-y += omapfb.h
|
||||
header-y += param.h
|
||||
header-y += pci_regs.h
|
||||
header-y += perf_event.h
|
||||
|
|
@ -363,6 +364,7 @@ unifdef-y += uio.h
|
|||
unifdef-y += unistd.h
|
||||
unifdef-y += usbdevice_fs.h
|
||||
unifdef-y += utsname.h
|
||||
unifdef-y += vhost.h
|
||||
unifdef-y += videodev2.h
|
||||
unifdef-y += videodev.h
|
||||
unifdef-y += virtio_config.h
|
||||
|
|
|
|||
|
|
@ -121,16 +121,15 @@ struct vfsmount;
|
|||
struct super_block;
|
||||
struct pacct_struct;
|
||||
struct pid_namespace;
|
||||
extern int acct_parm[]; /* for sysctl */
|
||||
extern void acct_auto_close_mnt(struct vfsmount *m);
|
||||
extern void acct_auto_close(struct super_block *sb);
|
||||
extern void acct_init_pacct(struct pacct_struct *pacct);
|
||||
extern void acct_collect(long exitcode, int group_dead);
|
||||
extern void acct_process(void);
|
||||
extern void acct_exit_ns(struct pid_namespace *);
|
||||
#else
|
||||
#define acct_auto_close_mnt(x) do { } while (0)
|
||||
#define acct_auto_close(x) do { } while (0)
|
||||
#define acct_init_pacct(x) do { } while (0)
|
||||
#define acct_collect(x,y) do { } while (0)
|
||||
#define acct_process() do { } while (0)
|
||||
#define acct_exit_ns(ns) do { } while (0)
|
||||
|
|
|
|||
|
|
@ -21,22 +21,21 @@
|
|||
#define CLCD_UBAS 0x00000010
|
||||
#define CLCD_LBAS 0x00000014
|
||||
|
||||
#if !defined(CONFIG_ARCH_VERSATILE) && !defined(CONFIG_ARCH_REALVIEW)
|
||||
#define CLCD_IENB 0x00000018
|
||||
#define CLCD_CNTL 0x0000001c
|
||||
#else
|
||||
/*
|
||||
* Someone rearranged these two registers on the Versatile
|
||||
* platform...
|
||||
*/
|
||||
#define CLCD_IENB 0x0000001c
|
||||
#define CLCD_CNTL 0x00000018
|
||||
#endif
|
||||
#define CLCD_PL110_IENB 0x00000018
|
||||
#define CLCD_PL110_CNTL 0x0000001c
|
||||
#define CLCD_PL110_STAT 0x00000020
|
||||
#define CLCD_PL110_INTR 0x00000024
|
||||
#define CLCD_PL110_UCUR 0x00000028
|
||||
#define CLCD_PL110_LCUR 0x0000002C
|
||||
|
||||
#define CLCD_PL111_CNTL 0x00000018
|
||||
#define CLCD_PL111_IENB 0x0000001c
|
||||
#define CLCD_PL111_RIS 0x00000020
|
||||
#define CLCD_PL111_MIS 0x00000024
|
||||
#define CLCD_PL111_ICR 0x00000028
|
||||
#define CLCD_PL111_UCUR 0x0000002c
|
||||
#define CLCD_PL111_LCUR 0x00000030
|
||||
|
||||
#define CLCD_STAT 0x00000020
|
||||
#define CLCD_INTR 0x00000024
|
||||
#define CLCD_UCUR 0x00000028
|
||||
#define CLCD_LCUR 0x0000002C
|
||||
#define CLCD_PALL 0x00000200
|
||||
#define CLCD_PALETTE 0x00000200
|
||||
|
||||
|
|
@ -147,6 +146,8 @@ struct clcd_fb {
|
|||
struct clcd_board *board;
|
||||
void *board_data;
|
||||
void __iomem *regs;
|
||||
u16 off_ienb;
|
||||
u16 off_cntl;
|
||||
u32 clcd_cntl;
|
||||
u32 cmap[16];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ extern void audit_syscall_exit(int failed, long return_code);
|
|||
extern void __audit_getname(const char *name);
|
||||
extern void audit_putname(const char *name);
|
||||
extern void __audit_inode(const char *name, const struct dentry *dentry);
|
||||
extern void __audit_inode_child(const char *dname, const struct dentry *dentry,
|
||||
extern void __audit_inode_child(const struct dentry *dentry,
|
||||
const struct inode *parent);
|
||||
extern void __audit_ptrace(struct task_struct *t);
|
||||
|
||||
|
|
@ -442,11 +442,10 @@ static inline void audit_inode(const char *name, const struct dentry *dentry) {
|
|||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode(name, dentry);
|
||||
}
|
||||
static inline void audit_inode_child(const char *dname,
|
||||
const struct dentry *dentry,
|
||||
static inline void audit_inode_child(const struct dentry *dentry,
|
||||
const struct inode *parent) {
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode_child(dname, dentry, parent);
|
||||
__audit_inode_child(dentry, parent);
|
||||
}
|
||||
void audit_core_dumps(long signr);
|
||||
|
||||
|
|
@ -544,9 +543,9 @@ extern int audit_signals;
|
|||
#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(d,i,p) do { ; } while (0)
|
||||
#define __audit_inode_child(i,p) do { ; } while (0)
|
||||
#define audit_inode(n,d) do { ; } while (0)
|
||||
#define audit_inode_child(d,i,p) do { ; } while (0)
|
||||
#define audit_inode_child(i,p) do { ; } while (0)
|
||||
#define audit_core_dumps(i) do { ; } while (0)
|
||||
#define auditsc_get_stamp(c,t,s) (0)
|
||||
#define audit_get_loginuid(t) (-1)
|
||||
|
|
|
|||
|
|
@ -36,18 +36,18 @@ struct backlight_device;
|
|||
struct fb_info;
|
||||
|
||||
struct backlight_ops {
|
||||
const unsigned int options;
|
||||
unsigned int options;
|
||||
|
||||
#define BL_CORE_SUSPENDRESUME (1 << 0)
|
||||
|
||||
/* Notify the backlight driver some property has changed */
|
||||
int (* const update_status)(struct backlight_device *);
|
||||
int (*update_status)(struct backlight_device *);
|
||||
/* Return the current backlight brightness (accounting for power,
|
||||
fb_blank etc.) */
|
||||
int (* const get_brightness)(struct backlight_device *);
|
||||
int (*get_brightness)(struct backlight_device *);
|
||||
/* Check if given framebuffer device is the one bound to this backlight;
|
||||
return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
|
||||
int (* const check_fb)(struct fb_info *);
|
||||
int (*check_fb)(struct backlight_device *, struct fb_info *);
|
||||
};
|
||||
|
||||
/* This structure defines all the properties of a backlight */
|
||||
|
|
@ -103,7 +103,8 @@ static inline void backlight_update_status(struct backlight_device *bd)
|
|||
}
|
||||
|
||||
extern struct backlight_device *backlight_device_register(const char *name,
|
||||
struct device *dev, void *devdata, const struct backlight_ops *ops);
|
||||
struct device *dev, void *devdata, const struct backlight_ops *ops,
|
||||
const struct backlight_properties *props);
|
||||
extern void backlight_device_unregister(struct backlight_device *bd);
|
||||
extern void backlight_force_update(struct backlight_device *bd,
|
||||
enum backlight_update_reason reason);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ struct coredump_params {
|
|||
struct pt_regs *regs;
|
||||
struct file *file;
|
||||
unsigned long limit;
|
||||
unsigned long mm_flags;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -16,11 +16,13 @@
|
|||
*/
|
||||
#include <asm/bitops.h>
|
||||
|
||||
#define for_each_bit(bit, addr, size) \
|
||||
#define for_each_set_bit(bit, addr, size) \
|
||||
for ((bit) = find_first_bit((addr), (size)); \
|
||||
(bit) < (size); \
|
||||
(bit) = find_next_bit((addr), (size), (bit) + 1))
|
||||
|
||||
/* Temporary */
|
||||
#define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size)
|
||||
|
||||
static __inline__ int get_bitmask_order(unsigned int count)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -150,8 +150,8 @@ struct blk_user_trace_setup {
|
|||
struct blk_trace {
|
||||
int trace_state;
|
||||
struct rchan *rchan;
|
||||
unsigned long *sequence;
|
||||
unsigned char *msg_data;
|
||||
unsigned long __percpu *sequence;
|
||||
unsigned char __percpu *msg_data;
|
||||
u16 act_mask;
|
||||
u64 start_lba;
|
||||
u64 end_lba;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ extern unsigned long max_pfn;
|
|||
extern unsigned long saved_max_pfn;
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NO_BOOTMEM
|
||||
/*
|
||||
* node_bootmem_map is a map pointer - the bits represent all physical
|
||||
* memory pages (including holes) on the node.
|
||||
|
|
@ -37,6 +38,7 @@ typedef struct bootmem_data {
|
|||
} bootmem_data_t;
|
||||
|
||||
extern bootmem_data_t bootmem_node_data[];
|
||||
#endif
|
||||
|
||||
extern unsigned long bootmem_bootmap_pages(unsigned long);
|
||||
|
||||
|
|
@ -46,6 +48,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
|
|||
unsigned long endpfn);
|
||||
extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
|
||||
|
||||
unsigned long free_all_memory_core_early(int nodeid);
|
||||
extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
|
||||
extern unsigned long free_all_bootmem(void);
|
||||
|
||||
|
|
@ -84,6 +87,10 @@ extern void *__alloc_bootmem_node(pg_data_t *pgdat,
|
|||
unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
void *__alloc_bootmem_node_high(pg_data_t *pgdat,
|
||||
unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
|
||||
unsigned long size,
|
||||
unsigned long align,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,14 @@
|
|||
#define PHY_ID_BCM50610 0x0143bd60
|
||||
#define PHY_ID_BCM50610M 0x0143bd70
|
||||
#define PHY_ID_BCMAC131 0x0143bc70
|
||||
#define PHY_ID_BCM57780 0x03625d90
|
||||
|
||||
#define PHY_BCM_OUI_MASK 0xfffffc00
|
||||
#define PHY_BCM_OUI_1 0x00206000
|
||||
#define PHY_BCM_OUI_2 0x0143bc00
|
||||
#define PHY_BCM_OUI_3 0x03625c00
|
||||
|
||||
|
||||
#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
|
||||
#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
|
||||
#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
|
||||
|
|
|
|||
109
include/linux/btree-128.h
Normal file
109
include/linux/btree-128.h
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
extern struct btree_geo btree_geo128;
|
||||
|
||||
struct btree_head128 { struct btree_head h; };
|
||||
|
||||
static inline void btree_init_mempool128(struct btree_head128 *head,
|
||||
mempool_t *mempool)
|
||||
{
|
||||
btree_init_mempool(&head->h, mempool);
|
||||
}
|
||||
|
||||
static inline int btree_init128(struct btree_head128 *head)
|
||||
{
|
||||
return btree_init(&head->h);
|
||||
}
|
||||
|
||||
static inline void btree_destroy128(struct btree_head128 *head)
|
||||
{
|
||||
btree_destroy(&head->h);
|
||||
}
|
||||
|
||||
static inline void *btree_lookup128(struct btree_head128 *head, u64 k1, u64 k2)
|
||||
{
|
||||
u64 key[2] = {k1, k2};
|
||||
return btree_lookup(&head->h, &btree_geo128, (unsigned long *)&key);
|
||||
}
|
||||
|
||||
static inline void *btree_get_prev128(struct btree_head128 *head,
|
||||
u64 *k1, u64 *k2)
|
||||
{
|
||||
u64 key[2] = {*k1, *k2};
|
||||
void *val;
|
||||
|
||||
val = btree_get_prev(&head->h, &btree_geo128,
|
||||
(unsigned long *)&key);
|
||||
*k1 = key[0];
|
||||
*k2 = key[1];
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline int btree_insert128(struct btree_head128 *head, u64 k1, u64 k2,
|
||||
void *val, gfp_t gfp)
|
||||
{
|
||||
u64 key[2] = {k1, k2};
|
||||
return btree_insert(&head->h, &btree_geo128,
|
||||
(unsigned long *)&key, val, gfp);
|
||||
}
|
||||
|
||||
static inline int btree_update128(struct btree_head128 *head, u64 k1, u64 k2,
|
||||
void *val)
|
||||
{
|
||||
u64 key[2] = {k1, k2};
|
||||
return btree_update(&head->h, &btree_geo128,
|
||||
(unsigned long *)&key, val);
|
||||
}
|
||||
|
||||
static inline void *btree_remove128(struct btree_head128 *head, u64 k1, u64 k2)
|
||||
{
|
||||
u64 key[2] = {k1, k2};
|
||||
return btree_remove(&head->h, &btree_geo128, (unsigned long *)&key);
|
||||
}
|
||||
|
||||
static inline void *btree_last128(struct btree_head128 *head, u64 *k1, u64 *k2)
|
||||
{
|
||||
u64 key[2];
|
||||
void *val;
|
||||
|
||||
val = btree_last(&head->h, &btree_geo128, (unsigned long *)&key[0]);
|
||||
if (val) {
|
||||
*k1 = key[0];
|
||||
*k2 = key[1];
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline int btree_merge128(struct btree_head128 *target,
|
||||
struct btree_head128 *victim,
|
||||
gfp_t gfp)
|
||||
{
|
||||
return btree_merge(&target->h, &victim->h, &btree_geo128, gfp);
|
||||
}
|
||||
|
||||
void visitor128(void *elem, unsigned long opaque, unsigned long *__key,
|
||||
size_t index, void *__func);
|
||||
|
||||
typedef void (*visitor128_t)(void *elem, unsigned long opaque,
|
||||
u64 key1, u64 key2, size_t index);
|
||||
|
||||
static inline size_t btree_visitor128(struct btree_head128 *head,
|
||||
unsigned long opaque,
|
||||
visitor128_t func2)
|
||||
{
|
||||
return btree_visitor(&head->h, &btree_geo128, opaque,
|
||||
visitor128, func2);
|
||||
}
|
||||
|
||||
static inline size_t btree_grim_visitor128(struct btree_head128 *head,
|
||||
unsigned long opaque,
|
||||
visitor128_t func2)
|
||||
{
|
||||
return btree_grim_visitor(&head->h, &btree_geo128, opaque,
|
||||
visitor128, func2);
|
||||
}
|
||||
|
||||
#define btree_for_each_safe128(head, k1, k2, val) \
|
||||
for (val = btree_last128(head, &k1, &k2); \
|
||||
val; \
|
||||
val = btree_get_prev128(head, &k1, &k2))
|
||||
|
||||
147
include/linux/btree-type.h
Normal file
147
include/linux/btree-type.h
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
#define __BTREE_TP(pfx, type, sfx) pfx ## type ## sfx
|
||||
#define _BTREE_TP(pfx, type, sfx) __BTREE_TP(pfx, type, sfx)
|
||||
#define BTREE_TP(pfx) _BTREE_TP(pfx, BTREE_TYPE_SUFFIX,)
|
||||
#define BTREE_FN(name) BTREE_TP(btree_ ## name)
|
||||
#define BTREE_TYPE_HEAD BTREE_TP(struct btree_head)
|
||||
#define VISITOR_FN BTREE_TP(visitor)
|
||||
#define VISITOR_FN_T _BTREE_TP(visitor, BTREE_TYPE_SUFFIX, _t)
|
||||
|
||||
BTREE_TYPE_HEAD {
|
||||
struct btree_head h;
|
||||
};
|
||||
|
||||
static inline void BTREE_FN(init_mempool)(BTREE_TYPE_HEAD *head,
|
||||
mempool_t *mempool)
|
||||
{
|
||||
btree_init_mempool(&head->h, mempool);
|
||||
}
|
||||
|
||||
static inline int BTREE_FN(init)(BTREE_TYPE_HEAD *head)
|
||||
{
|
||||
return btree_init(&head->h);
|
||||
}
|
||||
|
||||
static inline void BTREE_FN(destroy)(BTREE_TYPE_HEAD *head)
|
||||
{
|
||||
btree_destroy(&head->h);
|
||||
}
|
||||
|
||||
static inline int BTREE_FN(merge)(BTREE_TYPE_HEAD *target,
|
||||
BTREE_TYPE_HEAD *victim,
|
||||
gfp_t gfp)
|
||||
{
|
||||
return btree_merge(&target->h, &victim->h, BTREE_TYPE_GEO, gfp);
|
||||
}
|
||||
|
||||
#if (BITS_PER_LONG > BTREE_TYPE_BITS)
|
||||
static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
|
||||
{
|
||||
unsigned long _key = key;
|
||||
return btree_lookup(&head->h, BTREE_TYPE_GEO, &_key);
|
||||
}
|
||||
|
||||
static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
|
||||
void *val, gfp_t gfp)
|
||||
{
|
||||
unsigned long _key = key;
|
||||
return btree_insert(&head->h, BTREE_TYPE_GEO, &_key, val, gfp);
|
||||
}
|
||||
|
||||
static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
|
||||
void *val)
|
||||
{
|
||||
unsigned long _key = key;
|
||||
return btree_update(&head->h, BTREE_TYPE_GEO, &_key, val);
|
||||
}
|
||||
|
||||
static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
|
||||
{
|
||||
unsigned long _key = key;
|
||||
return btree_remove(&head->h, BTREE_TYPE_GEO, &_key);
|
||||
}
|
||||
|
||||
static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
|
||||
{
|
||||
unsigned long _key;
|
||||
void *val = btree_last(&head->h, BTREE_TYPE_GEO, &_key);
|
||||
if (val)
|
||||
*key = _key;
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
|
||||
{
|
||||
unsigned long _key = *key;
|
||||
void *val = btree_get_prev(&head->h, BTREE_TYPE_GEO, &_key);
|
||||
if (val)
|
||||
*key = _key;
|
||||
return val;
|
||||
}
|
||||
#else
|
||||
static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
|
||||
{
|
||||
return btree_lookup(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key);
|
||||
}
|
||||
|
||||
static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
|
||||
void *val, gfp_t gfp)
|
||||
{
|
||||
return btree_insert(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key,
|
||||
val, gfp);
|
||||
}
|
||||
|
||||
static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
|
||||
void *val)
|
||||
{
|
||||
return btree_update(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key, val);
|
||||
}
|
||||
|
||||
static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
|
||||
{
|
||||
return btree_remove(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key);
|
||||
}
|
||||
|
||||
static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
|
||||
{
|
||||
return btree_last(&head->h, BTREE_TYPE_GEO, (unsigned long *)key);
|
||||
}
|
||||
|
||||
static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
|
||||
{
|
||||
return btree_get_prev(&head->h, BTREE_TYPE_GEO, (unsigned long *)key);
|
||||
}
|
||||
#endif
|
||||
|
||||
void VISITOR_FN(void *elem, unsigned long opaque, unsigned long *key,
|
||||
size_t index, void *__func);
|
||||
|
||||
typedef void (*VISITOR_FN_T)(void *elem, unsigned long opaque,
|
||||
BTREE_KEYTYPE key, size_t index);
|
||||
|
||||
static inline size_t BTREE_FN(visitor)(BTREE_TYPE_HEAD *head,
|
||||
unsigned long opaque,
|
||||
VISITOR_FN_T func2)
|
||||
{
|
||||
return btree_visitor(&head->h, BTREE_TYPE_GEO, opaque,
|
||||
visitorl, func2);
|
||||
}
|
||||
|
||||
static inline size_t BTREE_FN(grim_visitor)(BTREE_TYPE_HEAD *head,
|
||||
unsigned long opaque,
|
||||
VISITOR_FN_T func2)
|
||||
{
|
||||
return btree_grim_visitor(&head->h, BTREE_TYPE_GEO, opaque,
|
||||
visitorl, func2);
|
||||
}
|
||||
|
||||
#undef VISITOR_FN
|
||||
#undef VISITOR_FN_T
|
||||
#undef __BTREE_TP
|
||||
#undef _BTREE_TP
|
||||
#undef BTREE_TP
|
||||
#undef BTREE_FN
|
||||
#undef BTREE_TYPE_HEAD
|
||||
#undef BTREE_TYPE_SUFFIX
|
||||
#undef BTREE_TYPE_GEO
|
||||
#undef BTREE_KEYTYPE
|
||||
#undef BTREE_TYPE_BITS
|
||||
243
include/linux/btree.h
Normal file
243
include/linux/btree.h
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
#ifndef BTREE_H
|
||||
#define BTREE_H
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mempool.h>
|
||||
|
||||
/**
|
||||
* DOC: B+Tree basics
|
||||
*
|
||||
* A B+Tree is a data structure for looking up arbitrary (currently allowing
|
||||
* unsigned long, u32, u64 and 2 * u64) keys into pointers. The data structure
|
||||
* is described at http://en.wikipedia.org/wiki/B-tree, we currently do not
|
||||
* use binary search to find the key on lookups.
|
||||
*
|
||||
* Each B+Tree consists of a head, that contains bookkeeping information and
|
||||
* a variable number (starting with zero) nodes. Each node contains the keys
|
||||
* and pointers to sub-nodes, or, for leaf nodes, the keys and values for the
|
||||
* tree entries.
|
||||
*
|
||||
* Each node in this implementation has the following layout:
|
||||
* [key1, key2, ..., keyN] [val1, val2, ..., valN]
|
||||
*
|
||||
* Each key here is an array of unsigned longs, geo->no_longs in total. The
|
||||
* number of keys and values (N) is geo->no_pairs.
|
||||
*/
|
||||
|
||||
/**
|
||||
* struct btree_head - btree head
|
||||
*
|
||||
* @node: the first node in the tree
|
||||
* @mempool: mempool used for node allocations
|
||||
* @height: current of the tree
|
||||
*/
|
||||
struct btree_head {
|
||||
unsigned long *node;
|
||||
mempool_t *mempool;
|
||||
int height;
|
||||
};
|
||||
|
||||
/* btree geometry */
|
||||
struct btree_geo;
|
||||
|
||||
/**
|
||||
* btree_alloc - allocate function for the mempool
|
||||
* @gfp_mask: gfp mask for the allocation
|
||||
* @pool_data: unused
|
||||
*/
|
||||
void *btree_alloc(gfp_t gfp_mask, void *pool_data);
|
||||
|
||||
/**
|
||||
* btree_free - free function for the mempool
|
||||
* @element: the element to free
|
||||
* @pool_data: unused
|
||||
*/
|
||||
void btree_free(void *element, void *pool_data);
|
||||
|
||||
/**
|
||||
* btree_init_mempool - initialise a btree with given mempool
|
||||
*
|
||||
* @head: the btree head to initialise
|
||||
* @mempool: the mempool to use
|
||||
*
|
||||
* When this function is used, there is no need to destroy
|
||||
* the mempool.
|
||||
*/
|
||||
void btree_init_mempool(struct btree_head *head, mempool_t *mempool);
|
||||
|
||||
/**
|
||||
* btree_init - initialise a btree
|
||||
*
|
||||
* @head: the btree head to initialise
|
||||
*
|
||||
* This function allocates the memory pool that the
|
||||
* btree needs. Returns zero or a negative error code
|
||||
* (-%ENOMEM) when memory allocation fails.
|
||||
*
|
||||
*/
|
||||
int __must_check btree_init(struct btree_head *head);
|
||||
|
||||
/**
|
||||
* btree_destroy - destroy mempool
|
||||
*
|
||||
* @head: the btree head to destroy
|
||||
*
|
||||
* This function destroys the internal memory pool, use only
|
||||
* when using btree_init(), not with btree_init_mempool().
|
||||
*/
|
||||
void btree_destroy(struct btree_head *head);
|
||||
|
||||
/**
|
||||
* btree_lookup - look up a key in the btree
|
||||
*
|
||||
* @head: the btree to look in
|
||||
* @geo: the btree geometry
|
||||
* @key: the key to look up
|
||||
*
|
||||
* This function returns the value for the given key, or %NULL.
|
||||
*/
|
||||
void *btree_lookup(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long *key);
|
||||
|
||||
/**
|
||||
* btree_insert - insert an entry into the btree
|
||||
*
|
||||
* @head: the btree to add to
|
||||
* @geo: the btree geometry
|
||||
* @key: the key to add (must not already be present)
|
||||
* @val: the value to add (must not be %NULL)
|
||||
* @gfp: allocation flags for node allocations
|
||||
*
|
||||
* This function returns 0 if the item could be added, or an
|
||||
* error code if it failed (may fail due to memory pressure).
|
||||
*/
|
||||
int __must_check btree_insert(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long *key, void *val, gfp_t gfp);
|
||||
/**
|
||||
* btree_update - update an entry in the btree
|
||||
*
|
||||
* @head: the btree to update
|
||||
* @geo: the btree geometry
|
||||
* @key: the key to update
|
||||
* @val: the value to change it to (must not be %NULL)
|
||||
*
|
||||
* This function returns 0 if the update was successful, or
|
||||
* -%ENOENT if the key could not be found.
|
||||
*/
|
||||
int btree_update(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long *key, void *val);
|
||||
/**
|
||||
* btree_remove - remove an entry from the btree
|
||||
*
|
||||
* @head: the btree to update
|
||||
* @geo: the btree geometry
|
||||
* @key: the key to remove
|
||||
*
|
||||
* This function returns the removed entry, or %NULL if the key
|
||||
* could not be found.
|
||||
*/
|
||||
void *btree_remove(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long *key);
|
||||
|
||||
/**
|
||||
* btree_merge - merge two btrees
|
||||
*
|
||||
* @target: the tree that gets all the entries
|
||||
* @victim: the tree that gets merged into @target
|
||||
* @geo: the btree geometry
|
||||
* @gfp: allocation flags
|
||||
*
|
||||
* The two trees @target and @victim may not contain the same keys,
|
||||
* that is a bug and triggers a BUG(). This function returns zero
|
||||
* if the trees were merged successfully, and may return a failure
|
||||
* when memory allocation fails, in which case both trees might have
|
||||
* been partially merged, i.e. some entries have been moved from
|
||||
* @victim to @target.
|
||||
*/
|
||||
int btree_merge(struct btree_head *target, struct btree_head *victim,
|
||||
struct btree_geo *geo, gfp_t gfp);
|
||||
|
||||
/**
|
||||
* btree_last - get last entry in btree
|
||||
*
|
||||
* @head: btree head
|
||||
* @geo: btree geometry
|
||||
* @key: last key
|
||||
*
|
||||
* Returns the last entry in the btree, and sets @key to the key
|
||||
* of that entry; returns NULL if the tree is empty, in that case
|
||||
* key is not changed.
|
||||
*/
|
||||
void *btree_last(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long *key);
|
||||
|
||||
/**
|
||||
* btree_get_prev - get previous entry
|
||||
*
|
||||
* @head: btree head
|
||||
* @geo: btree geometry
|
||||
* @key: pointer to key
|
||||
*
|
||||
* The function returns the next item right before the value pointed to by
|
||||
* @key, and updates @key with its key, or returns %NULL when there is no
|
||||
* entry with a key smaller than the given key.
|
||||
*/
|
||||
void *btree_get_prev(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long *key);
|
||||
|
||||
|
||||
/* internal use, use btree_visitor{l,32,64,128} */
|
||||
size_t btree_visitor(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long opaque,
|
||||
void (*func)(void *elem, unsigned long opaque,
|
||||
unsigned long *key, size_t index,
|
||||
void *func2),
|
||||
void *func2);
|
||||
|
||||
/* internal use, use btree_grim_visitor{l,32,64,128} */
|
||||
size_t btree_grim_visitor(struct btree_head *head, struct btree_geo *geo,
|
||||
unsigned long opaque,
|
||||
void (*func)(void *elem, unsigned long opaque,
|
||||
unsigned long *key,
|
||||
size_t index, void *func2),
|
||||
void *func2);
|
||||
|
||||
|
||||
#include <linux/btree-128.h>
|
||||
|
||||
extern struct btree_geo btree_geo32;
|
||||
#define BTREE_TYPE_SUFFIX l
|
||||
#define BTREE_TYPE_BITS BITS_PER_LONG
|
||||
#define BTREE_TYPE_GEO &btree_geo32
|
||||
#define BTREE_KEYTYPE unsigned long
|
||||
#include <linux/btree-type.h>
|
||||
|
||||
#define btree_for_each_safel(head, key, val) \
|
||||
for (val = btree_lastl(head, &key); \
|
||||
val; \
|
||||
val = btree_get_prevl(head, &key))
|
||||
|
||||
#define BTREE_TYPE_SUFFIX 32
|
||||
#define BTREE_TYPE_BITS 32
|
||||
#define BTREE_TYPE_GEO &btree_geo32
|
||||
#define BTREE_KEYTYPE u32
|
||||
#include <linux/btree-type.h>
|
||||
|
||||
#define btree_for_each_safe32(head, key, val) \
|
||||
for (val = btree_last32(head, &key); \
|
||||
val; \
|
||||
val = btree_get_prev32(head, &key))
|
||||
|
||||
extern struct btree_geo btree_geo64;
|
||||
#define BTREE_TYPE_SUFFIX 64
|
||||
#define BTREE_TYPE_BITS 64
|
||||
#define BTREE_TYPE_GEO &btree_geo64
|
||||
#define BTREE_KEYTYPE u64
|
||||
#include <linux/btree-type.h>
|
||||
|
||||
#define btree_for_each_safe64(head, key, val) \
|
||||
for (val = btree_last64(head, &key); \
|
||||
val; \
|
||||
val = btree_get_prev64(head, &key))
|
||||
|
||||
#endif
|
||||
|
|
@ -38,6 +38,7 @@ struct can_priv {
|
|||
|
||||
enum can_state state;
|
||||
u32 ctrlmode;
|
||||
u32 ctrlmode_supported;
|
||||
|
||||
int restart_ms;
|
||||
struct timer_list restart_timer;
|
||||
|
|
@ -46,6 +47,8 @@ struct can_priv {
|
|||
int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
|
||||
int (*do_get_state)(const struct net_device *dev,
|
||||
enum can_state *state);
|
||||
int (*do_get_berr_counter)(const struct net_device *dev,
|
||||
struct can_berr_counter *bec);
|
||||
|
||||
unsigned int echo_skb_max;
|
||||
struct sk_buff **echo_skb;
|
||||
|
|
@ -60,6 +63,21 @@ struct can_priv {
|
|||
*/
|
||||
#define get_can_dlc(i) (min_t(__u8, (i), 8))
|
||||
|
||||
/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
|
||||
static inline int can_dropped_invalid_skb(struct net_device *dev,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct can_frame *cf = (struct can_frame *)skb->data;
|
||||
|
||||
if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) {
|
||||
kfree_skb(skb);
|
||||
dev->stats.tx_dropped++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
|
||||
void free_candev(struct net_device *dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@ enum can_state {
|
|||
CAN_STATE_MAX
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN bus error counters
|
||||
*/
|
||||
struct can_berr_counter {
|
||||
__u16 txerr;
|
||||
__u16 rxerr;
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN controller mode
|
||||
*/
|
||||
|
|
@ -77,9 +85,11 @@ struct can_ctrlmode {
|
|||
__u32 flags;
|
||||
};
|
||||
|
||||
#define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */
|
||||
#define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */
|
||||
#define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */
|
||||
#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
|
||||
#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
|
||||
#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
|
||||
#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
|
||||
#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
|
||||
|
||||
/*
|
||||
* CAN device statistics
|
||||
|
|
@ -105,6 +115,7 @@ enum {
|
|||
IFLA_CAN_CTRLMODE,
|
||||
IFLA_CAN_RESTART_MS,
|
||||
IFLA_CAN_RESTART,
|
||||
IFLA_CAN_BERR_COUNTER,
|
||||
__IFLA_CAN_MAX
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef __CAN_PLATFORM_TI_HECC_H__
|
||||
#define __CAN_PLATFORM_TI_HECC_H__
|
||||
|
||||
/*
|
||||
* TI HECC (High End CAN Controller) driver platform header
|
||||
*
|
||||
|
|
@ -23,6 +26,7 @@
|
|||
* @mbx_offset: Mailbox RAM offset
|
||||
* @int_line: Interrupt line to use - 0 or 1
|
||||
* @version: version for future use
|
||||
* @transceiver_switch: platform specific callback fn for transceiver control
|
||||
*
|
||||
* Platform data structure to get all platform specific settings.
|
||||
* this structure also accounts the fact that the IP may have different
|
||||
|
|
@ -35,6 +39,6 @@ struct ti_hecc_platform_data {
|
|||
u32 mbx_offset;
|
||||
u32 int_line;
|
||||
u32 version;
|
||||
void (*transceiver_switch) (int);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -37,16 +37,24 @@ extern void cgroup_post_fork(struct task_struct *p);
|
|||
extern void cgroup_exit(struct task_struct *p, int run_callbacks);
|
||||
extern int cgroupstats_build(struct cgroupstats *stats,
|
||||
struct dentry *dentry);
|
||||
extern int cgroup_load_subsys(struct cgroup_subsys *ss);
|
||||
extern void cgroup_unload_subsys(struct cgroup_subsys *ss);
|
||||
|
||||
extern const struct file_operations proc_cgroup_operations;
|
||||
|
||||
/* Define the enumeration of all cgroup subsystems */
|
||||
/* Define the enumeration of all builtin cgroup subsystems */
|
||||
#define SUBSYS(_x) _x ## _subsys_id,
|
||||
enum cgroup_subsys_id {
|
||||
#include <linux/cgroup_subsys.h>
|
||||
CGROUP_SUBSYS_COUNT
|
||||
CGROUP_BUILTIN_SUBSYS_COUNT
|
||||
};
|
||||
#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 {
|
||||
|
|
@ -76,6 +84,12 @@ enum {
|
|||
CSS_REMOVED, /* This CSS is dead */
|
||||
};
|
||||
|
||||
/* Caller must verify that the css is not for root cgroup */
|
||||
static inline void __css_get(struct cgroup_subsys_state *css, int count)
|
||||
{
|
||||
atomic_add(count, &css->refcnt);
|
||||
}
|
||||
|
||||
/*
|
||||
* Call css_get() to hold a reference on the css; it can be used
|
||||
* for a reference obtained via:
|
||||
|
|
@ -87,7 +101,7 @@ static inline void css_get(struct cgroup_subsys_state *css)
|
|||
{
|
||||
/* We don't need to reference count the root state */
|
||||
if (!test_bit(CSS_ROOT, &css->flags))
|
||||
atomic_inc(&css->refcnt);
|
||||
__css_get(css, 1);
|
||||
}
|
||||
|
||||
static inline bool css_is_removed(struct cgroup_subsys_state *css)
|
||||
|
|
@ -118,11 +132,11 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
|
|||
* css_get() or css_tryget()
|
||||
*/
|
||||
|
||||
extern void __css_put(struct cgroup_subsys_state *css);
|
||||
extern void __css_put(struct cgroup_subsys_state *css, int count);
|
||||
static inline void css_put(struct cgroup_subsys_state *css)
|
||||
{
|
||||
if (!test_bit(CSS_ROOT, &css->flags))
|
||||
__css_put(css);
|
||||
__css_put(css, 1);
|
||||
}
|
||||
|
||||
/* bits in struct cgroup flags field */
|
||||
|
|
@ -221,6 +235,10 @@ struct cgroup {
|
|||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
|
||||
/* List of events which userspace want to recieve */
|
||||
struct list_head event_list;
|
||||
spinlock_t event_list_lock;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -258,7 +276,8 @@ struct css_set {
|
|||
/*
|
||||
* Set of subsystem states, one for each subsystem. This array
|
||||
* is immutable after creation apart from the init_css_set
|
||||
* during subsystem registration (at boot time).
|
||||
* during subsystem registration (at boot time) and modular subsystem
|
||||
* loading/unloading.
|
||||
*/
|
||||
struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
|
||||
|
||||
|
|
@ -363,6 +382,23 @@ struct cftype {
|
|||
int (*trigger)(struct cgroup *cgrp, unsigned int event);
|
||||
|
||||
int (*release)(struct inode *inode, struct file *file);
|
||||
|
||||
/*
|
||||
* register_event() callback will be used to add new userspace
|
||||
* waiter for changes related to the cftype. Implement it if
|
||||
* you want to provide this functionality. Use eventfd_signal()
|
||||
* on eventfd to send notification to userspace.
|
||||
*/
|
||||
int (*register_event)(struct cgroup *cgrp, struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd, const char *args);
|
||||
/*
|
||||
* unregister_event() callback will be called when userspace
|
||||
* closes the eventfd or on cgroup removing.
|
||||
* This callback must be implemented, if you want provide
|
||||
* notification functionality.
|
||||
*/
|
||||
int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd);
|
||||
};
|
||||
|
||||
struct cgroup_scanner {
|
||||
|
|
@ -428,6 +464,8 @@ struct cgroup_subsys {
|
|||
void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct task_struct *tsk, bool threadgroup);
|
||||
void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct task_struct *tsk, bool threadgroup);
|
||||
void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup *old_cgrp, struct task_struct *tsk,
|
||||
bool threadgroup);
|
||||
|
|
@ -472,6 +510,9 @@ struct cgroup_subsys {
|
|||
/* used when use_id == true */
|
||||
struct idr idr;
|
||||
spinlock_t id_lock;
|
||||
|
||||
/* should be defined only by modular subsystems */
|
||||
struct module *module;
|
||||
};
|
||||
|
||||
#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* See Documentation/circular-buffers.txt for more information.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CIRC_BUF_H
|
||||
#define _LINUX_CIRC_BUF_H 1
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ enum clock_event_nofitiers {
|
|||
* @list: list head for the management code
|
||||
* @mode: operating mode assigned by the management code
|
||||
* @next_event: local storage for the next event in oneshot mode
|
||||
* @retries: number of forced programming retries
|
||||
*/
|
||||
struct clock_event_device {
|
||||
const char *name;
|
||||
|
|
@ -93,6 +94,7 @@ struct clock_event_device {
|
|||
struct list_head list;
|
||||
enum clock_event_mode mode;
|
||||
ktime_t next_event;
|
||||
unsigned long retries;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
typedef __compat_uid32_t compat_uid_t;
|
||||
typedef __compat_gid32_t compat_gid_t;
|
||||
|
||||
struct compat_sel_arg_struct;
|
||||
struct rusage;
|
||||
|
||||
struct compat_itimerspec {
|
||||
|
|
@ -249,6 +250,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
|
|||
compat_ulong_t __user *outp, compat_ulong_t __user *exp,
|
||||
struct compat_timeval __user *tvp);
|
||||
|
||||
asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
|
||||
|
||||
asmlinkage long compat_sys_wait4(compat_pid_t pid,
|
||||
compat_uint_t __user *stat_addr, int options,
|
||||
struct compat_rusage __user *ru);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#ifdef __CHECKER__
|
||||
# define __user __attribute__((noderef, address_space(1)))
|
||||
# define __kernel /* default address space */
|
||||
# define __kernel __attribute__((address_space(0)))
|
||||
# define __safe __attribute__((safe))
|
||||
# define __force __attribute__((force))
|
||||
# define __nocast __attribute__((nocast))
|
||||
|
|
|
|||
45
include/linux/coredump.h
Normal file
45
include/linux/coredump.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef _LINUX_COREDUMP_H
|
||||
#define _LINUX_COREDUMP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
/*
|
||||
* These are the only things you should do on a core-file: use only these
|
||||
* functions to write out all the necessary info.
|
||||
*/
|
||||
static inline int dump_write(struct file *file, const void *addr, int nr)
|
||||
{
|
||||
return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
|
||||
}
|
||||
|
||||
static inline int dump_seek(struct file *file, loff_t off)
|
||||
{
|
||||
int ret = 1;
|
||||
|
||||
if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
|
||||
if (file->f_op->llseek(file, off, SEEK_CUR) < 0)
|
||||
return 0;
|
||||
} else {
|
||||
char *buf = (char *)get_zeroed_page(GFP_KERNEL);
|
||||
|
||||
if (!buf)
|
||||
return 0;
|
||||
while (off > 0) {
|
||||
unsigned long n = off;
|
||||
|
||||
if (n > PAGE_SIZE)
|
||||
n = PAGE_SIZE;
|
||||
if (!dump_write(file, buf, n)) {
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
off -= n;
|
||||
}
|
||||
free_page((unsigned long)buf);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_COREDUMP_H */
|
||||
|
|
@ -90,10 +90,10 @@ extern const struct cpumask *const cpu_active_mask;
|
|||
#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask)
|
||||
#define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask)
|
||||
#else
|
||||
#define num_online_cpus() 1
|
||||
#define num_possible_cpus() 1
|
||||
#define num_present_cpus() 1
|
||||
#define num_active_cpus() 1
|
||||
#define num_online_cpus() 1U
|
||||
#define num_possible_cpus() 1U
|
||||
#define num_present_cpus() 1U
|
||||
#define num_active_cpus() 1U
|
||||
#define cpu_online(cpu) ((cpu) == 0)
|
||||
#define cpu_possible(cpu) ((cpu) == 0)
|
||||
#define cpu_present(cpu) ((cpu) == 0)
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ static inline void put_cred(const struct cred *_cred)
|
|||
* task or by holding tasklist_lock to prevent it from being unlinked.
|
||||
*/
|
||||
#define __task_cred(task) \
|
||||
((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_is_held(&tasklist_lock))))
|
||||
((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held())))
|
||||
|
||||
/**
|
||||
* get_task_cred - Get another task's objective credentials
|
||||
|
|
|
|||
|
|
@ -14,11 +14,21 @@
|
|||
|
||||
/* Code active when included from pre-boot environment: */
|
||||
|
||||
/*
|
||||
* Some architectures want to ensure there is no local data in their
|
||||
* pre-boot environment, so that data can arbitarily relocated (via
|
||||
* GOT references). This is achieved by defining STATIC_RW_DATA to
|
||||
* be null.
|
||||
*/
|
||||
#ifndef STATIC_RW_DATA
|
||||
#define STATIC_RW_DATA static
|
||||
#endif
|
||||
|
||||
/* A trivial malloc implementation, adapted from
|
||||
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
|
||||
*/
|
||||
static unsigned long malloc_ptr;
|
||||
static int malloc_count;
|
||||
STATIC_RW_DATA unsigned long malloc_ptr;
|
||||
STATIC_RW_DATA int malloc_count;
|
||||
|
||||
static void *malloc(int size)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -118,10 +118,9 @@ struct dm_dev {
|
|||
/*
|
||||
* Constructors should call these functions to ensure destination devices
|
||||
* are opened/closed correctly.
|
||||
* FIXME: too many arguments.
|
||||
*/
|
||||
int dm_get_device(struct dm_target *ti, const char *path, sector_t start,
|
||||
sector_t len, fmode_t mode, struct dm_dev **result);
|
||||
int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode,
|
||||
struct dm_dev **result);
|
||||
void dm_put_device(struct dm_target *ti, struct dm_dev *d);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ extern int bus_unregister_notifier(struct bus_type *bus,
|
|||
|
||||
/* All 4 notifers below get called with the target struct device *
|
||||
* as an argument. Note that those functions are likely to be called
|
||||
* with the device semaphore held in the core, so be careful.
|
||||
* with the device lock held in the core, so be careful.
|
||||
*/
|
||||
#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
|
||||
#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
|
||||
|
|
@ -251,8 +251,10 @@ extern struct device *class_find_device(struct class *class,
|
|||
|
||||
struct class_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct class *class, char *buf);
|
||||
ssize_t (*store)(struct class *class, const char *buf, size_t count);
|
||||
ssize_t (*show)(struct class *class, struct class_attribute *attr,
|
||||
char *buf);
|
||||
ssize_t (*store)(struct class *class, struct class_attribute *attr,
|
||||
const char *buf, size_t count);
|
||||
};
|
||||
|
||||
#define CLASS_ATTR(_name, _mode, _show, _store) \
|
||||
|
|
@ -263,6 +265,23 @@ extern int __must_check class_create_file(struct class *class,
|
|||
extern void class_remove_file(struct class *class,
|
||||
const struct class_attribute *attr);
|
||||
|
||||
/* Simple class attribute that is just a static string */
|
||||
|
||||
struct class_attribute_string {
|
||||
struct class_attribute attr;
|
||||
char *str;
|
||||
};
|
||||
|
||||
/* Currently read-only only */
|
||||
#define _CLASS_ATTR_STRING(_name, _mode, _str) \
|
||||
{ __ATTR(_name, _mode, show_class_attr_string, NULL), _str }
|
||||
#define CLASS_ATTR_STRING(_name, _mode, _str) \
|
||||
struct class_attribute_string class_attr_##_name = \
|
||||
_CLASS_ATTR_STRING(_name, _mode, _str)
|
||||
|
||||
extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
|
||||
char *buf);
|
||||
|
||||
struct class_interface {
|
||||
struct list_head node;
|
||||
struct class *class;
|
||||
|
|
@ -489,6 +508,21 @@ static inline bool device_async_suspend_enabled(struct device *dev)
|
|||
return !!dev->power.async_suspend;
|
||||
}
|
||||
|
||||
static inline void device_lock(struct device *dev)
|
||||
{
|
||||
down(&dev->sem);
|
||||
}
|
||||
|
||||
static inline int device_trylock(struct device *dev)
|
||||
{
|
||||
return down_trylock(&dev->sem);
|
||||
}
|
||||
|
||||
static inline void device_unlock(struct device *dev)
|
||||
{
|
||||
up(&dev->sem);
|
||||
}
|
||||
|
||||
void driver_init(void);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@ enum dm_io_mem_type {
|
|||
struct dm_io_memory {
|
||||
enum dm_io_mem_type type;
|
||||
|
||||
unsigned offset;
|
||||
|
||||
union {
|
||||
struct page_list *pl;
|
||||
struct bio_vec *bvec;
|
||||
void *vma;
|
||||
void *addr;
|
||||
} ptr;
|
||||
|
||||
unsigned offset;
|
||||
};
|
||||
|
||||
struct dm_io_notify {
|
||||
|
|
|
|||
|
|
@ -266,9 +266,9 @@ enum {
|
|||
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_VERSION_MAJOR 4
|
||||
#define DM_VERSION_MINOR 16
|
||||
#define DM_VERSION_MINOR 17
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2009-11-05)"
|
||||
#define DM_VERSION_EXTRA "-ioctl (2010-03-05)"
|
||||
|
||||
/* Status bits */
|
||||
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
|
||||
|
|
@ -316,4 +316,9 @@ enum {
|
|||
*/
|
||||
#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */
|
||||
|
||||
/*
|
||||
* If set, a uevent was generated for which the caller may need to wait.
|
||||
*/
|
||||
#define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */
|
||||
|
||||
#endif /* _LINUX_DM_IOCTL_H */
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#define DM9000_PLATF_NO_EEPROM (0x0010)
|
||||
#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */
|
||||
|
||||
/* platfrom data for platfrom device structure's platfrom_data field */
|
||||
/* platform data for platform device structure's platform_data field */
|
||||
|
||||
struct dm9000_plat_data {
|
||||
unsigned int flags;
|
||||
|
|
|
|||
|
|
@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev)
|
|||
return DMA_BIT_MASK(32);
|
||||
}
|
||||
|
||||
static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
|
||||
{
|
||||
if (!dma_supported(dev, mask))
|
||||
return -EIO;
|
||||
dev->coherent_dma_mask = mask;
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern u64 dma_get_required_mask(struct device *dev);
|
||||
|
||||
static inline unsigned int dma_get_max_seg_size(struct device *dev)
|
||||
|
|
@ -232,4 +240,20 @@ struct dma_attrs;
|
|||
|
||||
#endif /* CONFIG_HAVE_DMA_ATTRS */
|
||||
|
||||
#ifdef CONFIG_NEED_DMA_MAP_STATE
|
||||
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
|
||||
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME
|
||||
#define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
|
||||
#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
|
||||
#define dma_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
|
||||
#define dma_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
|
||||
#else
|
||||
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
|
||||
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
|
||||
#define dma_unmap_addr(PTR, ADDR_NAME) (0)
|
||||
#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
|
||||
#define dma_unmap_len(PTR, LEN_NAME) (0)
|
||||
#define dma_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@
|
|||
* if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
|
||||
*/
|
||||
typedef s32 dma_cookie_t;
|
||||
#define DMA_MIN_COOKIE 1
|
||||
#define DMA_MAX_COOKIE INT_MAX
|
||||
|
||||
#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0)
|
||||
|
||||
|
|
@ -162,7 +164,7 @@ struct dma_chan {
|
|||
struct dma_chan_dev *dev;
|
||||
|
||||
struct list_head device_node;
|
||||
struct dma_chan_percpu *local;
|
||||
struct dma_chan_percpu __percpu *local;
|
||||
int client_count;
|
||||
int table_count;
|
||||
void *private;
|
||||
|
|
|
|||
23
include/linux/early_res.h
Normal file
23
include/linux/early_res.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef _LINUX_EARLY_RES_H
|
||||
#define _LINUX_EARLY_RES_H
|
||||
#ifdef __KERNEL__
|
||||
|
||||
extern void reserve_early(u64 start, u64 end, char *name);
|
||||
extern void reserve_early_overlap_ok(u64 start, u64 end, char *name);
|
||||
extern void free_early(u64 start, u64 end);
|
||||
void free_early_partial(u64 start, u64 end);
|
||||
extern void early_res_to_bootmem(u64 start, u64 end);
|
||||
|
||||
void reserve_early_without_check(u64 start, u64 end, char *name);
|
||||
u64 find_early_area(u64 ei_start, u64 ei_last, u64 start, u64 end,
|
||||
u64 size, u64 align);
|
||||
u64 find_early_area_size(u64 ei_start, u64 ei_last, u64 start,
|
||||
u64 *sizep, u64 align);
|
||||
u64 find_fw_memmap_area(u64 start, u64 end, u64 size, u64 align);
|
||||
u64 get_max_mapped(void);
|
||||
#include <linux/range.h>
|
||||
int get_free_all_memory_range(struct range **rangep, int nodeid);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_EARLY_RES_H */
|
||||
|
|
@ -50,6 +50,28 @@ typedef __s64 Elf64_Sxword;
|
|||
|
||||
#define PT_GNU_STACK (PT_LOOS + 0x474e551)
|
||||
|
||||
/*
|
||||
* Extended Numbering
|
||||
*
|
||||
* If the real number of program header table entries is larger than
|
||||
* or equal to PN_XNUM(0xffff), it is set to sh_info field of the
|
||||
* section header at index 0, and PN_XNUM is set to e_phnum
|
||||
* field. Otherwise, the section header at index 0 is zero
|
||||
* initialized, if it exists.
|
||||
*
|
||||
* Specifications are available in:
|
||||
*
|
||||
* - Sun microsystems: Linker and Libraries.
|
||||
* Part No: 817-1984-17, September 2008.
|
||||
* URL: http://docs.sun.com/app/docs/doc/817-1984
|
||||
*
|
||||
* - System V ABI AMD64 Architecture Processor Supplement
|
||||
* Draft Version 0.99.,
|
||||
* May 11, 2009.
|
||||
* URL: http://www.x86-64.org/
|
||||
*/
|
||||
#define PN_XNUM 0xffff
|
||||
|
||||
/* These constants define the different elf file types */
|
||||
#define ET_NONE 0
|
||||
#define ET_REL 1
|
||||
|
|
@ -286,7 +308,7 @@ typedef struct elf64_phdr {
|
|||
#define SHN_COMMON 0xfff2
|
||||
#define SHN_HIRESERVE 0xffff
|
||||
|
||||
typedef struct {
|
||||
typedef struct elf32_shdr {
|
||||
Elf32_Word sh_name;
|
||||
Elf32_Word sh_type;
|
||||
Elf32_Word sh_flags;
|
||||
|
|
@ -394,16 +416,20 @@ typedef struct elf64_note {
|
|||
extern Elf32_Dyn _DYNAMIC [];
|
||||
#define elfhdr elf32_hdr
|
||||
#define elf_phdr elf32_phdr
|
||||
#define elf_shdr elf32_shdr
|
||||
#define elf_note elf32_note
|
||||
#define elf_addr_t Elf32_Off
|
||||
#define Elf_Half Elf32_Half
|
||||
|
||||
#else
|
||||
|
||||
extern Elf64_Dyn _DYNAMIC [];
|
||||
#define elfhdr elf64_hdr
|
||||
#define elf_phdr elf64_phdr
|
||||
#define elf_shdr elf64_shdr
|
||||
#define elf_note elf64_note
|
||||
#define elf_addr_t Elf64_Off
|
||||
#define Elf_Half Elf64_Half
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
#include <linux/user.h>
|
||||
#endif
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
struct elf_siginfo
|
||||
{
|
||||
|
|
@ -150,5 +152,20 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
|
|||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/*
|
||||
* These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
|
||||
* extra segments containing the gate DSO contents. Dumping its
|
||||
* contents makes post-mortem fully interpretable later without matching up
|
||||
* the same kernel and hardware config to see what PC values meant.
|
||||
* Dumping its extra ELF program headers includes all the other information
|
||||
* a debugger needs to easily find how the gate DSO was being used.
|
||||
*/
|
||||
extern Elf_Half elf_core_extra_phdrs(void);
|
||||
extern int
|
||||
elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
|
||||
unsigned long limit);
|
||||
extern int
|
||||
elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
|
||||
extern size_t elf_core_extra_data_size(void);
|
||||
|
||||
#endif /* _LINUX_ELFCORE_H */
|
||||
|
|
|
|||
|
|
@ -61,6 +61,13 @@ struct ethtool_drvinfo {
|
|||
/* For PCI devices, use pci_name(pci_dev). */
|
||||
char reserved1[32];
|
||||
char reserved2[12];
|
||||
/*
|
||||
* Some struct members below are filled in
|
||||
* using ops->get_sset_count(). Obtaining
|
||||
* this info from ethtool_drvinfo is now
|
||||
* deprecated; Use ETHTOOL_GSSET_INFO
|
||||
* instead.
|
||||
*/
|
||||
__u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
|
||||
__u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
|
||||
__u32 testinfo_len;
|
||||
|
|
@ -242,6 +249,7 @@ enum ethtool_stringset {
|
|||
ETH_SS_TEST = 0,
|
||||
ETH_SS_STATS,
|
||||
ETH_SS_PRIV_FLAGS,
|
||||
ETH_SS_NTUPLE_FILTERS,
|
||||
};
|
||||
|
||||
/* for passing string sets for data tagging */
|
||||
|
|
@ -252,6 +260,17 @@ struct ethtool_gstrings {
|
|||
__u8 data[0];
|
||||
};
|
||||
|
||||
struct ethtool_sset_info {
|
||||
__u32 cmd; /* ETHTOOL_GSSET_INFO */
|
||||
__u32 reserved;
|
||||
__u64 sset_mask; /* input: each bit selects an sset to query */
|
||||
/* output: each bit a returned sset */
|
||||
__u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
|
||||
in sset_mask. One bit implies one
|
||||
__u32, two bits implies two
|
||||
__u32's, etc. */
|
||||
};
|
||||
|
||||
enum ethtool_test_flags {
|
||||
ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
|
||||
ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
|
||||
|
|
@ -290,6 +309,7 @@ struct ethtool_perm_addr {
|
|||
*/
|
||||
enum ethtool_flags {
|
||||
ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
|
||||
ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
|
||||
};
|
||||
|
||||
/* The following structures are for supporting RX network flow
|
||||
|
|
@ -363,6 +383,35 @@ struct ethtool_rxnfc {
|
|||
__u32 rule_locs[0];
|
||||
};
|
||||
|
||||
struct ethtool_rx_ntuple_flow_spec {
|
||||
__u32 flow_type;
|
||||
union {
|
||||
struct ethtool_tcpip4_spec tcp_ip4_spec;
|
||||
struct ethtool_tcpip4_spec udp_ip4_spec;
|
||||
struct ethtool_tcpip4_spec sctp_ip4_spec;
|
||||
struct ethtool_ah_espip4_spec ah_ip4_spec;
|
||||
struct ethtool_ah_espip4_spec esp_ip4_spec;
|
||||
struct ethtool_rawip4_spec raw_ip4_spec;
|
||||
struct ethtool_ether_spec ether_spec;
|
||||
struct ethtool_usrip4_spec usr_ip4_spec;
|
||||
__u8 hdata[64];
|
||||
} h_u, m_u; /* entry, mask */
|
||||
|
||||
__u16 vlan_tag;
|
||||
__u16 vlan_tag_mask;
|
||||
__u64 data; /* user-defined flow spec data */
|
||||
__u64 data_mask; /* user-defined flow spec mask */
|
||||
|
||||
/* signed to distinguish between queue and actions (DROP) */
|
||||
__s32 action;
|
||||
#define ETHTOOL_RXNTUPLE_ACTION_DROP -1
|
||||
};
|
||||
|
||||
struct ethtool_rx_ntuple {
|
||||
__u32 cmd;
|
||||
struct ethtool_rx_ntuple_flow_spec fs;
|
||||
};
|
||||
|
||||
#define ETHTOOL_FLASH_MAX_FILENAME 128
|
||||
enum ethtool_flash_op_type {
|
||||
ETHTOOL_FLASH_ALL_REGIONS = 0,
|
||||
|
|
@ -377,6 +426,20 @@ struct ethtool_flash {
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/rculist.h>
|
||||
|
||||
struct ethtool_rx_ntuple_flow_spec_container {
|
||||
struct ethtool_rx_ntuple_flow_spec fs;
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
struct ethtool_rx_ntuple_list {
|
||||
#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
|
||||
#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
|
||||
struct list_head list;
|
||||
unsigned int count;
|
||||
};
|
||||
|
||||
struct net_device;
|
||||
|
||||
/* Some generic methods drivers may use in their ethtool_ops */
|
||||
|
|
@ -394,6 +457,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
|
|||
int ethtool_op_set_ufo(struct net_device *dev, u32 data);
|
||||
u32 ethtool_op_get_flags(struct net_device *dev);
|
||||
int ethtool_op_set_flags(struct net_device *dev, u32 data);
|
||||
void ethtool_ntuple_flush(struct net_device *dev);
|
||||
|
||||
/**
|
||||
* ðtool_ops - Alter and report network device settings
|
||||
|
|
@ -500,6 +564,8 @@ struct ethtool_ops {
|
|||
int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
|
||||
int (*flash_device)(struct net_device *, struct ethtool_flash *);
|
||||
int (*reset)(struct net_device *, u32 *);
|
||||
int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *);
|
||||
int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
|
||||
};
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
|
@ -558,6 +624,9 @@ struct ethtool_ops {
|
|||
#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
|
||||
#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
|
||||
#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
|
||||
#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
|
||||
#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */
|
||||
#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
|
||||
|
||||
/* compatibility with older code */
|
||||
#define SPARC_ETH_GSET ETHTOOL_GSET
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ struct fid {
|
|||
* @fh_to_parent: find the implied object's parent and get a dentry for it
|
||||
* @get_name: find the name for a given inode in a given directory
|
||||
* @get_parent: find the parent of a given directory
|
||||
* @commit_metadata: commit metadata changes to stable storage
|
||||
*
|
||||
* See Documentation/filesystems/nfs/Exporting for details on how to use
|
||||
* this interface correctly.
|
||||
|
|
@ -137,6 +138,9 @@ struct fid {
|
|||
* is also a directory. In the event that it cannot be found, or storage
|
||||
* space cannot be allocated, a %ERR_PTR should be returned.
|
||||
*
|
||||
* commit_metadata:
|
||||
* @commit_metadata should commit metadata changes to stable storage.
|
||||
*
|
||||
* Locking rules:
|
||||
* get_parent is called with child->d_inode->i_mutex down
|
||||
* get_name is not (which is possibly inconsistent)
|
||||
|
|
@ -152,6 +156,7 @@ struct export_operations {
|
|||
int (*get_name)(struct dentry *parent, char *name,
|
||||
struct dentry *child);
|
||||
struct dentry * (*get_parent)(struct dentry *child);
|
||||
int (*commit_metadata)(struct inode *inode);
|
||||
};
|
||||
|
||||
extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid,
|
||||
|
|
|
|||
|
|
@ -202,14 +202,6 @@ static inline __u32 ext3_mask_flags(umode_t mode, __u32 flags)
|
|||
return flags & EXT3_OTHER_FLMASK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inode dynamic state flags
|
||||
*/
|
||||
#define EXT3_STATE_JDATA 0x00000001 /* journaled data exists */
|
||||
#define EXT3_STATE_NEW 0x00000002 /* inode is newly created */
|
||||
#define EXT3_STATE_XATTR 0x00000004 /* has in-inode xattrs */
|
||||
#define EXT3_STATE_FLUSH_ON_CLOSE 0x00000008
|
||||
|
||||
/* Used to pass group descriptor data when online resize is done */
|
||||
struct ext3_new_group_input {
|
||||
__u32 group; /* Group number for this data */
|
||||
|
|
@ -560,6 +552,31 @@ static inline int ext3_valid_inum(struct super_block *sb, unsigned long ino)
|
|||
(ino >= EXT3_FIRST_INO(sb) &&
|
||||
ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count));
|
||||
}
|
||||
|
||||
/*
|
||||
* Inode dynamic state flags
|
||||
*/
|
||||
enum {
|
||||
EXT3_STATE_JDATA, /* journaled data exists */
|
||||
EXT3_STATE_NEW, /* inode is newly created */
|
||||
EXT3_STATE_XATTR, /* has in-inode xattrs */
|
||||
EXT3_STATE_FLUSH_ON_CLOSE, /* flush dirty pages on close */
|
||||
};
|
||||
|
||||
static inline int ext3_test_inode_state(struct inode *inode, int bit)
|
||||
{
|
||||
return test_bit(bit, &EXT3_I(inode)->i_state_flags);
|
||||
}
|
||||
|
||||
static inline void ext3_set_inode_state(struct inode *inode, int bit)
|
||||
{
|
||||
set_bit(bit, &EXT3_I(inode)->i_state_flags);
|
||||
}
|
||||
|
||||
static inline void ext3_clear_inode_state(struct inode *inode, int bit)
|
||||
{
|
||||
clear_bit(bit, &EXT3_I(inode)->i_state_flags);
|
||||
}
|
||||
#else
|
||||
/* Assume that user mode programs are passing in an ext3fs superblock, not
|
||||
* a kernel struct super_block. This will allow us to call the feature-test
|
||||
|
|
@ -877,7 +894,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
|
|||
int create);
|
||||
|
||||
extern struct inode *ext3_iget(struct super_block *, unsigned long);
|
||||
extern int ext3_write_inode (struct inode *, int);
|
||||
extern int ext3_write_inode (struct inode *, struct writeback_control *);
|
||||
extern int ext3_setattr (struct dentry *, struct iattr *);
|
||||
extern void ext3_delete_inode (struct inode *);
|
||||
extern int ext3_sync_inode (handle_t *, struct inode *);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ struct ext3_inode_info {
|
|||
* near to their parent directory's inode.
|
||||
*/
|
||||
__u32 i_block_group;
|
||||
__u32 i_state; /* Dynamic state flags for ext3 */
|
||||
unsigned long i_state_flags; /* Dynamic state flags for ext3 */
|
||||
|
||||
/* block reservation info */
|
||||
struct ext3_block_alloc_info *i_block_alloc_info;
|
||||
|
|
|
|||
|
|
@ -82,9 +82,10 @@ static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
|
|||
#endif /* CONFIG_FAULT_INJECTION */
|
||||
|
||||
#ifdef CONFIG_FAILSLAB
|
||||
extern bool should_failslab(size_t size, gfp_t gfpflags);
|
||||
extern bool should_failslab(size_t size, gfp_t gfpflags, unsigned long flags);
|
||||
#else
|
||||
static inline bool should_failslab(size_t size, gfp_t gfpflags)
|
||||
static inline bool should_failslab(size_t size, gfp_t gfpflags,
|
||||
unsigned long flags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -543,6 +543,8 @@ struct fb_cursor_user {
|
|||
#define FB_EVENT_GET_REQ 0x0D
|
||||
/* Unbind from the console if possible */
|
||||
#define FB_EVENT_FB_UNBIND 0x0E
|
||||
/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */
|
||||
#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
|
||||
|
||||
struct fb_event {
|
||||
struct fb_info *info;
|
||||
|
|
|
|||
|
|
@ -248,13 +248,20 @@ union fw_cdev_event {
|
|||
#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
|
||||
#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
|
||||
|
||||
/* available since kernel version 2.6.34 */
|
||||
#define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
|
||||
|
||||
/*
|
||||
* FW_CDEV_VERSION History
|
||||
* 1 (2.6.22) - initial version
|
||||
* 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if
|
||||
* &fw_cdev_create_iso_context.header_size is 8 or more
|
||||
* (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt
|
||||
* (2.6.33) - IR has always packet-per-buffer semantics now, not one of
|
||||
* dual-buffer or packet-per-buffer depending on hardware
|
||||
* 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable
|
||||
*/
|
||||
#define FW_CDEV_VERSION 2
|
||||
#define FW_CDEV_VERSION 3
|
||||
|
||||
/**
|
||||
* struct fw_cdev_get_info - General purpose information ioctl
|
||||
|
|
@ -544,20 +551,43 @@ struct fw_cdev_stop_iso {
|
|||
/**
|
||||
* struct fw_cdev_get_cycle_timer - read cycle timer register
|
||||
* @local_time: system time, in microseconds since the Epoch
|
||||
* @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13
|
||||
* @cycle_timer: Cycle Time register contents
|
||||
*
|
||||
* The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer
|
||||
* and also the system clock. This allows to express the receive time of an
|
||||
* isochronous packet as a system time with microsecond accuracy.
|
||||
* and also the system clock (%CLOCK_REALTIME). This allows to express the
|
||||
* receive time of an isochronous packet as a system time.
|
||||
*
|
||||
* @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
|
||||
* 12 bits cycleOffset, in host byte order.
|
||||
* 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
|
||||
* per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
|
||||
*
|
||||
* In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
|
||||
* monotonic) @cycle_timer values on certain controllers.
|
||||
*/
|
||||
struct fw_cdev_get_cycle_timer {
|
||||
__u64 local_time;
|
||||
__u32 cycle_timer;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fw_cdev_get_cycle_timer2 - read cycle timer register
|
||||
* @tv_sec: system time, seconds
|
||||
* @tv_nsec: system time, sub-seconds part in nanoseconds
|
||||
* @clk_id: input parameter, clock from which to get the system time
|
||||
* @cycle_timer: Cycle Time register contents
|
||||
*
|
||||
* The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like
|
||||
* %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX'
|
||||
* clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME
|
||||
* and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW.
|
||||
*/
|
||||
struct fw_cdev_get_cycle_timer2 {
|
||||
__s64 tv_sec;
|
||||
__s32 tv_nsec;
|
||||
__s32 clk_id;
|
||||
__u32 cycle_timer;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth
|
||||
* @closure: Passed back to userspace in correponding iso resource events
|
||||
|
|
|
|||
|
|
@ -65,12 +65,13 @@
|
|||
#define CSR_DIRECTORY_ID 0x20
|
||||
|
||||
struct fw_csr_iterator {
|
||||
u32 *p;
|
||||
u32 *end;
|
||||
const u32 *p;
|
||||
const u32 *end;
|
||||
};
|
||||
|
||||
void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p);
|
||||
void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p);
|
||||
int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value);
|
||||
int fw_csr_string(const u32 *directory, int key, char *buf, size_t size);
|
||||
|
||||
extern struct bus_type fw_bus_type;
|
||||
|
||||
|
|
@ -162,7 +163,7 @@ struct fw_device {
|
|||
struct mutex client_list_mutex;
|
||||
struct list_head client_list;
|
||||
|
||||
u32 *config_rom;
|
||||
const u32 *config_rom;
|
||||
size_t config_rom_length;
|
||||
int config_rom_retries;
|
||||
unsigned is_local:1;
|
||||
|
|
@ -204,7 +205,7 @@ int fw_device_enable_phys_dma(struct fw_device *device);
|
|||
*/
|
||||
struct fw_unit {
|
||||
struct device device;
|
||||
u32 *directory;
|
||||
const u32 *directory;
|
||||
struct fw_attribute_group attribute_group;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@
|
|||
*/
|
||||
#ifdef CONFIG_FIRMWARE_MEMMAP
|
||||
|
||||
int firmware_map_add(u64 start, u64 end, const char *type);
|
||||
int firmware_map_add_early(u64 start, u64 end, const char *type);
|
||||
int firmware_map_add_hotplug(u64 start, u64 end, const char *type);
|
||||
|
||||
#else /* CONFIG_FIRMWARE_MEMMAP */
|
||||
|
||||
static inline int firmware_map_add(u64 start, u64 end, const char *type)
|
||||
static inline int firmware_map_add_early(u64 start, u64 end, const char *type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int firmware_map_add_early(u64 start, u64 end, const char *type)
|
||||
static inline int firmware_map_add_hotplug(u64 start, u64 end, const char *type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,24 +60,24 @@ struct inodes_stat_t {
|
|||
*/
|
||||
|
||||
/* file is open for reading */
|
||||
#define FMODE_READ ((__force fmode_t)1)
|
||||
#define FMODE_READ ((__force fmode_t)0x1)
|
||||
/* file is open for writing */
|
||||
#define FMODE_WRITE ((__force fmode_t)2)
|
||||
#define FMODE_WRITE ((__force fmode_t)0x2)
|
||||
/* file is seekable */
|
||||
#define FMODE_LSEEK ((__force fmode_t)4)
|
||||
#define FMODE_LSEEK ((__force fmode_t)0x4)
|
||||
/* file can be accessed using pread */
|
||||
#define FMODE_PREAD ((__force fmode_t)8)
|
||||
#define FMODE_PREAD ((__force fmode_t)0x8)
|
||||
/* file can be accessed using pwrite */
|
||||
#define FMODE_PWRITE ((__force fmode_t)16)
|
||||
#define FMODE_PWRITE ((__force fmode_t)0x10)
|
||||
/* File is opened for execution with sys_execve / sys_uselib */
|
||||
#define FMODE_EXEC ((__force fmode_t)32)
|
||||
#define FMODE_EXEC ((__force fmode_t)0x20)
|
||||
/* File is opened with O_NDELAY (only set for block devices) */
|
||||
#define FMODE_NDELAY ((__force fmode_t)64)
|
||||
#define FMODE_NDELAY ((__force fmode_t)0x40)
|
||||
/* File is opened with O_EXCL (only set for block devices) */
|
||||
#define FMODE_EXCL ((__force fmode_t)128)
|
||||
#define FMODE_EXCL ((__force fmode_t)0x80)
|
||||
/* File is opened using open(.., 3, ..) and is writeable only for ioctls
|
||||
(specialy hack for floppy.c) */
|
||||
#define FMODE_WRITE_IOCTL ((__force fmode_t)256)
|
||||
#define FMODE_WRITE_IOCTL ((__force fmode_t)0x100)
|
||||
|
||||
/*
|
||||
* Don't update ctime and mtime.
|
||||
|
|
@ -85,7 +85,10 @@ struct inodes_stat_t {
|
|||
* Currently a special hack for the XFS open_by_handle ioctl, but we'll
|
||||
* hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
|
||||
*/
|
||||
#define FMODE_NOCMTIME ((__force fmode_t)2048)
|
||||
#define FMODE_NOCMTIME ((__force fmode_t)0x800)
|
||||
|
||||
/* Expect random access pattern */
|
||||
#define FMODE_RANDOM ((__force fmode_t)0x1000)
|
||||
|
||||
/*
|
||||
* The below are the various read and write types that we support. Some of
|
||||
|
|
@ -1305,6 +1308,8 @@ extern int send_sigurg(struct fown_struct *fown);
|
|||
#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
|
||||
#define MNT_DETACH 0x00000002 /* Just detach from the tree */
|
||||
#define MNT_EXPIRE 0x00000004 /* Mark for expiry */
|
||||
#define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */
|
||||
#define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */
|
||||
|
||||
extern struct list_head super_blocks;
|
||||
extern spinlock_t sb_lock;
|
||||
|
|
@ -1314,9 +1319,9 @@ extern spinlock_t sb_lock;
|
|||
struct super_block {
|
||||
struct list_head s_list; /* Keep this first */
|
||||
dev_t s_dev; /* search index; _not_ kdev_t */
|
||||
unsigned long s_blocksize;
|
||||
unsigned char s_blocksize_bits;
|
||||
unsigned char s_dirt;
|
||||
unsigned char s_blocksize_bits;
|
||||
unsigned long s_blocksize;
|
||||
loff_t s_maxbytes; /* Max file size */
|
||||
struct file_system_type *s_type;
|
||||
const struct super_operations *s_op;
|
||||
|
|
@ -1357,16 +1362,16 @@ struct super_block {
|
|||
void *s_fs_info; /* Filesystem private info */
|
||||
fmode_t s_mode;
|
||||
|
||||
/* Granularity of c/m/atime in ns.
|
||||
Cannot be worse than a second */
|
||||
u32 s_time_gran;
|
||||
|
||||
/*
|
||||
* The next field is for VFS *only*. No filesystems have any business
|
||||
* even looking at it. You had been warned.
|
||||
*/
|
||||
struct mutex s_vfs_rename_mutex; /* Kludge */
|
||||
|
||||
/* Granularity of c/m/atime in ns.
|
||||
Cannot be worse than a second */
|
||||
u32 s_time_gran;
|
||||
|
||||
/*
|
||||
* Filesystem subtype. If non-empty the filesystem type field
|
||||
* in /proc/mounts will be "type.subtype"
|
||||
|
|
@ -1555,7 +1560,7 @@ struct super_operations {
|
|||
void (*destroy_inode)(struct inode *);
|
||||
|
||||
void (*dirty_inode) (struct inode *);
|
||||
int (*write_inode) (struct inode *, int);
|
||||
int (*write_inode) (struct inode *, struct writeback_control *wbc);
|
||||
void (*drop_inode) (struct inode *);
|
||||
void (*delete_inode) (struct inode *);
|
||||
void (*put_super) (struct super_block *);
|
||||
|
|
@ -1794,7 +1799,8 @@ extern int may_umount(struct vfsmount *);
|
|||
extern long do_mount(char *, char *, char *, unsigned long, void *);
|
||||
extern struct vfsmount *collect_mounts(struct path *);
|
||||
extern void drop_collected_mounts(struct vfsmount *);
|
||||
|
||||
extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
|
||||
struct vfsmount *);
|
||||
extern int vfs_statfs(struct dentry *, struct kstatfs *);
|
||||
|
||||
extern int current_umask(void);
|
||||
|
|
@ -2058,12 +2064,6 @@ extern int invalidate_inodes(struct super_block *);
|
|||
unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
||||
pgoff_t start, pgoff_t end);
|
||||
|
||||
static inline unsigned long __deprecated
|
||||
invalidate_inode_pages(struct address_space *mapping)
|
||||
{
|
||||
return invalidate_mapping_pages(mapping, 0, ~0UL);
|
||||
}
|
||||
|
||||
static inline void invalidate_remote_inode(struct inode *inode)
|
||||
{
|
||||
if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
|
||||
|
|
@ -2132,6 +2132,7 @@ extern struct file * open_exec(const char *);
|
|||
|
||||
/* fs/dcache.c -- generic fs support functions */
|
||||
extern int is_subdir(struct dentry *, struct dentry *);
|
||||
extern int path_is_under(struct path *, struct path *);
|
||||
extern ino_t find_inode_number(struct dentry *, struct qstr *);
|
||||
|
||||
#include <linux/err.h>
|
||||
|
|
@ -2340,8 +2341,6 @@ extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct
|
|||
extern int simple_sync_file(struct file *, struct dentry *, int);
|
||||
extern int simple_empty(struct dentry *);
|
||||
extern int simple_readpage(struct file *file, struct page *page);
|
||||
extern int simple_prepare_write(struct file *file, struct page *page,
|
||||
unsigned offset, unsigned to);
|
||||
extern int simple_write_begin(struct file *file, struct address_space *mapping,
|
||||
loff_t pos, unsigned len, unsigned flags,
|
||||
struct page **pagep, void **fsdata);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ struct fscache_operation {
|
|||
/* operation releaser */
|
||||
fscache_operation_release_t release;
|
||||
|
||||
#ifdef CONFIG_SLOW_WORK_PROC
|
||||
#ifdef CONFIG_SLOW_WORK_DEBUG
|
||||
const char *name; /* operation name */
|
||||
const char *state; /* operation state */
|
||||
#define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ static inline void fsnotify_link_count(struct inode *inode)
|
|||
* fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
|
||||
*/
|
||||
static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
|
||||
const char *old_name, const char *new_name,
|
||||
const char *old_name,
|
||||
int isdir, struct inode *target, struct dentry *moved)
|
||||
{
|
||||
struct inode *source = moved->d_inode;
|
||||
|
|
@ -73,6 +73,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
|
|||
u32 fs_cookie = fsnotify_get_cookie();
|
||||
__u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM);
|
||||
__u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO);
|
||||
const char *new_name = moved->d_name.name;
|
||||
|
||||
if (old_dir == new_dir)
|
||||
old_dir_mask |= FS_DN_RENAME;
|
||||
|
|
@ -103,7 +104,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
|
|||
inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
|
||||
fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
audit_inode_child(new_name, moved, new_dir);
|
||||
audit_inode_child(moved, new_dir);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -146,7 +147,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
|
|||
{
|
||||
inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
|
||||
dentry->d_inode);
|
||||
audit_inode_child(dentry->d_name.name, dentry, inode);
|
||||
audit_inode_child(dentry, inode);
|
||||
|
||||
fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
|
||||
}
|
||||
|
|
@ -161,7 +162,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct
|
|||
inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name,
|
||||
inode);
|
||||
fsnotify_link_count(inode);
|
||||
audit_inode_child(new_dentry->d_name.name, new_dentry, dir);
|
||||
audit_inode_child(new_dentry, dir);
|
||||
|
||||
fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0);
|
||||
}
|
||||
|
|
@ -175,7 +176,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
|
|||
struct inode *d_inode = dentry->d_inode;
|
||||
|
||||
inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode);
|
||||
audit_inode_child(dentry->d_name.name, dentry, inode);
|
||||
audit_inode_child(dentry, inode);
|
||||
|
||||
fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,12 +131,12 @@ struct ftrace_event_call {
|
|||
void *mod;
|
||||
void *data;
|
||||
|
||||
int profile_count;
|
||||
int (*profile_enable)(struct ftrace_event_call *);
|
||||
void (*profile_disable)(struct ftrace_event_call *);
|
||||
int perf_refcount;
|
||||
int (*perf_event_enable)(struct ftrace_event_call *);
|
||||
void (*perf_event_disable)(struct ftrace_event_call *);
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_PROFILE_SIZE 2048
|
||||
#define PERF_MAX_TRACE_SIZE 2048
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
|
||||
|
|
@ -187,22 +187,25 @@ do { \
|
|||
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
struct perf_event;
|
||||
extern int ftrace_profile_enable(int event_id);
|
||||
extern void ftrace_profile_disable(int event_id);
|
||||
|
||||
DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
|
||||
|
||||
extern int perf_trace_enable(int event_id);
|
||||
extern void perf_trace_disable(int event_id);
|
||||
extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
|
||||
char *filter_str);
|
||||
extern void ftrace_profile_free_filter(struct perf_event *event);
|
||||
extern void *
|
||||
ftrace_perf_buf_prepare(int size, unsigned short type, int *rctxp,
|
||||
perf_trace_buf_prepare(int size, unsigned short type, int *rctxp,
|
||||
unsigned long *irq_flags);
|
||||
|
||||
static inline void
|
||||
ftrace_perf_buf_submit(void *raw_data, int size, int rctx, u64 addr,
|
||||
u64 count, unsigned long irq_flags)
|
||||
perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
|
||||
u64 count, unsigned long irq_flags, struct pt_regs *regs)
|
||||
{
|
||||
struct trace_entry *entry = raw_data;
|
||||
|
||||
perf_tp_event(entry->type, addr, count, raw_data, size);
|
||||
perf_tp_event(entry->type, addr, count, raw_data, size, regs);
|
||||
perf_swevent_put_recursion_context(rctx);
|
||||
local_irq_restore(irq_flags);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ struct hd_struct {
|
|||
unsigned long stamp;
|
||||
int in_flight[2];
|
||||
#ifdef CONFIG_SMP
|
||||
struct disk_stats *dkstats;
|
||||
struct disk_stats __percpu *dkstats;
|
||||
#else
|
||||
struct disk_stats dkstats;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ struct vm_area_struct;
|
|||
* _might_ fail. This depends upon the particular VM implementation.
|
||||
*
|
||||
* __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller
|
||||
* cannot handle allocation failures.
|
||||
* cannot handle allocation failures. This modifier is deprecated and no new
|
||||
* users should be added.
|
||||
*
|
||||
* __GFP_NORETRY: The VM implementation must not retry indefinitely.
|
||||
*
|
||||
|
|
@ -83,6 +84,7 @@ struct vm_area_struct;
|
|||
#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
|
||||
__GFP_HARDWALL | __GFP_HIGHMEM | \
|
||||
__GFP_MOVABLE)
|
||||
#define GFP_IOFS (__GFP_IO | __GFP_FS)
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
|
||||
|
|
@ -325,7 +327,7 @@ void free_pages_exact(void *virt, size_t size);
|
|||
|
||||
extern void __free_pages(struct page *page, unsigned int order);
|
||||
extern void free_pages(unsigned long addr, unsigned int order);
|
||||
extern void free_hot_page(struct page *page);
|
||||
extern void free_hot_cold_page(struct page *page, int cold);
|
||||
|
||||
#define __free_page(page) __free_pages((page), 0)
|
||||
#define free_page(addr) free_pages((addr),0)
|
||||
|
|
@ -337,9 +339,7 @@ void drain_local_pages(void *dummy);
|
|||
|
||||
extern gfp_t gfp_allowed_mask;
|
||||
|
||||
static inline void set_gfp_allowed_mask(gfp_t mask)
|
||||
{
|
||||
gfp_allowed_mask = mask;
|
||||
}
|
||||
extern void set_gfp_allowed_mask(gfp_t mask);
|
||||
extern gfp_t clear_gfp_allowed_mask(gfp_t mask);
|
||||
|
||||
#endif /* __LINUX_GFP_H */
|
||||
|
|
|
|||
|
|
@ -179,33 +179,6 @@ struct gfs2_rgrp {
|
|||
__u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
|
||||
};
|
||||
|
||||
/*
|
||||
* quota linked list: user quotas and group quotas form two separate
|
||||
* singly linked lists. ll_next stores uids or gids of next quotas in the
|
||||
* linked list.
|
||||
|
||||
Given the uid/gid, how to calculate the quota file offsets for the corresponding
|
||||
gfs2_quota structures on disk:
|
||||
|
||||
for user quotas, given uid,
|
||||
offset = uid * sizeof(struct gfs2_quota);
|
||||
|
||||
for group quotas, given gid,
|
||||
offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota);
|
||||
|
||||
|
||||
uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142
|
||||
+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
|
||||
| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid |
|
||||
+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
|
||||
next:12 next:12 next:17 next:5142 next:NULL next:NULL
|
||||
| | | | |<-- user quota list |
|
||||
\______|___________/ \______|___________/ group quota list -->|
|
||||
| | |
|
||||
\__________________/ \_______________________________________/
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* quota structure
|
||||
*/
|
||||
|
|
@ -214,8 +187,7 @@ struct gfs2_quota {
|
|||
__be64 qu_limit;
|
||||
__be64 qu_warn;
|
||||
__be64 qu_value;
|
||||
__be32 qu_ll_next; /* location of next quota in list */
|
||||
__u8 qu_reserved[60];
|
||||
__u8 qu_reserved[64];
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -168,14 +168,14 @@ enum hil_command {
|
|||
HIL_CMD_PR6 = 0x45, /* Prompt6 */
|
||||
HIL_CMD_PR7 = 0x46, /* Prompt7 */
|
||||
HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */
|
||||
HIL_CMD_AK1 = 0x48, /* Acknowlege1 */
|
||||
HIL_CMD_AK2 = 0x49, /* Acknowlege2 */
|
||||
HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */
|
||||
HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */
|
||||
HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */
|
||||
HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */
|
||||
HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */
|
||||
HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */
|
||||
HIL_CMD_AK1 = 0x48, /* Acknowledge1 */
|
||||
HIL_CMD_AK2 = 0x49, /* Acknowledge2 */
|
||||
HIL_CMD_AK3 = 0x4a, /* Acknowledge3 */
|
||||
HIL_CMD_AK4 = 0x4b, /* Acknowledge4 */
|
||||
HIL_CMD_AK5 = 0x4c, /* Acknowledge5 */
|
||||
HIL_CMD_AK6 = 0x4d, /* Acknowledge6 */
|
||||
HIL_CMD_AK7 = 0x4e, /* Acknowledge7 */
|
||||
HIL_CMD_ACK = 0x4f, /* Acknowledge (General Purpose) */
|
||||
|
||||
/* 0x50 to 0x78 reserved for future use */
|
||||
/* 0x80 to 0xEF device-specific commands */
|
||||
|
|
|
|||
24
include/linux/htcpld.h
Normal file
24
include/linux/htcpld.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef __LINUX_HTCPLD_H
|
||||
#define __LINUX_HTCPLD_H
|
||||
|
||||
struct htcpld_chip_platform_data {
|
||||
unsigned int addr;
|
||||
unsigned int reset;
|
||||
unsigned int num_gpios;
|
||||
unsigned int gpio_out_base;
|
||||
unsigned int gpio_in_base;
|
||||
unsigned int irq_base;
|
||||
unsigned int num_irqs;
|
||||
};
|
||||
|
||||
struct htcpld_core_platform_data {
|
||||
unsigned int int_reset_gpio_hi;
|
||||
unsigned int int_reset_gpio_lo;
|
||||
unsigned int i2c_adapter_id;
|
||||
|
||||
struct htcpld_chip_platform_data *chip;
|
||||
unsigned int num_chip;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_HTCPLD_H */
|
||||
|
||||
|
|
@ -66,14 +66,14 @@ register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
|
|||
perf_overflow_handler_t triggered,
|
||||
int cpu);
|
||||
|
||||
extern struct perf_event **
|
||||
extern struct perf_event * __percpu *
|
||||
register_wide_hw_breakpoint(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered);
|
||||
|
||||
extern int register_perf_hw_breakpoint(struct perf_event *bp);
|
||||
extern int __register_perf_hw_breakpoint(struct perf_event *bp);
|
||||
extern void unregister_hw_breakpoint(struct perf_event *bp);
|
||||
extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events);
|
||||
extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events);
|
||||
|
||||
extern int dbg_reserve_bp_slot(struct perf_event *bp);
|
||||
extern int dbg_release_bp_slot(struct perf_event *bp);
|
||||
|
|
@ -100,7 +100,7 @@ static inline struct perf_event *
|
|||
register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered,
|
||||
int cpu) { return NULL; }
|
||||
static inline struct perf_event **
|
||||
static inline struct perf_event * __percpu *
|
||||
register_wide_hw_breakpoint(struct perf_event_attr *attr,
|
||||
perf_overflow_handler_t triggered) { return NULL; }
|
||||
static inline int
|
||||
|
|
@ -109,7 +109,7 @@ static inline int
|
|||
__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
|
||||
static inline void unregister_hw_breakpoint(struct perf_event *bp) { }
|
||||
static inline void
|
||||
unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { }
|
||||
unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { }
|
||||
static inline int
|
||||
reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }
|
||||
static inline void release_bp_slot(struct perf_event *bp) { }
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ struct i2c_algo_bit_data {
|
|||
void (*setscl) (void *data, int state);
|
||||
int (*getsda) (void *data);
|
||||
int (*getscl) (void *data);
|
||||
int (*pre_xfer) (struct i2c_adapter *);
|
||||
void (*post_xfer) (struct i2c_adapter *);
|
||||
|
||||
/* local settings */
|
||||
int udelay; /* half clock cycle time in us,
|
||||
|
|
|
|||
50
include/linux/i2c-smbus.h
Normal file
50
include/linux/i2c-smbus.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* i2c-smbus.h - SMBus extensions to the I2C protocol
|
||||
*
|
||||
* Copyright (C) 2010 Jean Delvare <khali@linux-fr.org>
|
||||
*
|
||||
* 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 _LINUX_I2C_SMBUS_H
|
||||
#define _LINUX_I2C_SMBUS_H
|
||||
|
||||
#include <linux/i2c.h>
|
||||
|
||||
|
||||
/**
|
||||
* i2c_smbus_alert_setup - platform data for the smbus_alert i2c client
|
||||
* @alert_edge_triggered: whether the alert interrupt is edge (1) or level (0)
|
||||
* triggered
|
||||
* @irq: IRQ number, if the smbus_alert driver should take care of interrupt
|
||||
* handling
|
||||
*
|
||||
* If irq is not specified, the smbus_alert driver doesn't take care of
|
||||
* interrupt handling. In that case it is up to the I2C bus driver to either
|
||||
* handle the interrupts or to poll for alerts.
|
||||
*
|
||||
* If irq is specified then it it crucial that alert_edge_triggered is
|
||||
* properly set.
|
||||
*/
|
||||
struct i2c_smbus_alert_setup {
|
||||
unsigned int alert_edge_triggered:1;
|
||||
int irq;
|
||||
};
|
||||
|
||||
struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter,
|
||||
struct i2c_smbus_alert_setup *setup);
|
||||
int i2c_handle_smbus_alert(struct i2c_client *ara);
|
||||
|
||||
#endif /* _LINUX_I2C_SMBUS_H */
|
||||
43
include/linux/i2c-xiic.h
Normal file
43
include/linux/i2c-xiic.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* i2c-xiic.h
|
||||
* Copyright (c) 2009 Intel Corporation
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Supports:
|
||||
* Xilinx IIC
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_I2C_XIIC_H
|
||||
#define _LINUX_I2C_XIIC_H
|
||||
|
||||
/**
|
||||
* struct xiic_i2c_platform_data - Platform data of the Xilinx I2C driver
|
||||
* @num_devices: Number of devices that shall be added when the driver
|
||||
* is probed.
|
||||
* @devices: The actuall devices to add.
|
||||
*
|
||||
* This purpose of this platform data struct is to be able to provide a number
|
||||
* of devices that should be added to the I2C bus. The reason is that sometimes
|
||||
* the I2C board info is not enough, a new PCI board can for instance be
|
||||
* plugged into a standard PC, and the bus number might be unknown at
|
||||
* early init time.
|
||||
*/
|
||||
struct xiic_i2c_platform_data {
|
||||
u8 num_devices;
|
||||
struct i2c_board_info const *devices;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_I2C_XIIC_H */
|
||||
|
|
@ -53,6 +53,7 @@ struct i2c_board_info;
|
|||
* on a bus (or read from them). Apart from two basic transfer functions to
|
||||
* transmit one message at a time, a more complex version can be used to
|
||||
* transmit an arbitrary number of messages without interruption.
|
||||
* @count must be be less than 64k since msg.len is u16.
|
||||
*/
|
||||
extern int i2c_master_send(struct i2c_client *client, const char *buf,
|
||||
int count);
|
||||
|
|
@ -152,6 +153,13 @@ struct i2c_driver {
|
|||
int (*suspend)(struct i2c_client *, pm_message_t mesg);
|
||||
int (*resume)(struct i2c_client *);
|
||||
|
||||
/* Alert callback, for example for the SMBus alert protocol.
|
||||
* The format and meaning of the data value depends on the protocol.
|
||||
* For the SMBus alert protocol, there is a single bit of data passed
|
||||
* as the alert response's low bit ("event flag").
|
||||
*/
|
||||
void (*alert)(struct i2c_client *, unsigned int data);
|
||||
|
||||
/* a ioctl like command that can be used to perform specific functions
|
||||
* with the device.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
#ifndef _LINUX_PCA953X_H
|
||||
#define _LINUX_PCA953X_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/i2c.h>
|
||||
|
||||
/* platform data for the PCA9539 16-bit I/O expander driver */
|
||||
|
||||
struct pca953x_platform_data {
|
||||
|
|
@ -7,6 +13,9 @@ struct pca953x_platform_data {
|
|||
/* initial polarity inversion setting */
|
||||
uint16_t invert;
|
||||
|
||||
/* interrupt base */
|
||||
int irq_base;
|
||||
|
||||
void *context; /* param to setup/teardown */
|
||||
|
||||
int (*setup)(struct i2c_client *client,
|
||||
|
|
@ -17,3 +26,5 @@ struct pca953x_platform_data {
|
|||
void *context);
|
||||
char **names;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_PCA953X_H */
|
||||
|
|
|
|||
|
|
@ -80,6 +80,11 @@
|
|||
#define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER
|
||||
#define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
|
||||
#define TWL_MODULE_RTC TWL4030_MODULE_RTC
|
||||
#define TWL_MODULE_PWM TWL4030_MODULE_PWM0
|
||||
|
||||
#define TWL6030_MODULE_ID0 0x0D
|
||||
#define TWL6030_MODULE_ID1 0x0E
|
||||
#define TWL6030_MODULE_ID2 0x0F
|
||||
|
||||
#define GPIO_INTR_OFFSET 0
|
||||
#define KEYPAD_INTR_OFFSET 1
|
||||
|
|
@ -239,6 +244,21 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
|
|||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/*Interface Bit Register (INTBR) offsets
|
||||
*(Use TWL_4030_MODULE_INTBR)
|
||||
*/
|
||||
|
||||
#define REG_GPPUPDCTR1 0x0F
|
||||
|
||||
/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */
|
||||
|
||||
#define I2C_SCL_CTRL_PU BIT(0)
|
||||
#define I2C_SDA_CTRL_PU BIT(2)
|
||||
#define SR_I2C_SCL_CTRL_PU BIT(4)
|
||||
#define SR_I2C_SDA_CTRL_PU BIT(6)
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Keypad register offsets (use TWL4030_MODULE_KEYPAD)
|
||||
* ... SIH/interrupt only
|
||||
|
|
@ -530,6 +550,7 @@ struct twl4030_power_data {
|
|||
};
|
||||
|
||||
extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
|
||||
extern int twl4030_remove_script(u8 flags);
|
||||
|
||||
struct twl4030_codec_audio_data {
|
||||
unsigned int audio_mclk;
|
||||
|
|
@ -605,12 +626,7 @@ int twl4030_sih_setup(int module);
|
|||
#define TWL4030_VAUX3_DEV_GRP 0x1F
|
||||
#define TWL4030_VAUX3_DEDICATED 0x22
|
||||
|
||||
#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
|
||||
defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
|
||||
extern int twl4030charger_usb_en(int enable);
|
||||
#else
|
||||
static inline int twl4030charger_usb_en(int enable) { return 0; }
|
||||
#endif
|
||||
static inline int twl4030charger_usb_en(int enable) { return 0; }
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
|
|
|||
|
|
@ -174,8 +174,7 @@ struct icmp6_filter {
|
|||
|
||||
extern void icmpv6_send(struct sk_buff *skb,
|
||||
u8 type, u8 code,
|
||||
__u32 info,
|
||||
struct net_device *dev);
|
||||
__u32 info);
|
||||
|
||||
extern int icmpv6_init(void);
|
||||
extern int icmpv6_err_convert(u8 type, u8 code,
|
||||
|
|
|
|||
|
|
@ -515,6 +515,8 @@ struct ide_drive_s {
|
|||
u8 init_speed; /* transfer rate set at boot */
|
||||
u8 current_speed; /* current transfer rate set */
|
||||
u8 desired_speed; /* desired transfer rate set */
|
||||
u8 pio_mode; /* for ->set_pio_mode _only_ */
|
||||
u8 dma_mode; /* for ->dma_pio_mode _only_ */
|
||||
u8 dn; /* now wide spread use */
|
||||
u8 acoustic; /* acoustic management */
|
||||
u8 media; /* disk, cdrom, tape, floppy, ... */
|
||||
|
|
@ -622,8 +624,8 @@ extern const struct ide_tp_ops default_tp_ops;
|
|||
*/
|
||||
struct ide_port_ops {
|
||||
void (*init_dev)(ide_drive_t *);
|
||||
void (*set_pio_mode)(ide_drive_t *, const u8);
|
||||
void (*set_dma_mode)(ide_drive_t *, const u8);
|
||||
void (*set_pio_mode)(struct hwif_s *, ide_drive_t *);
|
||||
void (*set_dma_mode)(struct hwif_s *, ide_drive_t *);
|
||||
int (*reset_poll)(ide_drive_t *);
|
||||
void (*pre_reset)(ide_drive_t *);
|
||||
void (*resetproc)(ide_drive_t *);
|
||||
|
|
@ -1494,7 +1496,6 @@ int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
|
|||
#ifdef CONFIG_IDE_XFER_MODE
|
||||
int ide_scan_pio_blacklist(char *);
|
||||
const char *ide_xfer_verbose(u8);
|
||||
u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
|
||||
int ide_pio_need_iordy(ide_drive_t *, const u8);
|
||||
int ide_set_pio_mode(ide_drive_t *, u8);
|
||||
int ide_set_dma_mode(ide_drive_t *, u8);
|
||||
|
|
|
|||
|
|
@ -120,6 +120,26 @@
|
|||
#define IEEE80211_QOS_CTL_TID_MASK 0x000F
|
||||
#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
|
||||
|
||||
/* U-APSD queue for WMM IEs sent by AP */
|
||||
#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
|
||||
|
||||
/* U-APSD queues for WMM IEs sent by STA */
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0)
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VI (1<<1)
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BK (1<<2)
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BE (1<<3)
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK 0x0f
|
||||
|
||||
/* U-APSD max SP length for WMM IEs sent by STA */
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL 0x00
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_SP_2 0x01
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_SP_4 0x02
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_SP_6 0x03
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK 0x03
|
||||
#define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT 5
|
||||
|
||||
#define IEEE80211_HT_CTL_LEN 4
|
||||
|
||||
struct ieee80211_hdr {
|
||||
__le16 frame_control;
|
||||
__le16 duration_id;
|
||||
|
|
@ -130,6 +150,25 @@ struct ieee80211_hdr {
|
|||
u8 addr4[6];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct ieee80211_hdr_3addr {
|
||||
__le16 frame_control;
|
||||
__le16 duration_id;
|
||||
u8 addr1[6];
|
||||
u8 addr2[6];
|
||||
u8 addr3[6];
|
||||
__le16 seq_ctrl;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct ieee80211_qos_hdr {
|
||||
__le16 frame_control;
|
||||
__le16 duration_id;
|
||||
u8 addr1[6];
|
||||
u8 addr2[6];
|
||||
u8 addr3[6];
|
||||
__le16 seq_ctrl;
|
||||
__le16 qos_ctrl;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/**
|
||||
* ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
|
||||
* @fc: frame control bytes in little-endian byteorder
|
||||
|
|
@ -707,6 +746,10 @@ struct ieee80211_mgmt {
|
|||
u8 action;
|
||||
u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
|
||||
} __attribute__ ((packed)) sa_query;
|
||||
struct {
|
||||
u8 action;
|
||||
u8 smps_control;
|
||||
} __attribute__ ((packed)) ht_smps;
|
||||
} u;
|
||||
} __attribute__ ((packed)) action;
|
||||
} u;
|
||||
|
|
@ -771,7 +814,10 @@ struct ieee80211_bar {
|
|||
/**
|
||||
* struct ieee80211_mcs_info - MCS information
|
||||
* @rx_mask: RX mask
|
||||
* @rx_highest: highest supported RX rate
|
||||
* @rx_highest: highest supported RX rate. If set represents
|
||||
* the highest supported RX data rate in units of 1 Mbps.
|
||||
* If this field is 0 this value should not be used to
|
||||
* consider the highest RX data rate supported.
|
||||
* @tx_params: TX parameters
|
||||
*/
|
||||
struct ieee80211_mcs_info {
|
||||
|
|
@ -824,6 +870,7 @@ struct ieee80211_ht_cap {
|
|||
#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
|
||||
#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002
|
||||
#define IEEE80211_HT_CAP_SM_PS 0x000C
|
||||
#define IEEE80211_HT_CAP_SM_PS_SHIFT 2
|
||||
#define IEEE80211_HT_CAP_GRN_FLD 0x0010
|
||||
#define IEEE80211_HT_CAP_SGI_20 0x0020
|
||||
#define IEEE80211_HT_CAP_SGI_40 0x0040
|
||||
|
|
@ -839,6 +886,7 @@ struct ieee80211_ht_cap {
|
|||
/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */
|
||||
#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
|
||||
#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
|
||||
#define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2
|
||||
|
||||
/*
|
||||
* Maximum length of AMPDU that the STA can receive.
|
||||
|
|
@ -922,12 +970,17 @@ struct ieee80211_ht_info {
|
|||
#define IEEE80211_MAX_AMPDU_BUF 0x40
|
||||
|
||||
|
||||
/* Spatial Multiplexing Power Save Modes */
|
||||
/* Spatial Multiplexing Power Save Modes (for capability) */
|
||||
#define WLAN_HT_CAP_SM_PS_STATIC 0
|
||||
#define WLAN_HT_CAP_SM_PS_DYNAMIC 1
|
||||
#define WLAN_HT_CAP_SM_PS_INVALID 2
|
||||
#define WLAN_HT_CAP_SM_PS_DISABLED 3
|
||||
|
||||
/* for SM power control field lower two bits */
|
||||
#define WLAN_HT_SMPS_CONTROL_DISABLED 0
|
||||
#define WLAN_HT_SMPS_CONTROL_STATIC 1
|
||||
#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
|
||||
|
||||
/* Authentication algorithms */
|
||||
#define WLAN_AUTH_OPEN 0
|
||||
#define WLAN_AUTH_SHARED_KEY 1
|
||||
|
|
@ -1071,12 +1124,12 @@ enum ieee80211_eid {
|
|||
WLAN_EID_TIM = 5,
|
||||
WLAN_EID_IBSS_PARAMS = 6,
|
||||
WLAN_EID_CHALLENGE = 16,
|
||||
/* 802.11d */
|
||||
|
||||
WLAN_EID_COUNTRY = 7,
|
||||
WLAN_EID_HP_PARAMS = 8,
|
||||
WLAN_EID_HP_TABLE = 9,
|
||||
WLAN_EID_REQUEST = 10,
|
||||
/* 802.11e */
|
||||
|
||||
WLAN_EID_QBSS_LOAD = 11,
|
||||
WLAN_EID_EDCA_PARAM_SET = 12,
|
||||
WLAN_EID_TSPEC = 13,
|
||||
|
|
@ -1099,7 +1152,7 @@ enum ieee80211_eid {
|
|||
WLAN_EID_PREP = 69,
|
||||
WLAN_EID_PERR = 70,
|
||||
WLAN_EID_RANN = 49, /* compatible with FreeBSD */
|
||||
/* 802.11h */
|
||||
|
||||
WLAN_EID_PWR_CONSTRAINT = 32,
|
||||
WLAN_EID_PWR_CAPABILITY = 33,
|
||||
WLAN_EID_TPC_REQUEST = 34,
|
||||
|
|
@ -1110,20 +1163,41 @@ enum ieee80211_eid {
|
|||
WLAN_EID_MEASURE_REPORT = 39,
|
||||
WLAN_EID_QUIET = 40,
|
||||
WLAN_EID_IBSS_DFS = 41,
|
||||
/* 802.11g */
|
||||
|
||||
WLAN_EID_ERP_INFO = 42,
|
||||
WLAN_EID_EXT_SUPP_RATES = 50,
|
||||
/* 802.11n */
|
||||
|
||||
WLAN_EID_HT_CAPABILITY = 45,
|
||||
WLAN_EID_HT_INFORMATION = 61,
|
||||
/* 802.11i */
|
||||
|
||||
WLAN_EID_RSN = 48,
|
||||
WLAN_EID_TIMEOUT_INTERVAL = 56,
|
||||
WLAN_EID_MMIE = 76 /* 802.11w */,
|
||||
WLAN_EID_MMIE = 76,
|
||||
WLAN_EID_WPA = 221,
|
||||
WLAN_EID_GENERIC = 221,
|
||||
WLAN_EID_VENDOR_SPECIFIC = 221,
|
||||
WLAN_EID_QOS_PARAMETER = 222
|
||||
WLAN_EID_QOS_PARAMETER = 222,
|
||||
|
||||
WLAN_EID_AP_CHAN_REPORT = 51,
|
||||
WLAN_EID_NEIGHBOR_REPORT = 52,
|
||||
WLAN_EID_RCPI = 53,
|
||||
WLAN_EID_BSS_AVG_ACCESS_DELAY = 63,
|
||||
WLAN_EID_ANTENNA_INFO = 64,
|
||||
WLAN_EID_RSNI = 65,
|
||||
WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66,
|
||||
WLAN_EID_BSS_AVAILABLE_CAPACITY = 67,
|
||||
WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
|
||||
WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
|
||||
WLAN_EID_MULTIPLE_BSSID = 71,
|
||||
|
||||
WLAN_EID_MOBILITY_DOMAIN = 54,
|
||||
WLAN_EID_FAST_BSS_TRANSITION = 55,
|
||||
WLAN_EID_TIMEOUT_INTERVAL = 56,
|
||||
WLAN_EID_RIC_DATA = 57,
|
||||
WLAN_EID_RIC_DESCRIPTOR = 75,
|
||||
|
||||
WLAN_EID_DSE_REGISTERED_LOCATION = 58,
|
||||
WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
|
||||
WLAN_EID_EXT_CHANSWITCH_ANN = 60,
|
||||
};
|
||||
|
||||
/* Action category code */
|
||||
|
|
@ -1150,6 +1224,18 @@ enum ieee80211_spectrum_mgmt_actioncode {
|
|||
WLAN_ACTION_SPCT_CHL_SWITCH = 4,
|
||||
};
|
||||
|
||||
/* HT action codes */
|
||||
enum ieee80211_ht_actioncode {
|
||||
WLAN_HT_ACTION_NOTIFY_CHANWIDTH = 0,
|
||||
WLAN_HT_ACTION_SMPS = 1,
|
||||
WLAN_HT_ACTION_PSMP = 2,
|
||||
WLAN_HT_ACTION_PCO_PHASE = 3,
|
||||
WLAN_HT_ACTION_CSI = 4,
|
||||
WLAN_HT_ACTION_NONCOMPRESSED_BF = 5,
|
||||
WLAN_HT_ACTION_COMPRESSED_BF = 6,
|
||||
WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
|
||||
};
|
||||
|
||||
/* Security key length */
|
||||
enum ieee80211_key_len {
|
||||
WLAN_KEY_LEN_WEP40 = 5,
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ enum {
|
|||
#define IFLA_LINKINFO IFLA_LINKINFO
|
||||
IFLA_NET_NS_PID,
|
||||
IFLA_IFALIAS,
|
||||
IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
|
||||
IFLA_VF_MAC, /* Hardware queue specific attributes */
|
||||
IFLA_VF_VLAN,
|
||||
IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
|
||||
IFLA_VFINFO,
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
|
|
@ -196,4 +201,29 @@ enum macvlan_mode {
|
|||
MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
|
||||
};
|
||||
|
||||
/* SR-IOV virtual function managment section */
|
||||
|
||||
struct ifla_vf_mac {
|
||||
__u32 vf;
|
||||
__u8 mac[32]; /* MAX_ADDR_LEN */
|
||||
};
|
||||
|
||||
struct ifla_vf_vlan {
|
||||
__u32 vf;
|
||||
__u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
|
||||
__u32 qos;
|
||||
};
|
||||
|
||||
struct ifla_vf_tx_rate {
|
||||
__u32 vf;
|
||||
__u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
|
||||
};
|
||||
|
||||
struct ifla_vf_info {
|
||||
__u32 vf;
|
||||
__u8 mac[32];
|
||||
__u32 vlan;
|
||||
__u32 qos;
|
||||
__u32 tx_rate;
|
||||
};
|
||||
#endif /* _LINUX_IF_LINK_H */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,90 @@
|
|||
#ifndef _LINUX_IF_MACVLAN_H
|
||||
#define _LINUX_IF_MACVLAN_H
|
||||
|
||||
#include <linux/if_link.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <net/netlink.h>
|
||||
|
||||
#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE)
|
||||
struct socket *macvtap_get_socket(struct file *);
|
||||
#else
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
struct file;
|
||||
struct socket;
|
||||
static inline struct socket *macvtap_get_socket(struct file *f)
|
||||
{
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
#endif /* CONFIG_MACVTAP */
|
||||
|
||||
struct macvlan_port;
|
||||
struct macvtap_queue;
|
||||
|
||||
/**
|
||||
* struct macvlan_rx_stats - MACVLAN percpu rx stats
|
||||
* @rx_packets: number of received packets
|
||||
* @rx_bytes: number of received bytes
|
||||
* @multicast: number of received multicast packets
|
||||
* @rx_errors: number of errors
|
||||
*/
|
||||
struct macvlan_rx_stats {
|
||||
unsigned long rx_packets;
|
||||
unsigned long rx_bytes;
|
||||
unsigned long multicast;
|
||||
unsigned long rx_errors;
|
||||
};
|
||||
|
||||
struct macvlan_dev {
|
||||
struct net_device *dev;
|
||||
struct list_head list;
|
||||
struct hlist_node hlist;
|
||||
struct macvlan_port *port;
|
||||
struct net_device *lowerdev;
|
||||
struct macvlan_rx_stats __percpu *rx_stats;
|
||||
enum macvlan_mode mode;
|
||||
int (*receive)(struct sk_buff *skb);
|
||||
int (*forward)(struct net_device *dev, struct sk_buff *skb);
|
||||
struct macvtap_queue *tap;
|
||||
};
|
||||
|
||||
static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
|
||||
unsigned int len, bool success,
|
||||
bool multicast)
|
||||
{
|
||||
struct macvlan_rx_stats *rx_stats;
|
||||
|
||||
rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
|
||||
if (likely(success)) {
|
||||
rx_stats->rx_packets++;;
|
||||
rx_stats->rx_bytes += len;
|
||||
if (multicast)
|
||||
rx_stats->multicast++;
|
||||
} else {
|
||||
rx_stats->rx_errors++;
|
||||
}
|
||||
}
|
||||
|
||||
extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
|
||||
struct nlattr *tb[], struct nlattr *data[],
|
||||
int (*receive)(struct sk_buff *skb),
|
||||
int (*forward)(struct net_device *dev,
|
||||
struct sk_buff *skb));
|
||||
|
||||
extern void macvlan_count_rx(const struct macvlan_dev *vlan,
|
||||
unsigned int len, bool success,
|
||||
bool multicast);
|
||||
|
||||
extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
|
||||
|
||||
extern int macvlan_link_register(struct rtnl_link_ops *ops);
|
||||
|
||||
extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
|
||||
|
||||
extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *);
|
||||
|
||||
#endif /* _LINUX_IF_MACVLAN_H */
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ struct sockaddr_ll {
|
|||
#define PACKET_RESERVE 12
|
||||
#define PACKET_TX_RING 13
|
||||
#define PACKET_LOSS 14
|
||||
#define PACKET_VNET_HDR 15
|
||||
|
||||
struct tpacket_stats {
|
||||
unsigned int tp_packets;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/filter.h>
|
||||
|
||||
/* Read queue size */
|
||||
#define TUN_READQ_SIZE 500
|
||||
|
|
@ -48,6 +49,8 @@
|
|||
#define TUNGETIFF _IOR('T', 210, unsigned int)
|
||||
#define TUNGETSNDBUF _IOR('T', 211, int)
|
||||
#define TUNSETSNDBUF _IOW('T', 212, int)
|
||||
#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
|
||||
#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
|
||||
|
||||
/* TUNSETIFF ifr flags */
|
||||
#define IFF_TUN 0x0001
|
||||
|
|
@ -86,4 +89,18 @@ struct tun_filter {
|
|||
__u8 addr[0][ETH_ALEN];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
|
||||
struct socket *tun_get_socket(struct file *);
|
||||
#else
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
struct file;
|
||||
struct socket;
|
||||
static inline struct socket *tun_get_socket(struct file *f)
|
||||
{
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
#endif /* CONFIG_TUN */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __IF_TUN_H */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define _IF_TUNNEL_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/ip.h>
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ extern int sysctl_igmp_max_msf;
|
|||
struct ip_sf_socklist {
|
||||
unsigned int sl_max;
|
||||
unsigned int sl_count;
|
||||
struct rcu_head rcu;
|
||||
__be32 sl_addr[0];
|
||||
};
|
||||
|
||||
|
|
@ -170,6 +171,7 @@ struct ip_mc_socklist {
|
|||
struct ip_mreqn multi;
|
||||
unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
|
||||
struct ip_sf_socklist *sflist;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
struct ip_sf_list {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ struct in_addr {
|
|||
#define IP_ORIGDSTADDR 20
|
||||
#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
|
||||
|
||||
#define IP_MINTTL 21
|
||||
|
||||
/* IP_MTU_DISCOVER values */
|
||||
#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
|
||||
#define IP_PMTUDISC_WANT 1 /* Use per route hints */
|
||||
|
|
|
|||
|
|
@ -10,10 +10,40 @@
|
|||
#include <linux/timer.h>
|
||||
#include <linux/sysctl.h>
|
||||
|
||||
enum
|
||||
{
|
||||
IPV4_DEVCONF_FORWARDING=1,
|
||||
IPV4_DEVCONF_MC_FORWARDING,
|
||||
IPV4_DEVCONF_PROXY_ARP,
|
||||
IPV4_DEVCONF_ACCEPT_REDIRECTS,
|
||||
IPV4_DEVCONF_SECURE_REDIRECTS,
|
||||
IPV4_DEVCONF_SEND_REDIRECTS,
|
||||
IPV4_DEVCONF_SHARED_MEDIA,
|
||||
IPV4_DEVCONF_RP_FILTER,
|
||||
IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
|
||||
IPV4_DEVCONF_BOOTP_RELAY,
|
||||
IPV4_DEVCONF_LOG_MARTIANS,
|
||||
IPV4_DEVCONF_TAG,
|
||||
IPV4_DEVCONF_ARPFILTER,
|
||||
IPV4_DEVCONF_MEDIUM_ID,
|
||||
IPV4_DEVCONF_NOXFRM,
|
||||
IPV4_DEVCONF_NOPOLICY,
|
||||
IPV4_DEVCONF_FORCE_IGMP_VERSION,
|
||||
IPV4_DEVCONF_ARP_ANNOUNCE,
|
||||
IPV4_DEVCONF_ARP_IGNORE,
|
||||
IPV4_DEVCONF_PROMOTE_SECONDARIES,
|
||||
IPV4_DEVCONF_ARP_ACCEPT,
|
||||
IPV4_DEVCONF_ARP_NOTIFY,
|
||||
IPV4_DEVCONF_ACCEPT_LOCAL,
|
||||
IPV4_DEVCONF_SRC_VMARK,
|
||||
IPV4_DEVCONF_PROXY_ARP_PVLAN,
|
||||
__IPV4_DEVCONF_MAX
|
||||
};
|
||||
|
||||
struct ipv4_devconf {
|
||||
void *sysctl;
|
||||
int data[__NET_IPV4_CONF_MAX - 1];
|
||||
DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1);
|
||||
int data[__IPV4_DEVCONF_MAX - 1];
|
||||
DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1);
|
||||
};
|
||||
|
||||
struct in_device {
|
||||
|
|
@ -40,7 +70,7 @@ struct in_device {
|
|||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1])
|
||||
#define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1])
|
||||
#define IPV4_DEVCONF_ALL(net, attr) \
|
||||
IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr)
|
||||
|
||||
|
|
@ -60,13 +90,13 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
|
|||
|
||||
static inline void ipv4_devconf_setall(struct in_device *in_dev)
|
||||
{
|
||||
bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1);
|
||||
bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1);
|
||||
}
|
||||
|
||||
#define IN_DEV_CONF_GET(in_dev, attr) \
|
||||
ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr)
|
||||
ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr)
|
||||
#define IN_DEV_CONF_SET(in_dev, attr, val) \
|
||||
ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val))
|
||||
ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val))
|
||||
|
||||
#define IN_DEV_ANDCONF(in_dev, attr) \
|
||||
(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
|
||||
|
|
@ -89,6 +119,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
|
|||
|
||||
#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
|
||||
#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP)
|
||||
#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN)
|
||||
#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)
|
||||
#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)
|
||||
#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \
|
||||
|
|
|
|||
|
|
@ -32,14 +32,6 @@ extern struct fs_struct init_fs;
|
|||
}
|
||||
|
||||
extern struct nsproxy init_nsproxy;
|
||||
#define INIT_NSPROXY(nsproxy) { \
|
||||
.pid_ns = &init_pid_ns, \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.uts_ns = &init_uts_ns, \
|
||||
.mnt_ns = NULL, \
|
||||
INIT_NET_NS(net_ns) \
|
||||
INIT_IPC_NS(ipc_ns) \
|
||||
}
|
||||
|
||||
#define INIT_SIGHAND(sighand) { \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ struct input_absinfo {
|
|||
|
||||
#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
|
||||
#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
|
||||
#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
|
||||
#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
|
||||
#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
|
||||
#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
|
||||
#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
|
||||
#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
|
||||
#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */
|
||||
#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */
|
||||
|
||||
#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
|
||||
#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
|
||||
|
|
@ -1142,8 +1142,10 @@ struct input_dev {
|
|||
unsigned int keycodemax;
|
||||
unsigned int keycodesize;
|
||||
void *keycode;
|
||||
int (*setkeycode)(struct input_dev *dev, int scancode, int keycode);
|
||||
int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode);
|
||||
int (*setkeycode)(struct input_dev *dev,
|
||||
unsigned int scancode, unsigned int keycode);
|
||||
int (*getkeycode)(struct input_dev *dev,
|
||||
unsigned int scancode, unsigned int *keycode);
|
||||
|
||||
struct ff_device *ff;
|
||||
|
||||
|
|
@ -1415,8 +1417,10 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
|
|||
dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
|
||||
}
|
||||
|
||||
int input_get_keycode(struct input_dev *dev, int scancode, int *keycode);
|
||||
int input_set_keycode(struct input_dev *dev, int scancode, int keycode);
|
||||
int input_get_keycode(struct input_dev *dev,
|
||||
unsigned int scancode, unsigned int *keycode);
|
||||
int input_set_keycode(struct input_dev *dev,
|
||||
unsigned int scancode, unsigned int keycode);
|
||||
|
||||
extern struct class input_class;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct io_context {
|
|||
unsigned short ioprio;
|
||||
unsigned short ioprio_changed;
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
|
||||
unsigned short cgroup_changed;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -34,22 +34,24 @@ struct resource_list {
|
|||
*/
|
||||
#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
|
||||
|
||||
#define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */
|
||||
#define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */
|
||||
#define IORESOURCE_IO 0x00000100
|
||||
#define IORESOURCE_MEM 0x00000200
|
||||
#define IORESOURCE_IRQ 0x00000400
|
||||
#define IORESOURCE_DMA 0x00000800
|
||||
#define IORESOURCE_BUS 0x00001000
|
||||
|
||||
#define IORESOURCE_PREFETCH 0x00001000 /* No side effects */
|
||||
#define IORESOURCE_READONLY 0x00002000
|
||||
#define IORESOURCE_CACHEABLE 0x00004000
|
||||
#define IORESOURCE_RANGELENGTH 0x00008000
|
||||
#define IORESOURCE_SHADOWABLE 0x00010000
|
||||
#define IORESOURCE_PREFETCH 0x00002000 /* No side effects */
|
||||
#define IORESOURCE_READONLY 0x00004000
|
||||
#define IORESOURCE_CACHEABLE 0x00008000
|
||||
#define IORESOURCE_RANGELENGTH 0x00010000
|
||||
#define IORESOURCE_SHADOWABLE 0x00020000
|
||||
|
||||
#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */
|
||||
#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */
|
||||
#define IORESOURCE_SIZEALIGN 0x00040000 /* size indicates alignment */
|
||||
#define IORESOURCE_STARTALIGN 0x00080000 /* start field is alignment */
|
||||
|
||||
#define IORESOURCE_MEM_64 0x00100000
|
||||
#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */
|
||||
|
||||
#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
|
||||
#define IORESOURCE_DISABLED 0x10000000
|
||||
|
|
@ -110,12 +112,14 @@ struct resource_list {
|
|||
extern struct resource ioport_resource;
|
||||
extern struct resource iomem_resource;
|
||||
|
||||
extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
|
||||
extern int request_resource(struct resource *root, struct resource *new);
|
||||
extern int release_resource(struct resource *new);
|
||||
void release_child_resources(struct resource *new);
|
||||
extern void reserve_region_with_split(struct resource *root,
|
||||
resource_size_t start, resource_size_t end,
|
||||
const char *name);
|
||||
extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new);
|
||||
extern int insert_resource(struct resource *parent, struct resource *new);
|
||||
extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
|
||||
extern int allocate_resource(struct resource *root, struct resource *new,
|
||||
|
|
|
|||
|
|
@ -62,11 +62,6 @@ extern struct ipc_namespace init_ipc_ns;
|
|||
extern atomic_t nr_ipc_ns;
|
||||
|
||||
extern spinlock_t mq_lock;
|
||||
#if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
|
||||
#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
|
||||
#else
|
||||
#define INIT_IPC_NS(ns)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSVIPC
|
||||
extern int register_ipcns_notifier(struct ipc_namespace *);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ipmi_smi.h>
|
||||
|
||||
/* This files describes the interface for IPMI system management interface
|
||||
drivers to bind into the IPMI message handler. */
|
||||
|
|
|
|||
|
|
@ -400,7 +400,9 @@ static inline int irq_has_action(unsigned int irq)
|
|||
|
||||
/* Dynamic irq helper functions */
|
||||
extern void dynamic_irq_init(unsigned int irq);
|
||||
void dynamic_irq_init_keep_chip_data(unsigned int irq);
|
||||
extern void dynamic_irq_cleanup(unsigned int irq);
|
||||
void dynamic_irq_cleanup_keep_chip_data(unsigned int irq);
|
||||
|
||||
/* Set/get chip/data for an IRQ: */
|
||||
extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
|
||||
|
|
|
|||
|
|
@ -50,8 +50,7 @@ struct capi_ctr {
|
|||
u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb);
|
||||
|
||||
char *(*procinfo)(struct capi_ctr *);
|
||||
int (*ctr_read_proc)(char *page, char **start, off_t off,
|
||||
int count, int *eof, struct capi_ctr *card);
|
||||
const struct file_operations *proc_fops;
|
||||
|
||||
/* filled in before calling ready callback */
|
||||
u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
|
||||
|
|
@ -67,9 +66,10 @@ struct capi_ctr {
|
|||
unsigned long nsentdatapkt;
|
||||
|
||||
int cnr; /* controller number */
|
||||
volatile unsigned short cardstate; /* controller state */
|
||||
volatile int blocked; /* output blocked */
|
||||
unsigned short state; /* controller state */
|
||||
int blocked; /* output blocked */
|
||||
int traceflag; /* capi trace */
|
||||
wait_queue_head_t state_wait_queue;
|
||||
|
||||
struct proc_dir_entry *procent;
|
||||
char procfn[128];
|
||||
|
|
|
|||
|
|
@ -246,19 +246,8 @@ typedef struct journal_superblock_s
|
|||
|
||||
#define J_ASSERT(assert) BUG_ON(!(assert))
|
||||
|
||||
#if defined(CONFIG_BUFFER_DEBUG)
|
||||
void buffer_assertion_failure(struct buffer_head *bh);
|
||||
#define J_ASSERT_BH(bh, expr) \
|
||||
do { \
|
||||
if (!(expr)) \
|
||||
buffer_assertion_failure(bh); \
|
||||
J_ASSERT(expr); \
|
||||
} while (0)
|
||||
#define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr)
|
||||
#else
|
||||
#define J_ASSERT_BH(bh, expr) J_ASSERT(expr)
|
||||
#define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
|
||||
#endif
|
||||
|
||||
#if defined(JBD_PARANOID_IOFAIL)
|
||||
#define J_EXPECT(expr, why...) J_ASSERT(expr)
|
||||
|
|
|
|||
|
|
@ -69,15 +69,8 @@ extern u8 jbd2_journal_enable_debug;
|
|||
#define jbd_debug(f, a...) /**/
|
||||
#endif
|
||||
|
||||
static inline void *jbd2_alloc(size_t size, gfp_t flags)
|
||||
{
|
||||
return (void *)__get_free_pages(flags, get_order(size));
|
||||
}
|
||||
|
||||
static inline void jbd2_free(void *ptr, size_t size)
|
||||
{
|
||||
free_pages((unsigned long)ptr, get_order(size));
|
||||
};
|
||||
extern void *jbd2_alloc(size_t size, gfp_t flags);
|
||||
extern void jbd2_free(void *ptr, size_t size);
|
||||
|
||||
#define JBD2_MIN_JOURNAL_BLOCKS 1024
|
||||
|
||||
|
|
@ -284,19 +277,8 @@ typedef struct journal_superblock_s
|
|||
|
||||
#define J_ASSERT(assert) BUG_ON(!(assert))
|
||||
|
||||
#if defined(CONFIG_BUFFER_DEBUG)
|
||||
void buffer_assertion_failure(struct buffer_head *bh);
|
||||
#define J_ASSERT_BH(bh, expr) \
|
||||
do { \
|
||||
if (!(expr)) \
|
||||
buffer_assertion_failure(bh); \
|
||||
J_ASSERT(expr); \
|
||||
} while (0)
|
||||
#define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr)
|
||||
#else
|
||||
#define J_ASSERT_BH(bh, expr) J_ASSERT(expr)
|
||||
#define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
|
||||
#endif
|
||||
|
||||
#if defined(JBD2_PARANOID_IOFAIL)
|
||||
#define J_EXPECT(expr, why...) J_ASSERT(expr)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,16 @@ extern const char linux_proc_banner[];
|
|||
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
|
||||
|
||||
/*
|
||||
* This looks more complex than it should be. But we need to
|
||||
* get the type for the ~ right in round_down (it needs to be
|
||||
* as wide as the result!), and we want to evaluate the macro
|
||||
* arguments just once each.
|
||||
*/
|
||||
#define __round_mask(x, y) ((__typeof__(x))((y)-1))
|
||||
#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
|
||||
#define round_down(x, y) ((x) & ~__round_mask(x, y))
|
||||
|
||||
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
|
|
|
|||
|
|
@ -48,9 +48,7 @@ typedef struct kcapi_carddef {
|
|||
#include <linux/list.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#define KCI_CONTRUP 0 /* arg: struct capi_profile */
|
||||
#define KCI_CONTRDOWN 1 /* arg: NULL */
|
||||
#include <linux/notifier.h>
|
||||
|
||||
struct capi20_appl {
|
||||
u16 applid;
|
||||
|
|
@ -67,11 +65,6 @@ struct capi20_appl {
|
|||
struct sk_buff_head recv_queue;
|
||||
struct work_struct recv_work;
|
||||
int release_in_progress;
|
||||
|
||||
/* ugly hack to allow for notification of added/removed
|
||||
* controllers. The Right Way (tm) is known. XXX
|
||||
*/
|
||||
void (*callback) (unsigned int cmd, __u32 contr, void *data);
|
||||
};
|
||||
|
||||
u16 capi20_isinstalled(void);
|
||||
|
|
@ -84,11 +77,11 @@ u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
|
|||
u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
|
||||
int capi20_manufacturer(unsigned int cmd, void __user *data);
|
||||
|
||||
/* temporary hack XXX */
|
||||
void capi20_set_callback(struct capi20_appl *ap,
|
||||
void (*callback) (unsigned int cmd, __u32 contr, void *data));
|
||||
|
||||
#define CAPICTR_UP 0
|
||||
#define CAPICTR_DOWN 1
|
||||
|
||||
int register_capictr_notifier(struct notifier_block *nb);
|
||||
int unregister_capictr_notifier(struct notifier_block *nb);
|
||||
|
||||
#define CAPI_NOERROR 0x0000
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ extern struct kimage *kexec_crash_image;
|
|||
*/
|
||||
extern struct resource crashk_res;
|
||||
typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
|
||||
extern note_buf_t *crash_notes;
|
||||
extern note_buf_t __percpu *crash_notes;
|
||||
extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
|
||||
extern size_t vmcoreinfo_size;
|
||||
extern size_t vmcoreinfo_max_size;
|
||||
|
|
|
|||
|
|
@ -102,8 +102,6 @@ union { \
|
|||
unsigned char name##kfifo_buffer[size]; \
|
||||
struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer)
|
||||
|
||||
#undef __kfifo_initializer
|
||||
|
||||
extern void kfifo_init(struct kfifo *fifo, void *buffer,
|
||||
unsigned int size);
|
||||
extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#define KMOD_PATH_LEN 256
|
||||
|
||||
#ifdef CONFIG_MODULES
|
||||
extern char modprobe_path[]; /* for sysctl */
|
||||
/* modprobe exit status on success, -ve on error. Return value
|
||||
* usually useless though. */
|
||||
extern int __request_module(bool wait, const char *name, ...) \
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
|
|||
|
||||
struct kobj_type {
|
||||
void (*release)(struct kobject *kobj);
|
||||
struct sysfs_ops *sysfs_ops;
|
||||
const struct sysfs_ops *sysfs_ops;
|
||||
struct attribute **default_attrs;
|
||||
};
|
||||
|
||||
|
|
@ -118,9 +118,9 @@ struct kobj_uevent_env {
|
|||
};
|
||||
|
||||
struct kset_uevent_ops {
|
||||
int (*filter)(struct kset *kset, struct kobject *kobj);
|
||||
const char *(*name)(struct kset *kset, struct kobject *kobj);
|
||||
int (*uevent)(struct kset *kset, struct kobject *kobj,
|
||||
int (* const filter)(struct kset *kset, struct kobject *kobj);
|
||||
const char *(* const name)(struct kset *kset, struct kobject *kobj);
|
||||
int (* const uevent)(struct kset *kset, struct kobject *kobj,
|
||||
struct kobj_uevent_env *env);
|
||||
};
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ struct kobj_attribute {
|
|||
const char *buf, size_t count);
|
||||
};
|
||||
|
||||
extern struct sysfs_ops kobj_sysfs_ops;
|
||||
extern const struct sysfs_ops kobj_sysfs_ops;
|
||||
|
||||
/**
|
||||
* struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
|
||||
|
|
@ -155,14 +155,14 @@ struct kset {
|
|||
struct list_head list;
|
||||
spinlock_t list_lock;
|
||||
struct kobject kobj;
|
||||
struct kset_uevent_ops *uevent_ops;
|
||||
const struct kset_uevent_ops *uevent_ops;
|
||||
};
|
||||
|
||||
extern void kset_init(struct kset *kset);
|
||||
extern int __must_check kset_register(struct kset *kset);
|
||||
extern void kset_unregister(struct kset *kset);
|
||||
extern struct kset * __must_check kset_create_and_add(const char *name,
|
||||
struct kset_uevent_ops *u,
|
||||
const struct kset_uevent_ops *u,
|
||||
struct kobject *parent_kobj);
|
||||
|
||||
static inline struct kset *to_kset(struct kobject *kobj)
|
||||
|
|
|
|||
|
|
@ -122,6 +122,11 @@ struct kprobe {
|
|||
/* Kprobe status flags */
|
||||
#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */
|
||||
#define KPROBE_FLAG_DISABLED 2 /* probe is temporarily disabled */
|
||||
#define KPROBE_FLAG_OPTIMIZED 4 /*
|
||||
* probe is really optimized.
|
||||
* NOTE:
|
||||
* this flag is only for optimized_kprobe.
|
||||
*/
|
||||
|
||||
/* Has this kprobe gone ? */
|
||||
static inline int kprobe_gone(struct kprobe *p)
|
||||
|
|
@ -134,6 +139,12 @@ static inline int kprobe_disabled(struct kprobe *p)
|
|||
{
|
||||
return p->flags & (KPROBE_FLAG_DISABLED | KPROBE_FLAG_GONE);
|
||||
}
|
||||
|
||||
/* Is this kprobe really running optimized path ? */
|
||||
static inline int kprobe_optimized(struct kprobe *p)
|
||||
{
|
||||
return p->flags & KPROBE_FLAG_OPTIMIZED;
|
||||
}
|
||||
/*
|
||||
* Special probe type that uses setjmp-longjmp type tricks to resume
|
||||
* execution at a specified entry with a matching prototype corresponding
|
||||
|
|
@ -249,6 +260,39 @@ extern kprobe_opcode_t *get_insn_slot(void);
|
|||
extern void free_insn_slot(kprobe_opcode_t *slot, int dirty);
|
||||
extern void kprobes_inc_nmissed_count(struct kprobe *p);
|
||||
|
||||
#ifdef CONFIG_OPTPROBES
|
||||
/*
|
||||
* Internal structure for direct jump optimized probe
|
||||
*/
|
||||
struct optimized_kprobe {
|
||||
struct kprobe kp;
|
||||
struct list_head list; /* list for optimizing queue */
|
||||
struct arch_optimized_insn optinsn;
|
||||
};
|
||||
|
||||
/* Architecture dependent functions for direct jump optimization */
|
||||
extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn);
|
||||
extern int arch_check_optimized_kprobe(struct optimized_kprobe *op);
|
||||
extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op);
|
||||
extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op);
|
||||
extern int arch_optimize_kprobe(struct optimized_kprobe *op);
|
||||
extern void arch_unoptimize_kprobe(struct optimized_kprobe *op);
|
||||
extern kprobe_opcode_t *get_optinsn_slot(void);
|
||||
extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty);
|
||||
extern int arch_within_optimized_kprobe(struct optimized_kprobe *op,
|
||||
unsigned long addr);
|
||||
|
||||
extern void opt_pre_handler(struct kprobe *p, struct pt_regs *regs);
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
extern int sysctl_kprobes_optimization;
|
||||
extern int proc_kprobes_optimization_handler(struct ctl_table *table,
|
||||
int write, void __user *buffer,
|
||||
size_t *length, loff_t *ppos);
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_OPTPROBES */
|
||||
|
||||
/* Get the kprobe at this addr (if any) - called with preemption disabled */
|
||||
struct kprobe *get_kprobe(void *addr);
|
||||
void kretprobe_hash_lock(struct task_struct *tsk,
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ struct kvm_userspace_memory_region {
|
|||
|
||||
/* for kvm_memory_region::flags */
|
||||
#define KVM_MEM_LOG_DIRTY_PAGES 1UL
|
||||
|
||||
#define KVM_MEMSLOT_INVALID (1UL << 1)
|
||||
|
||||
/* for KVM_IRQ_LINE */
|
||||
struct kvm_irq_level {
|
||||
|
|
@ -497,6 +497,11 @@ struct kvm_ioeventfd {
|
|||
#endif
|
||||
#define KVM_CAP_S390_PSW 42
|
||||
#define KVM_CAP_PPC_SEGSTATE 43
|
||||
#define KVM_CAP_HYPERV 44
|
||||
#define KVM_CAP_HYPERV_VAPIC 45
|
||||
#define KVM_CAP_HYPERV_SPIN 46
|
||||
#define KVM_CAP_PCI_SEGMENT 47
|
||||
#define KVM_CAP_X86_ROBUST_SINGLESTEP 51
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
|
|
@ -691,8 +696,9 @@ struct kvm_assigned_pci_dev {
|
|||
__u32 busnr;
|
||||
__u32 devfn;
|
||||
__u32 flags;
|
||||
__u32 segnr;
|
||||
union {
|
||||
__u32 reserved[12];
|
||||
__u32 reserved[11];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#define KVM_REQ_MMU_SYNC 7
|
||||
#define KVM_REQ_KVMCLOCK_UPDATE 8
|
||||
#define KVM_REQ_KICK 9
|
||||
#define KVM_REQ_DEACTIVATE_FPU 10
|
||||
|
||||
#define KVM_USERSPACE_IRQ_SOURCE_ID 0
|
||||
|
||||
|
|
@ -57,20 +58,20 @@ struct kvm_io_bus {
|
|||
struct kvm_io_device *devs[NR_IOBUS_DEVS];
|
||||
};
|
||||
|
||||
void kvm_io_bus_init(struct kvm_io_bus *bus);
|
||||
void kvm_io_bus_destroy(struct kvm_io_bus *bus);
|
||||
int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len,
|
||||
const void *val);
|
||||
int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len,
|
||||
enum kvm_bus {
|
||||
KVM_MMIO_BUS,
|
||||
KVM_PIO_BUS,
|
||||
KVM_NR_BUSES
|
||||
};
|
||||
|
||||
int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
|
||||
int len, const void *val);
|
||||
int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len,
|
||||
void *val);
|
||||
int __kvm_io_bus_register_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus,
|
||||
int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx,
|
||||
struct kvm_io_device *dev);
|
||||
void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
|
||||
struct kvm_io_device *dev);
|
||||
|
||||
struct kvm_vcpu {
|
||||
struct kvm *kvm;
|
||||
|
|
@ -83,6 +84,8 @@ struct kvm_vcpu {
|
|||
struct kvm_run *run;
|
||||
unsigned long requests;
|
||||
unsigned long guest_debug;
|
||||
int srcu_idx;
|
||||
|
||||
int fpu_active;
|
||||
int guest_fpu_loaded;
|
||||
wait_queue_head_t wq;
|
||||
|
|
@ -150,14 +153,19 @@ struct kvm_irq_routing_table {};
|
|||
|
||||
#endif
|
||||
|
||||
struct kvm {
|
||||
spinlock_t mmu_lock;
|
||||
spinlock_t requests_lock;
|
||||
struct rw_semaphore slots_lock;
|
||||
struct mm_struct *mm; /* userspace tied to this vm */
|
||||
struct kvm_memslots {
|
||||
int nmemslots;
|
||||
struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
|
||||
KVM_PRIVATE_MEM_SLOTS];
|
||||
};
|
||||
|
||||
struct kvm {
|
||||
spinlock_t mmu_lock;
|
||||
raw_spinlock_t requests_lock;
|
||||
struct mutex slots_lock;
|
||||
struct mm_struct *mm; /* userspace tied to this vm */
|
||||
struct kvm_memslots *memslots;
|
||||
struct srcu_struct srcu;
|
||||
#ifdef CONFIG_KVM_APIC_ARCHITECTURE
|
||||
u32 bsp_vcpu_id;
|
||||
struct kvm_vcpu *bsp_vcpu;
|
||||
|
|
@ -166,8 +174,7 @@ struct kvm {
|
|||
atomic_t online_vcpus;
|
||||
struct list_head vm_list;
|
||||
struct mutex lock;
|
||||
struct kvm_io_bus mmio_bus;
|
||||
struct kvm_io_bus pio_bus;
|
||||
struct kvm_io_bus *buses[KVM_NR_BUSES];
|
||||
#ifdef CONFIG_HAVE_KVM_EVENTFD
|
||||
struct {
|
||||
spinlock_t lock;
|
||||
|
|
@ -249,13 +256,20 @@ int kvm_set_memory_region(struct kvm *kvm,
|
|||
int __kvm_set_memory_region(struct kvm *kvm,
|
||||
struct kvm_userspace_memory_region *mem,
|
||||
int user_alloc);
|
||||
int kvm_arch_set_memory_region(struct kvm *kvm,
|
||||
int kvm_arch_prepare_memory_region(struct kvm *kvm,
|
||||
struct kvm_memory_slot *memslot,
|
||||
struct kvm_memory_slot old,
|
||||
struct kvm_userspace_memory_region *mem,
|
||||
int user_alloc);
|
||||
void kvm_arch_commit_memory_region(struct kvm *kvm,
|
||||
struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot old,
|
||||
int user_alloc);
|
||||
void kvm_disable_largepages(void);
|
||||
void kvm_arch_flush_shadow(struct kvm *kvm);
|
||||
gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
|
||||
gfn_t unalias_gfn_instantiation(struct kvm *kvm, gfn_t gfn);
|
||||
|
||||
struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
|
||||
unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
|
||||
void kvm_release_page_clean(struct page *page);
|
||||
|
|
@ -264,6 +278,9 @@ void kvm_set_page_dirty(struct page *page);
|
|||
void kvm_set_page_accessed(struct page *page);
|
||||
|
||||
pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
|
||||
pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
|
||||
struct kvm_memory_slot *slot, gfn_t gfn);
|
||||
int memslot_id(struct kvm *kvm, gfn_t gfn);
|
||||
void kvm_release_pfn_dirty(pfn_t);
|
||||
void kvm_release_pfn_clean(pfn_t pfn);
|
||||
void kvm_set_pfn_dirty(pfn_t pfn);
|
||||
|
|
@ -283,6 +300,7 @@ int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);
|
|||
int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);
|
||||
struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
|
||||
int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
|
||||
unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn);
|
||||
void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
|
||||
|
||||
void kvm_vcpu_block(struct kvm_vcpu *vcpu);
|
||||
|
|
@ -383,6 +401,7 @@ struct kvm_assigned_dev_kernel {
|
|||
struct work_struct interrupt_work;
|
||||
struct list_head list;
|
||||
int assigned_dev_id;
|
||||
int host_segnr;
|
||||
int host_busnr;
|
||||
int host_devfn;
|
||||
unsigned int entries_nr;
|
||||
|
|
@ -429,8 +448,7 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
|
|||
#define KVM_IOMMU_CACHE_COHERENCY 0x1
|
||||
|
||||
#ifdef CONFIG_IOMMU_API
|
||||
int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn,
|
||||
unsigned long npages);
|
||||
int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot);
|
||||
int kvm_iommu_map_guest(struct kvm *kvm);
|
||||
int kvm_iommu_unmap_guest(struct kvm *kvm);
|
||||
int kvm_assign_device(struct kvm *kvm,
|
||||
|
|
@ -480,11 +498,6 @@ static inline void kvm_guest_exit(void)
|
|||
current->flags &= ~PF_VCPU;
|
||||
}
|
||||
|
||||
static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
|
||||
{
|
||||
return slot - kvm->memslots;
|
||||
}
|
||||
|
||||
static inline gpa_t gfn_to_gpa(gfn_t gfn)
|
||||
{
|
||||
return (gpa_t)gfn << PAGE_SHIFT;
|
||||
|
|
@ -532,6 +545,10 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef KVM_ARCH_HAS_UNALIAS_INSTANTIATION
|
||||
#define unalias_gfn_instantiation unalias_gfn
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
||||
|
||||
#define KVM_MAX_IRQ_ROUTES 1024
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ static inline void list_splice_tail_init(struct list_head *list,
|
|||
pos = n, n = list_entry(n->member.next, typeof(*n), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_continue
|
||||
* list_for_each_entry_safe_continue - continue list iteration safe against removal
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
|
|
@ -514,7 +514,7 @@ static inline void list_splice_tail_init(struct list_head *list,
|
|||
pos = n, n = list_entry(n->member.next, typeof(*n), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_from
|
||||
* list_for_each_entry_safe_from - iterate over list from current point safe against removal
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
|
|
@ -529,7 +529,7 @@ static inline void list_splice_tail_init(struct list_head *list,
|
|||
pos = n, n = list_entry(n->member.next, typeof(*n), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_reverse
|
||||
* list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ enum llc_sockopts {
|
|||
LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
|
||||
LLC_OPT_TX_WIN, /* tx window size. */
|
||||
LLC_OPT_RX_WIN, /* rx window size. */
|
||||
LLC_OPT_PKTINFO, /* ancillary packet information. */
|
||||
LLC_OPT_MAX
|
||||
};
|
||||
|
||||
|
|
@ -70,6 +71,12 @@ enum llc_sockopts {
|
|||
#define LLC_SAP_RM 0xD4 /* Resource Management */
|
||||
#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
|
||||
|
||||
struct llc_pktinfo {
|
||||
int lpi_ifindex;
|
||||
unsigned char lpi_sap;
|
||||
unsigned char lpi_mac[IFHWADDRLEN];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define LLC_SAP_DYN_START 0xC0
|
||||
#define LLC_SAP_DYN_STOP 0xDE
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@
|
|||
struct task_struct;
|
||||
struct lockdep_map;
|
||||
|
||||
/* for sysctl */
|
||||
extern int prove_locking;
|
||||
extern int lock_stat;
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ For crash recovery after replication node failure,
|
|||
usually the condition is softened to regions that _may_ have been target of
|
||||
in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent
|
||||
bitmap, trading frequency of meta data transactions against amount of
|
||||
(possibly unneccessary) resync traffic.
|
||||
(possibly unnecessary) resync traffic.
|
||||
|
||||
If we set a hard limit on the area that may be "hot" at any given time, we
|
||||
limit the amount of resync traffic needed for crash recovery.
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@
|
|||
#define CGROUP_SUPER_MAGIC 0x27e0eb
|
||||
|
||||
#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
|
||||
#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
|
||||
|
||||
#define STACK_END_MAGIC 0x57AC6E9D
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ static inline bool mem_cgroup_disabled(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
extern bool mem_cgroup_oom_called(struct task_struct *task);
|
||||
void mem_cgroup_update_file_mapped(struct page *page, int val);
|
||||
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
|
||||
gfp_t gfp_mask, int nid,
|
||||
|
|
@ -258,11 +257,6 @@ static inline bool mem_cgroup_disabled(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
static inline bool mem_cgroup_oom_called(struct task_struct *task)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int
|
||||
mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ struct memory_block {
|
|||
struct sys_device sysdev;
|
||||
};
|
||||
|
||||
int arch_get_memory_phys_device(unsigned long start_pfn);
|
||||
|
||||
/* These states are exposed to userspace as text strings in sysfs */
|
||||
#define MEM_ONLINE (1<<0) /* exposed to userspace */
|
||||
#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
|
||||
|
|
|
|||
|
|
@ -1,217 +0,0 @@
|
|||
/*
|
||||
* Marvell 88PM8607 Interface
|
||||
*
|
||||
* Copyright (C) 2009 Marvell International Ltd.
|
||||
* Haojian Zhuang <haojian.zhuang@marvell.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 __LINUX_MFD_88PM8607_H
|
||||
#define __LINUX_MFD_88PM8607_H
|
||||
|
||||
enum {
|
||||
PM8607_ID_BUCK1 = 0,
|
||||
PM8607_ID_BUCK2,
|
||||
PM8607_ID_BUCK3,
|
||||
|
||||
PM8607_ID_LDO1,
|
||||
PM8607_ID_LDO2,
|
||||
PM8607_ID_LDO3,
|
||||
PM8607_ID_LDO4,
|
||||
PM8607_ID_LDO5,
|
||||
PM8607_ID_LDO6,
|
||||
PM8607_ID_LDO7,
|
||||
PM8607_ID_LDO8,
|
||||
PM8607_ID_LDO9,
|
||||
PM8607_ID_LDO10,
|
||||
PM8607_ID_LDO12,
|
||||
PM8607_ID_LDO14,
|
||||
|
||||
PM8607_ID_RG_MAX,
|
||||
};
|
||||
|
||||
#define CHIP_ID (0x40)
|
||||
#define CHIP_ID_MASK (0xF8)
|
||||
|
||||
/* Interrupt Registers */
|
||||
#define PM8607_STATUS_1 (0x01)
|
||||
#define PM8607_STATUS_2 (0x02)
|
||||
#define PM8607_INT_STATUS1 (0x03)
|
||||
#define PM8607_INT_STATUS2 (0x04)
|
||||
#define PM8607_INT_STATUS3 (0x05)
|
||||
#define PM8607_INT_MASK_1 (0x06)
|
||||
#define PM8607_INT_MASK_2 (0x07)
|
||||
#define PM8607_INT_MASK_3 (0x08)
|
||||
|
||||
/* Regulator Control Registers */
|
||||
#define PM8607_LDO1 (0x10)
|
||||
#define PM8607_LDO2 (0x11)
|
||||
#define PM8607_LDO3 (0x12)
|
||||
#define PM8607_LDO4 (0x13)
|
||||
#define PM8607_LDO5 (0x14)
|
||||
#define PM8607_LDO6 (0x15)
|
||||
#define PM8607_LDO7 (0x16)
|
||||
#define PM8607_LDO8 (0x17)
|
||||
#define PM8607_LDO9 (0x18)
|
||||
#define PM8607_LDO10 (0x19)
|
||||
#define PM8607_LDO12 (0x1A)
|
||||
#define PM8607_LDO14 (0x1B)
|
||||
#define PM8607_SLEEP_MODE1 (0x1C)
|
||||
#define PM8607_SLEEP_MODE2 (0x1D)
|
||||
#define PM8607_SLEEP_MODE3 (0x1E)
|
||||
#define PM8607_SLEEP_MODE4 (0x1F)
|
||||
#define PM8607_GO (0x20)
|
||||
#define PM8607_SLEEP_BUCK1 (0x21)
|
||||
#define PM8607_SLEEP_BUCK2 (0x22)
|
||||
#define PM8607_SLEEP_BUCK3 (0x23)
|
||||
#define PM8607_BUCK1 (0x24)
|
||||
#define PM8607_BUCK2 (0x25)
|
||||
#define PM8607_BUCK3 (0x26)
|
||||
#define PM8607_BUCK_CONTROLS (0x27)
|
||||
#define PM8607_SUPPLIES_EN11 (0x2B)
|
||||
#define PM8607_SUPPLIES_EN12 (0x2C)
|
||||
#define PM8607_GROUP1 (0x2D)
|
||||
#define PM8607_GROUP2 (0x2E)
|
||||
#define PM8607_GROUP3 (0x2F)
|
||||
#define PM8607_GROUP4 (0x30)
|
||||
#define PM8607_GROUP5 (0x31)
|
||||
#define PM8607_GROUP6 (0x32)
|
||||
#define PM8607_SUPPLIES_EN21 (0x33)
|
||||
#define PM8607_SUPPLIES_EN22 (0x34)
|
||||
|
||||
/* RTC Control Registers */
|
||||
#define PM8607_RTC1 (0xA0)
|
||||
#define PM8607_RTC_COUNTER1 (0xA1)
|
||||
#define PM8607_RTC_COUNTER2 (0xA2)
|
||||
#define PM8607_RTC_COUNTER3 (0xA3)
|
||||
#define PM8607_RTC_COUNTER4 (0xA4)
|
||||
#define PM8607_RTC_EXPIRE1 (0xA5)
|
||||
#define PM8607_RTC_EXPIRE2 (0xA6)
|
||||
#define PM8607_RTC_EXPIRE3 (0xA7)
|
||||
#define PM8607_RTC_EXPIRE4 (0xA8)
|
||||
#define PM8607_RTC_TRIM1 (0xA9)
|
||||
#define PM8607_RTC_TRIM2 (0xAA)
|
||||
#define PM8607_RTC_TRIM3 (0xAB)
|
||||
#define PM8607_RTC_TRIM4 (0xAC)
|
||||
#define PM8607_RTC_MISC1 (0xAD)
|
||||
#define PM8607_RTC_MISC2 (0xAE)
|
||||
#define PM8607_RTC_MISC3 (0xAF)
|
||||
|
||||
/* Misc Registers */
|
||||
#define PM8607_CHIP_ID (0x00)
|
||||
#define PM8607_LDO1 (0x10)
|
||||
#define PM8607_DVC3 (0x26)
|
||||
#define PM8607_MISC1 (0x40)
|
||||
|
||||
/* bit definitions for PM8607 events */
|
||||
#define PM8607_EVENT_ONKEY (1 << 0)
|
||||
#define PM8607_EVENT_EXTON (1 << 1)
|
||||
#define PM8607_EVENT_CHG (1 << 2)
|
||||
#define PM8607_EVENT_BAT (1 << 3)
|
||||
#define PM8607_EVENT_RTC (1 << 4)
|
||||
#define PM8607_EVENT_CC (1 << 5)
|
||||
#define PM8607_EVENT_VBAT (1 << 8)
|
||||
#define PM8607_EVENT_VCHG (1 << 9)
|
||||
#define PM8607_EVENT_VSYS (1 << 10)
|
||||
#define PM8607_EVENT_TINT (1 << 11)
|
||||
#define PM8607_EVENT_GPADC0 (1 << 12)
|
||||
#define PM8607_EVENT_GPADC1 (1 << 13)
|
||||
#define PM8607_EVENT_GPADC2 (1 << 14)
|
||||
#define PM8607_EVENT_GPADC3 (1 << 15)
|
||||
#define PM8607_EVENT_AUDIO_SHORT (1 << 16)
|
||||
#define PM8607_EVENT_PEN (1 << 17)
|
||||
#define PM8607_EVENT_HEADSET (1 << 18)
|
||||
#define PM8607_EVENT_HOOK (1 << 19)
|
||||
#define PM8607_EVENT_MICIN (1 << 20)
|
||||
#define PM8607_EVENT_CHG_TIMEOUT (1 << 21)
|
||||
#define PM8607_EVENT_CHG_DONE (1 << 22)
|
||||
#define PM8607_EVENT_CHG_FAULT (1 << 23)
|
||||
|
||||
/* bit definitions of Status Query Interface */
|
||||
#define PM8607_STATUS_CC (1 << 3)
|
||||
#define PM8607_STATUS_PEN (1 << 4)
|
||||
#define PM8607_STATUS_HEADSET (1 << 5)
|
||||
#define PM8607_STATUS_HOOK (1 << 6)
|
||||
#define PM8607_STATUS_MICIN (1 << 7)
|
||||
#define PM8607_STATUS_ONKEY (1 << 8)
|
||||
#define PM8607_STATUS_EXTON (1 << 9)
|
||||
#define PM8607_STATUS_CHG (1 << 10)
|
||||
#define PM8607_STATUS_BAT (1 << 11)
|
||||
#define PM8607_STATUS_VBUS (1 << 12)
|
||||
#define PM8607_STATUS_OV (1 << 13)
|
||||
|
||||
/* bit definitions of BUCK3 */
|
||||
#define PM8607_BUCK3_DOUBLE (1 << 6)
|
||||
|
||||
/* bit definitions of Misc1 */
|
||||
#define PM8607_MISC1_PI2C (1 << 0)
|
||||
|
||||
/* Interrupt Number in 88PM8607 */
|
||||
enum {
|
||||
PM8607_IRQ_ONKEY = 0,
|
||||
PM8607_IRQ_EXTON,
|
||||
PM8607_IRQ_CHG,
|
||||
PM8607_IRQ_BAT,
|
||||
PM8607_IRQ_RTC,
|
||||
PM8607_IRQ_VBAT = 8,
|
||||
PM8607_IRQ_VCHG,
|
||||
PM8607_IRQ_VSYS,
|
||||
PM8607_IRQ_TINT,
|
||||
PM8607_IRQ_GPADC0,
|
||||
PM8607_IRQ_GPADC1,
|
||||
PM8607_IRQ_GPADC2,
|
||||
PM8607_IRQ_GPADC3,
|
||||
PM8607_IRQ_AUDIO_SHORT = 16,
|
||||
PM8607_IRQ_PEN,
|
||||
PM8607_IRQ_HEADSET,
|
||||
PM8607_IRQ_HOOK,
|
||||
PM8607_IRQ_MICIN,
|
||||
PM8607_IRQ_CHG_FAIL,
|
||||
PM8607_IRQ_CHG_DONE,
|
||||
PM8607_IRQ_CHG_FAULT,
|
||||
};
|
||||
|
||||
enum {
|
||||
PM8607_CHIP_A0 = 0x40,
|
||||
PM8607_CHIP_A1 = 0x41,
|
||||
PM8607_CHIP_B0 = 0x48,
|
||||
};
|
||||
|
||||
|
||||
struct pm8607_chip {
|
||||
struct device *dev;
|
||||
struct mutex io_lock;
|
||||
struct i2c_client *client;
|
||||
|
||||
int (*read)(struct pm8607_chip *chip, int reg, int bytes, void *dest);
|
||||
int (*write)(struct pm8607_chip *chip, int reg, int bytes, void *src);
|
||||
|
||||
int buck3_double; /* DVC ramp slope double */
|
||||
unsigned char chip_id;
|
||||
|
||||
};
|
||||
|
||||
#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */
|
||||
|
||||
enum {
|
||||
GI2C_PORT = 0,
|
||||
PI2C_PORT,
|
||||
};
|
||||
|
||||
struct pm8607_platform_data {
|
||||
int i2c_port; /* Controlled by GI2C or PI2C */
|
||||
struct regulator_init_data *regulator[PM8607_MAX_REGULATOR];
|
||||
};
|
||||
|
||||
extern int pm8607_reg_read(struct pm8607_chip *, int);
|
||||
extern int pm8607_reg_write(struct pm8607_chip *, int, unsigned char);
|
||||
extern int pm8607_bulk_read(struct pm8607_chip *, int, int,
|
||||
unsigned char *);
|
||||
extern int pm8607_bulk_write(struct pm8607_chip *, int, int,
|
||||
unsigned char *);
|
||||
extern int pm8607_set_bits(struct pm8607_chip *, int, unsigned char,
|
||||
unsigned char);
|
||||
#endif /* __LINUX_MFD_88PM8607_H */
|
||||
375
include/linux/mfd/88pm860x.h
Normal file
375
include/linux/mfd/88pm860x.h
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
/*
|
||||
* Marvell 88PM860x Interface
|
||||
*
|
||||
* Copyright (C) 2009 Marvell International Ltd.
|
||||
* Haojian Zhuang <haojian.zhuang@marvell.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 __LINUX_MFD_88PM860X_H
|
||||
#define __LINUX_MFD_88PM860X_H
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#define MFD_NAME_SIZE (40)
|
||||
|
||||
enum {
|
||||
CHIP_INVALID = 0,
|
||||
CHIP_PM8606,
|
||||
CHIP_PM8607,
|
||||
CHIP_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
PM8606_ID_INVALID,
|
||||
PM8606_ID_BACKLIGHT,
|
||||
PM8606_ID_LED,
|
||||
PM8606_ID_VIBRATOR,
|
||||
PM8606_ID_TOUCH,
|
||||
PM8606_ID_SOUND,
|
||||
PM8606_ID_CHARGER,
|
||||
PM8606_ID_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
PM8606_BACKLIGHT1 = 0,
|
||||
PM8606_BACKLIGHT2,
|
||||
PM8606_BACKLIGHT3,
|
||||
};
|
||||
|
||||
enum {
|
||||
PM8606_LED1_RED = 0,
|
||||
PM8606_LED1_GREEN,
|
||||
PM8606_LED1_BLUE,
|
||||
PM8606_LED2_RED,
|
||||
PM8606_LED2_GREEN,
|
||||
PM8606_LED2_BLUE,
|
||||
PM8607_LED_VIBRATOR,
|
||||
};
|
||||
|
||||
|
||||
/* 8606 Registers */
|
||||
#define PM8606_DCM_BOOST (0x00)
|
||||
#define PM8606_PWM (0x01)
|
||||
|
||||
/* Backlight Registers */
|
||||
#define PM8606_WLED1A (0x02)
|
||||
#define PM8606_WLED1B (0x03)
|
||||
#define PM8606_WLED2A (0x04)
|
||||
#define PM8606_WLED2B (0x05)
|
||||
#define PM8606_WLED3A (0x06)
|
||||
#define PM8606_WLED3B (0x07)
|
||||
|
||||
/* LED Registers */
|
||||
#define PM8606_RGB2A (0x08)
|
||||
#define PM8606_RGB2B (0x09)
|
||||
#define PM8606_RGB2C (0x0A)
|
||||
#define PM8606_RGB2D (0x0B)
|
||||
#define PM8606_RGB1A (0x0C)
|
||||
#define PM8606_RGB1B (0x0D)
|
||||
#define PM8606_RGB1C (0x0E)
|
||||
#define PM8606_RGB1D (0x0F)
|
||||
|
||||
#define PM8606_PREREGULATORA (0x10)
|
||||
#define PM8606_PREREGULATORB (0x11)
|
||||
#define PM8606_VIBRATORA (0x12)
|
||||
#define PM8606_VIBRATORB (0x13)
|
||||
#define PM8606_VCHG (0x14)
|
||||
#define PM8606_VSYS (0x15)
|
||||
#define PM8606_MISC (0x16)
|
||||
#define PM8606_CHIP_ID (0x17)
|
||||
#define PM8606_STATUS (0x18)
|
||||
#define PM8606_FLAGS (0x19)
|
||||
#define PM8606_PROTECTA (0x1A)
|
||||
#define PM8606_PROTECTB (0x1B)
|
||||
#define PM8606_PROTECTC (0x1C)
|
||||
|
||||
/* Bit definitions of PM8606 registers */
|
||||
#define PM8606_DCM_500MA (0x0) /* current limit */
|
||||
#define PM8606_DCM_750MA (0x1)
|
||||
#define PM8606_DCM_1000MA (0x2)
|
||||
#define PM8606_DCM_1250MA (0x3)
|
||||
#define PM8606_DCM_250MV (0x0 << 2)
|
||||
#define PM8606_DCM_300MV (0x1 << 2)
|
||||
#define PM8606_DCM_350MV (0x2 << 2)
|
||||
#define PM8606_DCM_400MV (0x3 << 2)
|
||||
|
||||
#define PM8606_PWM_31200HZ (0x0)
|
||||
#define PM8606_PWM_15600HZ (0x1)
|
||||
#define PM8606_PWM_7800HZ (0x2)
|
||||
#define PM8606_PWM_3900HZ (0x3)
|
||||
#define PM8606_PWM_1950HZ (0x4)
|
||||
#define PM8606_PWM_976HZ (0x5)
|
||||
#define PM8606_PWM_488HZ (0x6)
|
||||
#define PM8606_PWM_244HZ (0x7)
|
||||
#define PM8606_PWM_FREQ_MASK (0x7)
|
||||
|
||||
#define PM8606_WLED_ON (1 << 0)
|
||||
#define PM8606_WLED_CURRENT(x) ((x & 0x1F) << 1)
|
||||
|
||||
#define PM8606_LED_CURRENT(x) (((x >> 2) & 0x07) << 5)
|
||||
|
||||
#define PM8606_VSYS_EN (1 << 1)
|
||||
|
||||
#define PM8606_MISC_OSC_EN (1 << 4)
|
||||
|
||||
enum {
|
||||
PM8607_ID_BUCK1 = 0,
|
||||
PM8607_ID_BUCK2,
|
||||
PM8607_ID_BUCK3,
|
||||
|
||||
PM8607_ID_LDO1,
|
||||
PM8607_ID_LDO2,
|
||||
PM8607_ID_LDO3,
|
||||
PM8607_ID_LDO4,
|
||||
PM8607_ID_LDO5,
|
||||
PM8607_ID_LDO6,
|
||||
PM8607_ID_LDO7,
|
||||
PM8607_ID_LDO8,
|
||||
PM8607_ID_LDO9,
|
||||
PM8607_ID_LDO10,
|
||||
PM8607_ID_LDO12,
|
||||
PM8607_ID_LDO14,
|
||||
|
||||
PM8607_ID_RG_MAX,
|
||||
};
|
||||
|
||||
#define PM8607_VERSION (0x40) /* 8607 chip ID */
|
||||
#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */
|
||||
|
||||
/* Interrupt Registers */
|
||||
#define PM8607_STATUS_1 (0x01)
|
||||
#define PM8607_STATUS_2 (0x02)
|
||||
#define PM8607_INT_STATUS1 (0x03)
|
||||
#define PM8607_INT_STATUS2 (0x04)
|
||||
#define PM8607_INT_STATUS3 (0x05)
|
||||
#define PM8607_INT_MASK_1 (0x06)
|
||||
#define PM8607_INT_MASK_2 (0x07)
|
||||
#define PM8607_INT_MASK_3 (0x08)
|
||||
|
||||
/* Regulator Control Registers */
|
||||
#define PM8607_LDO1 (0x10)
|
||||
#define PM8607_LDO2 (0x11)
|
||||
#define PM8607_LDO3 (0x12)
|
||||
#define PM8607_LDO4 (0x13)
|
||||
#define PM8607_LDO5 (0x14)
|
||||
#define PM8607_LDO6 (0x15)
|
||||
#define PM8607_LDO7 (0x16)
|
||||
#define PM8607_LDO8 (0x17)
|
||||
#define PM8607_LDO9 (0x18)
|
||||
#define PM8607_LDO10 (0x19)
|
||||
#define PM8607_LDO12 (0x1A)
|
||||
#define PM8607_LDO14 (0x1B)
|
||||
#define PM8607_SLEEP_MODE1 (0x1C)
|
||||
#define PM8607_SLEEP_MODE2 (0x1D)
|
||||
#define PM8607_SLEEP_MODE3 (0x1E)
|
||||
#define PM8607_SLEEP_MODE4 (0x1F)
|
||||
#define PM8607_GO (0x20)
|
||||
#define PM8607_SLEEP_BUCK1 (0x21)
|
||||
#define PM8607_SLEEP_BUCK2 (0x22)
|
||||
#define PM8607_SLEEP_BUCK3 (0x23)
|
||||
#define PM8607_BUCK1 (0x24)
|
||||
#define PM8607_BUCK2 (0x25)
|
||||
#define PM8607_BUCK3 (0x26)
|
||||
#define PM8607_BUCK_CONTROLS (0x27)
|
||||
#define PM8607_SUPPLIES_EN11 (0x2B)
|
||||
#define PM8607_SUPPLIES_EN12 (0x2C)
|
||||
#define PM8607_GROUP1 (0x2D)
|
||||
#define PM8607_GROUP2 (0x2E)
|
||||
#define PM8607_GROUP3 (0x2F)
|
||||
#define PM8607_GROUP4 (0x30)
|
||||
#define PM8607_GROUP5 (0x31)
|
||||
#define PM8607_GROUP6 (0x32)
|
||||
#define PM8607_SUPPLIES_EN21 (0x33)
|
||||
#define PM8607_SUPPLIES_EN22 (0x34)
|
||||
|
||||
/* Vibrator Control Registers */
|
||||
#define PM8607_VIBRATOR_SET (0x28)
|
||||
#define PM8607_VIBRATOR_PWM (0x29)
|
||||
|
||||
/* GPADC Registers */
|
||||
#define PM8607_GP_BIAS1 (0x4F)
|
||||
#define PM8607_MEAS_EN1 (0x50)
|
||||
#define PM8607_MEAS_EN2 (0x51)
|
||||
#define PM8607_MEAS_EN3 (0x52)
|
||||
#define PM8607_MEAS_OFF_TIME1 (0x53)
|
||||
#define PM8607_MEAS_OFF_TIME2 (0x54)
|
||||
#define PM8607_TSI_PREBIAS (0x55) /* prebias time */
|
||||
#define PM8607_PD_PREBIAS (0x56) /* prebias time */
|
||||
#define PM8607_GPADC_MISC1 (0x57)
|
||||
|
||||
/* RTC Control Registers */
|
||||
#define PM8607_RTC1 (0xA0)
|
||||
#define PM8607_RTC_COUNTER1 (0xA1)
|
||||
#define PM8607_RTC_COUNTER2 (0xA2)
|
||||
#define PM8607_RTC_COUNTER3 (0xA3)
|
||||
#define PM8607_RTC_COUNTER4 (0xA4)
|
||||
#define PM8607_RTC_EXPIRE1 (0xA5)
|
||||
#define PM8607_RTC_EXPIRE2 (0xA6)
|
||||
#define PM8607_RTC_EXPIRE3 (0xA7)
|
||||
#define PM8607_RTC_EXPIRE4 (0xA8)
|
||||
#define PM8607_RTC_TRIM1 (0xA9)
|
||||
#define PM8607_RTC_TRIM2 (0xAA)
|
||||
#define PM8607_RTC_TRIM3 (0xAB)
|
||||
#define PM8607_RTC_TRIM4 (0xAC)
|
||||
#define PM8607_RTC_MISC1 (0xAD)
|
||||
#define PM8607_RTC_MISC2 (0xAE)
|
||||
#define PM8607_RTC_MISC3 (0xAF)
|
||||
|
||||
/* Misc Registers */
|
||||
#define PM8607_CHIP_ID (0x00)
|
||||
#define PM8607_B0_MISC1 (0x0C)
|
||||
#define PM8607_LDO1 (0x10)
|
||||
#define PM8607_DVC3 (0x26)
|
||||
#define PM8607_A1_MISC1 (0x40)
|
||||
|
||||
/* bit definitions of Status Query Interface */
|
||||
#define PM8607_STATUS_CC (1 << 3)
|
||||
#define PM8607_STATUS_PEN (1 << 4)
|
||||
#define PM8607_STATUS_HEADSET (1 << 5)
|
||||
#define PM8607_STATUS_HOOK (1 << 6)
|
||||
#define PM8607_STATUS_MICIN (1 << 7)
|
||||
#define PM8607_STATUS_ONKEY (1 << 8)
|
||||
#define PM8607_STATUS_EXTON (1 << 9)
|
||||
#define PM8607_STATUS_CHG (1 << 10)
|
||||
#define PM8607_STATUS_BAT (1 << 11)
|
||||
#define PM8607_STATUS_VBUS (1 << 12)
|
||||
#define PM8607_STATUS_OV (1 << 13)
|
||||
|
||||
/* bit definitions of BUCK3 */
|
||||
#define PM8607_BUCK3_DOUBLE (1 << 6)
|
||||
|
||||
/* bit definitions of Misc1 */
|
||||
#define PM8607_A1_MISC1_PI2C (1 << 0)
|
||||
#define PM8607_B0_MISC1_INV_INT (1 << 0)
|
||||
#define PM8607_B0_MISC1_INT_CLEAR (1 << 1)
|
||||
#define PM8607_B0_MISC1_INT_MASK (1 << 2)
|
||||
#define PM8607_B0_MISC1_PI2C (1 << 3)
|
||||
#define PM8607_B0_MISC1_RESET (1 << 6)
|
||||
|
||||
/* bits definitions of GPADC */
|
||||
#define PM8607_GPADC_EN (1 << 0)
|
||||
#define PM8607_GPADC_PREBIAS_MASK (3 << 1)
|
||||
#define PM8607_GPADC_SLOT_CYCLE_MASK (3 << 3) /* slow mode */
|
||||
#define PM8607_GPADC_OFF_SCALE_MASK (3 << 5) /* GP sleep mode */
|
||||
#define PM8607_GPADC_SW_CAL_MASK (1 << 7)
|
||||
|
||||
#define PM8607_PD_PREBIAS_MASK (0x1F << 0)
|
||||
#define PM8607_PD_PRECHG_MASK (7 << 5)
|
||||
|
||||
/* Interrupt Number in 88PM8607 */
|
||||
enum {
|
||||
PM8607_IRQ_ONKEY,
|
||||
PM8607_IRQ_EXTON,
|
||||
PM8607_IRQ_CHG,
|
||||
PM8607_IRQ_BAT,
|
||||
PM8607_IRQ_RTC,
|
||||
PM8607_IRQ_CC,
|
||||
PM8607_IRQ_VBAT,
|
||||
PM8607_IRQ_VCHG,
|
||||
PM8607_IRQ_VSYS,
|
||||
PM8607_IRQ_TINT,
|
||||
PM8607_IRQ_GPADC0,
|
||||
PM8607_IRQ_GPADC1,
|
||||
PM8607_IRQ_GPADC2,
|
||||
PM8607_IRQ_GPADC3,
|
||||
PM8607_IRQ_AUDIO_SHORT,
|
||||
PM8607_IRQ_PEN,
|
||||
PM8607_IRQ_HEADSET,
|
||||
PM8607_IRQ_HOOK,
|
||||
PM8607_IRQ_MICIN,
|
||||
PM8607_IRQ_CHG_FAIL,
|
||||
PM8607_IRQ_CHG_DONE,
|
||||
PM8607_IRQ_CHG_FAULT,
|
||||
};
|
||||
|
||||
enum {
|
||||
PM8607_CHIP_A0 = 0x40,
|
||||
PM8607_CHIP_A1 = 0x41,
|
||||
PM8607_CHIP_B0 = 0x48,
|
||||
};
|
||||
|
||||
struct pm860x_chip {
|
||||
struct device *dev;
|
||||
struct mutex io_lock;
|
||||
struct mutex irq_lock;
|
||||
struct i2c_client *client;
|
||||
struct i2c_client *companion; /* companion chip client */
|
||||
|
||||
int buck3_double; /* DVC ramp slope double */
|
||||
unsigned short companion_addr;
|
||||
int id;
|
||||
int irq_mode;
|
||||
int irq_base;
|
||||
int core_irq;
|
||||
unsigned char chip_version;
|
||||
|
||||
};
|
||||
|
||||
#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */
|
||||
|
||||
enum {
|
||||
GI2C_PORT = 0,
|
||||
PI2C_PORT,
|
||||
};
|
||||
|
||||
struct pm860x_backlight_pdata {
|
||||
int id;
|
||||
int pwm;
|
||||
int iset;
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
struct pm860x_led_pdata {
|
||||
int id;
|
||||
int iset;
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
struct pm860x_touch_pdata {
|
||||
int gpadc_prebias;
|
||||
int slot_cycle;
|
||||
int off_scale;
|
||||
int sw_cal;
|
||||
int tsi_prebias; /* time, slot */
|
||||
int pen_prebias; /* time, slot */
|
||||
int pen_prechg; /* time, slot */
|
||||
int res_x; /* resistor of Xplate */
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
struct pm860x_power_pdata {
|
||||
unsigned fast_charge; /* charge current */
|
||||
};
|
||||
|
||||
struct pm860x_platform_data {
|
||||
struct pm860x_backlight_pdata *backlight;
|
||||
struct pm860x_led_pdata *led;
|
||||
struct pm860x_touch_pdata *touch;
|
||||
struct pm860x_power_pdata *power;
|
||||
|
||||
unsigned short companion_addr; /* I2C address of companion chip */
|
||||
int i2c_port; /* Controlled by GI2C or PI2C */
|
||||
int irq_mode; /* Clear interrupt by read/write(0/1) */
|
||||
int irq_base; /* IRQ base number of 88pm860x */
|
||||
struct regulator_init_data *regulator[PM8607_MAX_REGULATOR];
|
||||
};
|
||||
|
||||
extern char pm860x_backlight_name[][MFD_NAME_SIZE];
|
||||
extern char pm860x_led_name[][MFD_NAME_SIZE];
|
||||
|
||||
extern int pm860x_reg_read(struct i2c_client *, int);
|
||||
extern int pm860x_reg_write(struct i2c_client *, int, unsigned char);
|
||||
extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *);
|
||||
extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *);
|
||||
extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
|
||||
unsigned char);
|
||||
|
||||
extern int pm860x_device_init(struct pm860x_chip *chip,
|
||||
struct pm860x_platform_data *pdata);
|
||||
extern void pm860x_device_exit(struct pm860x_chip *chip);
|
||||
|
||||
#endif /* __LINUX_MFD_88PM860X_H */
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
|
||||
#ifndef MFD_AB3100_H
|
||||
|
|
@ -74,7 +73,6 @@
|
|||
* @testreg_client: secondary client for test registers
|
||||
* @chip_name: name of this chip variant
|
||||
* @chip_id: 8 bit chip ID for this chip variant
|
||||
* @work: an event handling worker
|
||||
* @event_subscribers: event subscribers are listed here
|
||||
* @startup_events: a copy of the first reading of the event registers
|
||||
* @startup_events_read: whether the first events have been read
|
||||
|
|
@ -90,7 +88,6 @@ struct ab3100 {
|
|||
struct i2c_client *testreg_client;
|
||||
char chip_name[32];
|
||||
u8 chip_id;
|
||||
struct work_struct work;
|
||||
struct blocking_notifier_head event_subscribers;
|
||||
u32 startup_events;
|
||||
bool startup_events_read;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue