summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/chelsio
diff options
context:
space:
mode:
authorVarun Prakash <varun@chelsio.com>2016-09-13 21:24:02 +0530
committerDavid S. Miller <davem@davemloft.net>2016-09-15 20:49:20 -0400
commita1a234542b7817c28770ad4e80be1bf69e6a4f86 (patch)
tree98ceeb893034c8504f40aa0ed91f32c330aeec48 /drivers/net/ethernet/chelsio
parentcc516700c7edab4197d08998ac023c3043369391 (diff)
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_tid_release()
Add cxgb_mk_tid_release() to remove duplicate code to form CPL_TID_RELEASE 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')
-rw-r--r--drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
index ecf3baa940b9..fbb973e9ec29 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
+++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
@@ -83,4 +83,17 @@ static inline u32 cxgb_compute_wscale(u32 win)
wscale++;
return wscale;
}
+
+static inline void
+cxgb_mk_tid_release(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
+{
+ struct cpl_tid_release *req;
+
+ req = (struct cpl_tid_release *)__skb_put(skb, len);
+ memset(req, 0, len);
+
+ INIT_TP_WR(req, tid);
+ OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_TID_RELEASE, tid));
+ set_wr_txq(skb, CPL_PRIORITY_SETUP, chan);
+}
#endif