Lines Matching refs:opts
861 struct f_ecm_opts *opts; in ecm_free_inst() local
863 opts = container_of(f, struct f_ecm_opts, func_inst); in ecm_free_inst()
864 if (opts->bound) in ecm_free_inst()
865 gether_cleanup(netdev_priv(opts->net)); in ecm_free_inst()
867 free_netdev(opts->net); in ecm_free_inst()
868 kfree(opts); in ecm_free_inst()
873 struct f_ecm_opts *opts; in ecm_alloc_inst() local
875 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ecm_alloc_inst()
876 if (!opts) in ecm_alloc_inst()
878 mutex_init(&opts->lock); in ecm_alloc_inst()
879 opts->func_inst.free_func_inst = ecm_free_inst; in ecm_alloc_inst()
880 opts->net = gether_setup_default(); in ecm_alloc_inst()
881 if (IS_ERR(opts->net)) { in ecm_alloc_inst()
882 struct net_device *net = opts->net; in ecm_alloc_inst()
883 kfree(opts); in ecm_alloc_inst()
887 config_group_init_type_name(&opts->func_inst.group, "", &ecm_func_type); in ecm_alloc_inst()
889 return &opts->func_inst; in ecm_alloc_inst()
895 struct f_ecm_opts *opts; in ecm_free() local
898 opts = container_of(f->fi, struct f_ecm_opts, func_inst); in ecm_free()
900 mutex_lock(&opts->lock); in ecm_free()
901 opts->refcnt--; in ecm_free()
902 mutex_unlock(&opts->lock); in ecm_free()
925 struct f_ecm_opts *opts; in ecm_alloc() local
933 opts = container_of(fi, struct f_ecm_opts, func_inst); in ecm_alloc()
934 mutex_lock(&opts->lock); in ecm_alloc()
935 opts->refcnt++; in ecm_alloc()
938 status = gether_get_host_addr_cdc(opts->net, ecm->ethaddr, in ecm_alloc()
942 mutex_unlock(&opts->lock); in ecm_alloc()
946 ecm->port.ioport = netdev_priv(opts->net); in ecm_alloc()
947 mutex_unlock(&opts->lock); in ecm_alloc()