--- zzzz-none-000/linux-2.6.28.10/include/linux/skbuff.h 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/include/linux/skbuff.h 2012-08-28 13:01:43.000000000 +0000 @@ -14,6 +14,7 @@ #ifndef _LINUX_SKBUFF_H #define _LINUX_SKBUFF_H +#include #include #include #include @@ -22,13 +23,20 @@ #include #include #include -#include +#include #include #include #include #include #include +#ifdef CONFIG_GENERIC_CONNTRACK +#include +#endif +#ifdef CONFIG_AVM_PA +#include +#endif + #define HAVE_ALLOC_SKB /* For the drivers to know */ #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ @@ -97,9 +105,123 @@ struct scatterlist; struct pipe_inode_info; +/* Structure Definition for QoS */ +#if defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS) || defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS_MODULE) +typedef struct +{ + /* Action */ + unsigned char qos_map; /* QoS Mapping Information */ + unsigned char qos_mark; /* QoS Marking Information */ + + /* Information */ + unsigned char qos_drop_prob; /* QoS Drop Probability */ + unsigned char qos_cos; /* QoS VLAN-COS value */ + unsigned char qos_priority; /* QoS Traffic Priority */ + unsigned char qos_marking_priority; /* QoS Marking Info */ + unsigned char qos_cos_marking_priority; /* QoS COS Marking Info */ +}QoSFlowInfo_t; +#endif + + +#if defined(CONFIG_FUSIV_KERNEL_AP_2_AP) || defined(CONFIG_FUSIV_KERNEL_AP_2_AP_MODULE) + +// Added for AP_FRAGMENTATION ....Start....... + +# define RESERVED_SPACE_FOR_FRAGMENT 20 + +// Module Types + +# define MODULE_TYPE_ADSL 1 +# define MODULE_TYPE_WLAN 2 + +// Packet Types for ADSL + +# define PKT_TYPE_PPPOE 0 +# define PKT_TYPE_VLAN 1 + +// Packet Types for WLAN + +# define PKT_TYPE_ATHEROS_ETH_HDR_CONVERT 2 +# define PKT_TYPE_ATHEROS_NO_ETH_HDR_CONVERT 3 +# define PKT_TYPE_RALINK_11N 4 +# define PKT_TYPE_RALINK_11G 5 + +// Information required for Fragmentation + +struct fragmentInfo { + unsigned int mtuSize; + unsigned short l2HeaderLen; + unsigned short totalLength; + unsigned char moduleType; + unsigned char pktType; + int (*fragment_xmit_ptr)(struct sk_buff *skb, struct net_device *dev); +}; + +// Added for AP_FRAGMENTATION ....End....... + +/* This file is modified with new ADI ap-ap frame work */ +/* apEntryInfo structure is defined here */ + +struct apEntryInfo { + void *RftPtrs[3]; + unsigned short hashValue[3]; + unsigned char apId[3]; + unsigned long adi_nfmark; + unsigned long pktCount[3]; +}; + +struct apFlowInfo { + unsigned char rxApId; + unsigned char txApId; + + struct net_device *rxDev; + struct net_device *txDev; + + struct nf_conntrack *nfct; + + unsigned short hash; + + unsigned short flags1; + unsigned short flags2; + + // For ADSL modules like PPPoE, PPPoA, IPoA + int sessionId; + int connId; + char encap; + +#if defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS) || defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS_MODULE) + QoSFlowInfo_t qosInfo; /* For IPQOS */ +#endif + + struct net_device *postRtDev; + unsigned char controlFlags; +#ifdef CONFIG_BRIDGE + struct net_bridge_fdb_entry *smac_entry; + struct net_bridge_fdb_entry *dmac_entry; +#endif + + unsigned int txHandle; + unsigned int rxHandle; + void* neigh; +#if defined(CONFIG_FUSIV_KERNEL_PERI_AP) || defined(CONFIG_FUSIV_KERNEL_PERI_AP_MODULE) + void *wlanNode; + unsigned char wlanFlags; + unsigned char secHdrLen; + void *secKey; +#endif + +#if defined(CONFIG_IP_NF_IPSEC) || defined(CONFIG_IP_NF_IPSEC_MODULE) + unsigned int spi; +#endif +}; +#endif + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack { atomic_t use; +#if defined(CONFIG_FUSIV_KERNEL_AP_2_AP) || defined(CONFIG_FUSIV_KERNEL_AP_2_AP_MODULE) + struct apEntryInfo apEntryData; +#endif }; #endif @@ -156,6 +278,38 @@ #endif }; +/*------------------------------------------------------------------------------------------*\ +\*------------------------------------------------------------------------------------------*/ +#ifdef CONFIG_TI_PACKET_PROCESSOR + +/* The length of the EPI header. */ +#define TI_EPI_HEADER_LEN 8 + +/* Flag definitions.... */ +#define TI_PPM_SESSION_INGRESS_RECORDED 0x1 +#define TI_PPM_SESSION_BYPASS 0x2 +#define TI_PPM_SESSION_ROUTED 0x4 + +#include + +/* The structure contains information that needs to be stored on a per packet basis + * for the TI Packet Processor to operate. */ +typedef struct TI_PP_PACKET_INFO +{ + TI_PP_SESSION ti_session; + unsigned int ti_pp_flags; + char ti_epi_header[TI_EPI_HEADER_LEN]; +#ifdef CONFIG_TI_PACKET_PROCESSOR_STATS + void* ti_match_llc_filter; + void* ti_match_inbound_ip_filter; + void* ti_match_outbound_ip_filter; + void* ti_match_qos_classifier; +#endif + +}TI_PP_PACKET_INFO; + +#endif /* CONFIG_TI_PACKET_PROCESSOR */ + /* We divide dataref into two halves. The higher 16 bits hold references * to the payload part of skb->data. The lower 16 bits hold references to * the entire skb->data. A clone of a headerless skb holds the length of @@ -264,6 +418,7 @@ struct sock *sk; ktime_t tstamp; struct net_device *dev; + struct net_device *input_dev; union { struct dst_entry *dst; @@ -279,6 +434,24 @@ */ char cb[48]; + char encap; +#if defined(CONFIG_FUSIV_KERNEL_AP_2_AP) || defined(CONFIG_FUSIV_KERNEL_AP_2_AP_MODULE) + struct apFlowInfo apFlowData; /* ADI Structure for + * AP-AP fast path */ +#else +#if defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS) || defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS_MODULE) + QoSFlowInfo_t qosInfo; /* QoS Info structure when AP is disabled */ +#endif +#endif + +#if defined(CONFIG_FUSIV_ENABLE_AP_MBUF) || defined(CONFIG_FUSIV_ENABLE_MBUF_AP) +#if (CONFIG_FUSIV_ENABLE_AP_MBUF | CONFIG_FUSIV_ENABLE_MBUF_AP) + /* Specific to FUSIV, used to map AP cluster to SK BUF and Vice + versa. */ + unsigned char* apAllocAddr; +#endif +#endif + unsigned int len, data_len; __u16 mac_len, @@ -303,6 +476,17 @@ nf_trace:1; __be16 protocol; +#ifdef CONFIG_AVM_PA + union { + struct avm_pa_pkt_info pktinfo; + __u8 buf[256]; + } avm_pa; +#define AVM_PKT_INFO(skb) (&(skb)->avm_pa.pktinfo) +#endif +#ifdef CONFIG_GENERIC_CONNTRACK + struct generic_ct *generic_ct; +#endif + void (*destructor)(struct sk_buff *skb); #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack *nfct; @@ -335,6 +519,36 @@ __u32 secmark; #endif +#ifdef CONFIG_TI_META_DATA + unsigned int ti_meta_info; + unsigned int ti_meta_info2; +#endif /* CONFIG_TI_META_DATA */ + +#ifdef CONFIG_TI_DOCSIS_INPUT_DEV + struct net_device *ti_docsis_input_dev; +#endif /* CONFIG_TI_DOCSIS_INPUT_DEV */ + +#ifdef CONFIG_TI_L2_SELECTIVE_FORWARDER + unsigned int ti_selective_fwd_dev_info; +#endif /* CONFIG_TI_L2_SELECTIVE_FORWARDER */ + +#ifdef CONFIG_TI_PACKET_PROCESSOR + TI_PP_PACKET_INFO pp_packet_info; +#endif /* CONFIG_TI_PACKET_PROCESSOR */ + +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + void *last_user; +#endif + + void *destructor_info; + /*------------------------------------------------------------------------------------------*\ + * uniq_id: * + * Attention! This field does not exist in the 2.6.28 kernel anymore. We just use it to * + * pass port and queue information between avm_cpmac and multid/dsld in the upper eight * + * bits. * + \*------------------------------------------------------------------------------------------*/ + unsigned long uniq_id; + __u32 mark; __u16 vlan_tci; @@ -367,6 +581,15 @@ enum dma_data_direction dir); #endif +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK +static inline void skb_track_caller(struct sk_buff *skb) +{ + skb->last_user = __builtin_return_address(0); +} +#else +#define skb_track_caller(skb) do { } while (0) +#endif + extern void kfree_skb(struct sk_buff *skb); extern void __kfree_skb(struct sk_buff *skb); extern struct sk_buff *__alloc_skb(unsigned int size, @@ -732,6 +955,7 @@ struct sk_buff *prev, struct sk_buff *next, struct sk_buff_head *list) { + skb_track_caller(newsk); newsk->next = next; newsk->prev = prev; next->prev = prev->next = newsk; @@ -886,6 +1110,7 @@ { struct sk_buff *next, *prev; + skb_track_caller(skb); list->qlen--; next = skb->next; prev = skb->prev; @@ -1086,6 +1311,7 @@ */ static inline void skb_reserve(struct sk_buff *skb, int len) { + skb_track_caller(skb); skb->data += len; skb->tail += len; } @@ -1254,7 +1480,11 @@ * headroom, you should not reduce this. */ #ifndef NET_SKB_PAD +#if defined (CONFIG_AR9) || defined (CONFIG_AMAZON_S) || defined (CONFIG_VR9) +#define NET_SKB_PAD 64 +#else /*--- #if defined (CONFIG_AR9) || defined (CONFIG_AMAZON_S) || defined (CONFIG_VR9) ---*/ #define NET_SKB_PAD 16 +#endif /*--- #else ---*/ /*--- #if defined (CONFIG_AR9) || defined (CONFIG_AMAZON_S) || defined (CONFIG_VR9) ---*/ #endif extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); @@ -1309,6 +1539,7 @@ */ static inline void skb_orphan(struct sk_buff *skb) { + skb_track_caller(skb); if (skb->destructor) skb->destructor(skb); skb->destructor = NULL; @@ -1353,6 +1584,7 @@ } extern struct sk_buff *dev_alloc_skb(unsigned int length); +extern struct sk_buff *dev_alloc_skb_nowarn(unsigned int length); extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, gfp_t gfp_mask); @@ -1391,7 +1623,7 @@ return __netdev_alloc_page(dev, GFP_ATOMIC); } -static inline void netdev_free_page(struct net_device *dev, struct page *page) +static inline void netdev_free_page(struct net_device *dev __attribute__ ((unused)), struct page *page) { __free_page(page); } @@ -1503,8 +1735,8 @@ if (i) { struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; - return page == frag->page && - off == frag->page_offset + frag->size; + return (page == frag->page) && + (off == (int)(frag->page_offset + frag->size)); } return 0; } @@ -1703,6 +1935,7 @@ static inline void __net_timestamp(struct sk_buff *skb) { skb->tstamp = ktime_get_real(); + skb_track_caller(skb); } static inline ktime_t net_timedelta(ktime_t t) @@ -1745,6 +1978,18 @@ 0 : __skb_checksum_complete(skb); } +#ifdef CONFIG_GENERIC_CONNTRACK +static inline enum generic_ct_dir skb_get_ct_dir(struct sk_buff *skb) +{ + return skb->nfctinfo ? GENERIC_CT_DIR_REPLY : GENERIC_CT_DIR_ORIGINAL; +} + +static inline void skb_set_ct_dir(struct sk_buff *skb, enum generic_ct_dir dir) +{ + skb->nfctinfo = (dir & 1); +} +#endif + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) extern void nf_conntrack_destroy(struct nf_conntrack *nfct); static inline void nf_conntrack_put(struct nf_conntrack *nfct) @@ -1780,8 +2025,12 @@ atomic_inc(&nf_bridge->use); } #endif /* CONFIG_BRIDGE_NETFILTER */ -static inline void nf_reset(struct sk_buff *skb) +static inline void nf_reset(struct sk_buff *skb __attribute__ ((unused))) { +#ifdef CONFIG_GENERIC_CONNTRACK + generic_ct_put(skb->generic_ct); + skb->generic_ct = 0; +#endif #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(skb->nfct); skb->nfct = NULL; @@ -1795,8 +2044,13 @@ } /* Note: This doesn't put any conntrack and bridge info in dst. */ -static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) +static inline void __nf_copy(struct sk_buff *dst __attribute__ ((unused)), + const struct sk_buff *src __attribute__ ((unused))) { +#ifdef CONFIG_GENERIC_CONNTRACK + dst->generic_ct = generic_ct_get(src->generic_ct); + dst->nfctinfo = src->nfctinfo; +#endif #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) dst->nfct = src->nfct; nf_conntrack_get(src->nfct); @@ -1812,6 +2066,9 @@ static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) { +#ifdef CONFIG_GENERIC_CONNTRACK + generic_ct_put(dst->generic_ct); +#endif #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(dst->nfct); nf_conntrack_put_reasm(dst->nfct_reasm); @@ -1833,10 +2090,10 @@ skb->secmark = 0; } #else -static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from) +static inline void skb_copy_secmark(struct sk_buff *to __attribute__ ((unused)), const struct sk_buff *from __attribute__ ((unused))) { } -static inline void skb_init_secmark(struct sk_buff *skb) +static inline void skb_init_secmark(struct sk_buff *skb __attribute__ ((unused))) { } #endif @@ -1887,5 +2144,19 @@ } bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); + +extern atomic_t skbs_in_use; + +extern int get_skbs_in_use(void); + +#ifdef CONFIG_AVM_PA +static inline void avm_pa_add_local_session(PKT *pkt, struct sock *sk) +{ + struct avm_pa_pkt_info *info = AVM_PKT_INFO(pkt); + if (info->ptype_pid_handle && info->is_accelerated == 0) + _avm_pa_add_local_session(pkt, sk); +} +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */