Lines Matching refs:ext_prop
1283 struct usb_os_desc_ext_prop *ext_prop = to_usb_os_desc_ext_prop(item); in ext_prop_type_store() local
1284 struct usb_os_desc *desc = to_usb_os_desc(ext_prop->item.ci_parent); in ext_prop_type_store()
1298 if ((ext_prop->type == USB_EXT_PROP_BINARY || in ext_prop_type_store()
1299 ext_prop->type == USB_EXT_PROP_LE32 || in ext_prop_type_store()
1300 ext_prop->type == USB_EXT_PROP_BE32) && in ext_prop_type_store()
1304 ext_prop->data_len <<= 1; in ext_prop_type_store()
1305 else if ((ext_prop->type == USB_EXT_PROP_UNICODE || in ext_prop_type_store()
1306 ext_prop->type == USB_EXT_PROP_UNICODE_ENV || in ext_prop_type_store()
1307 ext_prop->type == USB_EXT_PROP_UNICODE_LINK) && in ext_prop_type_store()
1311 ext_prop->data_len >>= 1; in ext_prop_type_store()
1312 ext_prop->type = type; in ext_prop_type_store()
1321 struct usb_os_desc_ext_prop *ext_prop = to_usb_os_desc_ext_prop(item); in ext_prop_data_show() local
1322 int len = ext_prop->data_len; in ext_prop_data_show()
1324 if (ext_prop->type == USB_EXT_PROP_UNICODE || in ext_prop_data_show()
1325 ext_prop->type == USB_EXT_PROP_UNICODE_ENV || in ext_prop_data_show()
1326 ext_prop->type == USB_EXT_PROP_UNICODE_LINK) in ext_prop_data_show()
1328 memcpy(page, ext_prop->data, len); in ext_prop_data_show()
1336 struct usb_os_desc_ext_prop *ext_prop = to_usb_os_desc_ext_prop(item); in ext_prop_data_store() local
1337 struct usb_os_desc *desc = to_usb_os_desc(ext_prop->item.ci_parent); in ext_prop_data_store()
1349 kfree(ext_prop->data); in ext_prop_data_store()
1350 ext_prop->data = new_data; in ext_prop_data_store()
1351 desc->ext_prop_len -= ext_prop->data_len; in ext_prop_data_store()
1352 ext_prop->data_len = len; in ext_prop_data_store()
1353 desc->ext_prop_len += ext_prop->data_len; in ext_prop_data_store()
1354 if (ext_prop->type == USB_EXT_PROP_UNICODE || in ext_prop_data_store()
1355 ext_prop->type == USB_EXT_PROP_UNICODE_ENV || in ext_prop_data_store()
1356 ext_prop->type == USB_EXT_PROP_UNICODE_LINK) { in ext_prop_data_store()
1357 desc->ext_prop_len -= ext_prop->data_len; in ext_prop_data_store()
1358 ext_prop->data_len <<= 1; in ext_prop_data_store()
1359 ext_prop->data_len += 2; in ext_prop_data_store()
1360 desc->ext_prop_len += ext_prop->data_len; in ext_prop_data_store()
1378 struct usb_os_desc_ext_prop *ext_prop = to_usb_os_desc_ext_prop(item); in usb_os_desc_ext_prop_release() local
1380 kfree(ext_prop); /* frees a whole chunk */ in usb_os_desc_ext_prop_release()
1391 struct usb_os_desc_ext_prop *ext_prop; in ext_prop_make() local
1397 vla_item(data_chunk, struct usb_os_desc_ext_prop, ext_prop, 1); in ext_prop_make()
1404 ext_prop = vla_ptr(vlabuf, data_chunk, ext_prop); in ext_prop_make()
1412 config_item_init_type_name(&ext_prop->item, name, ext_prop_type); in ext_prop_make()
1414 ext_prop->name = kstrdup(name, GFP_KERNEL); in ext_prop_make()
1415 if (!ext_prop->name) { in ext_prop_make()
1420 ext_prop->name_len = 2 * strlen(ext_prop->name) + 2; in ext_prop_make()
1423 desc->ext_prop_len += ext_prop->name_len; in ext_prop_make()
1424 list_add_tail(&ext_prop->entry, &desc->ext_prop); in ext_prop_make()
1429 return &ext_prop->item; in ext_prop_make()
1434 struct usb_os_desc_ext_prop *ext_prop = to_usb_os_desc_ext_prop(item); in ext_prop_drop() local
1439 list_del(&ext_prop->entry); in ext_prop_drop()
1441 kfree(ext_prop->name); in ext_prop_drop()
1442 desc->ext_prop_len -= (ext_prop->name_len + ext_prop->data_len + 14); in ext_prop_drop()