diff options
| author | Varun Prakash <varun@chelsio.com> | 2016-09-13 11:54:01 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-09-15 20:49:20 -0400 |
| commit | cc516700c7edab4197d08998ac023c3043369391 (patch) | |
| tree | 7066c61e5639f393e5edf15e36d1c8712d78c1ea /drivers/target | |
| parent | 44c6d06992ac663e5163bdbe00844cb845ed5703 (diff) | |
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>
Diffstat (limited to 'drivers/target')
| -rw-r--r-- | drivers/target/iscsi/cxgbit/cxgbit_cm.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index b09c09ba9659..cd29c91d01fc 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c | |||
| @@ -1085,15 +1085,6 @@ out: | |||
| 1085 | return -ENOMEM; | 1085 | return -ENOMEM; |
| 1086 | } | 1086 | } |
| 1087 | 1087 | ||
| 1088 | static u32 cxgbit_compute_wscale(u32 win) | ||
| 1089 | { | ||
| 1090 | u32 wscale = 0; | ||
| 1091 | |||
| 1092 | while (wscale < 14 && (65535 << wscale) < win) | ||
| 1093 | wscale++; | ||
| 1094 | return wscale; | ||
| 1095 | } | ||
| 1096 | |||
| 1097 | static void | 1088 | static void |
| 1098 | cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req) | 1089 | cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req) |
| 1099 | { | 1090 | { |
| @@ -1124,7 +1115,7 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req) | |||
| 1124 | cxgb_best_mtu(csk->com.cdev->lldi.mtus, csk->mtu, &mtu_idx, | 1115 | cxgb_best_mtu(csk->com.cdev->lldi.mtus, csk->mtu, &mtu_idx, |
| 1125 | req->tcpopt.tstamp, | 1116 | req->tcpopt.tstamp, |
| 1126 | (csk->com.remote_addr.ss_family == AF_INET) ? 0 : 1); | 1117 | (csk->com.remote_addr.ss_family == AF_INET) ? 0 : 1); |
| 1127 | wscale = cxgbit_compute_wscale(csk->rcv_win); | 1118 | wscale = cxgb_compute_wscale(csk->rcv_win); |
| 1128 | /* | 1119 | /* |
| 1129 | * Specify the largest window that will fit in opt0. The | 1120 | * Specify the largest window that will fit in opt0. The |
| 1130 | * remainder will be specified in the rx_data_ack. | 1121 | * remainder will be specified in the rx_data_ack. |
