diff options
-rw-r--r-- | net/bluetooth/hci_conn.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 445829cd363c..06047142797c 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -36,24 +36,25 @@ | |||
36 | struct sco_param { | 36 | struct sco_param { |
37 | u16 pkt_type; | 37 | u16 pkt_type; |
38 | u16 max_latency; | 38 | u16 max_latency; |
39 | u8 retrans_effort; | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | static const struct sco_param esco_param_cvsd[] = { | 42 | static const struct sco_param esco_param_cvsd[] = { |
42 | { EDR_ESCO_MASK & ~ESCO_2EV3, 0x000a }, /* S3 */ | 43 | { EDR_ESCO_MASK & ~ESCO_2EV3, 0x000a, 0x01 }, /* S3 */ |
43 | { EDR_ESCO_MASK & ~ESCO_2EV3, 0x0007 }, /* S2 */ | 44 | { EDR_ESCO_MASK & ~ESCO_2EV3, 0x0007, 0x01 }, /* S2 */ |
44 | { EDR_ESCO_MASK | ESCO_EV3, 0x0007 }, /* S1 */ | 45 | { EDR_ESCO_MASK | ESCO_EV3, 0x0007, 0x01 }, /* S1 */ |
45 | { EDR_ESCO_MASK | ESCO_HV3, 0xffff }, /* D1 */ | 46 | { EDR_ESCO_MASK | ESCO_HV3, 0xffff, 0x01 }, /* D1 */ |
46 | { EDR_ESCO_MASK | ESCO_HV1, 0xffff }, /* D0 */ | 47 | { EDR_ESCO_MASK | ESCO_HV1, 0xffff, 0x01 }, /* D0 */ |
47 | }; | 48 | }; |
48 | 49 | ||
49 | static const struct sco_param sco_param_cvsd[] = { | 50 | static const struct sco_param sco_param_cvsd[] = { |
50 | { EDR_ESCO_MASK | ESCO_HV3, 0xffff }, /* D1 */ | 51 | { EDR_ESCO_MASK | ESCO_HV3, 0xffff, 0xff }, /* D1 */ |
51 | { EDR_ESCO_MASK | ESCO_HV1, 0xffff }, /* D0 */ | 52 | { EDR_ESCO_MASK | ESCO_HV1, 0xffff, 0xff }, /* D0 */ |
52 | }; | 53 | }; |
53 | 54 | ||
54 | static const struct sco_param sco_param_wideband[] = { | 55 | static const struct sco_param sco_param_wideband[] = { |
55 | { EDR_ESCO_MASK & ~ESCO_2EV3, 0x000d }, /* T2 */ | 56 | { EDR_ESCO_MASK & ~ESCO_2EV3, 0x000d, 0x02 }, /* T2 */ |
56 | { EDR_ESCO_MASK | ESCO_EV3, 0x0008 }, /* T1 */ | 57 | { EDR_ESCO_MASK | ESCO_EV3, 0x0008, 0x02 }, /* T1 */ |
57 | }; | 58 | }; |
58 | 59 | ||
59 | static void hci_le_create_connection_cancel(struct hci_conn *conn) | 60 | static void hci_le_create_connection_cancel(struct hci_conn *conn) |
@@ -208,19 +209,16 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle) | |||
208 | case SCO_AIRMODE_TRANSP: | 209 | case SCO_AIRMODE_TRANSP: |
209 | if (conn->attempt > ARRAY_SIZE(sco_param_wideband)) | 210 | if (conn->attempt > ARRAY_SIZE(sco_param_wideband)) |
210 | return false; | 211 | return false; |
211 | cp.retrans_effort = 0x02; | ||
212 | param = &sco_param_wideband[conn->attempt - 1]; | 212 | param = &sco_param_wideband[conn->attempt - 1]; |
213 | break; | 213 | break; |
214 | case SCO_AIRMODE_CVSD: | 214 | case SCO_AIRMODE_CVSD: |
215 | if (lmp_esco_capable(conn->link)) { | 215 | if (lmp_esco_capable(conn->link)) { |
216 | if (conn->attempt > ARRAY_SIZE(esco_param_cvsd)) | 216 | if (conn->attempt > ARRAY_SIZE(esco_param_cvsd)) |
217 | return false; | 217 | return false; |
218 | cp.retrans_effort = 0x01; | ||
219 | param = &esco_param_cvsd[conn->attempt - 1]; | 218 | param = &esco_param_cvsd[conn->attempt - 1]; |
220 | } else { | 219 | } else { |
221 | if (conn->attempt > ARRAY_SIZE(sco_param_cvsd)) | 220 | if (conn->attempt > ARRAY_SIZE(sco_param_cvsd)) |
222 | return false; | 221 | return false; |
223 | cp.retrans_effort = 0xff; | ||
224 | param = &sco_param_cvsd[conn->attempt - 1]; | 222 | param = &sco_param_cvsd[conn->attempt - 1]; |
225 | } | 223 | } |
226 | break; | 224 | break; |
@@ -228,6 +226,7 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle) | |||
228 | return false; | 226 | return false; |
229 | } | 227 | } |
230 | 228 | ||
229 | cp.retrans_effort = param->retrans_effort; | ||
231 | cp.pkt_type = __cpu_to_le16(param->pkt_type); | 230 | cp.pkt_type = __cpu_to_le16(param->pkt_type); |
232 | cp.max_latency = __cpu_to_le16(param->max_latency); | 231 | cp.max_latency = __cpu_to_le16(param->max_latency); |
233 | 232 | ||