Lines Matching refs:ifr

24 static int dev_ifname(struct net *net, struct ifreq *ifr)  in dev_ifname()  argument
26 ifr->ifr_name[IFNAMSIZ-1] = 0; in dev_ifname()
27 return netdev_get_name(net, ifr->ifr_name, ifr->ifr_ifindex); in dev_ifname()
82 static int dev_getifmap(struct net_device *dev, struct ifreq *ifr) in dev_getifmap() argument
84 struct ifmap *ifmap = &ifr->ifr_map; in dev_getifmap()
109 static int dev_setifmap(struct net_device *dev, struct ifreq *ifr) in dev_setifmap() argument
111 struct compat_ifmap *cifmap = (struct compat_ifmap *)&ifr->ifr_map; in dev_setifmap()
129 return dev->netdev_ops->ndo_set_config(dev, &ifr->ifr_map); in dev_setifmap()
135 static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cmd) in dev_ifsioc_locked() argument
138 struct net_device *dev = dev_get_by_name_rcu(net, ifr->ifr_name); in dev_ifsioc_locked()
145 ifr->ifr_flags = (short) dev_get_flags(dev); in dev_ifsioc_locked()
150 ifr->ifr_metric = 0; in dev_ifsioc_locked()
154 ifr->ifr_mtu = dev->mtu; in dev_ifsioc_locked()
162 return dev_getifmap(dev, ifr); in dev_ifsioc_locked()
165 ifr->ifr_ifindex = dev->ifindex; in dev_ifsioc_locked()
169 ifr->ifr_qlen = dev->tx_queue_len; in dev_ifsioc_locked()
184 static int net_hwtstamp_validate(struct ifreq *ifr) in net_hwtstamp_validate() argument
192 if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg))) in net_hwtstamp_validate()
244 struct ifreq *ifr, unsigned int cmd) in dev_eth_ioctl() argument
249 err = dsa_ndo_eth_ioctl(dev, ifr, cmd); in dev_eth_ioctl()
255 err = ops->ndo_eth_ioctl(dev, ifr, cmd); in dev_eth_ioctl()
264 struct ifreq *ifr, unsigned int cmd) in dev_siocbond() argument
270 return ops->ndo_siocbond(dev, ifr, cmd); in dev_siocbond()
278 static int dev_siocdevprivate(struct net_device *dev, struct ifreq *ifr, in dev_siocdevprivate() argument
285 return ops->ndo_siocdevprivate(dev, ifr, data, cmd); in dev_siocdevprivate()
310 static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data, in dev_ifsioc() argument
314 struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name); in dev_ifsioc()
324 return dev_change_flags(dev, ifr->ifr_flags, NULL); in dev_ifsioc()
331 return dev_set_mtu(dev, ifr->ifr_mtu); in dev_ifsioc()
336 return dev_set_mac_address_user(dev, &ifr->ifr_hwaddr, NULL); in dev_ifsioc()
339 if (ifr->ifr_hwaddr.sa_family != dev->type) in dev_ifsioc()
341 memcpy(dev->broadcast, ifr->ifr_hwaddr.sa_data, in dev_ifsioc()
342 min(sizeof(ifr->ifr_hwaddr.sa_data), in dev_ifsioc()
348 return dev_setifmap(dev, ifr); in dev_ifsioc()
352 ifr->ifr_hwaddr.sa_family != AF_UNSPEC) in dev_ifsioc()
356 return dev_mc_add_global(dev, ifr->ifr_hwaddr.sa_data); in dev_ifsioc()
360 ifr->ifr_hwaddr.sa_family != AF_UNSPEC) in dev_ifsioc()
364 return dev_mc_del_global(dev, ifr->ifr_hwaddr.sa_data); in dev_ifsioc()
367 if (ifr->ifr_qlen < 0) in dev_ifsioc()
369 return dev_change_tx_queue_len(dev, ifr->ifr_qlen); in dev_ifsioc()
372 ifr->ifr_newname[IFNAMSIZ-1] = '\0'; in dev_ifsioc()
373 return dev_change_name(dev, ifr->ifr_newname); in dev_ifsioc()
376 return dev_siocwandev(dev, &ifr->ifr_settings); in dev_ifsioc()
386 err = br_ioctl_call(net, netdev_priv(dev), cmd, ifr, NULL); in dev_ifsioc()
392 err = net_hwtstamp_validate(ifr); in dev_ifsioc()
403 return dev_siocdevprivate(dev, ifr, data, cmd); in dev_ifsioc()
410 err = dev_eth_ioctl(dev, ifr, cmd); in dev_ifsioc()
417 err = dev_siocbond(dev, ifr, cmd); in dev_ifsioc()
470 int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr, in dev_ioctl() argument
479 return dev_ifname(net, ifr); in dev_ioctl()
481 ifr->ifr_name[IFNAMSIZ-1] = 0; in dev_ioctl()
483 colon = strchr(ifr->ifr_name, ':'); in dev_ioctl()
493 dev_load(net, ifr->ifr_name); in dev_ioctl()
494 ret = dev_get_mac_address(&ifr->ifr_hwaddr, net, ifr->ifr_name); in dev_ioctl()
511 dev_load(net, ifr->ifr_name); in dev_ioctl()
513 ret = dev_ifsioc_locked(net, ifr, cmd); in dev_ioctl()
520 dev_load(net, ifr->ifr_name); in dev_ioctl()
521 ret = dev_ethtool(net, ifr, data); in dev_ioctl()
535 dev_load(net, ifr->ifr_name); in dev_ioctl()
539 ret = dev_ifsioc(net, ifr, data, cmd); in dev_ioctl()
583 dev_load(net, ifr->ifr_name); in dev_ioctl()
585 ret = dev_ifsioc(net, ifr, data, cmd); in dev_ioctl()
608 dev_load(net, ifr->ifr_name); in dev_ioctl()
610 ret = dev_ifsioc(net, ifr, data, cmd); in dev_ioctl()