isp_sbus.c (198822) | isp_sbus.c (203444) |
---|---|
1/*- 2 * Copyright (c) 1997-2006 by Matthew Jacob 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 --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26/* 27 * SBus specific probe and attach routines for Qlogic ISP SCSI adapters. 28 * FreeBSD Version. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997-2006 by Matthew Jacob 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 --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26/* 27 * SBus specific probe and attach routines for Qlogic ISP SCSI adapters. 28 * FreeBSD Version. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 198822 2009-11-02 21:22:30Z mjacob $"); | 32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 203444 2010-02-03 21:09:32Z mjacob $"); |
33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/linker.h> 37#include <sys/firmware.h> 38#include <sys/bus.h> 39#include <sys/kernel.h> 40#include <sys/module.h> --- 409 unchanged lines hidden (view full) --- 450 isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) 451 malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); 452 if (isp->isp_osinfo.pcmd_pool == NULL) { 453 isp_prt(isp, ISP_LOGERR, "cannot alloc pcmd pool"); 454 ISP_LOCK(isp); 455 return (1); 456 } 457 | 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/linker.h> 37#include <sys/firmware.h> 38#include <sys/bus.h> 39#include <sys/kernel.h> 40#include <sys/module.h> --- 409 unchanged lines hidden (view full) --- 450 isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) 451 malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); 452 if (isp->isp_osinfo.pcmd_pool == NULL) { 453 isp_prt(isp, ISP_LOGERR, "cannot alloc pcmd pool"); 454 ISP_LOCK(isp); 455 return (1); 456 } 457 |
458 len = sizeof (XS_T **) * isp->isp_maxcmds; 459 isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); | 458 len = sizeof (isp_hdl_t *) * isp->isp_maxcmds; 459 isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); |
460 if (isp->isp_xflist == NULL) { 461 isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array"); 462 ISP_LOCK(isp); 463 return (1); 464 } | 460 if (isp->isp_xflist == NULL) { 461 isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array"); 462 ISP_LOCK(isp); 463 return (1); 464 } |
465 for (len = 0; len < isp->isp_maxcmds - 1; len++) { 466 isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; 467 } 468 isp->isp_xffree = isp->isp_xflist; |
|
465 len = sizeof (bus_dmamap_t) * isp->isp_maxcmds; 466 467 if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_SBD(isp)), 1, 468 BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, 469 BUS_SPACE_MAXADDR_32BIT, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 470 ISP_NSEGS, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { 471 isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); 472 free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); --- 246 unchanged lines hidden --- | 469 len = sizeof (bus_dmamap_t) * isp->isp_maxcmds; 470 471 if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_SBD(isp)), 1, 472 BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, 473 BUS_SPACE_MAXADDR_32BIT, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 474 ISP_NSEGS, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { 475 isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); 476 free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); --- 246 unchanged lines hidden --- |