Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c94cb314 authored by Oliver Neukum's avatar Oliver Neukum Committed by David S. Miller
Browse files

net: prepare usb net drivers for addition of status as a parameter



USB is going to switch the signature of the callbacks to
void callback(struct urb *urb, int status)
This patch will ease the transition.

Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ab5024ab
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -246,10 +246,11 @@ out:
static void asix_async_cmd_callback(struct urb *urb)
{
	struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
	int status = urb->status;

	if (urb->status < 0)
	if (status < 0)
		printk(KERN_DEBUG "asix_async_cmd_callback() failed with %d",
			urb->status);
			status);

	kfree(req);
	usb_free_urb(urb);
+22 −19
Original line number Diff line number Diff line
@@ -229,14 +229,15 @@ static void catc_rx_done(struct urb *urb)
	u8 *pkt_start = urb->transfer_buffer;
	struct sk_buff *skb;
	int pkt_len, pkt_offset = 0;
	int status = urb->status;

	if (!catc->is_f5u011) {
		clear_bit(RX_RUNNING, &catc->flags);
		pkt_offset = 2;
	}

	if (urb->status) {
		dbg("rx_done, status %d, length %d", urb->status, urb->actual_length);
	if (status) {
		dbg("rx_done, status %d, length %d", status, urb->actual_length);
		return;
	}

@@ -273,12 +274,12 @@ static void catc_rx_done(struct urb *urb)

	if (catc->is_f5u011) {
		if (atomic_read(&catc->recq_sz)) {
			int status;
			int state;
			atomic_dec(&catc->recq_sz);
			dbg("getting extra packet");
			urb->dev = catc->usbdev;
			if ((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
				dbg("submit(rx_urb) status %d", status);
			if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
				dbg("submit(rx_urb) status %d", state);
			}
		} else {
			clear_bit(RX_RUNNING, &catc->flags);
@@ -290,8 +291,9 @@ static void catc_irq_done(struct urb *urb)
{
	struct catc *catc = urb->context;
	u8 *data = urb->transfer_buffer;
	int status;
	int status = urb->status;
	unsigned int hasdata = 0, linksts = LinkNoChange;
	int res;

	if (!catc->is_f5u011) {
		hasdata = data[1] & 0x80;
@@ -307,7 +309,7 @@ static void catc_irq_done(struct urb *urb)
			linksts = LinkBad;
	}

	switch (urb->status) {
	switch (status) {
	case 0:			/* success */
		break;
	case -ECONNRESET:	/* unlink */
@@ -316,7 +318,7 @@ static void catc_irq_done(struct urb *urb)
		return;
	/* -EPIPE:  should clear the halt */
	default:		/* error */
		dbg("irq_done, status %d, data %02x %02x.", urb->status, data[0], data[1]);
		dbg("irq_done, status %d, data %02x %02x.", status, data[0], data[1]);
		goto resubmit;
	}

@@ -336,17 +338,17 @@ static void catc_irq_done(struct urb *urb)
				atomic_inc(&catc->recq_sz);
		} else {
			catc->rx_urb->dev = catc->usbdev;
			if ((status = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
				err("submit(rx_urb) status %d", status);
			if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
				err("submit(rx_urb) status %d", res);
			}
		} 
	}
resubmit:
	status = usb_submit_urb (urb, GFP_ATOMIC);
	if (status)
	res = usb_submit_urb (urb, GFP_ATOMIC);
	if (res)
		err ("can't resubmit intr, %s-%s, status %d",
				catc->usbdev->bus->bus_name,
				catc->usbdev->devpath, status);
				catc->usbdev->devpath, res);
}

/*
@@ -378,9 +380,9 @@ static void catc_tx_done(struct urb *urb)
{
	struct catc *catc = urb->context;
	unsigned long flags;
	int r;
	int r, status = urb->status;

	if (urb->status == -ECONNRESET) {
	if (status == -ECONNRESET) {
		dbg("Tx Reset.");
		urb->status = 0;
		catc->netdev->trans_start = jiffies;
@@ -390,8 +392,8 @@ static void catc_tx_done(struct urb *urb)
		return;
	}

	if (urb->status) {
		dbg("tx_done, status %d, length %d", urb->status, urb->actual_length);
	if (status) {
		dbg("tx_done, status %d, length %d", status, urb->actual_length);
		return;
	}

@@ -502,9 +504,10 @@ static void catc_ctrl_done(struct urb *urb)
	struct catc *catc = urb->context;
	struct ctrl_queue *q;
	unsigned long flags;
	int status = urb->status;

	if (urb->status)
		dbg("ctrl_done, status %d, len %d.", urb->status, urb->actual_length);
	if (status)
		dbg("ctrl_done, status %d, len %d.", status, urb->actual_length);

	spin_lock_irqsave(&catc->ctrl_lock, flags);

+3 −2
Original line number Diff line number Diff line
@@ -123,10 +123,11 @@ static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
static void dm_write_async_callback(struct urb *urb)
{
	struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
	int status = urb->status;

	if (urb->status < 0)
	if (status < 0)
		printk(KERN_DEBUG "dm_write_async_callback() failed with %d\n",
		       urb->status);
		       status);

	kfree(req);
	usb_free_urb(urb);
+10 −7
Original line number Diff line number Diff line
@@ -516,8 +516,9 @@ static void int_callback(struct urb *u)
{
	struct kaweth_device *kaweth = u->context;
	int act_state;
	int status = u->status;

	switch (u->status) {
	switch (status) {
	case 0:			/* success */
		break;
	case -ECONNRESET:	/* unlink */
@@ -598,6 +599,7 @@ static void kaweth_usb_receive(struct urb *urb)
{
	struct kaweth_device *kaweth = urb->context;
	struct net_device *net = kaweth->net;
	int status = urb->status;

	int count = urb->actual_length;
	int count2 = urb->transfer_buffer_length;
@@ -606,7 +608,7 @@ static void kaweth_usb_receive(struct urb *urb)

	struct sk_buff *skb;

	if(unlikely(urb->status == -ECONNRESET || urb->status == -ESHUTDOWN))
	if(unlikely(status == -ECONNRESET || status == -ESHUTDOWN))
	/* we are killed - set a flag and wake the disconnect handler */
	{
		kaweth->end = 1;
@@ -621,10 +623,10 @@ static void kaweth_usb_receive(struct urb *urb)
	}
	spin_unlock(&kaweth->device_lock);

	if(urb->status && urb->status != -EREMOTEIO && count != 1) {
	if(status && status != -EREMOTEIO && count != 1) {
		err("%s RX status: %d count: %d packet_len: %d",
                           net->name,
			   urb->status,
			   status,
			   count,
			   (int)pkt_len);
		kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
@@ -775,10 +777,11 @@ static void kaweth_usb_transmit_complete(struct urb *urb)
{
	struct kaweth_device *kaweth = urb->context;
	struct sk_buff *skb = kaweth->tx_skb;
	int status = urb->status;

	if (unlikely(urb->status != 0))
		if (urb->status != -ENOENT)
			dbg("%s: TX status %d.", kaweth->net->name, urb->status);
	if (unlikely(status != 0))
		if (status != -ENOENT)
			dbg("%s: TX status %d.", kaweth->net->name, status);

	netif_wake_queue(kaweth->net);
	dev_kfree_skb_irq(skb);
+3 −2
Original line number Diff line number Diff line
@@ -115,10 +115,11 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data)
static void mcs7830_async_cmd_callback(struct urb *urb)
{
	struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
	int status = urb->status;

	if (urb->status < 0)
	if (status < 0)
		printk(KERN_DEBUG "%s() failed with %d\n",
		       __func__, urb->status);
		       __func__, status);

	kfree(req);
	usb_free_urb(urb);
Loading