Deleted Added
full compact
isp_pci.c (35389) isp_pci.c (37618)
1/* $FreeBSD: head/sys/dev/isp/isp_pci.c 35389 1998-04-22 18:12:29Z mjacob $ */
2/* $Id: isp_pci.c,v 1.9 1998/04/17 17:44:36 mjacob Exp $ */
1/* $FreeBSD: head/sys/dev/isp/isp_pci.c 37618 1998-07-13 09:53:11Z bde $ */
2/* $Id: isp_pci.c,v 1.1 1998/04/22 18:10:34 mjacob Exp $ */
3/*
4 * PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
5 * FreeBSD Version.
6 *
7 *---------------------------------------
8 * Copyright (c) 1997, 1998 by Matthew Jacob
9 * NASA/Ames Research Center
10 * All rights reserved.

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

196 struct isp_pcisoftc *pcs;
197 struct ispsoftc *isp;
198 vm_offset_t vaddr, paddr;
199 ISP_LOCKVAL_DECL;
200
201
202 pcs = malloc(sizeof (struct isp_pcisoftc), M_DEVBUF, M_NOWAIT);
203 if (pcs == NULL) {
3/*
4 * PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
5 * FreeBSD Version.
6 *
7 *---------------------------------------
8 * Copyright (c) 1997, 1998 by Matthew Jacob
9 * NASA/Ames Research Center
10 * All rights reserved.

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

196 struct isp_pcisoftc *pcs;
197 struct ispsoftc *isp;
198 vm_offset_t vaddr, paddr;
199 ISP_LOCKVAL_DECL;
200
201
202 pcs = malloc(sizeof (struct isp_pcisoftc), M_DEVBUF, M_NOWAIT);
203 if (pcs == NULL) {
204 printf("isp%ld: cannot allocate softc\n", unit);
204 printf("isp%d: cannot allocate softc\n", unit);
205 return;
206 }
207 bzero(pcs, sizeof (struct isp_pcisoftc));
208
209 vaddr = paddr = NULL;
210 mapped = 0;
211 data = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
212 if (mapped == 0 && (data & PCI_COMMAND_IO_ENABLE)) {

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

219 if (mapped == 0 && (data & PCI_COMMAND_MEM_ENABLE)) {
220 if (pci_map_mem(config_id, PCI_MAP_REG_START, &vaddr, &paddr)) {
221 pcs->pci_st = I386_BUS_SPACE_MEM;
222 pcs->pci_sh = vaddr;
223 mapped++;
224 }
225 }
226 if (mapped == 0) {
205 return;
206 }
207 bzero(pcs, sizeof (struct isp_pcisoftc));
208
209 vaddr = paddr = NULL;
210 mapped = 0;
211 data = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
212 if (mapped == 0 && (data & PCI_COMMAND_IO_ENABLE)) {

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

219 if (mapped == 0 && (data & PCI_COMMAND_MEM_ENABLE)) {
220 if (pci_map_mem(config_id, PCI_MAP_REG_START, &vaddr, &paddr)) {
221 pcs->pci_st = I386_BUS_SPACE_MEM;
222 pcs->pci_sh = vaddr;
223 mapped++;
224 }
225 }
226 if (mapped == 0) {
227 printf("isp%ld: unable to map any ports!\n", unit);
227 printf("isp%d: unable to map any ports!\n", unit);
228 free(pcs, M_DEVBUF);
229 return;
230 }
231 printf("isp%d: using %s space register mapping\n", unit,
232 pcs->pci_st == I386_BUS_SPACE_IO? "I/O" : "Memory");
233
234 isp = &pcs->pci_isp;
235 (void) sprintf(isp->isp_name, "isp%d", unit);

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

260 ISP_UNLOCK;
261 } else {
262 free(pcs, M_DEVBUF);
263 return;
264 }
265
266 if (pci_map_int(config_id, (void (*)(void *))isp_intr,
267 (void *)isp, &IMASK) == 0) {
228 free(pcs, M_DEVBUF);
229 return;
230 }
231 printf("isp%d: using %s space register mapping\n", unit,
232 pcs->pci_st == I386_BUS_SPACE_IO? "I/O" : "Memory");
233
234 isp = &pcs->pci_isp;
235 (void) sprintf(isp->isp_name, "isp%d", unit);

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

260 ISP_UNLOCK;
261 } else {
262 free(pcs, M_DEVBUF);
263 return;
264 }
265
266 if (pci_map_int(config_id, (void (*)(void *))isp_intr,
267 (void *)isp, &IMASK) == 0) {
268 printf("%s: could not map interrupt\n");
268 printf("%s: could not map interrupt\n", isp->isp_name);
269 free(pcs, M_DEVBUF);
270 return;
271 }
272
273 pcs->pci_id = config_id;
274 ISP_LOCK;
275 isp_reset(isp);
276 if (isp->isp_state != ISP_RESETSTATE) {

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

548 isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS);
549}
550
551static void
552isp_pci_dumpregs(isp)
553 struct ispsoftc *isp;
554{
555 struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
269 free(pcs, M_DEVBUF);
270 return;
271 }
272
273 pcs->pci_id = config_id;
274 ISP_LOCK;
275 isp_reset(isp);
276 if (isp->isp_state != ISP_RESETSTATE) {

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

548 isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS);
549}
550
551static void
552isp_pci_dumpregs(isp)
553 struct ispsoftc *isp;
554{
555 struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
556 printf("%s: PCI Status Command/Status=%x\n", pci->pci_isp.isp_name,
556 printf("%s: PCI Status Command/Status=%lx\n", pci->pci_isp.isp_name,
557 pci_conf_read(pci->pci_id, PCI_COMMAND_STATUS_REG));
558}
559#endif
557 pci_conf_read(pci->pci_id, PCI_COMMAND_STATUS_REG));
558}
559#endif