Deleted Added
full compact
isp_freebsd.h (224856) isp_freebsd.h (225950)
1/* $FreeBSD: head/sys/dev/isp/isp_freebsd.h 224856 2011-08-13 23:34:17Z mjacob $ */
1/* $FreeBSD: head/sys/dev/isp/isp_freebsd.h 225950 2011-10-03 20:32:55Z ken $ */
2/*-
3 * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions
4 *
5 * Copyright (c) 1997-2008 by Matthew Jacob
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

433#define XS_XFRLEN(ccb) (ccb)->dxfer_len
434#define XS_TIME(ccb) (ccb)->ccb_h.timeout
435#define XS_GET_RESID(ccb) (ccb)->resid
436#define XS_SET_RESID(ccb, r) (ccb)->resid = r
437#define XS_STSP(ccb) (&(ccb)->scsi_status)
438#define XS_SNSP(ccb) (&(ccb)->sense_data)
439
440#define XS_SNSLEN(ccb) \
2/*-
3 * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions
4 *
5 * Copyright (c) 1997-2008 by Matthew Jacob
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

433#define XS_XFRLEN(ccb) (ccb)->dxfer_len
434#define XS_TIME(ccb) (ccb)->ccb_h.timeout
435#define XS_GET_RESID(ccb) (ccb)->resid
436#define XS_SET_RESID(ccb, r) (ccb)->resid = r
437#define XS_STSP(ccb) (&(ccb)->scsi_status)
438#define XS_SNSP(ccb) (&(ccb)->sense_data)
439
440#define XS_SNSLEN(ccb) \
441 imin((sizeof((ccb)->sense_data)), ccb->sense_len)
441 imin((sizeof((ccb)->sense_data)), ccb->sense_len - ccb->sense_resid)
442
442
443#define XS_SNSKEY(ccb) ((ccb)->sense_data.flags & 0xf)
444#define XS_SNSASC(ccb) ((ccb)->sense_data.add_sense_code)
445#define XS_SNSASCQ(ccb) ((ccb)->sense_data.add_sense_code_qual)
443#define XS_SNSKEY(ccb) (scsi_get_sense_key(&(ccb)->sense_data, \
444 ccb->sense_len - ccb->sense_resid, \
445 /*show_errors*/ 1))
446
447#define XS_SNSASC(ccb) (scsi_get_asc(&(ccb)->sense_data, \
448 ccb->sense_len - ccb->sense_resid, \
449 /*show_errors*/ 1))
450
451#define XS_SNSASCQ(ccb) (scsi_get_ascq(&(ccb)->sense_data, \
452 ccb->sense_len - ccb->sense_resid, \
453 /*show_errors*/ 1))
446#define XS_TAG_P(ccb) \
447 (((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \
448 (ccb)->tag_action != CAM_TAG_ACTION_NONE)
449
450#define XS_TAG_TYPE(ccb) \
451 ((ccb->tag_action == MSG_SIMPLE_Q_TAG)? REQFLAG_STAG : \
452 ((ccb->tag_action == MSG_HEAD_OF_Q_TAG)? REQFLAG_HTAG : REQFLAG_OTAG))
453

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

471
472#define XS_NOERR(ccb) \
473 (((ccb)->ccb_h.spriv_field0 & ISP_SPRIV_ERRSET) == 0 || \
474 ((ccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG)
475
476#define XS_INITERR(ccb) \
477 XS_SETERR(ccb, CAM_REQ_INPROG), (ccb)->ccb_h.spriv_field0 = 0
478
454#define XS_TAG_P(ccb) \
455 (((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \
456 (ccb)->tag_action != CAM_TAG_ACTION_NONE)
457
458#define XS_TAG_TYPE(ccb) \
459 ((ccb->tag_action == MSG_SIMPLE_Q_TAG)? REQFLAG_STAG : \
460 ((ccb->tag_action == MSG_HEAD_OF_Q_TAG)? REQFLAG_HTAG : REQFLAG_OTAG))
461

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

479
480#define XS_NOERR(ccb) \
481 (((ccb)->ccb_h.spriv_field0 & ISP_SPRIV_ERRSET) == 0 || \
482 ((ccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG)
483
484#define XS_INITERR(ccb) \
485 XS_SETERR(ccb, CAM_REQ_INPROG), (ccb)->ccb_h.spriv_field0 = 0
486
479#define XS_SAVE_SENSE(xs, sense_ptr, sense_len) \
480 (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \
481 memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs), sense_len))
487#define XS_SAVE_SENSE(xs, sense_ptr, slen) do { \
488 (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \
489 memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs),\
490 slen)); \
491 if (slen < (xs)->sense_len) \
492 (xs)->sense_resid = (xs)->sense_len - slen; \
493 } while (0);
482
483#define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0)
484
485#define DEFAULT_FRAMESIZE(isp) isp->isp_osinfo.framesize
486#define DEFAULT_EXEC_THROTTLE(isp) isp->isp_osinfo.exec_throttle
487
488#define GET_DEFAULT_ROLE(isp, chan) \
489 (IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role)

--- 179 unchanged lines hidden ---
494
495#define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0)
496
497#define DEFAULT_FRAMESIZE(isp) isp->isp_osinfo.framesize
498#define DEFAULT_EXEC_THROTTLE(isp) isp->isp_osinfo.exec_throttle
499
500#define GET_DEFAULT_ROLE(isp, chan) \
501 (IS_FC(isp)? ISP_FC_PC(isp, chan)->def_role : ISP_SPI_PC(isp, chan)->def_role)

--- 179 unchanged lines hidden ---