/usr/src/linux-headers-5.15.0-181/include/linux/usb
NameSizeModeActions
audio-v2.h143560644editdlrm
audio-v3.h142700644editdlrm
audio.h12610644editdlrm
c67x00.h18670644editdlrm
ccid.h7870644editdlrm
cdc-wdm.h7010644editdlrm
cdc.h15170644editdlrm
cdc_ncm.h59780644editdlrm
ch9.h23420644editdlrm
chipidea.h35120644editdlrm
composite.h261720644editdlrm
ehci-dbgp.h20990644editdlrm
ehci_def.h82770644editdlrm
ehci_pdriver.h23950644editdlrm
ezusb.h2860644editdlrm
functionfs.h1510644editdlrm
gadget.h375430644editdlrm
gadget_configfs.h30140644editdlrm
g_hid.h11580644editdlrm
hcd.h283430644editdlrm
input.h7160644editdlrm
iowarrior.h13740644editdlrm
irda.h38530644editdlrm
isp116x.h11600644editdlrm
isp1301.h24330644editdlrm
isp1362.h16280644editdlrm
m66592.h14440644editdlrm
musb-ux500.h8990644editdlrm
musb.h36000644editdlrm
net2280.h241200644editdlrm
of.h18590644editdlrm
ohci_pdriver.h17480644editdlrm
otg-fsm.h88230644editdlrm
otg.h31580644editdlrm
pd.h152540644editdlrm
pd_ado.h11910644editdlrm
pd_bdo.h5550644editdlrm
pd_ext_sdb.h6980644editdlrm
pd_vdo.h165540644editdlrm
phy.h84350644editdlrm
phy_companion.h11970644editdlrm
quirks.h24030644editdlrm
r8a66597.h180690644editdlrm
r8152.h10670644editdlrm
renesas_usbhs.h43030644editdlrm
rndis_host.h60800644editdlrm
role.h36630644editdlrm
serial.h175960644editdlrm
sl811.h8380644editdlrm
storage.h26450644editdlrm
tcpci.h68830644editdlrm
tcpm.h66140644editdlrm
tegra_usb_phy.h25860644editdlrm
typec.h95900644editdlrm
typec_altmode.h66390644editdlrm
typec_dp.h39980644editdlrm
typec_mux.h21150644editdlrm
typec_tbt.h17740644editdlrm
uas.h21210644editdlrm
ulpi.h23190644editdlrm
usb338x.h79770644editdlrm
usbnet.h108250644editdlrm
usb_phy_generic.h5820644editdlrm
xhci-dbgp.h8250644editdlrm
Edit: /usr/src/linux-headers-5.15.0-181/include/linux/usb/gadget_configfs.h (3014B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __GADGET_CONFIGFS__ #define __GADGET_CONFIGFS__ #include int check_user_usb_string(const char *name, struct usb_gadget_strings *stringtab_dev); #define GS_STRINGS_W(__struct, __name) \ static ssize_t __struct##_##__name##_store(struct config_item *item, \ const char *page, size_t len) \ { \ struct __struct *gs = to_##__struct(item); \ int ret; \ \ ret = usb_string_copy(page, &gs->__name); \ if (ret) \ return ret; \ return len; \ } #define GS_STRINGS_R(__struct, __name) \ static ssize_t __struct##_##__name##_show(struct config_item *item, char *page) \ { \ struct __struct *gs = to_##__struct(item); \ return sprintf(page, "%s\n", gs->__name ?: ""); \ } #define GS_STRINGS_RW(struct_name, _name) \ GS_STRINGS_R(struct_name, _name) \ GS_STRINGS_W(struct_name, _name) \ CONFIGFS_ATTR(struct_name##_, _name) #define USB_CONFIG_STRING_RW_OPS(struct_in) \ static struct configfs_item_operations struct_in##_langid_item_ops = { \ .release = struct_in##_attr_release, \ }; \ \ static struct config_item_type struct_in##_langid_type = { \ .ct_item_ops = &struct_in##_langid_item_ops, \ .ct_attrs = struct_in##_langid_attrs, \ .ct_owner = THIS_MODULE, \ } #define USB_CONFIG_STRINGS_LANG(struct_in, struct_member) \ static struct config_group *struct_in##_strings_make( \ struct config_group *group, \ const char *name) \ { \ struct struct_member *gi; \ struct struct_in *gs; \ struct struct_in *new; \ int langs = 0; \ int ret; \ \ new = kzalloc(sizeof(*new), GFP_KERNEL); \ if (!new) \ return ERR_PTR(-ENOMEM); \ \ ret = check_user_usb_string(name, &new->stringtab_dev); \ if (ret) \ goto err; \ config_group_init_type_name(&new->group, name, \ &struct_in##_langid_type); \ \ gi = container_of(group, struct struct_member, strings_group); \ ret = -EEXIST; \ list_for_each_entry(gs, &gi->string_list, list) { \ if (gs->stringtab_dev.language == new->stringtab_dev.language) \ goto err; \ langs++; \ } \ ret = -EOVERFLOW; \ if (langs >= MAX_USB_STRING_LANGS) \ goto err; \ \ list_add_tail(&new->list, &gi->string_list); \ return &new->group; \ err: \ kfree(new); \ return ERR_PTR(ret); \ } \ \ static void struct_in##_strings_drop( \ struct config_group *group, \ struct config_item *item) \ { \ config_item_put(item); \ } \ \ static struct configfs_group_operations struct_in##_strings_ops = { \ .make_group = &struct_in##_strings_make, \ .drop_item = &struct_in##_strings_drop, \ }; \ \ static struct config_item_type struct_in##_strings_type = { \ .ct_group_ops = &struct_in##_strings_ops, \ .ct_owner = THIS_MODULE, \ } #endif