Lines Matching refs:opts
856 struct f_ecm_opts *opts; in ecm_free_inst() local
858 opts = container_of(f, struct f_ecm_opts, func_inst); in ecm_free_inst()
859 if (opts->bound) in ecm_free_inst()
860 gether_cleanup(netdev_priv(opts->net)); in ecm_free_inst()
862 free_netdev(opts->net); in ecm_free_inst()
863 kfree(opts); in ecm_free_inst()
868 struct f_ecm_opts *opts; in ecm_alloc_inst() local
870 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ecm_alloc_inst()
871 if (!opts) in ecm_alloc_inst()
873 mutex_init(&opts->lock); in ecm_alloc_inst()
874 opts->func_inst.free_func_inst = ecm_free_inst; in ecm_alloc_inst()
875 opts->net = gether_setup_default(); in ecm_alloc_inst()
876 if (IS_ERR(opts->net)) { in ecm_alloc_inst()
877 struct net_device *net = opts->net; in ecm_alloc_inst()
878 kfree(opts); in ecm_alloc_inst()
882 config_group_init_type_name(&opts->func_inst.group, "", &ecm_func_type); in ecm_alloc_inst()
884 return &opts->func_inst; in ecm_alloc_inst()
890 struct f_ecm_opts *opts; in ecm_free() local
893 opts = container_of(f->fi, struct f_ecm_opts, func_inst); in ecm_free()
895 mutex_lock(&opts->lock); in ecm_free()
896 opts->refcnt--; in ecm_free()
897 mutex_unlock(&opts->lock); in ecm_free()
915 struct f_ecm_opts *opts; in ecm_alloc() local
923 opts = container_of(fi, struct f_ecm_opts, func_inst); in ecm_alloc()
924 mutex_lock(&opts->lock); in ecm_alloc()
925 opts->refcnt++; in ecm_alloc()
928 status = gether_get_host_addr_cdc(opts->net, ecm->ethaddr, in ecm_alloc()
932 mutex_unlock(&opts->lock); in ecm_alloc()
937 ecm->port.ioport = netdev_priv(opts->net); in ecm_alloc()
938 mutex_unlock(&opts->lock); in ecm_alloc()