Lines Matching refs:ptr
16 u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len) in eir_append_local_name() argument
28 return eir_append_data(ptr, ad_len, EIR_NAME_COMPLETE, in eir_append_local_name()
34 return eir_append_data(ptr, ad_len, EIR_NAME_SHORT, in eir_append_local_name()
46 return eir_append_data(ptr, ad_len, EIR_NAME_SHORT, name, in eir_append_local_name()
53 u8 eir_append_appearance(struct hci_dev *hdev, u8 *ptr, u8 ad_len) in eir_append_appearance() argument
55 return eir_append_le16(ptr, ad_len, EIR_APPEARANCE, hdev->appearance); in eir_append_appearance()
73 u8 *ptr = data, *uuids_start = NULL; in create_uuid16_list() local
77 return ptr; in create_uuid16_list()
93 uuids_start = ptr; in create_uuid16_list()
96 ptr += 2; in create_uuid16_list()
100 if ((ptr - data) + sizeof(u16) > len) { in create_uuid16_list()
105 *ptr++ = (uuid16 & 0x00ff); in create_uuid16_list()
106 *ptr++ = (uuid16 & 0xff00) >> 8; in create_uuid16_list()
110 return ptr; in create_uuid16_list()
115 u8 *ptr = data, *uuids_start = NULL; in create_uuid32_list() local
119 return ptr; in create_uuid32_list()
126 uuids_start = ptr; in create_uuid32_list()
129 ptr += 2; in create_uuid32_list()
133 if ((ptr - data) + sizeof(u32) > len) { in create_uuid32_list()
138 memcpy(ptr, &uuid->uuid[12], sizeof(u32)); in create_uuid32_list()
139 ptr += sizeof(u32); in create_uuid32_list()
143 return ptr; in create_uuid32_list()
148 u8 *ptr = data, *uuids_start = NULL; in create_uuid128_list() local
152 return ptr; in create_uuid128_list()
159 uuids_start = ptr; in create_uuid128_list()
162 ptr += 2; in create_uuid128_list()
166 if ((ptr - data) + 16 > len) { in create_uuid128_list()
171 memcpy(ptr, uuid->uuid, 16); in create_uuid128_list()
172 ptr += 16; in create_uuid128_list()
176 return ptr; in create_uuid128_list()
181 u8 *ptr = data; in eir_create() local
190 ptr[1] = EIR_NAME_SHORT; in eir_create()
192 ptr[1] = EIR_NAME_COMPLETE; in eir_create()
196 ptr[0] = name_len + 1; in eir_create()
198 memcpy(ptr + 2, hdev->dev_name, name_len); in eir_create()
200 ptr += (name_len + 2); in eir_create()
204 ptr[0] = 2; in eir_create()
205 ptr[1] = EIR_TX_POWER; in eir_create()
206 ptr[2] = (u8)hdev->inq_tx_power; in eir_create()
208 ptr += 3; in eir_create()
212 ptr[0] = 9; in eir_create()
213 ptr[1] = EIR_DEVICE_ID; in eir_create()
215 put_unaligned_le16(hdev->devid_source, ptr + 2); in eir_create()
216 put_unaligned_le16(hdev->devid_vendor, ptr + 4); in eir_create()
217 put_unaligned_le16(hdev->devid_product, ptr + 6); in eir_create()
218 put_unaligned_le16(hdev->devid_version, ptr + 8); in eir_create()
220 ptr += 10; in eir_create()
223 ptr = create_uuid16_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); in eir_create()
224 ptr = create_uuid32_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); in eir_create()
225 ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); in eir_create()
228 u8 eir_create_adv_data(struct hci_dev *hdev, u8 instance, u8 *ptr) in eir_create_adv_data() argument
273 ptr[0] = 0x02; in eir_create_adv_data()
274 ptr[1] = EIR_FLAGS; in eir_create_adv_data()
275 ptr[2] = flags; in eir_create_adv_data()
278 ptr += 3; in eir_create_adv_data()
284 memcpy(ptr, adv->adv_data, adv->adv_data_len); in eir_create_adv_data()
286 ptr += adv->adv_data_len; in eir_create_adv_data()
303 ptr[0] = 0x02; in eir_create_adv_data()
304 ptr[1] = EIR_TX_POWER; in eir_create_adv_data()
305 ptr[2] = (u8)adv_tx_power; in eir_create_adv_data()
308 ptr += 3; in eir_create_adv_data()
315 static u8 create_default_scan_rsp(struct hci_dev *hdev, u8 *ptr) in create_default_scan_rsp() argument
320 scan_rsp_len = eir_append_appearance(hdev, ptr, scan_rsp_len); in create_default_scan_rsp()
322 return eir_append_local_name(hdev, ptr, scan_rsp_len); in create_default_scan_rsp()
325 u8 eir_create_scan_rsp(struct hci_dev *hdev, u8 instance, u8 *ptr) in eir_create_scan_rsp() argument
331 return create_default_scan_rsp(hdev, ptr); in eir_create_scan_rsp()
338 scan_rsp_len = eir_append_appearance(hdev, ptr, scan_rsp_len); in eir_create_scan_rsp()
340 memcpy(&ptr[scan_rsp_len], adv->scan_rsp_data, adv->scan_rsp_len); in eir_create_scan_rsp()
345 scan_rsp_len = eir_append_local_name(hdev, ptr, scan_rsp_len); in eir_create_scan_rsp()