summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.davemloft.net>2004-06-23 04:17:00 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-06-23 04:17:00 -0700
commitbc61f4fff58f6625342d16f2cda84dbfe95613e8 (patch)
tree5eec41ab052d68d457aed3de185c004d62a5c98f /include/linux
parent38194998ffe413468434633b26eb66dd3967f758 (diff)
parent5e1c40de84c8e0514e8fe7e5db5087355dc00d5c (diff)
Merge nuts.davemloft.net:/disk1/BK/netnew-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libata.h1
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_addrtype.h11
-rw-r--r--include/linux/netfilter_ipv4/ipt_realm.h10
-rw-r--r--include/linux/pkt_cls.h182
-rw-r--r--include/linux/pkt_sched.h7
-rw-r--r--include/linux/rtnetlink.h17
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/skbuff.h25
10 files changed, 247 insertions, 13 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 787f3583729a..a40286d08e23 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -91,6 +91,7 @@ enum {
ATA_DFLAG_MASTER = (1 << 2), /* is device 0? */
ATA_DFLAG_WCACHE = (1 << 3), /* has write cache we can
* (hopefully) flush? */
+ ATA_DFLAG_LOCK_SECTORS = (1 << 4), /* don't adjust max_sectors */
ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 97758cd8f50e..9f380143cec0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -366,6 +366,8 @@ struct net_device
struct Qdisc *qdisc_ingress;
unsigned long tx_queue_len; /* Max frames per queue allowed */
+ /* ingress path synchronizer */
+ spinlock_t ingress_lock;
/* hard_start_xmit synchronizer */
spinlock_t xmit_lock;
/* cpu id of processor entered to hard_start_xmit or -1,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 26d7f3a11fd7..1974f162f5a0 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -103,7 +103,7 @@ union ip_conntrack_nat_help {
#include <linux/types.h>
#include <linux/skbuff.h>
-#ifdef CONFIG_NF_DEBUG
+#ifdef CONFIG_NETFILTER_DEBUG
#define IP_NF_ASSERT(x) \
do { \
if (!(x)) \
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h
new file mode 100644
index 000000000000..166ed01a8122
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ipt_addrtype.h
@@ -0,0 +1,11 @@
+#ifndef _IPT_ADDRTYPE_H
+#define _IPT_ADDRTYPE_H
+
+struct ipt_addrtype_info {
+ u_int16_t source; /* source-type mask */
+ u_int16_t dest; /* dest-type mask */
+ u_int32_t invert_source;
+ u_int32_t invert_dest;
+};
+
+#endif
diff --git a/include/linux/netfilter_ipv4/ipt_realm.h b/include/linux/netfilter_ipv4/ipt_realm.h
new file mode 100644
index 000000000000..a4d6698723ac
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ipt_realm.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_REALM_H
+#define _IPT_REALM_H
+
+struct ipt_realm_info {
+ u_int32_t id;
+ u_int32_t mask;
+ u_int8_t invert;
+};
+
+#endif /* _IPT_REALM_H */
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index f54111f9d14c..06e4e728d4fc 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -1,14 +1,139 @@
#ifndef __LINUX_PKT_CLS_H
#define __LINUX_PKT_CLS_H
+/* I think i could have done better macros ; for now this is stolen from
+ * some arch/mips code - jhs
+*/
+#define _TC_MAKE32(x) ((x))
+
+#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n))
+#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n))
+#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n))
+#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n))
+
+/* verdict bit breakdown
+ *
+bit 0: when set -> this packet has been munged already
+
+bit 1: when set -> It is ok to munge this packet
+
+bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded
+assume loop
+
+bit 6,7: Where this packet was last seen
+0: Above the transmit example at the socket level
+1: on the Ingress
+2: on the Egress
+
+bit 8: when set --> Request not to classify on ingress.
+
+bits 9,10,11: redirect counter - redirect TTL. Loop avoidance
+
+ *
+ * */
+
+#define TC_MUNGED _TC_MAKEMASK1(0)
+#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
+#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
+
+#define TC_OK2MUNGE _TC_MAKEMASK1(1)
+#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
+#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
+
+#define S_TC_VERD _TC_MAKE32(2)
+#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
+#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
+#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
+#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
+
+#define S_TC_FROM _TC_MAKE32(6)
+#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
+#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
+#define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM)
+#define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM))
+#define AT_STACK 0x0
+#define AT_INGRESS 0x1
+#define AT_EGRESS 0x2
+
+#define TC_NCLS _TC_MAKEMASK1(8)
+#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
+#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
+
+#define S_TC_RTTL _TC_MAKE32(9)
+#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
+#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
+#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
+#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
+
+#define S_TC_AT _TC_MAKE32(12)
+#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
+#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
+#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
+#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
+
+/* Action attributes */
+enum
+{
+ TCA_ACT_UNSPEC,
+ TCA_ACT_KIND,
+ TCA_ACT_OPTIONS,
+ TCA_ACT_INDEX,
+ __TCA_ACT_MAX
+};
+
+#define TCA_ACT_MAX __TCA_ACT_MAX
+#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
+#define TCA_ACT_MAX_PRIO 32
+#define TCA_ACT_BIND 1
+#define TCA_ACT_NOBIND 0
+#define TCA_ACT_UNBIND 1
+#define TCA_ACT_NOUNBIND 0
+#define TCA_ACT_REPLACE 1
+#define TCA_ACT_NOREPLACE 0
+#define MAX_REC_LOOP 4
+#define MAX_RED_LOOP 4
+
+#define TC_ACT_UNSPEC (-1)
+#define TC_ACT_OK 0
+#define TC_ACT_RECLASSIFY 1
+#define TC_ACT_SHOT 2
+#define TC_ACT_PIPE 3
+#define TC_ACT_STOLEN 4
+#define TC_ACT_QUEUED 5
+#define TC_ACT_REPEAT 6
+#define TC_ACT_JUMP 0x10000000
+
+/* Action type identifiers*/
+enum
+{
+ TCA_ID_UNSPEC=0,
+ TCA_ID_POLICE=1,
+ /* other actions go here */
+ __TCA_ID_MAX=255
+};
+
+#define TCA_ID_MAX __TCA_ID_MAX
+
struct tc_police
{
__u32 index;
+#ifdef CONFIG_NET_CLS_ACT
+ int refcnt;
+ int bindcnt;
+#endif
+/* Turned off because it requires new tc
+ * to work (for now maintain ABI)
+ *
+#ifdef CONFIG_NET_CLS_ACT
+ __u32 capab;
+#endif
+*/
int action;
-#define TC_POLICE_UNSPEC (-1)
-#define TC_POLICE_OK 0
-#define TC_POLICE_RECLASSIFY 1
-#define TC_POLICE_SHOT 2
+#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
+#define TC_POLICE_OK TC_ACT_OK
+#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
+#define TC_POLICE_SHOT TC_ACT_SHOT
+#define TC_POLICE_PIPE TC_ACT_PIPE
__u32 limit;
__u32 burst;
@@ -17,6 +142,26 @@ struct tc_police
struct tc_ratespec peakrate;
};
+struct tcf_t
+{
+ __u32 install;
+ __u32 lastuse;
+ __u32 expires;
+};
+
+struct tc_cnt
+{
+ int refcnt;
+ int bindcnt;
+};
+
+#define tc_gen \
+ __u32 index; \
+ __u32 capab; \
+ int action; \
+ int refcnt; \
+ int bindcnt
+
enum
{
TCA_POLICE_UNSPEC,
@@ -25,8 +170,8 @@ enum
TCA_POLICE_PEAKRATE,
TCA_POLICE_AVRATE,
TCA_POLICE_RESULT,
-#define TCA_POLICE_RESULT TCA_POLICE_RESULT
__TCA_POLICE_MAX
+#define TCA_POLICE_RESULT TCA_POLICE_RESULT
};
#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
@@ -50,6 +195,12 @@ enum
TCA_U32_DIVISOR,
TCA_U32_SEL,
TCA_U32_POLICE,
+#ifdef CONFIG_NET_CLS_ACT
+ TCA_U32_ACT,
+#endif
+#ifdef CONFIG_NET_CLS_IND
+ TCA_U32_INDEV,
+#endif
__TCA_U32_MAX
};
@@ -61,6 +212,9 @@ struct tc_u32_key
__u32 val;
int off;
int offmask;
+#ifdef CONFIG_CLS_U32_PERF
+ unsigned long kcnt;
+#endif
};
struct tc_u32_sel
@@ -68,6 +222,9 @@ struct tc_u32_sel
unsigned char flags;
unsigned char offshift;
unsigned char nkeys;
+#ifdef fix_u32_bug
+ unsigned char fshift; /* fold shift */
+#endif
__u16 offmask;
__u16 off;
@@ -75,7 +232,10 @@ struct tc_u32_sel
short hoff;
__u32 hmask;
-
+#ifdef CONFIG_CLS_U32_PERF
+ unsigned long rcnt;
+ unsigned long rhit;
+#endif
struct tc_u32_key keys[0];
};
@@ -102,7 +262,7 @@ enum
__TCA_RSVP_MAX
};
-#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1)
+#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
struct tc_rsvp_gpi
{
@@ -143,6 +303,12 @@ enum
TCA_FW_UNSPEC,
TCA_FW_CLASSID,
TCA_FW_POLICE,
+#ifdef CONFIG_NET_CLS_IND
+ TCA_FW_INDEV,
+#endif
+#ifdef CONFIG_NET_CLS_ACT
+ TCA_FW_ACT,
+#endif
__TCA_FW_MAX
};
@@ -162,6 +328,6 @@ enum
__TCA_TCINDEX_MAX
};
-#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
+#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
#endif
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index ef350df8e560..6b3f74154be6 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -37,6 +37,13 @@ struct tc_stats
__u32 bps; /* Current flow byte rate */
__u32 pps; /* Current flow packet rate */
__u32 qlen;
+#ifdef CONFIG_NET_CLS_ACT
+/* eventually remove the define here; adding this(useful)
+field at least fixes the 8 byte layout problems we
+have with MIPS and PPC because we have a u64
+*/
+ __u32 reqs; /* number of requeues happened */
+#endif
__u32 backlog;
#ifdef __KERNEL__
spinlock_t *lock;
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 4b3a0b5d44b6..366eae3b4fc3 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -44,6 +44,10 @@
#define RTM_DELTFILTER (RTM_BASE+29)
#define RTM_GETTFILTER (RTM_BASE+30)
+#define RTM_NEWACTION (RTM_BASE+32)
+#define RTM_DELACTION (RTM_BASE+33)
+#define RTM_GETACTION (RTM_BASE+34)
+
#define RTM_NEWPREFIX (RTM_BASE+36)
#define RTM_GETPREFIX (RTM_BASE+38)
@@ -639,6 +643,7 @@ enum
TCA_STATS,
TCA_XSTATS,
TCA_RATE,
+ TCA_FCNT,
__TCA_MAX
};
@@ -673,6 +678,18 @@ enum
#define RTMGRP_IPV6_PREFIX 0x20000
+/* TC action piece */
+struct tcamsg
+{
+ unsigned char tca_family;
+ unsigned char tca__pad1;
+ unsigned short tca__pad2;
+};
+#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
+#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
+#define TCA_ACT_TAB 1 /* attr type must be >=1 */
+#define TCAA_MAX 1
+
/* End of information exported to user level */
#ifdef __KERNEL__
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index f79c67d6f281..c653647073f1 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -80,6 +80,9 @@
/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
#define PORT_IP22ZILOG 56
+/* Sharp LH7a40x -- an ARM9 SoC series */
+#define PORT_LH7A40X 57
+
#ifdef __KERNEL__
#include <linux/config.h>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 26e258c66ff5..3d0ba45fa88d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -156,6 +156,7 @@ struct skb_shared_info {
* @sk: Socket we are owned by
* @stamp: Time we arrived
* @dev: Device we arrived on/are leaving by
+ * @input_dev: Device we arrived on
* @real_dev: The real device we are using
* @h: Transport layer header
* @nh: Network layer header
@@ -198,6 +199,7 @@ struct sk_buff {
struct sock *sk;
struct timeval stamp;
struct net_device *dev;
+ struct net_device *input_dev;
struct net_device *real_dev;
union {
@@ -263,9 +265,15 @@ struct sk_buff {
} private;
#endif
#ifdef CONFIG_NET_SCHED
- __u32 tc_index; /* traffic control index */
+ __u32 tc_index; /* traffic control index */
+#ifdef CONFIG_NET_CLS_ACT
+ __u32 tc_verd; /* traffic control verdict */
+ __u32 tc_classid; /* traffic control classid */
+ #endif
+
#endif
+
/* These elements must be at the end, see alloc_skb() for details. */
unsigned int truesize;
atomic_t users;
@@ -1111,6 +1119,14 @@ static inline void nf_conntrack_get(struct nf_ct_info *nfct)
if (nfct)
atomic_inc(&nfct->master->use);
}
+static inline void nf_reset(struct sk_buff *skb)
+{
+ nf_conntrack_put(skb->nfct);
+ skb->nfct = NULL;
+#ifdef CONFIG_NETFILTER_DEBUG
+ skb->nf_debug = 0;
+#endif
+}
#ifdef CONFIG_BRIDGE_NETFILTER
static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)
@@ -1123,9 +1139,10 @@ static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge)
if (nf_bridge)
atomic_inc(&nf_bridge->use);
}
-#endif
-
-#endif
+#endif /* CONFIG_BRIDGE_NETFILTER */
+#else /* CONFIG_NETFILTER */
+static inline void nf_reset(struct sk_buff *skb) {}
+#endif /* CONFIG_NETFILTER */
#endif /* __KERNEL__ */
#endif /* _LINUX_SKBUFF_H */