usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod){	struct usbnet			*dev;	struct net_device 		*net;	struct usb_host_interface	*interface;	struct driver_info		*info;	struct usb_device		*xdev;	int				status;	info = (struct driver_info *) prod->driver_info;	if (!info) {		dev_dbg (&udev->dev, "blacklisted by %s\n", driver_name);		return -ENODEV;	}	xdev = interface_to_usbdev (udev);	interface = udev->cur_altsetting;	usb_get_dev (xdev);	status = -ENOMEM;	// set up our own records	net = alloc_etherdev(sizeof(*dev));	if (!net) {		dbg ("can't kmalloc dev");		goto out;	}	dev = netdev_priv(net);	dev->udev = xdev;	dev->driver_info = info;	dev->msg_enable = netif_msg_init (msg_level, NETIF_MSG_DRV				| NETIF_MSG_PROBE | NETIF_MSG_LINK);	skb_queue_head_init (&dev->rxq);	skb_queue_head_init (&dev->txq);	skb_queue_head_init (&dev->done);	dev->bh.func = usbnet_bh;	dev->bh.data = (unsigned long) dev;	INIT_WORK (&dev->kevent, kevent, dev);	dev->delay.function = usbnet_bh;	dev->delay.data = (unsigned long) dev;	init_timer (&dev->delay);	SET_MODULE_OWNER (net);	dev->net = net;	strcpy (net->name, "usb%d");	memcpy (net->dev_addr, node_id, sizeof node_id);	dev->hard_mtu = net->mtu + net->hard_header_len;#if 0// dma_supported() is deeply broken on almost all architectures	// possible with some EHCI controllers	if (dma_supported (&udev->dev, DMA_64BIT_MASK))		net->features |= NETIF_F_HIGHDMA;#endif	net->change_mtu = usbnet_change_mtu;	net->get_stats = usbnet_get_stats;	net->hard_start_xmit = usbnet_start_xmit;	net->open = usbnet_open;	net->stop = usbnet_stop;	net->watchdog_timeo = TX_TIMEOUT_JIFFIES;	net->tx_timeout = usbnet_tx_timeout;	net->do_ioctl = usbnet_ioctl;	net->ethtool_ops = &usbnet_ethtool_ops;	// allow device-specific bind/init procedures	// NOTE net->name still not usable ...	if (info->bind) {		status = info->bind (dev, udev);		// heuristic:  "usb%d" for links we know are two-host,		// else "eth%d" when there's reasonable doubt.  userspace		// can rename the link if it knows better.		if ((dev->driver_info->flags & FLAG_ETHER) != 0				&& (net->dev_addr [0] & 0x02) == 0)			strcpy (net->name, "eth%d");		/* maybe the remote can't receive an Ethernet MTU */		if (net->mtu > (dev->hard_mtu - net->hard_header_len))			net->mtu = dev->hard_mtu - net->hard_header_len;	} else if (!info->in || info->out)		status = get_endpoints (dev, udev);	else {		dev->in = usb_rcvbulkpipe (xdev, info->in);		dev->out = usb_sndbulkpipe (xdev, info->out);		if (!(info->flags & FLAG_NO_SETINT))			status = usb_set_interface (xdev,				interface->desc.bInterfaceNumber,				interface->desc.bAlternateSetting);		else			status = 0;	}	if (status == 0 && dev->status)		status = init_status (dev, udev);	if (status < 0)		goto out1;	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);		SET_NETDEV_DEV(net, &udev->dev);	status = register_netdev (net);	if (status)		goto out3;	if (netif_msg_probe (dev))		devinfo (dev, "register '%s' at usb-%s-%s, %s, "				"%02x:%02x:%02x:%02x:%02x:%02x",			udev->dev.driver->name,			xdev->bus->bus_name, xdev->devpath,			dev->driver_info->description,			net->dev_addr [0], net->dev_addr [1],			net->dev_addr [2], net->dev_addr [3],			net->dev_addr [4], net->dev_addr [5]);	// ok, it's ready to go.	usb_set_intfdata (udev, dev);	// start as if the link is up	netif_device_attach (net);	return 0;out3:	if (info->unbind)		info->unbind (dev, udev);out1:	free_netdev(net);out:	usb_put_dev(xdev);	return status;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2e55cc7210fef90f88201e860d8767594974574e/usbnet.c/buggy/drivers/usb/net/usbnet.c