input: Fix connecting new trusted sixaxis device

If sixaxis device was trusted before first connection over Bluetooth
connection might get accepted before device services were discovered.
This results in conection to PSM19 not being added to idev. To fix
this channel for PSM19 is also added to SDP complete callback so that
both channels are added.
This commit is contained in:
Szymon Janc 2014-01-08 01:02:25 +01:00 committed by Johan Hedberg
parent fc8f951c07
commit 8d2bdf4eef

View File

@ -101,9 +101,6 @@ static void sixaxis_browse_sdp(const bdaddr_t *src, const bdaddr_t *dst,
struct btd_device *device;
struct sixaxis_data *data;
if (psm != L2CAP_PSM_HIDP_CTRL)
return;
device = btd_adapter_find_device(adapter_find(src), dst);
if (!device)
return;
@ -112,7 +109,9 @@ static void sixaxis_browse_sdp(const bdaddr_t *src, const bdaddr_t *dst,
data->chan = g_io_channel_ref(chan);
data->psm = psm;
device_discover_services(device);
if (psm == L2CAP_PSM_HIDP_CTRL)
device_discover_services(device);
device_wait_for_svc_complete(device, sixaxis_sdp_cb, data);
}