1/*-
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 14 unchanged lines hidden (view full) ---
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 227637 2011-11-17 21:07:56Z mav $");
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/systm.h>
36#include <sys/types.h>
37#include <sys/malloc.h>
38#include <sys/kernel.h>
39#include <sys/time.h>
--- 21 unchanged lines hidden (view full) ---
61#include <cam/cam_xpt_sim.h>
62#include <cam/cam_xpt_periph.h>
63#include <cam/cam_xpt_internal.h>
64#include <cam/cam_debug.h>
65
66#include <cam/scsi/scsi_all.h>
67#include <cam/scsi/scsi_message.h>
68#include <cam/scsi/scsi_pass.h>
69#include <machine/stdarg.h> /* for xpt_print below */
70#include "opt_cam.h"
71
72/*
73 * This is the maximum number of high powered commands (e.g. start unit)
74 * that can be outstanding at a particular time.
75 */
76#ifndef CAM_MAX_HIGHPOWER
77#define CAM_MAX_HIGHPOWER 4
--- 2373 unchanged lines hidden (view full) ---
2451 if (start_ccb->ccg.block_size == 0
2452 || start_ccb->ccg.volume_size == 0) {
2453 start_ccb->ccg.cylinders = 0;
2454 start_ccb->ccg.heads = 0;
2455 start_ccb->ccg.secs_per_track = 0;
2456 start_ccb->ccb_h.status = CAM_REQ_CMP;
2457 break;
2458 }
2459#ifdef PC98
2460 /*
2461 * In a PC-98 system, geometry translation depens on
2462 * the "real" device geometry obtained from mode page 4.
2463 * SCSI geometry translation is performed in the
2464 * initialization routine of the SCSI BIOS and the result
2465 * stored in host memory. If the translation is available
2466 * in host memory, use it. If not, rely on the default
2467 * translation the device driver performs.
2468 */
2469 if (scsi_da_bios_params(&start_ccb->ccg) != 0) {
2470 start_ccb->ccb_h.status = CAM_REQ_CMP;
2471 break;
2472 }
2473#endif
2474 sim = path->bus->sim;
2475 (*(sim->sim_action))(sim, start_ccb);
--- 2493 unchanged lines hidden ---
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 14 unchanged lines hidden (view full) ---
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 227637 2011-11-17 21:07:56Z mav $");
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/systm.h>
36#include <sys/types.h>
37#include <sys/malloc.h>
38#include <sys/kernel.h>
39#include <sys/time.h>
--- 21 unchanged lines hidden (view full) ---
61#include <cam/cam_xpt_sim.h>
62#include <cam/cam_xpt_periph.h>
63#include <cam/cam_xpt_internal.h>
64#include <cam/cam_debug.h>
65
66#include <cam/scsi/scsi_all.h>
67#include <cam/scsi/scsi_message.h>
68#include <cam/scsi/scsi_pass.h>
69#include <machine/stdarg.h> /* for xpt_print below */
70#include "opt_cam.h"
71
72/*
73 * This is the maximum number of high powered commands (e.g. start unit)
74 * that can be outstanding at a particular time.
75 */
76#ifndef CAM_MAX_HIGHPOWER
77#define CAM_MAX_HIGHPOWER 4
--- 2373 unchanged lines hidden (view full) ---
2451 if (start_ccb->ccg.block_size == 0
2452 || start_ccb->ccg.volume_size == 0) {
2453 start_ccb->ccg.cylinders = 0;
2454 start_ccb->ccg.heads = 0;
2455 start_ccb->ccg.secs_per_track = 0;
2456 start_ccb->ccb_h.status = CAM_REQ_CMP;
2457 break;
2458 }
2459#ifdef PC98
2460 /*
2461 * In a PC-98 system, geometry translation depens on
2462 * the "real" device geometry obtained from mode page 4.
2463 * SCSI geometry translation is performed in the
2464 * initialization routine of the SCSI BIOS and the result
2465 * stored in host memory. If the translation is available
2466 * in host memory, use it. If not, rely on the default
2467 * translation the device driver performs.
2468 */
2469 if (scsi_da_bios_params(&start_ccb->ccg) != 0) {
2470 start_ccb->ccb_h.status = CAM_REQ_CMP;
2471 break;
2472 }
2473#endif
2474 sim = path->bus->sim;
2475 (*(sim->sim_action))(sim, start_ccb);
--- 2493 unchanged lines hidden ---