aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2016-09-13 21:24:06 +0530
committerDavid S. Miller <davem@davemloft.net>2016-09-15 20:49:20 -0400
commit6e3b6fc201fe16d3944e2b293e7f47a72f4a56c1 (patch)
treed95302cbabb87e60d4cb455f26e50e4cf247bbbc /drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
parentlibcxgb,iw_cxgb4,cxgbit: add cxgb_mk_abort_rpl() (diff)
downloadlinux-dev-6e3b6fc201fe16d3944e2b293e7f47a72f4a56c1.tar.xz
linux-dev-6e3b6fc201fe16d3944e2b293e7f47a72f4a56c1.zip
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_rx_data_ack()
Add cxgb_mk_rx_data_ack() to remove duplicate code to form CPL_RX_DATA_ACK hardware command. Signed-off-by: Varun Prakash <varun@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h')
-rw-r--r--drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
index 70999e8cf4b7..515b94ff9080 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
+++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
@@ -142,4 +142,19 @@ cxgb_mk_abort_rpl(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
rpl->cmd = CPL_ABORT_NO_RST;
set_wr_txq(skb, CPL_PRIORITY_DATA, chan);
}
+
+static inline void
+cxgb_mk_rx_data_ack(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
+ u32 credit_dack)
+{
+ struct cpl_rx_data_ack *req;
+
+ req = (struct cpl_rx_data_ack *)__skb_put(skb, len);
+ memset(req, 0, len);
+
+ INIT_TP_WR(req, tid);
+ OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_RX_DATA_ACK, tid));
+ req->credit_dack = cpu_to_be32(credit_dack);
+ set_wr_txq(skb, CPL_PRIORITY_ACK, chan);
+}
#endif