/* Get the combination of flag bits exported through APIs to userspace.  */
unsigned dev_get_flags(const struct net_device *dev)
/* Get the combination of flag bits exported through APIs to userspace.  */
unsigned dev_get_flags(const struct net_device *dev)
{
	unsigned flags;
	flags = (dev->flags & ~(IFF_PROMISC |
				IFF_ALLMULTI |
				IFF_RUNNING |
				IFF_LOWER_UP |
				IFF_DORMANT)) |
		(dev->gflags & (IFF_PROMISC |
				IFF_ALLMULTI));
	if (netif_running(dev)) {
		if (netif_oper_up(dev))
			flags |= IFF_RUNNING;
		if (netif_carrier_ok(dev))
			flags |= IFF_LOWER_UP;
		if (netif_dormant(dev))
			flags |= IFF_DORMANT;
	}
	return flags;
}