Lines Matching refs:ifr

214 	struct ifreq *ifr;  member
965 struct ifreq *ifr = tun->ifr; in tun_net_init() local
991 (ifr->ifr_flags & TUN_FEATURES); in tun_net_init()
994 err = tun_attach(tun, tun->file, false, ifr->ifr_flags & IFF_NAPI, in tun_net_init()
995 ifr->ifr_flags & IFF_NAPI_FRAGS, false); in tun_net_init()
2655 static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) in tun_set_iff() argument
2665 if ((ifr->ifr_flags & IFF_NAPI_FRAGS)) { in tun_set_iff()
2669 if (!(ifr->ifr_flags & IFF_NAPI) || in tun_set_iff()
2670 (ifr->ifr_flags & TUN_TYPE_MASK) != IFF_TAP) in tun_set_iff()
2674 dev = __dev_get_by_name(net, ifr->ifr_name); in tun_set_iff()
2676 if (ifr->ifr_flags & IFF_TUN_EXCL) in tun_set_iff()
2678 if ((ifr->ifr_flags & IFF_TUN) && dev->netdev_ops == &tun_netdev_ops) in tun_set_iff()
2680 else if ((ifr->ifr_flags & IFF_TAP) && dev->netdev_ops == &tap_netdev_ops) in tun_set_iff()
2685 if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) != in tun_set_iff()
2695 err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER, in tun_set_iff()
2696 ifr->ifr_flags & IFF_NAPI, in tun_set_iff()
2697 ifr->ifr_flags & IFF_NAPI_FRAGS, true); in tun_set_iff()
2711 (ifr->ifr_flags & TUN_FEATURES); in tun_set_iff()
2717 int queues = ifr->ifr_flags & IFF_MULTI_QUEUE ? in tun_set_iff()
2727 if (ifr->ifr_flags & IFF_TUN) { in tun_set_iff()
2731 } else if (ifr->ifr_flags & IFF_TAP) { in tun_set_iff()
2738 if (*ifr->ifr_name) in tun_set_iff()
2739 name = ifr->ifr_name; in tun_set_iff()
2765 tun->ifr = ifr; in tun_set_iff()
2789 strcpy(ifr->ifr_name, tun->dev->name); in tun_set_iff()
2793 static void tun_get_iff(struct tun_struct *tun, struct ifreq *ifr) in tun_get_iff() argument
2795 strcpy(ifr->ifr_name, tun->dev->name); in tun_get_iff()
2797 ifr->ifr_flags = tun_flags(tun); in tun_get_iff()
2885 static int tun_set_queue(struct file *file, struct ifreq *ifr) in tun_set_queue() argument
2893 if (ifr->ifr_flags & IFF_ATTACH_QUEUE) { in tun_set_queue()
2904 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { in tun_set_queue()
2988 struct ifreq ifr; in __tun_chr_ioctl() local
2999 if (copy_from_user(&ifr, argp, ifreq_len)) in __tun_chr_ioctl()
3002 memset(&ifr, 0, sizeof(ifr)); in __tun_chr_ioctl()
3012 return tun_set_queue(file, &ifr); in __tun_chr_ioctl()
3027 ifr.ifr_name[IFNAMSIZ-1] = '\0'; in __tun_chr_ioctl()
3029 ret = tun_set_iff(net, file, &ifr); in __tun_chr_ioctl()
3034 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3062 tun_get_iff(tun, &ifr); in __tun_chr_ioctl()
3065 ifr.ifr_flags |= IFF_DETACH_QUEUE; in __tun_chr_ioctl()
3067 ifr.ifr_flags |= IFF_NOFILTER; in __tun_chr_ioctl()
3069 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3168 dev_get_mac_address(&ifr.ifr_hwaddr, net, tun->dev->name); in __tun_chr_ioctl()
3169 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3175 ret = dev_set_mac_address_user(tun->dev, &ifr.ifr_hwaddr, NULL); in __tun_chr_ioctl()
3415 struct ifreq ifr; in tun_chr_show_fdinfo() local
3417 memset(&ifr, 0, sizeof(ifr)); in tun_chr_show_fdinfo()
3422 tun_get_iff(tun, &ifr); in tun_chr_show_fdinfo()
3428 seq_printf(m, "iff:\t%s\n", ifr.ifr_name); in tun_chr_show_fdinfo()