ipheth.c (ca2478a7d974f38d29d27acb42a952c7f168916e) ipheth.c (c2fb33a7fed5d88f0c446b6136fe491affbbb8bc)
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

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

281 case 0:
282 break;
283 default:
284 dev_err(&dev->intf->dev, "%s: urb status: %d\n",
285 __func__, status);
286 return;
287 }
288
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

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

281 case 0:
282 break;
283 default:
284 dev_err(&dev->intf->dev, "%s: urb status: %d\n",
285 __func__, status);
286 return;
287 }
288
289 if (urb->actual_length <= IPHETH_IP_ALIGN) {
290 dev->net->stats.rx_length_errors++;
291 return;
292 }
293
294 /* RX URBs starting with 0x00 0x01 do not encapsulate Ethernet frames,
295 * but rather are control frames. Their purpose is not documented, and
296 * they don't affect driver functionality, okay to drop them.
297 * There is usually just one 4-byte control frame as the very first
298 * URB received from the bulk IN endpoint.
299 */
300 if (unlikely
289 /* RX URBs starting with 0x00 0x01 do not encapsulate Ethernet frames,
290 * but rather are control frames. Their purpose is not documented, and
291 * they don't affect driver functionality, okay to drop them.
292 * There is usually just one 4-byte control frame as the very first
293 * URB received from the bulk IN endpoint.
294 */
295 if (unlikely
301 (((char *)urb->transfer_buffer)[0] == 0 &&
296 (urb->actual_length == 4 &&
297 ((char *)urb->transfer_buffer)[0] == 0 &&
302 ((char *)urb->transfer_buffer)[1] == 1))
303 goto rx_submit;
304
305 retval = dev->rcvbulk_callback(urb);
306 if (retval != 0) {
307 dev_err(&dev->intf->dev, "%s: callback retval: %d\n",
308 __func__, retval);
309 return;

--- 367 unchanged lines hidden ---
298 ((char *)urb->transfer_buffer)[1] == 1))
299 goto rx_submit;
300
301 retval = dev->rcvbulk_callback(urb);
302 if (retval != 0) {
303 dev_err(&dev->intf->dev, "%s: callback retval: %d\n",
304 __func__, retval);
305 return;

--- 367 unchanged lines hidden ---