OSDN Git Service

android-x86/system-bt.git
3 years agoSimplify bnep_sec_check_complete am: 86fbde4a5e
Hansong Zhang [Mon, 28 Sep 2020 20:53:44 +0000 (20:53 +0000)]
Simplify bnep_sec_check_complete am: 86fbde4a5e

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439086

Change-Id: Idb4a0b924b656e23556d6161da055fe6a8de2398

3 years agol2c_csm: Use pL2CA_Error_Cb on error am: 30a07c56e1
Hansong Zhang [Mon, 28 Sep 2020 19:03:43 +0000 (19:03 +0000)]
l2c_csm: Use pL2CA_Error_Cb on error am: 30a07c56e1

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439085

Change-Id: I5d53012f81c0ee4358948654418600b897f1f34b

3 years agoRegard L2CAP_CFG_PENDING as failure am: 5b85860bd5
Hansong Zhang [Mon, 28 Sep 2020 19:02:50 +0000 (19:02 +0000)]
Regard L2CAP_CFG_PENDING as failure am: 5b85860bd5

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439084

Change-Id: I9d42ccf85dc915acb2561a63d2718bbb1d5c08bf

3 years agoIntroduce pL2CA_Error_Cb am: b6e5a07555
Hansong Zhang [Mon, 28 Sep 2020 16:48:11 +0000 (16:48 +0000)]
Introduce pL2CA_Error_Cb am: b6e5a07555

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439083

Change-Id: I4af7949c994761ee6b3a7b6c2808a8077fafdfc7

3 years agol2c_csm: Remove unused variable am: 5020f1c00f
Hansong Zhang [Mon, 28 Sep 2020 16:47:19 +0000 (16:47 +0000)]
l2c_csm: Remove unused variable am: 5020f1c00f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439082

Change-Id: I7a4ad9d2b31de4811798dcbb206702be137de7b2

3 years agoSimplify bnep_sec_check_complete
Hansong Zhang [Sun, 27 Sep 2020 00:42:02 +0000 (17:42 -0700)]
Simplify bnep_sec_check_complete

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ifc0edea758f4d1e0847f5b00fc49b51b4ad00344

3 years agol2c_csm: Use pL2CA_Error_Cb on error
Hansong Zhang [Sat, 26 Sep 2020 23:58:47 +0000 (16:58 -0700)]
l2c_csm: Use pL2CA_Error_Cb on error

Note that we only have two result codes, because the user only needs to
know whether it's during ConnectRsp or ConfigRsp (except for HIDH
retry), which we need further research.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I24aa7bf8487c9b2b69fc455cfdb52a7ec758b90b

3 years agoRegard L2CAP_CFG_PENDING as failure
Hansong Zhang [Sat, 26 Sep 2020 23:48:40 +0000 (16:48 -0700)]
Regard L2CAP_CFG_PENDING as failure

Since all L2CAP users disconnect if the status is not OK.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I112400c2081be12d038426c1e8ea82229d5b9f4a

3 years agoIntroduce pL2CA_Error_Cb
Hansong Zhang [Sat, 26 Sep 2020 23:39:28 +0000 (16:39 -0700)]
Introduce pL2CA_Error_Cb

L2CAP notifies users error in ConnectRsp and ConfigRsp through this
callback function (not linked so far). Next step is we send success
through pL2CA_ConnectCfm_Cb and pL2CA_ConfigCfm_Cb.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4456487d36248408fc1c31403d107baef05e3646

3 years agol2c_csm: Remove unused variable
Hansong Zhang [Sat, 26 Sep 2020 23:20:31 +0000 (16:20 -0700)]
l2c_csm: Remove unused variable

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie11caa34cc55ed7e4aa6789df4cf08725998c73a

3 years agoMerge "Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlin...
Treehugger Robot [Mon, 28 Sep 2020 03:01:03 +0000 (03:01 +0000)]
Merge "Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux" am: 960730c35b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439973

Change-Id: Ic78e1a205f0e6c32291968257f6e069b1579dfb9

3 years agoMerge "Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux"
Treehugger Robot [Mon, 28 Sep 2020 02:28:06 +0000 (02:28 +0000)]
Merge "Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux"

3 years agoMerge "Set apex_available property" am: 9a5637591a
Treehugger Robot [Mon, 28 Sep 2020 00:38:30 +0000 (00:38 +0000)]
Merge "Set apex_available property" am: 9a5637591a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1432812

Change-Id: I56e4f7d5776bace6a9bec765aedc4a6f34add49f

3 years agoMerge "Set apex_available property"
Treehugger Robot [Mon, 28 Sep 2020 00:05:12 +0000 (00:05 +0000)]
Merge "Set apex_available property"

3 years agoL2CAP ERTM: Fix p_ccb->max_rx_mtu am: 8308c24d8a
Hansong Zhang [Sun, 27 Sep 2020 16:11:38 +0000 (16:11 +0000)]
L2CAP ERTM: Fix p_ccb->max_rx_mtu am: 8308c24d8a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439081

Change-Id: I07e1644a16015e7ec5d7876a365a28ecf4eee2de

3 years agoUse hidh_on_l2cap_error for error handling am: 95149a585c
Hansong Zhang [Sun, 27 Sep 2020 07:25:37 +0000 (07:25 +0000)]
Use hidh_on_l2cap_error for error handling am: 95149a585c

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439959

Change-Id: I306d906901998af5c5cf41b844e32b16df7a7722

3 years agoUse hidd_on_l2cap_error for error handling am: 407ad73659
Hansong Zhang [Sun, 27 Sep 2020 07:25:34 +0000 (07:25 +0000)]
Use hidd_on_l2cap_error for error handling am: 407ad73659

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439638

Change-Id: Ice0383502cc4ed8210dd326671a17fbecbf5e154

3 years agoHID: Simplify security check code am: a412f6bbb3
Hansong Zhang [Sun, 27 Sep 2020 07:25:31 +0000 (07:25 +0000)]
HID: Simplify security check code am: a412f6bbb3

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439965

Change-Id: I6f128e6bd65565bf44ad6e1257c92fb26c692258

3 years agoUse rfc_on_l2cap_error for error handling am: d3c390b077
Hansong Zhang [Sun, 27 Sep 2020 07:25:28 +0000 (07:25 +0000)]
Use rfc_on_l2cap_error for error handling am: d3c390b077

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439637

Change-Id: I70c2c8bf6286149d4a09cce25d67fe4a1a311c61

3 years agoUse avct_on_l2cap_error for error handling am: 4e82f0d26c
Hansong Zhang [Sun, 27 Sep 2020 07:25:25 +0000 (07:25 +0000)]
Use avct_on_l2cap_error for error handling am: 4e82f0d26c

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439964

Change-Id: Id17abbde51854c5b624f6a7527244e4aa11eff01

3 years agoUse avdt_on_l2cap_error for error handling am: ece51101ed
Hansong Zhang [Sun, 27 Sep 2020 07:25:21 +0000 (07:25 +0000)]
Use avdt_on_l2cap_error for error handling am: ece51101ed

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439963

Change-Id: I26b046a88658c748960d09e4f3499ad09ae48a37

3 years agoUse avct_br_on_l2cap_error am: 4e00fa771a
Hansong Zhang [Sun, 27 Sep 2020 07:24:40 +0000 (07:24 +0000)]
Use avct_br_on_l2cap_error am: 4e00fa771a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439962

Change-Id: Ib7c8310fc78799f021ca72a51576ea13cda577f2

3 years agoL2CAP ERTM: Fix p_ccb->max_rx_mtu
Hansong Zhang [Sun, 27 Sep 2020 06:38:13 +0000 (23:38 -0700)]
L2CAP ERTM: Fix p_ccb->max_rx_mtu

Use the old value, which was removed in
I78c3d65fdaf14addf80607ce5105221e52447a9e.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working & OPP
Change-Id: I90a8f94d16f87df2d4ce8bb0de8130d544affd12

3 years agoUse hidh_on_l2cap_error for error handling
Hansong Zhang [Sat, 26 Sep 2020 06:06:13 +0000 (23:06 -0700)]
Use hidh_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I098743c83c82445618d02c2d8491890d8f765fee

3 years agoUse hidd_on_l2cap_error for error handling
Hansong Zhang [Sat, 26 Sep 2020 06:18:33 +0000 (23:18 -0700)]
Use hidd_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I96bb727b01b8f0114d9f0cba1b8068e9591fae1f

3 years agoHID: Simplify security check code
Hansong Zhang [Sat, 26 Sep 2020 06:04:26 +0000 (23:04 -0700)]
HID: Simplify security check code

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ief3f87adbe41c1d4c5ea848fcddc3d1a3352166b

3 years agoUse rfc_on_l2cap_error for error handling
Hansong Zhang [Sat, 26 Sep 2020 06:30:27 +0000 (23:30 -0700)]
Use rfc_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I32a6be12ab14a27c9c0502961bf5bd9bdbdff005

3 years agoUse avct_on_l2cap_error for error handling
Hansong Zhang [Sat, 26 Sep 2020 00:40:04 +0000 (17:40 -0700)]
Use avct_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6e35a51a175b43d9b0dc5bb5be859e2d5ff94fa1

3 years agoUse avdt_on_l2cap_error for error handling
Hansong Zhang [Sat, 26 Sep 2020 00:35:36 +0000 (17:35 -0700)]
Use avdt_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I03f15d69e86d12b53fa4ee7fc711d4dca8a294aa

3 years agoUse avct_br_on_l2cap_error
Hansong Zhang [Sat, 26 Sep 2020 00:12:47 +0000 (17:12 -0700)]
Use avct_br_on_l2cap_error

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: I40fb1d61ff9375d0da2e1f4c83d42d5b273699c4

3 years agoUse gap_on_l2cap_error for error handling am: 09f5d7f465
Hansong Zhang [Sun, 27 Sep 2020 00:30:14 +0000 (00:30 +0000)]
Use gap_on_l2cap_error for error handling am: 09f5d7f465

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439960

Change-Id: Ib5e1789effa96f6aafc4398099c917629c4baafe

3 years agoUse gatt_on_l2cap_error for error handling am: e8dc945f4d
Hansong Zhang [Sat, 26 Sep 2020 22:48:00 +0000 (22:48 +0000)]
Use gatt_on_l2cap_error for error handling am: e8dc945f4d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439958

Change-Id: If3d908794800893809af613fbf2e8074801eaa71

3 years agoSimplify bnep_on_l2cap_error am: 3b18048449
Hansong Zhang [Sat, 26 Sep 2020 22:47:56 +0000 (22:47 +0000)]
Simplify bnep_on_l2cap_error am: 3b18048449

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439957

Change-Id: Id3c875a660cbfcb4ee6ced2bb9ff295246e717b9

3 years agoUse bnep_on_l2cap_error for error handling am: 44b477a8bc
Hansong Zhang [Sat, 26 Sep 2020 22:47:51 +0000 (22:47 +0000)]
Use bnep_on_l2cap_error for error handling am: 44b477a8bc

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439956

Change-Id: I802e48ec1b85f25fab4b78fffd694b1eb04f7f46

3 years agoSimplify sdp_on_l2cap_error am: c86dcd3704
Hansong Zhang [Sat, 26 Sep 2020 22:47:48 +0000 (22:47 +0000)]
Simplify sdp_on_l2cap_error am: c86dcd3704

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439955

Change-Id: Ic1e19306b0ecb910bd748253c4942a2d27747c1c

3 years agoSDP failure reason isn't used am: bd04c8dcd3
Hansong Zhang [Sat, 26 Sep 2020 22:47:43 +0000 (22:47 +0000)]
SDP failure reason isn't used am: bd04c8dcd3

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439954

Change-Id: Icd7308889c4a0539d0dfec6dafe4331565ce3817

3 years agoSDP: Move L2cap error handling to one place am: ceac9ce032
Hansong Zhang [Sat, 26 Sep 2020 22:47:38 +0000 (22:47 +0000)]
SDP: Move L2cap error handling to one place am: ceac9ce032

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439953

Change-Id: I3b3da3e0744c427ab6cd59aef7e6cd369cf5c755

3 years agoRemove unused code in l2c_api am: 3fd840f421
Hansong Zhang [Sat, 26 Sep 2020 22:47:34 +0000 (22:47 +0000)]
Remove unused code in l2c_api am: 3fd840f421

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439952

Change-Id: Ife055cc136ed77f80a45feb0193d10db676a5c44

3 years agoRemove L2CA_ErtmConnectRsp am: 11e328e0d4
Hansong Zhang [Sat, 26 Sep 2020 22:46:46 +0000 (22:46 +0000)]
Remove L2CA_ErtmConnectRsp am: 11e328e0d4

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439636

Change-Id: I34423e5fddcd4364baee29219edfafea54dcd9eb

3 years agoAdd missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux
Tianyu Jiang [Fri, 25 Sep 2020 22:36:20 +0000 (15:36 -0700)]
Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux

so that hwasan build succeeds.

Test: lunch aosp_??????-userdebug && m SANITIZE_TARGET=hwaddress -j36
Bug: 169083233
Change-Id: I78da891664c2667aa449969b6f06f030e624b2e7
(cherry picked from commit 7181fb9f9e6823e06e718de5727f123b4073e05e)

3 years agoRemove L2CA_ErtmConnectReq am: 415e2e80ff
Hansong Zhang [Sat, 26 Sep 2020 05:51:13 +0000 (05:51 +0000)]
Remove L2CA_ErtmConnectReq am: 415e2e80ff

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439635

Change-Id: Ifb146de6d763c881c42b47e813b7c31d22d5a835

3 years agoL2CAP: Use ERTM info during registration, not conn req am: 1877084886
Hansong Zhang [Sat, 26 Sep 2020 05:50:27 +0000 (05:50 +0000)]
L2CAP: Use ERTM info during registration, not conn req am: 1877084886

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439634

Change-Id: I5985b42406af81a0dd00737fec8882b86898cb84

3 years agoClean up unused defines and imports am: f1ed22df09
Hansong Zhang [Sat, 26 Sep 2020 01:20:51 +0000 (01:20 +0000)]
Clean up unused defines and imports am: f1ed22df09

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439633

Change-Id: I27bd6dc4a030a76d2b0a196eeb749505f23dfdef

3 years agoL2cap user: Use ConfigCfm_Cb as channel open indicator am: 2304c36e52
Hansong Zhang [Sat, 26 Sep 2020 01:20:48 +0000 (01:20 +0000)]
L2cap user: Use ConfigCfm_Cb as channel open indicator am: 2304c36e52

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439632

Change-Id: I1ee0509fb3773e0c74a2ea27e40b7172909b2972

3 years agoL2C_CSM: Send ConfigCfm to user after ConfigInd am: 4bac7e4a78
Hansong Zhang [Sat, 26 Sep 2020 01:20:44 +0000 (01:20 +0000)]
L2C_CSM: Send ConfigCfm to user after ConfigInd am: 4bac7e4a78

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439775

Change-Id: Ie274e249a4865bcbe8cb3a8b52f2ec9dc6139c38

3 years agoL2CA_ConfigCfm_Cb only need to provide result am: da8ec43139
Hansong Zhang [Sat, 26 Sep 2020 01:20:40 +0000 (01:20 +0000)]
L2CA_ConfigCfm_Cb only need to provide result am: da8ec43139

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439774

Change-Id: Ie88ef37e16467bd8809df2ca44d710fc56a775fc

3 years agoHIDD: Treat unacceptable QOS as normal failure am: 3c87d00189
Hansong Zhang [Sat, 26 Sep 2020 01:20:36 +0000 (01:20 +0000)]
HIDD: Treat unacceptable QOS as normal failure am: 3c87d00189

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439773

Change-Id: Ib50488e6972f13614ac9fa352032213221650a62

3 years agoL2CA_ConfigReq and L2CA_ConfigRsp are internal now am: acc416288e
Hansong Zhang [Sat, 26 Sep 2020 01:20:31 +0000 (01:20 +0000)]
L2CA_ConfigReq and L2CA_ConfigRsp are internal now am: acc416288e

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439772

Change-Id: I0cbd5d725f6053d051f35b1e40c98fe6883a25c5

3 years agoRemove L2CA_ConfigReq in client code am: e91542d478
Hansong Zhang [Sat, 26 Sep 2020 01:20:27 +0000 (01:20 +0000)]
Remove L2CA_ConfigReq in client code am: e91542d478

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439451

Change-Id: I68652917693600c85d10e10574c5f4f64d7c51f6

3 years agoL2CAP module will send ConfigReq for you am: 65acfa23cf
Hansong Zhang [Sat, 26 Sep 2020 01:20:24 +0000 (01:20 +0000)]
L2CAP module will send ConfigReq for you am: 65acfa23cf

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438418

Change-Id: I4ea5f0e86c2bf834b348f7f3750517f0fed4550f

3 years agoL2CAP: Don't allow sending re-config am: db34984d29
Hansong Zhang [Sat, 26 Sep 2020 01:20:20 +0000 (01:20 +0000)]
L2CAP: Don't allow sending re-config am: db34984d29

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438672

Change-Id: If31d05d271340f2dd41561a4bc7142f223b9927b

3 years agoL2CA_ConfigRsp is always invoked with status OK am: 8588d5cdd1
Hansong Zhang [Sat, 26 Sep 2020 01:20:15 +0000 (01:20 +0000)]
L2CA_ConfigRsp is always invoked with status OK am: 8588d5cdd1

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438671

Change-Id: I593f15a4d4157df2a7109c2c43d74559a7cbabd8

3 years agoL2CAP: Provide a default ERTM option am: 0640f93856
Hansong Zhang [Sat, 26 Sep 2020 01:20:12 +0000 (01:20 +0000)]
L2CAP: Provide a default ERTM option am: 0640f93856

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438417

Change-Id: I18acbf65f5eab682de8073b98875f828da5056fa

3 years agoSome ERTM values are constant am: 1b6d60e504
Hansong Zhang [Sat, 26 Sep 2020 01:20:07 +0000 (01:20 +0000)]
Some ERTM values are constant am: 1b6d60e504

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438416

Change-Id: I0803905600edcfd0c0012d51917c584815ef87d8

3 years agoRemove unnecessary definition am: 989e83b5c1
Hansong Zhang [Sat, 26 Sep 2020 01:20:03 +0000 (01:20 +0000)]
Remove unnecessary definition am: 989e83b5c1

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438415

Change-Id: I82073c462fe23457dc86e2cb3580de5da844b8d0

3 years agoMerge "HciCaptures: Add CommandComplete" am: 08fd1d6421
Treehugger Robot [Sat, 26 Sep 2020 01:19:01 +0000 (01:19 +0000)]
Merge "HciCaptures: Add CommandComplete" am: 08fd1d6421

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438313

Change-Id: Idc051f11ee5ccf06d7b241fb5dc66261ae34bc0f

3 years agoUse gap_on_l2cap_error for error handling
Hansong Zhang [Sat, 26 Sep 2020 00:03:33 +0000 (17:03 -0700)]
Use gap_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I8faaa5f586e3133d1a5c7ff890ad27a87ee9433a

3 years agoUse gatt_on_l2cap_error for error handling
Hansong Zhang [Fri, 25 Sep 2020 23:54:05 +0000 (16:54 -0700)]
Use gatt_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7a2fbc5805662270588d152ead932ffa02fc9dc6

3 years agoSimplify bnep_on_l2cap_error
Hansong Zhang [Fri, 25 Sep 2020 23:37:51 +0000 (16:37 -0700)]
Simplify bnep_on_l2cap_error

Both cases are doing the same thing.

Error reason isn't used throughout the stack.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib3793f96c0d8a2907fc41d9a24712d2db78a0665

3 years agoUse bnep_on_l2cap_error for error handling
Hansong Zhang [Fri, 25 Sep 2020 23:37:05 +0000 (16:37 -0700)]
Use bnep_on_l2cap_error for error handling

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ieb28a7bbdea106a5e51e9bf996ecba9dab71f15a

3 years agoSimplify sdp_on_l2cap_error
Hansong Zhang [Fri, 25 Sep 2020 23:29:29 +0000 (16:29 -0700)]
Simplify sdp_on_l2cap_error

Both cases are doing the same thing (send disconnect request is no-op if
channel is not open, and then free the control block).

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9b29899164b00fd9072e4dc37cfc30dd095c3524

3 years agoSDP failure reason isn't used
Hansong Zhang [Fri, 25 Sep 2020 23:27:47 +0000 (16:27 -0700)]
SDP failure reason isn't used

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I1ee477914c1f13f43f868a28f18b372e36baf752

3 years agoSDP: Move L2cap error handling to one place
Hansong Zhang [Fri, 25 Sep 2020 23:24:52 +0000 (16:24 -0700)]
SDP: Move L2cap error handling to one place

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I903127f07ae97349d1fa7625d20835b46dbe9063

3 years agoRemove unused code in l2c_api
Hansong Zhang [Fri, 25 Sep 2020 23:16:48 +0000 (16:16 -0700)]
Remove unused code in l2c_api

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ifdcb0a14919e75103796246cddb9011393e0035a

3 years agoRemove L2CA_ErtmConnectRsp
Hansong Zhang [Fri, 25 Sep 2020 22:32:40 +0000 (15:32 -0700)]
Remove L2CA_ErtmConnectRsp

Just use L2CA_ConnectRsp.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie95ed09c9d2e79fabd9d6eae6a038a6896a8e558

3 years agoRemove L2CA_ErtmConnectReq
Hansong Zhang [Fri, 25 Sep 2020 22:27:51 +0000 (15:27 -0700)]
Remove L2CA_ErtmConnectReq

Now that the p_ertm_info parameter is unused, just use L2CA_ConnectReq.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I458e0d8bcc2809c8bc2d295be29516be05bf05ba

3 years agoL2CAP: Use ERTM info during registration, not conn req
Hansong Zhang [Fri, 25 Sep 2020 22:18:09 +0000 (15:18 -0700)]
L2CAP: Use ERTM info during registration, not conn req

ERTM info is stored in p_ccb->p_rcb. Use that as the source of truth.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I78c3d65fdaf14addf80607ce5105221e52447a9e

3 years agoClean up unused defines and imports
Hansong Zhang [Fri, 25 Sep 2020 21:57:49 +0000 (14:57 -0700)]
Clean up unused defines and imports

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I5c47ee320085664b3db68ff4a5860aa931d1376d

3 years agoL2cap user: Use ConfigCfm_Cb as channel open indicator
Hansong Zhang [Fri, 25 Sep 2020 21:32:11 +0000 (14:32 -0700)]
L2cap user: Use ConfigCfm_Cb as channel open indicator

When the user receives ConfigCfm_Cb, it's guaranteed that ConfigInd_Cb
is received with correct option enforced.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6de12f1ba6e9612f6a84b399e7fc984a7f3c3c72

3 years agoL2C_CSM: Send ConfigCfm to user after ConfigInd
Hansong Zhang [Fri, 25 Sep 2020 20:24:55 +0000 (13:24 -0700)]
L2C_CSM: Send ConfigCfm to user after ConfigInd

This way, users know that a ConfigCfm event with status OK means channel
is established. No need to further keep track of state.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I90295349c53d57aa859c5bb65e6f28a299714b3d

3 years agoL2CA_ConfigCfm_Cb only need to provide result
Hansong Zhang [Fri, 25 Sep 2020 19:39:16 +0000 (12:39 -0700)]
L2CA_ConfigCfm_Cb only need to provide result

Users only care about result.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ife07db2454f938fb1dd1b7fde2136b8de887fa3b

3 years agoHIDD: Treat unacceptable QOS as normal failure
Hansong Zhang [Fri, 25 Sep 2020 19:17:12 +0000 (12:17 -0700)]
HIDD: Treat unacceptable QOS as normal failure

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7d37c46f7c6b16a55afafe04b62081d43f63c122

3 years agoL2CA_ConfigReq and L2CA_ConfigRsp are internal now
Hansong Zhang [Fri, 25 Sep 2020 18:31:02 +0000 (11:31 -0700)]
L2CA_ConfigReq and L2CA_ConfigRsp are internal now

Only used by l2c_csm, so we make an internal version instead.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: If725c705bcbabec025cb16d063cd4d4aa4b319f9

3 years agoRemove L2CA_ConfigReq in client code
Hansong Zhang [Fri, 25 Sep 2020 18:15:00 +0000 (11:15 -0700)]
Remove L2CA_ConfigReq in client code

Let L2CAP do this for you.

HIDD used to send anothe ConfigReq if the remote HIDH wants a different
QOS. We drop this adjustment for now. QOS is not used. Regard this as a
normal config error. This simplifies the workflow.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic3ff08a4b876462fec697ffa8a09fc8bca943603

3 years agoL2CAP module will send ConfigReq for you
Hansong Zhang [Fri, 25 Sep 2020 04:32:08 +0000 (21:32 -0700)]
L2CAP module will send ConfigReq for you

No need to send it in client code.

Will get rid of the fake L2CA_ConfigReq() next.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I66e2efad144e76eb6abfa6d421e12ae4a60d8e1f

3 years agoL2CAP: Don't allow sending re-config
Hansong Zhang [Fri, 25 Sep 2020 07:04:44 +0000 (00:04 -0700)]
L2CAP: Don't allow sending re-config

There is no use case. Remove the support for now. This makes L2CAP state
machine more complicated.

Note that we don't handle re-config request from remote gracefully. For
example, RFCOMM will simply disconnect.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I1d2a420e4f904b7e935715f327171d133760eab3

3 years agoL2CA_ConfigRsp is always invoked with status OK
Hansong Zhang [Fri, 25 Sep 2020 06:28:56 +0000 (23:28 -0700)]
L2CA_ConfigRsp is always invoked with status OK

So we can move some error processing logic.

Also we never send a config with continuation flag.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6c5e05b39a76138f90b41a0e56b7bfd73f056455

3 years agoL2CAP: Provide a default ERTM option
Hansong Zhang [Fri, 25 Sep 2020 04:20:37 +0000 (21:20 -0700)]
L2CAP: Provide a default ERTM option

Note that the existing ERTM options for AVCT_BR and GAP OBEX are almost
the same, and the only difference is TxWindow (10 and 20).  Providing a
default value of 10 won't make a difference.

Use the same ERTM option so that later L2CAP can send config request for
them.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I410045f47c643fd4a152ae44722e905b2ce01197

3 years agoSome ERTM values are constant
Hansong Zhang [Fri, 25 Sep 2020 03:59:13 +0000 (20:59 -0700)]
Some ERTM values are constant

Remove unnecessary definition.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I2cb74575a57262e11ebc389a3f9473702dbb13b4

3 years agoRemove unnecessary definition
Hansong Zhang [Fri, 25 Sep 2020 03:45:11 +0000 (20:45 -0700)]
Remove unnecessary definition

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9baf600d22cad78b2b93d29dd7d8975731beb47d

3 years agoMerge "HciCaptures: Add CommandComplete"
Treehugger Robot [Sat, 26 Sep 2020 00:51:46 +0000 (00:51 +0000)]
Merge "HciCaptures: Add CommandComplete"

3 years agoLet L2CAP send ConfigRsp for you am: 75d1c63ba5
Hansong Zhang [Fri, 25 Sep 2020 22:55:30 +0000 (22:55 +0000)]
Let L2CAP send ConfigRsp for you am: 75d1c63ba5

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438234

Change-Id: I18cd60e397d3d74dbf2827918010b08e443b2f7d

3 years agoHciCaptures: Add CommandComplete
Myles Watson [Thu, 24 Sep 2020 15:51:14 +0000 (08:51 -0700)]
HciCaptures: Add CommandComplete

Add public methods to match or extract events in matchers.py.

Call the same private static methods to extract or match events.

- CommandComplete
- LeMetaEvent
- LeConnectionComplete

Test: cert/run --host
Bug: 145832107
Tag: #gd-refactor
Change-Id: I308e97cfe60dbcd351f211ff836c0516019412db

3 years agoStraighten out stack/acl/btm_acl::btm_read_remote_version_complete am: d64f464405
Chris Manton [Fri, 25 Sep 2020 22:43:09 +0000 (22:43 +0000)]
Straighten out stack/acl/btm_acl::btm_read_remote_version_complete am: d64f464405

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438551

Change-Id: I39a09c44ed84df9c6f4d5c076d0b7fc171813b35

3 years agoAdd gd/l2cap::OnReadRemoteVersionInformationComplete am: 11131aa71b
Chris Manton [Fri, 25 Sep 2020 22:42:24 +0000 (22:42 +0000)]
Add gd/l2cap::OnReadRemoteVersionInformationComplete am: 11131aa71b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438552

Change-Id: Ie02d5e1824a37937b7b4e8b08dd94738d9ec11b7

3 years agoLet L2CAP send ConfigRsp for you
Hansong Zhang [Fri, 25 Sep 2020 03:05:07 +0000 (20:05 -0700)]
Let L2CAP send ConfigRsp for you

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4767af7032b9c22fc297cca0877a1bc7e8c8607b

3 years agoStraighten out stack/acl/btm_acl::btm_read_remote_version_complete
Chris Manton [Fri, 25 Sep 2020 00:11:21 +0000 (17:11 -0700)]
Straighten out stack/acl/btm_acl::btm_read_remote_version_complete

Towards readable code

Bug: 163134718
Tag: #refactor
Test: ble paired 2 phones
Test: act.py -tc BleCocTest
Change-Id: I87db6ce0106e98684f1582a60f28beed81d66aec

3 years agoAdd gd/l2cap::OnReadRemoteVersionInformationComplete
Chris Manton [Fri, 25 Sep 2020 05:12:00 +0000 (22:12 -0700)]
Add gd/l2cap::OnReadRemoteVersionInformationComplete

Provide ability to handle at higher layer

Bug: 166280067
Tag: #refactor
Test: gd/cert/run --host
Change-Id: I717b273623df4a3e21bf07e62b034cd7ad790cd3

3 years agoMerge "Handle remote connection parameter request" am: 827c2217e9
Treehugger Robot [Fri, 25 Sep 2020 19:19:43 +0000 (19:19 +0000)]
Merge "Handle remote connection parameter request" am: 827c2217e9

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1439391

Change-Id: I49d07ef7d59d9b312b01caaa1a17944d77d60212

3 years agoEnforce remote MTU requirement in L2CAP directly am: 679dfc5152
Hansong Zhang [Fri, 25 Sep 2020 19:19:29 +0000 (19:19 +0000)]
Enforce remote MTU requirement in L2CAP directly am: 679dfc5152

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438233

Change-Id: I54ee513e88222c2119ecc89ef45eb3ad389f912b

3 years agoL2CAP: peer_cfg_bits is unused am: b0d9b4b9b7
Hansong Zhang [Fri, 25 Sep 2020 19:19:25 +0000 (19:19 +0000)]
L2CAP: peer_cfg_bits is unused am: b0d9b4b9b7

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438232

Change-Id: Ib6ce3a945650bbb9fe1a92d60b92c1f44406c06a

3 years agoL2CAP: Add a "required_remote_mtu" and store it am: 8ddee4d822
Hansong Zhang [Fri, 25 Sep 2020 19:19:21 +0000 (19:19 +0000)]
L2CAP: Add a "required_remote_mtu" and store it am: 8ddee4d822

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438414

Change-Id: I1b184c4b93e50339d346cfd635a36c007ed944c3

3 years agoRemove unused code in BNEP am: bf88eeb9ea
Hansong Zhang [Fri, 25 Sep 2020 19:19:18 +0000 (19:19 +0000)]
Remove unused code in BNEP am: bf88eeb9ea

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438412

Change-Id: Ied8c5cccc4da6f559095f9f37ae127d9445d7a53

3 years agoProfile services have const MTU size now am: 2e15c539cc
Hansong Zhang [Fri, 25 Sep 2020 19:17:59 +0000 (19:17 +0000)]
Profile services have const MTU size now am: 2e15c539cc

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438411

Change-Id: Ie2fde010c0631b54cc9c8199cb7c91e5bced60cc

3 years agoMerge "Handle remote connection parameter request"
Treehugger Robot [Fri, 25 Sep 2020 19:15:18 +0000 (19:15 +0000)]
Merge "Handle remote connection parameter request"

3 years agoHandle remote connection parameter request
Jakub Pawlowski [Fri, 25 Sep 2020 17:28:07 +0000 (19:28 +0200)]
Handle remote connection parameter request

Bug: 145832107
Test: connect with LE Device that request parameter chagne
Tag: #gd-refactor
Change-Id: I82839b56c58dda4b2f430c212156bf8919d67103

3 years agoEnforce remote MTU requirement in L2CAP directly
Hansong Zhang [Fri, 25 Sep 2020 02:57:01 +0000 (19:57 -0700)]
Enforce remote MTU requirement in L2CAP directly

AVCT_BR and BNEP don't need to enforce it locally.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I090d4e31b76e0098fc77e707ebd2eacf4cd78b7b

3 years agoL2CAP: peer_cfg_bits is unused
Hansong Zhang [Fri, 25 Sep 2020 02:28:17 +0000 (19:28 -0700)]
L2CAP: peer_cfg_bits is unused

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Icec4e536f28a649779f747d34a7d76295f5ef10f

3 years agoL2CAP: Add a "required_remote_mtu" and store it
Hansong Zhang [Fri, 25 Sep 2020 00:50:55 +0000 (17:50 -0700)]
L2CAP: Add a "required_remote_mtu" and store it

For AVCT_BR and BNEP, we need a larger required remote mtu than minimal
L2CAP MTU.

So far we enforce this in profile service itself, but later we can let
L2CAP module enforce this for us.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0b4bad4049636bcdc52615c000b1fff3acde360c

3 years agoRemove unused code in BNEP
Hansong Zhang [Fri, 25 Sep 2020 00:27:49 +0000 (17:27 -0700)]
Remove unused code in BNEP

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I51a6edb1d7f94422657128d0b3d8398a4c25c5de