npinfo->rx_flags = 0; 
int netpoll_setup(struct netpoll *np){	struct net_device *ndev = NULL;	struct in_device *in_dev;	struct netpoll_info *npinfo;	unsigned long flags;	if (np->dev_name)		ndev = dev_get_by_name(np->dev_name);	if (!ndev) {		printk(KERN_ERR "%s: %s doesn't exist, aborting.\n",		       np->name, np->dev_name);		return -1;	}	np->dev = ndev;	if (!ndev->npinfo) {		npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);		if (!npinfo)			goto release;		npinfo->rx_np = NULL;		npinfo->poll_lock = SPIN_LOCK_UNLOCKED;		npinfo->poll_owner = -1;		npinfo->rx_lock = SPIN_LOCK_UNLOCKED;	} else		npinfo = ndev->npinfo;	if (!ndev->poll_controller) {		printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",		       np->name, np->dev_name);		goto release;	}	if (!netif_running(ndev)) {		unsigned long atmost, atleast;		printk(KERN_INFO "%s: device %s not up yet, forcing it\n",		       np->name, np->dev_name);		rtnl_shlock();		if (dev_change_flags(ndev, ndev->flags | IFF_UP) < 0) {			printk(KERN_ERR "%s: failed to open %s\n",			       np->name, np->dev_name);			rtnl_shunlock();			goto release;		}		rtnl_shunlock();		atleast = jiffies + HZ/10; 		atmost = jiffies + 4*HZ;		while (!netif_carrier_ok(ndev)) {			if (time_after(jiffies, atmost)) {				printk(KERN_NOTICE				       "%s: timeout waiting for carrier\n",				       np->name);				break;			}			cond_resched();		}		/* If carrier appears to come up instantly, we don't		 * trust it and pause so that we don't pump all our		 * queued console messages into the bitbucket.		 */		if (time_before(jiffies, atleast)) {			printk(KERN_NOTICE "%s: carrier detect appears"			       " untrustworthy, waiting 4 seconds\n",			       np->name);			msleep(4000);		}	}	if (!memcmp(np->local_mac, "\0\0\0\0\0\0", 6) && ndev->dev_addr)		memcpy(np->local_mac, ndev->dev_addr, 6);	if (!np->local_ip) {		rcu_read_lock();		in_dev = __in_dev_get(ndev);		if (!in_dev || !in_dev->ifa_list) {			rcu_read_unlock();			printk(KERN_ERR "%s: no IP address for %s, aborting\n",			       np->name, np->dev_name);			goto release;		}		np->local_ip = ntohl(in_dev->ifa_list->ifa_local);		rcu_read_unlock();		printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n",		       np->name, HIPQUAD(np->local_ip));	}	if (np->rx_hook) {		spin_lock_irqsave(&npinfo->rx_lock, flags);		npinfo->rx_flags |= NETPOLL_RX_ENABLED;		npinfo->rx_np = np;		spin_unlock_irqrestore(&npinfo->rx_lock, flags);	}	/* last thing to do is link it to the net device structure */	ndev->npinfo = npinfo;	return 0; release:	if (!ndev->npinfo)		kfree(npinfo);	np->dev = NULL;	dev_put(ndev);	return -1;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/11513128bb66b0b09d5d0df069b58afdb01752a2/netpoll.c/clean/net/core/netpoll.c