Lines Matching refs:opts
873 struct f_ecm_opts *opts; in ecm_free_inst() local
875 opts = container_of(f, struct f_ecm_opts, func_inst); in ecm_free_inst()
876 if (opts->bound) in ecm_free_inst()
877 gether_cleanup(netdev_priv(opts->net)); in ecm_free_inst()
879 free_netdev(opts->net); in ecm_free_inst()
880 kfree(opts); in ecm_free_inst()
885 struct f_ecm_opts *opts; in ecm_alloc_inst() local
887 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ecm_alloc_inst()
888 if (!opts) in ecm_alloc_inst()
890 mutex_init(&opts->lock); in ecm_alloc_inst()
891 opts->func_inst.free_func_inst = ecm_free_inst; in ecm_alloc_inst()
892 opts->net = gether_setup_default(); in ecm_alloc_inst()
893 if (IS_ERR(opts->net)) { in ecm_alloc_inst()
894 struct net_device *net = opts->net; in ecm_alloc_inst()
895 kfree(opts); in ecm_alloc_inst()
899 config_group_init_type_name(&opts->func_inst.group, "", &ecm_func_type); in ecm_alloc_inst()
901 return &opts->func_inst; in ecm_alloc_inst()
907 struct f_ecm_opts *opts; in ecm_free() local
910 opts = container_of(f->fi, struct f_ecm_opts, func_inst); in ecm_free()
912 mutex_lock(&opts->lock); in ecm_free()
913 opts->refcnt--; in ecm_free()
914 mutex_unlock(&opts->lock); in ecm_free()
932 struct f_ecm_opts *opts; in ecm_alloc() local
940 opts = container_of(fi, struct f_ecm_opts, func_inst); in ecm_alloc()
941 mutex_lock(&opts->lock); in ecm_alloc()
942 opts->refcnt++; in ecm_alloc()
945 status = gether_get_host_addr_cdc(opts->net, ecm->ethaddr, in ecm_alloc()
949 mutex_unlock(&opts->lock); in ecm_alloc()
954 ecm->port.ioport = netdev_priv(opts->net); in ecm_alloc()
955 mutex_unlock(&opts->lock); in ecm_alloc()