Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9aa04c91 authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo Padovan
Browse files

Bluetooth: Add Advertising Report Meta Event handler



This patch adds a function to handle LE Advertising Report Meta
Events.

Signed-off-by: default avatarAndre Guedes <andre.guedes@openbossa.org>
Signed-off-by: default avatarAnderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 76c8686f
Loading
Loading
Loading
Loading
+25 −0
Original line number Original line Diff line number Diff line
@@ -2680,6 +2680,27 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff
	hci_dev_unlock(hdev);
	hci_dev_unlock(hdev);
}
}


static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
						struct sk_buff *skb)
{
	struct hci_ev_le_advertising_info *ev;
	u8 num_reports;

	num_reports = skb->data[0];
	ev = (void *) &skb->data[1];

	hci_dev_lock(hdev);

	hci_add_adv_entry(hdev, ev);

	while (--num_reports) {
		ev = (void *) (ev->data + ev->length + 1);
		hci_add_adv_entry(hdev, ev);
	}

	hci_dev_unlock(hdev);
}

static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
{
	struct hci_ev_le_meta *le_ev = (void *) skb->data;
	struct hci_ev_le_meta *le_ev = (void *) skb->data;
@@ -2691,6 +2712,10 @@ static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
		hci_le_conn_complete_evt(hdev, skb);
		hci_le_conn_complete_evt(hdev, skb);
		break;
		break;


	case HCI_EV_LE_ADVERTISING_REPORT:
		hci_le_adv_report_evt(hdev, skb);
		break;

	default:
	default:
		break;
		break;
	}
	}