Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
This commit is contained in:
@@ -381,7 +381,7 @@ struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
|
||||
int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
|
||||
int acpi_disable_wakeup_device_power(struct acpi_device *dev);
|
||||
|
||||
#ifdef CONFIG_PM_OPS
|
||||
#ifdef CONFIG_PM
|
||||
int acpi_pm_device_sleep_state(struct device *, int *);
|
||||
#else
|
||||
static inline int acpi_pm_device_sleep_state(struct device *d, int *p)
|
||||
|
||||
@@ -30,6 +30,9 @@ typedef u64 cputime64_t;
|
||||
#define cputime64_to_jiffies64(__ct) (__ct)
|
||||
#define jiffies64_to_cputime64(__jif) (__jif)
|
||||
#define cputime_to_cputime64(__ct) ((u64) __ct)
|
||||
#define cputime64_gt(__a, __b) ((__a) > (__b))
|
||||
|
||||
#define nsecs_to_cputime64(__ct) nsecs_to_jiffies64(__ct)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -80,6 +80,10 @@
|
||||
#define O_SYNC (__O_SYNC|O_DSYNC)
|
||||
#endif
|
||||
|
||||
#ifndef O_PATH
|
||||
#define O_PATH 010000000
|
||||
#endif
|
||||
|
||||
#ifndef O_NDELAY
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <asm/errno.h>
|
||||
|
||||
static inline int
|
||||
futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
|
||||
{
|
||||
int op = (encoded_op >> 28) & 7;
|
||||
int cmp = (encoded_op >> 24) & 15;
|
||||
@@ -16,7 +16,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
|
||||
oparg = 1 << oparg;
|
||||
|
||||
if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
|
||||
if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
pagefault_disable();
|
||||
@@ -48,7 +48,8 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
|
||||
}
|
||||
|
||||
static inline int
|
||||
futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
|
||||
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
|
||||
u32 oldval, u32 newval)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
#define TCSETXF 0x5434
|
||||
#define TCSETXW 0x5435
|
||||
#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */
|
||||
#define TIOCVHANGUP 0x5437
|
||||
|
||||
#define FIONCLEX 0x5450
|
||||
#define FIOCLEX 0x5451
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef CONFIG_MMU
|
||||
|
||||
#include <linux/mm_types.h>
|
||||
|
||||
#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
|
||||
extern int ptep_set_access_flags(struct vm_area_struct *vma,
|
||||
unsigned long address, pte_t *ptep,
|
||||
|
||||
@@ -11,6 +11,7 @@ extern char _sinittext[], _einittext[];
|
||||
extern char _end[];
|
||||
extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
|
||||
extern char __kprobes_text_start[], __kprobes_text_end[];
|
||||
extern char __entry_text_start[], __entry_text_end[];
|
||||
extern char __initdata_begin[], __initdata_end[];
|
||||
extern char __start_rodata[], __end_rodata[];
|
||||
|
||||
|
||||
@@ -646,9 +646,13 @@ __SYSCALL(__NR_prlimit64, sys_prlimit64)
|
||||
__SYSCALL(__NR_fanotify_init, sys_fanotify_init)
|
||||
#define __NR_fanotify_mark 263
|
||||
__SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
|
||||
#define __NR_name_to_handle_at 264
|
||||
__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
|
||||
#define __NR_open_by_handle_at 265
|
||||
__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at)
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls 264
|
||||
#define __NR_syscalls 266
|
||||
|
||||
/*
|
||||
* All syscalls below here should go away really,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* HEAD_TEXT_SECTION
|
||||
* INIT_TEXT_SECTION(PAGE_SIZE)
|
||||
* INIT_DATA_SECTION(...)
|
||||
* PERCPU(PAGE_SIZE)
|
||||
* PERCPU(CACHELINE_SIZE, PAGE_SIZE)
|
||||
* __init_end = .;
|
||||
*
|
||||
* _stext = .;
|
||||
@@ -424,6 +424,12 @@
|
||||
*(.kprobes.text) \
|
||||
VMLINUX_SYMBOL(__kprobes_text_end) = .;
|
||||
|
||||
#define ENTRY_TEXT \
|
||||
ALIGN_FUNCTION(); \
|
||||
VMLINUX_SYMBOL(__entry_text_start) = .; \
|
||||
*(.entry.text) \
|
||||
VMLINUX_SYMBOL(__entry_text_end) = .;
|
||||
|
||||
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
||||
#define IRQENTRY_TEXT \
|
||||
ALIGN_FUNCTION(); \
|
||||
@@ -683,13 +689,18 @@
|
||||
|
||||
/**
|
||||
* PERCPU_VADDR - define output section for percpu area
|
||||
* @cacheline: cacheline size
|
||||
* @vaddr: explicit base address (optional)
|
||||
* @phdr: destination PHDR (optional)
|
||||
*
|
||||
* Macro which expands to output section for percpu area. If @vaddr
|
||||
* is not blank, it specifies explicit base address and all percpu
|
||||
* symbols will be offset from the given address. If blank, @vaddr
|
||||
* always equals @laddr + LOAD_OFFSET.
|
||||
* Macro which expands to output section for percpu area.
|
||||
*
|
||||
* @cacheline is used to align subsections to avoid false cacheline
|
||||
* sharing between subsections for different purposes.
|
||||
*
|
||||
* If @vaddr is not blank, it specifies explicit base address and all
|
||||
* percpu symbols will be offset from the given address. If blank,
|
||||
* @vaddr always equals @laddr + LOAD_OFFSET.
|
||||
*
|
||||
* @phdr defines the output PHDR to use if not blank. Be warned that
|
||||
* output PHDR is sticky. If @phdr is specified, the next output
|
||||
@@ -700,7 +711,7 @@
|
||||
* If there is no need to put the percpu section at a predetermined
|
||||
* address, use PERCPU().
|
||||
*/
|
||||
#define PERCPU_VADDR(vaddr, phdr) \
|
||||
#define PERCPU_VADDR(cacheline, vaddr, phdr) \
|
||||
VMLINUX_SYMBOL(__per_cpu_load) = .; \
|
||||
.data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
|
||||
- LOAD_OFFSET) { \
|
||||
@@ -708,7 +719,9 @@
|
||||
*(.data..percpu..first) \
|
||||
. = ALIGN(PAGE_SIZE); \
|
||||
*(.data..percpu..page_aligned) \
|
||||
. = ALIGN(cacheline); \
|
||||
*(.data..percpu..readmostly) \
|
||||
. = ALIGN(cacheline); \
|
||||
*(.data..percpu) \
|
||||
*(.data..percpu..shared_aligned) \
|
||||
VMLINUX_SYMBOL(__per_cpu_end) = .; \
|
||||
@@ -717,18 +730,18 @@
|
||||
|
||||
/**
|
||||
* PERCPU - define output section for percpu area, simple version
|
||||
* @cacheline: cacheline size
|
||||
* @align: required alignment
|
||||
*
|
||||
* Align to @align and outputs output section for percpu area. This
|
||||
* macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and
|
||||
* Align to @align and outputs output section for percpu area. This macro
|
||||
* doesn't manipulate @vaddr or @phdr and __per_cpu_load and
|
||||
* __per_cpu_start will be identical.
|
||||
*
|
||||
* This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
|
||||
* that __per_cpu_load is defined as a relative symbol against
|
||||
* .data..percpu which is required for relocatable x86_32
|
||||
* configuration.
|
||||
* This macro is equivalent to ALIGN(@align); PERCPU_VADDR(@cacheline,,)
|
||||
* except that __per_cpu_load is defined as a relative symbol against
|
||||
* .data..percpu which is required for relocatable x86_32 configuration.
|
||||
*/
|
||||
#define PERCPU(align) \
|
||||
#define PERCPU(cacheline, align) \
|
||||
. = ALIGN(align); \
|
||||
.data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \
|
||||
VMLINUX_SYMBOL(__per_cpu_load) = .; \
|
||||
@@ -736,7 +749,9 @@
|
||||
*(.data..percpu..first) \
|
||||
. = ALIGN(PAGE_SIZE); \
|
||||
*(.data..percpu..page_aligned) \
|
||||
. = ALIGN(cacheline); \
|
||||
*(.data..percpu..readmostly) \
|
||||
. = ALIGN(cacheline); \
|
||||
*(.data..percpu) \
|
||||
*(.data..percpu..shared_aligned) \
|
||||
VMLINUX_SYMBOL(__per_cpu_end) = .; \
|
||||
|
||||
+1
-1
@@ -1101,7 +1101,7 @@ struct drm_device {
|
||||
struct platform_device *platformdev; /**< Platform device struture */
|
||||
|
||||
struct drm_sg_mem *sg; /**< Scatter gather memory */
|
||||
int num_crtcs; /**< Number of CRTCs on this device */
|
||||
unsigned int num_crtcs; /**< Number of CRTCs on this device */
|
||||
void *dev_private; /**< device private data */
|
||||
void *mm_private;
|
||||
struct address_space *dev_mapping;
|
||||
|
||||
@@ -99,7 +99,6 @@ struct rxrpc_key_token {
|
||||
* structure of raw payloads passed to add_key() or instantiate key
|
||||
*/
|
||||
struct rxrpc_key_data_v1 {
|
||||
u32 kif_version; /* 1 */
|
||||
u16 security_index;
|
||||
u16 ticket_length;
|
||||
u32 expiry; /* time_t */
|
||||
|
||||
+82
-81
@@ -89,6 +89,7 @@ enum {
|
||||
ATA_ID_SPG = 98,
|
||||
ATA_ID_LBA_CAPACITY_2 = 100,
|
||||
ATA_ID_SECTOR_SIZE = 106,
|
||||
ATA_ID_WWN = 108,
|
||||
ATA_ID_LOGICAL_SECTOR_SIZE = 117, /* and 118 */
|
||||
ATA_ID_LAST_LUN = 126,
|
||||
ATA_ID_DLF = 128,
|
||||
@@ -103,6 +104,7 @@ enum {
|
||||
ATA_ID_SERNO_LEN = 20,
|
||||
ATA_ID_FW_REV_LEN = 8,
|
||||
ATA_ID_PROD_LEN = 40,
|
||||
ATA_ID_WWN_LEN = 8,
|
||||
|
||||
ATA_PCI_CTL_OFS = 2,
|
||||
|
||||
@@ -598,42 +600,42 @@ static inline bool ata_id_has_dipm(const u16 *id)
|
||||
}
|
||||
|
||||
|
||||
static inline int ata_id_has_fua(const u16 *id)
|
||||
static inline bool ata_id_has_fua(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_CFSSE] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_CFSSE] & (1 << 6);
|
||||
}
|
||||
|
||||
static inline int ata_id_has_flush(const u16 *id)
|
||||
static inline bool ata_id_has_flush(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_COMMAND_SET_2] & (1 << 12);
|
||||
}
|
||||
|
||||
static inline int ata_id_flush_enabled(const u16 *id)
|
||||
static inline bool ata_id_flush_enabled(const u16 *id)
|
||||
{
|
||||
if (ata_id_has_flush(id) == 0)
|
||||
return 0;
|
||||
return false;
|
||||
if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_CFS_ENABLE_2] & (1 << 12);
|
||||
}
|
||||
|
||||
static inline int ata_id_has_flush_ext(const u16 *id)
|
||||
static inline bool ata_id_has_flush_ext(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_COMMAND_SET_2] & (1 << 13);
|
||||
}
|
||||
|
||||
static inline int ata_id_flush_ext_enabled(const u16 *id)
|
||||
static inline bool ata_id_flush_ext_enabled(const u16 *id)
|
||||
{
|
||||
if (ata_id_has_flush_ext(id) == 0)
|
||||
return 0;
|
||||
return false;
|
||||
if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
/*
|
||||
* some Maxtor disks have bit 13 defined incorrectly
|
||||
* so check bit 10 too
|
||||
@@ -686,64 +688,64 @@ static inline u16 ata_id_logical_sector_offset(const u16 *id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ata_id_has_lba48(const u16 *id)
|
||||
static inline bool ata_id_has_lba48(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
if (!ata_id_u64(id, ATA_ID_LBA_CAPACITY_2))
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_COMMAND_SET_2] & (1 << 10);
|
||||
}
|
||||
|
||||
static inline int ata_id_lba48_enabled(const u16 *id)
|
||||
static inline bool ata_id_lba48_enabled(const u16 *id)
|
||||
{
|
||||
if (ata_id_has_lba48(id) == 0)
|
||||
return 0;
|
||||
return false;
|
||||
if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_CFS_ENABLE_2] & (1 << 10);
|
||||
}
|
||||
|
||||
static inline int ata_id_hpa_enabled(const u16 *id)
|
||||
static inline bool ata_id_hpa_enabled(const u16 *id)
|
||||
{
|
||||
/* Yes children, word 83 valid bits cover word 82 data */
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
/* And 87 covers 85-87 */
|
||||
if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
/* Check command sets enabled as well as supported */
|
||||
if ((id[ATA_ID_CFS_ENABLE_1] & (1 << 10)) == 0)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_COMMAND_SET_1] & (1 << 10);
|
||||
}
|
||||
|
||||
static inline int ata_id_has_wcache(const u16 *id)
|
||||
static inline bool ata_id_has_wcache(const u16 *id)
|
||||
{
|
||||
/* Yes children, word 83 valid bits cover word 82 data */
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_COMMAND_SET_1] & (1 << 5);
|
||||
}
|
||||
|
||||
static inline int ata_id_has_pm(const u16 *id)
|
||||
static inline bool ata_id_has_pm(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_COMMAND_SET_1] & (1 << 3);
|
||||
}
|
||||
|
||||
static inline int ata_id_rahead_enabled(const u16 *id)
|
||||
static inline bool ata_id_rahead_enabled(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_CFS_ENABLE_1] & (1 << 6);
|
||||
}
|
||||
|
||||
static inline int ata_id_wcache_enabled(const u16 *id)
|
||||
static inline bool ata_id_wcache_enabled(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_CFS_ENABLE_1] & (1 << 5);
|
||||
}
|
||||
|
||||
@@ -773,7 +775,7 @@ static inline unsigned int ata_id_major_version(const u16 *id)
|
||||
return mver;
|
||||
}
|
||||
|
||||
static inline int ata_id_is_sata(const u16 *id)
|
||||
static inline bool ata_id_is_sata(const u16 *id)
|
||||
{
|
||||
/*
|
||||
* See if word 93 is 0 AND drive is at least ATA-5 compatible
|
||||
@@ -782,37 +784,40 @@ static inline int ata_id_is_sata(const u16 *id)
|
||||
* 0x0000 and 0xffff along with the earlier ATA revisions...
|
||||
*/
|
||||
if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020)
|
||||
return 1;
|
||||
return 0;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int ata_id_has_tpm(const u16 *id)
|
||||
static inline bool ata_id_has_tpm(const u16 *id)
|
||||
{
|
||||
/* The TPM bits are only valid on ATA8 */
|
||||
if (ata_id_major_version(id) < 8)
|
||||
return 0;
|
||||
return false;
|
||||
if ((id[48] & 0xC000) != 0x4000)
|
||||
return 0;
|
||||
return false;
|
||||
return id[48] & (1 << 0);
|
||||
}
|
||||
|
||||
static inline int ata_id_has_dword_io(const u16 *id)
|
||||
static inline bool ata_id_has_dword_io(const u16 *id)
|
||||
{
|
||||
/* ATA 8 reuses this flag for "trusted" computing */
|
||||
if (ata_id_major_version(id) > 7)
|
||||
return 0;
|
||||
if (id[ATA_ID_DWORD_IO] & (1 << 0))
|
||||
return 1;
|
||||
return 0;
|
||||
return false;
|
||||
return id[ATA_ID_DWORD_IO] & (1 << 0);
|
||||
}
|
||||
|
||||
static inline int ata_id_has_unload(const u16 *id)
|
||||
static inline bool ata_id_has_unload(const u16 *id)
|
||||
{
|
||||
if (ata_id_major_version(id) >= 7 &&
|
||||
(id[ATA_ID_CFSSE] & 0xC000) == 0x4000 &&
|
||||
id[ATA_ID_CFSSE] & (1 << 13))
|
||||
return 1;
|
||||
return 0;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool ata_id_has_wwn(const u16 *id)
|
||||
{
|
||||
return (id[ATA_ID_CSF_DEFAULT] & 0xC100) == 0x4100;
|
||||
}
|
||||
|
||||
static inline int ata_id_form_factor(const u16 *id)
|
||||
@@ -843,25 +848,25 @@ static inline int ata_id_rotation_rate(const u16 *id)
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline int ata_id_has_trim(const u16 *id)
|
||||
static inline bool ata_id_has_trim(const u16 *id)
|
||||
{
|
||||
if (ata_id_major_version(id) >= 7 &&
|
||||
(id[ATA_ID_DATA_SET_MGMT] & 1))
|
||||
return 1;
|
||||
return 0;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int ata_id_has_zero_after_trim(const u16 *id)
|
||||
static inline bool ata_id_has_zero_after_trim(const u16 *id)
|
||||
{
|
||||
/* DSM supported, deterministic read, and read zero after trim set */
|
||||
if (ata_id_has_trim(id) &&
|
||||
(id[ATA_ID_ADDITIONAL_SUPP] & 0x4020) == 0x4020)
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int ata_id_current_chs_valid(const u16 *id)
|
||||
static inline bool ata_id_current_chs_valid(const u16 *id)
|
||||
{
|
||||
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
|
||||
has not been issued to the device then the values of
|
||||
@@ -873,11 +878,11 @@ static inline int ata_id_current_chs_valid(const u16 *id)
|
||||
id[ATA_ID_CUR_SECTORS]; /* sectors in current translation */
|
||||
}
|
||||
|
||||
static inline int ata_id_is_cfa(const u16 *id)
|
||||
static inline bool ata_id_is_cfa(const u16 *id)
|
||||
{
|
||||
if ((id[ATA_ID_CONFIG] == 0x848A) || /* Traditional CF */
|
||||
(id[ATA_ID_CONFIG] == 0x844A)) /* Delkin Devices CF */
|
||||
return 1;
|
||||
return true;
|
||||
/*
|
||||
* CF specs don't require specific value in the word 0 anymore and yet
|
||||
* they forbid to report the ATA version in the word 80 and require the
|
||||
@@ -886,44 +891,40 @@ static inline int ata_id_is_cfa(const u16 *id)
|
||||
* and while those that don't indicate CFA feature support need some
|
||||
* sort of quirk list, it seems impractical for the ones that do...
|
||||
*/
|
||||
if ((id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004)
|
||||
return 1;
|
||||
return 0;
|
||||
return (id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004;
|
||||
}
|
||||
|
||||
static inline int ata_id_is_ssd(const u16 *id)
|
||||
static inline bool ata_id_is_ssd(const u16 *id)
|
||||
{
|
||||
return id[ATA_ID_ROT_SPEED] == 0x01;
|
||||
}
|
||||
|
||||
static inline int ata_id_pio_need_iordy(const u16 *id, const u8 pio)
|
||||
static inline bool ata_id_pio_need_iordy(const u16 *id, const u8 pio)
|
||||
{
|
||||
/* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */
|
||||
if (pio > 4 && ata_id_is_cfa(id))
|
||||
return 0;
|
||||
return false;
|
||||
/* For PIO3 and higher it is mandatory. */
|
||||
if (pio > 2)
|
||||
return 1;
|
||||
return true;
|
||||
/* Turn it on when possible. */
|
||||
if (ata_id_has_iordy(id))
|
||||
return 1;
|
||||
return 0;
|
||||
return ata_id_has_iordy(id);
|
||||
}
|
||||
|
||||
static inline int ata_drive_40wire(const u16 *dev_id)
|
||||
static inline bool ata_drive_40wire(const u16 *dev_id)
|
||||
{
|
||||
if (ata_id_is_sata(dev_id))
|
||||
return 0; /* SATA */
|
||||
return false; /* SATA */
|
||||
if ((dev_id[ATA_ID_HW_CONFIG] & 0xE000) == 0x6000)
|
||||
return 0; /* 80 wire */
|
||||
return 1;
|
||||
return false; /* 80 wire */
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
|
||||
static inline bool ata_drive_40wire_relaxed(const u16 *dev_id)
|
||||
{
|
||||
if ((dev_id[ATA_ID_HW_CONFIG] & 0x2000) == 0x2000)
|
||||
return 0; /* 80 wire */
|
||||
return 1;
|
||||
return false; /* 80 wire */
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline int atapi_cdb_len(const u16 *dev_id)
|
||||
@@ -936,12 +937,12 @@ static inline int atapi_cdb_len(const u16 *dev_id)
|
||||
}
|
||||
}
|
||||
|
||||
static inline int atapi_command_packet_set(const u16 *dev_id)
|
||||
static inline bool atapi_command_packet_set(const u16 *dev_id)
|
||||
{
|
||||
return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f;
|
||||
}
|
||||
|
||||
static inline int atapi_id_dmadir(const u16 *dev_id)
|
||||
static inline bool atapi_id_dmadir(const u16 *dev_id)
|
||||
{
|
||||
return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000);
|
||||
}
|
||||
@@ -954,13 +955,13 @@ static inline int atapi_id_dmadir(const u16 *dev_id)
|
||||
*
|
||||
* It is called only once for each device.
|
||||
*/
|
||||
static inline int ata_id_is_lba_capacity_ok(u16 *id)
|
||||
static inline bool ata_id_is_lba_capacity_ok(u16 *id)
|
||||
{
|
||||
unsigned long lba_sects, chs_sects, head, tail;
|
||||
|
||||
/* No non-LBA info .. so valid! */
|
||||
if (id[ATA_ID_CYLS] == 0)
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
lba_sects = ata_id_u32(id, ATA_ID_LBA_CAPACITY);
|
||||
|
||||
@@ -975,13 +976,13 @@ static inline int ata_id_is_lba_capacity_ok(u16 *id)
|
||||
id[ATA_ID_SECTORS] == 63 &&
|
||||
(id[ATA_ID_HEADS] == 15 || id[ATA_ID_HEADS] == 16) &&
|
||||
(lba_sects >= 16383 * 63 * id[ATA_ID_HEADS]))
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
chs_sects = id[ATA_ID_CYLS] * id[ATA_ID_HEADS] * id[ATA_ID_SECTORS];
|
||||
|
||||
/* perform a rough sanity check on lba_sects: within 10% is OK */
|
||||
if (lba_sects - chs_sects < chs_sects/10)
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
/* some drives have the word order reversed */
|
||||
head = (lba_sects >> 16) & 0xffff;
|
||||
@@ -990,10 +991,10 @@ static inline int ata_id_is_lba_capacity_ok(u16 *id)
|
||||
|
||||
if (lba_sects - chs_sects < chs_sects/10) {
|
||||
*(__le32 *)&id[ATA_ID_LBA_CAPACITY] = __cpu_to_le32(lba_sects);
|
||||
return 1; /* LBA capacity is (now) good */
|
||||
return true; /* LBA capacity is (now) good */
|
||||
}
|
||||
|
||||
return 0; /* LBA capacity value may be bad */
|
||||
return false; /* LBA capacity value may be bad */
|
||||
}
|
||||
|
||||
static inline void ata_id_to_hd_driveid(u16 *id)
|
||||
@@ -1051,19 +1052,19 @@ static inline int is_multi_taskfile(struct ata_taskfile *tf)
|
||||
(tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
|
||||
}
|
||||
|
||||
static inline int ata_ok(u8 status)
|
||||
static inline bool ata_ok(u8 status)
|
||||
{
|
||||
return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
|
||||
== ATA_DRDY);
|
||||
}
|
||||
|
||||
static inline int lba_28_ok(u64 block, u32 n_block)
|
||||
static inline bool lba_28_ok(u64 block, u32 n_block)
|
||||
{
|
||||
/* check the ending block number: must be LESS THAN 0x0fffffff */
|
||||
return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256);
|
||||
}
|
||||
|
||||
static inline int lba_48_ok(u64 block, u32 n_block)
|
||||
static inline bool lba_48_ok(u64 block, u32 n_block)
|
||||
{
|
||||
/* check the ending block number */
|
||||
return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
|
||||
|
||||
@@ -103,6 +103,8 @@
|
||||
#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
|
||||
#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
|
||||
#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
|
||||
#define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */
|
||||
#define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */
|
||||
|
||||
#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
|
||||
#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
|
||||
|
||||
@@ -699,7 +699,7 @@ extern void blk_start_queue(struct request_queue *q);
|
||||
extern void blk_stop_queue(struct request_queue *q);
|
||||
extern void blk_sync_queue(struct request_queue *q);
|
||||
extern void __blk_stop_queue(struct request_queue *q);
|
||||
extern void __blk_run_queue(struct request_queue *);
|
||||
extern void __blk_run_queue(struct request_queue *q, bool force_kblockd);
|
||||
extern void blk_run_queue(struct request_queue *);
|
||||
extern int blk_rq_map_user(struct request_queue *, struct request *,
|
||||
struct rq_map_data *, void __user *, unsigned long,
|
||||
@@ -1088,7 +1088,6 @@ static inline void put_dev_sector(Sector p)
|
||||
|
||||
struct work_struct;
|
||||
int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
|
||||
int kblockd_schedule_delayed_work(struct request_queue *q, struct delayed_work *dwork, unsigned long delay);
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
/*
|
||||
@@ -1136,7 +1135,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req)
|
||||
extern int blk_throtl_init(struct request_queue *q);
|
||||
extern void blk_throtl_exit(struct request_queue *q);
|
||||
extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
|
||||
extern void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay);
|
||||
extern void throtl_shutdown_timer_wq(struct request_queue *q);
|
||||
#else /* CONFIG_BLK_DEV_THROTTLING */
|
||||
static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
|
||||
@@ -1146,7 +1144,6 @@ static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
|
||||
|
||||
static inline int blk_throtl_init(struct request_queue *q) { return 0; }
|
||||
static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
|
||||
static inline void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay) {}
|
||||
static inline void throtl_shutdown_timer_wq(struct request_queue *q) {}
|
||||
#endif /* CONFIG_BLK_DEV_THROTTLING */
|
||||
|
||||
|
||||
@@ -245,7 +245,6 @@ static inline int blk_cmd_buf_len(struct request *rq)
|
||||
|
||||
extern void blk_dump_cmd(char *buf, struct request *rq);
|
||||
extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
|
||||
extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq);
|
||||
|
||||
#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ struct ceph_msg_pos {
|
||||
#define SOCK_CLOSED 11 /* socket state changed to closed */
|
||||
#define OPENING 13 /* open connection w/ (possibly new) peer */
|
||||
#define DEAD 14 /* dead, about to kfree */
|
||||
#define BACKOFF 15
|
||||
|
||||
/*
|
||||
* A single connection with another host.
|
||||
@@ -160,7 +161,6 @@ struct ceph_connection {
|
||||
struct list_head out_queue;
|
||||
struct list_head out_sent; /* sending or sent but unacked */
|
||||
u64 out_seq; /* last message queued for send */
|
||||
bool out_keepalive_pending;
|
||||
|
||||
u64 in_seq, in_seq_acked; /* last message received, acked */
|
||||
|
||||
|
||||
@@ -474,7 +474,8 @@ struct cgroup_subsys {
|
||||
struct cgroup *old_cgrp, struct task_struct *tsk,
|
||||
bool threadgroup);
|
||||
void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
void (*exit)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup *old_cgrp, struct task_struct *task);
|
||||
int (*populate)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cgrp);
|
||||
void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
@@ -626,6 +627,7 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg,
|
||||
/* Get id and depth of css */
|
||||
unsigned short css_id(struct cgroup_subsys_state *css);
|
||||
unsigned short css_depth(struct cgroup_subsys_state *css);
|
||||
struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id);
|
||||
|
||||
#else /* !CONFIG_CGROUPS */
|
||||
|
||||
|
||||
@@ -65,4 +65,8 @@ SUBSYS(net_cls)
|
||||
SUBSYS(blkio)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CGROUP_PERF
|
||||
SUBSYS(perf)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
@@ -42,8 +42,9 @@
|
||||
#define CN_VAL_DM_USERSPACE_LOG 0x1
|
||||
#define CN_IDX_DRBD 0x8
|
||||
#define CN_VAL_DRBD 0x1
|
||||
#define CN_KVP_IDX 0x9 /* HyperV KVP */
|
||||
|
||||
#define CN_NETLINK_USERS 8
|
||||
#define CN_NETLINK_USERS 9
|
||||
|
||||
/*
|
||||
* Maximum connector's message size.
|
||||
@@ -128,14 +129,17 @@ struct cn_dev {
|
||||
struct cn_queue_dev *cbdev;
|
||||
};
|
||||
|
||||
int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
|
||||
int cn_add_callback(struct cb_id *id, const char *name,
|
||||
void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
|
||||
void cn_del_callback(struct cb_id *);
|
||||
int cn_netlink_send(struct cn_msg *, u32, gfp_t);
|
||||
|
||||
int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
|
||||
int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,
|
||||
struct cb_id *id,
|
||||
void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
|
||||
void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
|
||||
|
||||
struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *);
|
||||
struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *);
|
||||
void cn_queue_free_dev(struct cn_queue_dev *dev);
|
||||
|
||||
int cn_cb_equal(struct cb_id *, struct cb_id *);
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* cpu_rmap.c: CPU affinity reverse-map support
|
||||
* Copyright 2011 Solarflare Communications Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation, incorporated herein by reference.
|
||||
*/
|
||||
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
/**
|
||||
* struct cpu_rmap - CPU affinity reverse-map
|
||||
* @size: Number of objects to be reverse-mapped
|
||||
* @used: Number of objects added
|
||||
* @obj: Pointer to array of object pointers
|
||||
* @near: For each CPU, the index and distance to the nearest object,
|
||||
* based on affinity masks
|
||||
*/
|
||||
struct cpu_rmap {
|
||||
u16 size, used;
|
||||
void **obj;
|
||||
struct {
|
||||
u16 index;
|
||||
u16 dist;
|
||||
} near[0];
|
||||
};
|
||||
#define CPU_RMAP_DIST_INF 0xffff
|
||||
|
||||
extern struct cpu_rmap *alloc_cpu_rmap(unsigned int size, gfp_t flags);
|
||||
|
||||
/**
|
||||
* free_cpu_rmap - free CPU affinity reverse-map
|
||||
* @rmap: Reverse-map allocated with alloc_cpu_rmap(), or %NULL
|
||||
*/
|
||||
static inline void free_cpu_rmap(struct cpu_rmap *rmap)
|
||||
{
|
||||
kfree(rmap);
|
||||
}
|
||||
|
||||
extern int cpu_rmap_add(struct cpu_rmap *rmap, void *obj);
|
||||
extern int cpu_rmap_update(struct cpu_rmap *rmap, u16 index,
|
||||
const struct cpumask *affinity);
|
||||
|
||||
static inline u16 cpu_rmap_lookup_index(struct cpu_rmap *rmap, unsigned int cpu)
|
||||
{
|
||||
return rmap->near[cpu].index;
|
||||
}
|
||||
|
||||
static inline void *cpu_rmap_lookup_obj(struct cpu_rmap *rmap, unsigned int cpu)
|
||||
{
|
||||
return rmap->obj[rmap->near[cpu].index];
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
|
||||
/**
|
||||
* alloc_irq_cpu_rmap - allocate CPU affinity reverse-map for IRQs
|
||||
* @size: Number of objects to be mapped
|
||||
*
|
||||
* Must be called in process context.
|
||||
*/
|
||||
static inline struct cpu_rmap *alloc_irq_cpu_rmap(unsigned int size)
|
||||
{
|
||||
return alloc_cpu_rmap(size, GFP_KERNEL);
|
||||
}
|
||||
extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
|
||||
|
||||
extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
|
||||
|
||||
#endif
|
||||
+112
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, Intel Corporation.
|
||||
* Copyright (c) 2008-2011, Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
@@ -25,9 +25,14 @@
|
||||
/* IEEE 802.1Qaz std supported values */
|
||||
#define IEEE_8021QAZ_MAX_TCS 8
|
||||
|
||||
#define IEEE_8021QAZ_TSA_STRICT 0
|
||||
#define IEEE_8021QAZ_TSA_CB_SHAPER 1
|
||||
#define IEEE_8021QAZ_TSA_ETS 2
|
||||
#define IEEE_8021QAZ_TSA_VENDOR 255
|
||||
|
||||
/* This structure contains the IEEE 802.1Qaz ETS managed object
|
||||
*
|
||||
* @willing: willing bit in ETS configuratin TLV
|
||||
* @willing: willing bit in ETS configuration TLV
|
||||
* @ets_cap: indicates supported capacity of ets feature
|
||||
* @cbs: credit based shaper ets algorithm supported
|
||||
* @tc_tx_bw: tc tx bandwidth indexed by traffic class
|
||||
@@ -82,6 +87,50 @@ struct ieee_pfc {
|
||||
__u64 indications[IEEE_8021QAZ_MAX_TCS];
|
||||
};
|
||||
|
||||
/* CEE DCBX std supported values */
|
||||
#define CEE_DCBX_MAX_PGS 8
|
||||
#define CEE_DCBX_MAX_PRIO 8
|
||||
|
||||
/**
|
||||
* struct cee_pg - CEE Priority-Group managed object
|
||||
*
|
||||
* @willing: willing bit in the PG tlv
|
||||
* @error: error bit in the PG tlv
|
||||
* @pg_en: enable bit of the PG feature
|
||||
* @tcs_supported: number of traffic classes supported
|
||||
* @pg_bw: bandwidth percentage for each priority group
|
||||
* @prio_pg: priority to PG mapping indexed by priority
|
||||
*/
|
||||
struct cee_pg {
|
||||
__u8 willing;
|
||||
__u8 error;
|
||||
__u8 pg_en;
|
||||
__u8 tcs_supported;
|
||||
__u8 pg_bw[CEE_DCBX_MAX_PGS];
|
||||
__u8 prio_pg[CEE_DCBX_MAX_PGS];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cee_pfc - CEE PFC managed object
|
||||
*
|
||||
* @willing: willing bit in the PFC tlv
|
||||
* @error: error bit in the PFC tlv
|
||||
* @pfc_en: bitmap indicating pfc enabled traffic classes
|
||||
* @tcs_supported: number of traffic classes supported
|
||||
*/
|
||||
struct cee_pfc {
|
||||
__u8 willing;
|
||||
__u8 error;
|
||||
__u8 pfc_en;
|
||||
__u8 tcs_supported;
|
||||
};
|
||||
|
||||
/* IEEE 802.1Qaz std supported values */
|
||||
#define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
|
||||
#define IEEE_8021QAZ_APP_SEL_STREAM 2
|
||||
#define IEEE_8021QAZ_APP_SEL_DGRAM 3
|
||||
#define IEEE_8021QAZ_APP_SEL_ANY 4
|
||||
|
||||
/* This structure contains the IEEE 802.1Qaz APP managed object. This
|
||||
* object is also used for the CEE std as well. There is no difference
|
||||
* between the objects.
|
||||
@@ -101,8 +150,22 @@ struct ieee_pfc {
|
||||
*/
|
||||
struct dcb_app {
|
||||
__u8 selector;
|
||||
__u32 protocol;
|
||||
__u8 priority;
|
||||
__u16 protocol;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dcb_peer_app_info - APP feature information sent by the peer
|
||||
*
|
||||
* @willing: willing bit in the peer APP tlv
|
||||
* @error: error bit in the peer APP tlv
|
||||
*
|
||||
* In addition to this information the full peer APP tlv also contains
|
||||
* a table of 'app_count' APP objects defined above.
|
||||
*/
|
||||
struct dcb_peer_app_info {
|
||||
__u8 willing;
|
||||
__u8 error;
|
||||
};
|
||||
|
||||
struct dcbmsg {
|
||||
@@ -139,6 +202,7 @@ struct dcbmsg {
|
||||
* @DCB_CMD_SDCBX: set DCBX engine configuration
|
||||
* @DCB_CMD_GFEATCFG: get DCBX features flags
|
||||
* @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
|
||||
* @DCB_CMD_CEE_GET: get CEE aggregated configuration
|
||||
*/
|
||||
enum dcbnl_commands {
|
||||
DCB_CMD_UNDEFINED,
|
||||
@@ -181,6 +245,8 @@ enum dcbnl_commands {
|
||||
DCB_CMD_GFEATCFG,
|
||||
DCB_CMD_SFEATCFG,
|
||||
|
||||
DCB_CMD_CEE_GET,
|
||||
|
||||
__DCB_CMD_ENUM_MAX,
|
||||
DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
|
||||
};
|
||||
@@ -203,6 +269,7 @@ enum dcbnl_commands {
|
||||
* @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
|
||||
* @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
|
||||
* @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
|
||||
* @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
|
||||
*/
|
||||
enum dcbnl_attrs {
|
||||
DCB_ATTR_UNDEFINED,
|
||||
@@ -226,15 +293,32 @@ enum dcbnl_attrs {
|
||||
DCB_ATTR_DCBX,
|
||||
DCB_ATTR_FEATCFG,
|
||||
|
||||
/* CEE nested attributes */
|
||||
DCB_ATTR_CEE,
|
||||
|
||||
__DCB_ATTR_ENUM_MAX,
|
||||
DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee_attrs - IEEE 802.1Qaz get/set attributes
|
||||
*
|
||||
* @DCB_ATTR_IEEE_UNSPEC: unspecified
|
||||
* @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
|
||||
* @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
|
||||
* @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
|
||||
* @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
|
||||
* @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
|
||||
* @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
|
||||
*/
|
||||
enum ieee_attrs {
|
||||
DCB_ATTR_IEEE_UNSPEC,
|
||||
DCB_ATTR_IEEE_ETS,
|
||||
DCB_ATTR_IEEE_PFC,
|
||||
DCB_ATTR_IEEE_APP_TABLE,
|
||||
DCB_ATTR_IEEE_PEER_ETS,
|
||||
DCB_ATTR_IEEE_PEER_PFC,
|
||||
DCB_ATTR_IEEE_PEER_APP,
|
||||
__DCB_ATTR_IEEE_MAX
|
||||
};
|
||||
#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
|
||||
@@ -246,6 +330,31 @@ enum ieee_attrs_app {
|
||||
};
|
||||
#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
|
||||
|
||||
/**
|
||||
* enum cee_attrs - CEE DCBX get attributes
|
||||
*
|
||||
* @DCB_ATTR_CEE_UNSPEC: unspecified
|
||||
* @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
|
||||
* @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
|
||||
* @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only
|
||||
*/
|
||||
enum cee_attrs {
|
||||
DCB_ATTR_CEE_UNSPEC,
|
||||
DCB_ATTR_CEE_PEER_PG,
|
||||
DCB_ATTR_CEE_PEER_PFC,
|
||||
DCB_ATTR_CEE_PEER_APP_TABLE,
|
||||
__DCB_ATTR_CEE_MAX
|
||||
};
|
||||
#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
|
||||
|
||||
enum peer_app_attr {
|
||||
DCB_ATTR_CEE_PEER_APP_UNSPEC,
|
||||
DCB_ATTR_CEE_PEER_APP_INFO,
|
||||
DCB_ATTR_CEE_PEER_APP,
|
||||
__DCB_ATTR_CEE_PEER_APP_MAX
|
||||
};
|
||||
#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
|
||||
|
||||
/**
|
||||
* enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
|
||||
*
|
||||
|
||||
@@ -279,8 +279,6 @@ enum dccp_state {
|
||||
DCCP_MAX_STATES
|
||||
};
|
||||
|
||||
#define DCCP_STATE_MASK 0x1f
|
||||
|
||||
enum {
|
||||
DCCPF_OPEN = TCPF_ESTABLISHED,
|
||||
DCCPF_REQUESTING = TCPF_SYN_SENT,
|
||||
|
||||
@@ -34,7 +34,10 @@ struct debug_obj {
|
||||
|
||||
/**
|
||||
* struct debug_obj_descr - object type specific debug description structure
|
||||
*
|
||||
* @name: name of the object typee
|
||||
* @debug_hint: function returning address, which have associated
|
||||
* kernel symbol, to allow identify the object
|
||||
* @fixup_init: fixup function, which is called when the init check
|
||||
* fails
|
||||
* @fixup_activate: fixup function, which is called when the activate check
|
||||
@@ -46,7 +49,7 @@ struct debug_obj {
|
||||
*/
|
||||
struct debug_obj_descr {
|
||||
const char *name;
|
||||
|
||||
void *(*debug_hint) (void *addr);
|
||||
int (*fixup_init) (void *addr, enum debug_obj_state state);
|
||||
int (*fixup_activate) (void *addr, enum debug_obj_state state);
|
||||
int (*fixup_destroy) (void *addr, enum debug_obj_state state);
|
||||
|
||||
@@ -128,9 +128,7 @@ struct device_driver {
|
||||
|
||||
bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
|
||||
|
||||
#if defined(CONFIG_OF)
|
||||
const struct of_device_id *of_match_table;
|
||||
#endif
|
||||
|
||||
int (*probe) (struct device *dev);
|
||||
int (*remove) (struct device *dev);
|
||||
@@ -422,6 +420,7 @@ struct device {
|
||||
void *platform_data; /* Platform specific data, device
|
||||
core doesn't touch it */
|
||||
struct dev_pm_info power;
|
||||
struct dev_power_domain *pwr_domain;
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
int numa_node; /* NUMA node this device is close to */
|
||||
@@ -441,9 +440,9 @@ struct device {
|
||||
override */
|
||||
/* arch specific additions */
|
||||
struct dev_archdata archdata;
|
||||
#ifdef CONFIG_OF
|
||||
struct device_node *of_node;
|
||||
#endif
|
||||
|
||||
struct device_node *of_node; /* associated device tree node */
|
||||
const struct of_device_id *of_match; /* matching of_device_id from driver */
|
||||
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
|
||||
|
||||
@@ -23,6 +23,53 @@ enum dmi_device_type {
|
||||
DMI_DEV_TYPE_DEV_ONBOARD = -3,
|
||||
};
|
||||
|
||||
enum dmi_entry_type {
|
||||
DMI_ENTRY_BIOS = 0,
|
||||
DMI_ENTRY_SYSTEM,
|
||||
DMI_ENTRY_BASEBOARD,
|
||||
DMI_ENTRY_CHASSIS,
|
||||
DMI_ENTRY_PROCESSOR,
|
||||
DMI_ENTRY_MEM_CONTROLLER,
|
||||
DMI_ENTRY_MEM_MODULE,
|
||||
DMI_ENTRY_CACHE,
|
||||
DMI_ENTRY_PORT_CONNECTOR,
|
||||
DMI_ENTRY_SYSTEM_SLOT,
|
||||
DMI_ENTRY_ONBOARD_DEVICE,
|
||||
DMI_ENTRY_OEMSTRINGS,
|
||||
DMI_ENTRY_SYSCONF,
|
||||
DMI_ENTRY_BIOS_LANG,
|
||||
DMI_ENTRY_GROUP_ASSOC,
|
||||
DMI_ENTRY_SYSTEM_EVENT_LOG,
|
||||
DMI_ENTRY_PHYS_MEM_ARRAY,
|
||||
DMI_ENTRY_MEM_DEVICE,
|
||||
DMI_ENTRY_32_MEM_ERROR,
|
||||
DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
|
||||
DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
|
||||
DMI_ENTRY_BUILTIN_POINTING_DEV,
|
||||
DMI_ENTRY_PORTABLE_BATTERY,
|
||||
DMI_ENTRY_SYSTEM_RESET,
|
||||
DMI_ENTRY_HW_SECURITY,
|
||||
DMI_ENTRY_SYSTEM_POWER_CONTROLS,
|
||||
DMI_ENTRY_VOLTAGE_PROBE,
|
||||
DMI_ENTRY_COOLING_DEV,
|
||||
DMI_ENTRY_TEMP_PROBE,
|
||||
DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
|
||||
DMI_ENTRY_OOB_REMOTE_ACCESS,
|
||||
DMI_ENTRY_BIS_ENTRY,
|
||||
DMI_ENTRY_SYSTEM_BOOT,
|
||||
DMI_ENTRY_MGMT_DEV,
|
||||
DMI_ENTRY_MGMT_DEV_COMPONENT,
|
||||
DMI_ENTRY_MGMT_DEV_THRES,
|
||||
DMI_ENTRY_MEM_CHANNEL,
|
||||
DMI_ENTRY_IPMI_DEV,
|
||||
DMI_ENTRY_SYS_POWER_SUPPLY,
|
||||
DMI_ENTRY_ADDITIONAL,
|
||||
DMI_ENTRY_ONBOARD_DEV_EXT,
|
||||
DMI_ENTRY_MGMT_CONTROLLER_HOST,
|
||||
DMI_ENTRY_INACTIVE = 126,
|
||||
DMI_ENTRY_END_OF_TABLE = 127,
|
||||
};
|
||||
|
||||
struct dmi_header {
|
||||
u8 type;
|
||||
u8 length;
|
||||
|
||||
@@ -31,6 +31,10 @@ struct _ddebug {
|
||||
* writes commands to <debugfs>/dynamic_debug/control
|
||||
*/
|
||||
#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */
|
||||
#define _DPRINTK_FLAGS_INCL_MODNAME (1<<1)
|
||||
#define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2)
|
||||
#define _DPRINTK_FLAGS_INCL_LINENO (1<<3)
|
||||
#define _DPRINTK_FLAGS_INCL_TID (1<<4)
|
||||
#define _DPRINTK_FLAGS_DEFAULT 0
|
||||
unsigned int flags:8;
|
||||
char enabled;
|
||||
@@ -42,6 +46,8 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
extern int ddebug_remove_module(const char *mod_name);
|
||||
extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#define dynamic_pr_debug(fmt, ...) do { \
|
||||
static struct _ddebug descriptor \
|
||||
@@ -50,7 +56,7 @@ extern int ddebug_remove_module(const char *mod_name);
|
||||
{ KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
|
||||
_DPRINTK_FLAGS_DEFAULT }; \
|
||||
if (unlikely(descriptor.enabled)) \
|
||||
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
|
||||
__dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
@@ -397,4 +397,41 @@ static inline void memrange_efi_to_native(u64 *addr, u64 *npages)
|
||||
*addr &= PAGE_MASK;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE)
|
||||
/*
|
||||
* EFI Variable support.
|
||||
*
|
||||
* Different firmware drivers can expose their EFI-like variables using
|
||||
* the following.
|
||||
*/
|
||||
|
||||
struct efivar_operations {
|
||||
efi_get_variable_t *get_variable;
|
||||
efi_get_next_variable_t *get_next_variable;
|
||||
efi_set_variable_t *set_variable;
|
||||
};
|
||||
|
||||
struct efivars {
|
||||
/*
|
||||
* ->lock protects two things:
|
||||
* 1) ->list - adds, removals, reads, writes
|
||||
* 2) ops.[gs]et_variable() calls.
|
||||
* It must not be held when creating sysfs entries or calling kmalloc.
|
||||
* ops.get_next_variable() is only called from register_efivars(),
|
||||
* which is protected by the BKL, so that path is safe.
|
||||
*/
|
||||
spinlock_t lock;
|
||||
struct list_head list;
|
||||
struct kset *kset;
|
||||
struct bin_attribute *new_var, *del_var;
|
||||
const struct efivar_operations *ops;
|
||||
};
|
||||
|
||||
int register_efivars(struct efivars *efivars,
|
||||
const struct efivar_operations *ops,
|
||||
struct kobject *parent_kobj);
|
||||
void unregister_efivars(struct efivars *efivars);
|
||||
|
||||
#endif /* CONFIG_EFI_VARS */
|
||||
|
||||
#endif /* _LINUX_EFI_H */
|
||||
|
||||
+90
-1
@@ -251,6 +251,7 @@ enum ethtool_stringset {
|
||||
ETH_SS_STATS,
|
||||
ETH_SS_PRIV_FLAGS,
|
||||
ETH_SS_NTUPLE_FILTERS,
|
||||
ETH_SS_FEATURES,
|
||||
};
|
||||
|
||||
/* for passing string sets for data tagging */
|
||||
@@ -523,6 +524,92 @@ struct ethtool_flash {
|
||||
char data[ETHTOOL_FLASH_MAX_FILENAME];
|
||||
};
|
||||
|
||||
/* for returning and changing feature sets */
|
||||
|
||||
/**
|
||||
* struct ethtool_get_features_block - block with state of 32 features
|
||||
* @available: mask of changeable features
|
||||
* @requested: mask of features requested to be enabled if possible
|
||||
* @active: mask of currently enabled features
|
||||
* @never_changed: mask of features not changeable for any device
|
||||
*/
|
||||
struct ethtool_get_features_block {
|
||||
__u32 available;
|
||||
__u32 requested;
|
||||
__u32 active;
|
||||
__u32 never_changed;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_gfeatures - command to get state of device's features
|
||||
* @cmd: command number = %ETHTOOL_GFEATURES
|
||||
* @size: in: number of elements in the features[] array;
|
||||
* out: number of elements in features[] needed to hold all features
|
||||
* @features: state of features
|
||||
*/
|
||||
struct ethtool_gfeatures {
|
||||
__u32 cmd;
|
||||
__u32 size;
|
||||
struct ethtool_get_features_block features[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_set_features_block - block with request for 32 features
|
||||
* @valid: mask of features to be changed
|
||||
* @requested: values of features to be changed
|
||||
*/
|
||||
struct ethtool_set_features_block {
|
||||
__u32 valid;
|
||||
__u32 requested;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_sfeatures - command to request change in device's features
|
||||
* @cmd: command number = %ETHTOOL_SFEATURES
|
||||
* @size: array size of the features[] array
|
||||
* @features: feature change masks
|
||||
*/
|
||||
struct ethtool_sfeatures {
|
||||
__u32 cmd;
|
||||
__u32 size;
|
||||
struct ethtool_set_features_block features[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* %ETHTOOL_SFEATURES changes features present in features[].valid to the
|
||||
* values of corresponding bits in features[].requested. Bits in .requested
|
||||
* not set in .valid or not changeable are ignored.
|
||||
*
|
||||
* Returns %EINVAL when .valid contains undefined or never-changable bits
|
||||
* or size is not equal to required number of features words (32-bit blocks).
|
||||
* Returns >= 0 if request was completed; bits set in the value mean:
|
||||
* %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
|
||||
* changeable (not present in %ETHTOOL_GFEATURES' features[].available)
|
||||
* those bits were ignored.
|
||||
* %ETHTOOL_F_WISH - some or all changes requested were recorded but the
|
||||
* resulting state of bits masked by .valid is not equal to .requested.
|
||||
* Probably there are other device-specific constraints on some features
|
||||
* in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
|
||||
* here as though ignored bits were cleared.
|
||||
* %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
|
||||
* compatibility functions. Requested offload state cannot be properly
|
||||
* managed by kernel.
|
||||
*
|
||||
* Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
|
||||
* bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
|
||||
* for ETH_SS_FEATURES string set. First entry in the table corresponds to least
|
||||
* significant bit in features[0] fields. Empty strings mark undefined features.
|
||||
*/
|
||||
enum ethtool_sfeatures_retval_bits {
|
||||
ETHTOOL_F_UNSUPPORTED__BIT,
|
||||
ETHTOOL_F_WISH__BIT,
|
||||
ETHTOOL_F_COMPAT__BIT,
|
||||
};
|
||||
|
||||
#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
|
||||
#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
|
||||
#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/rculist.h>
|
||||
@@ -543,7 +630,6 @@ struct net_device;
|
||||
|
||||
/* Some generic methods drivers may use in their ethtool_ops */
|
||||
u32 ethtool_op_get_link(struct net_device *dev);
|
||||
u32 ethtool_op_get_rx_csum(struct net_device *dev);
|
||||
u32 ethtool_op_get_tx_csum(struct net_device *dev);
|
||||
int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
|
||||
int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
|
||||
@@ -744,6 +830,9 @@ struct ethtool_ops {
|
||||
#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
|
||||
#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
|
||||
|
||||
#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
|
||||
#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
|
||||
|
||||
/* compatibility with older code */
|
||||
#define SPARC_ETH_GSET ETHTOOL_GSET
|
||||
#define SPARC_ETH_SSET ETHTOOL_SSET
|
||||
|
||||
@@ -8,6 +8,9 @@ struct inode;
|
||||
struct super_block;
|
||||
struct vfsmount;
|
||||
|
||||
/* limit the handle size to NFSv4 handle size now */
|
||||
#define MAX_HANDLE_SZ 128
|
||||
|
||||
/*
|
||||
* The fileid_type identifies how the file within the filesystem is encoded.
|
||||
* In theory this is freely set and parsed by the filesystem, but we try to
|
||||
@@ -121,8 +124,10 @@ struct fid {
|
||||
* set, the encode_fh() should store sufficient information so that a good
|
||||
* attempt can be made to find not only the file but also it's place in the
|
||||
* filesystem. This typically means storing a reference to de->d_parent in
|
||||
* the filehandle fragment. encode_fh() should return the number of bytes
|
||||
* stored or a negative error code such as %-ENOSPC
|
||||
* the filehandle fragment. encode_fh() should return the fileid_type on
|
||||
* success and on error returns 255 (if the space needed to encode fh is
|
||||
* greater than @max_len*4 bytes). On error @max_len contains the minimum
|
||||
* size(in 4 byte unit) needed to encode the file handle.
|
||||
*
|
||||
* fh_to_dentry:
|
||||
* @fh_to_dentry is given a &struct super_block (@sb) and a file handle
|
||||
|
||||
@@ -884,7 +884,8 @@ extern int ext3fs_dirhash(const char *name, int len, struct
|
||||
dx_hash_info *hinfo);
|
||||
|
||||
/* ialloc.c */
|
||||
extern struct inode * ext3_new_inode (handle_t *, struct inode *, int);
|
||||
extern struct inode * ext3_new_inode (handle_t *, struct inode *,
|
||||
const struct qstr *, int);
|
||||
extern void ext3_free_inode (handle_t *, struct inode *);
|
||||
extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
|
||||
extern unsigned long ext3_count_free_inodes (struct super_block *);
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
unlinking file. */
|
||||
#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
|
||||
#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
|
||||
#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ static inline void fput_light(struct file *file, int fput_needed)
|
||||
|
||||
extern struct file *fget(unsigned int fd);
|
||||
extern struct file *fget_light(unsigned int fd, int *fput_needed);
|
||||
extern struct file *fget_raw(unsigned int fd);
|
||||
extern struct file *fget_raw_light(unsigned int fd, int *fput_needed);
|
||||
extern void set_close_on_exec(unsigned int fd, int flag);
|
||||
extern void put_filp(struct file *);
|
||||
extern int alloc_fd(unsigned start, unsigned flags);
|
||||
|
||||
@@ -39,7 +39,7 @@ struct builtin_fw {
|
||||
int request_firmware(const struct firmware **fw, const char *name,
|
||||
struct device *device);
|
||||
int request_firmware_nowait(
|
||||
struct module *module, int uevent,
|
||||
struct module *module, bool uevent,
|
||||
const char *name, struct device *device, gfp_t gfp, void *context,
|
||||
void (*cont)(const struct firmware *fw, void *context));
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw,
|
||||
return -EINVAL;
|
||||
}
|
||||
static inline int request_firmware_nowait(
|
||||
struct module *module, int uevent,
|
||||
struct module *module, bool uevent,
|
||||
const char *name, struct device *device, gfp_t gfp, void *context,
|
||||
void (*cont)(const struct firmware *fw, void *context))
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ static inline void freezer_count(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the task should be counted as freezeable by the freezer
|
||||
* Check if the task should be counted as freezable by the freezer
|
||||
*/
|
||||
static inline int freezer_should_skip(struct task_struct *p)
|
||||
{
|
||||
|
||||
+41
-21
@@ -102,6 +102,9 @@ struct inodes_stat_t {
|
||||
/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
|
||||
#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
|
||||
|
||||
/* File is opened with O_PATH; almost nothing can be done with it */
|
||||
#define FMODE_PATH ((__force fmode_t)0x4000)
|
||||
|
||||
/* File was opened by fanotify and shouldn't generate fanotify events */
|
||||
#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
|
||||
|
||||
@@ -649,6 +652,7 @@ struct address_space {
|
||||
spinlock_t private_lock; /* for use by the address_space */
|
||||
struct list_head private_list; /* ditto */
|
||||
struct address_space *assoc_mapping; /* ditto */
|
||||
struct mutex unmap_mutex; /* to protect unmapping */
|
||||
} __attribute__((aligned(sizeof(long))));
|
||||
/*
|
||||
* On most architectures that alignment is already the case; but
|
||||
@@ -797,8 +801,7 @@ struct inode {
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IMA
|
||||
/* protected by i_lock */
|
||||
unsigned int i_readcount; /* struct files open RO */
|
||||
atomic_t i_readcount; /* struct files open RO */
|
||||
#endif
|
||||
atomic_t i_writecount;
|
||||
#ifdef CONFIG_SECURITY
|
||||
@@ -977,6 +980,13 @@ struct file {
|
||||
#endif
|
||||
};
|
||||
|
||||
struct file_handle {
|
||||
__u32 handle_bytes;
|
||||
int handle_type;
|
||||
/* file identifier */
|
||||
unsigned char f_handle[0];
|
||||
};
|
||||
|
||||
#define get_file(x) atomic_long_inc(&(x)->f_count)
|
||||
#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
|
||||
#define file_count(x) atomic_long_read(&(x)->f_count)
|
||||
@@ -1400,6 +1410,7 @@ struct super_block {
|
||||
wait_queue_head_t s_wait_unfrozen;
|
||||
|
||||
char s_id[32]; /* Informational name */
|
||||
u8 s_uuid[16]; /* UUID */
|
||||
|
||||
void *s_fs_info; /* Filesystem private info */
|
||||
fmode_t s_mode;
|
||||
@@ -1620,6 +1631,8 @@ struct super_operations {
|
||||
void (*umount_begin) (struct super_block *);
|
||||
|
||||
int (*show_options)(struct seq_file *, struct vfsmount *);
|
||||
int (*show_devname)(struct seq_file *, struct vfsmount *);
|
||||
int (*show_path)(struct seq_file *, struct vfsmount *);
|
||||
int (*show_stats)(struct seq_file *, struct vfsmount *);
|
||||
#ifdef CONFIG_QUOTA
|
||||
ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
|
||||
@@ -1783,8 +1796,6 @@ int sync_inode_metadata(struct inode *inode, int wait);
|
||||
struct file_system_type {
|
||||
const char *name;
|
||||
int fs_flags;
|
||||
int (*get_sb) (struct file_system_type *, int,
|
||||
const char *, void *, struct vfsmount *);
|
||||
struct dentry *(*mount) (struct file_system_type *, int,
|
||||
const char *, void *);
|
||||
void (*kill_sb) (struct super_block *);
|
||||
@@ -1807,24 +1818,12 @@ extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
|
||||
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
extern int get_sb_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
extern struct dentry *mount_single(struct file_system_type *fs_type,
|
||||
int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
extern int get_sb_single(struct file_system_type *fs_type,
|
||||
int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
extern struct dentry *mount_nodev(struct file_system_type *fs_type,
|
||||
int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
extern int get_sb_nodev(struct file_system_type *fs_type,
|
||||
int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
void generic_shutdown_super(struct super_block *sb);
|
||||
void kill_block_super(struct super_block *sb);
|
||||
void kill_anon_super(struct super_block *sb);
|
||||
@@ -1873,6 +1872,8 @@ extern void drop_collected_mounts(struct vfsmount *);
|
||||
extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
|
||||
struct vfsmount *);
|
||||
extern int vfs_statfs(struct path *, struct kstatfs *);
|
||||
extern int user_statfs(const char __user *, struct kstatfs *);
|
||||
extern int fd_statfs(int, struct kstatfs *);
|
||||
extern int statfs_by_dentry(struct dentry *, struct kstatfs *);
|
||||
extern int freeze_super(struct super_block *super);
|
||||
extern int thaw_super(struct super_block *super);
|
||||
@@ -1989,6 +1990,8 @@ extern int do_fallocate(struct file *file, int mode, loff_t offset,
|
||||
extern long do_sys_open(int dfd, const char __user *filename, int flags,
|
||||
int mode);
|
||||
extern struct file *filp_open(const char *, int, int);
|
||||
extern struct file *file_open_root(struct dentry *, struct vfsmount *,
|
||||
const char *, int);
|
||||
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
|
||||
const struct cred *);
|
||||
extern int filp_close(struct file *, fl_owner_t id);
|
||||
@@ -2139,7 +2142,7 @@ extern void check_disk_size_change(struct gendisk *disk,
|
||||
struct block_device *bdev);
|
||||
extern int revalidate_disk(struct gendisk *);
|
||||
extern int check_disk_change(struct block_device *);
|
||||
extern int __invalidate_device(struct block_device *);
|
||||
extern int __invalidate_device(struct block_device *, bool);
|
||||
extern int invalidate_partition(struct gendisk *, int);
|
||||
#endif
|
||||
unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
||||
@@ -2199,15 +2202,31 @@ static inline void allow_write_access(struct file *file)
|
||||
if (file)
|
||||
atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
|
||||
}
|
||||
#ifdef CONFIG_IMA
|
||||
static inline void i_readcount_dec(struct inode *inode)
|
||||
{
|
||||
BUG_ON(!atomic_read(&inode->i_readcount));
|
||||
atomic_dec(&inode->i_readcount);
|
||||
}
|
||||
static inline void i_readcount_inc(struct inode *inode)
|
||||
{
|
||||
atomic_inc(&inode->i_readcount);
|
||||
}
|
||||
#else
|
||||
static inline void i_readcount_dec(struct inode *inode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
static inline void i_readcount_inc(struct inode *inode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
extern int do_pipe_flags(int *, int);
|
||||
extern struct file *create_read_pipe(struct file *f, int flags);
|
||||
extern struct file *create_write_pipe(int flags);
|
||||
extern void free_write_pipe(struct file *);
|
||||
|
||||
extern struct file *do_filp_open(int dfd, const char *pathname,
|
||||
int open_flag, int mode, int acc_mode);
|
||||
extern int may_open(struct path *, int, int);
|
||||
|
||||
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
|
||||
extern struct file * open_exec(const char *);
|
||||
|
||||
@@ -2225,6 +2244,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
|
||||
|
||||
extern int inode_init_always(struct super_block *, struct inode *);
|
||||
extern void inode_init_once(struct inode *);
|
||||
extern void address_space_init_once(struct address_space *mapping);
|
||||
extern void ihold(struct inode * inode);
|
||||
extern void iput(struct inode *);
|
||||
extern struct inode * igrab(struct inode *);
|
||||
|
||||
@@ -428,6 +428,7 @@ extern void unregister_ftrace_graph(void);
|
||||
|
||||
extern void ftrace_graph_init_task(struct task_struct *t);
|
||||
extern void ftrace_graph_exit_task(struct task_struct *t);
|
||||
extern void ftrace_graph_init_idle_task(struct task_struct *t, int cpu);
|
||||
|
||||
static inline int task_curr_ret_stack(struct task_struct *t)
|
||||
{
|
||||
@@ -451,6 +452,7 @@ static inline void unpause_graph_tracing(void)
|
||||
|
||||
static inline void ftrace_graph_init_task(struct task_struct *t) { }
|
||||
static inline void ftrace_graph_exit_task(struct task_struct *t) { }
|
||||
static inline void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { }
|
||||
|
||||
static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc,
|
||||
trace_func_graph_ent_t entryfunc)
|
||||
|
||||
@@ -37,7 +37,6 @@ struct trace_entry {
|
||||
unsigned char flags;
|
||||
unsigned char preempt_count;
|
||||
int pid;
|
||||
int lock_depth;
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_EVENT \
|
||||
@@ -208,7 +207,6 @@ struct ftrace_event_call {
|
||||
|
||||
#define PERF_MAX_TRACE_SIZE 2048
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
|
||||
|
||||
extern void destroy_preds(struct ftrace_event_call *call);
|
||||
|
||||
+7
-4
@@ -332,16 +332,19 @@ alloc_pages(gfp_t gfp_mask, unsigned int order)
|
||||
return alloc_pages_current(gfp_mask, order);
|
||||
}
|
||||
extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order,
|
||||
struct vm_area_struct *vma, unsigned long addr);
|
||||
struct vm_area_struct *vma, unsigned long addr,
|
||||
int node);
|
||||
#else
|
||||
#define alloc_pages(gfp_mask, order) \
|
||||
alloc_pages_node(numa_node_id(), gfp_mask, order)
|
||||
#define alloc_pages_vma(gfp_mask, order, vma, addr) \
|
||||
#define alloc_pages_vma(gfp_mask, order, vma, addr, node) \
|
||||
alloc_pages(gfp_mask, order)
|
||||
#endif
|
||||
#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
|
||||
#define alloc_page_vma(gfp_mask, vma, addr) \
|
||||
alloc_pages_vma(gfp_mask, 0, vma, addr)
|
||||
#define alloc_page_vma(gfp_mask, vma, addr) \
|
||||
alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id())
|
||||
#define alloc_page_vma_node(gfp_mask, vma, addr, node) \
|
||||
alloc_pages_vma(gfp_mask, 0, vma, addr, node)
|
||||
|
||||
extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
|
||||
extern unsigned long get_zeroed_page(gfp_t gfp_mask);
|
||||
|
||||
@@ -93,13 +93,6 @@
|
||||
*/
|
||||
#define in_nmi() (preempt_count() & NMI_MASK)
|
||||
|
||||
#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
|
||||
# include <linux/sched.h>
|
||||
# define PREEMPT_INATOMIC_BASE (current->lock_depth >= 0)
|
||||
#else
|
||||
# define PREEMPT_INATOMIC_BASE 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PREEMPT)
|
||||
# define PREEMPT_CHECK_OFFSET 1
|
||||
#else
|
||||
@@ -113,7 +106,7 @@
|
||||
* used in the general case to determine whether sleeping is possible.
|
||||
* Do not use in_atomic() in driver code.
|
||||
*/
|
||||
#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_INATOMIC_BASE)
|
||||
#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
|
||||
|
||||
/*
|
||||
* Check whether we were atomic before we did preempt_disable():
|
||||
|
||||
+18
-6
@@ -54,11 +54,13 @@ enum hrtimer_restart {
|
||||
* 0x00 inactive
|
||||
* 0x01 enqueued into rbtree
|
||||
* 0x02 callback function running
|
||||
* 0x04 timer is migrated to another cpu
|
||||
*
|
||||
* Special cases:
|
||||
* 0x03 callback function running and enqueued
|
||||
* (was requeued on another CPU)
|
||||
* 0x09 timer was migrated on CPU hotunplug
|
||||
* 0x05 timer was migrated on CPU hotunplug
|
||||
*
|
||||
* The "callback function running and enqueued" status is only possible on
|
||||
* SMP. It happens for example when a posix timer expired and the callback
|
||||
* queued a signal. Between dropping the lock which protects the posix timer
|
||||
@@ -67,8 +69,11 @@ enum hrtimer_restart {
|
||||
* as otherwise the timer could be removed before the softirq code finishes the
|
||||
* the handling of the timer.
|
||||
*
|
||||
* The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to
|
||||
* preserve the HRTIMER_STATE_CALLBACK bit in the above scenario.
|
||||
* The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state
|
||||
* to preserve the HRTIMER_STATE_CALLBACK in the above scenario. This
|
||||
* also affects HRTIMER_STATE_MIGRATE where the preservation is not
|
||||
* necessary. HRTIMER_STATE_MIGRATE is cleared after the timer is
|
||||
* enqueued on the new cpu.
|
||||
*
|
||||
* All state transitions are protected by cpu_base->lock.
|
||||
*/
|
||||
@@ -148,7 +153,12 @@ struct hrtimer_clock_base {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define HRTIMER_MAX_CLOCK_BASES 2
|
||||
enum hrtimer_base_type {
|
||||
HRTIMER_BASE_REALTIME,
|
||||
HRTIMER_BASE_MONOTONIC,
|
||||
HRTIMER_BASE_BOOTTIME,
|
||||
HRTIMER_MAX_CLOCK_BASES,
|
||||
};
|
||||
|
||||
/*
|
||||
* struct hrtimer_cpu_base - the per cpu clock bases
|
||||
@@ -308,6 +318,7 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer)
|
||||
|
||||
extern ktime_t ktime_get(void);
|
||||
extern ktime_t ktime_get_real(void);
|
||||
extern ktime_t ktime_get_boottime(void);
|
||||
|
||||
|
||||
DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
|
||||
@@ -370,8 +381,9 @@ extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
|
||||
extern ktime_t hrtimer_get_next_event(void);
|
||||
|
||||
/*
|
||||
* A timer is active, when it is enqueued into the rbtree or the callback
|
||||
* function is running.
|
||||
* A timer is active, when it is enqueued into the rbtree or the
|
||||
* callback function is running or it's in the state of being migrated
|
||||
* to another cpu.
|
||||
*/
|
||||
static inline int hrtimer_active(const struct hrtimer *timer)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,8 @@ extern pmd_t *page_check_address_pmd(struct page *page,
|
||||
(transparent_hugepage_flags & \
|
||||
(1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG) && \
|
||||
((__vma)->vm_flags & VM_HUGEPAGE))) && \
|
||||
!((__vma)->vm_flags & VM_NOHUGEPAGE))
|
||||
!((__vma)->vm_flags & VM_NOHUGEPAGE) && \
|
||||
!is_vma_temporary_stack(__vma))
|
||||
#define transparent_hugepage_defrag(__vma) \
|
||||
((transparent_hugepage_flags & \
|
||||
(1<<TRANSPARENT_HUGEPAGE_DEFRAG_FLAG)) || \
|
||||
|
||||
@@ -258,9 +258,7 @@ struct i2c_board_info {
|
||||
unsigned short addr;
|
||||
void *platform_data;
|
||||
struct dev_archdata *archdata;
|
||||
#ifdef CONFIG_OF
|
||||
struct device_node *of_node;
|
||||
#endif
|
||||
int irq;
|
||||
};
|
||||
|
||||
|
||||
@@ -600,6 +600,8 @@ struct twl4030_usb_data {
|
||||
int (*phy_power)(struct device *dev, int iD, int on);
|
||||
/* enable/disable phy clocks */
|
||||
int (*phy_set_clock)(struct device *dev, int on);
|
||||
/* suspend/resume of phy */
|
||||
int (*phy_suspend)(struct device *dev, int suspend);
|
||||
};
|
||||
|
||||
struct twl4030_ins {
|
||||
|
||||
@@ -183,10 +183,10 @@ extern void icmpv6_cleanup(void);
|
||||
extern void icmpv6_param_prob(struct sk_buff *skb,
|
||||
u8 code, int pos);
|
||||
|
||||
struct flowi;
|
||||
struct flowi6;
|
||||
struct in6_addr;
|
||||
extern void icmpv6_flow_init(struct sock *sk,
|
||||
struct flowi *fl,
|
||||
struct flowi6 *fl6,
|
||||
u8 type,
|
||||
const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
|
||||
@@ -1325,6 +1325,9 @@ enum {
|
||||
/* Although the spec says 8 I'm seeing 6 in practice */
|
||||
#define IEEE80211_COUNTRY_IE_MIN_LEN 6
|
||||
|
||||
/* The Country String field of the element shall be 3 octets in length */
|
||||
#define IEEE80211_COUNTRY_STRING_LEN 3
|
||||
|
||||
/*
|
||||
* For regulatory extension stuff see IEEE 802.11-2007
|
||||
* Annex I (page 1141) and Annex J (page 1147). Also
|
||||
|
||||
+4
-5
@@ -71,11 +71,10 @@
|
||||
* release skb->dst
|
||||
*/
|
||||
#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
|
||||
#define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */
|
||||
#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */
|
||||
#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */
|
||||
#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */
|
||||
#define IFF_OVS_DATAPATH 0x10000 /* device used as Open vSwitch
|
||||
#define IFF_DISABLE_NETPOLL 0x1000 /* disable netpoll at run-time */
|
||||
#define IFF_MACVLAN_PORT 0x2000 /* device used as macvlan port */
|
||||
#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */
|
||||
#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch
|
||||
* datapath port */
|
||||
|
||||
#define IF_GET_IFACE 0x0001 /* for querying only */
|
||||
|
||||
@@ -135,6 +135,7 @@ enum {
|
||||
IFLA_VF_PORTS,
|
||||
IFLA_PORT_SELF,
|
||||
IFLA_AF_SPEC,
|
||||
IFLA_GROUP, /* Group the device belongs to */
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ struct ip_mc_list {
|
||||
#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
|
||||
#define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value)
|
||||
|
||||
extern int ip_check_mc(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto);
|
||||
extern int ip_check_mc_rcu(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto);
|
||||
extern int igmp_rcv(struct sk_buff *);
|
||||
extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
|
||||
extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr);
|
||||
|
||||
@@ -20,7 +20,6 @@ extern void ima_inode_free(struct inode *inode);
|
||||
extern int ima_file_check(struct file *file, int mask);
|
||||
extern void ima_file_free(struct file *file);
|
||||
extern int ima_file_mmap(struct file *file, unsigned long prot);
|
||||
extern void ima_counts_get(struct file *file);
|
||||
|
||||
#else
|
||||
static inline int ima_bprm_check(struct linux_binprm *bprm)
|
||||
@@ -53,10 +52,5 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ima_counts_get(struct file *file)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IMA_H */
|
||||
#endif /* _LINUX_IMA_H */
|
||||
|
||||
@@ -144,6 +144,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
|
||||
#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
|
||||
|
||||
struct in_ifaddr {
|
||||
struct hlist_node hash;
|
||||
struct in_ifaddr *ifa_next;
|
||||
struct in_device *ifa_dev;
|
||||
struct rcu_head rcu_head;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#define MATRIX_MAX_ROWS 16
|
||||
#define MATRIX_MAX_COLS 16
|
||||
#define MATRIX_MAX_ROWS 32
|
||||
#define MATRIX_MAX_COLS 32
|
||||
|
||||
#define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\
|
||||
(((col) & (MATRIX_MAX_COLS - 1)) << 16) |\
|
||||
|
||||
+65
-20
@@ -14,6 +14,8 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hrtimer.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
@@ -55,7 +57,8 @@
|
||||
* Used by threaded interrupts which need to keep the
|
||||
* irq line disabled until the threaded handler has been run.
|
||||
* IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
|
||||
*
|
||||
* IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
|
||||
* IRQF_NO_THREAD - Interrupt cannot be threaded
|
||||
*/
|
||||
#define IRQF_DISABLED 0x00000020
|
||||
#define IRQF_SAMPLE_RANDOM 0x00000040
|
||||
@@ -67,22 +70,10 @@
|
||||
#define IRQF_IRQPOLL 0x00001000
|
||||
#define IRQF_ONESHOT 0x00002000
|
||||
#define IRQF_NO_SUSPEND 0x00004000
|
||||
#define IRQF_FORCE_RESUME 0x00008000
|
||||
#define IRQF_NO_THREAD 0x00010000
|
||||
|
||||
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND)
|
||||
|
||||
/*
|
||||
* Bits used by threaded handlers:
|
||||
* IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
|
||||
* IRQTF_DIED - handler thread died
|
||||
* IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
|
||||
* IRQTF_AFFINITY - irq thread is requested to adjust affinity
|
||||
*/
|
||||
enum {
|
||||
IRQTF_RUNTHREAD,
|
||||
IRQTF_DIED,
|
||||
IRQTF_WARNED,
|
||||
IRQTF_AFFINITY,
|
||||
};
|
||||
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
|
||||
|
||||
/*
|
||||
* These values can be returned by request_any_context_irq() and
|
||||
@@ -110,6 +101,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
|
||||
* @thread_fn: interupt handler function for threaded interrupts
|
||||
* @thread: thread pointer for threaded interrupts
|
||||
* @thread_flags: flags related to @thread
|
||||
* @thread_mask: bitmask for keeping track of @thread activity
|
||||
*/
|
||||
struct irqaction {
|
||||
irq_handler_t handler;
|
||||
@@ -120,6 +112,7 @@ struct irqaction {
|
||||
irq_handler_t thread_fn;
|
||||
struct task_struct *thread;
|
||||
unsigned long thread_flags;
|
||||
unsigned long thread_mask;
|
||||
const char *name;
|
||||
struct proc_dir_entry *dir;
|
||||
} ____cacheline_internodealigned_in_smp;
|
||||
@@ -240,6 +233,35 @@ extern int irq_can_set_affinity(unsigned int irq);
|
||||
extern int irq_select_affinity(unsigned int irq);
|
||||
|
||||
extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
|
||||
|
||||
/**
|
||||
* struct irq_affinity_notify - context for notification of IRQ affinity changes
|
||||
* @irq: Interrupt to which notification applies
|
||||
* @kref: Reference count, for internal use
|
||||
* @work: Work item, for internal use
|
||||
* @notify: Function to be called on change. This will be
|
||||
* called in process context.
|
||||
* @release: Function to be called on release. This will be
|
||||
* called in process context. Once registered, the
|
||||
* structure must only be freed when this function is
|
||||
* called or later.
|
||||
*/
|
||||
struct irq_affinity_notify {
|
||||
unsigned int irq;
|
||||
struct kref kref;
|
||||
struct work_struct work;
|
||||
void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
|
||||
void (*release)(struct kref *ref);
|
||||
};
|
||||
|
||||
extern int
|
||||
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
|
||||
|
||||
static inline void irq_run_affinity_notifiers(void)
|
||||
{
|
||||
flush_scheduled_work();
|
||||
}
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
|
||||
static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
|
||||
@@ -255,7 +277,7 @@ static inline int irq_can_set_affinity(unsigned int irq)
|
||||
static inline int irq_select_affinity(unsigned int irq) { return 0; }
|
||||
|
||||
static inline int irq_set_affinity_hint(unsigned int irq,
|
||||
const struct cpumask *m)
|
||||
const struct cpumask *m)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -314,16 +336,24 @@ static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long
|
||||
}
|
||||
|
||||
/* IRQ wakeup (PM) control: */
|
||||
extern int set_irq_wake(unsigned int irq, unsigned int on);
|
||||
extern int irq_set_irq_wake(unsigned int irq, unsigned int on);
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
/* Please do not use: Use the replacement functions instead */
|
||||
static inline int set_irq_wake(unsigned int irq, unsigned int on)
|
||||
{
|
||||
return irq_set_irq_wake(irq, on);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int enable_irq_wake(unsigned int irq)
|
||||
{
|
||||
return set_irq_wake(irq, 1);
|
||||
return irq_set_irq_wake(irq, 1);
|
||||
}
|
||||
|
||||
static inline int disable_irq_wake(unsigned int irq)
|
||||
{
|
||||
return set_irq_wake(irq, 0);
|
||||
return irq_set_irq_wake(irq, 0);
|
||||
}
|
||||
|
||||
#else /* !CONFIG_GENERIC_HARDIRQS */
|
||||
@@ -353,6 +383,13 @@ static inline int disable_irq_wake(unsigned int irq)
|
||||
}
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
|
||||
#ifdef CONFIG_IRQ_FORCED_THREADING
|
||||
extern bool force_irqthreads;
|
||||
#else
|
||||
#define force_irqthreads (0)
|
||||
#endif
|
||||
|
||||
#ifndef __ARCH_SET_SOFTIRQ_PENDING
|
||||
#define set_softirq_pending(x) (local_softirq_pending() = (x))
|
||||
#define or_softirq_pending(x) (local_softirq_pending() |= (x))
|
||||
@@ -426,6 +463,13 @@ extern void raise_softirq(unsigned int nr);
|
||||
*/
|
||||
DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list);
|
||||
|
||||
DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
|
||||
|
||||
static inline struct task_struct *this_cpu_ksoftirqd(void)
|
||||
{
|
||||
return this_cpu_read(ksoftirqd);
|
||||
}
|
||||
|
||||
/* Try to send a softirq to a remote cpu. If this cannot be done, the
|
||||
* work will be queued to the local cpu.
|
||||
*/
|
||||
@@ -645,6 +689,7 @@ static inline void init_irq_proc(void)
|
||||
|
||||
struct seq_file;
|
||||
int show_interrupts(struct seq_file *p, void *v);
|
||||
int arch_show_interrupts(struct seq_file *p, int prec);
|
||||
|
||||
extern int early_irq_init(void);
|
||||
extern int arch_probe_nr_irqs(void);
|
||||
|
||||
@@ -89,6 +89,14 @@
|
||||
#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
|
||||
#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */
|
||||
|
||||
#define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | \
|
||||
IP_VS_CONN_F_NOOUTPUT | \
|
||||
IP_VS_CONN_F_INACTIVE | \
|
||||
IP_VS_CONN_F_SEQ_MASK | \
|
||||
IP_VS_CONN_F_NO_CPORT | \
|
||||
IP_VS_CONN_F_TEMPLATE \
|
||||
)
|
||||
|
||||
/* Flags that are not sent to backup server start from bit 16 */
|
||||
#define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */
|
||||
|
||||
|
||||
+297
-69
@@ -29,61 +29,104 @@
|
||||
#include <asm/irq_regs.h>
|
||||
|
||||
struct irq_desc;
|
||||
struct irq_data;
|
||||
typedef void (*irq_flow_handler_t)(unsigned int irq,
|
||||
struct irq_desc *desc);
|
||||
|
||||
typedef void (*irq_preflow_handler_t)(struct irq_data *data);
|
||||
|
||||
/*
|
||||
* IRQ line status.
|
||||
*
|
||||
* Bits 0-7 are reserved for the IRQF_* bits in linux/interrupt.h
|
||||
* Bits 0-7 are the same as the IRQF_* bits in linux/interrupt.h
|
||||
*
|
||||
* IRQ_TYPE_NONE - default, unspecified type
|
||||
* IRQ_TYPE_EDGE_RISING - rising edge triggered
|
||||
* IRQ_TYPE_EDGE_FALLING - falling edge triggered
|
||||
* IRQ_TYPE_EDGE_BOTH - rising and falling edge triggered
|
||||
* IRQ_TYPE_LEVEL_HIGH - high level triggered
|
||||
* IRQ_TYPE_LEVEL_LOW - low level triggered
|
||||
* IRQ_TYPE_LEVEL_MASK - Mask to filter out the level bits
|
||||
* IRQ_TYPE_SENSE_MASK - Mask for all the above bits
|
||||
* IRQ_TYPE_PROBE - Special flag for probing in progress
|
||||
*
|
||||
* Bits which can be modified via irq_set/clear/modify_status_flags()
|
||||
* IRQ_LEVEL - Interrupt is level type. Will be also
|
||||
* updated in the code when the above trigger
|
||||
* bits are modified via set_irq_type()
|
||||
* IRQ_PER_CPU - Mark an interrupt PER_CPU. Will protect
|
||||
* it from affinity setting
|
||||
* IRQ_NOPROBE - Interrupt cannot be probed by autoprobing
|
||||
* IRQ_NOREQUEST - Interrupt cannot be requested via
|
||||
* request_irq()
|
||||
* IRQ_NOAUTOEN - Interrupt is not automatically enabled in
|
||||
* request/setup_irq()
|
||||
* IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set)
|
||||
* IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context
|
||||
* IRQ_NESTED_TRHEAD - Interrupt nests into another thread
|
||||
*
|
||||
* Deprecated bits. They are kept updated as long as
|
||||
* CONFIG_GENERIC_HARDIRQS_NO_COMPAT is not set. Will go away soon. These bits
|
||||
* are internal state of the core code and if you really need to acces
|
||||
* them then talk to the genirq maintainer instead of hacking
|
||||
* something weird.
|
||||
*
|
||||
* IRQ types
|
||||
*/
|
||||
#define IRQ_TYPE_NONE 0x00000000 /* Default, unspecified type */
|
||||
#define IRQ_TYPE_EDGE_RISING 0x00000001 /* Edge rising type */
|
||||
#define IRQ_TYPE_EDGE_FALLING 0x00000002 /* Edge falling type */
|
||||
#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
|
||||
#define IRQ_TYPE_LEVEL_HIGH 0x00000004 /* Level high type */
|
||||
#define IRQ_TYPE_LEVEL_LOW 0x00000008 /* Level low type */
|
||||
#define IRQ_TYPE_SENSE_MASK 0x0000000f /* Mask of the above */
|
||||
#define IRQ_TYPE_PROBE 0x00000010 /* Probing in progress */
|
||||
enum {
|
||||
IRQ_TYPE_NONE = 0x00000000,
|
||||
IRQ_TYPE_EDGE_RISING = 0x00000001,
|
||||
IRQ_TYPE_EDGE_FALLING = 0x00000002,
|
||||
IRQ_TYPE_EDGE_BOTH = (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING),
|
||||
IRQ_TYPE_LEVEL_HIGH = 0x00000004,
|
||||
IRQ_TYPE_LEVEL_LOW = 0x00000008,
|
||||
IRQ_TYPE_LEVEL_MASK = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH),
|
||||
IRQ_TYPE_SENSE_MASK = 0x0000000f,
|
||||
|
||||
/* Internal flags */
|
||||
#define IRQ_INPROGRESS 0x00000100 /* IRQ handler active - do not enter! */
|
||||
#define IRQ_DISABLED 0x00000200 /* IRQ disabled - do not enter! */
|
||||
#define IRQ_PENDING 0x00000400 /* IRQ pending - replay on enable */
|
||||
#define IRQ_REPLAY 0x00000800 /* IRQ has been replayed but not acked yet */
|
||||
#define IRQ_AUTODETECT 0x00001000 /* IRQ is being autodetected */
|
||||
#define IRQ_WAITING 0x00002000 /* IRQ not yet seen - for autodetection */
|
||||
#define IRQ_LEVEL 0x00004000 /* IRQ level triggered */
|
||||
#define IRQ_MASKED 0x00008000 /* IRQ masked - shouldn't be seen again */
|
||||
#define IRQ_PER_CPU 0x00010000 /* IRQ is per CPU */
|
||||
#define IRQ_NOPROBE 0x00020000 /* IRQ is not valid for probing */
|
||||
#define IRQ_NOREQUEST 0x00040000 /* IRQ cannot be requested */
|
||||
#define IRQ_NOAUTOEN 0x00080000 /* IRQ will not be enabled on request irq */
|
||||
#define IRQ_WAKEUP 0x00100000 /* IRQ triggers system wakeup */
|
||||
#define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */
|
||||
#define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */
|
||||
#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */
|
||||
#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
|
||||
#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/
|
||||
#define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */
|
||||
#define IRQ_ONESHOT 0x08000000 /* IRQ is not unmasked after hardirq */
|
||||
#define IRQ_NESTED_THREAD 0x10000000 /* IRQ is nested into another, no own handler thread */
|
||||
IRQ_TYPE_PROBE = 0x00000010,
|
||||
|
||||
IRQ_LEVEL = (1 << 8),
|
||||
IRQ_PER_CPU = (1 << 9),
|
||||
IRQ_NOPROBE = (1 << 10),
|
||||
IRQ_NOREQUEST = (1 << 11),
|
||||
IRQ_NOAUTOEN = (1 << 12),
|
||||
IRQ_NO_BALANCING = (1 << 13),
|
||||
IRQ_MOVE_PCNTXT = (1 << 14),
|
||||
IRQ_NESTED_THREAD = (1 << 15),
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
IRQ_INPROGRESS = (1 << 16),
|
||||
IRQ_REPLAY = (1 << 17),
|
||||
IRQ_WAITING = (1 << 18),
|
||||
IRQ_DISABLED = (1 << 19),
|
||||
IRQ_PENDING = (1 << 20),
|
||||
IRQ_MASKED = (1 << 21),
|
||||
IRQ_MOVE_PENDING = (1 << 22),
|
||||
IRQ_AFFINITY_SET = (1 << 23),
|
||||
IRQ_WAKEUP = (1 << 24),
|
||||
#endif
|
||||
};
|
||||
|
||||
#define IRQF_MODIFY_MASK \
|
||||
(IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
|
||||
IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
|
||||
IRQ_PER_CPU)
|
||||
IRQ_PER_CPU | IRQ_NESTED_THREAD)
|
||||
|
||||
#ifdef CONFIG_IRQ_PER_CPU
|
||||
# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
|
||||
# define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
|
||||
#else
|
||||
# define CHECK_IRQ_PER_CPU(var) 0
|
||||
# define IRQ_NO_BALANCING_MASK IRQ_NO_BALANCING
|
||||
#endif
|
||||
#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
|
||||
|
||||
static inline __deprecated bool CHECK_IRQ_PER_CPU(unsigned int status)
|
||||
{
|
||||
return status & IRQ_PER_CPU;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return value for chip->irq_set_affinity()
|
||||
*
|
||||
* IRQ_SET_MASK_OK - OK, core updates irq_data.affinity
|
||||
* IRQ_SET_MASK_NOCPY - OK, chip did update irq_data.affinity
|
||||
*/
|
||||
enum {
|
||||
IRQ_SET_MASK_OK = 0,
|
||||
IRQ_SET_MASK_OK_NOCOPY,
|
||||
};
|
||||
|
||||
struct msi_desc;
|
||||
|
||||
@@ -91,6 +134,8 @@ struct msi_desc;
|
||||
* struct irq_data - per irq and irq chip data passed down to chip functions
|
||||
* @irq: interrupt number
|
||||
* @node: node index useful for balancing
|
||||
* @state_use_accessor: status information for irq chip functions.
|
||||
* Use accessor functions to deal with it
|
||||
* @chip: low level interrupt hardware access
|
||||
* @handler_data: per-IRQ data for the irq_chip methods
|
||||
* @chip_data: platform-specific per-chip private data for the chip
|
||||
@@ -105,6 +150,7 @@ struct msi_desc;
|
||||
struct irq_data {
|
||||
unsigned int irq;
|
||||
unsigned int node;
|
||||
unsigned int state_use_accessors;
|
||||
struct irq_chip *chip;
|
||||
void *handler_data;
|
||||
void *chip_data;
|
||||
@@ -114,6 +160,80 @@ struct irq_data {
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Bit masks for irq_data.state
|
||||
*
|
||||
* IRQD_TRIGGER_MASK - Mask for the trigger type bits
|
||||
* IRQD_SETAFFINITY_PENDING - Affinity setting is pending
|
||||
* IRQD_NO_BALANCING - Balancing disabled for this IRQ
|
||||
* IRQD_PER_CPU - Interrupt is per cpu
|
||||
* IRQD_AFFINITY_SET - Interrupt affinity was set
|
||||
* IRQD_LEVEL - Interrupt is level triggered
|
||||
* IRQD_WAKEUP_STATE - Interrupt is configured for wakeup
|
||||
* from suspend
|
||||
* IRDQ_MOVE_PCNTXT - Interrupt can be moved in process
|
||||
* context
|
||||
*/
|
||||
enum {
|
||||
IRQD_TRIGGER_MASK = 0xf,
|
||||
IRQD_SETAFFINITY_PENDING = (1 << 8),
|
||||
IRQD_NO_BALANCING = (1 << 10),
|
||||
IRQD_PER_CPU = (1 << 11),
|
||||
IRQD_AFFINITY_SET = (1 << 12),
|
||||
IRQD_LEVEL = (1 << 13),
|
||||
IRQD_WAKEUP_STATE = (1 << 14),
|
||||
IRQD_MOVE_PCNTXT = (1 << 15),
|
||||
};
|
||||
|
||||
static inline bool irqd_is_setaffinity_pending(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_SETAFFINITY_PENDING;
|
||||
}
|
||||
|
||||
static inline bool irqd_is_per_cpu(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_PER_CPU;
|
||||
}
|
||||
|
||||
static inline bool irqd_can_balance(struct irq_data *d)
|
||||
{
|
||||
return !(d->state_use_accessors & (IRQD_PER_CPU | IRQD_NO_BALANCING));
|
||||
}
|
||||
|
||||
static inline bool irqd_affinity_was_set(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_AFFINITY_SET;
|
||||
}
|
||||
|
||||
static inline u32 irqd_get_trigger_type(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_TRIGGER_MASK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Must only be called inside irq_chip.irq_set_type() functions.
|
||||
*/
|
||||
static inline void irqd_set_trigger_type(struct irq_data *d, u32 type)
|
||||
{
|
||||
d->state_use_accessors &= ~IRQD_TRIGGER_MASK;
|
||||
d->state_use_accessors |= type & IRQD_TRIGGER_MASK;
|
||||
}
|
||||
|
||||
static inline bool irqd_is_level_type(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_LEVEL;
|
||||
}
|
||||
|
||||
static inline bool irqd_is_wakeup_set(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_WAKEUP_STATE;
|
||||
}
|
||||
|
||||
static inline bool irqd_can_move_in_process_context(struct irq_data *d)
|
||||
{
|
||||
return d->state_use_accessors & IRQD_MOVE_PCNTXT;
|
||||
}
|
||||
|
||||
/**
|
||||
* struct irq_chip - hardware interrupt chip descriptor
|
||||
*
|
||||
@@ -150,6 +270,7 @@ struct irq_data {
|
||||
* @irq_set_wake: enable/disable power-management wake-on of an IRQ
|
||||
* @irq_bus_lock: function to lock access to slow bus (i2c) chips
|
||||
* @irq_bus_sync_unlock:function to sync and unlock slow bus (i2c) chips
|
||||
* @flags: chip specific flags
|
||||
*
|
||||
* @release: release function solely used by UML
|
||||
*/
|
||||
@@ -196,12 +317,27 @@ struct irq_chip {
|
||||
void (*irq_bus_lock)(struct irq_data *data);
|
||||
void (*irq_bus_sync_unlock)(struct irq_data *data);
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
/* Currently used only by UML, might disappear one day.*/
|
||||
#ifdef CONFIG_IRQ_RELEASE_METHOD
|
||||
void (*release)(unsigned int irq, void *dev_id);
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* irq_chip specific flags
|
||||
*
|
||||
* IRQCHIP_SET_TYPE_MASKED: Mask before calling chip.irq_set_type()
|
||||
* IRQCHIP_EOI_IF_HANDLED: Only issue irq_eoi() when irq was handled
|
||||
* IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path
|
||||
*/
|
||||
enum {
|
||||
IRQCHIP_SET_TYPE_MASKED = (1 << 0),
|
||||
IRQCHIP_EOI_IF_HANDLED = (1 << 1),
|
||||
IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
|
||||
};
|
||||
|
||||
/* This include will go away once we isolated irq_desc usage to core code */
|
||||
#include <linux/irqdesc.h>
|
||||
|
||||
@@ -218,7 +354,7 @@ struct irq_chip {
|
||||
# define ARCH_IRQ_INIT_FLAGS 0
|
||||
#endif
|
||||
|
||||
#define IRQ_DEFAULT_INIT_FLAGS (IRQ_DISABLED | ARCH_IRQ_INIT_FLAGS)
|
||||
#define IRQ_DEFAULT_INIT_FLAGS ARCH_IRQ_INIT_FLAGS
|
||||
|
||||
struct irqaction;
|
||||
extern int setup_irq(unsigned int irq, struct irqaction *new);
|
||||
@@ -229,9 +365,13 @@ extern void remove_irq(unsigned int irq, struct irqaction *act);
|
||||
#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
|
||||
void move_native_irq(int irq);
|
||||
void move_masked_irq(int irq);
|
||||
void irq_move_irq(struct irq_data *data);
|
||||
void irq_move_masked_irq(struct irq_data *data);
|
||||
#else
|
||||
static inline void move_native_irq(int irq) { }
|
||||
static inline void move_masked_irq(int irq) { }
|
||||
static inline void irq_move_irq(struct irq_data *data) { }
|
||||
static inline void irq_move_masked_irq(struct irq_data *data) { }
|
||||
#endif
|
||||
|
||||
extern int no_irq_affinity;
|
||||
@@ -267,23 +407,23 @@ extern struct irq_chip no_irq_chip;
|
||||
extern struct irq_chip dummy_irq_chip;
|
||||
|
||||
extern void
|
||||
set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
|
||||
irq_flow_handler_t handle);
|
||||
extern void
|
||||
set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
|
||||
irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
|
||||
irq_flow_handler_t handle, const char *name);
|
||||
|
||||
static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *chip,
|
||||
irq_flow_handler_t handle)
|
||||
{
|
||||
irq_set_chip_and_handler_name(irq, chip, handle, NULL);
|
||||
}
|
||||
|
||||
extern void
|
||||
__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
|
||||
__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
|
||||
const char *name);
|
||||
|
||||
/*
|
||||
* Set a highlevel flow handler for a given IRQ:
|
||||
*/
|
||||
static inline void
|
||||
set_irq_handler(unsigned int irq, irq_flow_handler_t handle)
|
||||
irq_set_handler(unsigned int irq, irq_flow_handler_t handle)
|
||||
{
|
||||
__set_irq_handler(irq, handle, 0, NULL);
|
||||
__irq_set_handler(irq, handle, 0, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -292,14 +432,11 @@ set_irq_handler(unsigned int irq, irq_flow_handler_t handle)
|
||||
* IRQ_NOREQUEST and IRQ_NOPROBE)
|
||||
*/
|
||||
static inline void
|
||||
set_irq_chained_handler(unsigned int irq,
|
||||
irq_flow_handler_t handle)
|
||||
irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle)
|
||||
{
|
||||
__set_irq_handler(irq, handle, 1, NULL);
|
||||
__irq_set_handler(irq, handle, 1, NULL);
|
||||
}
|
||||
|
||||
extern void set_irq_nested_thread(unsigned int irq, int nest);
|
||||
|
||||
void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set);
|
||||
|
||||
static inline void irq_set_status_flags(unsigned int irq, unsigned long set)
|
||||
@@ -312,16 +449,24 @@ static inline void irq_clear_status_flags(unsigned int irq, unsigned long clr)
|
||||
irq_modify_status(irq, clr, 0);
|
||||
}
|
||||
|
||||
static inline void set_irq_noprobe(unsigned int irq)
|
||||
static inline void irq_set_noprobe(unsigned int irq)
|
||||
{
|
||||
irq_modify_status(irq, 0, IRQ_NOPROBE);
|
||||
}
|
||||
|
||||
static inline void set_irq_probe(unsigned int irq)
|
||||
static inline void irq_set_probe(unsigned int irq)
|
||||
{
|
||||
irq_modify_status(irq, IRQ_NOPROBE, 0);
|
||||
}
|
||||
|
||||
static inline void irq_set_nested_thread(unsigned int irq, bool nest)
|
||||
{
|
||||
if (nest)
|
||||
irq_set_status_flags(irq, IRQ_NESTED_THREAD);
|
||||
else
|
||||
irq_clear_status_flags(irq, IRQ_NESTED_THREAD);
|
||||
}
|
||||
|
||||
/* Handle dynamic irq creation and destruction */
|
||||
extern unsigned int create_irq_nr(unsigned int irq_want, int node);
|
||||
extern int create_irq(void);
|
||||
@@ -338,14 +483,14 @@ static inline void dynamic_irq_init(unsigned int irq)
|
||||
}
|
||||
|
||||
/* Set/get chip/data for an IRQ: */
|
||||
extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
|
||||
extern int set_irq_data(unsigned int irq, void *data);
|
||||
extern int set_irq_chip_data(unsigned int irq, void *data);
|
||||
extern int set_irq_type(unsigned int irq, unsigned int type);
|
||||
extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
|
||||
extern int irq_set_chip(unsigned int irq, struct irq_chip *chip);
|
||||
extern int irq_set_handler_data(unsigned int irq, void *data);
|
||||
extern int irq_set_chip_data(unsigned int irq, void *data);
|
||||
extern int irq_set_irq_type(unsigned int irq, unsigned int type);
|
||||
extern int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry);
|
||||
extern struct irq_data *irq_get_irq_data(unsigned int irq);
|
||||
|
||||
static inline struct irq_chip *get_irq_chip(unsigned int irq)
|
||||
static inline struct irq_chip *irq_get_chip(unsigned int irq)
|
||||
{
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
return d ? d->chip : NULL;
|
||||
@@ -356,7 +501,7 @@ static inline struct irq_chip *irq_data_get_irq_chip(struct irq_data *d)
|
||||
return d->chip;
|
||||
}
|
||||
|
||||
static inline void *get_irq_chip_data(unsigned int irq)
|
||||
static inline void *irq_get_chip_data(unsigned int irq)
|
||||
{
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
return d ? d->chip_data : NULL;
|
||||
@@ -367,18 +512,18 @@ static inline void *irq_data_get_irq_chip_data(struct irq_data *d)
|
||||
return d->chip_data;
|
||||
}
|
||||
|
||||
static inline void *get_irq_data(unsigned int irq)
|
||||
static inline void *irq_get_handler_data(unsigned int irq)
|
||||
{
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
return d ? d->handler_data : NULL;
|
||||
}
|
||||
|
||||
static inline void *irq_data_get_irq_data(struct irq_data *d)
|
||||
static inline void *irq_data_get_irq_handler_data(struct irq_data *d)
|
||||
{
|
||||
return d->handler_data;
|
||||
}
|
||||
|
||||
static inline struct msi_desc *get_irq_msi(unsigned int irq)
|
||||
static inline struct msi_desc *irq_get_msi_desc(unsigned int irq)
|
||||
{
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
return d ? d->msi_desc : NULL;
|
||||
@@ -389,6 +534,89 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
|
||||
return d->msi_desc;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
/* Please do not use: Use the replacement functions instead */
|
||||
static inline int set_irq_chip(unsigned int irq, struct irq_chip *chip)
|
||||
{
|
||||
return irq_set_chip(irq, chip);
|
||||
}
|
||||
static inline int set_irq_data(unsigned int irq, void *data)
|
||||
{
|
||||
return irq_set_handler_data(irq, data);
|
||||
}
|
||||
static inline int set_irq_chip_data(unsigned int irq, void *data)
|
||||
{
|
||||
return irq_set_chip_data(irq, data);
|
||||
}
|
||||
static inline int set_irq_type(unsigned int irq, unsigned int type)
|
||||
{
|
||||
return irq_set_irq_type(irq, type);
|
||||
}
|
||||
static inline int set_irq_msi(unsigned int irq, struct msi_desc *entry)
|
||||
{
|
||||
return irq_set_msi_desc(irq, entry);
|
||||
}
|
||||
static inline struct irq_chip *get_irq_chip(unsigned int irq)
|
||||
{
|
||||
return irq_get_chip(irq);
|
||||
}
|
||||
static inline void *get_irq_chip_data(unsigned int irq)
|
||||
{
|
||||
return irq_get_chip_data(irq);
|
||||
}
|
||||
static inline void *get_irq_data(unsigned int irq)
|
||||
{
|
||||
return irq_get_handler_data(irq);
|
||||
}
|
||||
static inline void *irq_data_get_irq_data(struct irq_data *d)
|
||||
{
|
||||
return irq_data_get_irq_handler_data(d);
|
||||
}
|
||||
static inline struct msi_desc *get_irq_msi(unsigned int irq)
|
||||
{
|
||||
return irq_get_msi_desc(irq);
|
||||
}
|
||||
static inline void set_irq_noprobe(unsigned int irq)
|
||||
{
|
||||
irq_set_noprobe(irq);
|
||||
}
|
||||
static inline void set_irq_probe(unsigned int irq)
|
||||
{
|
||||
irq_set_probe(irq);
|
||||
}
|
||||
static inline void set_irq_nested_thread(unsigned int irq, int nest)
|
||||
{
|
||||
irq_set_nested_thread(irq, nest);
|
||||
}
|
||||
static inline void
|
||||
set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
|
||||
irq_flow_handler_t handle, const char *name)
|
||||
{
|
||||
irq_set_chip_and_handler_name(irq, chip, handle, name);
|
||||
}
|
||||
static inline void
|
||||
set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
|
||||
irq_flow_handler_t handle)
|
||||
{
|
||||
irq_set_chip_and_handler(irq, chip, handle);
|
||||
}
|
||||
static inline void
|
||||
__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
|
||||
const char *name)
|
||||
{
|
||||
__irq_set_handler(irq, handle, is_chained, name);
|
||||
}
|
||||
static inline void set_irq_handler(unsigned int irq, irq_flow_handler_t handle)
|
||||
{
|
||||
irq_set_handler(irq, handle);
|
||||
}
|
||||
static inline void
|
||||
set_irq_chained_handler(unsigned int irq, irq_flow_handler_t handle)
|
||||
{
|
||||
irq_set_chained_handler(irq, handle);
|
||||
}
|
||||
#endif
|
||||
|
||||
int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node);
|
||||
void irq_free_descs(unsigned int irq, unsigned int cnt);
|
||||
int irq_reserve_irqs(unsigned int from, unsigned int cnt);
|
||||
|
||||
+73
-5
@@ -8,6 +8,7 @@
|
||||
* For now it's included from <linux/irq.h>
|
||||
*/
|
||||
|
||||
struct irq_affinity_notify;
|
||||
struct proc_dir_entry;
|
||||
struct timer_rand_state;
|
||||
/**
|
||||
@@ -18,13 +19,16 @@ struct timer_rand_state;
|
||||
* @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()]
|
||||
* @action: the irq action chain
|
||||
* @status: status information
|
||||
* @core_internal_state__do_not_mess_with_it: core internal status information
|
||||
* @depth: disable-depth, for nested irq_disable() calls
|
||||
* @wake_depth: enable depth, for multiple set_irq_wake() callers
|
||||
* @irq_count: stats field to detect stalled irqs
|
||||
* @last_unhandled: aging timer for unhandled count
|
||||
* @irqs_unhandled: stats field for spurious unhandled interrupts
|
||||
* @lock: locking for SMP
|
||||
* @affinity_notify: context for notification of affinity changes
|
||||
* @pending_mask: pending rebalanced interrupts
|
||||
* @threads_oneshot: bitfield to handle shared oneshot threads
|
||||
* @threads_active: number of irqaction threads currently running
|
||||
* @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
|
||||
* @dir: /proc/irq/ procfs entry
|
||||
@@ -45,6 +49,7 @@ struct irq_desc {
|
||||
struct {
|
||||
unsigned int irq;
|
||||
unsigned int node;
|
||||
unsigned int pad_do_not_even_think_about_it;
|
||||
struct irq_chip *chip;
|
||||
void *handler_data;
|
||||
void *chip_data;
|
||||
@@ -59,9 +64,16 @@ struct irq_desc {
|
||||
struct timer_rand_state *timer_rand_state;
|
||||
unsigned int __percpu *kstat_irqs;
|
||||
irq_flow_handler_t handle_irq;
|
||||
#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
|
||||
irq_preflow_handler_t preflow_handler;
|
||||
#endif
|
||||
struct irqaction *action; /* IRQ action list */
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
unsigned int status_use_accessors;
|
||||
#else
|
||||
unsigned int status; /* IRQ status */
|
||||
|
||||
#endif
|
||||
unsigned int core_internal_state__do_not_mess_with_it;
|
||||
unsigned int depth; /* nested irq disables */
|
||||
unsigned int wake_depth; /* nested wake enables */
|
||||
unsigned int irq_count; /* For detecting broken IRQs */
|
||||
@@ -70,10 +82,12 @@ struct irq_desc {
|
||||
raw_spinlock_t lock;
|
||||
#ifdef CONFIG_SMP
|
||||
const struct cpumask *affinity_hint;
|
||||
struct irq_affinity_notify *affinity_notify;
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
cpumask_var_t pending_mask;
|
||||
#endif
|
||||
#endif
|
||||
unsigned long threads_oneshot;
|
||||
atomic_t threads_active;
|
||||
wait_queue_head_t wait_for_threads;
|
||||
#ifdef CONFIG_PROC_FS
|
||||
@@ -95,10 +109,51 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
|
||||
#define get_irq_desc_chip(desc) ((desc)->irq_data.chip)
|
||||
#define get_irq_desc_chip_data(desc) ((desc)->irq_data.chip_data)
|
||||
#define get_irq_desc_data(desc) ((desc)->irq_data.handler_data)
|
||||
#define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc)
|
||||
static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc)
|
||||
{
|
||||
return &desc->irq_data;
|
||||
}
|
||||
|
||||
static inline struct irq_chip *irq_desc_get_chip(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.chip;
|
||||
}
|
||||
|
||||
static inline void *irq_desc_get_chip_data(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.chip_data;
|
||||
}
|
||||
|
||||
static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.handler_data;
|
||||
}
|
||||
|
||||
static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.msi_desc;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
static inline struct irq_chip *get_irq_desc_chip(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_chip(desc);
|
||||
}
|
||||
static inline void *get_irq_desc_data(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_handler_data(desc);
|
||||
}
|
||||
|
||||
static inline void *get_irq_desc_chip_data(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_chip_data(desc);
|
||||
}
|
||||
|
||||
static inline struct msi_desc *get_irq_desc_msi(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_msi_desc(desc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Architectures call this to let the generic IRQ layer
|
||||
@@ -123,6 +178,7 @@ static inline int irq_has_action(unsigned int irq)
|
||||
return desc->action != NULL;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
static inline int irq_balancing_disabled(unsigned int irq)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
@@ -130,6 +186,7 @@ static inline int irq_balancing_disabled(unsigned int irq)
|
||||
desc = irq_to_desc(irq);
|
||||
return desc->status & IRQ_NO_BALANCING_MASK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* caller has locked the irq_desc and both params are valid */
|
||||
static inline void __set_irq_handler_unlocked(int irq,
|
||||
@@ -140,6 +197,17 @@ static inline void __set_irq_handler_unlocked(int irq,
|
||||
desc = irq_to_desc(irq);
|
||||
desc->handle_irq = handler;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
|
||||
static inline void
|
||||
__irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
|
||||
desc = irq_to_desc(irq);
|
||||
desc->preflow_handler = handler;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -307,6 +307,7 @@ extern clock_t jiffies_to_clock_t(long x);
|
||||
extern unsigned long clock_t_to_jiffies(unsigned long x);
|
||||
extern u64 jiffies_64_to_clock_t(u64 x);
|
||||
extern u64 nsec_to_clock_t(u64 x);
|
||||
extern u64 nsecs_to_jiffies64(u64 n);
|
||||
extern unsigned long nsecs_to_jiffies(u64 n);
|
||||
|
||||
#define TIMESTAMP_SIZE 30
|
||||
|
||||
@@ -50,11 +50,12 @@ struct kbd_struct {
|
||||
#define VC_CAPSLOCK 2 /* capslock mode */
|
||||
#define VC_KANALOCK 3 /* kanalock mode */
|
||||
|
||||
unsigned char kbdmode:2; /* one 2-bit value */
|
||||
unsigned char kbdmode:3; /* one 3-bit value */
|
||||
#define VC_XLATE 0 /* translate keycodes using keymap */
|
||||
#define VC_MEDIUMRAW 1 /* medium raw (keycode) mode */
|
||||
#define VC_RAW 2 /* raw (scancode) mode */
|
||||
#define VC_UNICODE 3 /* Unicode mode */
|
||||
#define VC_OFF 4 /* disabled mode */
|
||||
|
||||
unsigned char modeflags:5;
|
||||
#define VC_APPLIC 0 /* application key mode */
|
||||
|
||||
@@ -81,6 +81,7 @@ struct unimapinit {
|
||||
#define K_XLATE 0x01
|
||||
#define K_MEDIUMRAW 0x02
|
||||
#define K_UNICODE 0x03
|
||||
#define K_OFF 0x04
|
||||
#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
|
||||
#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ struct key_type {
|
||||
*/
|
||||
size_t def_datalen;
|
||||
|
||||
/* vet a description */
|
||||
int (*vet_description)(const char *description);
|
||||
|
||||
/* instantiate a key of this type
|
||||
* - this method should call key_payload_reserve() to determine if the
|
||||
* user's quota will hold the payload
|
||||
@@ -102,11 +105,20 @@ extern int key_instantiate_and_link(struct key *key,
|
||||
size_t datalen,
|
||||
struct key *keyring,
|
||||
struct key *instkey);
|
||||
extern int key_negate_and_link(struct key *key,
|
||||
extern int key_reject_and_link(struct key *key,
|
||||
unsigned timeout,
|
||||
unsigned error,
|
||||
struct key *keyring,
|
||||
struct key *instkey);
|
||||
extern void complete_request_key(struct key_construction *cons, int error);
|
||||
|
||||
static inline int key_negate_and_link(struct key *key,
|
||||
unsigned timeout,
|
||||
struct key *keyring,
|
||||
struct key *instkey)
|
||||
{
|
||||
return key_reject_and_link(key, timeout, ENOKEY, keyring, instkey);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_KEYS */
|
||||
#endif /* _LINUX_KEY_TYPE_H */
|
||||
|
||||
@@ -170,6 +170,7 @@ struct key {
|
||||
struct list_head link;
|
||||
unsigned long x[2];
|
||||
void *p[2];
|
||||
int reject_error;
|
||||
} type_data;
|
||||
|
||||
/* key data
|
||||
@@ -275,6 +276,10 @@ static inline key_serial_t key_serial(struct key *key)
|
||||
return key ? key->serial : 0;
|
||||
}
|
||||
|
||||
#define rcu_dereference_key(KEY) \
|
||||
(rcu_dereference_protected((KEY)->payload.rcudata, \
|
||||
rwsem_is_locked(&((struct key *)(KEY))->sem)))
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
extern ctl_table key_sysctls[];
|
||||
#endif
|
||||
|
||||
@@ -53,5 +53,7 @@
|
||||
#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
|
||||
#define KEYCTL_GET_SECURITY 17 /* get key security label */
|
||||
#define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */
|
||||
#define KEYCTL_REJECT 19 /* reject a partially constructed key */
|
||||
#define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */
|
||||
|
||||
#endif /* _LINUX_KEYCTL_H */
|
||||
|
||||
@@ -85,11 +85,13 @@ static inline const char *kobject_name(const struct kobject *kobj)
|
||||
extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
|
||||
extern int __must_check kobject_add(struct kobject *kobj,
|
||||
struct kobject *parent,
|
||||
const char *fmt, ...);
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf, 3, 4)));
|
||||
extern int __must_check kobject_init_and_add(struct kobject *kobj,
|
||||
struct kobj_type *ktype,
|
||||
struct kobject *parent,
|
||||
const char *fmt, ...);
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf, 4, 5)));
|
||||
|
||||
extern void kobject_del(struct kobject *kobj);
|
||||
|
||||
@@ -224,8 +226,8 @@ static inline int kobject_uevent_env(struct kobject *kobj,
|
||||
char *envp[])
|
||||
{ return 0; }
|
||||
|
||||
static inline int add_uevent_var(struct kobj_uevent_env *env,
|
||||
const char *format, ...)
|
||||
static inline __attribute__((format(printf, 2, 3)))
|
||||
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
|
||||
{ return 0; }
|
||||
|
||||
static inline int kobject_action_type(const char *buf, size_t count,
|
||||
|
||||
@@ -64,7 +64,7 @@ struct kthread_work {
|
||||
};
|
||||
|
||||
#define KTHREAD_WORKER_INIT(worker) { \
|
||||
.lock = SPIN_LOCK_UNLOCKED, \
|
||||
.lock = __SPIN_LOCK_UNLOCKED((worker).lock), \
|
||||
.work_list = LIST_HEAD_INIT((worker).work_list), \
|
||||
}
|
||||
|
||||
|
||||
@@ -179,10 +179,6 @@ enum {
|
||||
ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
|
||||
/* (doesn't imply presence) */
|
||||
ATA_FLAG_SATA = (1 << 1),
|
||||
ATA_FLAG_NO_LEGACY = (1 << 2), /* no legacy mode check */
|
||||
ATA_FLAG_MMIO = (1 << 3), /* use MMIO, not PIO */
|
||||
ATA_FLAG_SRST = (1 << 4), /* (obsolete) use ATA SRST, not E.D.D. */
|
||||
ATA_FLAG_SATA_RESET = (1 << 5), /* (obsolete) use COMRESET */
|
||||
ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */
|
||||
ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
|
||||
ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */
|
||||
@@ -198,7 +194,6 @@ enum {
|
||||
ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
|
||||
ATA_FLAG_AN = (1 << 18), /* controller supports AN */
|
||||
ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */
|
||||
ATA_FLAG_LPM = (1 << 20), /* driver can handle LPM */
|
||||
ATA_FLAG_EM = (1 << 21), /* driver supports enclosure
|
||||
* management */
|
||||
ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
|
||||
@@ -1050,6 +1045,8 @@ extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
|
||||
int queue_depth, int reason);
|
||||
extern struct ata_device *ata_dev_pair(struct ata_device *adev);
|
||||
extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
|
||||
extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
|
||||
extern void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, struct list_head *eh_q);
|
||||
|
||||
extern int ata_cable_40wire(struct ata_port *ap);
|
||||
extern int ata_cable_80wire(struct ata_port *ap);
|
||||
@@ -1613,6 +1610,9 @@ extern void ata_sff_irq_on(struct ata_port *ap);
|
||||
extern void ata_sff_irq_clear(struct ata_port *ap);
|
||||
extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
|
||||
u8 status, int in_wq);
|
||||
extern void ata_sff_queue_work(struct work_struct *work);
|
||||
extern void ata_sff_queue_delayed_work(struct delayed_work *dwork,
|
||||
unsigned long delay);
|
||||
extern void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay);
|
||||
extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
|
||||
extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
|
||||
|
||||
@@ -96,6 +96,11 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
|
||||
* in an undefined state.
|
||||
*/
|
||||
#ifndef CONFIG_DEBUG_LIST
|
||||
static inline void __list_del_entry(struct list_head *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
}
|
||||
|
||||
static inline void list_del(struct list_head *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
@@ -103,6 +108,7 @@ static inline void list_del(struct list_head *entry)
|
||||
entry->prev = LIST_POISON2;
|
||||
}
|
||||
#else
|
||||
extern void __list_del_entry(struct list_head *entry);
|
||||
extern void list_del(struct list_head *entry);
|
||||
#endif
|
||||
|
||||
@@ -135,7 +141,7 @@ static inline void list_replace_init(struct list_head *old,
|
||||
*/
|
||||
static inline void list_del_init(struct list_head *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
__list_del_entry(entry);
|
||||
INIT_LIST_HEAD(entry);
|
||||
}
|
||||
|
||||
@@ -146,7 +152,7 @@ static inline void list_del_init(struct list_head *entry)
|
||||
*/
|
||||
static inline void list_move(struct list_head *list, struct list_head *head)
|
||||
{
|
||||
__list_del(list->prev, list->next);
|
||||
__list_del_entry(list);
|
||||
list_add(list, head);
|
||||
}
|
||||
|
||||
@@ -158,7 +164,7 @@ static inline void list_move(struct list_head *list, struct list_head *head)
|
||||
static inline void list_move_tail(struct list_head *list,
|
||||
struct list_head *head)
|
||||
{
|
||||
__list_del(list->prev, list->next);
|
||||
__list_del_entry(list);
|
||||
list_add_tail(list, head);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define ISOFS_SUPER_MAGIC 0x9660
|
||||
#define JFFS2_SUPER_MAGIC 0x72b6
|
||||
#define ANON_INODE_FS_MAGIC 0x09041934
|
||||
#define PSTOREFS_MAGIC 0x6165676C
|
||||
|
||||
#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
|
||||
#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
#include <linux/mutex.h>
|
||||
|
||||
struct memory_block {
|
||||
unsigned long phys_index;
|
||||
unsigned long start_section_nr;
|
||||
unsigned long end_section_nr;
|
||||
unsigned long state;
|
||||
int section_count;
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ struct wm8994 {
|
||||
u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
|
||||
|
||||
/* Used over suspend/resume */
|
||||
bool suspended;
|
||||
u16 ldo_regs[WM8994_NUM_LDO_REGS];
|
||||
u16 gpio_regs[WM8994_NUM_GPIO_REGS];
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef _MICREL_PHY_H
|
||||
#define _MICREL_PHY_H
|
||||
|
||||
#define MICREL_PHY_ID_MASK 0x00fffff0
|
||||
|
||||
#define PHY_ID_KSZ9021 0x00221611
|
||||
#define PHY_ID_KS8737 0x00221720
|
||||
#define PHY_ID_KS8041 0x00221510
|
||||
#define PHY_ID_KS8051 0x00221550
|
||||
/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */
|
||||
#define PHY_ID_KS8001 0x0022161A
|
||||
|
||||
/* struct phy_device dev_flags definitions */
|
||||
#define MICREL_PHY_50MHZ_CLK 0x00000001
|
||||
|
||||
#endif /* _MICREL_PHY_H */
|
||||
@@ -1309,8 +1309,6 @@ int add_from_early_node_map(struct range *range, int az,
|
||||
int nr_range, int nid);
|
||||
u64 __init find_memory_core_early(int nid, u64 size, u64 align,
|
||||
u64 goal, u64 limit);
|
||||
void *__alloc_memory_core_early(int nodeid, u64 size, u64 align,
|
||||
u64 goal, u64 limit);
|
||||
typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
|
||||
extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
|
||||
extern void sparse_memory_present_with_active_regions(int nid);
|
||||
|
||||
@@ -62,7 +62,7 @@ struct module_version_attribute {
|
||||
struct module_attribute mattr;
|
||||
const char *module_name;
|
||||
const char *version;
|
||||
};
|
||||
} __attribute__ ((__aligned__(sizeof(void *))));
|
||||
|
||||
struct module_kobject
|
||||
{
|
||||
|
||||
@@ -19,7 +19,6 @@ struct nameidata {
|
||||
struct path path;
|
||||
struct qstr last;
|
||||
struct path root;
|
||||
struct file *file;
|
||||
struct inode *inode; /* path.dentry.d_inode */
|
||||
unsigned int flags;
|
||||
unsigned seq;
|
||||
@@ -63,6 +62,10 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
|
||||
#define LOOKUP_EXCL 0x0400
|
||||
#define LOOKUP_RENAME_TARGET 0x0800
|
||||
|
||||
#define LOOKUP_JUMPED 0x1000
|
||||
#define LOOKUP_ROOT 0x2000
|
||||
#define LOOKUP_EMPTY 0x4000
|
||||
|
||||
extern int user_path_at(int, const char __user *, unsigned, struct path *);
|
||||
|
||||
#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path)
|
||||
@@ -72,7 +75,7 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *);
|
||||
|
||||
extern int kern_path(const char *, unsigned, struct path *);
|
||||
|
||||
extern int path_lookup(const char *, unsigned, struct nameidata *);
|
||||
extern int kern_path_parent(const char *, struct nameidata *);
|
||||
extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
|
||||
const char *, unsigned int, struct nameidata *);
|
||||
|
||||
|
||||
+2
-1
@@ -118,6 +118,7 @@ enum sock_shutdown_cmd {
|
||||
};
|
||||
|
||||
struct socket_wq {
|
||||
/* Note: wait MUST be first field of socket_wq */
|
||||
wait_queue_head_t wait;
|
||||
struct fasync_struct *fasync_list;
|
||||
struct rcu_head rcu;
|
||||
@@ -142,7 +143,7 @@ struct socket {
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
struct socket_wq *wq;
|
||||
struct socket_wq __rcu *wq;
|
||||
|
||||
struct file *file;
|
||||
struct sock *sk;
|
||||
|
||||
+280
-28
@@ -138,6 +138,9 @@ static inline bool dev_xmit_complete(int rc)
|
||||
|
||||
#define MAX_ADDR_LEN 32 /* Largest hardware address length */
|
||||
|
||||
/* Initial net device group. All devices belong to group 0 by default. */
|
||||
#define INIT_NETDEV_GROUP 0
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/*
|
||||
* Compute the worst case header length according to the protocols
|
||||
@@ -387,7 +390,55 @@ enum gro_result {
|
||||
};
|
||||
typedef enum gro_result gro_result_t;
|
||||
|
||||
typedef struct sk_buff *rx_handler_func_t(struct sk_buff *skb);
|
||||
/*
|
||||
* enum rx_handler_result - Possible return values for rx_handlers.
|
||||
* @RX_HANDLER_CONSUMED: skb was consumed by rx_handler, do not process it
|
||||
* further.
|
||||
* @RX_HANDLER_ANOTHER: Do another round in receive path. This is indicated in
|
||||
* case skb->dev was changed by rx_handler.
|
||||
* @RX_HANDLER_EXACT: Force exact delivery, no wildcard.
|
||||
* @RX_HANDLER_PASS: Do nothing, passe the skb as if no rx_handler was called.
|
||||
*
|
||||
* rx_handlers are functions called from inside __netif_receive_skb(), to do
|
||||
* special processing of the skb, prior to delivery to protocol handlers.
|
||||
*
|
||||
* Currently, a net_device can only have a single rx_handler registered. Trying
|
||||
* to register a second rx_handler will return -EBUSY.
|
||||
*
|
||||
* To register a rx_handler on a net_device, use netdev_rx_handler_register().
|
||||
* To unregister a rx_handler on a net_device, use
|
||||
* netdev_rx_handler_unregister().
|
||||
*
|
||||
* Upon return, rx_handler is expected to tell __netif_receive_skb() what to
|
||||
* do with the skb.
|
||||
*
|
||||
* If the rx_handler consumed to skb in some way, it should return
|
||||
* RX_HANDLER_CONSUMED. This is appropriate when the rx_handler arranged for
|
||||
* the skb to be delivered in some other ways.
|
||||
*
|
||||
* If the rx_handler changed skb->dev, to divert the skb to another
|
||||
* net_device, it should return RX_HANDLER_ANOTHER. The rx_handler for the
|
||||
* new device will be called if it exists.
|
||||
*
|
||||
* If the rx_handler consider the skb should be ignored, it should return
|
||||
* RX_HANDLER_EXACT. The skb will only be delivered to protocol handlers that
|
||||
* are registred on exact device (ptype->dev == skb->dev).
|
||||
*
|
||||
* If the rx_handler didn't changed skb->dev, but want the skb to be normally
|
||||
* delivered, it should return RX_HANDLER_PASS.
|
||||
*
|
||||
* A device without a registered rx_handler will behave as if rx_handler
|
||||
* returned RX_HANDLER_PASS.
|
||||
*/
|
||||
|
||||
enum rx_handler_result {
|
||||
RX_HANDLER_CONSUMED,
|
||||
RX_HANDLER_ANOTHER,
|
||||
RX_HANDLER_EXACT,
|
||||
RX_HANDLER_PASS,
|
||||
};
|
||||
typedef enum rx_handler_result rx_handler_result_t;
|
||||
typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
|
||||
|
||||
extern void __napi_schedule(struct napi_struct *n);
|
||||
|
||||
@@ -551,14 +602,16 @@ struct rps_map {
|
||||
#define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16)))
|
||||
|
||||
/*
|
||||
* The rps_dev_flow structure contains the mapping of a flow to a CPU and the
|
||||
* tail pointer for that CPU's input queue at the time of last enqueue.
|
||||
* The rps_dev_flow structure contains the mapping of a flow to a CPU, the
|
||||
* tail pointer for that CPU's input queue at the time of last enqueue, and
|
||||
* a hardware filter index.
|
||||
*/
|
||||
struct rps_dev_flow {
|
||||
u16 cpu;
|
||||
u16 fill;
|
||||
u16 filter;
|
||||
unsigned int last_qtail;
|
||||
};
|
||||
#define RPS_NO_FILTER 0xffff
|
||||
|
||||
/*
|
||||
* The rps_dev_flow_table structure contains a table of flow mappings.
|
||||
@@ -608,6 +661,11 @@ static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table,
|
||||
|
||||
extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
|
||||
|
||||
#ifdef CONFIG_RFS_ACCEL
|
||||
extern bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index,
|
||||
u32 flow_id, u16 filter_id);
|
||||
#endif
|
||||
|
||||
/* This structure contains an instance of an RX queue. */
|
||||
struct netdev_rx_queue {
|
||||
struct rps_map __rcu *rps_map;
|
||||
@@ -643,6 +701,14 @@ struct xps_dev_maps {
|
||||
(nr_cpu_ids * sizeof(struct xps_map *)))
|
||||
#endif /* CONFIG_XPS */
|
||||
|
||||
#define TC_MAX_QUEUE 16
|
||||
#define TC_BITMASK 15
|
||||
/* HW offloaded queuing disciplines txq count and offset maps */
|
||||
struct netdev_tc_txq {
|
||||
u16 count;
|
||||
u16 offset;
|
||||
};
|
||||
|
||||
/*
|
||||
* This structure defines the management hooks for network devices.
|
||||
* The following hooks can be defined; unless noted otherwise, they are
|
||||
@@ -753,6 +819,74 @@ struct xps_dev_maps {
|
||||
* int (*ndo_set_vf_port)(struct net_device *dev, int vf,
|
||||
* struct nlattr *port[]);
|
||||
* int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
|
||||
* int (*ndo_setup_tc)(struct net_device *dev, u8 tc)
|
||||
* Called to setup 'tc' number of traffic classes in the net device. This
|
||||
* is always called from the stack with the rtnl lock held and netif tx
|
||||
* queues stopped. This allows the netdevice to perform queue management
|
||||
* safely.
|
||||
*
|
||||
* Fiber Channel over Ethernet (FCoE) offload functions.
|
||||
* int (*ndo_fcoe_enable)(struct net_device *dev);
|
||||
* Called when the FCoE protocol stack wants to start using LLD for FCoE
|
||||
* so the underlying device can perform whatever needed configuration or
|
||||
* initialization to support acceleration of FCoE traffic.
|
||||
*
|
||||
* int (*ndo_fcoe_disable)(struct net_device *dev);
|
||||
* Called when the FCoE protocol stack wants to stop using LLD for FCoE
|
||||
* so the underlying device can perform whatever needed clean-ups to
|
||||
* stop supporting acceleration of FCoE traffic.
|
||||
*
|
||||
* int (*ndo_fcoe_ddp_setup)(struct net_device *dev, u16 xid,
|
||||
* struct scatterlist *sgl, unsigned int sgc);
|
||||
* Called when the FCoE Initiator wants to initialize an I/O that
|
||||
* is a possible candidate for Direct Data Placement (DDP). The LLD can
|
||||
* perform necessary setup and returns 1 to indicate the device is set up
|
||||
* successfully to perform DDP on this I/O, otherwise this returns 0.
|
||||
*
|
||||
* int (*ndo_fcoe_ddp_done)(struct net_device *dev, u16 xid);
|
||||
* Called when the FCoE Initiator/Target is done with the DDPed I/O as
|
||||
* indicated by the FC exchange id 'xid', so the underlying device can
|
||||
* clean up and reuse resources for later DDP requests.
|
||||
*
|
||||
* int (*ndo_fcoe_ddp_target)(struct net_device *dev, u16 xid,
|
||||
* struct scatterlist *sgl, unsigned int sgc);
|
||||
* Called when the FCoE Target wants to initialize an I/O that
|
||||
* is a possible candidate for Direct Data Placement (DDP). The LLD can
|
||||
* perform necessary setup and returns 1 to indicate the device is set up
|
||||
* successfully to perform DDP on this I/O, otherwise this returns 0.
|
||||
*
|
||||
* int (*ndo_fcoe_get_wwn)(struct net_device *dev, u64 *wwn, int type);
|
||||
* Called when the underlying device wants to override default World Wide
|
||||
* Name (WWN) generation mechanism in FCoE protocol stack to pass its own
|
||||
* World Wide Port Name (WWPN) or World Wide Node Name (WWNN) to the FCoE
|
||||
* protocol stack to use.
|
||||
*
|
||||
* RFS acceleration.
|
||||
* int (*ndo_rx_flow_steer)(struct net_device *dev, const struct sk_buff *skb,
|
||||
* u16 rxq_index, u32 flow_id);
|
||||
* Set hardware filter for RFS. rxq_index is the target queue index;
|
||||
* flow_id is a flow ID to be passed to rps_may_expire_flow() later.
|
||||
* Return the filter ID on success, or a negative error code.
|
||||
*
|
||||
* Slave management functions (for bridge, bonding, etc). User should
|
||||
* call netdev_set_master() to set dev->master properly.
|
||||
* int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev);
|
||||
* Called to make another netdev an underling.
|
||||
*
|
||||
* int (*ndo_del_slave)(struct net_device *dev, struct net_device *slave_dev);
|
||||
* Called to release previously enslaved netdev.
|
||||
*
|
||||
* Feature/offload setting functions.
|
||||
* u32 (*ndo_fix_features)(struct net_device *dev, u32 features);
|
||||
* Adjusts the requested feature flags according to device-specific
|
||||
* constraints, and returns the resulting flags. Must not modify
|
||||
* the device state.
|
||||
*
|
||||
* int (*ndo_set_features)(struct net_device *dev, u32 features);
|
||||
* Called to update device configuration to new features. Passed
|
||||
* feature set might be less than what was returned by ndo_fix_features()).
|
||||
* Must return >0 or -errno if it changed dev->features itself.
|
||||
*
|
||||
*/
|
||||
#define HAVE_NET_DEVICE_OPS
|
||||
struct net_device_ops {
|
||||
@@ -811,6 +945,7 @@ struct net_device_ops {
|
||||
struct nlattr *port[]);
|
||||
int (*ndo_get_vf_port)(struct net_device *dev,
|
||||
int vf, struct sk_buff *skb);
|
||||
int (*ndo_setup_tc)(struct net_device *dev, u8 tc);
|
||||
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
|
||||
int (*ndo_fcoe_enable)(struct net_device *dev);
|
||||
int (*ndo_fcoe_disable)(struct net_device *dev);
|
||||
@@ -820,11 +955,29 @@ struct net_device_ops {
|
||||
unsigned int sgc);
|
||||
int (*ndo_fcoe_ddp_done)(struct net_device *dev,
|
||||
u16 xid);
|
||||
int (*ndo_fcoe_ddp_target)(struct net_device *dev,
|
||||
u16 xid,
|
||||
struct scatterlist *sgl,
|
||||
unsigned int sgc);
|
||||
#define NETDEV_FCOE_WWNN 0
|
||||
#define NETDEV_FCOE_WWPN 1
|
||||
int (*ndo_fcoe_get_wwn)(struct net_device *dev,
|
||||
u64 *wwn, int type);
|
||||
#endif
|
||||
#ifdef CONFIG_RFS_ACCEL
|
||||
int (*ndo_rx_flow_steer)(struct net_device *dev,
|
||||
const struct sk_buff *skb,
|
||||
u16 rxq_index,
|
||||
u32 flow_id);
|
||||
#endif
|
||||
int (*ndo_add_slave)(struct net_device *dev,
|
||||
struct net_device *slave_dev);
|
||||
int (*ndo_del_slave)(struct net_device *dev,
|
||||
struct net_device *slave_dev);
|
||||
u32 (*ndo_fix_features)(struct net_device *dev,
|
||||
u32 features);
|
||||
int (*ndo_set_features)(struct net_device *dev,
|
||||
u32 features);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -876,8 +1029,18 @@ struct net_device {
|
||||
struct list_head napi_list;
|
||||
struct list_head unreg_list;
|
||||
|
||||
/* Net device features */
|
||||
unsigned long features;
|
||||
/* currently active device features */
|
||||
u32 features;
|
||||
/* user-changeable features */
|
||||
u32 hw_features;
|
||||
/* user-requested features */
|
||||
u32 wanted_features;
|
||||
/* VLAN feature mask */
|
||||
u32 vlan_features;
|
||||
|
||||
/* Net device feature bits; if you change something,
|
||||
* also update netdev_features_strings[] in ethtool.c */
|
||||
|
||||
#define NETIF_F_SG 1 /* Scatter/gather IO. */
|
||||
#define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */
|
||||
#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
|
||||
@@ -902,6 +1065,7 @@ struct net_device {
|
||||
#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
|
||||
#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
|
||||
#define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */
|
||||
#define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */
|
||||
|
||||
/* Segmentation offload features */
|
||||
#define NETIF_F_GSO_SHIFT 16
|
||||
@@ -913,6 +1077,12 @@ struct net_device {
|
||||
#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
|
||||
#define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT)
|
||||
|
||||
/* Features valid for ethtool to change */
|
||||
/* = all defined minus driver/device-class-related */
|
||||
#define NETIF_F_NEVER_CHANGE (NETIF_F_HIGHDMA | NETIF_F_VLAN_CHALLENGED | \
|
||||
NETIF_F_LLTX | NETIF_F_NETNS_LOCAL)
|
||||
#define NETIF_F_ETHTOOL_BITS (0x3f3fffff & ~NETIF_F_NEVER_CHANGE)
|
||||
|
||||
/* List of features with software fallbacks. */
|
||||
#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \
|
||||
NETIF_F_TSO6 | NETIF_F_UFO)
|
||||
@@ -923,6 +1093,12 @@ struct net_device {
|
||||
#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
|
||||
#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
|
||||
|
||||
#define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
|
||||
|
||||
#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
|
||||
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
|
||||
NETIF_F_SCTP_CSUM | NETIF_F_FCOE_CRC)
|
||||
|
||||
/*
|
||||
* If one device supports one of these features, then enable them
|
||||
* for all in netdev_increment_features.
|
||||
@@ -931,6 +1107,9 @@ struct net_device {
|
||||
NETIF_F_SG | NETIF_F_HIGHDMA | \
|
||||
NETIF_F_FRAGLIST)
|
||||
|
||||
/* changeable features with no special hardware requirements */
|
||||
#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
|
||||
|
||||
/* Interface index. Unique device identifier */
|
||||
int ifindex;
|
||||
int iflink;
|
||||
@@ -1039,6 +1218,13 @@ struct net_device {
|
||||
|
||||
/* Number of RX queues currently active in device */
|
||||
unsigned int real_num_rx_queues;
|
||||
|
||||
#ifdef CONFIG_RFS_ACCEL
|
||||
/* CPU reverse-mapping for RX completion interrupts, indexed
|
||||
* by RX queue number. Assigned by driver. This must only be
|
||||
* set if the ndo_rx_flow_steer operation is defined. */
|
||||
struct cpu_rmap *rx_cpu_rmap;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
rx_handler_func_t __rcu *rx_handler;
|
||||
@@ -1132,9 +1318,6 @@ struct net_device {
|
||||
/* rtnetlink link ops */
|
||||
const struct rtnl_link_ops *rtnl_link_ops;
|
||||
|
||||
/* VLAN feature mask */
|
||||
unsigned long vlan_features;
|
||||
|
||||
/* for setting kernel sock attribute on TCP connection setup */
|
||||
#define GSO_MAX_SIZE 65536
|
||||
unsigned int gso_max_size;
|
||||
@@ -1143,6 +1326,9 @@ struct net_device {
|
||||
/* Data Center Bridging netlink ops */
|
||||
const struct dcbnl_rtnl_ops *dcbnl_ops;
|
||||
#endif
|
||||
u8 num_tc;
|
||||
struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE];
|
||||
u8 prio_tc_map[TC_BITMASK + 1];
|
||||
|
||||
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
|
||||
/* max exchange id for FCoE LRO by ddp */
|
||||
@@ -1153,11 +1339,65 @@ struct net_device {
|
||||
|
||||
/* phy device may attach itself for hardware timestamping */
|
||||
struct phy_device *phydev;
|
||||
|
||||
/* group the device belongs to */
|
||||
int group;
|
||||
};
|
||||
#define to_net_dev(d) container_of(d, struct net_device, dev)
|
||||
|
||||
#define NETDEV_ALIGN 32
|
||||
|
||||
static inline
|
||||
int netdev_get_prio_tc_map(const struct net_device *dev, u32 prio)
|
||||
{
|
||||
return dev->prio_tc_map[prio & TC_BITMASK];
|
||||
}
|
||||
|
||||
static inline
|
||||
int netdev_set_prio_tc_map(struct net_device *dev, u8 prio, u8 tc)
|
||||
{
|
||||
if (tc >= dev->num_tc)
|
||||
return -EINVAL;
|
||||
|
||||
dev->prio_tc_map[prio & TC_BITMASK] = tc & TC_BITMASK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
void netdev_reset_tc(struct net_device *dev)
|
||||
{
|
||||
dev->num_tc = 0;
|
||||
memset(dev->tc_to_txq, 0, sizeof(dev->tc_to_txq));
|
||||
memset(dev->prio_tc_map, 0, sizeof(dev->prio_tc_map));
|
||||
}
|
||||
|
||||
static inline
|
||||
int netdev_set_tc_queue(struct net_device *dev, u8 tc, u16 count, u16 offset)
|
||||
{
|
||||
if (tc >= dev->num_tc)
|
||||
return -EINVAL;
|
||||
|
||||
dev->tc_to_txq[tc].count = count;
|
||||
dev->tc_to_txq[tc].offset = offset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int netdev_set_num_tc(struct net_device *dev, u8 num_tc)
|
||||
{
|
||||
if (num_tc > TC_MAX_QUEUE)
|
||||
return -EINVAL;
|
||||
|
||||
dev->num_tc = num_tc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int netdev_get_num_tc(struct net_device *dev)
|
||||
{
|
||||
return dev->num_tc;
|
||||
}
|
||||
|
||||
static inline
|
||||
struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
|
||||
unsigned int index)
|
||||
@@ -1300,7 +1540,7 @@ struct packet_type {
|
||||
struct packet_type *,
|
||||
struct net_device *);
|
||||
struct sk_buff *(*gso_segment)(struct sk_buff *skb,
|
||||
int features);
|
||||
u32 features);
|
||||
int (*gso_send_check)(struct sk_buff *skb);
|
||||
struct sk_buff **(*gro_receive)(struct sk_buff **head,
|
||||
struct sk_buff *skb);
|
||||
@@ -1345,7 +1585,7 @@ static inline struct net_device *next_net_device_rcu(struct net_device *dev)
|
||||
struct net *net;
|
||||
|
||||
net = dev_net(dev);
|
||||
lh = rcu_dereference(dev->dev_list.next);
|
||||
lh = rcu_dereference(list_next_rcu(&dev->dev_list));
|
||||
return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
|
||||
}
|
||||
|
||||
@@ -1355,6 +1595,13 @@ static inline struct net_device *first_net_device(struct net *net)
|
||||
net_device_entry(net->dev_base_head.next);
|
||||
}
|
||||
|
||||
static inline struct net_device *first_net_device_rcu(struct net *net)
|
||||
{
|
||||
struct list_head *lh = rcu_dereference(list_next_rcu(&net->dev_base_head));
|
||||
|
||||
return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
|
||||
}
|
||||
|
||||
extern int netdev_boot_setup_check(struct net_device *dev);
|
||||
extern unsigned long netdev_boot_base(const char *prefix, int unit);
|
||||
extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
|
||||
@@ -1606,8 +1853,7 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev)
|
||||
static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue)
|
||||
{
|
||||
if (WARN_ON(!dev_queue)) {
|
||||
printk(KERN_INFO "netif_stop_queue() cannot be called before "
|
||||
"register_netdev()");
|
||||
pr_info("netif_stop_queue() cannot be called before register_netdev()\n");
|
||||
return;
|
||||
}
|
||||
set_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
|
||||
@@ -1844,6 +2090,7 @@ extern int dev_set_alias(struct net_device *, const char *, size_t);
|
||||
extern int dev_change_net_namespace(struct net_device *,
|
||||
struct net *, const char *);
|
||||
extern int dev_set_mtu(struct net_device *, int);
|
||||
extern void dev_set_group(struct net_device *, int);
|
||||
extern int dev_set_mac_address(struct net_device *,
|
||||
struct sockaddr *);
|
||||
extern int dev_hard_start_xmit(struct sk_buff *skb,
|
||||
@@ -2267,8 +2514,10 @@ extern int netdev_max_backlog;
|
||||
extern int netdev_tstamp_prequeue;
|
||||
extern int weight_p;
|
||||
extern int netdev_set_master(struct net_device *dev, struct net_device *master);
|
||||
extern int netdev_set_bond_master(struct net_device *dev,
|
||||
struct net_device *master);
|
||||
extern int skb_checksum_help(struct sk_buff *skb);
|
||||
extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features);
|
||||
extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features);
|
||||
#ifdef CONFIG_BUG
|
||||
extern void netdev_rx_csum_fault(struct net_device *dev);
|
||||
#else
|
||||
@@ -2295,22 +2544,26 @@ extern char *netdev_drivername(const struct net_device *dev, char *buffer, int l
|
||||
|
||||
extern void linkwatch_run_queue(void);
|
||||
|
||||
unsigned long netdev_increment_features(unsigned long all, unsigned long one,
|
||||
unsigned long mask);
|
||||
unsigned long netdev_fix_features(unsigned long features, const char *name);
|
||||
static inline u32 netdev_get_wanted_features(struct net_device *dev)
|
||||
{
|
||||
return (dev->features & ~dev->hw_features) | dev->wanted_features;
|
||||
}
|
||||
u32 netdev_increment_features(u32 all, u32 one, u32 mask);
|
||||
u32 netdev_fix_features(struct net_device *dev, u32 features);
|
||||
void netdev_update_features(struct net_device *dev);
|
||||
|
||||
void netif_stacked_transfer_operstate(const struct net_device *rootdev,
|
||||
struct net_device *dev);
|
||||
|
||||
int netif_skb_features(struct sk_buff *skb);
|
||||
u32 netif_skb_features(struct sk_buff *skb);
|
||||
|
||||
static inline int net_gso_ok(int features, int gso_type)
|
||||
static inline int net_gso_ok(u32 features, int gso_type)
|
||||
{
|
||||
int feature = gso_type << NETIF_F_GSO_SHIFT;
|
||||
return (features & feature) == feature;
|
||||
}
|
||||
|
||||
static inline int skb_gso_ok(struct sk_buff *skb, int features)
|
||||
static inline int skb_gso_ok(struct sk_buff *skb, u32 features)
|
||||
{
|
||||
return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
|
||||
(!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
|
||||
@@ -2328,15 +2581,9 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
|
||||
dev->gso_max_size = size;
|
||||
}
|
||||
|
||||
extern int __skb_bond_should_drop(struct sk_buff *skb,
|
||||
struct net_device *master);
|
||||
|
||||
static inline int skb_bond_should_drop(struct sk_buff *skb,
|
||||
struct net_device *master)
|
||||
static inline int netif_is_bond_slave(struct net_device *dev)
|
||||
{
|
||||
if (master)
|
||||
return __skb_bond_should_drop(skb, master);
|
||||
return 0;
|
||||
return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING;
|
||||
}
|
||||
|
||||
extern struct pernet_operations __net_initdata loopback_net_ops;
|
||||
@@ -2351,6 +2598,8 @@ static inline int dev_ethtool_get_settings(struct net_device *dev,
|
||||
|
||||
static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev)
|
||||
{
|
||||
if (dev->hw_features & NETIF_F_RXCSUM)
|
||||
return !!(dev->features & NETIF_F_RXCSUM);
|
||||
if (!dev->ethtool_ops || !dev->ethtool_ops->get_rx_csum)
|
||||
return 0;
|
||||
return dev->ethtool_ops->get_rx_csum(dev);
|
||||
@@ -2392,6 +2641,9 @@ extern int netdev_notice(const struct net_device *dev, const char *format, ...)
|
||||
extern int netdev_info(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#define MODULE_ALIAS_NETDEV(device) \
|
||||
MODULE_ALIAS("netdev-" device)
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define netdev_dbg(__dev, format, args...) \
|
||||
netdev_printk(KERN_DEBUG, __dev, format, ##args)
|
||||
|
||||
@@ -24,16 +24,20 @@
|
||||
#define NF_MAX_VERDICT NF_STOP
|
||||
|
||||
/* we overload the higher bits for encoding auxiliary data such as the queue
|
||||
* number. Not nice, but better than additional function arguments. */
|
||||
#define NF_VERDICT_MASK 0x0000ffff
|
||||
#define NF_VERDICT_BITS 16
|
||||
* number or errno values. Not nice, but better than additional function
|
||||
* arguments. */
|
||||
#define NF_VERDICT_MASK 0x000000ff
|
||||
|
||||
/* extra verdict flags have mask 0x0000ff00 */
|
||||
#define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
|
||||
|
||||
/* queue number (NF_QUEUE) or errno (NF_DROP) */
|
||||
#define NF_VERDICT_QMASK 0xffff0000
|
||||
#define NF_VERDICT_QBITS 16
|
||||
|
||||
#define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE)
|
||||
#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
|
||||
|
||||
#define NF_DROP_ERR(x) (((-x) << NF_VERDICT_BITS) | NF_DROP)
|
||||
#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
|
||||
|
||||
/* only for userspace compatibility */
|
||||
#ifndef __KERNEL__
|
||||
@@ -41,6 +45,9 @@
|
||||
<= 0x2000 is used for protocol-flags. */
|
||||
#define NFC_UNKNOWN 0x4000
|
||||
#define NFC_ALTERED 0x8000
|
||||
|
||||
/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
|
||||
#define NF_VERDICT_BITS 16
|
||||
#endif
|
||||
|
||||
enum nf_inet_hooks {
|
||||
@@ -72,6 +79,10 @@ union nf_inet_addr {
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_NETFILTER
|
||||
static inline int NF_DROP_GETERR(int verdict)
|
||||
{
|
||||
return -(verdict >> NF_VERDICT_QBITS);
|
||||
}
|
||||
|
||||
static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
|
||||
const union nf_inet_addr *a2)
|
||||
@@ -267,7 +278,7 @@ struct nf_afinfo {
|
||||
int route_key_size;
|
||||
};
|
||||
|
||||
extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO];
|
||||
extern const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO];
|
||||
static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family)
|
||||
{
|
||||
return rcu_dereference(nf_afinfo[family]);
|
||||
@@ -357,9 +368,9 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
|
||||
#endif /*CONFIG_NETFILTER*/
|
||||
|
||||
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
||||
extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *);
|
||||
extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu;
|
||||
extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
|
||||
extern void (*nf_ct_destroy)(struct nf_conntrack *);
|
||||
extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
|
||||
#else
|
||||
static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
header-y += ipset/
|
||||
|
||||
header-y += nf_conntrack_common.h
|
||||
header-y += nf_conntrack_ftp.h
|
||||
header-y += nf_conntrack_sctp.h
|
||||
@@ -9,6 +11,7 @@ header-y += nfnetlink_conntrack.h
|
||||
header-y += nfnetlink_log.h
|
||||
header-y += nfnetlink_queue.h
|
||||
header-y += x_tables.h
|
||||
header-y += xt_AUDIT.h
|
||||
header-y += xt_CHECKSUM.h
|
||||
header-y += xt_CLASSIFY.h
|
||||
header-y += xt_CONNMARK.h
|
||||
@@ -26,6 +29,7 @@ header-y += xt_TCPMSS.h
|
||||
header-y += xt_TCPOPTSTRIP.h
|
||||
header-y += xt_TEE.h
|
||||
header-y += xt_TPROXY.h
|
||||
header-y += xt_addrtype.h
|
||||
header-y += xt_cluster.h
|
||||
header-y += xt_comment.h
|
||||
header-y += xt_connbytes.h
|
||||
@@ -34,6 +38,7 @@ header-y += xt_connmark.h
|
||||
header-y += xt_conntrack.h
|
||||
header-y += xt_cpu.h
|
||||
header-y += xt_dccp.h
|
||||
header-y += xt_devgroup.h
|
||||
header-y += xt_dscp.h
|
||||
header-y += xt_esp.h
|
||||
header-y += xt_hashlimit.h
|
||||
@@ -54,7 +59,9 @@ header-y += xt_quota.h
|
||||
header-y += xt_rateest.h
|
||||
header-y += xt_realm.h
|
||||
header-y += xt_recent.h
|
||||
header-y += xt_set.h
|
||||
header-y += xt_sctp.h
|
||||
header-y += xt_socket.h
|
||||
header-y += xt_state.h
|
||||
header-y += xt_statistic.h
|
||||
header-y += xt_string.h
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
header-y += ip_set.h
|
||||
header-y += ip_set_bitmap.h
|
||||
header-y += ip_set_hash.h
|
||||
header-y += ip_set_list.h
|
||||
@@ -0,0 +1,452 @@
|
||||
#ifndef _IP_SET_H
|
||||
#define _IP_SET_H
|
||||
|
||||
/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
|
||||
* Patrick Schaaf <bof@bof.de>
|
||||
* Martin Josefsson <gandalf@wlug.westbo.se>
|
||||
* Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* The protocol version */
|
||||
#define IPSET_PROTOCOL 6
|
||||
|
||||
/* The max length of strings including NUL: set and type identifiers */
|
||||
#define IPSET_MAXNAMELEN 32
|
||||
|
||||
/* Message types and commands */
|
||||
enum ipset_cmd {
|
||||
IPSET_CMD_NONE,
|
||||
IPSET_CMD_PROTOCOL, /* 1: Return protocol version */
|
||||
IPSET_CMD_CREATE, /* 2: Create a new (empty) set */
|
||||
IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */
|
||||
IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */
|
||||
IPSET_CMD_RENAME, /* 5: Rename a set */
|
||||
IPSET_CMD_SWAP, /* 6: Swap two sets */
|
||||
IPSET_CMD_LIST, /* 7: List sets */
|
||||
IPSET_CMD_SAVE, /* 8: Save sets */
|
||||
IPSET_CMD_ADD, /* 9: Add an element to a set */
|
||||
IPSET_CMD_DEL, /* 10: Delete an element from a set */
|
||||
IPSET_CMD_TEST, /* 11: Test an element in a set */
|
||||
IPSET_CMD_HEADER, /* 12: Get set header data only */
|
||||
IPSET_CMD_TYPE, /* 13: Get set type */
|
||||
IPSET_MSG_MAX, /* Netlink message commands */
|
||||
|
||||
/* Commands in userspace: */
|
||||
IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */
|
||||
IPSET_CMD_HELP, /* 15: Get help */
|
||||
IPSET_CMD_VERSION, /* 16: Get program version */
|
||||
IPSET_CMD_QUIT, /* 17: Quit from interactive mode */
|
||||
|
||||
IPSET_CMD_MAX,
|
||||
|
||||
IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */
|
||||
};
|
||||
|
||||
/* Attributes at command level */
|
||||
enum {
|
||||
IPSET_ATTR_UNSPEC,
|
||||
IPSET_ATTR_PROTOCOL, /* 1: Protocol version */
|
||||
IPSET_ATTR_SETNAME, /* 2: Name of the set */
|
||||
IPSET_ATTR_TYPENAME, /* 3: Typename */
|
||||
IPSET_ATTR_SETNAME2 = IPSET_ATTR_TYPENAME, /* Setname at rename/swap */
|
||||
IPSET_ATTR_REVISION, /* 4: Settype revision */
|
||||
IPSET_ATTR_FAMILY, /* 5: Settype family */
|
||||
IPSET_ATTR_FLAGS, /* 6: Flags at command level */
|
||||
IPSET_ATTR_DATA, /* 7: Nested attributes */
|
||||
IPSET_ATTR_ADT, /* 8: Multiple data containers */
|
||||
IPSET_ATTR_LINENO, /* 9: Restore lineno */
|
||||
IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */
|
||||
IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */
|
||||
__IPSET_ATTR_CMD_MAX,
|
||||
};
|
||||
#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
|
||||
|
||||
/* CADT specific attributes */
|
||||
enum {
|
||||
IPSET_ATTR_IP = IPSET_ATTR_UNSPEC + 1,
|
||||
IPSET_ATTR_IP_FROM = IPSET_ATTR_IP,
|
||||
IPSET_ATTR_IP_TO, /* 2 */
|
||||
IPSET_ATTR_CIDR, /* 3 */
|
||||
IPSET_ATTR_PORT, /* 4 */
|
||||
IPSET_ATTR_PORT_FROM = IPSET_ATTR_PORT,
|
||||
IPSET_ATTR_PORT_TO, /* 5 */
|
||||
IPSET_ATTR_TIMEOUT, /* 6 */
|
||||
IPSET_ATTR_PROTO, /* 7 */
|
||||
IPSET_ATTR_CADT_FLAGS, /* 8 */
|
||||
IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
|
||||
/* Reserve empty slots */
|
||||
IPSET_ATTR_CADT_MAX = 16,
|
||||
/* Create-only specific attributes */
|
||||
IPSET_ATTR_GC,
|
||||
IPSET_ATTR_HASHSIZE,
|
||||
IPSET_ATTR_MAXELEM,
|
||||
IPSET_ATTR_NETMASK,
|
||||
IPSET_ATTR_PROBES,
|
||||
IPSET_ATTR_RESIZE,
|
||||
IPSET_ATTR_SIZE,
|
||||
/* Kernel-only */
|
||||
IPSET_ATTR_ELEMENTS,
|
||||
IPSET_ATTR_REFERENCES,
|
||||
IPSET_ATTR_MEMSIZE,
|
||||
|
||||
__IPSET_ATTR_CREATE_MAX,
|
||||
};
|
||||
#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
|
||||
|
||||
/* ADT specific attributes */
|
||||
enum {
|
||||
IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
|
||||
IPSET_ATTR_NAME,
|
||||
IPSET_ATTR_NAMEREF,
|
||||
IPSET_ATTR_IP2,
|
||||
IPSET_ATTR_CIDR2,
|
||||
__IPSET_ATTR_ADT_MAX,
|
||||
};
|
||||
#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
|
||||
|
||||
/* IP specific attributes */
|
||||
enum {
|
||||
IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
|
||||
IPSET_ATTR_IPADDR_IPV6,
|
||||
__IPSET_ATTR_IPADDR_MAX,
|
||||
};
|
||||
#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
|
||||
|
||||
/* Error codes */
|
||||
enum ipset_errno {
|
||||
IPSET_ERR_PRIVATE = 4096,
|
||||
IPSET_ERR_PROTOCOL,
|
||||
IPSET_ERR_FIND_TYPE,
|
||||
IPSET_ERR_MAX_SETS,
|
||||
IPSET_ERR_BUSY,
|
||||
IPSET_ERR_EXIST_SETNAME2,
|
||||
IPSET_ERR_TYPE_MISMATCH,
|
||||
IPSET_ERR_EXIST,
|
||||
IPSET_ERR_INVALID_CIDR,
|
||||
IPSET_ERR_INVALID_NETMASK,
|
||||
IPSET_ERR_INVALID_FAMILY,
|
||||
IPSET_ERR_TIMEOUT,
|
||||
IPSET_ERR_REFERENCED,
|
||||
IPSET_ERR_IPADDR_IPV4,
|
||||
IPSET_ERR_IPADDR_IPV6,
|
||||
|
||||
/* Type specific error codes */
|
||||
IPSET_ERR_TYPE_SPECIFIC = 4352,
|
||||
};
|
||||
|
||||
/* Flags at command level */
|
||||
enum ipset_cmd_flags {
|
||||
IPSET_FLAG_BIT_EXIST = 0,
|
||||
IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
|
||||
};
|
||||
|
||||
/* Flags at CADT attribute level */
|
||||
enum ipset_cadt_flags {
|
||||
IPSET_FLAG_BIT_BEFORE = 0,
|
||||
IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
|
||||
};
|
||||
|
||||
/* Commands with settype-specific attributes */
|
||||
enum ipset_adt {
|
||||
IPSET_ADD,
|
||||
IPSET_DEL,
|
||||
IPSET_TEST,
|
||||
IPSET_ADT_MAX,
|
||||
IPSET_CREATE = IPSET_ADT_MAX,
|
||||
IPSET_CADT_MAX,
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/ip.h>
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/netfilter.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <net/netlink.h>
|
||||
|
||||
/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
|
||||
* and IPSET_INVALID_ID if you want to increase the max number of sets.
|
||||
*/
|
||||
typedef u16 ip_set_id_t;
|
||||
|
||||
#define IPSET_INVALID_ID 65535
|
||||
|
||||
enum ip_set_dim {
|
||||
IPSET_DIM_ZERO = 0,
|
||||
IPSET_DIM_ONE,
|
||||
IPSET_DIM_TWO,
|
||||
IPSET_DIM_THREE,
|
||||
/* Max dimension in elements.
|
||||
* If changed, new revision of iptables match/target is required.
|
||||
*/
|
||||
IPSET_DIM_MAX = 6,
|
||||
};
|
||||
|
||||
/* Option flags for kernel operations */
|
||||
enum ip_set_kopt {
|
||||
IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
|
||||
IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
|
||||
IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
|
||||
IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
|
||||
};
|
||||
|
||||
/* Set features */
|
||||
enum ip_set_feature {
|
||||
IPSET_TYPE_IP_FLAG = 0,
|
||||
IPSET_TYPE_IP = (1 << IPSET_TYPE_IP_FLAG),
|
||||
IPSET_TYPE_PORT_FLAG = 1,
|
||||
IPSET_TYPE_PORT = (1 << IPSET_TYPE_PORT_FLAG),
|
||||
IPSET_TYPE_MAC_FLAG = 2,
|
||||
IPSET_TYPE_MAC = (1 << IPSET_TYPE_MAC_FLAG),
|
||||
IPSET_TYPE_IP2_FLAG = 3,
|
||||
IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG),
|
||||
IPSET_TYPE_NAME_FLAG = 4,
|
||||
IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG),
|
||||
/* Strictly speaking not a feature, but a flag for dumping:
|
||||
* this settype must be dumped last */
|
||||
IPSET_DUMP_LAST_FLAG = 7,
|
||||
IPSET_DUMP_LAST = (1 << IPSET_DUMP_LAST_FLAG),
|
||||
};
|
||||
|
||||
struct ip_set;
|
||||
|
||||
typedef int (*ipset_adtfn)(struct ip_set *set, void *value, u32 timeout);
|
||||
|
||||
/* Set type, variant-specific part */
|
||||
struct ip_set_type_variant {
|
||||
/* Kernelspace: test/add/del entries
|
||||
* returns negative error code,
|
||||
* zero for no match/success to add/delete
|
||||
* positive for matching element */
|
||||
int (*kadt)(struct ip_set *set, const struct sk_buff * skb,
|
||||
enum ipset_adt adt, u8 pf, u8 dim, u8 flags);
|
||||
|
||||
/* Userspace: test/add/del entries
|
||||
* returns negative error code,
|
||||
* zero for no match/success to add/delete
|
||||
* positive for matching element */
|
||||
int (*uadt)(struct ip_set *set, struct nlattr *tb[],
|
||||
enum ipset_adt adt, u32 *lineno, u32 flags);
|
||||
|
||||
/* Low level add/del/test functions */
|
||||
ipset_adtfn adt[IPSET_ADT_MAX];
|
||||
|
||||
/* When adding entries and set is full, try to resize the set */
|
||||
int (*resize)(struct ip_set *set, bool retried);
|
||||
/* Destroy the set */
|
||||
void (*destroy)(struct ip_set *set);
|
||||
/* Flush the elements */
|
||||
void (*flush)(struct ip_set *set);
|
||||
/* Expire entries before listing */
|
||||
void (*expire)(struct ip_set *set);
|
||||
/* List set header data */
|
||||
int (*head)(struct ip_set *set, struct sk_buff *skb);
|
||||
/* List elements */
|
||||
int (*list)(const struct ip_set *set, struct sk_buff *skb,
|
||||
struct netlink_callback *cb);
|
||||
|
||||
/* Return true if "b" set is the same as "a"
|
||||
* according to the create set parameters */
|
||||
bool (*same_set)(const struct ip_set *a, const struct ip_set *b);
|
||||
};
|
||||
|
||||
/* The core set type structure */
|
||||
struct ip_set_type {
|
||||
struct list_head list;
|
||||
|
||||
/* Typename */
|
||||
char name[IPSET_MAXNAMELEN];
|
||||
/* Protocol version */
|
||||
u8 protocol;
|
||||
/* Set features to control swapping */
|
||||
u8 features;
|
||||
/* Set type dimension */
|
||||
u8 dimension;
|
||||
/* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */
|
||||
u8 family;
|
||||
/* Type revision */
|
||||
u8 revision;
|
||||
|
||||
/* Create set */
|
||||
int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags);
|
||||
|
||||
/* Attribute policies */
|
||||
const struct nla_policy create_policy[IPSET_ATTR_CREATE_MAX + 1];
|
||||
const struct nla_policy adt_policy[IPSET_ATTR_ADT_MAX + 1];
|
||||
|
||||
/* Set this to THIS_MODULE if you are a module, otherwise NULL */
|
||||
struct module *me;
|
||||
};
|
||||
|
||||
/* register and unregister set type */
|
||||
extern int ip_set_type_register(struct ip_set_type *set_type);
|
||||
extern void ip_set_type_unregister(struct ip_set_type *set_type);
|
||||
|
||||
/* A generic IP set */
|
||||
struct ip_set {
|
||||
/* The name of the set */
|
||||
char name[IPSET_MAXNAMELEN];
|
||||
/* Lock protecting the set data */
|
||||
rwlock_t lock;
|
||||
/* References to the set */
|
||||
atomic_t ref;
|
||||
/* The core set type */
|
||||
struct ip_set_type *type;
|
||||
/* The type variant doing the real job */
|
||||
const struct ip_set_type_variant *variant;
|
||||
/* The actual INET family of the set */
|
||||
u8 family;
|
||||
/* The type specific data */
|
||||
void *data;
|
||||
};
|
||||
|
||||
/* register and unregister set references */
|
||||
extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set);
|
||||
extern void ip_set_put_byindex(ip_set_id_t index);
|
||||
extern const char * ip_set_name_byindex(ip_set_id_t index);
|
||||
extern ip_set_id_t ip_set_nfnl_get(const char *name);
|
||||
extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index);
|
||||
extern void ip_set_nfnl_put(ip_set_id_t index);
|
||||
|
||||
/* API for iptables set match, and SET target */
|
||||
extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb,
|
||||
u8 family, u8 dim, u8 flags);
|
||||
extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb,
|
||||
u8 family, u8 dim, u8 flags);
|
||||
extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb,
|
||||
u8 family, u8 dim, u8 flags);
|
||||
|
||||
/* Utility functions */
|
||||
extern void * ip_set_alloc(size_t size);
|
||||
extern void ip_set_free(void *members);
|
||||
extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr);
|
||||
extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr);
|
||||
|
||||
static inline int
|
||||
ip_set_get_hostipaddr4(struct nlattr *nla, u32 *ipaddr)
|
||||
{
|
||||
__be32 ip;
|
||||
int ret = ip_set_get_ipaddr4(nla, &ip);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
*ipaddr = ntohl(ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Ignore IPSET_ERR_EXIST errors if asked to do so? */
|
||||
static inline bool
|
||||
ip_set_eexist(int ret, u32 flags)
|
||||
{
|
||||
return ret == -IPSET_ERR_EXIST && (flags & IPSET_FLAG_EXIST);
|
||||
}
|
||||
|
||||
/* Check the NLA_F_NET_BYTEORDER flag */
|
||||
static inline bool
|
||||
ip_set_attr_netorder(struct nlattr *tb[], int type)
|
||||
{
|
||||
return tb[type] && (tb[type]->nla_type & NLA_F_NET_BYTEORDER);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ip_set_optattr_netorder(struct nlattr *tb[], int type)
|
||||
{
|
||||
return !tb[type] || (tb[type]->nla_type & NLA_F_NET_BYTEORDER);
|
||||
}
|
||||
|
||||
/* Useful converters */
|
||||
static inline u32
|
||||
ip_set_get_h32(const struct nlattr *attr)
|
||||
{
|
||||
return ntohl(nla_get_be32(attr));
|
||||
}
|
||||
|
||||
static inline u16
|
||||
ip_set_get_h16(const struct nlattr *attr)
|
||||
{
|
||||
return ntohs(nla_get_be16(attr));
|
||||
}
|
||||
|
||||
#define ipset_nest_start(skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED)
|
||||
#define ipset_nest_end(skb, start) nla_nest_end(skb, start)
|
||||
|
||||
#define NLA_PUT_IPADDR4(skb, type, ipaddr) \
|
||||
do { \
|
||||
struct nlattr *__nested = ipset_nest_start(skb, type); \
|
||||
\
|
||||
if (!__nested) \
|
||||
goto nla_put_failure; \
|
||||
NLA_PUT_NET32(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr); \
|
||||
ipset_nest_end(skb, __nested); \
|
||||
} while (0)
|
||||
|
||||
#define NLA_PUT_IPADDR6(skb, type, ipaddrptr) \
|
||||
do { \
|
||||
struct nlattr *__nested = ipset_nest_start(skb, type); \
|
||||
\
|
||||
if (!__nested) \
|
||||
goto nla_put_failure; \
|
||||
NLA_PUT(skb, IPSET_ATTR_IPADDR_IPV6, \
|
||||
sizeof(struct in6_addr), ipaddrptr); \
|
||||
ipset_nest_end(skb, __nested); \
|
||||
} while (0)
|
||||
|
||||
/* Get address from skbuff */
|
||||
static inline __be32
|
||||
ip4addr(const struct sk_buff *skb, bool src)
|
||||
{
|
||||
return src ? ip_hdr(skb)->saddr : ip_hdr(skb)->daddr;
|
||||
}
|
||||
|
||||
static inline void
|
||||
ip4addrptr(const struct sk_buff *skb, bool src, __be32 *addr)
|
||||
{
|
||||
*addr = src ? ip_hdr(skb)->saddr : ip_hdr(skb)->daddr;
|
||||
}
|
||||
|
||||
static inline void
|
||||
ip6addrptr(const struct sk_buff *skb, bool src, struct in6_addr *addr)
|
||||
{
|
||||
memcpy(addr, src ? &ipv6_hdr(skb)->saddr : &ipv6_hdr(skb)->daddr,
|
||||
sizeof(*addr));
|
||||
}
|
||||
|
||||
/* Calculate the bytes required to store the inclusive range of a-b */
|
||||
static inline int
|
||||
bitmap_bytes(u32 a, u32 b)
|
||||
{
|
||||
return 4 * ((((b - a + 8) / 8) + 3) / 4);
|
||||
}
|
||||
|
||||
/* Interface to iptables/ip6tables */
|
||||
|
||||
#define SO_IP_SET 83
|
||||
|
||||
union ip_set_name_index {
|
||||
char name[IPSET_MAXNAMELEN];
|
||||
ip_set_id_t index;
|
||||
};
|
||||
|
||||
#define IP_SET_OP_GET_BYNAME 0x00000006 /* Get set index by name */
|
||||
struct ip_set_req_get_set {
|
||||
unsigned op;
|
||||
unsigned version;
|
||||
union ip_set_name_index set;
|
||||
};
|
||||
|
||||
#define IP_SET_OP_GET_BYINDEX 0x00000007 /* Get set name by index */
|
||||
/* Uses ip_set_req_get_set */
|
||||
|
||||
#define IP_SET_OP_VERSION 0x00000100 /* Ask kernel version */
|
||||
struct ip_set_req_version {
|
||||
unsigned op;
|
||||
unsigned version;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /*_IP_SET_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
#ifndef __IP_SET_BITMAP_H
|
||||
#define __IP_SET_BITMAP_H
|
||||
|
||||
/* Bitmap type specific error codes */
|
||||
enum {
|
||||
/* The element is out of the range of the set */
|
||||
IPSET_ERR_BITMAP_RANGE = IPSET_ERR_TYPE_SPECIFIC,
|
||||
/* The range exceeds the size limit of the set type */
|
||||
IPSET_ERR_BITMAP_RANGE_SIZE,
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define IPSET_BITMAP_MAX_RANGE 0x0000FFFF
|
||||
|
||||
/* Common functions */
|
||||
|
||||
static inline u32
|
||||
range_to_mask(u32 from, u32 to, u8 *bits)
|
||||
{
|
||||
u32 mask = 0xFFFFFFFE;
|
||||
|
||||
*bits = 32;
|
||||
while (--(*bits) > 0 && mask && (to & mask) != from)
|
||||
mask <<= 1;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __IP_SET_BITMAP_H */
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _IP_SET_GETPORT_H
|
||||
#define _IP_SET_GETPORT_H
|
||||
|
||||
extern bool ip_set_get_ip4_port(const struct sk_buff *skb, bool src,
|
||||
__be16 *port, u8 *proto);
|
||||
|
||||
#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
||||
extern bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
|
||||
__be16 *port, u8 *proto);
|
||||
#else
|
||||
static inline bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
|
||||
__be16 *port, u8 *proto)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern bool ip_set_get_ip_port(const struct sk_buff *skb, u8 pf, bool src,
|
||||
__be16 *port);
|
||||
|
||||
#endif /*_IP_SET_GETPORT_H*/
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef __IP_SET_HASH_H
|
||||
#define __IP_SET_HASH_H
|
||||
|
||||
/* Hash type specific error codes */
|
||||
enum {
|
||||
/* Hash is full */
|
||||
IPSET_ERR_HASH_FULL = IPSET_ERR_TYPE_SPECIFIC,
|
||||
/* Null-valued element */
|
||||
IPSET_ERR_HASH_ELEM,
|
||||
/* Invalid protocol */
|
||||
IPSET_ERR_INVALID_PROTO,
|
||||
/* Protocol missing but must be specified */
|
||||
IPSET_ERR_MISSING_PROTO,
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define IPSET_DEFAULT_HASHSIZE 1024
|
||||
#define IPSET_MIMINAL_HASHSIZE 64
|
||||
#define IPSET_DEFAULT_MAXELEM 65536
|
||||
#define IPSET_DEFAULT_PROBES 4
|
||||
#define IPSET_DEFAULT_RESIZE 100
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __IP_SET_HASH_H */
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef __IP_SET_LIST_H
|
||||
#define __IP_SET_LIST_H
|
||||
|
||||
/* List type specific error codes */
|
||||
enum {
|
||||
/* Set name to be added/deleted/tested does not exist. */
|
||||
IPSET_ERR_NAME = IPSET_ERR_TYPE_SPECIFIC,
|
||||
/* list:set type is not permitted to add */
|
||||
IPSET_ERR_LOOP,
|
||||
/* Missing reference set */
|
||||
IPSET_ERR_BEFORE,
|
||||
/* Reference set does not exist */
|
||||
IPSET_ERR_NAMEREF,
|
||||
/* Set is full */
|
||||
IPSET_ERR_LIST_FULL,
|
||||
/* Reference set is not added to the set */
|
||||
IPSET_ERR_REF_EXIST,
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define IP_SET_LIST_DEFAULT_SIZE 8
|
||||
#define IP_SET_LIST_MIN_SIZE 4
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __IP_SET_LIST_H */
|
||||
@@ -0,0 +1,127 @@
|
||||
#ifndef _IP_SET_TIMEOUT_H
|
||||
#define _IP_SET_TIMEOUT_H
|
||||
|
||||
/* Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* How often should the gc be run by default */
|
||||
#define IPSET_GC_TIME (3 * 60)
|
||||
|
||||
/* Timeout period depending on the timeout value of the given set */
|
||||
#define IPSET_GC_PERIOD(timeout) \
|
||||
((timeout/3) ? min_t(u32, (timeout)/3, IPSET_GC_TIME) : 1)
|
||||
|
||||
/* Set is defined without timeout support: timeout value may be 0 */
|
||||
#define IPSET_NO_TIMEOUT UINT_MAX
|
||||
|
||||
#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT)
|
||||
|
||||
static inline unsigned int
|
||||
ip_set_timeout_uget(struct nlattr *tb)
|
||||
{
|
||||
unsigned int timeout = ip_set_get_h32(tb);
|
||||
|
||||
/* Userspace supplied TIMEOUT parameter: adjust crazy size */
|
||||
return timeout == IPSET_NO_TIMEOUT ? IPSET_NO_TIMEOUT - 1 : timeout;
|
||||
}
|
||||
|
||||
#ifdef IP_SET_BITMAP_TIMEOUT
|
||||
|
||||
/* Bitmap specific timeout constants and macros for the entries */
|
||||
|
||||
/* Bitmap entry is unset */
|
||||
#define IPSET_ELEM_UNSET 0
|
||||
/* Bitmap entry is set with no timeout value */
|
||||
#define IPSET_ELEM_PERMANENT (UINT_MAX/2)
|
||||
|
||||
static inline bool
|
||||
ip_set_timeout_test(unsigned long timeout)
|
||||
{
|
||||
return timeout != IPSET_ELEM_UNSET &&
|
||||
(timeout == IPSET_ELEM_PERMANENT ||
|
||||
time_after(timeout, jiffies));
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ip_set_timeout_expired(unsigned long timeout)
|
||||
{
|
||||
return timeout != IPSET_ELEM_UNSET &&
|
||||
timeout != IPSET_ELEM_PERMANENT &&
|
||||
time_before(timeout, jiffies);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
ip_set_timeout_set(u32 timeout)
|
||||
{
|
||||
unsigned long t;
|
||||
|
||||
if (!timeout)
|
||||
return IPSET_ELEM_PERMANENT;
|
||||
|
||||
t = timeout * HZ + jiffies;
|
||||
if (t == IPSET_ELEM_UNSET || t == IPSET_ELEM_PERMANENT)
|
||||
/* Bingo! */
|
||||
t++;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
static inline u32
|
||||
ip_set_timeout_get(unsigned long timeout)
|
||||
{
|
||||
return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* Hash specific timeout constants and macros for the entries */
|
||||
|
||||
/* Hash entry is set with no timeout value */
|
||||
#define IPSET_ELEM_PERMANENT 0
|
||||
|
||||
static inline bool
|
||||
ip_set_timeout_test(unsigned long timeout)
|
||||
{
|
||||
return timeout == IPSET_ELEM_PERMANENT ||
|
||||
time_after(timeout, jiffies);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ip_set_timeout_expired(unsigned long timeout)
|
||||
{
|
||||
return timeout != IPSET_ELEM_PERMANENT &&
|
||||
time_before(timeout, jiffies);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
ip_set_timeout_set(u32 timeout)
|
||||
{
|
||||
unsigned long t;
|
||||
|
||||
if (!timeout)
|
||||
return IPSET_ELEM_PERMANENT;
|
||||
|
||||
t = timeout * HZ + jiffies;
|
||||
if (t == IPSET_ELEM_PERMANENT)
|
||||
/* Bingo! :-) */
|
||||
t++;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
static inline u32
|
||||
ip_set_timeout_get(unsigned long timeout)
|
||||
{
|
||||
return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ;
|
||||
}
|
||||
#endif /* ! IP_SET_BITMAP_TIMEOUT */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _IP_SET_TIMEOUT_H */
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef _PFXLEN_H
|
||||
#define _PFXLEN_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/netfilter.h>
|
||||
|
||||
/* Prefixlen maps, by Jan Engelhardt */
|
||||
extern const union nf_inet_addr ip_set_netmask_map[];
|
||||
extern const union nf_inet_addr ip_set_hostmask_map[];
|
||||
|
||||
static inline __be32
|
||||
ip_set_netmask(u8 pfxlen)
|
||||
{
|
||||
return ip_set_netmask_map[pfxlen].ip;
|
||||
}
|
||||
|
||||
static inline const __be32 *
|
||||
ip_set_netmask6(u8 pfxlen)
|
||||
{
|
||||
return &ip_set_netmask_map[pfxlen].ip6[0];
|
||||
}
|
||||
|
||||
static inline u32
|
||||
ip_set_hostmask(u8 pfxlen)
|
||||
{
|
||||
return (__force u32) ip_set_hostmask_map[pfxlen].ip;
|
||||
}
|
||||
|
||||
static inline const __be32 *
|
||||
ip_set_hostmask6(u8 pfxlen)
|
||||
{
|
||||
return &ip_set_hostmask_map[pfxlen].ip6[0];
|
||||
}
|
||||
|
||||
#endif /*_PFXLEN_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef _NF_CONNTRACK_SNMP_H
|
||||
#define _NF_CONNTRACK_SNMP_H
|
||||
|
||||
extern int (*nf_nat_snmp_hook)(struct sk_buff *skb,
|
||||
unsigned int protoff,
|
||||
struct nf_conn *ct,
|
||||
enum ip_conntrack_info ctinfo);
|
||||
|
||||
#endif /* _NF_CONNTRACK_SNMP_H */
|
||||
@@ -47,7 +47,8 @@ struct nfgenmsg {
|
||||
#define NFNL_SUBSYS_QUEUE 3
|
||||
#define NFNL_SUBSYS_ULOG 4
|
||||
#define NFNL_SUBSYS_OSF 5
|
||||
#define NFNL_SUBSYS_COUNT 6
|
||||
#define NFNL_SUBSYS_IPSET 6
|
||||
#define NFNL_SUBSYS_COUNT 7
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ enum ctattr_type {
|
||||
CTA_SECMARK, /* obsolete */
|
||||
CTA_ZONE,
|
||||
CTA_SECCTX,
|
||||
CTA_TIMESTAMP,
|
||||
__CTA_MAX
|
||||
};
|
||||
#define CTA_MAX (__CTA_MAX - 1)
|
||||
@@ -127,6 +128,14 @@ enum ctattr_counters {
|
||||
};
|
||||
#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1)
|
||||
|
||||
enum ctattr_tstamp {
|
||||
CTA_TIMESTAMP_UNSPEC,
|
||||
CTA_TIMESTAMP_START,
|
||||
CTA_TIMESTAMP_STOP,
|
||||
__CTA_TIMESTAMP_MAX
|
||||
};
|
||||
#define CTA_TIMESTAMP_MAX (__CTA_TIMESTAMP_MAX - 1)
|
||||
|
||||
enum ctattr_nat {
|
||||
CTA_NAT_UNSPEC,
|
||||
CTA_NAT_MINIP,
|
||||
|
||||
@@ -611,8 +611,9 @@ struct _compat_xt_align {
|
||||
extern void xt_compat_lock(u_int8_t af);
|
||||
extern void xt_compat_unlock(u_int8_t af);
|
||||
|
||||
extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta);
|
||||
extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta);
|
||||
extern void xt_compat_flush_offsets(u_int8_t af);
|
||||
extern void xt_compat_init_offsets(u_int8_t af, unsigned int number);
|
||||
extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset);
|
||||
|
||||
extern int xt_compat_match_offset(const struct xt_match *match);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Header file for iptables xt_AUDIT target
|
||||
*
|
||||
* (C) 2010-2011 Thomas Graf <tgraf@redhat.com>
|
||||
* (C) 2010-2011 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef _XT_AUDIT_TARGET_H
|
||||
#define _XT_AUDIT_TARGET_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum {
|
||||
XT_AUDIT_TYPE_ACCEPT = 0,
|
||||
XT_AUDIT_TYPE_DROP,
|
||||
XT_AUDIT_TYPE_REJECT,
|
||||
__XT_AUDIT_TYPE_MAX,
|
||||
};
|
||||
|
||||
#define XT_AUDIT_TYPE_MAX (__XT_AUDIT_TYPE_MAX - 1)
|
||||
|
||||
struct xt_audit_info {
|
||||
__u8 type; /* XT_AUDIT_TYPE_* */
|
||||
};
|
||||
|
||||
#endif /* _XT_AUDIT_TARGET_H */
|
||||
@@ -1,14 +1,16 @@
|
||||
#ifndef _XT_CT_H
|
||||
#define _XT_CT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define XT_CT_NOTRACK 0x1
|
||||
|
||||
struct xt_ct_target_info {
|
||||
u_int16_t flags;
|
||||
u_int16_t zone;
|
||||
u_int32_t ct_events;
|
||||
u_int32_t exp_events;
|
||||
char helper[16];
|
||||
__u16 flags;
|
||||
__u16 zone;
|
||||
__u32 ct_events;
|
||||
__u32 exp_events;
|
||||
char helper[16];
|
||||
|
||||
/* Used internally by the kernel */
|
||||
struct nf_conn *ct __attribute__((aligned(8)));
|
||||
|
||||
@@ -20,4 +20,10 @@ struct xt_NFQ_info_v1 {
|
||||
__u16 queues_total;
|
||||
};
|
||||
|
||||
struct xt_NFQ_info_v2 {
|
||||
__u16 queuenum;
|
||||
__u16 queues_total;
|
||||
__u16 bypass;
|
||||
};
|
||||
|
||||
#endif /* _XT_NFQ_TARGET_H */
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#ifndef _XT_TCPOPTSTRIP_H
|
||||
#define _XT_TCPOPTSTRIP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define tcpoptstrip_set_bit(bmap, idx) \
|
||||
(bmap[(idx) >> 5] |= 1U << (idx & 31))
|
||||
#define tcpoptstrip_test_bit(bmap, idx) \
|
||||
(((1U << (idx & 31)) & bmap[(idx) >> 5]) != 0)
|
||||
|
||||
struct xt_tcpoptstrip_target_info {
|
||||
u_int32_t strip_bmap[8];
|
||||
__u32 strip_bmap[8];
|
||||
};
|
||||
|
||||
#endif /* _XT_TCPOPTSTRIP_H */
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
#ifndef _XT_TPROXY_H
|
||||
#define _XT_TPROXY_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* TPROXY target is capable of marking the packet to perform
|
||||
* redirection. We can get rid of that whenever we get support for
|
||||
* mutliple targets in the same rule. */
|
||||
struct xt_tproxy_target_info {
|
||||
u_int32_t mark_mask;
|
||||
u_int32_t mark_value;
|
||||
__u32 mark_mask;
|
||||
__u32 mark_value;
|
||||
__be32 laddr;
|
||||
__be16 lport;
|
||||
};
|
||||
|
||||
struct xt_tproxy_target_info_v1 {
|
||||
u_int32_t mark_mask;
|
||||
u_int32_t mark_value;
|
||||
__u32 mark_mask;
|
||||
__u32 mark_value;
|
||||
union nf_inet_addr laddr;
|
||||
__be16 lport;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef _XT_ADDRTYPE_H
|
||||
#define _XT_ADDRTYPE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum {
|
||||
XT_ADDRTYPE_INVERT_SOURCE = 0x0001,
|
||||
XT_ADDRTYPE_INVERT_DEST = 0x0002,
|
||||
XT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004,
|
||||
XT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008,
|
||||
};
|
||||
|
||||
|
||||
/* rtn_type enum values from rtnetlink.h, but shifted */
|
||||
enum {
|
||||
XT_ADDRTYPE_UNSPEC = 1 << 0,
|
||||
XT_ADDRTYPE_UNICAST = 1 << 1, /* 1 << RTN_UNICAST */
|
||||
XT_ADDRTYPE_LOCAL = 1 << 2, /* 1 << RTN_LOCAL, etc */
|
||||
XT_ADDRTYPE_BROADCAST = 1 << 3,
|
||||
XT_ADDRTYPE_ANYCAST = 1 << 4,
|
||||
XT_ADDRTYPE_MULTICAST = 1 << 5,
|
||||
XT_ADDRTYPE_BLACKHOLE = 1 << 6,
|
||||
XT_ADDRTYPE_UNREACHABLE = 1 << 7,
|
||||
XT_ADDRTYPE_PROHIBIT = 1 << 8,
|
||||
XT_ADDRTYPE_THROW = 1 << 9,
|
||||
XT_ADDRTYPE_NAT = 1 << 10,
|
||||
XT_ADDRTYPE_XRESOLVE = 1 << 11,
|
||||
};
|
||||
|
||||
struct xt_addrtype_info_v1 {
|
||||
__u16 source; /* source-type mask */
|
||||
__u16 dest; /* dest-type mask */
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
/* revision 0 */
|
||||
struct xt_addrtype_info {
|
||||
__u16 source; /* source-type mask */
|
||||
__u16 dest; /* dest-type mask */
|
||||
__u32 invert_source;
|
||||
__u32 invert_dest;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,15 +1,17 @@
|
||||
#ifndef _XT_CLUSTER_MATCH_H
|
||||
#define _XT_CLUSTER_MATCH_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum xt_cluster_flags {
|
||||
XT_CLUSTER_F_INV = (1 << 0)
|
||||
};
|
||||
|
||||
struct xt_cluster_match_info {
|
||||
u_int32_t total_nodes;
|
||||
u_int32_t node_mask;
|
||||
u_int32_t hash_seed;
|
||||
u_int32_t flags;
|
||||
__u32 total_nodes;
|
||||
__u32 node_mask;
|
||||
__u32 hash_seed;
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
#define XT_CLUSTER_NODES_MAX 32
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#define XT_MAX_COMMENT_LEN 256
|
||||
|
||||
struct xt_comment_info {
|
||||
unsigned char comment[XT_MAX_COMMENT_LEN];
|
||||
char comment[XT_MAX_COMMENT_LEN];
|
||||
};
|
||||
|
||||
#endif /* XT_COMMENT_H */
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
#ifndef _XT_CONNLIMIT_H
|
||||
#define _XT_CONNLIMIT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct xt_connlimit_data;
|
||||
|
||||
enum {
|
||||
XT_CONNLIMIT_INVERT = 1 << 0,
|
||||
XT_CONNLIMIT_DADDR = 1 << 1,
|
||||
};
|
||||
|
||||
struct xt_connlimit_info {
|
||||
union {
|
||||
union nf_inet_addr mask;
|
||||
@@ -13,7 +20,14 @@ struct xt_connlimit_info {
|
||||
};
|
||||
#endif
|
||||
};
|
||||
unsigned int limit, inverse;
|
||||
unsigned int limit;
|
||||
union {
|
||||
/* revision 0 */
|
||||
unsigned int inverse;
|
||||
|
||||
/* revision 1 */
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
/* Used internally by the kernel */
|
||||
struct xt_connlimit_data *data __attribute__((aligned(8)));
|
||||
|
||||
@@ -58,4 +58,19 @@ struct xt_conntrack_mtinfo2 {
|
||||
__u16 state_mask, status_mask;
|
||||
};
|
||||
|
||||
struct xt_conntrack_mtinfo3 {
|
||||
union nf_inet_addr origsrc_addr, origsrc_mask;
|
||||
union nf_inet_addr origdst_addr, origdst_mask;
|
||||
union nf_inet_addr replsrc_addr, replsrc_mask;
|
||||
union nf_inet_addr repldst_addr, repldst_mask;
|
||||
__u32 expires_min, expires_max;
|
||||
__u16 l4proto;
|
||||
__u16 origsrc_port, origdst_port;
|
||||
__u16 replsrc_port, repldst_port;
|
||||
__u16 match_flags, invert_flags;
|
||||
__u16 state_mask, status_mask;
|
||||
__u16 origsrc_port_high, origdst_port_high;
|
||||
__u16 replsrc_port_high, repldst_port_high;
|
||||
};
|
||||
|
||||
#endif /*_XT_CONNTRACK_H*/
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _XT_DEVGROUP_H
|
||||
#define _XT_DEVGROUP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum xt_devgroup_flags {
|
||||
XT_DEVGROUP_MATCH_SRC = 0x1,
|
||||
XT_DEVGROUP_INVERT_SRC = 0x2,
|
||||
XT_DEVGROUP_MATCH_DST = 0x4,
|
||||
XT_DEVGROUP_INVERT_DST = 0x8,
|
||||
};
|
||||
|
||||
struct xt_devgroup_info {
|
||||
__u32 flags;
|
||||
__u32 src_group;
|
||||
__u32 src_mask;
|
||||
__u32 dst_group;
|
||||
__u32 dst_mask;
|
||||
};
|
||||
|
||||
#endif /* _XT_DEVGROUP_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user