Deleted Added
full compact
ahci.c (208410) ahci.c (208414)
1/*-
2 * Copyright (c) 2009 Alexander Motin <mav@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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009 Alexander Motin <mav@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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/ahci/ahci.c 208410 2010-05-22 07:32:47Z mav $");
28__FBSDID("$FreeBSD: head/sys/dev/ahci/ahci.c 208414 2010-05-22 08:30:47Z mav $");
29
30#include <sys/param.h>
31#include <sys/module.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/ata.h>
35#include <sys/bus.h>
36#include <sys/endian.h>

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

325 resource_int_value(device_get_name(dev),
326 device_get_unit(dev), "ccc", &ctlr->ccc);
327 /* if we have a memory BAR(5) we are likely on an AHCI part */
328 ctlr->r_rid = PCIR_BAR(5);
329 if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
330 &ctlr->r_rid, RF_ACTIVE)))
331 return ENXIO;
332 /* Setup our own memory management for channels. */
29
30#include <sys/param.h>
31#include <sys/module.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/ata.h>
35#include <sys/bus.h>
36#include <sys/endian.h>

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

325 resource_int_value(device_get_name(dev),
326 device_get_unit(dev), "ccc", &ctlr->ccc);
327 /* if we have a memory BAR(5) we are likely on an AHCI part */
328 ctlr->r_rid = PCIR_BAR(5);
329 if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
330 &ctlr->r_rid, RF_ACTIVE)))
331 return ENXIO;
332 /* Setup our own memory management for channels. */
333 ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem);
334 ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem);
333 ctlr->sc_iomem.rm_type = RMAN_ARRAY;
334 ctlr->sc_iomem.rm_descr = "I/O memory addresses";
335 if ((error = rman_init(&ctlr->sc_iomem)) != 0) {
336 bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem);
337 return (error);
338 }
339 if ((error = rman_manage_region(&ctlr->sc_iomem,
340 rman_get_start(ctlr->r_mem), rman_get_end(ctlr->r_mem))) != 0) {

--- 2302 unchanged lines hidden ---
335 ctlr->sc_iomem.rm_type = RMAN_ARRAY;
336 ctlr->sc_iomem.rm_descr = "I/O memory addresses";
337 if ((error = rman_init(&ctlr->sc_iomem)) != 0) {
338 bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem);
339 return (error);
340 }
341 if ((error = rman_manage_region(&ctlr->sc_iomem,
342 rman_get_start(ctlr->r_mem), rman_get_end(ctlr->r_mem))) != 0) {

--- 2302 unchanged lines hidden ---