Deleted Added
full compact
cam_xpt.c (227637) cam_xpt.c (228022)
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>
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 $");
31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 228022 2011-11-27 15:43:40Z marius $");
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>
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
70#include <machine/md_var.h> /* geometry translation */
69#include <machine/stdarg.h> /* for xpt_print below */
71#include <machine/stdarg.h> /* for xpt_print below */
72
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 }
73#include "opt_cam.h"
74
75/*
76 * This is the maximum number of high powered commands (e.g. start unit)
77 * that can be outstanding at a particular time.
78 */
79#ifndef CAM_MAX_HIGHPOWER
80#define CAM_MAX_HIGHPOWER 4

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

2454 if (start_ccb->ccg.block_size == 0
2455 || start_ccb->ccg.volume_size == 0) {
2456 start_ccb->ccg.cylinders = 0;
2457 start_ccb->ccg.heads = 0;
2458 start_ccb->ccg.secs_per_track = 0;
2459 start_ccb->ccb_h.status = CAM_REQ_CMP;
2460 break;
2461 }
2459#ifdef PC98
2462#if defined(PC98) || defined(__sparc64__)
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.
2463 /*
2464 * In a PC-98 system, geometry translation depens on
2465 * the "real" device geometry obtained from mode page 4.
2466 * SCSI geometry translation is performed in the
2467 * initialization routine of the SCSI BIOS and the result
2468 * stored in host memory. If the translation is available
2469 * in host memory, use it. If not, rely on the default
2470 * translation the device driver performs.
2471 * For sparc64, we may need adjust the geometry of large
2472 * disks in order to fit the limitations of the 16-bit
2473 * fields of the VTOC8 disk label.
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 ---
2474 */
2475 if (scsi_da_bios_params(&start_ccb->ccg) != 0) {
2476 start_ccb->ccb_h.status = CAM_REQ_CMP;
2477 break;
2478 }
2479#endif
2480 sim = path->bus->sim;
2481 (*(sim->sim_action))(sim, start_ccb);

--- 2493 unchanged lines hidden ---