defer_kevent (dev, EVENT_TX_HALT); 
usbnet_defer_kevent (dev, EVENT_TX_HALT); 
static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net){	struct usbnet		*dev = netdev_priv(net);	int			length;	int			retval = NET_XMIT_SUCCESS;	struct urb		*urb = NULL;	struct skb_data		*entry;	struct driver_info	*info = dev->driver_info;	unsigned long		flags;#ifdef	CONFIG_USB_NET1080	struct nc_header	*header = NULL;	struct nc_trailer	*trailer = NULL;#endif	/* CONFIG_USB_NET1080 */	// some devices want funky USB-level framing, for	// win32 driver (usually) and/or hardware quirks	if (info->tx_fixup) {		skb = info->tx_fixup (dev, skb, GFP_ATOMIC);		if (!skb) {			if (netif_msg_tx_err (dev))				devdbg (dev, "can't tx_fixup skb");			goto drop;		}	}	length = skb->len;	if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) {		if (netif_msg_tx_err (dev))			devdbg (dev, "no urb");		goto drop;	}	entry = (struct skb_data *) skb->cb;	entry->urb = urb;	entry->dev = dev;	entry->state = tx_start;	entry->length = length;	// FIXME: reorganize a bit, so that fixup() fills out NetChip	// framing too. (Packet ID update needs the spinlock...)	// [ BETTER:  we already own net->xmit_lock, that's enough ]#ifdef	CONFIG_USB_NET1080	if (info->flags & FLAG_FRAMING_NC) {		header = (struct nc_header *) skb_push (skb, sizeof *header);		header->hdr_len = cpu_to_le16 (sizeof (*header));		header->packet_len = cpu_to_le16 (length);		if (!((skb->len + sizeof *trailer) & 0x01))			*skb_put (skb, 1) = PAD_BYTE;		trailer = (struct nc_trailer *) skb_put (skb, sizeof *trailer);	}#endif	/* CONFIG_USB_NET1080 */	usb_fill_bulk_urb (urb, dev->udev, dev->out,			skb->data, skb->len, tx_complete, skb);	/* don't assume the hardware handles USB_ZERO_PACKET	 * NOTE:  strictly conforming cdc-ether devices should expect	 * the ZLP here, but ignore the one-byte packet.	 *	 * FIXME zero that byte, if it doesn't require a new skb.	 */	if ((length % dev->maxpacket) == 0)		urb->transfer_buffer_length++;	spin_lock_irqsave (&dev->txq.lock, flags);#ifdef	CONFIG_USB_NET1080	if (info->flags & FLAG_FRAMING_NC) {		header->packet_id = cpu_to_le16 ((u16)dev->xid++);		put_unaligned (header->packet_id, &trailer->packet_id);#if 0		devdbg (dev, "frame >tx h %d p %d id %d",			header->hdr_len, header->packet_len,			header->packet_id);#endif	}#endif	/* CONFIG_USB_NET1080 */	switch ((retval = usb_submit_urb (urb, GFP_ATOMIC))) {	case -EPIPE:		netif_stop_queue (net);		defer_kevent (dev, EVENT_TX_HALT);		break;	default:		if (netif_msg_tx_err (dev))			devdbg (dev, "tx: submit urb err %d", retval);		break;	case 0:		net->trans_start = jiffies;		__skb_queue_tail (&dev->txq, skb);		if (dev->txq.qlen >= TX_QLEN (dev))			netif_stop_queue (net);	}	spin_unlock_irqrestore (&dev->txq.lock, flags);	if (retval) {		if (netif_msg_tx_err (dev))			devdbg (dev, "drop, code %d", retval);drop:		retval = NET_XMIT_SUCCESS;		dev->stats.tx_dropped++;		if (skb)			dev_kfree_skb_any (skb);		usb_free_urb (urb);	} else if (netif_msg_tx_queued (dev)) {		devdbg (dev, "> tx, len %d, type 0x%x",			length, skb->protocol);	}	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2e55cc7210fef90f88201e860d8767594974574e/usbnet.c/buggy/drivers/usb/net/usbnet.c