Lines Matching refs:ifr
26 static int dev_ifname(struct net *net, struct ifreq *ifr) in dev_ifname() argument
28 ifr->ifr_name[IFNAMSIZ-1] = 0; in dev_ifname()
29 return netdev_get_name(net, ifr->ifr_name, ifr->ifr_ifindex); in dev_ifname()
84 static int dev_getifmap(struct net_device *dev, struct ifreq *ifr) in dev_getifmap() argument
86 struct ifmap *ifmap = &ifr->ifr_map; in dev_getifmap()
111 static int dev_setifmap(struct net_device *dev, struct ifreq *ifr) in dev_setifmap() argument
113 struct compat_ifmap *cifmap = (struct compat_ifmap *)&ifr->ifr_map; in dev_setifmap()
131 return dev->netdev_ops->ndo_set_config(dev, &ifr->ifr_map); in dev_setifmap()
137 static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cmd) in dev_ifsioc_locked() argument
140 struct net_device *dev = dev_get_by_name_rcu(net, ifr->ifr_name); in dev_ifsioc_locked()
147 ifr->ifr_flags = (short) dev_get_flags(dev); in dev_ifsioc_locked()
152 ifr->ifr_metric = 0; in dev_ifsioc_locked()
156 ifr->ifr_mtu = dev->mtu; in dev_ifsioc_locked()
164 return dev_getifmap(dev, ifr); in dev_ifsioc_locked()
167 ifr->ifr_ifindex = dev->ifindex; in dev_ifsioc_locked()
171 ifr->ifr_qlen = dev->tx_queue_len; in dev_ifsioc_locked()
186 static int net_hwtstamp_validate(struct ifreq *ifr) in net_hwtstamp_validate() argument
194 if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg))) in net_hwtstamp_validate()
246 struct ifreq *ifr, unsigned int cmd) in dev_eth_ioctl() argument
251 err = dsa_ndo_eth_ioctl(dev, ifr, cmd); in dev_eth_ioctl()
257 err = ops->ndo_eth_ioctl(dev, ifr, cmd); in dev_eth_ioctl()
266 struct ifreq *ifr, unsigned int cmd) in dev_siocbond() argument
272 return ops->ndo_siocbond(dev, ifr, cmd); in dev_siocbond()
280 static int dev_siocdevprivate(struct net_device *dev, struct ifreq *ifr, in dev_siocdevprivate() argument
287 return ops->ndo_siocdevprivate(dev, ifr, data, cmd); in dev_siocdevprivate()
312 static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data, in dev_ifsioc() argument
316 struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name); in dev_ifsioc()
327 return dev_change_flags(dev, ifr->ifr_flags, NULL); in dev_ifsioc()
334 return dev_set_mtu(dev, ifr->ifr_mtu); in dev_ifsioc()
339 return dev_set_mac_address_user(dev, &ifr->ifr_hwaddr, NULL); in dev_ifsioc()
342 if (ifr->ifr_hwaddr.sa_family != dev->type) in dev_ifsioc()
344 memcpy(dev->broadcast, ifr->ifr_hwaddr.sa_data, in dev_ifsioc()
345 min(sizeof(ifr->ifr_hwaddr.sa_data), in dev_ifsioc()
351 return dev_setifmap(dev, ifr); in dev_ifsioc()
355 ifr->ifr_hwaddr.sa_family != AF_UNSPEC) in dev_ifsioc()
359 return dev_mc_add_global(dev, ifr->ifr_hwaddr.sa_data); in dev_ifsioc()
363 ifr->ifr_hwaddr.sa_family != AF_UNSPEC) in dev_ifsioc()
367 return dev_mc_del_global(dev, ifr->ifr_hwaddr.sa_data); in dev_ifsioc()
370 if (ifr->ifr_qlen < 0) in dev_ifsioc()
372 return dev_change_tx_queue_len(dev, ifr->ifr_qlen); in dev_ifsioc()
375 ifr->ifr_newname[IFNAMSIZ-1] = '\0'; in dev_ifsioc()
376 return dev_change_name(dev, ifr->ifr_newname); in dev_ifsioc()
379 return dev_siocwandev(dev, &ifr->ifr_settings); in dev_ifsioc()
389 err = br_ioctl_call(net, netdev_priv(dev), cmd, ifr, NULL); in dev_ifsioc()
395 err = net_hwtstamp_validate(ifr); in dev_ifsioc()
406 return dev_siocdevprivate(dev, ifr, data, cmd); in dev_ifsioc()
413 err = dev_eth_ioctl(dev, ifr, cmd); in dev_ifsioc()
420 err = dev_siocbond(dev, ifr, cmd); in dev_ifsioc()
473 int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr, in dev_ioctl() argument
482 return dev_ifname(net, ifr); in dev_ioctl()
484 ifr->ifr_name[IFNAMSIZ-1] = 0; in dev_ioctl()
486 colon = strchr(ifr->ifr_name, ':'); in dev_ioctl()
496 dev_load(net, ifr->ifr_name); in dev_ioctl()
497 ret = dev_get_mac_address(&ifr->ifr_hwaddr, net, ifr->ifr_name); in dev_ioctl()
514 dev_load(net, ifr->ifr_name); in dev_ioctl()
516 ret = dev_ifsioc_locked(net, ifr, cmd); in dev_ioctl()
523 dev_load(net, ifr->ifr_name); in dev_ioctl()
524 ret = dev_ethtool(net, ifr, data); in dev_ioctl()
538 dev_load(net, ifr->ifr_name); in dev_ioctl()
542 ret = dev_ifsioc(net, ifr, data, cmd); in dev_ioctl()
586 dev_load(net, ifr->ifr_name); in dev_ioctl()
588 ret = dev_ifsioc(net, ifr, data, cmd); in dev_ioctl()
611 dev_load(net, ifr->ifr_name); in dev_ioctl()
613 ret = dev_ifsioc(net, ifr, data, cmd); in dev_ioctl()