Lines Matching refs:ifr

214 	struct ifreq *ifr;  member
977 struct ifreq *ifr = tun->ifr; in tun_net_init() local
1003 (ifr->ifr_flags & TUN_FEATURES); in tun_net_init()
1006 err = tun_attach(tun, tun->file, false, ifr->ifr_flags & IFF_NAPI, in tun_net_init()
1007 ifr->ifr_flags & IFF_NAPI_FRAGS, false); in tun_net_init()
2716 static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) in tun_set_iff() argument
2726 if ((ifr->ifr_flags & IFF_NAPI_FRAGS)) { in tun_set_iff()
2730 if (!(ifr->ifr_flags & IFF_NAPI) || in tun_set_iff()
2731 (ifr->ifr_flags & TUN_TYPE_MASK) != IFF_TAP) in tun_set_iff()
2735 dev = __dev_get_by_name(net, ifr->ifr_name); in tun_set_iff()
2737 if (ifr->ifr_flags & IFF_TUN_EXCL) in tun_set_iff()
2739 if ((ifr->ifr_flags & IFF_TUN) && dev->netdev_ops == &tun_netdev_ops) in tun_set_iff()
2741 else if ((ifr->ifr_flags & IFF_TAP) && dev->netdev_ops == &tap_netdev_ops) in tun_set_iff()
2746 if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) != in tun_set_iff()
2756 err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER, in tun_set_iff()
2757 ifr->ifr_flags & IFF_NAPI, in tun_set_iff()
2758 ifr->ifr_flags & IFF_NAPI_FRAGS, true); in tun_set_iff()
2772 (ifr->ifr_flags & TUN_FEATURES); in tun_set_iff()
2778 int queues = ifr->ifr_flags & IFF_MULTI_QUEUE ? in tun_set_iff()
2788 if (ifr->ifr_flags & IFF_TUN) { in tun_set_iff()
2792 } else if (ifr->ifr_flags & IFF_TAP) { in tun_set_iff()
2799 if (*ifr->ifr_name) in tun_set_iff()
2800 name = ifr->ifr_name; in tun_set_iff()
2826 tun->ifr = ifr; in tun_set_iff()
2842 if (ifr->ifr_flags & IFF_NO_CARRIER) in tun_set_iff()
2853 strcpy(ifr->ifr_name, tun->dev->name); in tun_set_iff()
2857 static void tun_get_iff(struct tun_struct *tun, struct ifreq *ifr) in tun_get_iff() argument
2859 strcpy(ifr->ifr_name, tun->dev->name); in tun_get_iff()
2861 ifr->ifr_flags = tun_flags(tun); in tun_get_iff()
2949 static int tun_set_queue(struct file *file, struct ifreq *ifr) in tun_set_queue() argument
2957 if (ifr->ifr_flags & IFF_ATTACH_QUEUE) { in tun_set_queue()
2968 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { in tun_set_queue()
3052 struct ifreq ifr; in __tun_chr_ioctl() local
3063 if (copy_from_user(&ifr, argp, ifreq_len)) in __tun_chr_ioctl()
3066 memset(&ifr, 0, sizeof(ifr)); in __tun_chr_ioctl()
3076 return tun_set_queue(file, &ifr); in __tun_chr_ioctl()
3091 ifr.ifr_name[IFNAMSIZ-1] = '\0'; in __tun_chr_ioctl()
3093 ret = tun_set_iff(net, file, &ifr); in __tun_chr_ioctl()
3098 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3126 tun_get_iff(tun, &ifr); in __tun_chr_ioctl()
3129 ifr.ifr_flags |= IFF_DETACH_QUEUE; in __tun_chr_ioctl()
3131 ifr.ifr_flags |= IFF_NOFILTER; in __tun_chr_ioctl()
3133 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3232 dev_get_mac_address(&ifr.ifr_hwaddr, net, tun->dev->name); in __tun_chr_ioctl()
3233 if (copy_to_user(argp, &ifr, ifreq_len)) in __tun_chr_ioctl()
3239 ret = dev_set_mac_address_user(tun->dev, &ifr.ifr_hwaddr, NULL); in __tun_chr_ioctl()
3479 struct ifreq ifr; in tun_chr_show_fdinfo() local
3481 memset(&ifr, 0, sizeof(ifr)); in tun_chr_show_fdinfo()
3486 tun_get_iff(tun, &ifr); in tun_chr_show_fdinfo()
3492 seq_printf(m, "iff:\t%s\n", ifr.ifr_name); in tun_chr_show_fdinfo()