Lines Matching refs:ifr
2665 static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) in tun_set_iff() argument
2675 if ((ifr->ifr_flags & IFF_NAPI_FRAGS)) { in tun_set_iff()
2679 if (!(ifr->ifr_flags & IFF_NAPI) || in tun_set_iff()
2680 (ifr->ifr_flags & TUN_TYPE_MASK) != IFF_TAP) in tun_set_iff()
2684 dev = __dev_get_by_name(net, ifr->ifr_name); in tun_set_iff()
2686 if (ifr->ifr_flags & IFF_TUN_EXCL) in tun_set_iff()
2688 if ((ifr->ifr_flags & IFF_TUN) && dev->netdev_ops == &tun_netdev_ops) in tun_set_iff()
2690 else if ((ifr->ifr_flags & IFF_TAP) && dev->netdev_ops == &tap_netdev_ops) in tun_set_iff()
2695 if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) != in tun_set_iff()
2705 err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER, in tun_set_iff()
2706 ifr->ifr_flags & IFF_NAPI, in tun_set_iff()
2707 ifr->ifr_flags & IFF_NAPI_FRAGS, true); in tun_set_iff()
2721 (ifr->ifr_flags & TUN_FEATURES); in tun_set_iff()
2727 int queues = ifr->ifr_flags & IFF_MULTI_QUEUE ? in tun_set_iff()
2737 if (ifr->ifr_flags & IFF_TUN) { in tun_set_iff()
2741 } else if (ifr->ifr_flags & IFF_TAP) { in tun_set_iff()
2748 if (*ifr->ifr_name) in tun_set_iff()
2749 name = ifr->ifr_name; in tun_set_iff()
2799 (ifr->ifr_flags & TUN_FEATURES); in tun_set_iff()
2802 err = tun_attach(tun, file, false, ifr->ifr_flags & IFF_NAPI, in tun_set_iff()
2803 ifr->ifr_flags & IFF_NAPI_FRAGS, false); in tun_set_iff()
2824 strcpy(ifr->ifr_name, tun->dev->name); in tun_set_iff()
2846 static void tun_get_iff(struct tun_struct *tun, struct ifreq *ifr) in tun_get_iff() argument
2848 strcpy(ifr->ifr_name, tun->dev->name); in tun_get_iff()
2850 ifr->ifr_flags = tun_flags(tun); in tun_get_iff()
2938 static int tun_set_queue(struct file *file, struct ifreq *ifr) in tun_set_queue() argument
2946 if (ifr->ifr_flags & IFF_ATTACH_QUEUE) { in tun_set_queue()
2957 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { in tun_set_queue()
3041 struct ifreq ifr; in __tun_chr_ioctl() local
3052 if (copy_from_user(&ifr, argp, ifreq_len)) in __tun_chr_ioctl()
3055 memset(&ifr, 0, sizeof(ifr)); in __tun_chr_ioctl()
3065 return tun_set_queue(file, &ifr); in __tun_chr_ioctl()
3081 ifr.ifr_name[IFNAMSIZ-1] = '\0'; in __tun_chr_ioctl()
3083 ret = tun_set_iff(net, file, &ifr); in __tun_chr_ioctl()
3088 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3116 tun_get_iff(tun, &ifr); in __tun_chr_ioctl()
3119 ifr.ifr_flags |= IFF_DETACH_QUEUE; in __tun_chr_ioctl()
3121 ifr.ifr_flags |= IFF_NOFILTER; in __tun_chr_ioctl()
3123 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3213 dev_get_mac_address(&ifr.ifr_hwaddr, net, tun->dev->name); in __tun_chr_ioctl()
3214 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3220 ret = dev_set_mac_address_user(tun->dev, &ifr.ifr_hwaddr, NULL); in __tun_chr_ioctl()
3460 struct ifreq ifr; in tun_chr_show_fdinfo() local
3462 memset(&ifr, 0, sizeof(ifr)); in tun_chr_show_fdinfo()
3467 tun_get_iff(tun, &ifr); in tun_chr_show_fdinfo()
3473 seq_printf(m, "iff:\t%s\n", ifr.ifr_name); in tun_chr_show_fdinfo()