Lines Matching refs:unit

272 static struct ppp *ppp_create_interface(struct net *net, int unit,
276 static struct ppp *ppp_find_unit(struct ppp_net *pn, int unit);
277 static struct channel *ppp_find_channel(struct ppp_net *pn, int unit);
278 static int ppp_connect_channel(struct channel *pch, int unit);
575 int unit, cflags; in ppp_ioctl() local
626 if (get_user(unit, p)) in ppp_ioctl()
628 err = ppp_connect_channel(pch, unit); in ppp_ioctl()
837 int unit, err = -EFAULT; in ppp_unattached_ioctl() local
846 if (get_user(unit, p)) in ppp_unattached_ioctl()
848 ppp = ppp_create_interface(net, unit, file, &err); in ppp_unattached_ioctl()
860 if (get_user(unit, p)) in ppp_unattached_ioctl()
865 ppp = ppp_find_unit(pn, unit); in ppp_unattached_ioctl()
875 if (get_user(unit, p)) in ppp_unattached_ioctl()
880 chan = ppp_find_channel(pn, unit); in ppp_unattached_ioctl()
2334 int unit = -1; in ppp_unit_number() local
2339 unit = pch->ppp->file.index; in ppp_unit_number()
2342 return unit; in ppp_unit_number()
2719 static struct ppp *ppp_create_interface(struct net *net, int unit, in ppp_create_interface() argument
2764 if (unit < 0) { in ppp_create_interface()
2765 unit = unit_get(&pn->units_idr, ppp); in ppp_create_interface()
2766 if (unit < 0) { in ppp_create_interface()
2767 ret = unit; in ppp_create_interface()
2772 if (unit_find(&pn->units_idr, unit)) in ppp_create_interface()
2783 unit = unit_set(&pn->units_idr, ppp, unit); in ppp_create_interface()
2784 if (unit < 0) in ppp_create_interface()
2789 ppp->file.index = unit; in ppp_create_interface()
2790 sprintf(dev->name, "ppp%d", unit); in ppp_create_interface()
2794 unit_put(&pn->units_idr, unit); in ppp_create_interface()
2880 ppp_find_unit(struct ppp_net *pn, int unit) in ppp_find_unit() argument
2882 return unit_find(&pn->units_idr, unit); in ppp_find_unit()
2894 ppp_find_channel(struct ppp_net *pn, int unit) in ppp_find_channel() argument
2899 if (pch->file.index == unit) { in ppp_find_channel()
2906 if (pch->file.index == unit) in ppp_find_channel()
2917 ppp_connect_channel(struct channel *pch, int unit) in ppp_connect_channel() argument
2927 ppp = ppp_find_unit(pn, unit); in ppp_connect_channel()
3018 int unit; in unit_set() local
3020 unit = idr_alloc(p, ptr, n, n + 1, GFP_KERNEL); in unit_set()
3021 if (unit == -ENOSPC) in unit_set()
3022 unit = -EINVAL; in unit_set()
3023 return unit; in unit_set()