if_mxge.c (d9b9dae1a954c5a277eada994d268f88eb5f3f20) if_mxge.c (43cd61606b6bfae52bb09856277751103bfa28fd)
1/******************************************************************************
2
3Copyright (c) 2006-2013, Myricom Inc.
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

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

4656
4657 count = pci_msi_count(sc->dev);
4658 if (count == 1 && pci_alloc_msi(sc->dev, &count) == 0) {
4659 rid = 1;
4660 } else {
4661 rid = 0;
4662 sc->legacy_irq = 1;
4663 }
1/******************************************************************************
2
3Copyright (c) 2006-2013, Myricom Inc.
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

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

4656
4657 count = pci_msi_count(sc->dev);
4658 if (count == 1 && pci_alloc_msi(sc->dev, &count) == 0) {
4659 rid = 1;
4660 } else {
4661 rid = 0;
4662 sc->legacy_irq = 1;
4663 }
4664 sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, 0, ~0,
4665 1, RF_SHAREABLE | RF_ACTIVE);
4664 sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
4665 RF_SHAREABLE | RF_ACTIVE);
4666 if (sc->irq_res == NULL) {
4667 device_printf(sc->dev, "could not alloc interrupt\n");
4668 return ENXIO;
4669 }
4670 if (mxge_verbose)
4671 device_printf(sc->dev, "using %s irq %ld\n",
4672 sc->legacy_irq ? "INTx" : "MSI",
4673 rman_get_start(sc->irq_res));

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

4808 MTX_NETWORK_LOCK, MTX_DEF);
4809
4810 callout_init_mtx(&sc->co_hdl, &sc->driver_mtx, 0);
4811
4812 mxge_setup_cfg_space(sc);
4813
4814 /* Map the board into the kernel */
4815 rid = PCIR_BARS;
4666 if (sc->irq_res == NULL) {
4667 device_printf(sc->dev, "could not alloc interrupt\n");
4668 return ENXIO;
4669 }
4670 if (mxge_verbose)
4671 device_printf(sc->dev, "using %s irq %ld\n",
4672 sc->legacy_irq ? "INTx" : "MSI",
4673 rman_get_start(sc->irq_res));

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

4808 MTX_NETWORK_LOCK, MTX_DEF);
4809
4810 callout_init_mtx(&sc->co_hdl, &sc->driver_mtx, 0);
4811
4812 mxge_setup_cfg_space(sc);
4813
4814 /* Map the board into the kernel */
4815 rid = PCIR_BARS;
4816 sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0,
4817 ~0, 1, RF_ACTIVE);
4816 sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
4817 RF_ACTIVE);
4818 if (sc->mem_res == NULL) {
4819 device_printf(dev, "could not map memory\n");
4820 err = ENXIO;
4821 goto abort_with_lock;
4822 }
4823 sc->sram = rman_get_virtual(sc->mem_res);
4824 sc->sram_size = 2*1024*1024 - (2*(48*1024)+(32*1024)) - 0x100;
4825 if (sc->sram_size > rman_get_size(sc->mem_res)) {

--- 207 unchanged lines hidden ---
4818 if (sc->mem_res == NULL) {
4819 device_printf(dev, "could not map memory\n");
4820 err = ENXIO;
4821 goto abort_with_lock;
4822 }
4823 sc->sram = rman_get_virtual(sc->mem_res);
4824 sc->sram_size = 2*1024*1024 - (2*(48*1024)+(32*1024)) - 0x100;
4825 if (sc->sram_size > rman_get_size(sc->mem_res)) {

--- 207 unchanged lines hidden ---