> > > >>> > >>> Andrzej, would you tell us why you introduce refcnt for driver's > >>> configfs opts? And why it is needed to judge for "store" operation? > >>> > >> > >> The reason is that a function can be linked to more than one > >> configuration. Imagine this sequence: you create a function, set its > >> parameters and then create a configuration. Then you declare "I want > >> this function in my configuration". You can decide that you want that > >> particular function instance because you already know how it is > >> configured and are fine with that state. Think of it as a contract between the > function and the configuration. > >> > >> Now, suppose some other configuration is created and in that > >> configuration a similar function is needed. The creator of that other > >> configuration might be tempted to modify the existing and already > >> used function (linked to a configuration), thus breaking the contract between the > function and the first configuration. > > > > Thanks, Andrzej. > > > > But we designed "store" entry for function drivers, we can't use it now. > > Is it possible let the parameters per function device instead of function driver? > > Or like module parameters, let the user change one time at least. > > > > Can you please describe your use case? > > Andrzej I would like to change parameters for function driver through configfs, below is the example for ncm and f_sourcesink cases, thanks. if [ "$FUNC" == "ncm" ]; then mkdir functions/$FUNC".0" ln -s functions/$FUNC".0" configs/c.1 echo 10 > functions/ncm.0/qmult echo "12:a5:cf:42:92:fd" > functions/ncm.0/host_addr echo "5e:bc:ca:27:92:b1" > functions/ncm.0/dev_addr fi if [ "$FUNC" == "ss" ]; then cd /sys/kernel/config/usb_gadget cd g1 echo "0x0525" > idVendor echo "0xa4a0" > idProduct export FUNC="SourceSink" mkdir functions/$FUNC".0" ln -s functions/$FUNC".0" configs/c.1 cd functions/$FUNC".0" echo 1 > pattern echo 1 > isoc_interval echo 1024 > isoc_maxpacket echo 2 > isoc_mult #isoc_maxburst echo 1024 > bulk_buflen echo 16 > bulk_qlen echo 16 > iso_qlen fi Peter