ethernet.c (219694) | ethernet.c (219695) |
---|---|
1/************************************************************************* 2Copyright (c) 2003-2007 Cavium Networks (support@cavium.com). All rights 3reserved. 4 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are 8met: --- 13 unchanged lines hidden (view full) --- 22 23This Software, including technical data, may be subject to U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. 24 25TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 26AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 27*************************************************************************/ 28 29#include <sys/cdefs.h> | 1/************************************************************************* 2Copyright (c) 2003-2007 Cavium Networks (support@cavium.com). All rights 3reserved. 4 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are 8met: --- 13 unchanged lines hidden (view full) --- 22 23This Software, including technical data, may be subject to U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. 24 25TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 26AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 27*************************************************************************/ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/mips/cavium/octe/ethernet.c 219694 2011-03-16 08:51:36Z jmallett $"); | 30__FBSDID("$FreeBSD: head/sys/mips/cavium/octe/ethernet.c 219695 2011-03-16 08:56:22Z jmallett $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35#include <sys/conf.h> 36#include <sys/endian.h> 37#include <sys/kernel.h> 38#include <sys/rman.h> --- 206 unchanged lines hidden (view full) --- 245 1, RF_ACTIVE); 246 if (sc->sc_rx_irq == NULL) { 247 device_printf(bus, "could not allocate workq irq"); 248 return; 249 } 250 251 error = bus_setup_intr(bus, sc->sc_rx_irq, INTR_TYPE_NET | INTR_MPSAFE, 252 cvm_oct_do_interrupt, NULL, cvm_oct_device, | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35#include <sys/conf.h> 36#include <sys/endian.h> 37#include <sys/kernel.h> 38#include <sys/rman.h> --- 206 unchanged lines hidden (view full) --- 245 1, RF_ACTIVE); 246 if (sc->sc_rx_irq == NULL) { 247 device_printf(bus, "could not allocate workq irq"); 248 return; 249 } 250 251 error = bus_setup_intr(bus, sc->sc_rx_irq, INTR_TYPE_NET | INTR_MPSAFE, 252 cvm_oct_do_interrupt, NULL, cvm_oct_device, |
253 NULL); | 253 &sc->sc_rx_intr_cookie); |
254 if (error != 0) { 255 device_printf(bus, "could not setup workq irq"); 256 return; 257 } 258 259 260#ifdef SMP 261 { --- 206 unchanged lines hidden (view full) --- 468} 469 470 471/** 472 * Module / driver shutdown 473 * 474 * @return Zero on success 475 */ | 254 if (error != 0) { 255 device_printf(bus, "could not setup workq irq"); 256 return; 257 } 258 259 260#ifdef SMP 261 { --- 206 unchanged lines hidden (view full) --- 468} 469 470 471/** 472 * Module / driver shutdown 473 * 474 * @return Zero on success 475 */ |
476void cvm_oct_cleanup_module(void) | 476void cvm_oct_cleanup_module(device_t bus) |
477{ 478 int port; | 477{ 478 int port; |
479 struct octebus_softc *sc = device_get_softc(bus); |
|
479 480 /* Disable POW interrupt */ 481 cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0); 482 | 480 481 /* Disable POW interrupt */ 482 cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0); 483 |
483#if 0 | |
484 /* Free the interrupt handler */ | 484 /* Free the interrupt handler */ |
485 free_irq(8 + pow_receive_group, cvm_oct_device); 486#endif | 485 bus_teardown_intr(bus, sc->sc_rx_irq, sc->sc_rx_intr_cookie); |
487 488 callout_stop(&cvm_oct_poll_timer); 489 cvm_oct_rx_shutdown(); 490 491 cvmx_helper_shutdown_packet_io_global(); 492 493 /* Free the ethernet devices */ 494 for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++) { --- 21 unchanged lines hidden --- | 486 487 callout_stop(&cvm_oct_poll_timer); 488 cvm_oct_rx_shutdown(); 489 490 cvmx_helper_shutdown_packet_io_global(); 491 492 /* Free the ethernet devices */ 493 for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++) { --- 21 unchanged lines hidden --- |