summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2004-06-21 11:46:13 +0100
committerAnton Altaparmakov <aia21@cantab.net>2004-06-21 11:46:13 +0100
commitbde83043a7e018b08d808ca933962be4678ec5cb (patch)
tree7ad914ed75f5d02383143b1354a793611668cd14 /include/linux
parentcfeac312b3960ac26ed085860ee10b531ad65aa5 (diff)
parent9a85e04ec3e527234d8a2210e6ba04d7af9a4298 (diff)
Merge cantab.net:/home/src/bklinux-2.6
into cantab.net:/home/src/ntfs-2.6
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/affs_fs.h3
-rw-r--r--include/linux/affs_fs_sb.h1
-rw-r--r--include/linux/bio.h18
-rw-r--r--include/linux/bootmem.h8
-rw-r--r--include/linux/dmi.h47
-rw-r--r--include/linux/ds1286.h54
-rw-r--r--include/linux/errqueue.h4
-rw-r--r--include/linux/fs.h14
-rw-r--r--include/linux/idr.h2
-rw-r--r--include/linux/kernel.h9
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--include/linux/netfilter.h1
-rw-r--r--include/linux/netfilter_arp/arp_tables.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h3
-rw-r--r--include/linux/skbuff.h36
-rw-r--r--include/linux/videodev2.h17
-rw-r--r--include/linux/wait.h31
19 files changed, 250 insertions, 16 deletions
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h
index c849309b1131..5ba9d6205dc0 100644
--- a/include/linux/affs_fs.h
+++ b/include/linux/affs_fs.h
@@ -36,7 +36,8 @@ extern u32 affs_count_free_bits(u32 blocksize, const void *data);
extern u32 affs_count_free_blocks(struct super_block *s);
extern void affs_free_block(struct super_block *sb, u32 block);
extern u32 affs_alloc_block(struct inode *inode, u32 goal);
-extern int affs_init_bitmap(struct super_block *sb);
+extern int affs_init_bitmap(struct super_block *sb, int *flags);
+extern void affs_free_bitmap(struct super_block *sb);
/* namei.c */
diff --git a/include/linux/affs_fs_sb.h b/include/linux/affs_fs_sb.h
index d2f86715cf1c..d722befe1ced 100644
--- a/include/linux/affs_fs_sb.h
+++ b/include/linux/affs_fs_sb.h
@@ -47,7 +47,6 @@ struct affs_sb_info {
#define SF_OFS 0x0200 /* Old filesystem */
#define SF_PREFIX 0x0400 /* Buffer for prefix is allocated */
#define SF_VERBOSE 0x0800 /* Talk about fs when mounting */
-#define SF_READONLY 0x1000 /* Don't allow to remount rw */
/* short cut to get to the affs specific sb data */
static inline struct affs_sb_info *AFFS_SB(struct super_block *sb)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index c4dd287dd1c8..601531cf4976 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -25,6 +25,15 @@
/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
#include <asm/io.h>
+
+#if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY)
+#define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1))
+#define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE)
+#else
+#define BIOVEC_VIRT_START_SIZE(x) 0
+#define BIOVEC_VIRT_OVERSIZE(x) 0
+#endif
+
#ifndef BIO_VMERGE_BOUNDARY
#define BIO_VMERGE_BOUNDARY 0
#endif
@@ -81,6 +90,15 @@ struct bio {
unsigned short bi_hw_segments;
unsigned int bi_size; /* residual I/O count */
+
+ /*
+ * To keep track of the max hw size, we account for the
+ * sizes of the first and last virtually mergeable segments
+ * in this bio
+ */
+ unsigned int bi_hw_front_size;
+ unsigned int bi_hw_back_size;
+
unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
struct bio_vec *bi_io_vec; /* the actual vec list */
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 6902724691d2..e038f9a3d0ef 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -67,4 +67,12 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size,
__alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0)
#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
+extern void *__init alloc_large_system_hash(const char *tablename,
+ unsigned long bucketsize,
+ unsigned long numentries,
+ int scale,
+ int consider_highmem,
+ unsigned int *_hash_shift,
+ unsigned int *_hash_mask);
+
#endif /* _LINUX_BOOTMEM_H */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
new file mode 100644
index 000000000000..d2bcf556088b
--- /dev/null
+++ b/include/linux/dmi.h
@@ -0,0 +1,47 @@
+#ifndef __DMI_H__
+#define __DMI_H__
+
+enum dmi_field {
+ DMI_NONE,
+ DMI_BIOS_VENDOR,
+ DMI_BIOS_VERSION,
+ DMI_BIOS_DATE,
+ DMI_SYS_VENDOR,
+ DMI_PRODUCT_NAME,
+ DMI_PRODUCT_VERSION,
+ DMI_BOARD_VENDOR,
+ DMI_BOARD_NAME,
+ DMI_BOARD_VERSION,
+ DMI_STRING_MAX,
+};
+
+/*
+ * DMI callbacks for problem boards
+ */
+struct dmi_strmatch {
+ u8 slot;
+ char *substr;
+};
+
+struct dmi_system_id {
+ int (*callback)(struct dmi_system_id *);
+ char *ident;
+ struct dmi_strmatch matches[4];
+ void *driver_data;
+};
+
+#define DMI_MATCH(a,b) { a, b }
+
+#if defined(CONFIG_X86) && !defined(CONFIG_X86_64)
+
+extern int dmi_check_system(struct dmi_system_id *list);
+extern char * dmi_get_system_info(int field);
+
+#else
+
+static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
+static inline char * dmi_get_system_info(int field) { return NULL; }
+
+#endif
+
+#endif /* __DMI_H__ */
diff --git a/include/linux/ds1286.h b/include/linux/ds1286.h
new file mode 100644
index 000000000000..d8989860e4ce
--- /dev/null
+++ b/include/linux/ds1286.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 1998, 1999, 2003 Ralf Baechle
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#ifndef __LINUX_DS1286_H
+#define __LINUX_DS1286_H
+
+#include <asm/ds1286.h>
+
+/**********************************************************************
+ * register summary
+ **********************************************************************/
+#define RTC_HUNDREDTH_SECOND 0
+#define RTC_SECONDS 1
+#define RTC_MINUTES 2
+#define RTC_MINUTES_ALARM 3
+#define RTC_HOURS 4
+#define RTC_HOURS_ALARM 5
+#define RTC_DAY 6
+#define RTC_DAY_ALARM 7
+#define RTC_DATE 8
+#define RTC_MONTH 9
+#define RTC_YEAR 10
+#define RTC_CMD 11
+#define RTC_WHSEC 12
+#define RTC_WSEC 13
+#define RTC_UNUSED 14
+
+/* RTC_*_alarm is always true if 2 MSBs are set */
+# define RTC_ALARM_DONT_CARE 0xC0
+
+
+/*
+ * Bits in the month register
+ */
+#define RTC_EOSC 0x80
+#define RTC_ESQW 0x40
+
+/*
+ * Bits in the Command register
+ */
+#define RTC_TDF 0x01
+#define RTC_WAF 0x02
+#define RTC_TDM 0x04
+#define RTC_WAM 0x08
+#define RTC_PU_LVL 0x10
+#define RTC_IBH_LO 0x20
+#define RTC_IPSW 0x40
+#define RTC_TE 0x80
+
+#endif /* __LINUX_DS1286_H */
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index 0d87e62ec9e7..174582fedb8b 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -22,6 +22,10 @@ struct sock_extended_err
#ifdef __KERNEL__
#include <linux/config.h>
+#include <net/ip.h>
+#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
+#include <linux/ipv6.h>
+#endif
#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 10a69a544045..88337ed4f4f2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -214,15 +214,17 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
#include <linux/list.h>
#include <linux/radix-tree.h>
#include <linux/audit.h>
+#include <linux/init.h>
#include <asm/semaphore.h>
#include <asm/byteorder.h>
/* Used to be a macro which just called the function, now just a function */
extern void update_atime (struct inode *);
-extern void inode_init(unsigned long);
-extern void mnt_init(unsigned long);
-extern void files_init(unsigned long);
+extern void __init inode_init(unsigned long);
+extern void __init inode_init_early(void);
+extern void __init mnt_init(unsigned long);
+extern void __init files_init(unsigned long);
struct buffer_head;
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
@@ -977,7 +979,8 @@ static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
static inline void file_accessed(struct file *file)
{
- touch_atime(file->f_vfsmnt, file->f_dentry);
+ if (!(file->f_flags & O_NOATIME))
+ touch_atime(file->f_vfsmnt, file->f_dentry);
}
int sync_inode(struct inode *inode, struct writeback_control *wbc);
@@ -1199,7 +1202,8 @@ extern int filp_close(struct file *, fl_owner_t id);
extern char * getname(const char __user *);
/* fs/dcache.c */
-extern void vfs_caches_init(unsigned long);
+extern void __init vfs_caches_init_early(void);
+extern void __init vfs_caches_init(unsigned long);
#define __getname() kmem_cache_alloc(names_cachep, SLAB_KERNEL)
#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 8e2618e3f334..f41128683d65 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -1,5 +1,5 @@
/*
- * include/linux/id.h
+ * include/linux/idr.h
*
* 2002-10-18 written by Jim Houston jim.houston@ccur.com
* Copyright (C) 2002 by Concurrent Computer Corporation
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 67da15c2e1e3..9eb023020b44 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -92,6 +92,15 @@ asmlinkage int printk(const char * fmt, ...)
unsigned long int_sqrt(unsigned long);
+static inline int __attribute_pure__ long_log2(unsigned long x)
+{
+ int r = 0;
+ for (x >>= 1; x > 0; x >>= 1)
+ r++;
+ return r;
+}
+
+
extern int printk_ratelimit(void);
extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f1e1a727acb2..373a13ba6f3f 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -20,6 +20,18 @@
#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
#endif
+/*
+ * system hash table size limits
+ * - on large memory machines, we may want to allocate a bigger hash than that
+ * permitted by MAX_ORDER, so we allocate with the bootmem allocator, and are
+ * limited to this size
+ */
+#if MAX_ORDER > 14
+#define MAX_SYS_HASH_TABLE_ORDER MAX_ORDER
+#else
+#define MAX_SYS_HASH_TABLE_ORDER 14
+#endif
+
struct free_area {
struct list_head free_list;
unsigned long *map;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a55f97a34035..97758cd8f50e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -405,6 +405,7 @@ struct net_device
#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */
+#define NETIF_F_LLTX 4096 /* LockLess TX */
/* Called after device is detached from network. */
void (*uninit)(struct net_device *dev);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b20c79258825..83f9668653ca 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -10,6 +10,7 @@
#include <linux/wait.h>
#include <linux/list.h>
#endif
+#include <linux/compiler.h>
/* Responses from hook functions. */
#define NF_DROP 0
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 78c4f7142267..d6a7188b525c 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -16,7 +16,7 @@
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#endif
-
+#include <linux/compiler.h>
#include <linux/netfilter_arp.h>
#define ARPT_FUNCTION_MAXNAMELEN 30
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index f43f1dddebc4..dccc68052c88 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -22,6 +22,7 @@
#include <linux/ip.h>
#include <linux/skbuff.h>
#endif
+#include <linux/compiler.h>
#include <linux/netfilter_ipv4.h>
#define IPT_FUNCTION_MAXNAMELEN 30
@@ -336,8 +337,8 @@ ipt_get_target(struct ipt_entry *e)
/*
* Main firewall chains definitions and global var's definitions.
*/
-static DECLARE_MUTEX(ipt_mutex);
#ifdef __KERNEL__
+static DECLARE_MUTEX(ipt_mutex);
#include <linux/init.h>
extern void ipt_init(void) __init;
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index a0995271934a..f9983d16cc1c 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -22,6 +22,7 @@
#include <linux/ipv6.h>
#include <linux/skbuff.h>
#endif
+#include <linux/compiler.h>
#include <linux/netfilter_ipv6.h>
#define IP6T_FUNCTION_MAXNAMELEN 30
@@ -106,7 +107,9 @@ struct ip6t_counters
u_int64_t pcnt, bcnt; /* Packet and byte counters */
};
+#ifdef __KERNEL__
static DECLARE_MUTEX(ip6t_mutex);
+#endif
/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c0af91ff4b1e..1b33d607f276 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -27,6 +27,7 @@
#include <linux/highmem.h>
#include <linux/poll.h>
#include <linux/net.h>
+#include <net/checksum.h>
#define HAVE_ALLOC_SKB /* For the drivers to know */
#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
@@ -995,6 +996,39 @@ static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len)
return skb_pad(skb, len-size);
}
+static inline int skb_add_data(struct sk_buff *skb,
+ char __user *from, int copy)
+{
+ const int off = skb->len;
+
+ if (skb->ip_summed == CHECKSUM_NONE) {
+ int err = 0;
+ unsigned int csum = csum_and_copy_from_user(from,
+ skb_put(skb, copy),
+ copy, 0, &err);
+ if (!err) {
+ skb->csum = csum_block_add(skb->csum, csum, off);
+ return 0;
+ }
+ } else if (!copy_from_user(skb_put(skb, copy), from, copy))
+ return 0;
+
+ __skb_trim(skb, off);
+ return -EFAULT;
+}
+
+static inline int skb_can_coalesce(struct sk_buff *skb, int i,
+ struct page *page, int off)
+{
+ if (i) {
+ struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
+
+ return page == frag->page &&
+ off == frag->page_offset + frag->size;
+ }
+ return 0;
+}
+
/**
* skb_linearize - convert paged skb to linear one
* @skb: buffer to linarize
@@ -1058,6 +1092,8 @@ extern unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb,
int offset, u8 *to, int len,
unsigned int csum);
extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
+extern void skb_split(struct sk_buff *skb,
+ struct sk_buff *skb1, const u32 len);
extern void skb_init(void);
extern void skb_add_mtu(int mtu);
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index a4ab8e826bbe..ab8727d92739 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -207,6 +207,9 @@ struct v4l2_pix_format
#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
+/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
+
/* compressed formats */
#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
@@ -383,8 +386,8 @@ struct v4l2_buffer
unsigned long userptr;
} m;
__u32 length;
-
- __u32 reserved[2];
+ __u32 input;
+ __u32 reserved;
};
/* Flags for 'flags' field */
@@ -395,6 +398,7 @@ struct v4l2_buffer
#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
+#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
/*
* O V E R L A Y P R E V I E W
@@ -526,12 +530,13 @@ typedef __u64 v4l2_std_id;
V4L2_STD_PAL_I)
#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
V4L2_STD_NTSC_M_JP)
+#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
+ V4L2_STD_SECAM_K |\
+ V4L2_STD_SECAM_K1)
#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
- V4L2_STD_SECAM_D |\
V4L2_STD_SECAM_G |\
V4L2_STD_SECAM_H |\
- V4L2_STD_SECAM_K |\
- V4L2_STD_SECAM_K1 |\
+ V4L2_STD_SECAM_DK |\
V4L2_STD_SECAM_L)
#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
@@ -541,6 +546,8 @@ typedef __u64 v4l2_std_id;
V4L2_STD_PAL_N |\
V4L2_STD_PAL_Nc |\
V4L2_STD_SECAM)
+#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
+ V4L2_STD_ATSC_16_VSB)
#define V4L2_STD_UNKNOWN 0
#define V4L2_STD_ALL (V4L2_STD_525_60 |\
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 52edb1786b14..4a9f996bb6cc 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -200,7 +200,36 @@ do { \
__wait_event_interruptible_timeout(wq, condition, __ret); \
__ret; \
})
-
+
+#define __wait_event_interruptible_exclusive(wq, condition, ret) \
+do { \
+ wait_queue_t __wait; \
+ init_waitqueue_entry(&__wait, current); \
+ \
+ add_wait_queue_exclusive(&wq, &__wait); \
+ for (;;) { \
+ set_current_state(TASK_INTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ if (!signal_pending(current)) { \
+ schedule(); \
+ continue; \
+ } \
+ ret = -ERESTARTSYS; \
+ break; \
+ } \
+ current->state = TASK_RUNNING; \
+ remove_wait_queue(&wq, &__wait); \
+} while (0)
+
+#define wait_event_interruptible_exclusive(wq, condition) \
+({ \
+ int __ret = 0; \
+ if (!(condition)) \
+ __wait_event_interruptible_exclusive(wq, condition, __ret);\
+ __ret; \
+})
+
/*
* Must be called with the spinlock in the wait_queue_head_t held.
*/