diff options
author | Varun Prakash <varun@chelsio.com> | 2016-09-13 15:54:06 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-16 00:49:20 (GMT) |
commit | 6e3b6fc201fe16d3944e2b293e7f47a72f4a56c1 (patch) | |
tree | d95302cbabb87e60d4cb455f26e50e4cf247bbbc /drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h | |
parent | 052f4731ed1fd6b132a14c56f49435377a246834 (diff) | |
download | linux-6e3b6fc201fe16d3944e2b293e7f47a72f4a56c1.tar.xz |
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.h | 15 |
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 70999e8..515b94f 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 |