Lines Matching refs:opts
844 struct f_ecm_opts *opts; in ecm_free_inst() local
846 opts = container_of(f, struct f_ecm_opts, func_inst); in ecm_free_inst()
847 if (opts->bound) in ecm_free_inst()
848 gether_cleanup(netdev_priv(opts->net)); in ecm_free_inst()
850 free_netdev(opts->net); in ecm_free_inst()
851 kfree(opts); in ecm_free_inst()
856 struct f_ecm_opts *opts; in ecm_alloc_inst() local
858 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ecm_alloc_inst()
859 if (!opts) in ecm_alloc_inst()
861 mutex_init(&opts->lock); in ecm_alloc_inst()
862 opts->func_inst.free_func_inst = ecm_free_inst; in ecm_alloc_inst()
863 opts->net = gether_setup_default(); in ecm_alloc_inst()
864 if (IS_ERR(opts->net)) { in ecm_alloc_inst()
865 struct net_device *net = opts->net; in ecm_alloc_inst()
866 kfree(opts); in ecm_alloc_inst()
870 config_group_init_type_name(&opts->func_inst.group, "", &ecm_func_type); in ecm_alloc_inst()
872 return &opts->func_inst; in ecm_alloc_inst()
904 struct f_ecm_opts *opts; in ecm_free() local
907 opts = container_of(f->fi, struct f_ecm_opts, func_inst); in ecm_free()
909 mutex_lock(&opts->lock); in ecm_free()
910 opts->refcnt--; in ecm_free()
911 mutex_unlock(&opts->lock); in ecm_free()
934 struct f_ecm_opts *opts; in ecm_alloc() local
942 opts = container_of(fi, struct f_ecm_opts, func_inst); in ecm_alloc()
943 mutex_lock(&opts->lock); in ecm_alloc()
944 opts->refcnt++; in ecm_alloc()
947 status = gether_get_host_addr_cdc(opts->net, ecm->ethaddr, in ecm_alloc()
951 mutex_unlock(&opts->lock); in ecm_alloc()
955 ecm->port.ioport = netdev_priv(opts->net); in ecm_alloc()
956 mutex_unlock(&opts->lock); in ecm_alloc()