Commit 227a0cd
committed
Bluetooth: MGMT: Fix not generating command complete for MGMT_OP_DISCONNECT
MGMT_OP_DISCONNECT can be called while mgmt_device_connected has not
been called yet, which will cause the connection procedure to be
aborted, so mgmt_device_disconnected shall still respond with command
complete to MGMT_OP_DISCONNECT and just not emit
MGMT_EV_DEVICE_DISCONNECTED since MGMT_EV_DEVICE_CONNECTED was never
sent.
To fix this MGMT_OP_DISCONNECT is changed to work similarly to other
command which do use hci_cmd_sync_queue and then use hci_conn_abort to
disconnect and returns the result, in order for hci_conn_abort to be
used from hci_cmd_sync context it now uses hci_cmd_sync_run_once.
Link: bluez/bluez#932
Fixes: 12d4a3b ("Bluetooth: Move check for MGMT_CONNECTED flag into mgmt.c")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>1 parent c898f6d commit 227a0cd
2 files changed
Lines changed: 47 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2952 | 2952 | | |
2953 | 2953 | | |
2954 | 2954 | | |
2955 | | - | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
2956 | 2960 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2921 | 2921 | | |
2922 | 2922 | | |
2923 | 2923 | | |
2924 | | - | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
2925 | 2930 | | |
2926 | 2931 | | |
2927 | 2932 | | |
| |||
3053 | 3058 | | |
3054 | 3059 | | |
3055 | 3060 | | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
3056 | 3093 | | |
3057 | 3094 | | |
3058 | 3095 | | |
3059 | 3096 | | |
3060 | 3097 | | |
3061 | 3098 | | |
3062 | | - | |
3063 | 3099 | | |
3064 | 3100 | | |
3065 | 3101 | | |
| |||
3082 | 3118 | | |
3083 | 3119 | | |
3084 | 3120 | | |
3085 | | - | |
3086 | | - | |
3087 | | - | |
3088 | | - | |
3089 | | - | |
3090 | | - | |
3091 | | - | |
3092 | | - | |
3093 | | - | |
3094 | | - | |
3095 | | - | |
3096 | | - | |
3097 | | - | |
3098 | | - | |
3099 | | - | |
3100 | | - | |
3101 | | - | |
3102 | | - | |
3103 | | - | |
3104 | | - | |
3105 | | - | |
| 3121 | + | |
3106 | 3122 | | |
3107 | 3123 | | |
3108 | 3124 | | |
3109 | 3125 | | |
3110 | 3126 | | |
3111 | 3127 | | |
3112 | 3128 | | |
3113 | | - | |
| 3129 | + | |
| 3130 | + | |
3114 | 3131 | | |
3115 | | - | |
| 3132 | + | |
3116 | 3133 | | |
3117 | 3134 | | |
3118 | 3135 | | |
| |||
9689 | 9706 | | |
9690 | 9707 | | |
9691 | 9708 | | |
9692 | | - | |
9693 | | - | |
9694 | | - | |
9695 | | - | |
9696 | | - | |
9697 | | - | |
9698 | | - | |
9699 | | - | |
9700 | | - | |
9701 | | - | |
9702 | | - | |
9703 | | - | |
9704 | 9709 | | |
9705 | 9710 | | |
9706 | 9711 | | |
| |||
9744 | 9749 | | |
9745 | 9750 | | |
9746 | 9751 | | |
9747 | | - | |
9748 | | - | |
9749 | 9752 | | |
9750 | 9753 | | |
9751 | 9754 | | |
| |||
9758 | 9761 | | |
9759 | 9762 | | |
9760 | 9763 | | |
9761 | | - | |
9762 | | - | |
9763 | | - | |
9764 | 9764 | | |
9765 | 9765 | | |
9766 | 9766 | | |
| |||
0 commit comments