mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 03:04:01 +08:00
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>
This commit is contained in:
parent
cc516700c7
commit
a1a234542b
@ -240,15 +240,13 @@ int c4iw_ofld_send(struct c4iw_rdev *rdev, struct sk_buff *skb)
|
|||||||
|
|
||||||
static void release_tid(struct c4iw_rdev *rdev, u32 hwtid, struct sk_buff *skb)
|
static void release_tid(struct c4iw_rdev *rdev, u32 hwtid, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct cpl_tid_release *req;
|
u32 len = roundup(sizeof(struct cpl_tid_release), 16);
|
||||||
|
|
||||||
skb = get_skb(skb, sizeof *req, GFP_KERNEL);
|
skb = get_skb(skb, len, GFP_KERNEL);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return;
|
return;
|
||||||
req = (struct cpl_tid_release *) skb_put(skb, sizeof(*req));
|
|
||||||
INIT_TP_WR(req, hwtid);
|
cxgb_mk_tid_release(skb, len, hwtid, 0);
|
||||||
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid));
|
|
||||||
set_wr_txq(skb, CPL_PRIORITY_SETUP, 0);
|
|
||||||
c4iw_ofld_send(rdev, skb);
|
c4iw_ofld_send(rdev, skb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -83,4 +83,17 @@ static inline u32 cxgb_compute_wscale(u32 win)
|
|||||||
wscale++;
|
wscale++;
|
||||||
return 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
|
#endif
|
||||||
|
@ -961,21 +961,14 @@ int cxgbit_ofld_send(struct cxgbit_device *cdev, struct sk_buff *skb)
|
|||||||
|
|
||||||
static void cxgbit_release_tid(struct cxgbit_device *cdev, u32 tid)
|
static void cxgbit_release_tid(struct cxgbit_device *cdev, u32 tid)
|
||||||
{
|
{
|
||||||
struct cpl_tid_release *req;
|
u32 len = roundup(sizeof(struct cpl_tid_release), 16);
|
||||||
unsigned int len = roundup(sizeof(*req), 16);
|
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
skb = alloc_skb(len, GFP_ATOMIC);
|
skb = alloc_skb(len, GFP_ATOMIC);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
req = (struct cpl_tid_release *)__skb_put(skb, len);
|
cxgb_mk_tid_release(skb, len, tid, 0);
|
||||||
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, 0);
|
|
||||||
cxgbit_ofld_send(cdev, skb);
|
cxgbit_ofld_send(cdev, skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user