Lines Matching refs:page
138 char *page) \
140 return sprintf(page, "0x%02x\n", \
146 char *page) \
148 return sprintf(page, "0x%04x\n", \
155 const char *page, size_t len) \
159 ret = kstrtou8(page, 0, &val); \
168 const char *page, size_t len) \
172 ret = kstrtou16(page, 0, &val); \
206 const char *page, size_t len)
211 ret = kstrtou16(page, 0, &bcdDevice);
223 const char *page, size_t len)
228 ret = kstrtou16(page, 0, &bcdUSB);
239 static ssize_t gadget_dev_desc_UDC_show(struct config_item *item, char *page)
247 ret = sprintf(page, "%s\n", udc_name ?: "");
269 const char *page, size_t len)
275 if (strlen(page) < len)
278 name = kstrdup(page, GFP_KERNEL);
312 char *page)
316 return sprintf(page, "%s\n", usb_speed_string(speed));
320 const char *page, size_t len)
330 if (strncmp(page, "super-speed-plus", 16) == 0)
332 else if (strncmp(page, "super-speed", 11) == 0)
334 else if (strncmp(page, "high-speed", 10) == 0)
336 else if (strncmp(page, "full-speed", 10) == 0)
338 else if (strncmp(page, "low-speed", 9) == 0)
522 char *page)
526 return sprintf(page, "%u\n", cfg->c.MaxPower);
530 const char *page, size_t len)
535 ret = kstrtou16(page, 0, &val);
545 char *page)
549 return sprintf(page, "0x%02x\n", cfg->c.bmAttributes);
553 const char *page, size_t len)
558 ret = kstrtou8(page, 0, &val);
800 static ssize_t gadget_string_id_show(struct config_item *item, char *page)
805 ret = sprintf(page, "%u\n", string->usb_string.id);
810 static ssize_t gadget_string_s_show(struct config_item *item, char *page)
815 ret = snprintf(page, sizeof(string->string), "%s\n", string->string);
819 static ssize_t gadget_string_s_store(struct config_item *item, const char *page,
828 return strscpy(string->string, page, size);
970 static ssize_t webusb_use_show(struct config_item *item, char *page)
972 return sysfs_emit(page, "%d\n",
976 static ssize_t webusb_use_store(struct config_item *item, const char *page,
983 ret = kstrtobool(page, &use);
994 static ssize_t webusb_bcdVersion_show(struct config_item *item, char *page)
996 return sysfs_emit(page, "0x%04x\n",
1001 const char *page, size_t len)
1007 ret = kstrtou16(page, 0, &bcdVersion);
1022 static ssize_t webusb_bVendorCode_show(struct config_item *item, char *page)
1024 return sysfs_emit(page, "0x%02x\n",
1029 const char *page, size_t len)
1035 ret = kstrtou8(page, 0, &b_vendor_code);
1046 static ssize_t webusb_landingPage_show(struct config_item *item, char *page)
1048 return sysfs_emit(page, "%s\n", webusb_item_to_gadget_info(item)->landing_page);
1051 static ssize_t webusb_landingPage_store(struct config_item *item, const char *page,
1058 if (page[l - 1] == '\n') {
1069 if (strncasecmp(page, "https://", 8) == 0)
1071 else if (strncasecmp(page, "http://", 7) == 0)
1083 // ensure 0 bytes are set, in case the new landing page is shorter then the old one.
1084 memcpy_and_pad(gi->landing_page, sizeof(gi->landing_page), page, l, 0);
1115 static ssize_t os_desc_use_show(struct config_item *item, char *page)
1117 return sprintf(page, "%d\n",
1121 static ssize_t os_desc_use_store(struct config_item *item, const char *page,
1128 ret = kstrtobool(page, &use);
1139 static ssize_t os_desc_b_vendor_code_show(struct config_item *item, char *page)
1141 return sprintf(page, "0x%02x\n",
1146 const char *page, size_t len)
1152 ret = kstrtou8(page, 0, &b_vendor_code);
1163 static ssize_t os_desc_qw_sign_show(struct config_item *item, char *page)
1169 UTF16_LITTLE_ENDIAN, page, PAGE_SIZE - 1);
1170 page[res++] = '\n';
1175 static ssize_t os_desc_qw_sign_store(struct config_item *item, const char *page,
1182 if (page[l - 1] == '\n')
1186 res = utf8s_to_utf16s(page, l,
1272 static ssize_t ext_prop_type_show(struct config_item *item, char *page)
1274 return sprintf(page, "%d\n", to_usb_os_desc_ext_prop(item)->type);
1278 const char *page, size_t len)
1285 ret = kstrtou8(page, 0, &type);
1316 static ssize_t ext_prop_data_show(struct config_item *item, char *page)
1325 memcpy(page, ext_prop->data, len);
1331 const char *page, size_t len)
1338 if (page[len - 1] == '\n' || page[len - 1] == '\0')
1340 new_data = kmemdup(page, len, GFP_KERNEL);
1451 char *page)
1453 memcpy(page, to_usb_os_desc(item)->ext_compat_id, 8);
1458 const char *page, size_t len)
1464 if (page[l - 1] == '\n')
1468 memcpy(desc->ext_compat_id, page, l);
1477 char *page)
1479 memcpy(page, to_usb_os_desc(item)->ext_compat_id + 8, 8);
1484 const char *page, size_t len)
1490 if (page[l - 1] == '\n')
1494 memcpy(desc->ext_compat_id + 8, page, l);