isp_sbus.c (165269) | isp_sbus.c (166165) |
---|---|
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 165269 2006-12-16 05:54:29Z mjacob $"); | 32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 166165 2007-01-21 19:32:51Z marius $"); |
33 34#include <sys/param.h> 35#include <sys/systm.h> 36#if __FreeBSD_version >= 700000 37#include <sys/linker.h> 38#include <sys/firmware.h> 39#endif 40#include <sys/bus.h> --- 433 unchanged lines hidden (view full) --- 474 } 475} 476 477/* 478 * Should be BUS_SPACE_MAXSIZE, but MAXPHYS is larger than BUS_SPACE_MAXSIZE 479 */ 480#define ISP_NSEGS ((MAXPHYS / PAGE_SIZE) + 1) 481 | 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#if __FreeBSD_version >= 700000 37#include <sys/linker.h> 38#include <sys/firmware.h> 39#endif 40#include <sys/bus.h> --- 433 unchanged lines hidden (view full) --- 474 } 475} 476 477/* 478 * Should be BUS_SPACE_MAXSIZE, but MAXPHYS is larger than BUS_SPACE_MAXSIZE 479 */ 480#define ISP_NSEGS ((MAXPHYS / PAGE_SIZE) + 1) 481 |
482#if __FreeBSD_version < 700020 483#define BUS_DMA_ROOTARG NULL 484#define isp_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, z) \ 485 bus_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, \ 486 busdma_lock_mutex, &Giant, z) 487#else 488#define BUS_DMA_ROOTARG bus_get_dma_tag(sbs->sbus_dev) 489#define isp_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, z) \ 490 bus_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, \ 491 busdma_lock_mutex, &Giant, z) 492#endif 493 |
|
482static int 483isp_sbus_mbxdma(ispsoftc_t *isp) 484{ 485 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp; 486 caddr_t base; 487 uint32_t len; 488 int i, error, ns; 489 struct imush im; 490 491 /* 492 * Already been here? If so, leave... 493 */ 494 if (isp->isp_rquest) { 495 return (0); 496 } 497 498 ISP_UNLOCK(isp); 499 | 494static int 495isp_sbus_mbxdma(ispsoftc_t *isp) 496{ 497 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp; 498 caddr_t base; 499 uint32_t len; 500 int i, error, ns; 501 struct imush im; 502 503 /* 504 * Already been here? If so, leave... 505 */ 506 if (isp->isp_rquest) { 507 return (0); 508 } 509 510 ISP_UNLOCK(isp); 511 |
500 if (bus_dma_tag_create(NULL, 1, BUS_SPACE_MAXADDR_24BIT+1, | 512 if (isp_dma_tag_create(BUS_DMA_ROOTARG, 1, BUS_SPACE_MAXADDR_24BIT+1, |
501 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR_32BIT, 502 NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, ISP_NSEGS, | 513 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR_32BIT, 514 NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, ISP_NSEGS, |
503 BUS_SPACE_MAXADDR_24BIT, 0, busdma_lock_mutex, &Giant, | 515 BUS_SPACE_MAXADDR_24BIT, 0, |
504 &sbs->dmat)) { 505 isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); 506 ISP_LOCK(isp); 507 return(1); 508 } 509 510 len = sizeof (XS_T **) * isp->isp_maxcmds; 511 isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); --- 359 unchanged lines hidden --- | 516 &sbs->dmat)) { 517 isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); 518 ISP_LOCK(isp); 519 return(1); 520 } 521 522 len = sizeof (XS_T **) * isp->isp_maxcmds; 523 isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); --- 359 unchanged lines hidden --- |