* global list (by passing NULL as first parameter).
*/
static struct l2cap_chan *l2cap_global_fixed_chan(struct l2cap_chan *c,
- bdaddr_t *src)
+ bdaddr_t *src, u8 link_type)
{
read_lock(&chan_list_lock);
continue;
if (bacmp(&c->src, src) && bacmp(&c->src, BDADDR_ANY))
continue;
+ if (link_type == ACL_LINK && c->src_type != BDADDR_BREDR)
+ continue;
+ if (link_type == LE_LINK && c->src_type == BDADDR_BREDR)
+ continue;
l2cap_chan_hold(c);
read_unlock(&chan_list_lock);
* we left off, because the list lock would prevent calling the
* potentially sleeping l2cap_chan_lock() function.
*/
- pchan = l2cap_global_fixed_chan(NULL, &hdev->bdaddr);
+ pchan = l2cap_global_fixed_chan(NULL, &hdev->bdaddr, hcon->type);
while (pchan) {
struct l2cap_chan *chan, *next;
l2cap_chan_unlock(pchan);
next:
- next = l2cap_global_fixed_chan(pchan, &hdev->bdaddr);
+ next = l2cap_global_fixed_chan(pchan, &hdev->bdaddr,
+ hcon->type);
l2cap_chan_put(pchan);
pchan = next;
}