ipheth.c (4d1cfa3afb8627435744ecdc6d8b58bc72ee0f4c) ipheth.c (28123a54f8877ae21f9b40b5e7b38832c6fac7b3)
1/*
2 * ipheth.c - Apple iPhone USB Ethernet driver
3 *
4 * Copyright (c) 2009 Diego Giagio <diego@giagio.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 341 unchanged lines hidden (view full) ---

350 retval = usb_control_msg(udev,
351 usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
352 IPHETH_CMD_CARRIER_CHECK, /* request */
353 0xc0, /* request type */
354 0x00, /* value */
355 0x02, /* index */
356 dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE,
357 IPHETH_CTRL_TIMEOUT);
1/*
2 * ipheth.c - Apple iPhone USB Ethernet driver
3 *
4 * Copyright (c) 2009 Diego Giagio <diego@giagio.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 341 unchanged lines hidden (view full) ---

350 retval = usb_control_msg(udev,
351 usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
352 IPHETH_CMD_CARRIER_CHECK, /* request */
353 0xc0, /* request type */
354 0x00, /* value */
355 0x02, /* index */
356 dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE,
357 IPHETH_CTRL_TIMEOUT);
358 if (retval < 0) {
358 if (retval <= 0) {
359 dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
360 __func__, retval);
361 return retval;
362 }
363
359 dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
360 __func__, retval);
361 return retval;
362 }
363
364 if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON) {
364 if ((retval == 1 && dev->ctrl_buf[0] == IPHETH_CARRIER_ON) ||
365 (retval >= 2 && dev->ctrl_buf[1] == IPHETH_CARRIER_ON)) {
365 netif_carrier_on(dev->net);
366 if (dev->tx_urb->status != -EINPROGRESS)
367 netif_wake_queue(dev->net);
368 } else {
369 netif_carrier_off(dev->net);
370 netif_stop_queue(dev->net);
371 }
372 return 0;

--- 305 unchanged lines hidden ---
366 netif_carrier_on(dev->net);
367 if (dev->tx_urb->status != -EINPROGRESS)
368 netif_wake_queue(dev->net);
369 } else {
370 netif_carrier_off(dev->net);
371 netif_stop_queue(dev->net);
372 }
373 return 0;

--- 305 unchanged lines hidden ---