diff options
author | Varun Prakash <varun@chelsio.com> | 2016-09-13 15:54:04 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-16 00:49:20 (GMT) |
commit | a7e1a97f88058ed9b6aa054b38167fbe62f59f50 (patch) | |
tree | 7a26bf44457dd8d6aa575f17df4b87f95786aee5 /drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h | |
parent | 29fb6f42e7282322672eff8b4ad85918b9dcbae3 (diff) | |
download | linux-a7e1a97f88058ed9b6aa054b38167fbe62f59f50.tar.xz |
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_abort_req()
Add cxgb_mk_abort_req() to remove duplicate code
to form CPL_ABORT_REQ 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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h index e77661d..2d3a3bf 100644 --- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h +++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h @@ -112,4 +112,20 @@ cxgb_mk_close_con_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan, set_wr_txq(skb, CPL_PRIORITY_DATA, chan); t4_set_arp_err_handler(skb, handle, handler); } + +static inline void +cxgb_mk_abort_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan, + void *handle, arp_err_handler_t handler) +{ + struct cpl_abort_req *req; + + req = (struct cpl_abort_req *)__skb_put(skb, len); + memset(req, 0, len); + + INIT_TP_WR(req, tid); + OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_ABORT_REQ, tid)); + req->cmd = CPL_ABORT_SEND_RST; + set_wr_txq(skb, CPL_PRIORITY_DATA, chan); + t4_set_arp_err_handler(skb, handle, handler); +} #endif |