1 /* This dissector is based on the SBC2 specification.
9 * Some DATA IN/OUT PDUs are missing as well.
12 * Dissector for the SCSI SBC commandset
13 * Extracted from packet-scsi.c
15 * Dinesh G Dutt (ddutt@cisco.com)
16 * Ronnie sahlberg 2006
20 * Wireshark - Network traffic analyzer
21 * By Gerald Combs <gerald@wireshark.org>
22 * Copyright 2002 Gerald Combs
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License
26 * as published by the Free Software Foundation; either version 2
27 * of the License, or (at your option) any later version.
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * You should have received a copy of the GNU General Public License
35 * along with this program; if not, write to the Free Software
36 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
45 #include <epan/strutil.h>
46 #include <epan/packet.h>
47 #include <epan/conversation.h>
49 #include "packet-scsi.h"
50 #include "packet-fc.h"
51 #include "packet-scsi-sbc.h"
54 static int proto_scsi_sbc = -1;
55 int hf_scsi_sbc_opcode = -1;
56 static int hf_scsi_sbc_formatunit_flags = -1;
57 static int hf_scsi_sbc_defect_list_format = -1;
58 static int hf_scsi_sbc_formatunit_vendor = -1;
59 static int hf_scsi_sbc_formatunit_interleave = -1;
60 static int hf_scsi_sbc_rdwr6_lba = -1;
61 static int hf_scsi_sbc_rdwr6_xferlen = -1;
62 static int hf_scsi_sbc_rdwr10_lba = -1;
63 static int hf_scsi_sbc_rdwr10_xferlen = -1;
64 static int hf_scsi_sbc_rdwr12_xferlen = -1;
65 static int hf_scsi_sbc_rdwr16_lba = -1;
66 static int hf_scsi_sbc_ssu_immed_flags = -1;
67 static int hf_scsi_sbc_ssu_immed = -1;
68 static int hf_scsi_sbc_ssu_pwr_flags = -1;
69 static int hf_scsi_sbc_ssu_pwr_cond = -1;
70 static int hf_scsi_sbc_ssu_loej = -1;
71 static int hf_scsi_sbc_ssu_start = -1;
72 static int hf_scsi_sbc_bytchk = -1;
73 static int hf_scsi_sbc_verify_reladdr = -1;
74 static int hf_scsi_sbc_verify_lba = -1;
75 static int hf_scsi_sbc_verify_lba64 = -1;
76 static int hf_scsi_sbc_verify_vlen = -1;
77 static int hf_scsi_sbc_verify_vlen32 = -1;
78 static int hf_scsi_sbc_wrverify_lba = -1;
79 static int hf_scsi_sbc_wrverify_xferlen = -1;
80 static int hf_scsi_sbc_wrverify_lba64 = -1;
81 static int hf_scsi_sbc_wrverify_xferlen32 = -1;
82 static int hf_scsi_sbc_readcapacity_flags = -1;
83 static int hf_scsi_sbc_readcapacity_lba = -1;
84 static int hf_scsi_sbc_readdefdata_flags = -1;
85 static int hf_scsi_sbc_reassignblks_flags = -1;
86 static int hf_scsi_sbc_read_flags = -1;
87 static int hf_scsi_sbc_alloclen32 = -1;
88 static int hf_scsi_sbc_alloclen16 = -1;
89 static int hf_scsi_sbc_fuflags_fmtpinfo = -1;
90 static int hf_scsi_sbc_fuflags_rto_req = -1;
91 static int hf_scsi_sbc_fuflags_longlist = -1;
92 static int hf_scsi_sbc_fuflags_fmtdata = -1;
93 static int hf_scsi_sbc_fuflags_cmplist = -1;
94 static int hf_scsi_sbc_prefetch_flags = -1;
95 static int hf_scsi_sbc_prefetch_immed = -1;
96 static int hf_scsi_sbc_group = -1;
97 static int hf_scsi_sbc_rdprotect = -1;
98 static int hf_scsi_sbc_dpo = -1;
99 static int hf_scsi_sbc_fua = -1;
100 static int hf_scsi_sbc_fua_nv = -1;
101 static int hf_scsi_sbc_pmi_flags = -1;
102 static int hf_scsi_sbc_pmi = -1;
103 static int hf_scsi_sbc_blocksize = -1;
104 static int hf_scsi_sbc_returned_lba = -1;
105 static int hf_scsi_sbc_req_plist = -1;
106 static int hf_scsi_sbc_req_glist = -1;
107 static int hf_scsi_sbc_corrct_flags = -1;
108 static int hf_scsi_sbc_corrct = -1;
109 static int hf_scsi_sbc_reassignblocks_longlba = -1;
110 static int hf_scsi_sbc_reassignblocks_longlist = -1;
111 static int hf_scsi_sbc_synccache_flags = -1;
112 static int hf_scsi_sbc_synccache_immed = -1;
113 static int hf_scsi_sbc_synccache_sync_nv = -1;
114 static int hf_scsi_sbc_vrprotect = -1;
115 static int hf_scsi_sbc_verify_flags = -1;
116 static int hf_scsi_sbc_wrprotect = -1;
117 static int hf_scsi_sbc_wrverify_flags = -1;
118 static int hf_scsi_sbc_writesame_flags = -1;
119 static int hf_scsi_sbc_pbdata = -1;
120 static int hf_scsi_sbc_lbdata = -1;
121 static int hf_scsi_sbc_xdread_flags = -1;
122 static int hf_scsi_sbc_xorpinfo = -1;
123 static int hf_scsi_sbc_disable_write = -1;
124 static int hf_scsi_sbc_xdwrite_flags = -1;
125 static int hf_scsi_sbc_xdwriteread_flags = -1;
126 static int hf_scsi_sbc_xpwrite_flags = -1;
128 static gint ett_scsi_format_unit = -1;
129 static gint ett_scsi_prefetch = -1;
130 static gint ett_scsi_rdwr = -1;
131 static gint ett_scsi_xdread = -1;
132 static gint ett_scsi_xdwrite = -1;
133 static gint ett_scsi_xdwriteread = -1;
134 static gint ett_scsi_xpwrite = -1;
135 static gint ett_scsi_pmi = -1;
136 static gint ett_scsi_defectdata = -1;
137 static gint ett_scsi_corrct = -1;
138 static gint ett_scsi_reassign_blocks = -1;
139 static gint ett_scsi_ssu_immed = -1;
140 static gint ett_scsi_ssu_pwr = -1;
141 static gint ett_scsi_synccache = -1;
142 static gint ett_scsi_verify = -1;
143 static gint ett_scsi_wrverify = -1;
144 static gint ett_scsi_writesame = -1;
148 static const true_false_string dpo_tfs = {
149 "Disable Page Out (don't cache this data)",
150 "Disable page out is DISABLED (cache this data)"
152 static const true_false_string fua_tfs = {
153 "Read from the medium, not cache",
154 "Read from cache if possible"
156 static const true_false_string fua_nv_tfs = {
157 "Read from volatile cache is NOT permitted",
158 "Read from volatile or non-volatile cache permitted"
160 static const true_false_string pmi_tfs = {
166 dissect_sbc_formatunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
167 guint offset, gboolean isreq, gboolean iscdb,
168 guint payload_len _U_, scsi_task_data_t *cdata _U_)
171 static const int *fuflags_fields[] = {
172 &hf_scsi_sbc_fuflags_fmtpinfo,
173 &hf_scsi_sbc_fuflags_rto_req,
174 &hf_scsi_sbc_fuflags_longlist,
175 &hf_scsi_sbc_fuflags_fmtdata,
176 &hf_scsi_sbc_fuflags_cmplist,
177 &hf_scsi_sbc_defect_list_format,
184 if (isreq && iscdb) {
185 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_formatunit_flags, ett_scsi_format_unit, fuflags_fields, FALSE);
187 proto_tree_add_item (tree, hf_scsi_sbc_formatunit_vendor, tvb, offset+1,
189 proto_tree_add_item (tree, hf_scsi_sbc_formatunit_interleave, tvb, offset+2,
191 flags = tvb_get_guint8 (tvb, offset+4);
192 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
194 "Vendor Unique = %u, NACA = %u, Link = %u",
195 flags & 0xC0, flags & 0x4, flags & 0x1);
197 /* TODO : add dissection of DATA */
201 dissect_sbc_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
202 guint offset, gboolean isreq, gboolean iscdb,
203 guint payload_len _U_, scsi_task_data_t *cdata _U_)
207 if (isreq && iscdb) {
208 if (check_col (pinfo->cinfo, COL_INFO))
209 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
210 tvb_get_ntoh24 (tvb, offset),
211 tvb_get_guint8 (tvb, offset+3));
214 if (tree && isreq && iscdb) {
215 proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_lba, tvb, offset, 3, 0);
216 proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_xferlen, tvb, offset+3, 1, 0);
217 flags = tvb_get_guint8 (tvb, offset+4);
218 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
220 "Vendor Unique = %u, NACA = %u, Link = %u",
221 flags & 0xC0, flags & 0x4, flags & 0x1);
226 dissect_sbc_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
227 guint offset, gboolean isreq, gboolean iscdb,
228 guint payload_len _U_, scsi_task_data_t *cdata _U_)
232 if (isreq && iscdb) {
233 if (check_col (pinfo->cinfo, COL_INFO))
234 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
235 tvb_get_ntoh24 (tvb, offset),
236 tvb_get_guint8 (tvb, offset+3));
239 if (tree && isreq && iscdb) {
240 proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_lba, tvb, offset, 3, 0);
241 proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_xferlen, tvb, offset+3, 1, 0);
242 flags = tvb_get_guint8 (tvb, offset+4);
243 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
245 "Vendor Unique = %u, NACA = %u, Link = %u",
246 flags & 0xC0, flags & 0x4, flags & 0x1);
251 dissect_sbc_prefetch10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
252 guint offset, gboolean isreq, gboolean iscdb,
253 guint payload_len _U_, scsi_task_data_t *cdata _U_)
257 static const int *prefetch_fields[] = {
258 &hf_scsi_sbc_prefetch_immed,
262 if (isreq && iscdb) {
263 if (check_col (pinfo->cinfo, COL_INFO))
264 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
265 tvb_get_ntohl (tvb, offset+1),
266 tvb_get_ntohs (tvb, offset+6));
269 if (tree && isreq && iscdb) {
270 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_prefetch_flags, ett_scsi_prefetch, prefetch_fields, FALSE);
272 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
274 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
276 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
277 flags = tvb_get_guint8 (tvb, offset+8);
278 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
280 "Vendor Unique = %u, NACA = %u, Link = %u",
281 flags & 0xC0, flags & 0x4, flags & 0x1);
286 dissect_sbc_synchronizecache10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
287 guint offset, gboolean isreq, gboolean iscdb,
288 guint payload_len _U_, scsi_task_data_t *cdata _U_)
292 static const int *sync_fields[] = {
293 &hf_scsi_sbc_synccache_sync_nv,
294 &hf_scsi_sbc_synccache_immed,
298 if (isreq && iscdb) {
299 if (check_col (pinfo->cinfo, COL_INFO))
300 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
301 tvb_get_ntohl (tvb, offset+1),
302 tvb_get_ntohs (tvb, offset+6));
305 if (tree && isreq && iscdb) {
306 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_synccache_flags, ett_scsi_synccache, sync_fields, FALSE);
308 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
310 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
312 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
313 flags = tvb_get_guint8 (tvb, offset+8);
314 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
316 "Vendor Unique = %u, NACA = %u, Link = %u",
317 flags & 0xC0, flags & 0x4, flags & 0x1);
322 dissect_sbc_synchronizecache16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
323 guint offset, gboolean isreq, gboolean iscdb,
324 guint payload_len _U_, scsi_task_data_t *cdata _U_)
328 static const int *sync_fields[] = {
329 &hf_scsi_sbc_synccache_sync_nv,
330 &hf_scsi_sbc_synccache_immed,
334 if (isreq && iscdb) {
335 if (check_col (pinfo->cinfo, COL_INFO))
336 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
337 tvb_get_ntoh64 (tvb, offset+1),
338 tvb_get_ntohl (tvb, offset+9));
341 if (tree && isreq && iscdb) {
342 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_synccache_flags, ett_scsi_synccache, sync_fields, FALSE);
344 proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, 0);
345 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, 0);
346 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
348 flags = tvb_get_guint8 (tvb, offset+14);
349 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
351 "Vendor Unique = %u, NACA = %u, Link = %u",
352 flags & 0xC0, flags & 0x4, flags & 0x1);
357 dissect_sbc_prefetch16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
358 guint offset, gboolean isreq, gboolean iscdb,
359 guint payload_len _U_, scsi_task_data_t *cdata _U_)
363 static const int *prefetch_fields[] = {
364 &hf_scsi_sbc_prefetch_immed,
368 if (isreq && iscdb) {
369 if (check_col (pinfo->cinfo, COL_INFO))
370 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
371 tvb_get_ntoh64 (tvb, offset+1),
372 tvb_get_ntohl (tvb, offset+9));
375 if (tree && isreq && iscdb) {
376 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_prefetch_flags, ett_scsi_prefetch, prefetch_fields, FALSE);
378 proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, 0);
379 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, 0);
380 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
382 flags = tvb_get_guint8 (tvb, offset+14);
383 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
385 "Vendor Unique = %u, NACA = %u, Link = %u",
386 flags & 0xC0, flags & 0x4, flags & 0x1);
391 dissect_sbc_read10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
392 guint offset, gboolean isreq, gboolean iscdb,
393 guint payload_len _U_, scsi_task_data_t *cdata _U_)
397 static const int *rdwr10_fields[] = {
398 &hf_scsi_sbc_rdprotect,
405 if (isreq && iscdb) {
406 if (check_col (pinfo->cinfo, COL_INFO))
407 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
408 tvb_get_ntohl (tvb, offset+1),
409 tvb_get_ntohs (tvb, offset+6));
412 if (tree && isreq && iscdb) {
413 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr10_fields, FALSE);
415 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
416 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
418 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
419 flags = tvb_get_guint8 (tvb, offset+8);
420 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
422 "Vendor Unique = %u, NACA = %u, Link = %u",
423 flags & 0xC0, flags & 0x4, flags & 0x1);
428 dissect_sbc_xdread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
429 guint offset, gboolean isreq, gboolean iscdb,
430 guint payload_len _U_, scsi_task_data_t *cdata _U_)
434 static const int *xdread10_fields[] = {
435 &hf_scsi_sbc_xorpinfo,
439 if (isreq && iscdb) {
440 if (check_col (pinfo->cinfo, COL_INFO))
441 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
442 tvb_get_ntohl (tvb, offset+1),
443 tvb_get_ntohs (tvb, offset+6));
446 if (tree && isreq && iscdb) {
447 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdread_flags, ett_scsi_xdread, xdread10_fields, FALSE);
449 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
450 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
452 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
453 flags = tvb_get_guint8 (tvb, offset+8);
454 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
456 "Vendor Unique = %u, NACA = %u, Link = %u",
457 flags & 0xC0, flags & 0x4, flags & 0x1);
462 dissect_sbc_xdwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
463 guint offset, gboolean isreq, gboolean iscdb,
464 guint payload_len _U_, scsi_task_data_t *cdata _U_)
468 static const int *xdwrite10_fields[] = {
469 &hf_scsi_sbc_wrprotect,
472 &hf_scsi_sbc_disable_write,
477 if (isreq && iscdb) {
478 if (check_col (pinfo->cinfo, COL_INFO))
479 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
480 tvb_get_ntohl (tvb, offset+1),
481 tvb_get_ntohs (tvb, offset+6));
484 if (tree && isreq && iscdb) {
485 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdwrite_flags, ett_scsi_xdwrite, xdwrite10_fields, FALSE);
487 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
488 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
490 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
491 flags = tvb_get_guint8 (tvb, offset+8);
492 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
494 "Vendor Unique = %u, NACA = %u, Link = %u",
495 flags & 0xC0, flags & 0x4, flags & 0x1);
500 dissect_sbc_xdwriteread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
501 guint offset, gboolean isreq, gboolean iscdb,
502 guint payload_len _U_, scsi_task_data_t *cdata _U_)
506 static const int *xdwriteread10_fields[] = {
507 &hf_scsi_sbc_wrprotect,
510 &hf_scsi_sbc_disable_write,
512 &hf_scsi_sbc_xorpinfo,
516 if (isreq && iscdb) {
517 if (check_col (pinfo->cinfo, COL_INFO))
518 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
519 tvb_get_ntohl (tvb, offset+1),
520 tvb_get_ntohs (tvb, offset+6));
523 if (tree && isreq && iscdb) {
524 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdwriteread_flags, ett_scsi_xdwriteread, xdwriteread10_fields, FALSE);
526 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
527 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
529 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
530 flags = tvb_get_guint8 (tvb, offset+8);
531 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
533 "Vendor Unique = %u, NACA = %u, Link = %u",
534 flags & 0xC0, flags & 0x4, flags & 0x1);
539 dissect_sbc_xpwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
540 guint offset, gboolean isreq, gboolean iscdb,
541 guint payload_len _U_, scsi_task_data_t *cdata _U_)
545 static const int *xpwrite10_fields[] = {
549 &hf_scsi_sbc_xorpinfo,
553 if (isreq && iscdb) {
554 if (check_col (pinfo->cinfo, COL_INFO))
555 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
556 tvb_get_ntohl (tvb, offset+1),
557 tvb_get_ntohs (tvb, offset+6));
560 if (tree && isreq && iscdb) {
561 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xpwrite_flags, ett_scsi_xpwrite, xpwrite10_fields, FALSE);
563 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
564 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
566 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
567 flags = tvb_get_guint8 (tvb, offset+8);
568 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
570 "Vendor Unique = %u, NACA = %u, Link = %u",
571 flags & 0xC0, flags & 0x4, flags & 0x1);
576 dissect_sbc_write10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
577 guint offset, gboolean isreq, gboolean iscdb,
578 guint payload_len _U_, scsi_task_data_t *cdata _U_)
582 static const int *rdwr10_fields[] = {
583 &hf_scsi_sbc_wrprotect,
590 if (isreq && iscdb) {
591 if (check_col (pinfo->cinfo, COL_INFO))
592 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
593 tvb_get_ntohl (tvb, offset+1),
594 tvb_get_ntohs (tvb, offset+6));
597 if (tree && isreq && iscdb) {
598 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr10_fields, FALSE);
600 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
601 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
603 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, 0);
604 flags = tvb_get_guint8 (tvb, offset+8);
605 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
607 "Vendor Unique = %u, NACA = %u, Link = %u",
608 flags & 0xC0, flags & 0x4, flags & 0x1);
613 dissect_sbc_read12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
614 guint offset, gboolean isreq, gboolean iscdb,
615 guint payload_len _U_, scsi_task_data_t *cdata _U_)
618 static const int *rdwr12_fields[] = {
619 &hf_scsi_sbc_rdprotect,
626 if (isreq && iscdb) {
627 if (check_col (pinfo->cinfo, COL_INFO))
628 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
629 tvb_get_ntohl (tvb, offset+1),
630 tvb_get_ntohl (tvb, offset+5));
633 if (tree && isreq && iscdb) {
634 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr12_fields, FALSE);
636 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
637 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+5, 4, 0);
638 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, 0);
640 flags = tvb_get_guint8 (tvb, offset+10);
641 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
643 "Vendor Unique = %u, NACA = %u, Link = %u",
644 flags & 0xC0, flags & 0x4, flags & 0x1);
648 dissect_sbc_write12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
649 guint offset, gboolean isreq, gboolean iscdb,
650 guint payload_len _U_, scsi_task_data_t *cdata _U_)
653 static const int *rdwr12_fields[] = {
654 &hf_scsi_sbc_wrprotect,
661 if (isreq && iscdb) {
662 if (check_col (pinfo->cinfo, COL_INFO))
663 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
664 tvb_get_ntohl (tvb, offset+1),
665 tvb_get_ntohl (tvb, offset+5));
668 if (tree && isreq && iscdb) {
669 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr12_fields, FALSE);
671 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
672 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+5, 4, 0);
673 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, 0);
675 flags = tvb_get_guint8 (tvb, offset+10);
676 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
678 "Vendor Unique = %u, NACA = %u, Link = %u",
679 flags & 0xC0, flags & 0x4, flags & 0x1);
684 dissect_sbc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
685 guint offset, gboolean isreq, gboolean iscdb,
686 guint payload_len _U_, scsi_task_data_t *cdata _U_)
689 static const int *rdwr16_fields[] = {
690 &hf_scsi_sbc_rdprotect,
697 if (isreq && iscdb) {
698 if (check_col (pinfo->cinfo, COL_INFO))
699 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
700 tvb_get_ntoh64 (tvb, offset+1),
701 tvb_get_ntohl (tvb, offset+9));
704 if (tree && isreq && iscdb) {
705 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, FALSE);
707 proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, 0);
708 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, 0);
709 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
711 flags = tvb_get_guint8 (tvb, offset+14);
712 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
714 "Vendor Unique = %u, NACA = %u, Link = %u",
715 flags & 0xC0, flags & 0x4, flags & 0x1);
719 dissect_sbc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
720 guint offset, gboolean isreq, gboolean iscdb,
721 guint payload_len _U_, scsi_task_data_t *cdata _U_)
724 static const int *rdwr16_fields[] = {
725 &hf_scsi_sbc_wrprotect,
732 if (isreq && iscdb) {
733 if (check_col (pinfo->cinfo, COL_INFO))
734 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
735 tvb_get_ntoh64 (tvb, offset+1),
736 tvb_get_ntohl (tvb, offset+9));
739 if (tree && isreq && iscdb) {
740 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags, ett_scsi_rdwr, rdwr16_fields, FALSE);
742 proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, 0);
743 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, 0);
744 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
746 flags = tvb_get_guint8 (tvb, offset+14);
747 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
749 "Vendor Unique = %u, NACA = %u, Link = %u",
750 flags & 0xC0, flags & 0x4, flags & 0x1);
755 static const value_string scsi_ssu_pwrcnd_val[] = {
757 {0x1, "Place Device In Active Condition"},
758 {0x2, "Place device into Idle condition"},
759 {0x3, "Place device into Standby condition"},
761 {0x5, "Place device into Sleep condition"},
763 {0x7, "Transfer control of power conditions to block device"},
766 {0xA, "Force Idle Condition Timer to zero"},
767 {0xB, "Force Standby Condition Timer to zero"},
772 dissect_sbc_startstopunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
773 guint offset, gboolean isreq _U_, gboolean iscdb,
774 guint payload_len _U_, scsi_task_data_t *cdata _U_)
777 static const int *ssu_fields[] = {
778 &hf_scsi_sbc_ssu_immed,
781 static const int *pwr_fields[] = {
782 &hf_scsi_sbc_ssu_pwr_cond,
783 &hf_scsi_sbc_ssu_loej,
784 &hf_scsi_sbc_ssu_start,
791 if (isreq && iscdb) {
792 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_ssu_immed_flags, ett_scsi_ssu_immed, ssu_fields, FALSE);
794 proto_tree_add_bitmask(tree, tvb, offset+3, hf_scsi_sbc_ssu_pwr_flags, ett_scsi_ssu_pwr, pwr_fields, FALSE);
797 flags = tvb_get_guint8 (tvb, offset+4);
798 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
800 "Vendor Unique = %u, NACA = %u, Link = %u",
801 flags & 0xC0, flags & 0x4, flags & 0x1);
806 dissect_sbc_verify10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
807 guint offset, gboolean isreq, gboolean iscdb,
808 guint payload_len _U_, scsi_task_data_t *cdata _U_)
812 static const int *verify10_fields[] = {
813 &hf_scsi_sbc_vrprotect,
819 if (isreq && iscdb) {
820 if (check_col (pinfo->cinfo, COL_INFO))
821 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
822 tvb_get_ntohl (tvb, offset+1),
823 tvb_get_ntohs (tvb, offset+6));
826 if (tree && isreq && iscdb) {
827 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags, ett_scsi_verify, verify10_fields, FALSE);
829 proto_tree_add_item (tree, hf_scsi_sbc_verify_lba, tvb, offset+1, 4, 0);
830 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
832 proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen, tvb, offset+6, 2, 0);
833 flags = tvb_get_guint8 (tvb, offset+8);
834 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
836 "Vendor Unique = %u, NACA = %u, Link = %u",
837 flags & 0xC0, flags & 0x4, flags & 0x1);
842 dissect_sbc_verify12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
843 guint offset, gboolean isreq, gboolean iscdb,
844 guint payload_len _U_, scsi_task_data_t *cdata _U_)
848 static const int *verify12_fields[] = {
849 &hf_scsi_sbc_vrprotect,
855 if (isreq && iscdb) {
856 if (check_col (pinfo->cinfo, COL_INFO))
857 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
858 tvb_get_ntohl (tvb, offset+1),
859 tvb_get_ntohl (tvb, offset+5));
862 if (isreq && iscdb) {
863 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags, ett_scsi_verify, verify12_fields, FALSE);
866 proto_tree_add_item (tree, hf_scsi_sbc_verify_lba, tvb, offset+1, 4, 0);
867 proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen32, tvb, offset+5, 4, 0);
869 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, 0);
871 flags = tvb_get_guint8 (tvb, offset+10);
872 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
874 "Vendor Unique = %u, NACA = %u, Link = %u",
875 flags & 0xC0, flags & 0x4, flags & 0x1);
880 dissect_sbc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
881 guint offset, gboolean isreq, gboolean iscdb,
882 guint payload_len _U_, scsi_task_data_t *cdata _U_)
886 static const int *verify16_fields[] = {
887 &hf_scsi_sbc_vrprotect,
893 if (isreq && iscdb) {
894 if (check_col (pinfo->cinfo, COL_INFO))
895 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
896 tvb_get_ntoh64 (tvb, offset+1),
897 tvb_get_ntohl (tvb, offset+9));
900 if (isreq && iscdb) {
901 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags, ett_scsi_verify, verify16_fields, FALSE);
903 proto_tree_add_item (tree, hf_scsi_sbc_verify_lba64, tvb, offset+1, 8, 0);
904 proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen32, tvb, offset+9, 4, 0);
905 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
907 flags = tvb_get_guint8 (tvb, offset+14);
908 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
910 "Vendor Unique = %u, NACA = %u, Link = %u",
911 flags & 0xC0, flags & 0x4, flags & 0x1);
917 dissect_sbc_wrverify10 (tvbuff_t *tvb, packet_info *pinfo _U_,
918 proto_tree *tree, guint offset, gboolean isreq,
919 gboolean iscdb, guint payload_len _U_,
920 scsi_task_data_t *cdata _U_)
924 static const int *wrverify10_fields[] = {
925 &hf_scsi_sbc_wrprotect,
931 if (isreq && iscdb) {
932 if (check_col (pinfo->cinfo, COL_INFO))
933 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
934 tvb_get_ntohl (tvb, offset+1),
935 tvb_get_ntohs (tvb, offset+6));
938 if (tree && isreq && iscdb) {
939 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags, ett_scsi_wrverify, wrverify10_fields, FALSE);
941 proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba, tvb, offset+1, 4, 0);
942 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
944 proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen, tvb, offset+6,
946 flags = tvb_get_guint8 (tvb, offset+8);
947 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
949 "Vendor Unique = %u, NACA = %u, Link = %u",
950 flags & 0xC0, flags & 0x4, flags & 0x1);
955 dissect_sbc_wrverify12 (tvbuff_t *tvb, packet_info *pinfo _U_,
956 proto_tree *tree, guint offset, gboolean isreq,
957 gboolean iscdb, guint payload_len _U_,
958 scsi_task_data_t *cdata _U_)
961 static const int *wrverify12_fields[] = {
962 &hf_scsi_sbc_wrprotect,
968 if (isreq && iscdb) {
969 if (check_col (pinfo->cinfo, COL_INFO))
970 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
971 tvb_get_ntohl (tvb, offset+1),
972 tvb_get_ntohl (tvb, offset+5));
975 if (tree && isreq && iscdb) {
976 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags, ett_scsi_wrverify, wrverify12_fields, FALSE);
978 proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba, tvb, offset+1, 4, 0);
979 proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen32, tvb, offset+5,
981 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, 0);
983 flags = tvb_get_guint8 (tvb, offset+10);
984 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
986 "Vendor Unique = %u, NACA = %u, Link = %u",
987 flags & 0xC0, flags & 0x4, flags & 0x1);
992 dissect_sbc_wrverify16 (tvbuff_t *tvb, packet_info *pinfo _U_,
993 proto_tree *tree, guint offset, gboolean isreq,
994 gboolean iscdb, guint payload_len _U_,
995 scsi_task_data_t *cdata _U_)
998 static const int *wrverify16_fields[] = {
999 &hf_scsi_sbc_wrprotect,
1001 &hf_scsi_sbc_bytchk,
1005 if (isreq && iscdb) {
1006 if (check_col (pinfo->cinfo, COL_INFO))
1007 col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
1008 tvb_get_ntoh64 (tvb, offset+1),
1009 tvb_get_ntohl (tvb, offset+9));
1012 if (tree && isreq && iscdb) {
1013 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags, ett_scsi_wrverify, wrverify16_fields, FALSE);
1015 proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba64, tvb, offset+1, 8, 0);
1016 proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen32, tvb, offset+9,
1018 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
1020 flags = tvb_get_guint8 (tvb, offset+14);
1021 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
1023 "Vendor Unique = %u, NACA = %u, Link = %u",
1024 flags & 0xC0, flags & 0x4, flags & 0x1);
1030 dissect_sbc_readcapacity10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1031 guint offset, gboolean isreq, gboolean iscdb,
1032 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1035 guint32 len, block_len, tot_len;
1037 static const int *pmi_fields[] = {
1045 if (isreq && iscdb) {
1046 proto_tree_add_item (tree, hf_scsi_sbc_readcapacity_lba, tvb, offset+1,
1048 proto_tree_add_bitmask(tree, tvb, offset+7, hf_scsi_sbc_pmi_flags, ett_scsi_pmi, pmi_fields, FALSE);
1051 flags = tvb_get_guint8 (tvb, offset+8);
1052 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
1054 "Vendor Unique = %u, NACA = %u, Link = %u",
1055 flags & 0xC0, flags & 0x4, flags & 0x1);
1058 len = tvb_get_ntohl (tvb, offset);
1059 block_len = tvb_get_ntohl (tvb, offset+4);
1060 tot_len=((len/1024)*block_len)/1024; /*MB*/
1066 proto_tree_add_uint_format (tree, hf_scsi_sbc_returned_lba, tvb, offset, 4, len, "LBA: %u (%u %s)", len, tot_len, un);
1067 proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+4, 4, 0);
1072 dissect_sbc_readdefectdata10 (tvbuff_t *tvb, packet_info *pinfo _U_,
1073 proto_tree *tree, guint offset, gboolean isreq,
1075 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1078 static const int *defect_fields[] = {
1079 &hf_scsi_sbc_defect_list_format,
1080 &hf_scsi_sbc_req_plist,
1081 &hf_scsi_sbc_req_glist,
1088 if (isreq && iscdb) {
1089 proto_tree_add_bitmask(tree, tvb, offset+1, hf_scsi_sbc_readdefdata_flags, ett_scsi_defectdata, defect_fields, FALSE);
1091 proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, 0);
1092 flags = tvb_get_guint8 (tvb, offset+8);
1093 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
1095 "Vendor Unique = %u, NACA = %u, Link = %u",
1096 flags & 0xC0, flags & 0x4, flags & 0x1);
1098 /* TODO : add dissection of DATA */
1103 dissect_sbc_readlong10 (tvbuff_t *tvb, packet_info *pinfo _U_,
1104 proto_tree *tree, guint offset, gboolean isreq,
1106 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1109 static const int *corrct_fields[] = {
1110 &hf_scsi_sbc_corrct,
1117 if (isreq && iscdb) {
1118 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_corrct_flags, ett_scsi_corrct, corrct_fields, FALSE);
1120 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
1122 proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, 0);
1123 flags = tvb_get_guint8 (tvb, offset+8);
1124 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
1126 "Vendor Unique = %u, NACA = %u, Link = %u",
1127 flags & 0xC0, flags & 0x4, flags & 0x1);
1132 dissect_sbc_writelong10 (tvbuff_t *tvb, packet_info *pinfo _U_,
1133 proto_tree *tree, guint offset, gboolean isreq,
1135 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1142 if (isreq && iscdb) {
1143 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
1145 proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, 0);
1146 flags = tvb_get_guint8 (tvb, offset+8);
1147 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
1149 "Vendor Unique = %u, NACA = %u, Link = %u",
1150 flags & 0xC0, flags & 0x4, flags & 0x1);
1155 dissect_sbc_writesame10 (tvbuff_t *tvb, packet_info *pinfo _U_,
1156 proto_tree *tree, guint offset, gboolean isreq,
1158 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1161 static const int *writesame10_fields[] = {
1162 &hf_scsi_sbc_wrprotect,
1163 &hf_scsi_sbc_pbdata,
1164 &hf_scsi_sbc_lbdata,
1171 if (isreq && iscdb) {
1172 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_writesame_flags, ett_scsi_writesame, writesame10_fields, FALSE);
1174 proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, 0);
1176 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, 0);
1178 proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, 0);
1179 flags = tvb_get_guint8 (tvb, offset+8);
1180 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
1182 "Vendor Unique = %u, NACA = %u, Link = %u",
1183 flags & 0xC0, flags & 0x4, flags & 0x1);
1188 dissect_sbc_writesame16 (tvbuff_t *tvb, packet_info *pinfo _U_,
1189 proto_tree *tree, guint offset, gboolean isreq,
1191 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1194 static const int *writesame16_fields[] = {
1195 &hf_scsi_sbc_wrprotect,
1196 &hf_scsi_sbc_pbdata,
1197 &hf_scsi_sbc_lbdata,
1204 if (isreq && iscdb) {
1205 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_writesame_flags, ett_scsi_writesame, writesame16_fields, FALSE);
1207 proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, 0);
1208 proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, 0);
1209 proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, 0);
1211 flags = tvb_get_guint8 (tvb, offset+14);
1212 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
1214 "Vendor Unique = %u, NACA = %u, Link = %u",
1215 flags & 0xC0, flags & 0x4, flags & 0x1);
1221 dissect_sbc_readdefectdata12 (tvbuff_t *tvb, packet_info *pinfo _U_,
1222 proto_tree *tree, guint offset, gboolean isreq,
1224 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1227 static const int *defect_fields[] = {
1228 &hf_scsi_sbc_defect_list_format,
1229 &hf_scsi_sbc_req_plist,
1230 &hf_scsi_sbc_req_glist,
1237 if (isreq && iscdb) {
1238 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_readdefdata_flags, ett_scsi_defectdata, defect_fields, FALSE);
1240 proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset+5, 4, 0);
1241 flags = tvb_get_guint8 (tvb, offset+10);
1242 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
1244 "Vendor Unique = %u, NACA = %u, Link = %u",
1245 flags & 0xC0, flags & 0x4, flags & 0x1);
1247 /* TODO : add dissection of DATA */
1252 dissect_sbc_reassignblocks (tvbuff_t *tvb, packet_info *pinfo _U_,
1253 proto_tree *tree, guint offset, gboolean isreq,
1255 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1258 static const int *reassign_fields[] = {
1259 &hf_scsi_sbc_reassignblocks_longlba,
1260 &hf_scsi_sbc_reassignblocks_longlist,
1267 if (isreq && iscdb) {
1268 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_reassignblks_flags, ett_scsi_reassign_blocks, reassign_fields, FALSE);
1270 flags = tvb_get_guint8 (tvb, offset+4);
1271 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
1273 "Vendor Unique = %u, NACA = %u, Link = %u",
1274 flags & 0xC0, flags & 0x4, flags & 0x1);
1276 /* TODO : add dissection of DATA */
1280 const value_string service_action_vals[] = {
1281 {SHORT_FORM_BLOCK_ID, "Short Form - Block ID"},
1282 {SHORT_FORM_VENDOR_SPECIFIC, "Short Form - Vendor-Specific"},
1283 {LONG_FORM, "Long Form"},
1284 {EXTENDED_FORM, "Extended Form"},
1285 {SERVICE_READ_CAPACITY16, "Read Capacity(16)"},
1286 {SERVICE_READ_LONG16, "Read Long(16)"},
1290 /* this is either readcapacity16 or readlong16 depending of what service
1294 dissect_sbc_serviceactionin16 (tvbuff_t *tvb, packet_info *pinfo _U_,
1295 proto_tree *tree, guint offset, gboolean isreq,
1297 guint payload_len _U_, scsi_task_data_t *cdata _U_)
1299 guint8 service_action, flags;
1301 guint64 len, tot_len;
1303 static const int *pmi_fields[] = {
1311 if (isreq && iscdb) {
1312 service_action = tvb_get_guint8 (tvb, offset) & 0x1F;
1313 if(cdata && cdata->itlq){
1314 cdata->itlq->flags=service_action;
1317 switch(service_action){
1318 case SERVICE_READ_CAPACITY16:
1319 proto_tree_add_text (tree, tvb, offset, 1,
1320 "Service Action: %s",
1321 val_to_str (service_action,
1322 service_action_vals,
1323 "Unknown (0x%02x)"));
1326 proto_tree_add_text (tree, tvb, offset, 8,
1327 "Logical Block Address: %" G_GINT64_MODIFIER "u",
1328 tvb_get_ntoh64 (tvb, offset));
1331 proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, 0);
1334 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_pmi_flags, ett_scsi_pmi, pmi_fields, FALSE);
1337 flags = tvb_get_guint8 (tvb, offset);
1338 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset, 1,
1340 "Vendor Unique = %u, NACA = %u, Link = %u",
1341 flags & 0xC0, flags & 0x4, flags & 0x1);
1345 case SERVICE_READ_LONG16:
1346 proto_tree_add_text (tree, tvb, offset, 1,
1347 "Service Action: %s",
1348 val_to_str (service_action,
1349 service_action_vals,
1350 "Unknown (0x%02x)"));
1353 proto_tree_add_text (tree, tvb, offset, 8,
1354 "Logical Block Address: %" G_GINT64_MODIFIER "u",
1355 tvb_get_ntoh64 (tvb, offset));
1358 /* two reserved bytes */
1361 proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset, 2, 0);
1367 flags = tvb_get_guint8 (tvb, offset);
1368 proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset, 1,
1370 "Vendor Unique = %u, NACA = %u, Link = %u",
1371 flags & 0xC0, flags & 0x4, flags & 0x1);
1376 } else if (!iscdb) {
1377 if(cdata && cdata->itlq){
1378 switch(cdata->itlq->flags){
1379 case SERVICE_READ_CAPACITY16:
1380 len = tvb_get_ntoh64 (tvb, offset);
1381 block_len = tvb_get_ntohl (tvb, offset+8);
1382 tot_len=((len/1024)*block_len)/1024; /*MB*/
1388 proto_tree_add_text (tree, tvb, offset, 8, "LBA: %" G_GINT64_MODIFIER "u (%" G_GINT64_MODIFIER "u %s)",
1390 proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+8, 4, 0);
1399 const value_string scsi_sbc_vals[] = {
1400 {SCSI_SPC_EXTCOPY , "Extended Copy"},
1401 {SCSI_SPC_INQUIRY , "Inquiry"},
1402 {SCSI_SBC_FORMATUNIT , "Format Unit"},
1403 {SCSI_SBC_LOCKUNLKCACHE10 , "Lock Unlock Cache(10)"},
1404 {SCSI_SBC_LOCKUNLKCACHE16 , "Lock Unlock Cache(16)"},
1405 {SCSI_SPC_LOGSELECT , "Log Select"},
1406 {SCSI_SPC_LOGSENSE , "Log Sense"},
1407 {SCSI_SPC_MODESELECT6 , "Mode Select(6)"},
1408 {SCSI_SPC_MODESELECT10 , "Mode Select(10)"},
1409 {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"},
1410 {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"},
1411 {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"},
1412 {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"},
1413 {SCSI_SBC_PREFETCH10 , "Pre-Fetch(10)"},
1414 {SCSI_SBC_PREFETCH16 , "Pre-Fetch(16)"},
1415 {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"},
1416 {SCSI_SBC_READ6 , "Read(6)"},
1417 {SCSI_SBC_READ10 , "Read(10)"},
1418 {SCSI_SBC_READ12 , "Read(12)"},
1419 {SCSI_SBC_READ16 , "Read(16)"},
1420 {SCSI_SBC_READCAPACITY10 , "Read Capacity(10)"},
1421 {SCSI_SPC_REPORTLUNS , "Report LUNs"},
1422 {SCSI_SPC_REQSENSE , "Request Sense"},
1423 {SCSI_SBC_SERVICEACTIONIN16 , "Service Action In(16)"},
1424 {SCSI_SBC_READDEFDATA10 , "Read Defect Data(10)"},
1425 {SCSI_SBC_READDEFDATA12 , "Read Defect Data(12)"},
1426 {SCSI_SBC_READLONG , "Read Long(10)"},
1427 {SCSI_SBC_REASSIGNBLKS , "Reassign Blocks"},
1428 {SCSI_SBC_REBUILD16 , "Rebuild(16)"},
1429 {SCSI_SBC_REBUILD32 , "Rebuild(32)"},
1430 {SCSI_SBC_REGENERATE16 , "Regenerate(16)"},
1431 {SCSI_SBC_REGENERATE32 , "Regenerate(32)"},
1432 {SCSI_SPC_RELEASE6 , "Release(6)"}, /* obsolete in SBC2 and later */
1433 {SCSI_SPC_RELEASE10 , "Release(10)"},/* obsolete in SBC2 and later */
1434 {SCSI_SPC_RESERVE6 , "Reserve(6)"}, /* obsolete in SBC2 and later */
1435 {SCSI_SPC_RESERVE10 , "Reserve(10)"},/* obsolete in SBC2 and later */
1436 {SCSI_SBC_SEEK10 , "Seek(10)"},
1437 {SCSI_SPC_SENDDIAG , "Send Diagnostic"},
1438 {SCSI_SBC_SETLIMITS10 , "Set Limits(10)"},
1439 {SCSI_SBC_SETLIMITS12 , "Set Limits(12)"},
1440 {SCSI_SBC_STARTSTOPUNIT , "Start Stop Unit"},
1441 {SCSI_SBC_SYNCCACHE10 , "Synchronize Cache(10)"},
1442 {SCSI_SBC_SYNCCACHE16 , "Synchronize Cache(16)"},
1443 {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"},
1444 {SCSI_SBC_VERIFY10 , "Verify(10)"},
1445 {SCSI_SBC_VERIFY12 , "Verify(12)"},
1446 {SCSI_SBC_VERIFY16 , "Verify(16)"},
1447 {SCSI_SBC_WRITE6 , "Write(6)"},
1448 {SCSI_SBC_WRITE10 , "Write(10)"},
1449 {SCSI_SBC_WRITE12 , "Write(12)"},
1450 {SCSI_SBC_WRITE16 , "Write(16)"},
1451 {SCSI_SPC_WRITEBUFFER , "Write Buffer"},
1452 {SCSI_SBC_WRITENVERIFY10 , "Write & Verify(10)"},
1453 {SCSI_SBC_WRITENVERIFY12 , "Write & Verify(12)"},
1454 {SCSI_SBC_WRITENVERIFY16 , "Write & Verify(16)"},
1455 {SCSI_SBC_WRITELONG , "Write Long"},
1456 {SCSI_SBC_WRITESAME10 , "Write Same(10)"},
1457 {SCSI_SBC_WRITESAME16 , "Write Same(16)"},
1458 {SCSI_SBC_XDREAD10 , "XdRead(10)"},
1459 {SCSI_SBC_XDREAD32 , "XdRead(32)"},
1460 {SCSI_SBC_XDWRITE10 , "XdWrite(10)"},
1461 {SCSI_SBC_XDWRITE32 , "XdWrite(32)"},
1462 {SCSI_SBC_XDWRITEREAD10 , "XdWriteRead(10)"},
1463 {SCSI_SBC_XDWRITEREAD32 , "XdWriteRead(32)"},
1464 {SCSI_SBC_XDWRITEEXTD16 , "XdWrite Extended(16)"},
1465 {SCSI_SBC_XDWRITEEXTD32 , "XdWrite Extended(32)"},
1466 {SCSI_SBC_XPWRITE10 , "XpWrite(10)"},
1467 {SCSI_SBC_XPWRITE32 , "XpWrite(32)"},
1471 scsi_cdb_table_t scsi_sbc_table[256] = {
1472 /*SPC 0x00*/{dissect_spc_testunitready},
1475 /*SPC 0x03*/{dissect_spc_requestsense},
1476 /*SBC 0x04*/{dissect_sbc_formatunit},
1479 /*SBC 0x07*/{dissect_sbc_reassignblocks},
1480 /*SBC 0x08*/{dissect_sbc_read6},
1482 /*SBC 0x0a*/{dissect_sbc_write6},
1490 /*SPC 0x12*/{dissect_spc_inquiry},
1493 /*SPC 0x15*/{dissect_spc_modeselect6},
1494 /*SBC 0x16*/{dissect_spc_reserve6}, /* obsolete in SBC2 and later */
1495 /*SBC 0x17*/{dissect_spc_release6}, /* obsolete in SBC2 and later */
1498 /*SPC 0x1a*/{dissect_spc_modesense6},
1499 /*SBC 0x1b*/{dissect_sbc_startstopunit},
1501 /*SPC 0x1d*/{dissect_spc_senddiagnostic},
1502 /*SBC 0x1e*/{dissect_spc_preventallowmediaremoval},
1509 /*SBC 0x25*/{dissect_sbc_readcapacity10},
1512 /*SBC 0x28*/{dissect_sbc_read10},
1514 /*SBC 0x2a*/{dissect_sbc_write10},
1518 /*SBC 0x2e*/{dissect_sbc_wrverify10},
1519 /*SBC 0x2f*/{dissect_sbc_verify10},
1524 /*SBC 0x34*/{dissect_sbc_prefetch10},
1525 /*SBC 0x35*/{dissect_sbc_synchronizecache10},
1527 /*SBC 0x37*/{dissect_sbc_readdefectdata10},
1531 /*SPC 0x3b*/{dissect_spc_writebuffer},
1534 /*SBC 0x3e*/{dissect_sbc_readlong10},
1535 /*SBC 0x3f*/{dissect_sbc_writelong10},
1537 /*SBC 0x41*/{dissect_sbc_writesame10},
1548 /*SPC 0x4c*/{dissect_spc_logselect},
1549 /*SPC 0x4d*/{dissect_spc_logsense},
1552 /*SBC 0x50*/{dissect_sbc_xdwrite10},
1553 /*SBC 0x51*/{dissect_sbc_xpwrite10},
1554 /*SBC 0x52*/{dissect_sbc_xdread10},
1555 /*SBC 0x53*/{dissect_sbc_xdwriteread10},
1557 /*SPC 0x55*/{dissect_spc_modeselect10},
1558 /*SPC 0x56*/{dissect_spc_reserve10},/* obsolete in SBC2 and later */
1559 /*SPC 0x57*/{dissect_spc_release10},/* obsolete in SBC2 and later */
1562 /*SPC 0x5a*/{dissect_spc_modesense10},
1566 /*SPC 0x5e*/{dissect_spc_persistentreservein},
1567 /*SPC 0x5f*/{dissect_spc_persistentreserveout},
1603 /*SPC 0x83*/{dissect_spc_extcopy},
1608 /*SBC 0x88*/{dissect_sbc_read16},
1610 /*SBC 0x8a*/{dissect_sbc_write16},
1614 /*SBC 0x8e*/{dissect_sbc_wrverify16},
1615 /*SBC 0x8f*/{dissect_sbc_verify16},
1616 /*SBC 0x90*/{dissect_sbc_prefetch16},
1617 /*SBC 0x91*/{dissect_sbc_synchronizecache16},
1619 /*SBC 0x93*/{dissect_sbc_writesame16},
1630 /*SBC 0x9e*/{dissect_sbc_serviceactionin16},
1632 /*SPC 0xa0*/{dissect_spc_reportluns},
1640 /*SBC 0xa8*/{dissect_sbc_read12},
1642 /*SBC 0xaa*/{dissect_sbc_write12},
1646 /*SBC 0xae*/{dissect_sbc_wrverify12},
1647 /*SBC 0xaf*/{dissect_sbc_verify12},
1655 /*SBC 0xb7*/{dissect_sbc_readdefectdata12},
1732 proto_register_scsi_sbc(void)
1734 static hf_register_info hf[] = {
1735 { &hf_scsi_sbc_opcode,
1736 {"SBC Opcode", "scsi.sbc.opcode", FT_UINT8, BASE_HEX,
1737 VALS (scsi_sbc_vals), 0x0, NULL, HFILL}},
1738 { &hf_scsi_sbc_formatunit_flags,
1739 {"Flags", "scsi.sbc.formatunit.flags", FT_UINT8, BASE_HEX, NULL, 0xF8,
1741 { &hf_scsi_sbc_defect_list_format,
1742 {"Defect List Format", "scsi.sbc.defect_list_format", FT_UINT8, BASE_DEC,
1743 NULL, 0x7, NULL, HFILL}},
1744 { &hf_scsi_sbc_formatunit_vendor,
1745 {"Vendor Unique", "scsi.sbc.formatunit.vendor", FT_UINT8, BASE_HEX, NULL,
1747 { &hf_scsi_sbc_formatunit_interleave,
1748 {"Interleave", "scsi.sbc.formatunit.interleave", FT_UINT16, BASE_HEX,
1749 NULL, 0x0, NULL, HFILL}},
1750 { &hf_scsi_sbc_rdwr6_lba,
1751 {"Logical Block Address (LBA)", "scsi.sbc.rdwr6.lba", FT_UINT24, BASE_DEC,
1752 NULL, 0x0FFFFF, NULL, HFILL}},
1753 { &hf_scsi_sbc_rdwr6_xferlen,
1754 {"Transfer Length", "scsi.sbc.rdwr6.xferlen", FT_UINT24, BASE_DEC, NULL, 0x0,
1756 { &hf_scsi_sbc_rdwr10_lba,
1757 {"Logical Block Address (LBA)", "scsi.sbc.rdwr10.lba", FT_UINT32, BASE_DEC,
1758 NULL, 0x0, NULL, HFILL}},
1759 { &hf_scsi_sbc_rdwr10_xferlen,
1760 {"Transfer Length", "scsi.sbc.rdwr10.xferlen", FT_UINT16, BASE_DEC, NULL,
1762 { &hf_scsi_sbc_rdwr12_xferlen,
1763 {"Transfer Length", "scsi.sbc.rdwr12.xferlen", FT_UINT32, BASE_DEC, NULL,
1765 { &hf_scsi_sbc_rdwr16_lba,
1766 {"Logical Block Address (LBA)", "scsi.sbc.rdwr16.lba", FT_BYTES, BASE_NONE,
1767 NULL, 0x0, NULL, HFILL}},
1768 { &hf_scsi_sbc_ssu_immed,
1769 {"Immediate", "scsi.sbc.ssu.immediate", FT_BOOLEAN, 8, NULL,
1770 0x01, NULL, HFILL}},
1771 { &hf_scsi_sbc_ssu_pwr_cond,
1772 {"Power Conditions", "scsi.sbc.ssu.pwr", FT_UINT8, BASE_HEX,
1773 VALS (scsi_ssu_pwrcnd_val), 0xF0, NULL, HFILL}},
1774 { &hf_scsi_sbc_ssu_loej,
1775 {"LOEJ", "scsi.sbc.ssu.loej", FT_BOOLEAN, 8, NULL, 0x2, NULL,
1777 { &hf_scsi_sbc_ssu_start,
1778 {"Start", "scsi.sbc.ssu.start", FT_BOOLEAN, 8, NULL, 0x1,
1780 { &hf_scsi_sbc_bytchk,
1781 {"BYTCHK", "scsi.sbc.bytchk", FT_BOOLEAN, 8,
1782 NULL, 0x02, NULL, HFILL}},
1783 { &hf_scsi_sbc_verify_reladdr,
1784 {"RELADDR", "scsi.sbc.verify.reladdr", FT_BOOLEAN, 8, NULL,
1786 { &hf_scsi_sbc_verify_lba,
1787 {"LBA", "scsi.sbc.verify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
1789 { &hf_scsi_sbc_verify_lba64,
1790 {"LBA", "scsi.sbc.verify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0, NULL,
1792 { &hf_scsi_sbc_verify_vlen,
1793 {"Verification Length", "scsi.sbc.verify.vlen", FT_UINT16,
1794 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1795 { &hf_scsi_sbc_verify_vlen32,
1796 {"Verification Length", "scsi.sbc.verify.vlen32", FT_UINT32,
1797 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1798 { &hf_scsi_sbc_wrverify_lba,
1799 {"LBA", "scsi.sbc.wrverify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
1801 { &hf_scsi_sbc_wrverify_xferlen,
1802 {"Transfer Length", "scsi.sbc.wrverify.xferlen", FT_UINT16, BASE_DEC,
1803 NULL, 0x0, NULL, HFILL}},
1804 { &hf_scsi_sbc_wrverify_lba64,
1805 {"LBA", "scsi.sbc.wrverify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0,
1807 { &hf_scsi_sbc_wrverify_xferlen32,
1808 {"Transfer Length", "scsi.sbc.wrverify.xferlen32", FT_UINT32,
1809 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1810 { &hf_scsi_sbc_readcapacity_flags,
1811 {"Flags", "scsi.sbc.readcapacity.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
1813 { &hf_scsi_sbc_readcapacity_lba,
1814 {"Logical Block Address", "scsi.sbc.readcapacity.lba", FT_UINT32, BASE_DEC,
1815 NULL, 0x0, NULL, HFILL}},
1816 { &hf_scsi_sbc_readdefdata_flags,
1817 {"Flags", "scsi.sbc.readdefdata.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1819 { &hf_scsi_sbc_reassignblks_flags,
1820 {"Flags", "scsi.sbc.reassignblks.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1822 { &hf_scsi_sbc_read_flags,
1823 {"Flags", "scsi.sbc.read.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1825 { &hf_scsi_sbc_alloclen32,
1826 {"Allocation Length", "scsi.sbc.alloclen32", FT_UINT32, BASE_DEC,
1827 NULL, 0x0, NULL, HFILL}},
1828 { &hf_scsi_sbc_alloclen16,
1829 {"Allocation Length", "scsi.sbc.alloclen16", FT_UINT16, BASE_DEC,
1830 NULL, 0x0, NULL, HFILL}},
1831 { &hf_scsi_sbc_fuflags_fmtpinfo,
1832 {"FMTPINFO", "scsi.sbc.format_unit.fmtpinfo", FT_BOOLEAN, 8,
1833 NULL, 0x80, NULL, HFILL}},
1834 { &hf_scsi_sbc_fuflags_rto_req,
1835 {"RTO_REQ", "scsi.sbc.format_unit.rto_req", FT_BOOLEAN, 8,
1836 NULL, 0x40, NULL, HFILL}},
1837 { &hf_scsi_sbc_fuflags_longlist,
1838 {"LONGLIST", "scsi.sbc.format_unit.longlist", FT_BOOLEAN, 8,
1839 NULL, 0x20, NULL, HFILL}},
1840 { &hf_scsi_sbc_fuflags_fmtdata,
1841 {"FMTDATA", "scsi.sbc.format_unit.fmtdata", FT_BOOLEAN, 8,
1842 NULL, 0x10, NULL, HFILL}},
1843 { &hf_scsi_sbc_fuflags_cmplist,
1844 {"CMPLIST", "scsi.sbc.format_unit.cmplist", FT_BOOLEAN, 8,
1845 NULL, 0x08, NULL, HFILL}},
1846 { &hf_scsi_sbc_prefetch_flags,
1847 {"Flags", "scsi.sbc.prefetch.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1849 { &hf_scsi_sbc_prefetch_immed,
1850 {"Immediate", "scsi.sbc.prefetch.immediate", FT_BOOLEAN, 8, NULL,
1852 { &hf_scsi_sbc_group,
1853 {"Group", "scsi.sbc.group", FT_UINT8, BASE_HEX, NULL,
1854 0x1f, NULL, HFILL}},
1855 { &hf_scsi_sbc_rdprotect,
1856 {"RDPROTECT", "scsi.sbc.rdprotect", FT_UINT8, BASE_HEX,
1857 NULL, 0xe0, NULL, HFILL}},
1859 {"DPO", "scsi.sbc.dpo", FT_BOOLEAN, 8,
1860 TFS(&dpo_tfs), 0x10, "DisablePageOut: Whether the device should cache the data or not", HFILL}},
1862 {"FUA", "scsi.sbc.fua", FT_BOOLEAN, 8,
1863 TFS(&fua_tfs), 0x08, "ForceUnitAccess: Whether to allow reading from the cache or not", HFILL}},
1864 { &hf_scsi_sbc_fua_nv,
1865 {"FUA_NV", "scsi.sbc.fua_nv", FT_BOOLEAN, 8,
1866 TFS(&fua_nv_tfs), 0x02, "ForceUnitAccess_NonVolatile: Whether to allow reading from non-volatile cache or not", HFILL}},
1868 {"PMI", "scsi.sbc.pmi", FT_BOOLEAN, 8,
1869 TFS(&pmi_tfs), 0x01, "Partial Medium Indicator", HFILL}},
1870 { &hf_scsi_sbc_pmi_flags,
1871 {"PMI Flags", "scsi.sbc.pmi_flags", FT_UINT8, BASE_HEX,
1872 NULL, 0, NULL, HFILL}},
1873 { &hf_scsi_sbc_blocksize,
1874 {"Block size in bytes", "scsi.sbc.blocksize", FT_UINT32, BASE_DEC,
1875 NULL, 0, NULL, HFILL}},
1876 { &hf_scsi_sbc_returned_lba,
1877 {"Returned LBA", "scsi.sbc.returned_lba", FT_UINT32, BASE_DEC,
1878 NULL, 0, NULL, HFILL}},
1879 { &hf_scsi_sbc_req_plist,
1880 {"REQ_PLIST", "scsi.sbc.req_plist", FT_BOOLEAN, 8,
1881 NULL, 0x10, NULL, HFILL}},
1882 { &hf_scsi_sbc_req_glist,
1883 {"REQ_GLIST", "scsi.sbc.req_glist", FT_BOOLEAN, 8,
1884 NULL, 0x08, NULL, HFILL}},
1885 { &hf_scsi_sbc_corrct,
1886 {"CORRCT", "scsi.sbc.corrct", FT_BOOLEAN, 8,
1887 NULL, 0x02, NULL, HFILL}},
1888 { &hf_scsi_sbc_corrct_flags,
1889 {"Flags", "scsi.sbc.corrct_flags", FT_UINT8, BASE_HEX,
1890 NULL, 0, NULL, HFILL}},
1891 { &hf_scsi_sbc_reassignblocks_longlba,
1892 {"LongLBA", "scsi.sbc.reassignblocks.longlba", FT_BOOLEAN, 8,
1893 NULL, 0x02, NULL, HFILL}},
1894 { &hf_scsi_sbc_reassignblocks_longlist,
1895 {"LongList", "scsi.sbc.reassignblocks.longlist", FT_BOOLEAN, 8,
1896 NULL, 0x01, NULL, HFILL}},
1897 { &hf_scsi_sbc_ssu_immed_flags,
1898 {"Immed flags", "scsi.sbc.ssu.immed_flags", FT_UINT8, BASE_HEX,
1899 NULL, 0, NULL, HFILL}},
1900 { &hf_scsi_sbc_ssu_pwr_flags,
1901 {"Pwr flags", "scsi.sbc.ssu.pwr_flags", FT_UINT8, BASE_HEX,
1902 NULL, 0, NULL, HFILL}},
1903 { &hf_scsi_sbc_synccache_flags,
1904 {"Flags", "scsi.sbc.synccache.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1906 { &hf_scsi_sbc_synccache_immed,
1907 {"Immediate", "scsi.sbc.synccache.immediate", FT_BOOLEAN, 8, NULL,
1908 0x02, NULL, HFILL}},
1909 { &hf_scsi_sbc_synccache_sync_nv,
1910 {"SYNC_NV", "scsi.sbc.synccache.sync_nv", FT_BOOLEAN, 8, NULL,
1911 0x04, NULL, HFILL}},
1912 { &hf_scsi_sbc_vrprotect,
1913 {"VRPROTECT", "scsi.sbc.vrprotect", FT_UINT8, BASE_HEX,
1914 NULL, 0xe0, NULL, HFILL}},
1915 { &hf_scsi_sbc_verify_flags,
1916 {"Flags", "scsi.sbc.verify_flags", FT_UINT8, BASE_HEX,
1917 NULL, 0, NULL, HFILL}},
1918 { &hf_scsi_sbc_wrprotect,
1919 {"WRPROTECT", "scsi.sbc.wrprotect", FT_UINT8, BASE_HEX,
1920 NULL, 0xe0, NULL, HFILL}},
1921 { &hf_scsi_sbc_wrverify_flags,
1922 {"Flags", "scsi.sbc.wrverify_flags", FT_UINT8, BASE_HEX,
1923 NULL, 0, NULL, HFILL}},
1924 { &hf_scsi_sbc_writesame_flags,
1925 {"Flags", "scsi.sbc.writesame_flags", FT_UINT8, BASE_HEX,
1926 NULL, 0, NULL, HFILL}},
1927 { &hf_scsi_sbc_pbdata,
1928 {"PBDATA", "scsi.sbc.pbdata", FT_BOOLEAN, 8, NULL,
1929 0x04, NULL, HFILL}},
1930 { &hf_scsi_sbc_lbdata,
1931 {"LBDATA", "scsi.sbc.lbdata", FT_BOOLEAN, 8, NULL,
1932 0x02, NULL, HFILL}},
1933 { &hf_scsi_sbc_xdread_flags,
1934 {"Flags", "scsi.sbc.xdread.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1936 { &hf_scsi_sbc_xorpinfo,
1937 {"XORPINFO", "scsi.sbc.xorpinfo", FT_BOOLEAN, 8, NULL,
1938 0x01, NULL, HFILL}},
1939 { &hf_scsi_sbc_disable_write,
1940 {"DISABLE_WRITE", "scsi.sbc.disable_write", FT_BOOLEAN, 8, NULL,
1941 0x04, NULL, HFILL}},
1942 { &hf_scsi_sbc_xdwrite_flags,
1943 {"Flags", "scsi.sbc.xdwrite.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1945 { &hf_scsi_sbc_xdwriteread_flags,
1946 {"Flags", "scsi.sbc.xdwriteread.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1948 { &hf_scsi_sbc_xpwrite_flags,
1949 {"Flags", "scsi.sbc.xpwrite.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
1954 /* Setup protocol subtree array */
1955 static gint *ett[] = {
1956 &ett_scsi_format_unit,
1962 &ett_scsi_xdwriteread,
1964 &ett_scsi_defectdata,
1966 &ett_scsi_reassign_blocks,
1967 &ett_scsi_ssu_immed,
1969 &ett_scsi_synccache,
1975 /* Register the protocol name and description */
1976 proto_scsi_sbc = proto_register_protocol("SCSI_SBC", "SCSI_SBC", "scsi_sbc");
1978 /* Required function calls to register the header fields and subtrees used */
1979 proto_register_field_array(proto_scsi_sbc, hf, array_length(hf));
1980 proto_register_subtree_array(ett, array_length(ett));
1984 proto_reg_handoff_scsi_sbc(void)