summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/libcxgb
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2016-09-13 17:54:03 +0200
committerDavid S. Miller <davem@davemloft.net>2016-09-16 02:49:20 +0200
commit29fb6f42e7282322672eff8b4ad85918b9dcbae3 (patch)
treec745228ae738982d22029a921c6bbeffe374eec9 /drivers/net/ethernet/chelsio/libcxgb
parentlibcxgb,iw_cxgb4,cxgbit: add cxgb_mk_tid_release() (diff)
downloadlinux-29fb6f42e7282322672eff8b4ad85918b9dcbae3.tar.xz
linux-29fb6f42e7282322672eff8b4ad85918b9dcbae3.zip
libcxgb, iw_cxgb4, cxgbit: add cxgb_mk_close_con_req()
Add cxgb_mk_close_con_req() to remove duplicate code to form CPL_CLOSE_CON_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')
-rw-r--r--drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h16
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 fbb973e9ec29..e77661d98738 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
+++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
@@ -38,6 +38,7 @@
#include <cxgb4.h>
#include <t4_msg.h>
+#include <l2t.h>
void
cxgb_get_4tuple(struct cpl_pass_accept_req *, enum chip_type,
@@ -96,4 +97,19 @@ cxgb_mk_tid_release(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_TID_RELEASE, tid));
set_wr_txq(skb, CPL_PRIORITY_SETUP, chan);
}
+
+static inline void
+cxgb_mk_close_con_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
+ void *handle, arp_err_handler_t handler)
+{
+ struct cpl_close_con_req *req;
+
+ req = (struct cpl_close_con_req *)__skb_put(skb, len);
+ memset(req, 0, len);
+
+ INIT_TP_WR(req, tid);
+ OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, tid));
+ set_wr_txq(skb, CPL_PRIORITY_DATA, chan);
+ t4_set_arp_err_handler(skb, handle, handler);
+}
#endif