if_ae.c (ba26d470bd4a84935e743550e35b661d92789dac) if_ae.c (e4ec1e683e718941d3a11098e3680c83b4801226)
1/*-
2 * Copyright (c) 2008 Stanislav Sedov <stas@FreeBSD.org>.
3 * 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

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

1100 KASSERT(nsegs == 1, ("[ae, %d]: %d segments instead of 1!", __LINE__,
1101 nsegs));
1102 *addr = segs[0].ds_addr;
1103}
1104
1105static int
1106ae_alloc_rings(ae_softc_t *sc)
1107{
1/*-
2 * Copyright (c) 2008 Stanislav Sedov <stas@FreeBSD.org>.
3 * 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

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

1100 KASSERT(nsegs == 1, ("[ae, %d]: %d segments instead of 1!", __LINE__,
1101 nsegs));
1102 *addr = segs[0].ds_addr;
1103}
1104
1105static int
1106ae_alloc_rings(ae_softc_t *sc)
1107{
1108 bus_dma_tag_t bustag;
1109 bus_addr_t busaddr;
1110 int error;
1111
1108 bus_addr_t busaddr;
1109 int error;
1110
1112 bustag = bus_get_dma_tag(sc->dev);
1113
1114 /*
1115 * Create parent DMA tag.
1116 */
1117 error = bus_dma_tag_create(bus_get_dma_tag(sc->dev),
1118 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
1119 NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0,
1120 BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL,
1121 &sc->dma_parent_tag);

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

1898
1899 ifp = sc->ifp;
1900 flags = le16toh(rxd->flags);
1901
1902#ifdef AE_DEBUG
1903 if_printf(ifp, "Rx interrupt occuried.\n");
1904#endif
1905 size = le16toh(rxd->len) - ETHER_CRC_LEN;
1111 /*
1112 * Create parent DMA tag.
1113 */
1114 error = bus_dma_tag_create(bus_get_dma_tag(sc->dev),
1115 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
1116 NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0,
1117 BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL,
1118 &sc->dma_parent_tag);

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

1895
1896 ifp = sc->ifp;
1897 flags = le16toh(rxd->flags);
1898
1899#ifdef AE_DEBUG
1900 if_printf(ifp, "Rx interrupt occuried.\n");
1901#endif
1902 size = le16toh(rxd->len) - ETHER_CRC_LEN;
1906 if (size < 0) {
1907 if_printf(ifp, "Negative length packet received.");
1903 if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) {
1904 if_printf(ifp, "Runt frame received.");
1908 return (EIO);
1909 }
1910
1911 m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL);
1912 if (m == NULL)
1913 return (ENOBUFS);
1914
1915 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 &&

--- 346 unchanged lines hidden ---
1905 return (EIO);
1906 }
1907
1908 m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL);
1909 if (m == NULL)
1910 return (ENOBUFS);
1911
1912 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 &&

--- 346 unchanged lines hidden ---