--- zzzz-none-000/linux-2.6.28.10/include/linux/skbuff.h 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/include/linux/skbuff.h 2015-12-03 15:05:45.000000000 +0000 @@ -14,6 +14,7 @@ #ifndef _LINUX_SKBUFF_H #define _LINUX_SKBUFF_H +#include #include #include #include @@ -22,13 +23,23 @@ #include #include #include -#include +#include #include #include #include #include #include +#if defined(CONFIG_FUSIV_KERNEL_APSTATISTICS_PER_INTERFACE) +#include +#endif +#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 +108,194 @@ 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_done; /* used to indicate whether ipqos mapping/marking done for the packet */ + 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]; +#if defined(CONFIG_FUSIV_KERNEL_APSTATISTICS_PER_INTERFACE) + struct ap2ap_fastpath_apStatistics_ct apPrevStatistics[3]; +#endif +}; + +struct apFlowInfo { + unsigned char rxApId; + unsigned char txApId; + + struct net_device *rxDev; + struct net_device *txDev; + + struct nf_conntrack *nfct; +#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) || defined(CONFIG_IPV6_TUNNEL) || defined(CONFIG_IPV6_TUNNEL_MODULE) +#ifdef CONFIG_FUSIV_VX185 + + struct nf_conntrack *org_nfct; //connection track information of Original packet IPv4/IPV6 + __u8 org_nfctinfo:3, + encap_protocol:4; // =1 if packet is to be encapsulated, else =0 +#define PROCESS_PLAIN 0 +#define PROCESS_ENCAP 1 +#define PROCESS_DECAP 2 +#define PROCESS_ESP_ENCAP 3 +#define PROCESS_ESP_DECAP 4 +#define PROCESS_ESP_PASSTHRU 5 +#define PROCESS_ESP_NAT_T 6 +#define PROCESS_ESP_SLOW_PATH 7 +#define PROCESS_L2TP_ENCAP 8 +#define PROCESS_L2TP_DECAP 9 +#define PROCESS_L2TP_SLOW_PATH 10 +#define ESP_TUNNEL_HEADER_SIZE (20+4+4+1+1+12) // IPv4 header+ SPI + SeqNo + padlength + nexthdr + ICV +#define AP_FLAG1_IS_IPSEC_DECRYPTED_BIT 7 // bit set in info flag, when ESP packet is decrypted by SecAP +#else + struct nf_conntrack *pretunnel_nfct; + int *pretunnel_dir; +#endif +#endif + + unsigned short hash; + + unsigned short flags1; + unsigned short flags2; +#ifdef VX185_BONDING + unsigned short localVlan; //when it originaed from local and from VLAN interface, then we store the VLAN number here for distr ibuting traffic. +#endif + + // 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; + +/* Following macros represent bits of the control flag */ +#define CONTROL_FLOW 0x1 // Represents the control connection. +#define ESTABLISHED_FLOW 0x2 // Represents the established connection. +#define VLAN_FLOW 0x4 // Represents the VLAN flow. +#define AP2APROUTE_FLOW 0x8 // Represents the Route flow + // (to add into Route FlowTable). +#define AP2APBRIDGE_FLOW 0x10 // Represents the bridge flow. +//#define DIFFSERV_MARK 0x20 // Represents that the flow is marked with diffserv code point. +#define TCP_ACK_PACKET 0x20 +#define AP2AP_MCAST_ROUTE_FLOW 0x40 // Represents multicast route flow +#define IPQOS_HOQ_PACKET 0x80 + + 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 srcwlanFlags; + unsigned char dstwlanFlags; + unsigned char secHdrLen; + unsigned char srcsecHdrLen; + unsigned char dstsecHdrLen; + void *secKey; +#endif + +#if defined(CONFIG_NF_CT_PROTO_ESP) || defined(CONFIG_NF_CT_PROTO_ESP_MODULE) + unsigned int spi; +#endif +#ifdef CONFIG_IPSEC_AP_SUPPORT + unsigned int enc_tx_spi; + unsigned int enc_rx_spi; + unsigned int tx_seqNo; + unsigned int rx_seqNo; + unsigned char authAlg; + unsigned int authKeyLen; + unsigned char authKey[32]; + unsigned int encKeyLen; + unsigned char encAlg; + unsigned char encKey[32]; + unsigned int saddr; + unsigned int daddr; + void *pSA; +#ifndef ETH_ALEN +#define ETH_ALEN 6 +#endif + unsigned char srcMAC[ETH_ALEN]; + unsigned char dstMAC[ETH_ALEN]; +#endif +#ifdef CONFIG_L2TP_AP_SUPPORT + void *pApOps; +#endif + unsigned int mcastSPDPkt; //flag to identify multicast slowpath pkt +}; +#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 +352,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 +492,7 @@ struct sock *sk; ktime_t tstamp; struct net_device *dev; + struct net_device *input_dev; union { struct dst_entry *dst; @@ -279,6 +508,22 @@ */ 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) + /* Specific to FUSIV, used to map AP cluster to SK BUF and Vice + versa. */ + unsigned char* apAllocAddr; +#endif + unsigned int len, data_len; __u16 mac_len, @@ -303,6 +548,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 +591,37 @@ __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. * + \*------------------------------------------------------------------------------------------*/ +#define AVM_HAVE_SKB_UNIQ_ID + unsigned long uniq_id; + __u32 mark; __u16 vlan_tci; @@ -367,6 +654,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 +1028,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 +1183,7 @@ { struct sk_buff *next, *prev; + skb_track_caller(skb); list->qlen--; next = skb->next; prev = skb->prev; @@ -1086,6 +1384,7 @@ */ static inline void skb_reserve(struct sk_buff *skb, int len) { + skb_track_caller(skb); skb->data += len; skb->tail += len; } @@ -1254,7 +1553,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 +1612,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 +1657,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 +1696,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 +1808,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 +2008,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 +2051,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 +2098,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 +2117,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 +2139,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 +2163,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 +2217,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 */