Deleted Added
full compact
if_ixgb.c (211907) if_ixgb.c (211913)
1/*******************************************************************************
2
3Copyright (c) 2001-2004, Intel Corporation
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

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

26SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31
32***************************************************************************/
33
1/*******************************************************************************
2
3Copyright (c) 2001-2004, Intel Corporation
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

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

26SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31
32***************************************************************************/
33
34/*$FreeBSD: head/sys/dev/ixgb/if_ixgb.c 211907 2010-08-28 00:09:19Z yongari $*/
34/*$FreeBSD: head/sys/dev/ixgb/if_ixgb.c 211913 2010-08-28 00:34:22Z yongari $*/
35
36#ifdef HAVE_KERNEL_OPTION_HEADERS
37#include "opt_device_polling.h"
38#endif
39
40#include <dev/ixgb/if_ixgb.h>
41
42/*********************************************************************

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

319 /* Allocate Receive Descriptor ring */
320 if (ixgb_dma_malloc(adapter, rsize, &adapter->rxdma, BUS_DMA_NOWAIT)) {
321 device_printf(dev, "Unable to allocate rx_desc memory\n");
322 error = ENOMEM;
323 goto err_rx_desc;
324 }
325 adapter->rx_desc_base = (struct ixgb_rx_desc *) adapter->rxdma.dma_vaddr;
326
35
36#ifdef HAVE_KERNEL_OPTION_HEADERS
37#include "opt_device_polling.h"
38#endif
39
40#include <dev/ixgb/if_ixgb.h>
41
42/*********************************************************************

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

319 /* Allocate Receive Descriptor ring */
320 if (ixgb_dma_malloc(adapter, rsize, &adapter->rxdma, BUS_DMA_NOWAIT)) {
321 device_printf(dev, "Unable to allocate rx_desc memory\n");
322 error = ENOMEM;
323 goto err_rx_desc;
324 }
325 adapter->rx_desc_base = (struct ixgb_rx_desc *) adapter->rxdma.dma_vaddr;
326
327 /* Allocate multicast array memory. */
328 adapter->mta = malloc(sizeof(u_int8_t) * IXGB_ETH_LENGTH_OF_ADDRESS *
329 MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT);
330 if (adapter->mta == NULL) {
331 device_printf(dev, "Can not allocate multicast setup array\n");
332 error = ENOMEM;
333 goto err_hw_init;
334 }
335
327 /* Initialize the hardware */
328 if (ixgb_hardware_init(adapter)) {
329 device_printf(dev, "Unable to initialize the hardware\n");
330 error = EIO;
331 goto err_hw_init;
332 }
333 /* Setup OS specific network interface */
334 if (ixgb_setup_interface(dev, adapter) != 0)

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

346err_rx_desc:
347 ixgb_dma_free(adapter, &adapter->txdma);
348err_tx_desc:
349err_pci:
350 if (adapter->ifp != NULL)
351 if_free(adapter->ifp);
352 ixgb_free_pci_resources(adapter);
353 sysctl_ctx_free(&adapter->sysctl_ctx);
336 /* Initialize the hardware */
337 if (ixgb_hardware_init(adapter)) {
338 device_printf(dev, "Unable to initialize the hardware\n");
339 error = EIO;
340 goto err_hw_init;
341 }
342 /* Setup OS specific network interface */
343 if (ixgb_setup_interface(dev, adapter) != 0)

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

355err_rx_desc:
356 ixgb_dma_free(adapter, &adapter->txdma);
357err_tx_desc:
358err_pci:
359 if (adapter->ifp != NULL)
360 if_free(adapter->ifp);
361 ixgb_free_pci_resources(adapter);
362 sysctl_ctx_free(&adapter->sysctl_ctx);
363 free(adapter->mta, M_DEVBUF);
354 return (error);
355
356}
357
358/*********************************************************************
359 * Device removal routine
360 *
361 * The detach entry point is called when the driver is being removed.

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

407 }
408 /* Remove from the adapter list */
409 if (ixgb_adapter_list == adapter)
410 ixgb_adapter_list = adapter->next;
411 if (adapter->next != NULL)
412 adapter->next->prev = adapter->prev;
413 if (adapter->prev != NULL)
414 adapter->prev->next = adapter->next;
364 return (error);
365
366}
367
368/*********************************************************************
369 * Device removal routine
370 *
371 * The detach entry point is called when the driver is being removed.

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

417 }
418 /* Remove from the adapter list */
419 if (ixgb_adapter_list == adapter)
420 ixgb_adapter_list = adapter->next;
421 if (adapter->next != NULL)
422 adapter->next->prev = adapter->prev;
423 if (adapter->prev != NULL)
424 adapter->prev->next = adapter->next;
425 free(adapter->mta, M_DEVBUF);
415
416 IXGB_LOCK_DESTROY(adapter);
417 return (0);
418}
419
420/*********************************************************************
421 *
422 * Shutdown entry point

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

1064 * This routine is called whenever multicast address list is updated.
1065 *
1066 **********************************************************************/
1067
1068static void
1069ixgb_set_multi(struct adapter * adapter)
1070{
1071 u_int32_t reg_rctl = 0;
426
427 IXGB_LOCK_DESTROY(adapter);
428 return (0);
429}
430
431/*********************************************************************
432 *
433 * Shutdown entry point

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

1075 * This routine is called whenever multicast address list is updated.
1076 *
1077 **********************************************************************/
1078
1079static void
1080ixgb_set_multi(struct adapter * adapter)
1081{
1082 u_int32_t reg_rctl = 0;
1072 u_int8_t mta[MAX_NUM_MULTICAST_ADDRESSES * IXGB_ETH_LENGTH_OF_ADDRESS];
1083 u_int8_t *mta;
1073 struct ifmultiaddr *ifma;
1074 int mcnt = 0;
1075 struct ifnet *ifp = adapter->ifp;
1076
1077 IOCTL_DEBUGOUT("ixgb_set_multi: begin");
1078
1084 struct ifmultiaddr *ifma;
1085 int mcnt = 0;
1086 struct ifnet *ifp = adapter->ifp;
1087
1088 IOCTL_DEBUGOUT("ixgb_set_multi: begin");
1089
1090 mta = adapter->mta;
1091 bzero(mta, sizeof(u_int8_t) * IXGB_ETH_LENGTH_OF_ADDRESS *
1092 MAX_NUM_MULTICAST_ADDRESSES);
1093
1079 if_maddr_rlock(ifp);
1080#if __FreeBSD_version < 500000
1081 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1082#else
1083 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1084#endif
1085 if (ifma->ifma_addr->sa_family != AF_LINK)
1086 continue;

--- 1433 unchanged lines hidden ---
1094 if_maddr_rlock(ifp);
1095#if __FreeBSD_version < 500000
1096 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1097#else
1098 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1099#endif
1100 if (ifma->ifma_addr->sa_family != AF_LINK)
1101 continue;

--- 1433 unchanged lines hidden ---