diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index d015aa190fdc..e203a5fdf874 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -5213,27 +5213,6 @@ static inline int l2cap_move_channel_confirm_rsp(struct l2cap_conn *conn, | |||
5213 | return 0; | 5213 | return 0; |
5214 | } | 5214 | } |
5215 | 5215 | ||
5216 | static inline int l2cap_check_conn_param(u16 min, u16 max, u16 latency, | ||
5217 | u16 to_multiplier) | ||
5218 | { | ||
5219 | u16 max_latency; | ||
5220 | |||
5221 | if (min > max || min < 6 || max > 3200) | ||
5222 | return -EINVAL; | ||
5223 | |||
5224 | if (to_multiplier < 10 || to_multiplier > 3200) | ||
5225 | return -EINVAL; | ||
5226 | |||
5227 | if (max >= to_multiplier * 8) | ||
5228 | return -EINVAL; | ||
5229 | |||
5230 | max_latency = (to_multiplier * 8 / max) - 1; | ||
5231 | if (latency > 499 || latency > max_latency) | ||
5232 | return -EINVAL; | ||
5233 | |||
5234 | return 0; | ||
5235 | } | ||
5236 | |||
5237 | static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, | 5216 | static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, |
5238 | struct l2cap_cmd_hdr *cmd, | 5217 | struct l2cap_cmd_hdr *cmd, |
5239 | u16 cmd_len, u8 *data) | 5218 | u16 cmd_len, u8 *data) |
@@ -5261,7 +5240,7 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, | |||
5261 | 5240 | ||
5262 | memset(&rsp, 0, sizeof(rsp)); | 5241 | memset(&rsp, 0, sizeof(rsp)); |
5263 | 5242 | ||
5264 | err = l2cap_check_conn_param(min, max, latency, to_multiplier); | 5243 | err = hci_check_conn_params(min, max, latency, to_multiplier); |
5265 | if (err) | 5244 | if (err) |
5266 | rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); | 5245 | rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); |
5267 | else | 5246 | else |