Deleted Added
full compact
isp.c (218691) isp.c (219098)
1/*-
2 * Copyright (c) 1997-2009 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 *

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

42 */
43#ifdef __NetBSD__
44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD$");
46#include <dev/ic/isp_netbsd.h>
47#endif
48#ifdef __FreeBSD__
49#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2009 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 *

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

42 */
43#ifdef __NetBSD__
44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD$");
46#include <dev/ic/isp_netbsd.h>
47#endif
48#ifdef __FreeBSD__
49#include <sys/cdefs.h>
50__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 218691 2011-02-14 21:50:51Z marius $");
50__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 219098 2011-02-28 15:58:30Z mjacob $");
51#include <dev/isp/isp_freebsd.h>
52#endif
53#ifdef __OpenBSD__
54#include <dev/ic/isp_openbsd.h>
55#endif
56#ifdef __linux__
57#include "isp_linux.h"
58#endif

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

4372 /*
4373 * NB: we do not support long CDBs
4374 */
4375 cdblen = XS_CDBLEN(xs);
4376
4377 if (IS_SCSI(isp)) {
4378 reqp->req_target = target | (XS_CHANNEL(xs) << 7);
4379 reqp->req_lun_trn = XS_LUN(xs);
51#include <dev/isp/isp_freebsd.h>
52#endif
53#ifdef __OpenBSD__
54#include <dev/ic/isp_openbsd.h>
55#endif
56#ifdef __linux__
57#include "isp_linux.h"
58#endif

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

4372 /*
4373 * NB: we do not support long CDBs
4374 */
4375 cdblen = XS_CDBLEN(xs);
4376
4377 if (IS_SCSI(isp)) {
4378 reqp->req_target = target | (XS_CHANNEL(xs) << 7);
4379 reqp->req_lun_trn = XS_LUN(xs);
4380 cdblen = MIN(cdblen, sizeof (reqp->req_cdb));
4380 cdblen = ISP_MIN(cdblen, sizeof (reqp->req_cdb));
4381 cdbp = reqp->req_cdb;
4382 reqp->req_cdblen = cdblen;
4383 } else if (IS_24XX(isp)) {
4384 ispreqt7_t *t7 = (ispreqt7_t *)local;
4385 fcportdb_t *lp;
4386
4387 lp = &FCPARAM(isp, XS_CHANNEL(xs))->portdb[hdlidx];
4388 t7->req_nphdl = target;
4389 t7->req_tidlo = lp->portid;
4390 t7->req_tidhi = lp->portid >> 16;
4391 t7->req_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(xs));
4392 if (XS_LUN(xs) > 256) {
4393 t7->req_lun[0] = XS_LUN(xs) >> 8;
4394 t7->req_lun[0] |= 0x40;
4395 }
4396 t7->req_lun[1] = XS_LUN(xs);
4397 tptr = &t7->req_time;
4398 cdbp = t7->req_cdb;
4381 cdbp = reqp->req_cdb;
4382 reqp->req_cdblen = cdblen;
4383 } else if (IS_24XX(isp)) {
4384 ispreqt7_t *t7 = (ispreqt7_t *)local;
4385 fcportdb_t *lp;
4386
4387 lp = &FCPARAM(isp, XS_CHANNEL(xs))->portdb[hdlidx];
4388 t7->req_nphdl = target;
4389 t7->req_tidlo = lp->portid;
4390 t7->req_tidhi = lp->portid >> 16;
4391 t7->req_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(xs));
4392 if (XS_LUN(xs) > 256) {
4393 t7->req_lun[0] = XS_LUN(xs) >> 8;
4394 t7->req_lun[0] |= 0x40;
4395 }
4396 t7->req_lun[1] = XS_LUN(xs);
4397 tptr = &t7->req_time;
4398 cdbp = t7->req_cdb;
4399 cdblen = MIN(cdblen, sizeof (t7->req_cdb));
4399 cdblen = ISP_MIN(cdblen, sizeof (t7->req_cdb));
4400 } else if (ISP_CAP_2KLOGIN(isp)) {
4401 ispreqt2e_t *t2e = (ispreqt2e_t *)local;
4402 t2e->req_target = target;
4403 t2e->req_scclun = XS_LUN(xs);
4404 cdbp = t2e->req_cdb;
4400 } else if (ISP_CAP_2KLOGIN(isp)) {
4401 ispreqt2e_t *t2e = (ispreqt2e_t *)local;
4402 t2e->req_target = target;
4403 t2e->req_scclun = XS_LUN(xs);
4404 cdbp = t2e->req_cdb;
4405 cdblen = MIN(cdblen, sizeof (t2e->req_cdb));
4405 cdblen = ISP_MIN(cdblen, sizeof (t2e->req_cdb));
4406 } else if (ISP_CAP_SCCFW(isp)) {
4407 ispreqt2_t *t2 = (ispreqt2_t *)local;
4408 t2->req_target = target;
4409 t2->req_scclun = XS_LUN(xs);
4410 cdbp = t2->req_cdb;
4406 } else if (ISP_CAP_SCCFW(isp)) {
4407 ispreqt2_t *t2 = (ispreqt2_t *)local;
4408 t2->req_target = target;
4409 t2->req_scclun = XS_LUN(xs);
4410 cdbp = t2->req_cdb;
4411 cdblen = MIN(cdblen, sizeof (t2->req_cdb));
4411 cdblen = ISP_MIN(cdblen, sizeof (t2->req_cdb));
4412 } else {
4413 ispreqt2_t *t2 = (ispreqt2_t *)local;
4414 t2->req_target = target;
4415 t2->req_lun_trn = XS_LUN(xs);
4416 cdbp = t2->req_cdb;
4412 } else {
4413 ispreqt2_t *t2 = (ispreqt2_t *)local;
4414 t2->req_target = target;
4415 t2->req_lun_trn = XS_LUN(xs);
4416 cdbp = t2->req_cdb;
4417 cdblen = MIN(cdblen, sizeof (t2->req_cdb));
4417 cdblen = ISP_MIN(cdblen, sizeof (t2->req_cdb));
4418 }
4419 ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen);
4420
4421 *tptr = XS_TIME(xs) / 1000;
4422 if (*tptr == 0 && XS_TIME(xs)) {
4423 *tptr = 1;
4424 }
4425 if (IS_24XX(isp) && *tptr > 0x1999) {

--- 3879 unchanged lines hidden ---
4418 }
4419 ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen);
4420
4421 *tptr = XS_TIME(xs) / 1000;
4422 if (*tptr == 0 && XS_TIME(xs)) {
4423 *tptr = 1;
4424 }
4425 if (IS_24XX(isp) && *tptr > 0x1999) {

--- 3879 unchanged lines hidden ---