Deleted Added
full compact
if_ipheth.c (227309) if_ipheth.c (233774)
1/*-
2 * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
3 * Copyright (c) 2009 Diego Giagio. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 */
26
27/*
28 * Thanks to Diego Giagio for figuring out the programming details for
29 * the Apple iPhone Ethernet driver.
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
3 * Copyright (c) 2009 Diego Giagio. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 */
26
27/*
28 * Thanks to Diego Giagio for figuring out the programming details for
29 * the Apple iPhone Ethernet driver.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_ipheth.c 227309 2011-11-07 15:43:11Z ed $");
33__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_ipheth.c 233774 2012-04-02 10:50:42Z hselasky $");
34
35#include <sys/stdint.h>
36#include <sys/stddef.h>
37#include <sys/param.h>
38#include <sys/queue.h>
39#include <sys/types.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>

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

466 DPRINTF("received %u bytes in %u frames\n", actlen, aframes);
467
468 for (x = 0; x != aframes; x++) {
469
470 m = sc->sc_rx_buf[x];
471 sc->sc_rx_buf[x] = NULL;
472 len = usbd_xfer_frame_len(xfer, x);
473
34
35#include <sys/stdint.h>
36#include <sys/stddef.h>
37#include <sys/param.h>
38#include <sys/queue.h>
39#include <sys/types.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>

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

466 DPRINTF("received %u bytes in %u frames\n", actlen, aframes);
467
468 for (x = 0; x != aframes; x++) {
469
470 m = sc->sc_rx_buf[x];
471 sc->sc_rx_buf[x] = NULL;
472 len = usbd_xfer_frame_len(xfer, x);
473
474 if (len < (sizeof(struct ether_header) +
474 if (len < (int)(sizeof(struct ether_header) +
475 IPHETH_RX_ADJ)) {
476 m_freem(m);
477 continue;
478 }
479
480 m_adj(m, IPHETH_RX_ADJ);
481
482 /* queue up mbuf */

--- 45 unchanged lines hidden ---
475 IPHETH_RX_ADJ)) {
476 m_freem(m);
477 continue;
478 }
479
480 m_adj(m, IPHETH_RX_ADJ);
481
482 /* queue up mbuf */

--- 45 unchanged lines hidden ---