From fc3261c1e7c734758113ef9fe7bf5a5ab7f569df Mon Sep 17 00:00:00 2001 From: Pan Jiafei Date: Wed, 21 Jan 2015 10:29:15 +0800 Subject: capwap: set pool buffer size in PreHeader Signed-off-by: Pan Jiafei Change-Id: I52411e0d3cef00e5d8a3c7a45ec4fd9ac5907686 Reviewed-on: http://git.am.freescale.net:8181/33326 Tested-by: Review Code-CDREVIEW Reviewed-by: Horia Ioan Geanta Neag Reviewed-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.c b/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.c index f7b1806..dbf7a21 100644 --- a/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.c +++ b/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.c @@ -430,7 +430,7 @@ int dpaa_capwap_domain_init(struct dpaa_capwap_domain *capwap_domain) } capwap_domain->net_dev = net_dev; - capwap_domain->bpid = get_capwap_bpid(net_dev); + get_capwap_bp(net_dev, capwap_domain); err = op_init(&capwap_domain->post_dec_op_port, net_dev); if (err) { @@ -613,6 +613,8 @@ int add_in_tunnel(struct dpaa_capwap_domain *capwap_domain, preheader_initdesc->prehdr.lo.field.pool_id = capwap_domain->bpid; + preheader_initdesc->prehdr.lo.field.pool_buffer_size = + capwap_domain->bp_size; preheader_initdesc->prehdr.lo.field.offset = 1; preheader_initdesc->prehdr.hi.field.idlen = desc_len; @@ -1014,6 +1016,8 @@ int add_out_tunnel(struct dpaa_capwap_domain *capwap_domain, preheader_initdesc->prehdr.lo.field.pool_id = capwap_domain->bpid; + preheader_initdesc->prehdr.lo.field.pool_buffer_size = + capwap_domain->bp_size; /* 64bytes offset in output fd*/ preheader_initdesc->prehdr.lo.field.offset = 2; preheader_initdesc->prehdr.hi.field.idlen = desc_len; diff --git a/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.h b/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.h index 8fd8122..9616706 100644 --- a/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.h +++ b/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_domain.h @@ -131,6 +131,7 @@ struct dpaa_capwap_domain { struct dpaa_capwap_domain_fqs *fqs; struct net_device *net_dev; /* Device for CAPWAP Ethernet */ uint8_t bpid; + size_t bp_size; }; static inline struct dpaa_capwap_tunnel *dequeue_tunnel_obj( @@ -167,7 +168,8 @@ struct dpaa_capwap_domain_fqs *get_domain_fqs(void); int op_init(struct t_Port *port, struct net_device *net_dev); int capwap_fq_pre_init(struct dpaa_capwap_domain *capwap_domain); int capwap_tunnel_drv_init(struct dpaa_capwap_domain *domain); -uint8_t get_capwap_bpid(struct net_device *net_dev); +void get_capwap_bp(struct net_device *net_dev, + struct dpaa_capwap_domain *capwap_domain); int capwap_br_init(struct dpaa_capwap_domain *domain); uint16_t get_flow_index(bool is_dtls, bool is_control_tunnel); int capwap_kernel_rx_ctl(struct capwap_domain_kernel_rx_ctl *rx_ctl); diff --git a/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_op.c b/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_op.c index 18f95fd..e3cd135 100644 --- a/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_op.c +++ b/drivers/net/ethernet/freescale/dpa/capwap/dpaa_capwap_op.c @@ -41,12 +41,14 @@ #include "dpaa_capwap_fq.h" #include "dpaa_capwap_domain.h" -uint8_t get_capwap_bpid(struct net_device *net_dev) +void get_capwap_bp(struct net_device *net_dev, + struct dpaa_capwap_domain *capwap_domain) { struct dpa_priv_s *priv; priv = netdev_priv(net_dev); - return priv->dpa_bp->bpid; + capwap_domain->bpid = priv->dpa_bp->bpid; + capwap_domain->bp_size = priv->dpa_bp->size; } int op_init(struct t_Port *port, struct net_device *net_dev) -- cgit v0.10.2