hptnr_os_bsd.c (274819) | hptnr_os_bsd.c (296135) |
---|---|
1/* $Id: os_bsd.c,v 1.13 2010/05/11 03:12:11 lcn Exp $ */ 2/*- 3 * HighPoint RAID Driver for FreeBSD 4 * Copyright (C) 2005-2011 HighPoint Technologies, Inc. All Rights Reserved. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* $Id: os_bsd.c,v 1.13 2010/05/11 03:12:11 lcn Exp $ */ 2/*- 3 * HighPoint RAID Driver for FreeBSD 4 * Copyright (C) 2005-2011 HighPoint Technologies, Inc. All Rights Reserved. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/hptnr/hptnr_os_bsd.c 274819 2014-11-21 21:01:24Z smh $ | 28 * $FreeBSD: head/sys/dev/hptnr/hptnr_os_bsd.c 296135 2016-02-27 03:34:01Z jhibbits $ |
29 */ 30 31#include <dev/hptnr/hptnr_config.h> 32#include <dev/hptnr/os_bsd.h> 33 34BUS_ADDRESS get_dmapool_phy_addr(void *osext, void * dmapool_virt_addr); 35 36/* hardware access */ --- 64 unchanged lines hidden (view full) --- 101 PHBA hba = (PHBA)osext; 102 HPT_U32 base; 103 104 hba->pcibar[index].rid = 0x10 + index * 4; 105 base = pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4); 106 107 if (base & 1) { 108 hba->pcibar[index].type = SYS_RES_IOPORT; | 29 */ 30 31#include <dev/hptnr/hptnr_config.h> 32#include <dev/hptnr/os_bsd.h> 33 34BUS_ADDRESS get_dmapool_phy_addr(void *osext, void * dmapool_virt_addr); 35 36/* hardware access */ --- 64 unchanged lines hidden (view full) --- 101 PHBA hba = (PHBA)osext; 102 HPT_U32 base; 103 104 hba->pcibar[index].rid = 0x10 + index * 4; 105 base = pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4); 106 107 if (base & 1) { 108 hba->pcibar[index].type = SYS_RES_IOPORT; |
109 hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, 110 hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); | 109 hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, 110 hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); |
111 hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); 112 } else { 113 hba->pcibar[index].type = SYS_RES_MEMORY; | 111 hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); 112 } else { 113 hba->pcibar[index].type = SYS_RES_MEMORY; |
114 hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, 115 hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); | 114 hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, 115 hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); |
116 hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; 117 } 118 119 return hba->pcibar[index].base; 120} 121 122void os_unmap_pci_bar(void *osext, void *base) 123{ --- 179 unchanged lines hidden --- | 116 hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; 117 } 118 119 return hba->pcibar[index].base; 120} 121 122void os_unmap_pci_bar(void *osext, void *base) 123{ --- 179 unchanged lines hidden --- |