Deleted Added
full compact
cam_ccb.h (195534) cam_ccb.h (196008)
1/*-
2 * Data structures and definitions for CAM Control Blocks (CCBs).
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*-
2 * Data structures and definitions for CAM Control Blocks (CCBs).
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/cam/cam_ccb.h 195534 2009-07-10 08:18:08Z scottl $
28 * $FreeBSD: head/sys/cam/cam_ccb.h 196008 2009-08-01 01:04:26Z mjacob $
29 */
30
31#ifndef _CAM_CAM_CCB_H
32#define _CAM_CAM_CCB_H 1
33
34#include <sys/queue.h>
35#include <sys/cdefs.h>
36#include <sys/time.h>

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

168 /*
169 * Calculate the geometry parameters for
170 * a device give the sector size and
171 * volume size.
172 */
173 XPT_ATA_IO = 0x18 | XPT_FC_DEV_QUEUED,
174 /* Execute the requested ATA I/O operation */
175
29 */
30
31#ifndef _CAM_CAM_CCB_H
32#define _CAM_CAM_CCB_H 1
33
34#include <sys/queue.h>
35#include <sys/cdefs.h>
36#include <sys/time.h>

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

168 /*
169 * Calculate the geometry parameters for
170 * a device give the sector size and
171 * volume size.
172 */
173 XPT_ATA_IO = 0x18 | XPT_FC_DEV_QUEUED,
174 /* Execute the requested ATA I/O operation */
175
176 XPT_GET_SIM_KNOB = 0x18,
177 /*
178 * Get SIM specific knob values.
179 */
180
181 XPT_SET_SIM_KNOB = 0x19,
182 /*
183 * Set SIM specific knob values.
184 */
176/* HBA engine commands 0x20->0x2F */
177 XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY,
178 /* HBA engine feature inquiry */
179 XPT_ENG_EXEC = 0x21 | XPT_FC_DEV_QUEUED,
180 /* HBA execute engine request */
181
182/* Target mode commands: 0x30->0x3F */
183 XPT_EN_LUN = 0x30,
184 /* Enable LUN as a target */
185 XPT_TARGET_IO = 0x31 | XPT_FC_DEV_QUEUED,
186 /* Execute target I/O request */
187 XPT_ACCEPT_TARGET_IO = 0x32 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
188 /* Accept Host Target Mode CDB */
189 XPT_CONT_TARGET_IO = 0x33 | XPT_FC_DEV_QUEUED,
190 /* Continue Host Target I/O Connection */
191 XPT_IMMED_NOTIFY = 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
185/* HBA engine commands 0x20->0x2F */
186 XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY,
187 /* HBA engine feature inquiry */
188 XPT_ENG_EXEC = 0x21 | XPT_FC_DEV_QUEUED,
189 /* HBA execute engine request */
190
191/* Target mode commands: 0x30->0x3F */
192 XPT_EN_LUN = 0x30,
193 /* Enable LUN as a target */
194 XPT_TARGET_IO = 0x31 | XPT_FC_DEV_QUEUED,
195 /* Execute target I/O request */
196 XPT_ACCEPT_TARGET_IO = 0x32 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
197 /* Accept Host Target Mode CDB */
198 XPT_CONT_TARGET_IO = 0x33 | XPT_FC_DEV_QUEUED,
199 /* Continue Host Target I/O Connection */
200 XPT_IMMED_NOTIFY = 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
192 /* Notify Host Target driver of event */
201 /* Notify Host Target driver of event (obsolete) */
193 XPT_NOTIFY_ACK = 0x35,
202 XPT_NOTIFY_ACK = 0x35,
203 /* Acknowledgement of event (obsolete) */
204 XPT_IMMEDIATE_NOTIFY = 0x36 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
205 /* Notify Host Target driver of event */
206 XPT_NOTIFY_ACKNOWLEDGE = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
194 /* Acknowledgement of event */
195
196/* Vendor Unique codes: 0x80->0x8F */
197 XPT_VUNIQUE = 0x80
198} xpt_opcode;
199
200#define XPT_FC_GROUP_MASK 0xF0
201#define XPT_FC_GROUP(op) ((op) & XPT_FC_GROUP_MASK)

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

526 PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */
527 PIM_SEQSCAN = 0x04 /* Do bus scans sequentially, not in parallel */
528} pi_miscflag;
529
530/* Path Inquiry CCB */
531struct ccb_pathinq_settings_spi {
532 u_int8_t ppr_options;
533};
207 /* Acknowledgement of event */
208
209/* Vendor Unique codes: 0x80->0x8F */
210 XPT_VUNIQUE = 0x80
211} xpt_opcode;
212
213#define XPT_FC_GROUP_MASK 0xF0
214#define XPT_FC_GROUP(op) ((op) & XPT_FC_GROUP_MASK)

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

539 PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */
540 PIM_SEQSCAN = 0x04 /* Do bus scans sequentially, not in parallel */
541} pi_miscflag;
542
543/* Path Inquiry CCB */
544struct ccb_pathinq_settings_spi {
545 u_int8_t ppr_options;
546};
547
534struct ccb_pathinq_settings_fc {
535 u_int64_t wwnn; /* world wide node name */
536 u_int64_t wwpn; /* world wide port name */
537 u_int32_t port; /* 24 bit port id, if known */
538 u_int32_t bitrate; /* Mbps */
539};
548struct ccb_pathinq_settings_fc {
549 u_int64_t wwnn; /* world wide node name */
550 u_int64_t wwpn; /* world wide port name */
551 u_int32_t port; /* 24 bit port id, if known */
552 u_int32_t bitrate; /* Mbps */
553};
554
540struct ccb_pathinq_settings_sas {
541 u_int32_t bitrate; /* Mbps */
542};
543#define PATHINQ_SETTINGS_SIZE 128
544
545struct ccb_pathinq {
546 struct ccb_hdr ccb_h;
547 u_int8_t version_num; /* Version number for the SIM/HBA */

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

673 u_int32_t release_timeout;
674 u_int32_t qfrozen_cnt;
675};
676
677/*
678 * Definitions for the asynchronous callback CCB fields.
679 */
680typedef enum {
555struct ccb_pathinq_settings_sas {
556 u_int32_t bitrate; /* Mbps */
557};
558#define PATHINQ_SETTINGS_SIZE 128
559
560struct ccb_pathinq {
561 struct ccb_hdr ccb_h;
562 u_int8_t version_num; /* Version number for the SIM/HBA */

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

688 u_int32_t release_timeout;
689 u_int32_t qfrozen_cnt;
690};
691
692/*
693 * Definitions for the asynchronous callback CCB fields.
694 */
695typedef enum {
696 AC_CONTRACT = 0x1000,/* A contractual callback */
681 AC_GETDEV_CHANGED = 0x800,/* Getdev info might have changed */
682 AC_INQ_CHANGED = 0x400,/* Inquiry info might have changed */
683 AC_TRANSFER_NEG = 0x200,/* New transfer settings in effect */
684 AC_LOST_DEVICE = 0x100,/* A device went away */
685 AC_FOUND_DEVICE = 0x080,/* A new device was found */
686 AC_PATH_DEREGISTERED = 0x040,/* A path has de-registered */
687 AC_PATH_REGISTERED = 0x020,/* A new path has been registered */
688 AC_SENT_BDR = 0x010,/* A BDR message was sent to target */
689 AC_SCSI_AEN = 0x008,/* A SCSI AEN has been received */
690 AC_UNSOL_RESEL = 0x002,/* Unsolicited reselection occurred */
691 AC_BUS_RESET = 0x001 /* A SCSI bus reset occurred */
692} ac_code;
693
694typedef void ac_callback_t (void *softc, u_int32_t code,
695 struct cam_path *path, void *args);
696
697 AC_GETDEV_CHANGED = 0x800,/* Getdev info might have changed */
698 AC_INQ_CHANGED = 0x400,/* Inquiry info might have changed */
699 AC_TRANSFER_NEG = 0x200,/* New transfer settings in effect */
700 AC_LOST_DEVICE = 0x100,/* A device went away */
701 AC_FOUND_DEVICE = 0x080,/* A new device was found */
702 AC_PATH_DEREGISTERED = 0x040,/* A path has de-registered */
703 AC_PATH_REGISTERED = 0x020,/* A new path has been registered */
704 AC_SENT_BDR = 0x010,/* A BDR message was sent to target */
705 AC_SCSI_AEN = 0x008,/* A SCSI AEN has been received */
706 AC_UNSOL_RESEL = 0x002,/* Unsolicited reselection occurred */
707 AC_BUS_RESET = 0x001 /* A SCSI bus reset occurred */
708} ac_code;
709
710typedef void ac_callback_t (void *softc, u_int32_t code,
711 struct cam_path *path, void *args);
712
713/*
714 * Generic Asynchronous callbacks.
715 *
716 * Generic arguments passed bac which are then interpreted between a per-system
717 * contract number.
718 */
719#define AC_CONTRACT_DATA_MAX (128 - sizeof (u_int64_t))
720struct ac_contract {
721 u_int64_t contract_number;
722 u_int8_t contract_data[AC_CONTRACT_DATA_MAX];
723};
724
725#define AC_CONTRACT_DEV_CHG 1
726struct ac_device_changed {
727 u_int64_t wwpn;
728 u_int32_t port;
729 target_id_t target;
730 u_int8_t arrived;
731};
732
697/* Set Asynchronous Callback CCB */
698struct ccb_setasync {
699 struct ccb_hdr ccb_h;
700 u_int32_t event_enable; /* Async Event enables */
701 ac_callback_t *callback;
702 void *callback_arg;
703};
704

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

818 u_int32_t block_size;
819 u_int64_t volume_size;
820 u_int32_t cylinders;
821 u_int8_t heads;
822 u_int8_t secs_per_track;
823};
824
825/*
733/* Set Asynchronous Callback CCB */
734struct ccb_setasync {
735 struct ccb_hdr ccb_h;
736 u_int32_t event_enable; /* Async Event enables */
737 ac_callback_t *callback;
738 void *callback_arg;
739};
740

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

854 u_int32_t block_size;
855 u_int64_t volume_size;
856 u_int32_t cylinders;
857 u_int8_t heads;
858 u_int8_t secs_per_track;
859};
860
861/*
862 * Set or get SIM (and transport) specific knobs
863 */
864
865#define KNOB_VALID_ADDRESS 0x1
866#define KNOB_VALID_ROLE 0x2
867
868
869#define KNOB_ROLE_NONE 0x0
870#define KNOB_ROLE_INITIATOR 0x1
871#define KNOB_ROLE_TARGET 0x2
872#define KNOB_ROLE_BOTH 0x3
873
874struct ccb_sim_knob_settings_spi {
875 u_int valid;
876 u_int initiator_id;
877 u_int role;
878};
879
880struct ccb_sim_knob_settings_fc {
881 u_int valid;
882 u_int64_t wwnn; /* world wide node name */
883 u_int64_t wwpn; /* world wide port name */
884 u_int role;
885};
886
887struct ccb_sim_knob_settings_sas {
888 u_int valid;
889 u_int64_t wwnn; /* world wide node name */
890 u_int role;
891};
892#define KNOB_SETTINGS_SIZE 128
893
894struct ccb_sim_knob {
895 struct ccb_hdr ccb_h;
896 union {
897 u_int valid; /* Which fields to honor */
898 struct ccb_sim_knob_settings_spi spi;
899 struct ccb_sim_knob_settings_fc fc;
900 struct ccb_sim_knob_settings_sas sas;
901 char pad[KNOB_SETTINGS_SIZE];
902 } xport_specific;
903};
904
905/*
826 * Rescan the given bus, or bus/target/lun
827 */
828struct ccb_rescan {
829 struct ccb_hdr ccb_h;
830 cam_flags flags;
831};
832
833/*

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

842
843struct ccb_en_lun {
844 struct ccb_hdr ccb_h;
845 u_int16_t grp6_len; /* Group 6 VU CDB length */
846 u_int16_t grp7_len; /* Group 7 VU CDB length */
847 u_int8_t enable;
848};
849
906 * Rescan the given bus, or bus/target/lun
907 */
908struct ccb_rescan {
909 struct ccb_hdr ccb_h;
910 cam_flags flags;
911};
912
913/*

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

922
923struct ccb_en_lun {
924 struct ccb_hdr ccb_h;
925 u_int16_t grp6_len; /* Group 6 VU CDB length */
926 u_int16_t grp7_len; /* Group 7 VU CDB length */
927 u_int8_t enable;
928};
929
930/* old, barely used immediate notify, binary compatibility */
850struct ccb_immed_notify {
851 struct ccb_hdr ccb_h;
852 struct scsi_sense_data sense_data;
853 u_int8_t sense_len; /* Number of bytes in sense buffer */
854 u_int8_t initiator_id; /* Id of initiator that selected */
855 u_int8_t message_args[7]; /* Message Arguments */
856};
857
858struct ccb_notify_ack {
859 struct ccb_hdr ccb_h;
860 u_int16_t seq_id; /* Sequence identifier */
861 u_int8_t event; /* Event flags */
862};
863
931struct ccb_immed_notify {
932 struct ccb_hdr ccb_h;
933 struct scsi_sense_data sense_data;
934 u_int8_t sense_len; /* Number of bytes in sense buffer */
935 u_int8_t initiator_id; /* Id of initiator that selected */
936 u_int8_t message_args[7]; /* Message Arguments */
937};
938
939struct ccb_notify_ack {
940 struct ccb_hdr ccb_h;
941 u_int16_t seq_id; /* Sequence identifier */
942 u_int8_t event; /* Event flags */
943};
944
945struct ccb_immediate_notify {
946 struct ccb_hdr ccb_h;
947 u_int tag_id; /* Tag for immediate notify */
948 u_int seq_id; /* Tag for target of notify */
949 u_int initiator_id; /* Initiator Identifier */
950 u_int arg; /* Function specific */
951};
952
953struct ccb_notify_acknowledge {
954 struct ccb_hdr ccb_h;
955 u_int tag_id; /* Tag for immediate notify */
956 u_int seq_id; /* Tar for target of notify */
957 u_int initiator_id; /* Initiator Identifier */
958 u_int arg; /* Function specific */
959};
960
864/* HBA engine structures. */
865
866typedef enum {
867 EIT_BUFFER, /* Engine type: buffer memory */
868 EIT_LOSSLESS, /* Engine type: lossless compression */
869 EIT_LOSSY, /* Engine type: lossy compression */
870 EIT_ENCRYPT /* Engine type: encryption */
871} ei_type;

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

930 struct ccb_relsim crs;
931 struct ccb_setasync csa;
932 struct ccb_setdev csd;
933 struct ccb_pathstats cpis;
934 struct ccb_getdevstats cgds;
935 struct ccb_dev_match cdm;
936 struct ccb_trans_settings cts;
937 struct ccb_calc_geometry ccg;
961/* HBA engine structures. */
962
963typedef enum {
964 EIT_BUFFER, /* Engine type: buffer memory */
965 EIT_LOSSLESS, /* Engine type: lossless compression */
966 EIT_LOSSY, /* Engine type: lossy compression */
967 EIT_ENCRYPT /* Engine type: encryption */
968} ei_type;

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

1027 struct ccb_relsim crs;
1028 struct ccb_setasync csa;
1029 struct ccb_setdev csd;
1030 struct ccb_pathstats cpis;
1031 struct ccb_getdevstats cgds;
1032 struct ccb_dev_match cdm;
1033 struct ccb_trans_settings cts;
1034 struct ccb_calc_geometry ccg;
1035 struct ccb_sim_knob knob;
938 struct ccb_abort cab;
939 struct ccb_resetbus crb;
940 struct ccb_resetdev crd;
941 struct ccb_termio tio;
942 struct ccb_accept_tio atio;
943 struct ccb_scsiio ctio;
944 struct ccb_en_lun cel;
945 struct ccb_immed_notify cin;
946 struct ccb_notify_ack cna;
1036 struct ccb_abort cab;
1037 struct ccb_resetbus crb;
1038 struct ccb_resetdev crd;
1039 struct ccb_termio tio;
1040 struct ccb_accept_tio atio;
1041 struct ccb_scsiio ctio;
1042 struct ccb_en_lun cel;
1043 struct ccb_immed_notify cin;
1044 struct ccb_notify_ack cna;
1045 struct ccb_immediate_notify cin1;
1046 struct ccb_notify_acknowledge cna2;
947 struct ccb_eng_inq cei;
948 struct ccb_eng_exec cee;
949 struct ccb_rescan crcn;
950 struct ccb_debug cdbg;
951 struct ccb_ataio ataio;
952};
953
954__BEGIN_DECLS

--- 84 unchanged lines hidden ---
1047 struct ccb_eng_inq cei;
1048 struct ccb_eng_exec cee;
1049 struct ccb_rescan crcn;
1050 struct ccb_debug cdbg;
1051 struct ccb_ataio ataio;
1052};
1053
1054__BEGIN_DECLS

--- 84 unchanged lines hidden ---