Lines Matching refs:opts

824 	struct f_rndis_opts *opts;
826 opts = container_of(f, struct f_rndis_opts, func_inst);
827 if (opts->bound)
828 gether_cleanup(netdev_priv(opts->net));
830 free_netdev(opts->net);
831 opts->borrowed_net = opts->bound = true;
832 opts->net = net;
885 struct f_rndis_opts *opts;
887 opts = container_of(f, struct f_rndis_opts, func_inst);
888 if (!opts->borrowed_net) {
889 if (opts->bound)
890 gether_cleanup(netdev_priv(opts->net));
892 free_netdev(opts->net);
895 kfree(opts->rndis_interf_group); /* single VLA chunk */
896 kfree(opts);
901 struct f_rndis_opts *opts;
906 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
907 if (!opts)
909 opts->rndis_os_desc.ext_compat_id = opts->rndis_ext_compat_id;
911 mutex_init(&opts->lock);
912 opts->func_inst.free_func_inst = rndis_free_inst;
913 opts->net = gether_setup_default();
914 if (IS_ERR(opts->net)) {
915 struct net_device *net = opts->net;
916 kfree(opts);
919 INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop);
921 opts->class = rndis_iad_descriptor.bFunctionClass;
922 opts->subclass = rndis_iad_descriptor.bFunctionSubClass;
923 opts->protocol = rndis_iad_descriptor.bFunctionProtocol;
925 descs[0] = &opts->rndis_os_desc;
927 config_group_init_type_name(&opts->func_inst.group, "",
930 usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
933 rndis_free_inst(&opts->func_inst);
936 opts->rndis_interf_group = rndis_interf_group;
938 return &opts->func_inst;
944 struct f_rndis_opts *opts;
948 opts = container_of(f->fi, struct f_rndis_opts, func_inst);
950 mutex_lock(&opts->lock);
951 opts->refcnt--;
952 mutex_unlock(&opts->lock);
970 struct f_rndis_opts *opts;
978 opts = container_of(fi, struct f_rndis_opts, func_inst);
979 mutex_lock(&opts->lock);
980 opts->refcnt++;
982 gether_get_host_addr_u8(opts->net, rndis->ethaddr);
983 rndis->vendorID = opts->vendor_id;
984 rndis->manufacturer = opts->manufacturer;
986 rndis->port.ioport = netdev_priv(opts->net);
987 mutex_unlock(&opts->lock);