libcxgb,iw_cxgb4,cxgbit: add cxgb_compute_wscale()
Add cxgb_compute_wscale() in libcxgb_cm.h to remove it's duplicate definitions from cxgb4/cm.c and cxgbit/cxgbit_cm.c. Signed-off-by: Varun Prakash <varun@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
44c6d06992
commit
cc516700c7
@@ -74,4 +74,13 @@ cxgb_best_mtu(const unsigned short *mtus, unsigned short mtu,
|
||||
|
||||
cxgb4_best_aligned_mtu(mtus, hdr_size, data_size, 8, idx);
|
||||
}
|
||||
|
||||
static inline u32 cxgb_compute_wscale(u32 win)
|
||||
{
|
||||
u32 wscale = 0;
|
||||
|
||||
while (wscale < 14 && (65535 << wscale) < win)
|
||||
wscale++;
|
||||
return wscale;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user