~ubuntu-branches/ubuntu/gutsy/wireshark/gutsy-security

« back to all changes in this revision

Viewing changes to epan/dissectors/packet-scsi.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2007-04-01 08:58:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070401085840-or3qhrpv8alt1bwg
Tags: 0.99.5-1
* New upstream release.
* debian/patches/09_idl2wrs.dpatch: updated to patch idl2wrs.sh.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* TODO make the contracts require that all functions be called with valid 
 
1
/* TODO make the contracts require that all functions be called with valid
2
2
 * pointers for itl and itlq and remove all tests for itl/itlq being NULL
3
3
 */
4
4
/* TODO audit value parameter for proto_tree_add_boolean() calls */
5
5
/* TODO scsi_verdesc_val needs to be updated from appendix D in spc-3 */
6
6
/* packet-scsi.c
7
 
 * Routines for decoding SCSI CDBs and responses
 
7
 * Routines for decoding SCSI CDBs and responsess
8
8
 * Author: Dinesh G Dutt (ddutt@cisco.com)
9
9
 *
10
 
 * $Id: packet-scsi.c 19534 2006-10-14 22:05:57Z sahlberg $
 
10
 * $Id: packet-scsi.c 20624 2007-01-30 17:14:37Z gerald $
11
11
 *
12
12
 * Wireshark - Network traffic analyzer
13
13
 * By Gerald Combs <gerald@wireshark.org>
62
62
 *
63
63
 * In addition to this, the other requirement made from the transport is to
64
64
 * provide ITL and ITLQ structures that are persistent.
65
 
 *   
 
65
 *
66
66
 * The ITL structure uniquely identifies a Initiator/Target/Lun combination
67
 
 * and is among other things used to keep track of the device type for a 
 
67
 * and is among other things used to keep track of the device type for a
68
68
 * specific LUN.
69
69
 *
70
 
 * The ITLQ structure uniquely identifies a specific scsi task and is used to 
 
70
 * The ITLQ structure uniquely identifies a specific scsi task and is used to
71
71
 * keep track of OPCODEs between CDB/DATA/Responses and resp[onse times.
72
72
 *
73
73
 * This decoder attempts to track the type of SCSI device based on the response
96
96
#include "packet-scsi.h"
97
97
#include "packet-fc.h"
98
98
#include "packet-scsi-osd.h"
 
99
#include "packet-scsi-mmc.h"
 
100
#include "packet-scsi-sbc.h"
 
101
#include "packet-scsi-ssc.h"
 
102
#include "packet-scsi-smc.h"
99
103
 
100
104
static int proto_scsi                    = -1;
 
105
       int hf_scsi_control               = -1;
 
106
       int hf_scsi_alloclen16            = -1;
 
107
static int hf_scsi_alloclen32            = -1;
101
108
static int hf_scsi_time                  = -1;
102
109
static int hf_scsi_request_frame         = -1;
103
110
static int hf_scsi_response_frame        = -1;
104
111
static int hf_scsi_lun                   = -1;
105
112
static int hf_scsi_status                = -1;
106
113
static int hf_scsi_spcopcode             = -1;
107
 
static int hf_scsi_mmcopcode             = -1;
108
 
static int hf_scsi_sbcopcode             = -1;
109
 
static int hf_scsi_sscopcode             = -1;
110
 
static int hf_scsi_smcopcode             = -1;
111
 
static int hf_scsi_control               = -1;
112
114
static int hf_scsi_inquiry_flags         = -1;
113
115
static int hf_scsi_inquiry_evpd_page     = -1;
114
116
static int hf_scsi_inquiry_cmdt_page     = -1;
121
123
static int hf_scsi_logsns_pagecode       = -1;
122
124
static int hf_scsi_paramlen16            = -1;
123
125
static int hf_scsi_modesel_flags         = -1;
124
 
static int hf_scsi_alloclen16            = -1;
125
126
static int hf_scsi_modesns_pc            = -1;
126
127
static int hf_scsi_spcpagecode           = -1;
127
128
static int hf_scsi_sbcpagecode           = -1;
135
136
static int hf_scsi_persresv_type         = -1;
136
137
static int hf_scsi_release_flags         = -1;
137
138
static int hf_scsi_release_thirdpartyid  = -1;
138
 
static int hf_scsi_alloclen32            = -1;
139
139
static int hf_scsi_select_report         = -1;
140
 
static int hf_scsi_formatunit_flags      = -1;
141
 
static int hf_scsi_formatunit_interleave = -1;
142
 
static int hf_scsi_formatunit_vendor     = -1;
143
 
static int hf_scsi_rdwr6_lba             = -1;
144
 
static int hf_scsi_rdwr6_xferlen         = -1;
145
 
static int hf_scsi_rdwr10_lba            = -1;
146
 
static int hf_scsi_read_flags            = -1;
147
 
static int hf_scsi_rdwr12_xferlen        = -1;
148
 
static int hf_scsi_rdwr16_lba            = -1;
149
 
static int hf_scsi_readcapacity_flags    = -1;
150
 
static int hf_scsi_readcapacity_lba      = -1;
151
 
static int hf_scsi_readcapacity_pmi      = -1;
152
 
static int hf_scsi_rdwr10_xferlen        = -1;
153
 
static int hf_scsi_readdefdata_flags     = -1;
154
 
static int hf_scsi_cdb_defectfmt         = -1;
155
 
static int hf_scsi_reassignblks_flags    = -1;
156
140
static int hf_scsi_inq_add_len           = -1;
 
141
static int hf_scsi_inq_peripheral        = -1;
157
142
static int hf_scsi_inq_qualifier         = -1;
158
143
static int hf_scsi_inq_vendor_id         = -1;
159
144
static int hf_scsi_inq_product_id        = -1;
197
182
static int hf_scsi_inq_protect           = -1;
198
183
static int hf_scsi_inq_tpgs              = -1;
199
184
static int hf_scsi_inq_acaflags          = -1;
 
185
static int hf_scsi_inq_rmbflags          = -1;
200
186
static int hf_scsi_inq_normaca           = -1;
201
187
static int hf_scsi_inq_hisup             = -1;
202
188
static int hf_scsi_inq_aerc              = -1;
206
192
static int hf_scsi_persresv_scopeaddr    = -1;
207
193
static int hf_scsi_add_cdblen = -1;
208
194
static int hf_scsi_svcaction = -1;
209
 
static int hf_scsi_ssu_immed = -1;
210
 
static int hf_scsi_ssu_pwr_cond = -1;
211
 
static int hf_scsi_ssu_loej = -1;
212
 
static int hf_scsi_ssu_start = -1;
213
195
static int hf_scsi_wb_mode = -1;
214
196
static int hf_scsi_wb_bufferid = -1;
215
197
static int hf_scsi_wb_bufoffset = -1;
219
201
static int hf_scsi_senddiag_st = -1;
220
202
static int hf_scsi_senddiag_devoff = -1;
221
203
static int hf_scsi_senddiag_unitoff = -1;
222
 
static int hf_scsi_key_class = -1;
223
 
static int hf_scsi_key_format = -1;
224
 
static int hf_scsi_agid = -1;
225
 
static int hf_scsi_lba             = -1;
226
 
static int hf_scsi_read_compatibility_lba             = -1;
227
 
static int hf_scsi_num_blocks      = -1;
228
 
static int hf_scsi_data_length = -1;
229
 
static int hf_scsi_report_key_type_code = -1;
230
 
static int hf_scsi_report_key_vendor_resets = -1;
231
 
static int hf_scsi_report_key_user_changes = -1;
232
 
static int hf_scsi_report_key_region_mask = -1;
233
 
static int hf_scsi_report_key_rpc_scheme = -1;
234
 
static int hf_scsi_setcdspeed_rc = -1;
235
 
static int hf_scsi_getconf_rt = -1;
236
 
static int hf_scsi_getconf_starting_feature = -1;
237
 
static int hf_scsi_getconf_current_profile = -1;
238
 
static int hf_scsi_feature = -1;
239
 
static int hf_scsi_feature_version = -1;
240
 
static int hf_scsi_feature_persistent = -1;
241
 
static int hf_scsi_feature_current = -1;
242
 
static int hf_scsi_feature_additional_length = -1;
243
 
static int hf_scsi_feature_lun_sn = -1;
244
 
static int hf_scsi_feature_cdread_dap = -1;
245
 
static int hf_scsi_feature_cdread_c2flag = -1;
246
 
static int hf_scsi_feature_cdread_cdtext = -1;
247
 
static int hf_scsi_feature_dvdrw_write = -1;
248
 
static int hf_scsi_feature_dvdrw_quickstart = -1;
249
 
static int hf_scsi_feature_dvdrw_closeonly = -1;
250
 
static int hf_scsi_feature_dvdr_write = -1;
251
 
static int hf_scsi_feature_tao_buf = -1;
252
 
static int hf_scsi_feature_tao_rwraw = -1;
253
 
static int hf_scsi_feature_tao_rwpack = -1;
254
 
static int hf_scsi_feature_tao_testwrite = -1;
255
 
static int hf_scsi_feature_tao_cdrw = -1;
256
 
static int hf_scsi_feature_tao_rwsubcode = -1;
257
 
static int hf_scsi_feature_dts = -1;
258
 
static int hf_scsi_feature_sao_buf = -1;
259
 
static int hf_scsi_feature_sao_sao = -1;
260
 
static int hf_scsi_feature_sao_rawms = -1;
261
 
static int hf_scsi_feature_sao_raw = -1;
262
 
static int hf_scsi_feature_sao_testwrite = -1;
263
 
static int hf_scsi_feature_sao_cdrw = -1;
264
 
static int hf_scsi_feature_sao_rw = -1;
265
 
static int hf_scsi_feature_sao_mcsl = -1;
266
 
static int hf_scsi_feature_dvdr_buf = -1;
267
 
static int hf_scsi_feature_dvdr_testwrite = -1;
268
 
static int hf_scsi_feature_dvdr_dvdrw = -1;
269
 
static int hf_scsi_feature_profile = -1;
270
 
static int hf_scsi_feature_profile_current = -1;
271
 
static int hf_scsi_feature_isw_buf = -1;
272
 
static int hf_scsi_feature_isw_num_linksize = -1;
273
 
static int hf_scsi_feature_isw_linksize = -1;
274
 
static int hf_scsi_readtoc_time = -1;
275
 
static int hf_scsi_readtoc_format = -1;
276
 
static int hf_scsi_track = -1;
277
 
static int hf_scsi_track_size = -1;
278
 
static int hf_scsi_session = -1;
279
 
static int hf_scsi_first_track = -1;
280
 
static int hf_scsi_readtoc_first_session = -1;
281
 
static int hf_scsi_readtoc_last_track = -1;
282
 
static int hf_scsi_readtoc_last_session = -1;
283
 
static int hf_scsi_q_subchannel_adr = -1;
284
 
static int hf_scsi_q_subchannel_control = -1;
285
 
static int hf_scsi_track_start_address = -1;
286
 
static int hf_scsi_next_writable_address = -1;
287
 
static int hf_scsi_track_start_time = -1;
288
 
static int hf_scsi_synccache_immed = -1;
289
 
static int hf_scsi_synccache_reladr = -1;
290
 
static int hf_scsi_rbc_block = -1;
291
 
static int hf_scsi_rbc_lob_blocks = -1;
292
 
static int hf_scsi_rbc_alob_blocks = -1;
293
 
static int hf_scsi_rbc_lob_bytes = -1;
294
 
static int hf_scsi_rbc_alob_bytes = -1;
295
 
static int hf_scsi_setstreaming_type = -1;
296
 
static int hf_scsi_setstreaming_param_len = -1;
297
 
static int hf_scsi_setstreaming_wrc = -1;
298
 
static int hf_scsi_setstreaming_rdd = -1;
299
 
static int hf_scsi_setstreaming_exact = -1;
300
 
static int hf_scsi_setstreaming_ra = -1;
301
 
static int hf_scsi_setstreaming_start_lba = -1;
302
 
static int hf_scsi_setstreaming_end_lba = -1;
303
 
static int hf_scsi_setstreaming_read_size = -1;
304
 
static int hf_scsi_setstreaming_read_time = -1;
305
 
static int hf_scsi_setstreaming_write_size = -1;
306
 
static int hf_scsi_setstreaming_write_time = -1;
307
 
static int hf_scsi_reservation_size = -1;
308
 
static int hf_scsi_rti_address_type = -1;
309
 
static int hf_scsi_rti_damage = -1;
310
 
static int hf_scsi_rti_copy = -1;
311
 
static int hf_scsi_rti_track_mode = -1;
312
 
static int hf_scsi_rti_rt = -1;
313
 
static int hf_scsi_rti_blank = -1;
314
 
static int hf_scsi_rti_packet = -1;
315
 
static int hf_scsi_rti_fp = -1;
316
 
static int hf_scsi_rti_data_mode = -1;
317
 
static int hf_scsi_rti_lra_v = -1;
318
 
static int hf_scsi_rti_nwa_v = -1;
319
 
static int hf_scsi_free_blocks = -1;
320
 
static int hf_scsi_fixed_packet_size = -1;
321
 
static int hf_scsi_last_recorded_address = -1;
322
 
static int hf_scsi_disc_info_erasable = -1;
323
 
static int hf_scsi_disc_info_state_of_last_session = -1;
324
 
static int hf_scsi_disc_info_disk_status = -1;
325
 
static int hf_scsi_disc_info_number_of_sessions = -1;
326
 
static int hf_scsi_disc_info_first_track_in_last_session = -1;
327
 
static int hf_scsi_disc_info_last_track_in_last_session = -1;
328
 
static int hf_scsi_disc_info_did_v = -1;
329
 
static int hf_scsi_disc_info_dbc_v = -1;
330
 
static int hf_scsi_disc_info_uru = -1;
331
 
static int hf_scsi_disc_info_dac_v = -1;
332
 
static int hf_scsi_disc_info_dbit = -1;
333
 
static int hf_scsi_disc_info_bgfs = -1;
334
 
static int hf_scsi_disc_info_disc_type = -1;
335
 
static int hf_scsi_disc_info_disc_identification = -1;
336
 
static int hf_scsi_disc_info_last_session_lead_in_start_address = -1;
337
 
static int hf_scsi_disc_info_last_possible_lead_out_start_address = -1;
338
 
static int hf_scsi_disc_info_disc_bar_code = -1;
339
 
static int hf_sbc2_verify_lba = -1;
340
 
static int hf_sbc2_verify_vlen = -1;
341
 
static int hf_sbc2_verify_dpo = -1;
342
 
static int hf_sbc2_verify_blkvfy = -1;
343
 
static int hf_sbc2_verify_reladdr = -1;
344
 
static int hf_sbc2_verify_vlen32 = -1;
345
 
static int hf_sbc2_verify_lba64 = -1;
346
 
static int hf_sbc2_wrverify_ebp = -1;
347
 
static int hf_sbc2_wrverify_lba = -1;
348
 
static int hf_sbc2_wrverify_xferlen = -1;
349
 
static int hf_sbc2_wrverify_lba64 = -1;
350
 
static int hf_sbc2_wrverify_xferlen32 = -1;
351
 
static int hf_sbc2_verify_bytchk = -1;
352
 
static int hf_ssc3_space6_count = -1;
353
 
static int hf_ssc3_space16_count = -1;
354
 
static int hf_ssc3_locate10_loid = -1;
355
 
static int hf_ssc3_locate16_loid = -1;
356
204
static int hf_scsi_fragments = -1;
357
205
static int hf_scsi_fragment = -1;
358
206
static int hf_scsi_fragment_overlap = -1;
364
212
 
365
213
static gint ett_scsi         = -1;
366
214
static gint ett_scsi_page    = -1;
367
 
static gint ett_scsi_profile = -1;
 
215
static gint ett_scsi_inq_peripheral = -1;
368
216
static gint ett_scsi_inq_acaflags = -1;
 
217
static gint ett_scsi_inq_rmbflags = -1;
369
218
static gint ett_scsi_inq_sccsflags = -1;
370
219
static gint ett_scsi_inq_bqueflags = -1;
371
220
static gint ett_scsi_inq_reladrflags = -1;
402
251
};
403
252
 
404
253
 
405
 
 
406
 
 
407
 
 
408
 
/* These two defines are used to handle cases where data coming back from
409
 
 * the device is truncated due to a too short allocation_length specified
410
 
 * in the command CDB.
411
 
 * This is semi-common in SCSI and it would be wrong to mark these packets
412
 
 * as [malformed packets].
413
 
 * These macros will reset the reported length to what the data pdu specified
414
 
 * and if a ReportedBoundsError is generated we will instead throw 
415
 
 * ScsiBoundsError
416
 
 *
417
 
 * Please see dissect_spc3_inquiry() for an example how to use these
418
 
 * macros.
419
 
 */
420
 
#define TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb, offset, length)              \
421
 
    {                                                                   \
422
 
        gboolean short_packet;                                          \
423
 
        tvbuff_t *new_tvb;                                              \
424
 
        guint32 end_data_offset=0;                                      \
425
 
                                                                        \
426
 
        short_packet=pinfo->fd->cap_len<pinfo->fd->pkt_len;             \
427
 
        new_tvb=tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);\
428
 
        tvb=new_tvb;                                                    \
429
 
        offset=0;                                                       \
430
 
        TRY {
431
 
 
432
 
#define END_TRY_SCSI_CDB_ALLOC_LEN                                      \
433
 
                    if(end_data_offset){                                \
434
 
                        /* just verify we can read all the bytes we were\
435
 
                         * supposed to.                                 \
436
 
                         */                                             \
437
 
                        tvb_get_guint8(tvb,end_data_offset);            \
438
 
                }                                                       \
439
 
            } /* TRY */                                                 \
440
 
        CATCH(BoundsError) {                                            \
441
 
                if(short_packet){                                       \
442
 
                        /* this was a short packet */                   \
443
 
                        RETHROW;                                        \
444
 
                } else {                                                \
445
 
                        /* We probably tried to dissect beyond the end  \
446
 
                         * of the alloc len reported in the data        \
447
 
                         * pdu. This is not an error so dont flag it as \
448
 
                         * one                                          \
449
 
                         * it is the alloc_len in the CDB that is the   \
450
 
                         * important one                                \
451
 
                         */                                             \
452
 
                }                                                       \
453
 
            }                                                           \
454
 
        CATCH(ReportedBoundsError) {                                    \
455
 
                if(short_packet){                                       \
456
 
                        /* this was a short packet */                   \
457
 
                        RETHROW;                                        \
458
 
                } else {                                                \
459
 
                        /* this packet was not really short but limited \
460
 
                         * due to a short SCSI allocation length        \
461
 
                         */                                             \
462
 
                        THROW(ScsiBoundsError);                         \
463
 
                }                                                       \
464
 
            }                                                           \
465
 
        CATCH_ALL {                                                     \
466
 
                RETHROW;                                                \
467
 
        }                                                               \
468
 
        ENDTRY;                                                         \
469
 
    }
470
 
 
471
 
/* If the data pdu contains an alloc_len as well, this macro can be set
472
 
 * to registe this offset for the TRY section above.
473
 
 * At the end of the TRY section we will, if set, verify that the data
474
 
 * pdu contained all bytes that was specified in the data alloc len.
475
 
 *
476
 
 * This macro does currently not do anything but we might enhance it in
477
 
 * the future. There is no harm in teaching the dissector about how long
478
 
 * the data pdu is supposed to be according to alloc_len in the data pdu
479
 
 */
480
 
#define SET_SCSI_DATA_END(offset)                                       \
481
 
        end_data_offset=offset;
482
 
 
483
 
 
484
254
typedef guint32 scsi_cmnd_type;
485
255
typedef guint32 scsi_device_type;
486
256
 
487
257
/* Valid SCSI Command Types */
488
258
#define SCSI_CMND_SPC2                   1
489
 
#define SCSI_CMND_SBC2                   2
 
259
#define SCSI_CMND_SBC                    2
490
260
#define SCSI_CMND_SSC2                   3
491
261
#define SCSI_CMND_SMC2                   4
492
262
#define SCSI_CMND_MMC                    5
525
295
    {0, NULL},
526
296
};
527
297
 
528
 
/* SBC-2 Commands */
529
 
#define SCSI_SBC2_FORMATUNIT             0x04
530
 
#define SCSI_SBC2_LOCKUNLKCACHE10        0x36
531
 
#define SCSI_SBC2_LOCKUNLKCACHE16        0x92
532
 
#define SCSI_SBC2_PREFETCH10             0x34
533
 
#define SCSI_SBC2_PREFETCH16             0x90
534
 
#define SCSI_SBC2_READ6                  0x08
535
 
#define SCSI_SBC2_READ10                 0x28
536
 
#define SCSI_SBC2_READ12                 0xA8
537
 
#define SCSI_SBC2_READ16                 0x88
538
 
#define SCSI_SBC2_READCAPACITY10         0x25
539
 
#define SCSI_SBC2_SERVICEACTIONIN16      0x9E
540
 
#define SCSI_SBC2_READDEFDATA10          0x37
541
 
#define SCSI_SBC2_READDEFDATA12          0xB7
542
 
#define SCSI_SBC2_READLONG               0x3E
543
 
#define SCSI_SBC2_REASSIGNBLKS           0x07
544
 
#define SCSI_SBC2_REBUILD16              0x81
545
 
#define SCSI_SBC2_REBUILD32              0x7F
546
 
#define SCSI_SBC2_REGENERATE16           0x82
547
 
#define SCSI_SBC2_REGENERATE32           0x7F
548
 
#define SCSI_SBC2_SEEK10                 0x2B
549
 
#define SCSI_SBC2_SETLIMITS10            0x33
550
 
#define SCSI_SBC2_SETLIMITS12            0xB3
551
 
#define SCSI_SBC2_STARTSTOPUNIT          0x1B
552
 
#define SCSI_SBC2_SYNCCACHE10            0x35
553
 
#define SCSI_SBC2_SYNCCACHE16            0x91
554
 
#define SCSI_SBC2_VERIFY10               0x2F
555
 
#define SCSI_SBC2_VERIFY12               0xAF
556
 
#define SCSI_SBC2_VERIFY16               0x8F
557
 
#define SCSI_SBC2_WRITE6                 0x0A
558
 
#define SCSI_SBC2_WRITE10                0x2A
559
 
#define SCSI_SBC2_WRITE12                0xAA
560
 
#define SCSI_SBC2_WRITE16                0x8A
561
 
#define SCSI_SBC2_WRITENVERIFY10         0x2E
562
 
#define SCSI_SBC2_WRITENVERIFY12         0xAE
563
 
#define SCSI_SBC2_WRITENVERIFY16         0x8E
564
 
#define SCSI_SBC2_WRITELONG              0x3F
565
 
#define SCSI_SBC2_WRITESAME10            0x41
566
 
#define SCSI_SBC2_WRITESAME16            0x93
567
 
#define SCSI_SBC2_XDREAD10               0x52
568
 
#define SCSI_SBC2_XDREAD32               0x7F
569
 
#define SCSI_SBC2_XDWRITE10              0x50
570
 
#define SCSI_SBC2_XDWRITE32              0x7F
571
 
#define SCSI_SBC2_XDWRITEREAD10          0x53
572
 
#define SCSI_SBC2_XDWRITEREAD32          0x7F
573
 
#define SCSI_SBC2_XDWRITEEXTD16          0x80
574
 
#define SCSI_SBC2_XDWRITEEXTD32          0x7F
575
 
#define SCSI_SBC2_XPWRITE10              0x51
576
 
#define SCSI_SBC2_XPWRITE32              0x7F
577
 
 
578
 
 
579
 
const value_string scsi_sbc2_vals[] = {
580
 
    {SCSI_SPC2_EXTCOPY           , "Extended Copy"},
581
 
    {SCSI_SPC2_INQUIRY           , "Inquiry"},
582
 
    {SCSI_SBC2_FORMATUNIT        , "Format Unit"},
583
 
    {SCSI_SBC2_LOCKUNLKCACHE10   , "Lock Unlock Cache(10)"},
584
 
    {SCSI_SBC2_LOCKUNLKCACHE16   , "Lock Unlock Cache(16)"},
585
 
    {SCSI_SPC2_LOGSELECT         , "Log Select"},
586
 
    {SCSI_SPC2_LOGSENSE          , "Log Sense"},
587
 
    {SCSI_SPC2_MODESELECT6       , "Mode Select(6)"},
588
 
    {SCSI_SPC2_MODESELECT10      , "Mode Select(10)"},
589
 
    {SCSI_SPC2_MODESENSE6        , "Mode Sense(6)"},
590
 
    {SCSI_SPC2_MODESENSE10       , "Mode Sense(10)"},
591
 
    {SCSI_SPC2_PERSRESVIN        , "Persistent Reserve In"},
592
 
    {SCSI_SPC2_PERSRESVOUT       , "Persistent Reserve Out"},
593
 
    {SCSI_SBC2_PREFETCH10        , "Pre-Fetch(10)"},
594
 
    {SCSI_SBC2_PREFETCH16        , "Pre-Fetch(16)"},
595
 
    {SCSI_SPC2_PREVMEDREMOVAL    , "Prevent/Allow Medium Removal"},
596
 
    {SCSI_SBC2_READ6             , "Read(6)"},
597
 
    {SCSI_SBC2_READ10            , "Read(10)"},
598
 
    {SCSI_SBC2_READ12            , "Read(12)"},
599
 
    {SCSI_SBC2_READ16            , "Read(16)"},
600
 
    {SCSI_SBC2_READCAPACITY10    , "Read Capacity(10)"},
601
 
    {SCSI_SPC2_REPORTLUNS        , "Report LUNs"},
602
 
    {SCSI_SPC2_REQSENSE          , "Request Sense"},
603
 
    {SCSI_SBC2_SERVICEACTIONIN16 , "Service Action In(16)"},
604
 
    {SCSI_SBC2_READDEFDATA10     , "Read Defect Data(10)"},
605
 
    {SCSI_SBC2_READDEFDATA12     , "Read Defect Data(12)"},
606
 
    {SCSI_SBC2_READLONG          , "Read Long"},
607
 
    {SCSI_SBC2_REASSIGNBLKS      , "Reassign Blocks"},
608
 
    {SCSI_SBC2_REBUILD16         , "Rebuild(16)"},
609
 
    {SCSI_SBC2_REBUILD32         , "Rebuild(32)"},
610
 
    {SCSI_SBC2_REGENERATE16      , "Regenerate(16)"},
611
 
    {SCSI_SBC2_REGENERATE32      , "Regenerate(32)"},
612
 
    {SCSI_SBC2_SEEK10            , "Seek(10)"},
613
 
    {SCSI_SPC2_SENDDIAG          , "Send Diagnostic"},
614
 
    {SCSI_SBC2_SETLIMITS10       , "Set Limits(10)"},
615
 
    {SCSI_SBC2_SETLIMITS12       , "Set Limits(12)"},
616
 
    {SCSI_SBC2_STARTSTOPUNIT     , "Start Stop Unit"},
617
 
    {SCSI_SBC2_SYNCCACHE10       , "Synchronize Cache(10)"},
618
 
    {SCSI_SBC2_SYNCCACHE16       , "Synchronize Cache(16)"},
619
 
    {SCSI_SPC2_TESTUNITRDY       , "Test Unit Ready"},
620
 
    {SCSI_SBC2_VERIFY10          , "Verify(10)"},
621
 
    {SCSI_SBC2_VERIFY12          , "Verify(12)"},
622
 
    {SCSI_SBC2_VERIFY16          , "Verify(16)"},
623
 
    {SCSI_SBC2_WRITE6            , "Write(6)"},
624
 
    {SCSI_SBC2_WRITE10           , "Write(10)"},
625
 
    {SCSI_SBC2_WRITE12           , "Write(12)"},
626
 
    {SCSI_SBC2_WRITE16           , "Write(16)"},
627
 
    {SCSI_SPC2_WRITEBUFFER       , "Write Buffer"},
628
 
    {SCSI_SBC2_WRITENVERIFY10    , "Write & Verify(10)"},
629
 
    {SCSI_SBC2_WRITENVERIFY12    , "Write & Verify(12)"},
630
 
    {SCSI_SBC2_WRITENVERIFY16    , "Write & Verify(16)"},
631
 
    {SCSI_SBC2_WRITELONG         , "Write Long"},
632
 
    {SCSI_SBC2_WRITESAME10       , "Write Same(10)"},
633
 
    {SCSI_SBC2_WRITESAME16       , "Write Same(16)"},
634
 
    {SCSI_SBC2_XDREAD10          , "XdRead(10)"},
635
 
    {SCSI_SBC2_XDREAD32          , "XdRead(32)"},
636
 
    {SCSI_SBC2_XDWRITE10         , "XdWrite(10)"},
637
 
    {SCSI_SBC2_XDWRITE32         , "XdWrite(32)"},
638
 
    {SCSI_SBC2_XDWRITEREAD10     , "XdWriteRead(10)"},
639
 
    {SCSI_SBC2_XDWRITEREAD32     , "XdWriteRead(32)"},
640
 
    {SCSI_SBC2_XDWRITEEXTD16     , "XdWrite Extended(16)"},
641
 
    {SCSI_SBC2_XDWRITEEXTD32     , "XdWrite Extended(32)"},
642
 
    {SCSI_SBC2_XPWRITE10         , "XpWrite(10)"},
643
 
    {SCSI_SBC2_XPWRITE32         , "XpWrite(32)"},
644
 
    {0, NULL},
645
 
};
646
 
 
647
 
/* MMC Commands */
648
 
#define SCSI_MMC4_READCAPACITY10         0x25
649
 
#define SCSI_MMC4_READ10                 0x28
650
 
#define SCSI_MMC4_WRITE10                0x2a
651
 
#define SCSI_MMC4_SYNCHRONIZECACHE       0x35
652
 
#define SCSI_MMC4_READTOCPMAATIP         0x43
653
 
#define SCSI_MMC4_GETCONFIGURATION       0x46
654
 
#define SCSI_MMC4_GETEVENTSTATUSNOTIFY   0x4a
655
 
#define SCSI_MMC4_READDISCINFORMATION    0x51
656
 
#define SCSI_MMC4_READTRACKINFORMATION   0x52
657
 
#define SCSI_MMC4_RESERVETRACK           0x53
658
 
#define SCSI_MMC4_READBUFFERCAPACITY     0x5c
659
 
#define SCSI_MMC4_REPORTKEY             0xa4
660
 
#define SCSI_MMC4_READ12                 0xa8
661
 
#define SCSI_MMC4_WRITE12                0xaa
662
 
#define SCSI_MMC4_GETPERFORMANCE         0xac
663
 
#define SCSI_MMC4_READDISCSTRUCTURE      0xad
664
 
#define SCSI_MMC4_SETSTREAMING           0xb6
665
 
#define SCSI_MMC4_SETCDSPEED             0xbb
666
 
const value_string scsi_mmc_vals[] = {
667
 
    {SCSI_MMC4_GETCONFIGURATION      , "Get Configuraion"},
668
 
    {SCSI_MMC4_GETEVENTSTATUSNOTIFY  , "Get Event Status Notification"},
669
 
    {SCSI_MMC4_GETPERFORMANCE        , "Get Performance"},
670
 
    {SCSI_SPC2_INQUIRY               , "Inquiry"},
671
 
    {SCSI_SPC2_MODESELECT10          , "Mode Select(10)"},
672
 
    {SCSI_SPC2_MODESENSE10           , "Mode Sense(10)"},
673
 
    {SCSI_SPC2_PREVMEDREMOVAL        , "Prevent/Allow Medium Removal"},
674
 
    {SCSI_MMC4_READ10                , "Read(10)"},
675
 
    {SCSI_MMC4_READ12                , "Read(12)"},
676
 
    {SCSI_MMC4_READBUFFERCAPACITY    , "Read Buffer Capacity"},
677
 
    {SCSI_MMC4_READCAPACITY10        , "Read Capacity(10)"},
678
 
    {SCSI_MMC4_READDISCINFORMATION   , "Read Disc Information"},
679
 
    {SCSI_MMC4_READDISCSTRUCTURE     , "Read DISC Structure"},
680
 
    {SCSI_MMC4_READTOCPMAATIP        , "Read TOC/PMA/ATIP"},
681
 
    {SCSI_MMC4_READTRACKINFORMATION  , "Read Track Information"},
682
 
    {SCSI_MMC4_REPORTKEY             , "Report Key"},
683
 
    {SCSI_SPC2_REPORTLUNS            , "Report LUNs"},
684
 
    {SCSI_SPC2_REQSENSE              , "Request Sense"},
685
 
    {SCSI_MMC4_RESERVETRACK          , "Reserve Track"},
686
 
    {SCSI_MMC4_SETCDSPEED            , "Set CD Speed"},
687
 
    {SCSI_MMC4_SETSTREAMING          , "Set Streaming"},
688
 
    {SCSI_SBC2_STARTSTOPUNIT         , "Start Stop Unit"},
689
 
    {SCSI_MMC4_SYNCHRONIZECACHE      , "Synchronize Cache"},
690
 
    {SCSI_SPC2_TESTUNITRDY           , "Test Unit Ready"},
691
 
    {SCSI_MMC4_WRITE10               , "Write(10)"},
692
 
    {SCSI_MMC4_WRITE12               , "Write(12)"},
693
 
    {SCSI_SPC2_WRITEBUFFER           , "Write Buffer"},
694
 
    {0, NULL},
695
 
};
696
 
 
697
 
/* SMC2 Commands */
698
 
#define SCSI_SMC2_EXCHANGE_MEDIUM                 0x40
699
 
#define SCSI_SMC2_INITIALIZE_ELEMENT_STATUS       0x07
700
 
#define SCSI_SMC2_INITIALIZE_ELEMENT_STATUS_RANGE 0x37
701
 
#define SCSI_SMC2_MOVE_MEDIUM                     0xA5
702
 
#define SCSI_SMC2_MOVE_MEDIUM_ATTACHED            0xA7
703
 
#define SCSI_SMC2_POSITION_TO_ELEMENT             0x2B
704
 
#define SCSI_SMC2_READ_ATTRIBUTE                  0x8C
705
 
#define SCSI_SMC2_READ_ELEMENT_STATUS             0xB8
706
 
#define SCSI_SMC2_READ_ELEMENT_STATUS_ATTACHED    0xB4
707
 
#define SCSI_SMC2_REQUEST_VOLUME_ELEMENT_ADDRESS  0xB5
708
 
#define SCSI_SMC2_SEND_VOLUME_TAG                 0xB6
709
 
#define SCSI_SMC2_WRITE_ATTRIBUTE                 0x8D
710
 
 
711
 
static const value_string scsi_smc2_vals[] = {
712
 
    {SCSI_SMC2_EXCHANGE_MEDIUM                , "Exchange Medium"},
713
 
    {SCSI_SMC2_INITIALIZE_ELEMENT_STATUS      , "Initialize Element Status"},
714
 
    {SCSI_SMC2_INITIALIZE_ELEMENT_STATUS_RANGE, "Initialize Element Status With Range"},
715
 
    {SCSI_SPC2_INQUIRY                        , "Inquiry"},
716
 
    {SCSI_SPC2_LOGSELECT                      , "Log Select"},
717
 
    {SCSI_SPC2_LOGSENSE                       , "Log Sense"},
718
 
    {SCSI_SPC2_MODESELECT6                    , "Mode Select(6)"},
719
 
    {SCSI_SPC2_MODESELECT10                   , "Mode Select(10)"},
720
 
    {SCSI_SPC2_MODESENSE6                     , "Mode Sense(6)"},
721
 
    {SCSI_SPC2_MODESENSE10                    , "Mode Sense(10)"},
722
 
    {SCSI_SMC2_MOVE_MEDIUM                    , "Move Medium"},
723
 
    {SCSI_SMC2_MOVE_MEDIUM_ATTACHED           , "Move Medium Attached"},
724
 
    {SCSI_SPC2_PERSRESVIN                     , "Persistent Reserve In"},
725
 
    {SCSI_SPC2_PERSRESVOUT                    , "Persistent Reserve Out"},
726
 
    {SCSI_SMC2_POSITION_TO_ELEMENT            , "Position To Element"},
727
 
    {SCSI_SPC2_PREVMEDREMOVAL                 , "Prevent/Allow Medium Removal"},
728
 
    {SCSI_SMC2_READ_ATTRIBUTE                 , "Read Attribute"},
729
 
    {SCSI_SMC2_READ_ELEMENT_STATUS            , "Read Element Status"},
730
 
    {SCSI_SMC2_READ_ELEMENT_STATUS_ATTACHED   , "Read Element Status Attached"},
731
 
    {SCSI_SPC2_RELEASE6                       , "Release(6)"},
732
 
    {SCSI_SPC2_RELEASE10                      , "Release(10)"},
733
 
    {SCSI_SPC2_REPORTLUNS                     , "Report LUNs"},
734
 
    {SCSI_SPC2_REQSENSE                       , "Request Sense"},
735
 
    {SCSI_SMC2_REQUEST_VOLUME_ELEMENT_ADDRESS , "Request Volume Element Address"},
736
 
    {SCSI_SPC2_RESERVE6                       , "Reserve(6)"},
737
 
    {SCSI_SPC2_RESERVE10                      , "Reserve(10)"},
738
 
    {SCSI_SMC2_SEND_VOLUME_TAG                , "Send Volume Tag"},
739
 
    {SCSI_SPC2_SENDDIAG                       , "Send Diagnostic"},
740
 
    {SCSI_SPC2_TESTUNITRDY                    , "Test Unit Ready"},
741
 
    {SCSI_SMC2_WRITE_ATTRIBUTE                , "Write Attribute"},
742
 
    {SCSI_SPC2_WRITEBUFFER                    , "Write Buffer"},
743
 
    {0, NULL},
744
 
};
745
 
 
746
 
 
747
 
/* SSC2 Commands */
748
 
#define SCSI_SSC2_REWIND                        0x01
749
 
#define SCSI_SSC2_FORMAT_MEDIUM                 0x04
750
 
#define SCSI_SSC2_READ_BLOCK_LIMITS             0x05
751
 
#define SCSI_SSC2_READ6                         0x08
752
 
#define SCSI_SSC2_WRITE6                        0x0A
753
 
#define SCSI_SSC2_SET_CAPACITY                  0x0B
754
 
#define SCSI_SSC2_READ_REVERSE_6                0x0F
755
 
#define SCSI_SSC2_WRITE_FILEMARKS_6             0x10
756
 
#define SCSI_SSC2_SPACE_6                       0x11
757
 
#define SCSI_SSC2_VERIFY_6                      0x13
758
 
#define SCSI_SSC2_RECOVER_BUFFERED_DATA         0x14
759
 
#define SCSI_SSC2_ERASE_6                       0x19
760
 
#define SCSI_SSC2_LOAD_UNLOAD                   0x1B
761
 
#define SCSI_SSC2_LOCATE_10                     0x2B
762
 
#define SCSI_SSC2_READ_POSITION                 0x34
763
 
#define SCSI_SSC2_REPORT_DENSITY_SUPPORT        0x44
764
 
#define SCSI_SSC2_WRITE_FILEMARKS_16            0x80
765
 
#define SCSI_SSC2_READ_REVERSE_16               0x81
766
 
#define SCSI_SSC2_READ_16                       0x88
767
 
#define SCSI_SSC2_WRITE_16                      0x8A
768
 
#define SCSI_SSC2_VERIFY_16                     0x8F
769
 
#define SCSI_SSC2_SPACE_16                      0x91
770
 
#define SCSI_SSC2_LOCATE_16                     0x92
771
 
#define SCSI_SSC2_ERASE_16                      0x93
772
 
 
773
 
const value_string scsi_ssc2_vals[] = {
774
 
    {SCSI_SSC2_ERASE_6                     , "Erase(6)"},
775
 
    {SCSI_SSC2_ERASE_16                    , "Erase(16)"},
776
 
    {SCSI_SPC2_EXTCOPY                     , "Extended Copy"},
777
 
    {SCSI_SSC2_FORMAT_MEDIUM               , "Format Medium"},
778
 
    {SCSI_SPC2_INQUIRY                     , "Inquiry"},
779
 
    {SCSI_SSC2_LOAD_UNLOAD                 , "Load Unload"},
780
 
    {SCSI_SSC2_LOCATE_10                   , "Locate(10)"},
781
 
    {SCSI_SSC2_LOCATE_16                   , "Locate(16)"},
782
 
    {SCSI_SPC2_LOGSELECT                   , "Log Select"},
783
 
    {SCSI_SPC2_LOGSENSE                    , "Log Sense"},
784
 
    {SCSI_SPC2_MODESELECT6                 , "Mode Select(6)"},
785
 
    {SCSI_SPC2_MODESELECT10                , "Mode Select(10)"},
786
 
    {SCSI_SPC2_MODESENSE6                  , "Mode Sense(6)"},
787
 
    {SCSI_SPC2_MODESENSE10                 , "Mode Sense(10)"},
788
 
    {SCSI_SMC2_MOVE_MEDIUM                 , "Move Medium"},
789
 
    {SCSI_SMC2_MOVE_MEDIUM_ATTACHED        , "Move Medium Attached"},
790
 
    {SCSI_SPC2_PERSRESVIN                  , "Persistent Reserve In"},
791
 
    {SCSI_SPC2_PERSRESVOUT                 , "Persistent Reserve Out"},
792
 
    {SCSI_SPC2_PREVMEDREMOVAL              , "Prevent/Allow Medium Removal"},
793
 
    {SCSI_SSC2_READ6                       , "Read(6)"},
794
 
    {SCSI_SSC2_READ_16                     , "Read(16)"},
795
 
    {SCSI_SSC2_READ_BLOCK_LIMITS           , "Read Block Limits"},
796
 
    {SCSI_SMC2_READ_ELEMENT_STATUS         , "Read Element Status"},
797
 
    {SCSI_SMC2_READ_ELEMENT_STATUS_ATTACHED, "Read Element Status Attached"},
798
 
    {SCSI_SSC2_READ_POSITION               , "Read Position"},
799
 
    {SCSI_SSC2_READ_REVERSE_6              , "Read Reverse(6)"},
800
 
    {SCSI_SSC2_READ_REVERSE_16             , "Read Reverse(16)"},
801
 
    {SCSI_SSC2_RECOVER_BUFFERED_DATA       , "Recover Buffered Data"},
802
 
    {SCSI_SSC2_REPORT_DENSITY_SUPPORT      , "Report Density Support"},
803
 
    {SCSI_SPC2_REPORTLUNS                  , "Report LUNs"},
804
 
    {SCSI_SPC2_REQSENSE                    , "Request Sense"},
805
 
    {SCSI_SSC2_REWIND                      , "Rewind"},
806
 
    {SCSI_SPC2_SENDDIAG                    , "Send Diagnostic"},
807
 
    {SCSI_SSC2_SET_CAPACITY                , "Set Capacity"},
808
 
    {SCSI_SSC2_SPACE_6                     , "Space(6)"},
809
 
    {SCSI_SSC2_SPACE_16                    , "Space(16)"},
810
 
    {SCSI_SPC2_TESTUNITRDY                 , "Test Unit Ready"},
811
 
    {SCSI_SSC2_VERIFY_6                    , "Verify(6)"},
812
 
    {SCSI_SSC2_VERIFY_16                   , "Verify(16)"},
813
 
    {SCSI_SSC2_WRITE6                      , "Write(6)"},
814
 
    {SCSI_SSC2_WRITE_16                    , "Write(16)"},
815
 
    {SCSI_SPC2_WRITEBUFFER                 , "Write Buffer"},
816
 
    {SCSI_SSC2_WRITE_FILEMARKS_16          , "Write Filemarks(16)"},
817
 
    {SCSI_SSC2_WRITE_FILEMARKS_6           , "Write Filemarks(6)"},
818
 
    {0, NULL},
819
 
};
 
298
 
820
299
 
821
300
static const value_string scsi_select_report_val[] = {
822
301
    {0, "Select All LUNs" },
913
392
    {0, NULL},
914
393
};
915
394
 
916
 
#define SCSI_SBC2_MODEPAGE_RDWRERR  0x01
917
 
#define SCSI_SBC2_MODEPAGE_FMTDEV   0x03
918
 
#define SCSI_SBC2_MODEPAGE_DISKGEOM 0x04
919
 
#define SCSI_SBC2_MODEPAGE_FLEXDISK 0x05
920
 
#define SCSI_SBC2_MODEPAGE_VERERR   0x07
921
 
#define SCSI_SBC2_MODEPAGE_CACHE    0x08
922
 
#define SCSI_SBC2_MODEPAGE_MEDTYPE  0x0B
923
 
#define SCSI_SBC2_MODEPAGE_NOTPART  0x0C
924
 
#define SCSI_SBC2_MODEPAGE_XORCTL   0x10
 
395
#define SCSI_SBC_MODEPAGE_RDWRERR  0x01
 
396
#define SCSI_SBC_MODEPAGE_FMTDEV   0x03
 
397
#define SCSI_SBC_MODEPAGE_DISKGEOM 0x04
 
398
#define SCSI_SBC_MODEPAGE_FLEXDISK 0x05
 
399
#define SCSI_SBC_MODEPAGE_VERERR   0x07
 
400
#define SCSI_SBC_MODEPAGE_CACHE    0x08
 
401
#define SCSI_SBC_MODEPAGE_MEDTYPE  0x0B
 
402
#define SCSI_SBC_MODEPAGE_NOTPART  0x0C
 
403
#define SCSI_SBC_MODEPAGE_XORCTL   0x10
925
404
 
926
 
static const value_string scsi_sbc2_modepage_val[] = {
927
 
    {SCSI_SBC2_MODEPAGE_RDWRERR,  "Read/Write Error Recovery"},
928
 
    {SCSI_SBC2_MODEPAGE_FMTDEV,   "Format Device"},
929
 
    {SCSI_SBC2_MODEPAGE_DISKGEOM, "Rigid Disk Geometry"},
930
 
    {SCSI_SBC2_MODEPAGE_FLEXDISK, "Flexible Disk"},
931
 
    {SCSI_SBC2_MODEPAGE_VERERR,   "Verify Error Recovery"},
932
 
    {SCSI_SBC2_MODEPAGE_CACHE,    "Caching"},
933
 
    {SCSI_SBC2_MODEPAGE_MEDTYPE,  "Medium Types Supported"},
934
 
    {SCSI_SBC2_MODEPAGE_NOTPART,  "Notch & Partition"},
935
 
    {SCSI_SBC2_MODEPAGE_XORCTL,   "XOR Control"},
 
405
static const value_string scsi_sbc_modepage_val[] = {
 
406
    {SCSI_SBC_MODEPAGE_RDWRERR,  "Read/Write Error Recovery"},
 
407
    {SCSI_SBC_MODEPAGE_FMTDEV,   "Format Device"},
 
408
    {SCSI_SBC_MODEPAGE_DISKGEOM, "Rigid Disk Geometry"},
 
409
    {SCSI_SBC_MODEPAGE_FLEXDISK, "Flexible Disk"},
 
410
    {SCSI_SBC_MODEPAGE_VERERR,   "Verify Error Recovery"},
 
411
    {SCSI_SBC_MODEPAGE_CACHE,    "Caching"},
 
412
    {SCSI_SBC_MODEPAGE_MEDTYPE,  "Medium Types Supported"},
 
413
    {SCSI_SBC_MODEPAGE_NOTPART,  "Notch & Partition"},
 
414
    {SCSI_SBC_MODEPAGE_XORCTL,   "XOR Control"},
936
415
    {0x3F,                        "Return All Mode Pages"},
937
416
    {0, NULL},
938
417
};
1047
526
    {"block", "Block Device", SCSI_DEV_SBC},
1048
527
    {"sequential", "Sequential Device", SCSI_DEV_SSC},
1049
528
    {"objectbased", "Object Based Storage Device", SCSI_DEV_OSD},
 
529
    {"mediumchanger", "Medium Changer Device", SCSI_DEV_SMC},
 
530
    {"cdrom", "Multimedia Device", SCSI_DEV_CDROM},
1050
531
    {NULL, NULL, -1},
1051
532
};
1052
533
 
1142
623
#define CODESET_BINARY  1
1143
624
#define CODESET_ASCII   2
1144
625
 
1145
 
static const value_string scsi_devid_codeset_val[] = {
 
626
const value_string scsi_devid_codeset_val[] = {
1146
627
    {0,              "Reserved"},
1147
628
    {CODESET_BINARY, "Identifier field contains binary values"},
1148
629
    {CODESET_ASCII,  "Identifier field contains ASCII graphic codes"},
1155
636
    {0, NULL},
1156
637
};
1157
638
 
1158
 
static const value_string scsi_devid_idtype_val[] = {
 
639
const value_string scsi_devid_idtype_val[] = {
1159
640
    {0, "Vendor-specific ID (non-globally unique)"},
1160
641
    {1, "Vendor-ID + vendor-specific ID (globally unique)"},
1161
642
    {2, "EUI-64 ID"},
1334
815
    {0, NULL},
1335
816
};
1336
817
 
1337
 
static const value_string scsi_asc_val[] = {
 
818
const value_string scsi_asc_val[] = {
1338
819
    {0x0000,  "No Additional Sense Information"},
1339
820
    {0x0001,  "Filemark Detected"},
1340
821
    {0x0002,  "End Of Partition/Medium Detected"},
1671
1152
    {0, NULL},
1672
1153
};
1673
1154
 
1674
 
const value_string scsi_ssu_pwrcnd_val[] = {
1675
 
    {0x0, "No Change"},
1676
 
    {0x1, "Place Device In Active Condition"},
1677
 
    {0x2, "Place device into Idle condition"},
1678
 
    {0x3, "Place device into Standby condition"},
1679
 
    {0x4, "Reserved"},
1680
 
    {0x5, "Place device into Sleep condition"},
1681
 
    {0x6, "Reserved"},
1682
 
    {0x7, "Transfer control of power conditions to block device"},
1683
 
    {0x8, "Reserved"},
1684
 
    {0x9, "Reserved"},
1685
 
    {0xA, "Force Idle Condition Timer to zero"},
1686
 
    {0xB, "Force Standby Condition Timer to zero"},
1687
 
    {0, NULL},
1688
 
};
1689
1155
 
1690
1156
const value_string scsi_wb_mode_val[] = {
1691
1157
    {0x0, "Write combined header and data"},
1897
1363
        { 0, NULL }
1898
1364
};
1899
1365
 
1900
 
/* This dissects byte 3 of the SPC-3 standard INQ data (SPC-3 6.4.2) */
1901
 
static int
1902
 
dissect_spc3_inq_acaflags(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
1903
 
{
1904
 
        guint8 flags;
1905
 
        proto_item *item=NULL;
1906
 
        proto_tree *tree=NULL;
1907
 
 
1908
 
        if(parent_tree){
1909
 
                item=proto_tree_add_item(parent_tree, hf_scsi_inq_acaflags, tvb, offset, 1, 0);
1910
 
                tree = proto_item_add_subtree (item, ett_scsi_inq_acaflags);
1911
 
        }
1912
 
 
1913
 
        flags=tvb_get_guint8 (tvb, offset);
1914
 
 
1915
 
        /* AERC (obsolete in spc3 and forward) */
1916
 
        proto_tree_add_boolean(tree, hf_scsi_inq_aerc, tvb, offset, 1, flags);
1917
 
        if(flags&SCSI_INQ_ACAFLAGS_AERC){
1918
 
                proto_item_append_text(item, "  AERC");
1919
 
        }
1920
 
        flags&=(~SCSI_INQ_ACAFLAGS_AERC);
1921
 
 
1922
 
        /* TRMTSK (obsolete in spc2 and forward) */
1923
 
        proto_tree_add_boolean(tree, hf_scsi_inq_trmtsk, tvb, offset, 1, flags);
1924
 
        if(flags&SCSI_INQ_ACAFLAGS_TRMTSK){
1925
 
                proto_item_append_text(item, "  TrmTsk");
1926
 
        }
1927
 
        flags&=(~SCSI_INQ_ACAFLAGS_TRMTSK);
1928
 
 
1929
 
        /* NormACA */
1930
 
        proto_tree_add_boolean(tree, hf_scsi_inq_normaca, tvb, offset, 1, flags);
1931
 
        if(flags&SCSI_INQ_ACAFLAGS_NORMACA){
1932
 
                proto_item_append_text(item, "  NormACA");
1933
 
        }
1934
 
        flags&=(~SCSI_INQ_ACAFLAGS_NORMACA);
1935
 
 
1936
 
        /* HiSup */
1937
 
        proto_tree_add_boolean(tree, hf_scsi_inq_hisup, tvb, offset, 1, flags);
1938
 
        if(flags&SCSI_INQ_ACAFLAGS_HISUP){
1939
 
                proto_item_append_text(item, "  HiSup");
1940
 
        }
1941
 
        flags&=(~SCSI_INQ_ACAFLAGS_HISUP);
1942
 
 
1943
 
        /* Response Data Format */
1944
 
        proto_tree_add_item (tree, hf_scsi_inq_rdf, tvb, offset, 1, 0);
1945
 
        proto_item_append_text(item, "  RDF:%s", val_to_str(flags&0x0f, inq_rdf_vals, "Unknown:%d"));
1946
 
 
1947
 
        offset+=1;
1948
 
        return offset;
1949
 
}
1950
1366
 
1951
1367
#define SCSI_INQ_SCCSFLAGS_SCCS         0x80
1952
1368
#define SCSI_INQ_SCCSFLAGS_ACC          0x40
2126
1542
                      guint32 payload_len, scsi_task_data_t *cdata)
2127
1543
{
2128
1544
    guint8 flags, i;
 
1545
    static const int *peripheal_fields[] = {
 
1546
        &hf_scsi_inq_qualifier,
 
1547
        &hf_scsi_inq_devtype,
 
1548
        NULL
 
1549
    };
 
1550
    static const int *aca_fields[] = {
 
1551
        &hf_scsi_inq_aerc,      /* obsolete in spc3 and forward */
 
1552
        &hf_scsi_inq_trmtsk,    /* obsolete in spc2 and forward */
 
1553
        &hf_scsi_inq_normaca,
 
1554
        &hf_scsi_inq_hisup,
 
1555
        &hf_scsi_inq_rdf,
 
1556
        NULL
 
1557
    };
 
1558
    static const int *rmb_fields[] = {
 
1559
        &hf_scsi_inq_rmb,
 
1560
        NULL
 
1561
    };
2129
1562
 
2130
 
    if (!isreq && (cdata == NULL || !(cdata->itlq->flags & 0x3)) 
 
1563
    if (!isreq && (cdata == NULL || !(cdata->itlq->flags & 0x3))
2131
1564
    && (tvb_length_remaining(tvb, offset)>=1) ) {
2132
1565
        /*
2133
1566
         * INQUIRY response with device type information; add device type
2185
1618
        /* These pdus are sometimes truncated by SCSI allocation length
2186
1619
         * in the CDB
2187
1620
         */
2188
 
        TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb, offset, cdata->itlq->alloc_len); 
 
1621
        TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb, offset, cdata->itlq->alloc_len);
2189
1622
 
2190
1623
        /* Qualifier and DeviceType */
2191
 
        proto_tree_add_item (tree, hf_scsi_inq_qualifier, tvb, offset,
2192
 
                             1, 0);
2193
 
        proto_tree_add_item (tree, hf_scsi_inq_devtype, tvb, offset, 1, 0);
 
1624
        proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_peripheral, ett_scsi_inq_peripheral, peripheal_fields, FALSE);
2194
1625
        offset+=1;
2195
1626
 
2196
1627
        /* RMB */
2197
 
        proto_tree_add_item(tree, hf_scsi_inq_rmb,  tvb, offset, 1, 0);
 
1628
        proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_rmbflags, ett_scsi_inq_rmbflags, rmb_fields, FALSE);
2198
1629
        offset+=1;
2199
1630
 
2200
1631
        /* Version */
2202
1633
        offset+=1;
2203
1634
 
2204
1635
        /* aca flags */
2205
 
        offset=dissect_spc3_inq_acaflags(tvb, offset, tree);
 
1636
        proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_inq_acaflags, ett_scsi_inq_acaflags, aca_fields, FALSE);
 
1637
        offset+=1;
2206
1638
 
2207
1639
        /* Additional Length */
2208
1640
        SET_SCSI_DATA_END(tvb_get_guint8(tvb, offset)+offset);
2249
1681
    }
2250
1682
}
2251
1683
 
2252
 
static void
 
1684
void
2253
1685
dissect_spc3_extcopy (tvbuff_t *tvb _U_, packet_info *pinfo _U_,
2254
1686
                      proto_tree *tree _U_, guint offset _U_,
2255
1687
                      gboolean isreq _U_, gboolean iscdb _U_,
2382
1814
                if(tvb_length_remaining(tvb, offset)<3)
2383
1815
                    return;
2384
1816
                proto_tree_add_text (scsi_tree, tvb, offset, 3, "No. of Blocks: %u",
2385
 
                                     tvb_get_ntohl (tvb, offset));
 
1817
                                     tvb_get_ntoh24 (tvb, offset));
2386
1818
                offset += 3;
2387
1819
 
2388
1820
                offset++; /* reserved */
2523
1955
}
2524
1956
 
2525
1957
static gboolean
2526
 
dissect_scsi_sbc2_modepage (tvbuff_t *tvb, packet_info *pinfo _U_,
 
1958
dissect_scsi_sbc_modepage (tvbuff_t *tvb, packet_info *pinfo _U_,
2527
1959
                            proto_tree *tree, guint offset, guint8 pcode)
2528
1960
{
2529
1961
    guint8 flags;
2530
1962
 
2531
1963
    switch (pcode) {
2532
 
    case SCSI_SBC2_MODEPAGE_FMTDEV:
 
1964
    case SCSI_SBC_MODEPAGE_FMTDEV:
2533
1965
        proto_tree_add_text (tree, tvb, offset+2, 2, "Tracks Per Zone: %u",
2534
1966
                             tvb_get_ntohs (tvb, offset+2));
2535
1967
        proto_tree_add_text (tree, tvb, offset+4, 2,
2559
1991
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6,
2560
1992
                             (flags & 0x20) >> 5, (flags & 0x10) >> 4);
2561
1993
        break;
2562
 
    case SCSI_SBC2_MODEPAGE_RDWRERR:
 
1994
    case SCSI_SBC_MODEPAGE_RDWRERR:
2563
1995
        flags = tvb_get_guint8 (tvb, offset+2);
2564
1996
        proto_tree_add_text (tree, tvb, offset+2, 1,
2565
1997
                             "AWRE: %u, ARRE: %u, TB: %u, RC: %u, EER: %u, PER: %u, DTE: %u, DCR: %u",
2582
2014
                             "Recovery Time Limit: %u ms",
2583
2015
                             tvb_get_ntohs (tvb, offset+10));
2584
2016
        break;
2585
 
   case SCSI_SBC2_MODEPAGE_DISKGEOM:
 
2017
   case SCSI_SBC_MODEPAGE_DISKGEOM:
2586
2018
        proto_tree_add_text (tree, tvb, offset+2, 3, "Number of Cylinders: %u",
2587
2019
                             tvb_get_ntoh24 (tvb, offset+2));
2588
2020
        proto_tree_add_text (tree, tvb, offset+5, 1, "Number of Heads: %u",
2603
2035
                             "Medium Rotation Rate: %u",
2604
2036
                             tvb_get_ntohs (tvb, offset+20));
2605
2037
        break;
2606
 
    case SCSI_SBC2_MODEPAGE_FLEXDISK:
2607
 
        return FALSE;
2608
 
    case SCSI_SBC2_MODEPAGE_VERERR:
2609
 
        return FALSE;
2610
 
    case SCSI_SBC2_MODEPAGE_CACHE:
 
2038
    case SCSI_SBC_MODEPAGE_FLEXDISK:
 
2039
        return FALSE;
 
2040
    case SCSI_SBC_MODEPAGE_VERERR:
 
2041
        return FALSE;
 
2042
    case SCSI_SBC_MODEPAGE_CACHE:
2611
2043
        flags = tvb_get_guint8 (tvb, offset+2);
2612
2044
        proto_tree_add_text (tree, tvb, offset+2, 1,
2613
2045
                             "IC: %u, ABPF: %u, CAP %u, Disc: %u, Size: %u, WCE: %u, MF: %u, RCD: %u",
2643
2075
                             "Non-Cache Segment Size: %u",
2644
2076
                             tvb_get_ntoh24 (tvb, offset+17));
2645
2077
        break;
2646
 
    case SCSI_SBC2_MODEPAGE_MEDTYPE:
2647
 
        return FALSE;
2648
 
    case SCSI_SBC2_MODEPAGE_NOTPART:
2649
 
        return FALSE;
2650
 
    case SCSI_SBC2_MODEPAGE_XORCTL:
 
2078
    case SCSI_SBC_MODEPAGE_MEDTYPE:
 
2079
        return FALSE;
 
2080
    case SCSI_SBC_MODEPAGE_NOTPART:
 
2081
        return FALSE;
 
2082
    case SCSI_SBC_MODEPAGE_XORCTL:
2651
2083
        return FALSE;
2652
2084
    default:
2653
2085
        return FALSE;
2764
2196
                                 (flags & 0x01));
2765
2197
            flags = tvb_get_guint8 (tvb, offset+5);
2766
2198
            proto_tree_add_text (tree, tvb, offset+5, 1,
2767
 
                                 "Media Formar Recognition: %u",
 
2199
                                 "Media Format Recognition: %u",
2768
2200
                                 flags);
2769
2201
            flags = tvb_get_guint8 (tvb, offset+6);
2770
2202
            proto_tree_add_text (tree, tvb, offset+6, 1,
2866
2298
        proto_tree_add_text (tree, tvb, offset+4, 1,
2867
2299
                             "BUF: %u, Multi Session: %u, Mode 2 Form 2: %u, Mode 2 Form 1: %u,"
2868
2300
                             "Digital Port (2): %u, Digital Port (1): %u, Composite: %u, Audio Play: %u",
2869
 
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6, (flags & 0x20) >> 5, (flags & 0x10) >> 4, 
 
2301
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6, (flags & 0x20) >> 5, (flags & 0x10) >> 4,
2870
2302
                             (flags & 0x08) >> 3, (flags & 0x04) >> 2, (flags & 0x02) >> 1, (flags & 0x01));
2871
2303
        flags = tvb_get_guint8 (tvb, offset+5);
2872
2304
        proto_tree_add_text (tree, tvb, offset+5, 1,
2873
2305
                             "Read Bar Code: %u, UPC: %u, ISRC: %u, C2 Pointers supported: %u,"
2874
2306
                             "R-W Deinterleaved & corrected: %u, R-W Supported: %u, CD-DA Stream is Accurate: %u, CD-DA Cmds Supported: %u",
2875
 
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6, (flags & 0x20) >> 5, (flags & 0x10) >> 4, 
 
2307
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6, (flags & 0x20) >> 5, (flags & 0x10) >> 4,
2876
2308
                             (flags & 0x08) >> 3, (flags & 0x04) >> 2, (flags & 0x02) >> 1, (flags & 0x01));
2877
2309
        flags = tvb_get_guint8 (tvb, offset+6);
2878
2310
        proto_tree_add_text (tree, tvb, offset+6, 1,
3050
2482
         */
3051
2483
        switch (devtype) {
3052
2484
        case SCSI_DEV_SBC:
3053
 
            modepage_val = scsi_sbc2_modepage_val;
 
2485
            modepage_val = scsi_sbc_modepage_val;
3054
2486
            hf_pagecode = hf_scsi_sbcpagecode;
3055
 
            dissect_modepage = dissect_scsi_sbc2_modepage;
 
2487
            dissect_modepage = dissect_scsi_sbc_modepage;
3056
2488
            break;
3057
2489
 
3058
2490
        case SCSI_DEV_SSC:
3112
2544
    return (plen+2);
3113
2545
}
3114
2546
 
3115
 
static void
 
2547
void
3116
2548
dissect_spc3_modeselect6 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3117
2549
                          guint offset, gboolean isreq, gboolean iscdb,
3118
2550
                          guint payload_len, scsi_task_data_t *cdata)
3366
2798
    proto_tree_add_uint (tree, hf_pagecode, tvb, offset, 1, pcode);
3367
2799
}
3368
2800
 
3369
 
static void
 
2801
void
3370
2802
dissect_spc3_modesense6 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3371
2803
                         guint offset, gboolean isreq, gboolean iscdb,
3372
2804
                         guint payload_len, scsi_task_data_t *cdata)
3559
2991
    }
3560
2992
}
3561
2993
 
3562
 
static void
 
2994
void
3563
2995
dissect_spc3_preventallowmediaremoval (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3564
2996
                          guint offset, gboolean isreq, gboolean iscdb,
3565
2997
                          guint payload_len _U_, scsi_task_data_t *cdata _U_)
3571
3003
 
3572
3004
    if (isreq && iscdb) {
3573
3005
        flags = tvb_get_guint8 (tvb, offset+3);
3574
 
        proto_tree_add_text (tree, tvb, offset+3, 1, 
 
3006
        proto_tree_add_text (tree, tvb, offset+3, 1,
3575
3007
                             "Persistent: %u, Prevent: %u",
3576
3008
                             flags & 0x02, flags & 0x01);
3577
3009
 
3674
3106
    }
3675
3107
}
3676
3108
 
3677
 
static void
 
3109
void
3678
3110
dissect_spc2_release6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3679
3111
                       guint offset, gboolean isreq, gboolean iscdb,
3680
3112
                       guint payload_len _U_, scsi_task_data_t *cdata _U_)
3693
3125
    }
3694
3126
}
3695
3127
 
3696
 
static void
 
3128
void
3697
3129
dissect_spc2_release10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3698
3130
                        guint offset, gboolean isreq, gboolean iscdb,
3699
3131
                        guint payload_len _U_, scsi_task_data_t *cdata _U_)
3759
3191
                return;
3760
3192
        }
3761
3193
 
3762
 
        TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb, offset, cdata->itlq->alloc_len); 
 
3194
        TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb, offset, cdata->itlq->alloc_len);
3763
3195
        listlen = tvb_get_ntohl(tvb, offset);
3764
3196
        proto_tree_add_text (tree, tvb, offset, 4, "LUN List Length: %u",
3765
3197
                             listlen);
3810
3242
                             tvb_bytes_to_str (tvb, offset+15, 3));
3811
3243
}
3812
3244
 
3813
 
static void
 
3245
void
3814
3246
dissect_spc3_requestsense (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3815
3247
                       guint offset, gboolean isreq, gboolean iscdb,
3816
3248
                       guint payload_len _U_, scsi_task_data_t *cdata _U_)
3833
3265
        dissect_scsi_fix_snsinfo(tvb, tree, offset);
3834
3266
}
3835
3267
 
3836
 
static void
 
3268
void
3837
3269
dissect_spc2_reserve6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3838
3270
                       guint offset, gboolean isreq, gboolean iscdb,
3839
3271
                       guint payload_len _U_, scsi_task_data_t *cdata _U_)
3852
3284
    }
3853
3285
}
3854
3286
 
3855
 
static void
 
3287
void
3856
3288
dissect_spc2_reserve10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3857
3289
                        guint offset, gboolean isreq, gboolean iscdb,
3858
3290
                        guint payload_len _U_, scsi_task_data_t *cdata _U_)
3883
3315
    }
3884
3316
}
3885
3317
 
3886
 
static void
3887
 
dissect_sbc2_startstopunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3888
 
                            guint offset, gboolean isreq _U_, gboolean iscdb,
3889
 
                            guint payload_len _U_, scsi_task_data_t *cdata _U_)
3890
 
{
3891
 
    guint8 flags;
3892
 
 
3893
 
    if (!tree || !iscdb)
3894
 
        return;
3895
 
 
3896
 
    proto_tree_add_boolean (tree, hf_scsi_ssu_immed, tvb, offset, 1, 0);
3897
 
    proto_tree_add_uint (tree, hf_scsi_ssu_pwr_cond, tvb, offset+3, 1, 0);
3898
 
    proto_tree_add_boolean (tree, hf_scsi_ssu_loej, tvb, offset+3, 1, 0);
3899
 
    proto_tree_add_boolean (tree, hf_scsi_ssu_start, tvb, offset+3, 1, 0);
3900
 
 
3901
 
    flags = tvb_get_guint8 (tvb, offset+4);
3902
 
    proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
3903
 
                                flags,
3904
 
                                "Vendor Unique = %u, NACA = %u, Link = %u",
3905
 
                                flags & 0xC0, flags & 0x4, flags & 0x1);
3906
 
}
3907
 
 
3908
 
static void
 
3318
void
3909
3319
dissect_spc3_testunitready (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3910
3320
                          guint offset, gboolean isreq, gboolean iscdb,
3911
3321
                          guint payload_len _U_, scsi_task_data_t *cdata _U_)
3924
3334
    }
3925
3335
}
3926
3336
 
3927
 
static void
3928
 
dissect_sbc2_formatunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3929
 
                         guint offset, gboolean isreq, gboolean iscdb,
3930
 
                         guint payload_len _U_, scsi_task_data_t *cdata _U_)
3931
 
{
3932
 
    guint8 flags;
3933
 
 
3934
 
    if (!tree)
3935
 
        return;
3936
 
 
3937
 
    if (isreq && iscdb) {
3938
 
        flags = tvb_get_guint8 (tvb, offset);
3939
 
        proto_tree_add_uint_format (tree, hf_scsi_formatunit_flags, tvb, offset,
3940
 
                                    1, flags,
3941
 
                                    "Flags: Longlist = %u, FMTDATA = %u, CMPLIST = %u",
3942
 
                                    flags & 0x20, flags & 0x8, flags & 0x4);
3943
 
        proto_tree_add_item (tree, hf_scsi_cdb_defectfmt, tvb, offset, 1, 0);
3944
 
        proto_tree_add_item (tree, hf_scsi_formatunit_vendor, tvb, offset+1,
3945
 
                             1, 0);
3946
 
        proto_tree_add_item (tree, hf_scsi_formatunit_interleave, tvb, offset+2,
3947
 
                             2, 0);
3948
 
        flags = tvb_get_guint8 (tvb, offset+4);
3949
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
3950
 
                                    flags,
3951
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
3952
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
3953
 
    }
3954
 
}
3955
 
 
3956
 
static void
3957
 
dissect_sbc2_readwrite6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3958
 
                    guint offset, gboolean isreq, gboolean iscdb,
3959
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
3960
 
{
3961
 
    guint8 flags;
3962
 
 
3963
 
    if (isreq && iscdb) {
3964
 
        if (check_col (pinfo->cinfo, COL_INFO))
3965
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
3966
 
                             tvb_get_ntoh24 (tvb, offset),
3967
 
                             tvb_get_guint8 (tvb, offset+3));
3968
 
    }
3969
 
 
3970
 
    if (tree && isreq && iscdb) {
3971
 
        proto_tree_add_item (tree, hf_scsi_rdwr6_lba, tvb, offset, 3, 0);
3972
 
        proto_tree_add_item (tree, hf_scsi_rdwr6_xferlen, tvb, offset+3, 1, 0);
3973
 
        flags = tvb_get_guint8 (tvb, offset+4);
3974
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
3975
 
                                    flags,
3976
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
3977
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
3978
 
    }
3979
 
}
3980
 
 
3981
 
static void
3982
 
dissect_sbc2_readwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
3983
 
                     guint offset, gboolean isreq, gboolean iscdb,
3984
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
3985
 
 
3986
 
{
3987
 
    guint8 flags;
3988
 
 
3989
 
    if (isreq && iscdb) {
3990
 
        if (check_col (pinfo->cinfo, COL_INFO))
3991
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
3992
 
                             tvb_get_ntohl (tvb, offset+1),
3993
 
                             tvb_get_ntohs (tvb, offset+6));
3994
 
    }
3995
 
 
3996
 
    if (tree && isreq && iscdb) {
3997
 
        flags = tvb_get_guint8 (tvb, offset);
3998
 
 
3999
 
        proto_tree_add_uint_format (tree, hf_scsi_read_flags, tvb, offset, 1,
4000
 
                                    flags,
4001
 
                                    "DPO = %u, FUA = %u, RelAddr = %u",
4002
 
                                    flags & 0x10, flags & 0x8, flags & 0x1);
4003
 
        proto_tree_add_item (tree, hf_scsi_rdwr10_lba, tvb, offset+1, 4, 0);
4004
 
        proto_tree_add_item (tree, hf_scsi_rdwr10_xferlen, tvb, offset+6, 2, 0);
4005
 
        flags = tvb_get_guint8 (tvb, offset+8);
4006
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4007
 
                                    flags,
4008
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4009
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4010
 
    }
4011
 
}
4012
 
 
4013
 
static void
4014
 
dissect_sbc2_readwrite12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4015
 
                     guint offset, gboolean isreq, gboolean iscdb,
4016
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4017
 
{
4018
 
    guint8 flags;
4019
 
 
4020
 
    if (isreq && iscdb) {
4021
 
        if (check_col (pinfo->cinfo, COL_INFO))
4022
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
4023
 
                             tvb_get_ntohl (tvb, offset+1),
4024
 
                             tvb_get_ntohl (tvb, offset+5));
4025
 
    }
4026
 
 
4027
 
    if (tree && isreq && iscdb) {
4028
 
        flags = tvb_get_guint8 (tvb, offset);
4029
 
 
4030
 
        proto_tree_add_uint_format (tree, hf_scsi_read_flags, tvb, offset, 1,
4031
 
                                    flags,
4032
 
                                    "DPO = %u, FUA = %u, RelAddr = %u",
4033
 
                                    flags & 0x10, flags & 0x8, flags & 0x1);
4034
 
        proto_tree_add_item (tree, hf_scsi_rdwr10_lba, tvb, offset+1, 4, 0);
4035
 
        proto_tree_add_item (tree, hf_scsi_rdwr12_xferlen, tvb, offset+5, 4, 0);
4036
 
        flags = tvb_get_guint8 (tvb, offset+10);
4037
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
4038
 
                                    flags,
4039
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4040
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4041
 
    }
4042
 
}
4043
 
 
4044
 
static void
4045
 
dissect_sbc2_readwrite16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4046
 
                     guint offset, gboolean isreq, gboolean iscdb,
4047
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4048
 
{
4049
 
    guint8 flags;
4050
 
 
4051
 
    if (isreq && iscdb) {
4052
 
        if (check_col (pinfo->cinfo, COL_INFO))
4053
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
4054
 
                             tvb_get_ntoh64 (tvb, offset+1),
4055
 
                             tvb_get_ntohl (tvb, offset+9));
4056
 
    }
4057
 
 
4058
 
    if (tree && isreq && iscdb) {
4059
 
        flags = tvb_get_guint8 (tvb, offset);
4060
 
 
4061
 
        proto_tree_add_uint_format (tree, hf_scsi_read_flags, tvb, offset, 1,
4062
 
                                    flags,
4063
 
                                    "DPO = %u, FUA = %u, RelAddr = %u",
4064
 
                                    flags & 0x10, flags & 0x8, flags & 0x1);
4065
 
        proto_tree_add_item (tree, hf_scsi_rdwr16_lba, tvb, offset+1, 8, 0);
4066
 
        proto_tree_add_item (tree, hf_scsi_rdwr12_xferlen, tvb, offset+9, 4, 0);
4067
 
        flags = tvb_get_guint8 (tvb, offset+14);
4068
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
4069
 
                                    flags,
4070
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4071
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4072
 
    }
4073
 
}
4074
 
 
4075
 
static void
4076
 
dissect_sbc2_verify10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4077
 
                       guint offset, gboolean isreq, gboolean iscdb,
4078
 
                       guint payload_len _U_, scsi_task_data_t *cdata _U_)
4079
 
 
4080
 
{
4081
 
    guint8 flags;
4082
 
 
4083
 
    if (isreq && iscdb) {
4084
 
        if (check_col (pinfo->cinfo, COL_INFO))
4085
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
4086
 
                             tvb_get_ntohl (tvb, offset+2),
4087
 
                             tvb_get_ntohs (tvb, offset+7));
4088
 
    }
4089
 
 
4090
 
    if (tree && isreq && iscdb) {
4091
 
         proto_tree_add_item (tree, hf_sbc2_verify_dpo, tvb, offset+1, 1, 0);
4092
 
         proto_tree_add_item (tree, hf_sbc2_verify_blkvfy, tvb, offset+1, 1, 0);
4093
 
         proto_tree_add_item (tree, hf_sbc2_verify_bytchk, tvb, offset+1, 1, 0);
4094
 
         proto_tree_add_item (tree, hf_sbc2_verify_reladdr, tvb, offset+1, 1,
4095
 
                              0);
4096
 
         proto_tree_add_item (tree, hf_sbc2_verify_lba, tvb, offset+2, 4, 0);
4097
 
         proto_tree_add_item (tree, hf_sbc2_verify_vlen, tvb, offset+7, 2, 0);
4098
 
         flags = tvb_get_guint8 (tvb, offset+9);
4099
 
         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+9, 1,
4100
 
                                     flags,
4101
 
                                     "Vendor Unique = %u, NACA = %u, Link = %u",
4102
 
                                     flags & 0xC0, flags & 0x4, flags & 0x1);
4103
 
    }
4104
 
}
4105
 
 
4106
 
static void
4107
 
dissect_sbc2_verify12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4108
 
                       guint offset, gboolean isreq, gboolean iscdb,
4109
 
                       guint payload_len _U_, scsi_task_data_t *cdata _U_)
4110
 
 
4111
 
{
4112
 
    guint8 flags;
4113
 
 
4114
 
    if (isreq && iscdb) {
4115
 
        if (check_col (pinfo->cinfo, COL_INFO))
4116
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
4117
 
                             tvb_get_ntohl (tvb, offset+2),
4118
 
                             tvb_get_ntohl (tvb, offset+6));
4119
 
    }
4120
 
 
4121
 
    if (tree && isreq && iscdb) {
4122
 
         proto_tree_add_item (tree, hf_sbc2_verify_dpo, tvb, offset+1, 1, 0);
4123
 
         proto_tree_add_item (tree, hf_sbc2_verify_blkvfy, tvb, offset+1, 1, 0);
4124
 
         proto_tree_add_item (tree, hf_sbc2_verify_bytchk, tvb, offset+1, 1, 0);
4125
 
         proto_tree_add_item (tree, hf_sbc2_verify_reladdr, tvb, offset+1, 1,
4126
 
                              0);
4127
 
         proto_tree_add_item (tree, hf_sbc2_verify_lba, tvb, offset+2, 4, 0);
4128
 
         proto_tree_add_item (tree, hf_sbc2_verify_vlen32, tvb, offset+6, 4, 0);
4129
 
         flags = tvb_get_guint8 (tvb, offset+11);
4130
 
         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+11, 1,
4131
 
                                     flags,
4132
 
                                     "Vendor Unique = %u, NACA = %u, Link = %u",
4133
 
                                     flags & 0xC0, flags & 0x4, flags & 0x1);
4134
 
    }
4135
 
}
4136
 
 
4137
 
static void
4138
 
dissect_sbc2_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4139
 
                       guint offset, gboolean isreq, gboolean iscdb,
4140
 
                       guint payload_len _U_, scsi_task_data_t *cdata _U_)
4141
 
 
4142
 
{
4143
 
    guint8 flags;
4144
 
 
4145
 
    if (isreq && iscdb) {
4146
 
        if (check_col (pinfo->cinfo, COL_INFO))
4147
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
4148
 
                             tvb_get_ntoh64 (tvb, offset+2),
4149
 
                             tvb_get_ntohl (tvb, offset+10));
4150
 
    }
4151
 
 
4152
 
    if (tree && isreq && iscdb) {
4153
 
         proto_tree_add_item (tree, hf_sbc2_verify_dpo, tvb, offset+1, 1, 0);
4154
 
         proto_tree_add_item (tree, hf_sbc2_verify_blkvfy, tvb, offset+1, 1, 0);
4155
 
         proto_tree_add_item (tree, hf_sbc2_verify_bytchk, tvb, offset+1, 1, 0);
4156
 
         proto_tree_add_item (tree, hf_sbc2_verify_reladdr, tvb, offset+1, 1,
4157
 
                              0);
4158
 
         proto_tree_add_item (tree, hf_sbc2_verify_lba, tvb, offset+2, 8, 0);
4159
 
         proto_tree_add_item (tree, hf_sbc2_verify_vlen, tvb, offset+10, 4, 0);
4160
 
         flags = tvb_get_guint8 (tvb, offset+15);
4161
 
         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+15, 1,
4162
 
                                     flags,
4163
 
                                     "Vendor Unique = %u, NACA = %u, Link = %u",
4164
 
                                     flags & 0xC0, flags & 0x4, flags & 0x1);
4165
 
    }
4166
 
}
4167
 
 
4168
 
static void
4169
 
dissect_sbc2_wrverify10 (tvbuff_t *tvb, packet_info *pinfo _U_,
4170
 
                         proto_tree *tree, guint offset, gboolean isreq,
4171
 
                         gboolean iscdb, guint payload_len _U_,
4172
 
                         scsi_task_data_t *cdata _U_)
4173
 
 
4174
 
{
4175
 
    guint8 flags;
4176
 
 
4177
 
    if (isreq && iscdb) {
4178
 
        if (check_col (pinfo->cinfo, COL_INFO))
4179
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
4180
 
                             tvb_get_ntohl (tvb, offset+2),
4181
 
                             tvb_get_ntohs (tvb, offset+7));
4182
 
    }
4183
 
 
4184
 
    if (tree && isreq && iscdb) {
4185
 
         proto_tree_add_item (tree, hf_sbc2_verify_dpo, tvb, offset+1, 1, 0);
4186
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_ebp, tvb, offset+1, 1, 0);
4187
 
         proto_tree_add_item (tree, hf_sbc2_verify_bytchk, tvb, offset+1, 1, 0);
4188
 
         proto_tree_add_item (tree, hf_sbc2_verify_reladdr, tvb, offset+1, 1,
4189
 
                              0);
4190
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_lba, tvb, offset+2, 4, 0);
4191
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_xferlen, tvb, offset+7,
4192
 
                              2, 0);
4193
 
         flags = tvb_get_guint8 (tvb, offset+9);
4194
 
         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+9, 1,
4195
 
                                     flags,
4196
 
                                     "Vendor Unique = %u, NACA = %u, Link = %u",
4197
 
                                     flags & 0xC0, flags & 0x4, flags & 0x1);
4198
 
    }
4199
 
}
4200
 
 
4201
 
static void
4202
 
dissect_sbc2_wrverify12 (tvbuff_t *tvb, packet_info *pinfo _U_,
4203
 
                         proto_tree *tree, guint offset, gboolean isreq,
4204
 
                         gboolean iscdb, guint payload_len _U_,
4205
 
                         scsi_task_data_t *cdata _U_)
4206
 
{
4207
 
    guint8 flags;
4208
 
 
4209
 
    if (isreq && iscdb) {
4210
 
        if (check_col (pinfo->cinfo, COL_INFO))
4211
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
4212
 
                             tvb_get_ntohl (tvb, offset+2),
4213
 
                             tvb_get_ntohl (tvb, offset+6));
4214
 
    }
4215
 
 
4216
 
    if (tree && isreq && iscdb) {
4217
 
         proto_tree_add_item (tree, hf_sbc2_verify_dpo, tvb, offset+1, 1, 0);
4218
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_ebp, tvb, offset+1, 1, 0);
4219
 
         proto_tree_add_item (tree, hf_sbc2_verify_bytchk, tvb, offset+1, 1, 0);
4220
 
         proto_tree_add_item (tree, hf_sbc2_verify_reladdr, tvb, offset+1, 1,
4221
 
                              0);
4222
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_lba, tvb, offset+2, 4, 0);
4223
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_xferlen32, tvb, offset+6,
4224
 
                              4, 0);
4225
 
         flags = tvb_get_guint8 (tvb, offset+11);
4226
 
         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+11, 1,
4227
 
                                     flags,
4228
 
                                     "Vendor Unique = %u, NACA = %u, Link = %u",
4229
 
                                     flags & 0xC0, flags & 0x4, flags & 0x1);
4230
 
    }
4231
 
}
4232
 
 
4233
 
static void
4234
 
dissect_sbc2_wrverify16 (tvbuff_t *tvb, packet_info *pinfo _U_,
4235
 
                         proto_tree *tree, guint offset, gboolean isreq,
4236
 
                         gboolean iscdb, guint payload_len _U_,
4237
 
                         scsi_task_data_t *cdata _U_)
4238
 
{
4239
 
    guint8 flags;
4240
 
 
4241
 
    if (isreq && iscdb) {
4242
 
        if (check_col (pinfo->cinfo, COL_INFO))
4243
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
4244
 
                             tvb_get_ntoh64 (tvb, offset+2),
4245
 
                             tvb_get_ntohl (tvb, offset+10));
4246
 
    }
4247
 
 
4248
 
    if (tree && isreq && iscdb) {
4249
 
         proto_tree_add_item (tree, hf_sbc2_verify_dpo, tvb, offset+1, 1, 0);
4250
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_ebp, tvb, offset+1, 1, 0);
4251
 
         proto_tree_add_item (tree, hf_sbc2_verify_bytchk, tvb, offset+1, 1, 0);
4252
 
         proto_tree_add_item (tree, hf_sbc2_verify_reladdr, tvb, offset+1, 1,
4253
 
                              0);
4254
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_lba64, tvb, offset+2, 8, 0);
4255
 
         proto_tree_add_item (tree, hf_sbc2_wrverify_xferlen32, tvb, offset+10,
4256
 
                              4, 0);
4257
 
         flags = tvb_get_guint8 (tvb, offset+15);
4258
 
         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+15, 1,
4259
 
                                     flags,
4260
 
                                     "Vendor Unique = %u, NACA = %u, Link = %u",
4261
 
                                     flags & 0xC0, flags & 0x4, flags & 0x1);
4262
 
    }
4263
 
}
4264
 
 
4265
 
static const value_string scsi_key_class_val[] = {
4266
 
    {0x00, "DVD CSS/CPPM or CPRM"},
4267
 
    {0x01, "ReWriteable Security Service - A"},
4268
 
    {0,NULL}
4269
 
};
4270
 
static const value_string scsi_key_format_val[] = {
4271
 
    {0x00,      "AGID for CSS/CPPM"},
4272
 
    {0x01,      "Challenge Key"},
4273
 
    {0x02,      "Key 1"},
4274
 
    {0x04,      "Title Key"},
4275
 
    {0x05,      "Authentication Success Flag"},
4276
 
    {0x08,      "RPC State"},
4277
 
    {0x11,      "AGID for CPRM"},
4278
 
    {0x3f,      "None"},
4279
 
    {0,NULL}
4280
 
};
4281
 
static const value_string scsi_report_key_type_code_val[] = {
4282
 
    {0x00,      "NONE"},
4283
 
    {0x01,      "SET"},
4284
 
    {0x02,      "LAST CHANCE"},
4285
 
    {0x03,      "PERM"},
4286
 
    {0,NULL}
4287
 
};
4288
 
static const value_string scsi_report_key_rpc_scheme_val[] = {
4289
 
    {0x00,      "Unknown (RPC not enforced)"},
4290
 
    {0x01,      "RPC Phase II"},
4291
 
    {0,NULL}
4292
 
};
4293
 
 
4294
 
static void
4295
 
dissect_mmc4_reportkey (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4296
 
                     guint offset, gboolean isreq, gboolean iscdb,
4297
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4298
 
 
4299
 
{
4300
 
    guint8 flags, agid, key_format, key_class;
4301
 
    proto_item *ti;
4302
 
 
4303
 
    if (tree && isreq && iscdb) {
4304
 
        proto_tree_add_item (tree, hf_scsi_lba, tvb, offset+1,
4305
 
                             4, 0);
4306
 
        key_class=tvb_get_guint8(tvb, offset+6);
4307
 
        proto_tree_add_item (tree, hf_scsi_key_class, tvb, offset+6,
4308
 
                             1, 0);
4309
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+7, 2, 0);
4310
 
 
4311
 
        agid=tvb_get_guint8(tvb, offset+9)&0xc0;
4312
 
        key_format=tvb_get_guint8(tvb, offset+9)&0x3f;
4313
 
        switch(key_format){
4314
 
        case 0x01:
4315
 
        case 0x02:
4316
 
        case 0x04:
4317
 
        case 0x3f:
4318
 
            /* agid is only valid for some formats */
4319
 
            proto_tree_add_uint (tree, hf_scsi_agid, tvb, offset+9, 1, agid);
4320
 
            break;
4321
 
        }
4322
 
        proto_tree_add_uint (tree, hf_scsi_key_format, tvb, offset+9, 1, key_format);
4323
 
        /* save key_class/key_format so we can decode the response */
4324
 
        cdata->itlq->flags=(key_format<<8)|key_class;
4325
 
 
4326
 
        flags = tvb_get_guint8 (tvb, offset+14);
4327
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
4328
 
                                    flags,
4329
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4330
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4331
 
    }
4332
 
    if(tree && (!isreq)) {
4333
 
        switch(cdata->itlq->flags){
4334
 
        case 0x0800: /* format:RPC State  class:00 */
4335
 
            proto_tree_add_item (tree, hf_scsi_data_length, tvb, offset, 2, 0);
4336
 
            proto_tree_add_item (tree, hf_scsi_report_key_type_code, tvb, offset+4, 1, 0);
4337
 
            proto_tree_add_item (tree, hf_scsi_report_key_vendor_resets, tvb, offset+4, 1, 0);
4338
 
            proto_tree_add_item (tree, hf_scsi_report_key_user_changes, tvb, offset+4, 1, 0);
4339
 
            proto_tree_add_item (tree, hf_scsi_report_key_region_mask, tvb, offset+5, 1, 0);
4340
 
            proto_tree_add_item (tree, hf_scsi_report_key_rpc_scheme, tvb, offset+6, 1, 0);
4341
 
            break;
4342
 
        default:
4343
 
            ti = proto_tree_add_text (tree, tvb, 0, 0,
4344
 
                "SCSI/MMC Unknown Format:0x%02x/Class:0x%02x combination",
4345
 
                cdata->itlq->flags>>8,cdata->itlq->flags&0xff);
4346
 
            PROTO_ITEM_SET_GENERATED(ti);
4347
 
            break;
4348
 
        }
4349
 
    }
4350
 
}
4351
 
 
4352
 
static const value_string scsi_setstreaming_type_val[] = {
4353
 
    {0x00,      "Performance Descriptor"},
4354
 
    {0x05,      "DBI cache zone descriptor"},
4355
 
    {0,NULL}
4356
 
};
4357
 
 
4358
 
static void
4359
 
dissect_mmc4_setstreaming (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4360
 
                     guint offset, gboolean isreq, gboolean iscdb,
4361
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4362
 
 
4363
 
{
4364
 
    guint8 flags, type;
4365
 
    proto_item *ti;
4366
 
 
4367
 
    if (tree && isreq && iscdb) {
4368
 
        type=tvb_get_guint8(tvb, offset+7);
4369
 
        cdata->itlq->flags=type;
4370
 
        proto_tree_add_item (tree, hf_scsi_setstreaming_type, tvb, offset+7, 1, 0);
4371
 
        proto_tree_add_item (tree, hf_scsi_setstreaming_param_len, tvb, offset+8, 2, 0);
4372
 
 
4373
 
        flags = tvb_get_guint8 (tvb, offset+10);
4374
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
4375
 
                                    flags,
4376
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4377
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4378
 
    }
4379
 
    if(tree && isreq && (!iscdb)) {
4380
 
        switch(cdata->itlq->flags){
4381
 
        case 0x00: /* performance descriptor */
4382
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_wrc, tvb, offset+0, 1, 0);
4383
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_rdd, tvb, offset+0, 1, 0);
4384
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_exact, tvb, offset+0, 1, 0);
4385
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_ra, tvb, offset+0, 1, 0);
4386
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_start_lba, tvb, offset+4, 4, 0);
4387
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_end_lba, tvb, offset+8, 4, 0);
4388
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_read_size, tvb, offset+12, 4, 0);
4389
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_read_time, tvb, offset+16, 4, 0);
4390
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_write_size, tvb, offset+20, 4, 0);
4391
 
            proto_tree_add_item (tree, hf_scsi_setstreaming_write_time, tvb, offset+24, 4, 0);
4392
 
            break;
4393
 
        default:
4394
 
            ti = proto_tree_add_text (tree, tvb, 0, 0,
4395
 
                "SCSI/MMC Unknown SetStreaming Type:0x%02x",cdata->itlq->flags);
4396
 
            PROTO_ITEM_SET_GENERATED(ti);
4397
 
            break;
4398
 
        }
4399
 
    }
4400
 
}
4401
 
 
4402
 
static const value_string scsi_setcdspeed_rc_val[] = {
4403
 
    {0x00,      "CLV and none-pure CAV"},
4404
 
    {0x01,      "Pure CAV"},
4405
 
    {0x02,      "Reserved"},
4406
 
    {0x03,      "Reserved"},
4407
 
    {0,NULL}
4408
 
};
4409
 
 
4410
 
static void
4411
 
dissect_mmc4_setcdspeed (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4412
 
                     guint offset, gboolean isreq, gboolean iscdb,
4413
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4414
 
 
4415
 
{
4416
 
    guint8 flags;
4417
 
 
4418
 
    if (tree && isreq && iscdb) {
4419
 
        proto_tree_add_item (tree, hf_scsi_setcdspeed_rc, tvb, offset+0, 1, 0);
4420
 
 
4421
 
        proto_tree_add_text (tree, tvb, offset+1, 2,
4422
 
                             "Logical Unit Read Speed(bytes/sec): %u",
4423
 
                             tvb_get_ntohs (tvb, offset+1));
4424
 
        proto_tree_add_text (tree, tvb, offset+3, 2,
4425
 
                             "Logical Unit Write Speed(bytes/sec): %u",
4426
 
                             tvb_get_ntohs (tvb, offset+3));
4427
 
 
4428
 
        flags = tvb_get_guint8 (tvb, offset+10);
4429
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
4430
 
                                    flags,
4431
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4432
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4433
 
    }
4434
 
}
4435
 
 
4436
 
static const value_string scsi_getconf_rt_val[] = {
4437
 
    {0x00,      "Return all features"},
4438
 
    {0x01,      "Return all current features"},
4439
 
    {0x02,      "Return all identified by Starting Feature"},
4440
 
    {0,NULL}
4441
 
};
4442
 
static const value_string scsi_getconf_current_profile_val[] = {
4443
 
    {0x0000,    "Reserved"},
4444
 
    {0x0001,    "Non-removable disk"},
4445
 
    {0x0002,    "Removable disk"},
4446
 
    {0x0003,    "MO Erasable"},
4447
 
    {0x0004,    "Optical Write Once"},
4448
 
    {0x0005,    "AS-MO"},
4449
 
    {0x0008,    "CD-ROM"},
4450
 
    {0x0009,    "CD-R"},
4451
 
    {0x000a,    "CD-RW"},
4452
 
    {0x0010,    "DVD-ROM"},
4453
 
    {0x0011,    "DVD-R"},
4454
 
    {0x0012,    "DVD-RAM"},
4455
 
    {0x0013,    "DVD-RW Restricted Overwrite"},
4456
 
    {0x0014,    "DVD-RW Sequential recording"},
4457
 
    {0x001a,    "DVD+RW"},
4458
 
    {0x001b,    "DVD+R"},
4459
 
    {0x0020,    "DDCD-ROM"},
4460
 
    {0x0021,    "DDCD-R"},
4461
 
    {0x0022,    "DDCD-RW"},
4462
 
    {0xffff,    "Logical unit not conforming to a standard profile"},
4463
 
    {0,NULL}
4464
 
};
4465
 
 
4466
 
static const value_string scsi_feature_val[] = {
4467
 
    {0x0000,    "Profile List"},
4468
 
    {0x0001,    "Core"},
4469
 
    {0x0002,    "Morphing"},
4470
 
    {0x0003,    "Removable Medium"},
4471
 
    {0x0004,    "Write Protect"},
4472
 
    {0x0010,    "Random Readable"},
4473
 
    {0x001d,    "Multi-read"},
4474
 
    {0x001e,    "CD Read"},
4475
 
    {0x001f,    "DVD Read"},
4476
 
    {0x0020,    "Random Writeable"},
4477
 
    {0x0021,    "Incremental Streaming Writeable"},
4478
 
    {0x0022,    "Sector Erasable"},
4479
 
    {0x0023,    "Formattable"},
4480
 
    {0x0024,    "Defect Management"},
4481
 
    {0x0025,    "Write Once"},
4482
 
    {0x0026,    "Restricted Overwrite"},
4483
 
    {0x0027,    "CD-RW CAV Write"},
4484
 
    {0x0028,    "MRW"},
4485
 
    {0x0029,    "Enhanced Defect Reporting"},
4486
 
    {0x002a,    "DVD+RW"},
4487
 
    {0x002b,    "DVD+R"},
4488
 
    {0x002c,    "Rigid Restricted Overwrite"},
4489
 
    {0x002d,    "CD Track At Once"},
4490
 
    {0x002e,    "CD Mastering"},
4491
 
    {0x002f,    "DVD-R/-RW Write"},
4492
 
    {0x0030,    "DDCD Read"},
4493
 
    {0x0031,    "DDCD-R Write"},
4494
 
    {0x0032,    "DDCD-RW Write"},
4495
 
    {0x0037,    "CD-RW Media Write Support"},
4496
 
    {0x0100,    "Power Management"},
4497
 
    {0x0101,    "SMART"},
4498
 
    {0x0102,    "Embedded Changer"},
4499
 
    {0x0103,    "CD Audio analog play"},
4500
 
    {0x0104,    "Microcode Upgrade"},
4501
 
    {0x0105,    "Timeout"},
4502
 
    {0x0106,    "DVD-CSS"},
4503
 
    {0x0107,    "Real Time Streaming"},
4504
 
    {0x0108,    "Logical Unit serial number"},
4505
 
    {0x010a,    "Disc control Block"},
4506
 
    {0x010b,    "DVD CPRM"},
4507
 
    {0x010c,    "Firmware Information"},
4508
 
    {0,NULL}
4509
 
};
4510
 
 
4511
 
static void
4512
 
dissect_mmc4_getconfiguration (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4513
 
                     guint offset, gboolean isreq, gboolean iscdb,
4514
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4515
 
 
4516
 
{
4517
 
    guint8 flags;
4518
 
    gint32 len;
4519
 
    guint old_offset;
4520
 
 
4521
 
    if (tree && isreq && iscdb) {
4522
 
        proto_tree_add_item (tree, hf_scsi_getconf_rt, tvb, offset+0, 1, 0);
4523
 
        proto_tree_add_item (tree, hf_scsi_getconf_starting_feature, tvb, offset+1, 2, 0);
4524
 
 
4525
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
4526
 
        /* we need the alloc_len in the response */
4527
 
        if(cdata){
4528
 
                cdata->itlq->alloc_len=tvb_get_ntohs(tvb, offset+6);
4529
 
        }
4530
 
 
4531
 
        flags = tvb_get_guint8 (tvb, offset+8);
4532
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4533
 
                                    flags,
4534
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4535
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4536
 
    }
4537
 
    if(!isreq) {
4538
 
        if(!cdata){
4539
 
                return;
4540
 
        }
4541
 
 
4542
 
        TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb, offset, cdata->itlq->alloc_len); 
4543
 
 
4544
 
        len=tvb_get_ntohl(tvb, offset+0);
4545
 
        proto_tree_add_item (tree, hf_scsi_data_length, tvb, offset, 4, 0);
4546
 
        proto_tree_add_item (tree, hf_scsi_getconf_current_profile, tvb, offset+6, 2, 0);
4547
 
        offset+=8;
4548
 
        len-=4;
4549
 
        while(len>0){
4550
 
                guint16 feature;
4551
 
                guint8 additional_length;
4552
 
                guint8 num_linksize;
4553
 
 
4554
 
                feature=tvb_get_ntohs(tvb, offset);
4555
 
                proto_tree_add_item (tree, hf_scsi_feature, tvb, offset, 2, 0);
4556
 
                offset+=2;
4557
 
                proto_tree_add_item (tree, hf_scsi_feature_version, tvb, offset, 1, 0);
4558
 
                proto_tree_add_item (tree, hf_scsi_feature_persistent, tvb, offset, 1, 0);
4559
 
                proto_tree_add_item (tree, hf_scsi_feature_current, tvb, offset, 1, 0);
4560
 
                offset+=1;
4561
 
                additional_length=tvb_get_guint8(tvb, offset);
4562
 
                proto_tree_add_item (tree, hf_scsi_feature_additional_length, tvb, offset, 1, 0);
4563
 
                offset+=1;
4564
 
                old_offset=offset;
4565
 
                switch(feature){
4566
 
                case 0x0000: /* profile list */
4567
 
                    while(offset<(old_offset+additional_length)){
4568
 
                        proto_item *it=NULL;
4569
 
                        proto_tree *tr=NULL;
4570
 
                        guint16 profile;
4571
 
                        guint8  cur_profile;
4572
 
 
4573
 
                        if(tree){
4574
 
                                it=proto_tree_add_text(tree, tvb, offset, 4, "Profile:");
4575
 
                                tr=proto_item_add_subtree(it, ett_scsi_profile);
4576
 
                        }
4577
 
 
4578
 
                        profile=tvb_get_ntohs(tvb, offset);
4579
 
                        proto_tree_add_item (tr, hf_scsi_feature_profile, tvb, offset, 2, 0);
4580
 
                        proto_item_append_text(it, "%s", val_to_str(profile, scsi_getconf_current_profile_val, "Unknown 0x%04x"));
4581
 
 
4582
 
                        cur_profile=tvb_get_guint8(tvb, offset+2);
4583
 
                        proto_tree_add_item (tr, hf_scsi_feature_profile_current, tvb, offset+2, 1, 0);
4584
 
                        if(cur_profile&0x01){
4585
 
                                proto_item_append_text(it, "  [CURRENT PROFILE]");
4586
 
                        }
4587
 
 
4588
 
                        offset+=4;
4589
 
                    }
4590
 
                    break;
4591
 
                case 0x001d: /* multi-read */
4592
 
                case 0x001f: /* dvd read feature */
4593
 
                    /* no data for this one */
4594
 
                    break;
4595
 
                case 0x001e: /* cd read */
4596
 
                    proto_tree_add_item (tree, hf_scsi_feature_cdread_dap, tvb, offset, 1, 0);
4597
 
                    proto_tree_add_item (tree, hf_scsi_feature_cdread_c2flag, tvb, offset, 1, 0);
4598
 
                    proto_tree_add_item (tree, hf_scsi_feature_cdread_cdtext, tvb, offset, 1, 0);
4599
 
                    break;
4600
 
                case 0x0021: /* incremental streaming writeable */
4601
 
                    proto_tree_add_item (tree, hf_scsi_feature_dts, tvb, offset, 2, 0);
4602
 
                    offset+=2;
4603
 
                    proto_tree_add_item (tree, hf_scsi_feature_isw_buf, tvb, offset, 1, 0);
4604
 
                    offset+=1;
4605
 
                    num_linksize=tvb_get_guint8(tvb, offset);
4606
 
                    proto_tree_add_item (tree, hf_scsi_feature_isw_num_linksize, tvb, offset, 1, 0);
4607
 
                    offset+=1;
4608
 
                    while(num_linksize--){
4609
 
                        proto_tree_add_item (tree, hf_scsi_feature_isw_linksize, tvb, offset, 1, 0);
4610
 
                        offset+=1;
4611
 
                    }
4612
 
                    break;
4613
 
                case 0x002a: /* dvd-rw */
4614
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdrw_write, tvb, offset, 1, 0);
4615
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdrw_quickstart, tvb, offset, 2, 0);
4616
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdrw_closeonly, tvb, offset, 2, 0);
4617
 
                    break;
4618
 
                case 0x002b: /* dvd-r */
4619
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdr_write, tvb, offset, 1, 0);
4620
 
                    break;
4621
 
                case 0x002d: /* track at once */
4622
 
                    proto_tree_add_item (tree, hf_scsi_feature_tao_buf, tvb, offset, 1, 0);
4623
 
                    proto_tree_add_item (tree, hf_scsi_feature_tao_rwraw, tvb, offset, 1, 0);
4624
 
                    proto_tree_add_item (tree, hf_scsi_feature_tao_rwpack, tvb, offset, 1, 0);
4625
 
                    proto_tree_add_item (tree, hf_scsi_feature_tao_testwrite, tvb, offset, 1, 0);
4626
 
                    proto_tree_add_item (tree, hf_scsi_feature_tao_cdrw, tvb, offset, 1, 0);
4627
 
                    proto_tree_add_item (tree, hf_scsi_feature_tao_rwsubcode, tvb, offset, 1, 0);
4628
 
                    proto_tree_add_item (tree, hf_scsi_feature_dts, tvb, offset+2, 2, 0);
4629
 
                    break;
4630
 
                case 0x002e: /* session at once */
4631
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_buf, tvb, offset, 1, 0);
4632
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_sao, tvb, offset, 1, 0);
4633
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_rawms, tvb, offset, 1, 0);
4634
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_raw, tvb, offset, 1, 0);
4635
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_testwrite, tvb, offset, 1, 0);
4636
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_cdrw, tvb, offset, 1, 0);
4637
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_rw, tvb, offset, 1, 0);
4638
 
                    proto_tree_add_item (tree, hf_scsi_feature_sao_mcsl, tvb, offset+1, 3, 0);
4639
 
                    break;
4640
 
                case 0x002f: /* dvd-r/-rw*/
4641
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdr_buf, tvb, offset, 1, 0);
4642
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdr_testwrite, tvb, offset, 1, 0);
4643
 
                    proto_tree_add_item (tree, hf_scsi_feature_dvdr_dvdrw, tvb, offset, 1, 0);
4644
 
                    break;
4645
 
                case 0x0108: /* logical unit serial number */
4646
 
                    proto_tree_add_item (tree, hf_scsi_feature_lun_sn, tvb, offset, additional_length, 0);
4647
 
                    break;
4648
 
                default:
4649
 
                    proto_tree_add_text (tree, tvb, offset, additional_length,
4650
 
                        "SCSI/MMC Unknown Feature:0x%04x",feature);
4651
 
                    break;
4652
 
                }
4653
 
                old_offset+=additional_length;
4654
 
                len-=4+additional_length;
4655
 
        }
4656
 
        END_TRY_SCSI_CDB_ALLOC_LEN;
4657
 
    }
4658
 
}
4659
 
 
4660
 
static void
4661
 
dissect_mmc4_geteventstatusnotification (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4662
 
                     guint offset, gboolean isreq, gboolean iscdb,
4663
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4664
 
 
4665
 
{
4666
 
    guint8 flags;
4667
 
 
4668
 
    if (tree && isreq && iscdb) {
4669
 
        flags = tvb_get_guint8 (tvb, offset);
4670
 
        proto_tree_add_text (tree, tvb, offset, 1,
4671
 
                             "Polled: %u",
4672
 
                             flags & 0x01);
4673
 
 
4674
 
        flags = tvb_get_guint8 (tvb, offset+3);
4675
 
        proto_tree_add_text (tree, tvb, offset+3, 1,
4676
 
                             "Notification Class Request: %u",
4677
 
                             flags);
4678
 
 
4679
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
4680
 
 
4681
 
        flags = tvb_get_guint8 (tvb, offset+8);
4682
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4683
 
                                    flags,
4684
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4685
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4686
 
    }
4687
 
}
4688
 
 
4689
 
static const value_string scsi_q_subchannel_adr_val[] = {
4690
 
    {0x0,       "Q-Subchannel mode info not supplied"},
4691
 
    {0x1,       "Q-Subchannel encodes current position data"},
4692
 
    {0x2,       "Q-Subchannel encodes media catalog number"},
4693
 
    {0x3,       "Q-Subchannel encodes ISRC"},
4694
 
    {0,NULL}
4695
 
};
4696
 
static const value_string scsi_q_subchannel_control_val[] = {
4697
 
    {0x0,       "2 Audio channels without pre-emphasis (digital copy prohibited)"},
4698
 
    {0x2,       "2 Audio channels without pre-emphasis (digital copy permitted)"},
4699
 
    {0x1,       "2 Audio channels with pre-emphasis of 50/15us (digital copy prohibited)"},
4700
 
    {0x3,       "2 Audio channels with pre-emphasis of 50/15us (digital copy permitted)"},
4701
 
    {0x8,       "audio channels without pre-emphasis (digital copy prohibited)"},
4702
 
    {0xa,       "audio channels without pre-emphasis (digital copy permitted)"},
4703
 
    {0x9,       "2 Audio channels with pre-emphasis of 50/15us (digital copy prohibited)"},
4704
 
    {0xb,       "2 Audio channels with pre-emphasis of 50/15us (digital copy permitted)"},
4705
 
    {0x4,       "Data track, recorded uninterrupted (digital copy prohibited)"},
4706
 
    {0x6,       "Data track, recorded uninterrupted (digital copy permitted)"},
4707
 
    {0x5,       "Data track, recorded incremental (digital copy prohibited)"},
4708
 
    {0x7,       "Data track, recorded incremental (digital copy permitted)"},
4709
 
    {0,NULL}
4710
 
};
4711
 
 
4712
 
static void
4713
 
dissect_mmc4_readtocpmaatip (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4714
 
                     guint offset, gboolean isreq, gboolean iscdb,
4715
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4716
 
 
4717
 
{
4718
 
    guint8 flags, format;
4719
 
    gint16 len;
4720
 
 
4721
 
    if (tree && isreq && iscdb) {
4722
 
        format=tvb_get_guint8(tvb, offset+1)&0x0f;
4723
 
        /* save format so we can decode the response */
4724
 
        cdata->itlq->flags=format;
4725
 
 
4726
 
        switch(format){
4727
 
        case 0x00:
4728
 
        case 0x01:
4729
 
            proto_tree_add_item (tree, hf_scsi_readtoc_time, tvb, offset, 1, 0);
4730
 
            /* save time so we can pick it up in the response */
4731
 
            if(tvb_get_guint8(tvb, offset)&0x02){
4732
 
                cdata->itlq->flags|=0x0100;
4733
 
            }
4734
 
            break;
4735
 
        }
4736
 
        proto_tree_add_item (tree, hf_scsi_readtoc_format, tvb, offset+1, 1, 0);
4737
 
 
4738
 
        switch(format){
4739
 
        case 0x00:
4740
 
            proto_tree_add_item (tree, hf_scsi_track, tvb, offset+5, 1, 0);
4741
 
            /* save track so we can pick it up in the response */
4742
 
            cdata->itlq->flags|=0x0200;
4743
 
            break;
4744
 
        case 0x02:
4745
 
            proto_tree_add_item (tree, hf_scsi_session, tvb, offset+5, 1, 0);
4746
 
            /* save session so we can pick it up in the response */
4747
 
            cdata->itlq->flags|=0x0400;
4748
 
            break;
4749
 
        }
4750
 
 
4751
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
4752
 
 
4753
 
        flags = tvb_get_guint8 (tvb, offset+8);
4754
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4755
 
                                    flags,
4756
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4757
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4758
 
 
4759
 
    }
4760
 
    if(tree && (!isreq)) {
4761
 
        len=tvb_get_ntohs(tvb, offset);
4762
 
        proto_tree_add_item (tree, hf_scsi_data_length, tvb, offset, 2, 0);
4763
 
        if(cdata->itlq->flags&0x0200){
4764
 
            proto_tree_add_item (tree, hf_scsi_first_track, tvb, offset+2, 1, 0);
4765
 
            proto_tree_add_item (tree, hf_scsi_readtoc_last_track, tvb, offset+3, 1, 0);
4766
 
        }
4767
 
        if(cdata->itlq->flags&0x0400){
4768
 
            proto_tree_add_item (tree, hf_scsi_readtoc_first_session, tvb, offset+2, 1, 0);
4769
 
            proto_tree_add_item (tree, hf_scsi_readtoc_last_session, tvb, offset+3, 1, 0);
4770
 
        }
4771
 
        offset+=4;
4772
 
        len-=2;
4773
 
        switch(cdata->itlq->flags&0x000f){
4774
 
        case 0x0:
4775
 
            while(len>0){
4776
 
                proto_tree_add_item (tree, hf_scsi_q_subchannel_adr, tvb, offset+1, 1, 0);
4777
 
                proto_tree_add_item (tree, hf_scsi_q_subchannel_control, tvb, offset+1, 1, 0);
4778
 
                proto_tree_add_item (tree, hf_scsi_track, tvb, offset+2, 1, 0);
4779
 
                if(cdata->itlq->flags&0x0100){
4780
 
                    proto_tree_add_item (tree, hf_scsi_track_start_time, tvb, offset+4, 4, 0);
4781
 
                } else {
4782
 
                    proto_tree_add_item (tree, hf_scsi_track_start_address, tvb, offset+4, 4, 0);
4783
 
                }
4784
 
                offset+=8;
4785
 
                len-=8;
4786
 
            }
4787
 
            break;
4788
 
        default:
4789
 
            proto_tree_add_text (tree, tvb, offset, len,
4790
 
                "SCSI/MMC Unknown READ TOC Format:0x%04x",cdata->itlq->flags&0x000f);
4791
 
            break;
4792
 
        }
4793
 
    }
4794
 
}
4795
 
 
4796
 
static void
4797
 
dissect_mmc4_getperformance (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4798
 
                     guint offset, gboolean isreq, gboolean iscdb,
4799
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4800
 
 
4801
 
{
4802
 
    guint8 flags;
4803
 
 
4804
 
    if (tree && isreq && iscdb) {
4805
 
        flags = tvb_get_guint8 (tvb, offset);
4806
 
        proto_tree_add_text (tree, tvb, offset, 1, 
4807
 
                             "Data Type: %u",
4808
 
                             flags & 0x1f);
4809
 
 
4810
 
        proto_tree_add_text (tree, tvb, offset+1, 4, 
4811
 
                             "Starting LBA: %u",
4812
 
                             tvb_get_ntohl (tvb, offset+1));
4813
 
 
4814
 
        proto_tree_add_text (tree, tvb, offset+7, 2, 
4815
 
                             "Maximum Number of Descriptors: %u",
4816
 
                             tvb_get_ntohs (tvb, offset+7));
4817
 
 
4818
 
        flags = tvb_get_guint8 (tvb, offset+9);
4819
 
        proto_tree_add_text (tree, tvb, offset+9, 1, 
4820
 
                             "Type: %u",
4821
 
                             flags);
4822
 
 
4823
 
        flags = tvb_get_guint8 (tvb, offset+10);
4824
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
4825
 
                                    flags,
4826
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4827
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4828
 
 
4829
 
    }
4830
 
}
4831
 
 
4832
 
static void
4833
 
dissect_mmc4_synchronizecache (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4834
 
                     guint offset, gboolean isreq, gboolean iscdb,
4835
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4836
 
 
4837
 
{
4838
 
    guint8 flags;
4839
 
 
4840
 
    if (tree && isreq && iscdb) {
4841
 
        proto_tree_add_item (tree, hf_scsi_synccache_immed, tvb, offset, 1, 0);
4842
 
        proto_tree_add_item (tree, hf_scsi_synccache_reladr, tvb, offset, 1, 0);
4843
 
        proto_tree_add_item (tree, hf_scsi_lba, tvb, offset+1, 4, 0);
4844
 
        proto_tree_add_item (tree, hf_scsi_num_blocks, tvb, offset+6, 2, 0);
4845
 
 
4846
 
        flags = tvb_get_guint8 (tvb, offset+8);
4847
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4848
 
                                    flags,
4849
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4850
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4851
 
 
4852
 
    }
4853
 
}
4854
 
 
4855
 
static void
4856
 
dissect_mmc4_readbuffercapacity (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4857
 
                     guint offset, gboolean isreq, gboolean iscdb,
4858
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4859
 
 
4860
 
{
4861
 
    guint8 flags;
4862
 
    gint16 len;
4863
 
 
4864
 
    if (tree && isreq && iscdb) {
4865
 
        cdata->itlq->flags=0;
4866
 
        proto_tree_add_item (tree, hf_scsi_rbc_block, tvb, offset, 1, 0);
4867
 
        if(tvb_get_guint8(tvb, offset)&0x01){
4868
 
            cdata->itlq->flags=1;
4869
 
        }
4870
 
 
4871
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
4872
 
 
4873
 
        flags = tvb_get_guint8 (tvb, offset+8);
4874
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4875
 
                                    flags,
4876
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4877
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4878
 
 
4879
 
    }
4880
 
    if(tree && (!isreq)) {
4881
 
        len=tvb_get_ntohs(tvb, offset);
4882
 
        proto_tree_add_item (tree, hf_scsi_data_length, tvb, offset, 2, 0);
4883
 
        if(cdata->itlq->flags){
4884
 
            proto_tree_add_item (tree, hf_scsi_rbc_lob_blocks, tvb, offset+4, 4, 0);
4885
 
            proto_tree_add_item (tree, hf_scsi_rbc_alob_blocks, tvb, offset+8, 4, 0);
4886
 
        } else {
4887
 
            proto_tree_add_item (tree, hf_scsi_rbc_lob_bytes, tvb, offset+4, 4, 0);
4888
 
            proto_tree_add_item (tree, hf_scsi_rbc_alob_bytes, tvb, offset+8, 4, 0);
4889
 
        }
4890
 
    }
4891
 
}
4892
 
 
4893
 
static void
4894
 
dissect_mmc4_reservetrack (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4895
 
                     guint offset, gboolean isreq, gboolean iscdb,
4896
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4897
 
 
4898
 
{
4899
 
    guint8 flags;
4900
 
 
4901
 
    if (tree && isreq && iscdb) {
4902
 
        proto_tree_add_item (tree, hf_scsi_reservation_size, tvb, offset+4, 4, 0);
4903
 
 
4904
 
        flags = tvb_get_guint8 (tvb, offset+8);
4905
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4906
 
                                    flags,
4907
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4908
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4909
 
 
4910
 
    }
4911
 
}
4912
 
 
4913
 
static const value_string scsi_rti_address_type_val[] = {
4914
 
    {0x00,      "Logical Block Address"},
4915
 
    {0x01,      "Logical Track Number"},
4916
 
    {0x02,      "Session Number"},
4917
 
    {0,NULL}
4918
 
};
4919
 
 
4920
 
static void
4921
 
dissect_mmc4_readtrackinformation (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
4922
 
                     guint offset, gboolean isreq, gboolean iscdb,
4923
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
4924
 
 
4925
 
{
4926
 
    guint8 flags, addresstype;
4927
 
 
4928
 
    if (tree && isreq && iscdb) {
4929
 
        addresstype=tvb_get_guint8(tvb, offset)&0x03;
4930
 
        proto_tree_add_item (tree, hf_scsi_rti_address_type, tvb, offset+0, 1, 0);
4931
 
        switch(addresstype){
4932
 
        case 0x00: /* logical block address */
4933
 
            proto_tree_add_item (tree, hf_scsi_lba, tvb, offset+1,
4934
 
                             4, 0);
4935
 
            break;
4936
 
        case 0x01: /* logical track number */
4937
 
            proto_tree_add_item (tree, hf_scsi_track, tvb, offset+1,
4938
 
                             4, 0);
4939
 
            break;
4940
 
        case 0x02: /* logical session number */
4941
 
            proto_tree_add_item (tree, hf_scsi_session, tvb, offset+1,
4942
 
                             4, 0);
4943
 
            break;
4944
 
        }
4945
 
 
4946
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
4947
 
 
4948
 
        flags = tvb_get_guint8 (tvb, offset+8);
4949
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
4950
 
                                    flags,
4951
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
4952
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
4953
 
 
4954
 
    }
4955
 
    if(tree && (!isreq)) {
4956
 
        proto_tree_add_item (tree, hf_scsi_data_length, tvb, 0, 2, 0);
4957
 
        /* track  offset+2 and offset+32 */
4958
 
        proto_tree_add_uint (tree, hf_scsi_track, tvb, 2, 1, (tvb_get_guint8(tvb, offset+32)<<8)|tvb_get_guint8(tvb, offset+2));
4959
 
        /* session  offset+3 and offset+33 */
4960
 
        proto_tree_add_uint (tree, hf_scsi_session, tvb, 3, 1, (tvb_get_guint8(tvb, offset+33)<<8)|tvb_get_guint8(tvb, offset+3));
4961
 
        proto_tree_add_item (tree, hf_scsi_rti_damage, tvb, 5, 1, 0);
4962
 
        proto_tree_add_item (tree, hf_scsi_rti_copy, tvb, 5, 1, 0);
4963
 
        proto_tree_add_item (tree, hf_scsi_rti_track_mode, tvb, 5, 1, 0);
4964
 
        proto_tree_add_item (tree, hf_scsi_rti_rt, tvb, 6, 1, 0);
4965
 
        proto_tree_add_item (tree, hf_scsi_rti_blank, tvb, 6, 1, 0);
4966
 
        proto_tree_add_item (tree, hf_scsi_rti_packet, tvb, 6, 1, 0);
4967
 
        proto_tree_add_item (tree, hf_scsi_rti_fp, tvb, 6, 1, 0);
4968
 
        proto_tree_add_item (tree, hf_scsi_rti_data_mode, tvb, 6, 1, 0);
4969
 
        proto_tree_add_item (tree, hf_scsi_rti_lra_v, tvb, 7, 1, 0);
4970
 
        proto_tree_add_item (tree, hf_scsi_rti_nwa_v, tvb, 7, 1, 0);
4971
 
        proto_tree_add_item (tree, hf_scsi_track_start_address, tvb, offset+8, 4, 0);
4972
 
        proto_tree_add_item (tree, hf_scsi_next_writable_address, tvb, offset+12, 4, 0);
4973
 
        proto_tree_add_item (tree, hf_scsi_free_blocks, tvb, offset+16, 4, 0);
4974
 
        proto_tree_add_item (tree, hf_scsi_fixed_packet_size, tvb, offset+20, 4, 0);
4975
 
        proto_tree_add_item (tree, hf_scsi_track_size, tvb, offset+24, 4, 0);
4976
 
        proto_tree_add_item (tree, hf_scsi_last_recorded_address, tvb, offset+28, 4, 0);
4977
 
        proto_tree_add_item (tree, hf_scsi_read_compatibility_lba, tvb, offset+36, 4, 0);
4978
 
    }
4979
 
}
4980
 
 
4981
 
static const value_string scsi_disc_info_sols_val[] = {
4982
 
    {0x00,      "Empty Session"},
4983
 
    {0x01,      "Incomplete Session"},
4984
 
    {0x02,      "Reserved/Damaged Session"},
4985
 
    {0x03,      "Complete Session"},
4986
 
    {0,NULL}
4987
 
};
4988
 
 
4989
 
static const value_string scsi_disc_info_disc_status_val[] = {
4990
 
    {0x00,      "Empty Disc"},
4991
 
    {0x01,      "Incomplete Disc"},
4992
 
    {0x02,      "Finalized Disc"},
4993
 
    {0x03,      "Others"},
4994
 
    {0,NULL}
4995
 
};
4996
 
 
4997
 
static const value_string scsi_disc_info_bgfs_val[] = {
4998
 
    {0x00,      "Blank or not CD-RW/DVD-RW"},
4999
 
    {0x01,      "Background Format started but is not running nor complete"},
5000
 
    {0x02,      "Backgroung Format in progress"},
5001
 
    {0x03,      "Backgroung Format has completed"},
5002
 
    {0,NULL}
5003
 
};
5004
 
 
5005
 
static const value_string scsi_disc_info_disc_type_val[] = {
5006
 
    {0x00,      "CD-DA or CD-ROM Disc"},
5007
 
    {0x10,      "CD-I Disc"},
5008
 
    {0x20,      "CD-ROM XA Disc or DDCD"},
5009
 
    {0xff,      "Undefined"},
5010
 
    {0,NULL}
5011
 
};
5012
 
 
5013
 
static void
5014
 
dissect_mmc4_readdiscinformation (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5015
 
                     guint offset, gboolean isreq, gboolean iscdb,
5016
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
5017
 
 
5018
 
{
5019
 
    guint8 flags;
5020
 
 
5021
 
    if (tree && isreq && iscdb) {
5022
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
5023
 
 
5024
 
        flags = tvb_get_guint8 (tvb, offset+8);
5025
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
5026
 
                                    flags,
5027
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5028
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5029
 
 
5030
 
    }
5031
 
    if(tree && (!isreq)) {
5032
 
        proto_tree_add_item (tree, hf_scsi_data_length, tvb, 0, 2, 0);
5033
 
        proto_tree_add_item (tree, hf_scsi_disc_info_erasable, tvb, 2, 1, 0);
5034
 
        proto_tree_add_item (tree, hf_scsi_disc_info_state_of_last_session, tvb, 2, 1, 0);
5035
 
        proto_tree_add_item (tree, hf_scsi_disc_info_disk_status, tvb, 2, 1, 0);
5036
 
        proto_tree_add_item (tree, hf_scsi_first_track, tvb, offset+3, 1, 0);
5037
 
        /* number of session  offset+4 and offset+9 */
5038
 
        proto_tree_add_uint (tree, hf_scsi_disc_info_number_of_sessions, tvb, 4, 1, (tvb_get_guint8(tvb, offset+9)<<8)|tvb_get_guint8(tvb, offset+4));
5039
 
        /* first track in last session  offset+5 and offset+10 */
5040
 
        proto_tree_add_uint (tree, hf_scsi_disc_info_first_track_in_last_session, tvb, 5, 1, (tvb_get_guint8(tvb, offset+10)<<8)|tvb_get_guint8(tvb, offset+5));
5041
 
        /*  last track in last session  offset+6 and offset+11 */
5042
 
        proto_tree_add_uint (tree, hf_scsi_disc_info_last_track_in_last_session, tvb, 6, 1, (tvb_get_guint8(tvb, offset+11)<<8)|tvb_get_guint8(tvb, offset+6));
5043
 
        proto_tree_add_item (tree, hf_scsi_disc_info_did_v, tvb, offset+7, 1, 0);
5044
 
        proto_tree_add_item (tree, hf_scsi_disc_info_dbc_v, tvb, offset+7, 1, 0);
5045
 
        proto_tree_add_item (tree, hf_scsi_disc_info_uru, tvb, offset+7, 1, 0);
5046
 
        proto_tree_add_item (tree, hf_scsi_disc_info_dac_v, tvb, offset+7, 1, 0);
5047
 
        proto_tree_add_item (tree, hf_scsi_disc_info_dbit, tvb, offset+7, 1, 0);
5048
 
        proto_tree_add_item (tree, hf_scsi_disc_info_bgfs, tvb, offset+7, 1, 0);
5049
 
        proto_tree_add_item (tree, hf_scsi_disc_info_disc_type, tvb, offset+8, 1, 0);
5050
 
        proto_tree_add_item (tree, hf_scsi_disc_info_disc_identification, tvb, offset+12, 4, 0);
5051
 
        proto_tree_add_item (tree, hf_scsi_disc_info_last_session_lead_in_start_address, tvb, offset+16, 4, 0);
5052
 
        proto_tree_add_item (tree, hf_scsi_disc_info_last_possible_lead_out_start_address, tvb, offset+20, 4, 0);
5053
 
        proto_tree_add_item (tree, hf_scsi_disc_info_disc_bar_code, tvb, offset+24, 8, 0);
5054
 
        /* XXX should add OPC table decoding here ... */
5055
 
    }
5056
 
}
5057
 
 
5058
 
static void
5059
 
dissect_mmc4_readdiscstructure (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5060
 
                     guint offset, gboolean isreq, gboolean iscdb,
5061
 
                     guint payload_len _U_, scsi_task_data_t *cdata _U_)
5062
 
 
5063
 
{
5064
 
    guint8 flags;
5065
 
 
5066
 
    if (tree && isreq && iscdb) {
5067
 
        proto_tree_add_text (tree, tvb, offset+1, 4,
5068
 
                             "Address: %u",
5069
 
                             tvb_get_ntohl (tvb, offset+1));
5070
 
 
5071
 
        proto_tree_add_text (tree, tvb, offset+5, 1,
5072
 
                             "Layer Number: %u",
5073
 
                             tvb_get_guint8 (tvb, offset+5));
5074
 
 
5075
 
        proto_tree_add_text (tree, tvb, offset+6, 1,
5076
 
                             "Format Code: %u",
5077
 
                             tvb_get_guint8 (tvb, offset+6));
5078
 
 
5079
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+7, 2, 0);
5080
 
 
5081
 
        flags = tvb_get_guint8 (tvb, offset+9);
5082
 
        proto_tree_add_text (tree, tvb, offset+9, 1,
5083
 
                             "AGID: %u",
5084
 
                             flags & 0xc0);
5085
 
 
5086
 
        flags = tvb_get_guint8 (tvb, offset+10);
5087
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
5088
 
                                    flags,
5089
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5090
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5091
 
    }
5092
 
}
5093
 
 
5094
 
static void
5095
 
dissect_sbc2_readcapacity10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5096
 
                           guint offset, gboolean isreq, gboolean iscdb,
5097
 
                           guint payload_len _U_, scsi_task_data_t *cdata _U_)
5098
 
{
5099
 
    guint8 flags;
5100
 
    guint32 len, block_len, tot_len;
5101
 
    const char *un;
5102
 
 
5103
 
    if (!tree)
5104
 
        return;
5105
 
 
5106
 
    if (isreq && iscdb) {
5107
 
        flags = tvb_get_guint8 (tvb, offset);
5108
 
 
5109
 
        proto_tree_add_uint_format (tree, hf_scsi_readcapacity_flags, tvb,
5110
 
                                    offset, 1, flags,
5111
 
                                    "LongLBA = %u, RelAddr = %u",
5112
 
                                    flags & 0x2, flags & 0x1);
5113
 
        proto_tree_add_item (tree, hf_scsi_readcapacity_lba, tvb, offset+1,
5114
 
                             4, 0);
5115
 
        proto_tree_add_item (tree, hf_scsi_readcapacity_pmi, tvb, offset+7,
5116
 
                             1, 0);
5117
 
 
5118
 
        flags = tvb_get_guint8 (tvb, offset+8);
5119
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
5120
 
                                    flags,
5121
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5122
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5123
 
    }
5124
 
    else if (!iscdb) {
5125
 
        len = tvb_get_ntohl (tvb, offset);
5126
 
        block_len = tvb_get_ntohl (tvb, offset+4);
5127
 
        tot_len=((len/1024)*block_len)/1024; /*MB*/
5128
 
        un="MB";
5129
 
        if(tot_len>20000){
5130
 
            tot_len/=1024;
5131
 
            un="GB";
5132
 
        }
5133
 
        proto_tree_add_text (tree, tvb, offset, 4, "LBA: %u (%u %s)",
5134
 
                             len, tot_len, un);
5135
 
        proto_tree_add_text (tree, tvb, offset+4, 4, "Block Length: %u bytes",
5136
 
                             block_len);
5137
 
    }
5138
 
}
5139
 
 
5140
 
#define SHORT_FORM_BLOCK_ID        0x00
5141
 
#define SHORT_FORM_VENDOR_SPECIFIC 0x01
5142
 
#define LONG_FORM                  0x06
5143
 
#define EXTENDED_FORM              0x08
5144
 
#define SERVICE_READ_CAPACITY16 0x10
5145
 
#define SERVICE_READ_LONG16     0x11
5146
 
 
5147
 
static const value_string service_action_vals[] = {
5148
 
        {SHORT_FORM_BLOCK_ID,        "Short Form - Block ID"},
5149
 
        {SHORT_FORM_VENDOR_SPECIFIC, "Short Form - Vendor-Specific"},
5150
 
        {LONG_FORM,                  "Long Form"},
5151
 
        {EXTENDED_FORM,              "Extended Form"},
5152
 
        {SERVICE_READ_CAPACITY16,    "Read Capacity(16)"},
5153
 
        {SERVICE_READ_LONG16,        "Read Long(16)"},
5154
 
        {0, NULL}
5155
 
};
5156
 
 
5157
 
 
5158
 
/* this is either readcapacity16  or  readlong16  depending of what service
5159
 
   action is set to.   for now we only implement readcapacity16
5160
 
*/
5161
 
static void
5162
 
dissect_sbc2_serviceactionin16 (tvbuff_t *tvb, packet_info *pinfo _U_,
5163
 
                           proto_tree *tree, guint offset, gboolean isreq,
5164
 
                           gboolean iscdb,
5165
 
                           guint payload_len _U_, scsi_task_data_t *cdata _U_)
5166
 
{
5167
 
    guint8 service_action, flags;
5168
 
    guint32 block_len;
5169
 
    guint64 len, tot_len;
5170
 
    char *un;
5171
 
 
5172
 
    if (!tree)
5173
 
        return;
5174
 
 
5175
 
    if (isreq && iscdb) {
5176
 
        service_action = tvb_get_guint8 (tvb, offset) & 0x1F;
5177
 
        /* we should store this one for later so the data in can be decoded */
5178
 
        switch(service_action){
5179
 
        case SERVICE_READ_CAPACITY16:
5180
 
                proto_tree_add_text (tree, tvb, offset, 1,
5181
 
                             "Service Action: %s",
5182
 
                             val_to_str (service_action,
5183
 
                                         service_action_vals,
5184
 
                                         "Unknown (0x%02x)"));
5185
 
                offset++;
5186
 
 
5187
 
                proto_tree_add_text (tree, tvb, offset, 8,
5188
 
                             "Logical Block Address: %" PRIu64,
5189
 
                              tvb_get_ntoh64 (tvb, offset));
5190
 
                offset += 8;
5191
 
 
5192
 
                proto_tree_add_item (tree, hf_scsi_alloclen32, tvb, offset, 4, 0);
5193
 
                offset += 4;
5194
 
 
5195
 
                proto_tree_add_item (tree, hf_scsi_readcapacity_pmi, tvb, offset, 1, 0);
5196
 
                offset++;
5197
 
 
5198
 
                flags = tvb_get_guint8 (tvb, offset);
5199
 
                proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset, 1,
5200
 
                                    flags,
5201
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5202
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5203
 
                offset++;
5204
 
 
5205
 
                break;
5206
 
        };
5207
 
    } else if (!iscdb) {
5208
 
        /* assuming for now that all such data in PDUs are read capacity16 */
5209
 
        len = tvb_get_ntoh64 (tvb, offset);
5210
 
        block_len = tvb_get_ntohl (tvb, offset+8);
5211
 
        tot_len=((len/1024)*block_len)/1024; /*MB*/
5212
 
        un="MB";
5213
 
        if(tot_len>20000){
5214
 
            tot_len/=1024;
5215
 
            un="GB";
5216
 
        }
5217
 
        proto_tree_add_text (tree, tvb, offset, 8, "LBA: %" PRIu64 " (%" PRIu64 " %s)",
5218
 
                             len, tot_len, un);
5219
 
        proto_tree_add_text (tree, tvb, offset+8, 4, "Block Length: %u bytes",
5220
 
                             block_len);
5221
 
    }
5222
 
}
5223
 
 
5224
 
static void
5225
 
dissect_sbc2_readdefectdata10 (tvbuff_t *tvb, packet_info *pinfo _U_,
5226
 
                            proto_tree *tree, guint offset, gboolean isreq,
5227
 
                            gboolean iscdb,
5228
 
                            guint payload_len _U_, scsi_task_data_t *cdata _U_)
5229
 
{
5230
 
    guint8 flags;
5231
 
 
5232
 
    if (!tree)
5233
 
        return;
5234
 
 
5235
 
    if (isreq && iscdb) {
5236
 
        flags = tvb_get_guint8 (tvb, offset);
5237
 
 
5238
 
        proto_tree_add_uint_format (tree, hf_scsi_readdefdata_flags, tvb,
5239
 
                                    offset, 1, flags, "PLIST = %u, GLIST = %u",
5240
 
                                    flags & 0x10, flags & 0x8);
5241
 
        proto_tree_add_item (tree, hf_scsi_cdb_defectfmt, tvb, offset, 1, 0);
5242
 
        proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
5243
 
        flags = tvb_get_guint8 (tvb, offset+8);
5244
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
5245
 
                                    flags,
5246
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5247
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5248
 
    }
5249
 
}
5250
 
 
5251
 
static void
5252
 
dissect_sbc2_readdefectdata12 (tvbuff_t *tvb, packet_info *pinfo _U_,
5253
 
                            proto_tree *tree, guint offset, gboolean isreq,
5254
 
                            gboolean iscdb,
5255
 
                            guint payload_len _U_, scsi_task_data_t *cdata _U_)
5256
 
{
5257
 
    guint8 flags;
5258
 
 
5259
 
    if (!tree)
5260
 
        return;
5261
 
 
5262
 
    if (isreq && iscdb) {
5263
 
        flags = tvb_get_guint8 (tvb, offset);
5264
 
 
5265
 
        proto_tree_add_uint_format (tree, hf_scsi_readdefdata_flags, tvb,
5266
 
                                    offset, 1, flags, "PLIST = %u, GLIST = %u",
5267
 
                                    flags & 0x10, flags & 0x8);
5268
 
        proto_tree_add_item (tree, hf_scsi_cdb_defectfmt, tvb, offset, 1, 0);
5269
 
        proto_tree_add_item (tree, hf_scsi_alloclen32, tvb, offset+5, 4, 0);
5270
 
        flags = tvb_get_guint8 (tvb, offset+10);
5271
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
5272
 
                                    flags,
5273
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5274
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5275
 
    }
5276
 
}
5277
 
 
5278
 
static void
5279
 
dissect_sbc2_reassignblocks (tvbuff_t *tvb, packet_info *pinfo _U_,
5280
 
                           proto_tree *tree, guint offset, gboolean isreq,
5281
 
                           gboolean iscdb,
5282
 
                           guint payload_len _U_, scsi_task_data_t *cdata _U_)
5283
 
{
5284
 
    guint8 flags;
5285
 
 
5286
 
    if (!tree)
5287
 
        return;
5288
 
 
5289
 
    if (isreq && iscdb) {
5290
 
        flags = tvb_get_guint8 (tvb, offset);
5291
 
 
5292
 
        proto_tree_add_uint_format (tree, hf_scsi_reassignblks_flags, tvb,
5293
 
                                    offset, 1, flags,
5294
 
                                    "LongLBA = %u, LongList = %u",
5295
 
                                    flags & 0x2, flags & 0x1);
5296
 
        flags = tvb_get_guint8 (tvb, offset+4);
5297
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5298
 
                                    flags,
5299
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5300
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5301
 
    }
5302
 
}
5303
 
 
5304
 
static void
 
3337
 
 
3338
 
 
3339
 
 
3340
 
 
3341
 
 
3342
void
5305
3343
dissect_spc3_senddiagnostic (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5306
3344
                          guint offset, gboolean isreq, gboolean iscdb _U_,
5307
3345
                          guint payload_len _U_, scsi_task_data_t *cdata _U_)
5325
3363
                                flags & 0xC0, flags & 0x4, flags & 0x1);
5326
3364
}
5327
3365
 
5328
 
static void
 
3366
void
5329
3367
dissect_spc3_writebuffer (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5330
3368
                          guint offset, gboolean isreq, gboolean iscdb _U_,
5331
3369
                          guint payload_len _U_, scsi_task_data_t *cdata _U_)
5363
3401
    }
5364
3402
}
5365
3403
 
5366
 
static void
5367
 
dissect_ssc2_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5368
 
                    guint offset, gboolean isreq, gboolean iscdb,
5369
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5370
 
{
5371
 
    guint8 flags;
5372
 
 
5373
 
    if (isreq) {
5374
 
        if (check_col (pinfo->cinfo, COL_INFO))
5375
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
5376
 
                             tvb_get_ntoh24 (tvb, offset+1));
5377
 
    }
5378
 
 
5379
 
    if (tree && isreq && iscdb) {
5380
 
        flags = tvb_get_guint8 (tvb, offset);
5381
 
        proto_tree_add_text (tree, tvb, offset, 1,
5382
 
                             "SILI: %u, FIXED: %u",
5383
 
                             (flags & 0x02) >> 1, flags & 0x01);
5384
 
        proto_tree_add_item (tree, hf_scsi_rdwr6_xferlen, tvb, offset+1, 3, 0);
5385
 
        flags = tvb_get_guint8 (tvb, offset+4);
5386
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5387
 
                                    flags,
5388
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5389
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5390
 
    }
5391
 
}
5392
 
 
5393
 
static void
5394
 
dissect_ssc2_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5395
 
                    guint offset, gboolean isreq, gboolean iscdb,
5396
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5397
 
{
5398
 
    guint8 flags;
5399
 
 
5400
 
    if (isreq && iscdb) {
5401
 
        if (check_col (pinfo->cinfo, COL_INFO))
5402
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
5403
 
                             tvb_get_ntoh24 (tvb, offset+1));
5404
 
    }
5405
 
 
5406
 
    if (tree && isreq && iscdb) {
5407
 
        flags = tvb_get_guint8 (tvb, offset);
5408
 
        proto_tree_add_text (tree, tvb, offset, 1,
5409
 
                             "FIXED: %u", flags & 0x01);
5410
 
        proto_tree_add_item (tree, hf_scsi_rdwr6_xferlen, tvb, offset+1, 3,
5411
 
                             FALSE);
5412
 
        flags = tvb_get_guint8 (tvb, offset+4);
5413
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5414
 
                                    flags,
5415
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5416
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5417
 
    }
5418
 
}
5419
 
 
5420
 
static void
5421
 
dissect_ssc2_writefilemarks6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5422
 
                    guint offset, gboolean isreq, gboolean iscdb,
5423
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5424
 
{
5425
 
    guint8 flags;
5426
 
 
5427
 
    if (isreq) {
5428
 
        if (check_col (pinfo->cinfo, COL_INFO))
5429
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
5430
 
                             tvb_get_ntoh24 (tvb, offset+1));
5431
 
    }
5432
 
 
5433
 
    if (tree && isreq && iscdb) {
5434
 
        flags = tvb_get_guint8 (tvb, offset);
5435
 
        proto_tree_add_text (tree, tvb, offset, 1,
5436
 
                             "WSMK: %u, IMMED: %u",
5437
 
                             (flags & 0x02) >> 1, flags & 0x01);
5438
 
        proto_tree_add_item (tree, hf_scsi_rdwr6_xferlen, tvb, offset+1, 3,
5439
 
                             FALSE);
5440
 
        flags = tvb_get_guint8 (tvb, offset+4);
5441
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5442
 
                                    flags,
5443
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5444
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5445
 
    }
5446
 
}
5447
 
 
5448
 
static void
5449
 
dissect_ssc2_loadunload (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5450
 
                    guint offset, gboolean isreq, gboolean iscdb,
5451
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5452
 
{
5453
 
    guint8 flags;
5454
 
 
5455
 
    if (isreq && iscdb) {
5456
 
        if (check_col (pinfo->cinfo, COL_INFO))
5457
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)",
5458
 
                             tvb_get_guint8 (tvb, offset) & 0x01);
5459
 
 
5460
 
        if (!tree)
5461
 
            return;
5462
 
 
5463
 
        proto_tree_add_text (tree, tvb, offset, 1,
5464
 
                             "Immed: %u", tvb_get_guint8 (tvb, offset) & 0x01);
5465
 
        flags = tvb_get_guint8 (tvb, offset+3);
5466
 
        proto_tree_add_text (tree, tvb, offset+3, 1,
5467
 
                             "Hold: %u, EOT: %u, Reten: %u, Load: %u",
5468
 
                             (flags & 0x08) >> 3, (flags & 0x04) >> 2,
5469
 
                             (flags & 0x02) >> 1, (flags & 0x01));
5470
 
        flags = tvb_get_guint8 (tvb, offset+4);
5471
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5472
 
                                    flags,
5473
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5474
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5475
 
    }
5476
 
}
5477
 
 
5478
 
static void
5479
 
dissect_ssc2_readblocklimits (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5480
 
                    guint offset, gboolean isreq, gboolean iscdb,
5481
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5482
 
{
5483
 
    guint8 flags, granularity;
5484
 
 
5485
 
    if (!tree)
5486
 
        return;
5487
 
 
5488
 
    if (isreq && iscdb) {
5489
 
        flags = tvb_get_guint8 (tvb, offset+4);
5490
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5491
 
                                    flags,
5492
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5493
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5494
 
    }
5495
 
    else if (!iscdb) {
5496
 
        granularity = tvb_get_guint8 (tvb, offset);
5497
 
        proto_tree_add_text (tree, tvb, offset, 1, "Granularity: %u (%u %s)",
5498
 
                             granularity, 1 << granularity,
5499
 
                             plurality(1 << granularity, "byte", "bytes"));
5500
 
        proto_tree_add_text (tree, tvb, offset+1, 3, "Maximum Block Length Limit: %u bytes",
5501
 
                             tvb_get_ntoh24 (tvb, offset+1));
5502
 
        proto_tree_add_text (tree, tvb, offset+4, 2, "Minimum Block Length Limit: %u bytes",
5503
 
                             tvb_get_ntohs (tvb, offset+4));
5504
 
    }
5505
 
}
5506
 
 
5507
 
#define BCU  0x20
5508
 
#define BYCU 0x10
5509
 
#define MPU  0x08
5510
 
#define BPU  0x04
5511
 
 
5512
 
static void
5513
 
dissect_ssc2_readposition (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5514
 
                    guint offset, gboolean isreq, gboolean iscdb,
5515
 
                    guint payload_len _U_, scsi_task_data_t *cdata)
5516
 
{
5517
 
    gint service_action;
5518
 
    guint8 flags;
5519
 
 
5520
 
    if (!tree)
5521
 
        return;
5522
 
 
5523
 
    if (isreq && iscdb) {
5524
 
        service_action = tvb_get_guint8 (tvb, offset) & 0x1F;
5525
 
        proto_tree_add_text (tree, tvb, offset, 1,
5526
 
                             "Service Action: %s",
5527
 
                             val_to_str (service_action,
5528
 
                                         service_action_vals,
5529
 
                                         "Unknown (0x%02x)"));
5530
 
        /* Remember the service action so we can decode the reply */
5531
 
        if (cdata != NULL) {
5532
 
            cdata->itlq->flags = service_action;
5533
 
        }
5534
 
        proto_tree_add_text (tree, tvb, offset+6, 2,
5535
 
                             "Parameter Len: %u",
5536
 
                             tvb_get_ntohs (tvb, offset+6));
5537
 
        flags = tvb_get_guint8 (tvb, offset+8);
5538
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
5539
 
                                    flags,
5540
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5541
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5542
 
    }
5543
 
    else if (!isreq) {
5544
 
        if (cdata)
5545
 
            service_action = cdata->itlq->flags;
5546
 
        else
5547
 
            service_action = -1; /* unknown */
5548
 
        switch (service_action) {
5549
 
        case SHORT_FORM_BLOCK_ID:
5550
 
        case SHORT_FORM_VENDOR_SPECIFIC:
5551
 
            flags = tvb_get_guint8 (tvb, offset);
5552
 
            proto_tree_add_text (tree, tvb, offset, 1,
5553
 
                             "BOP: %u, EOP: %u, BCU: %u, BYCU: %u, BPU: %u, PERR: %u",
5554
 
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6,
5555
 
                             (flags & BCU) >> 5, (flags & BYCU) >> 4,
5556
 
                             (flags & BPU) >> 2, (flags & 0x02) >> 1);
5557
 
            offset += 1;
5558
 
 
5559
 
            proto_tree_add_text (tree, tvb, offset, 1,
5560
 
                                 "Partition Number: %u",
5561
 
                                 tvb_get_guint8 (tvb, offset));
5562
 
            offset += 1;
5563
 
 
5564
 
            offset += 2; /* reserved */
5565
 
 
5566
 
            if (!(flags & BPU)) {
5567
 
                proto_tree_add_text (tree, tvb, offset, 4,
5568
 
                                     "First Block Location: %u",
5569
 
                                     tvb_get_ntohl (tvb, offset));
5570
 
                offset += 4;
5571
 
 
5572
 
                proto_tree_add_text (tree, tvb, offset, 4,
5573
 
                                     "Last Block Location: %u",
5574
 
                                     tvb_get_ntohl (tvb, offset));
5575
 
                offset += 4;
5576
 
            } else
5577
 
                offset += 8;
5578
 
 
5579
 
            offset += 1; /* reserved */
5580
 
 
5581
 
            if (!(flags & BCU)) {
5582
 
                proto_tree_add_text (tree, tvb, offset, 3,
5583
 
                                     "Number of Blocks in Buffer: %u",
5584
 
                                     tvb_get_ntoh24 (tvb, offset));
5585
 
            }
5586
 
            offset += 3;
5587
 
 
5588
 
            if (!(flags & BYCU)) {
5589
 
                proto_tree_add_text (tree, tvb, offset, 4,
5590
 
                                     "Number of Bytes in Buffer: %u",
5591
 
                                     tvb_get_ntohl (tvb, offset));
5592
 
            }
5593
 
            offset += 4;
5594
 
            break;
5595
 
 
5596
 
        case LONG_FORM:
5597
 
            flags = tvb_get_guint8 (tvb, offset);
5598
 
            proto_tree_add_text (tree, tvb, offset, 1,
5599
 
                             "BOP: %u, EOP: %u, MPU: %u, BPU: %u",
5600
 
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6,
5601
 
                             (flags & MPU) >> 3, (flags & BPU) >> 2);
5602
 
            offset += 1;
5603
 
 
5604
 
            offset += 3; /* reserved */
5605
 
 
5606
 
            if (!(flags & BPU)) {
5607
 
                proto_tree_add_text (tree, tvb, offset, 4,
5608
 
                                     "Partition Number: %u",
5609
 
                                     tvb_get_ntohl (tvb, offset));
5610
 
                offset += 4;
5611
 
 
5612
 
                proto_tree_add_text (tree, tvb, offset, 8,
5613
 
                                     "Block Number: %" PRIu64,
5614
 
                                     tvb_get_ntoh64 (tvb, offset));
5615
 
                 offset += 8;
5616
 
            } else
5617
 
                offset += 12;
5618
 
 
5619
 
            if (!(flags & MPU)) {
5620
 
                proto_tree_add_text (tree, tvb, offset, 8,
5621
 
                                     "File Number: %" PRIu64,
5622
 
                                     tvb_get_ntoh64 (tvb, offset));
5623
 
                offset += 8;
5624
 
 
5625
 
                proto_tree_add_text (tree, tvb, offset, 8,
5626
 
                                     "Set Number: %" PRIu64,
5627
 
                                     tvb_get_ntoh64 (tvb, offset));
5628
 
                offset += 8;
5629
 
            } else
5630
 
                offset += 16;
5631
 
            break;
5632
 
 
5633
 
        case EXTENDED_FORM:
5634
 
            flags = tvb_get_guint8 (tvb, offset);
5635
 
            proto_tree_add_text (tree, tvb, offset, 1,
5636
 
                             "BOP: %u, EOP: %u, BCU: %u, BYCU: %u, MPU: %u, BPU: %u, PERR: %u",
5637
 
                             (flags & 0x80) >> 7, (flags & 0x40) >> 6,
5638
 
                             (flags & BCU) >> 5, (flags & BYCU) >> 4,
5639
 
                             (flags & MPU) >> 3, (flags & BPU) >> 2,
5640
 
                             (flags & 0x02) >> 1);
5641
 
            offset += 1;
5642
 
 
5643
 
            proto_tree_add_text (tree, tvb, offset, 1,
5644
 
                                 "Partition Number: %u",
5645
 
                                 tvb_get_guint8 (tvb, offset));
5646
 
            offset += 1;
5647
 
 
5648
 
            proto_tree_add_text (tree, tvb, offset, 2,
5649
 
                                 "Additional Length: %u",
5650
 
                                 tvb_get_ntohs (tvb, offset));
5651
 
            offset += 2;
5652
 
 
5653
 
            offset += 1; /* reserved */
5654
 
 
5655
 
            if (!(flags & BCU)) {
5656
 
                proto_tree_add_text (tree, tvb, offset, 3,
5657
 
                                     "Number of Blocks in Buffer: %u",
5658
 
                                     tvb_get_ntoh24 (tvb, offset));
5659
 
            }
5660
 
            offset += 3;
5661
 
 
5662
 
            if (!(flags & BPU)) {
5663
 
                proto_tree_add_text (tree, tvb, offset, 8,
5664
 
                                     "First Block Location: %" PRIu64,
5665
 
                                     tvb_get_ntoh64 (tvb, offset));
5666
 
                offset += 8;
5667
 
 
5668
 
                proto_tree_add_text (tree, tvb, offset, 8,
5669
 
                                     "Last Block Location: %" PRIu64,
5670
 
                                     tvb_get_ntoh64 (tvb, offset));
5671
 
                offset += 8;
5672
 
            } else
5673
 
                offset += 16;
5674
 
 
5675
 
            offset += 1; /* reserved */
5676
 
 
5677
 
            if (!(flags & BYCU)) {
5678
 
                proto_tree_add_text (tree, tvb, offset, 8,
5679
 
                                     "Number of Bytes in Buffer: %" PRIu64,
5680
 
                                     tvb_get_ntoh64 (tvb, offset));
5681
 
            }
5682
 
            offset += 8;
5683
 
            break;
5684
 
 
5685
 
        default:
5686
 
            break;
5687
 
        }
5688
 
    }
5689
 
}
5690
 
 
5691
 
 
5692
 
static void
5693
 
dissect_ssc2_rewind (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5694
 
                    guint offset, gboolean isreq, gboolean iscdb,
5695
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5696
 
{
5697
 
    guint8 flags;
5698
 
 
5699
 
    if (isreq && iscdb) {
5700
 
        if (check_col (pinfo->cinfo, COL_INFO))
5701
 
            col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)",
5702
 
                             tvb_get_guint8 (tvb, offset) & 0x01);
5703
 
 
5704
 
        if (!tree)
5705
 
            return;
5706
 
 
5707
 
        proto_tree_add_text (tree, tvb, offset, 1,
5708
 
                             "Immed: %u", tvb_get_guint8 (tvb, offset) & 0x01);
5709
 
        flags = tvb_get_guint8 (tvb, offset+4);
5710
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5711
 
                                    flags,
5712
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5713
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5714
 
    }
5715
 
}
5716
 
 
5717
 
static void
5718
 
dissect_ssc2_locate10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5719
 
                    guint offset, gboolean isreq, gboolean iscdb,
5720
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5721
 
{
5722
 
    guint8 flags;
5723
 
 
5724
 
    if (isreq && iscdb) {
5725
 
        if (!tree)
5726
 
            return;
5727
 
 
5728
 
        flags = tvb_get_guint8 (tvb, offset);
5729
 
        proto_tree_add_text (tree, tvb, offset, 1,
5730
 
                             "BT: %u, CP: %u, IMMED: %u",
5731
 
                             (flags & 0x04) >> 2,
5732
 
                             (flags & 0x02) >> 1,
5733
 
                             flags & 0x01);
5734
 
 
5735
 
        proto_tree_add_item (tree, hf_ssc3_locate10_loid, tvb, offset+2, 4, 0);
5736
 
 
5737
 
        flags = tvb_get_guint8 (tvb, offset+7);
5738
 
        proto_tree_add_text (tree, tvb, offset+7, 1,
5739
 
                             "Partition: %u",
5740
 
                            flags);
5741
 
 
5742
 
        flags = tvb_get_guint8 (tvb, offset+8);
5743
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
5744
 
                                    flags,
5745
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5746
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5747
 
    }
5748
 
}
5749
 
 
5750
 
static void
5751
 
dissect_ssc2_locate16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5752
 
                    guint offset, gboolean isreq, gboolean iscdb,
5753
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5754
 
{
5755
 
    guint8 flags;
5756
 
 
5757
 
    if (isreq && iscdb) {
5758
 
        if (!tree)
5759
 
            return;
5760
 
 
5761
 
        flags = tvb_get_guint8 (tvb, offset);
5762
 
        proto_tree_add_text (tree, tvb, offset, 1,
5763
 
                             "DEST_TYPE: %u, CP: %u, IMMED: %u",
5764
 
                             (flags & 0x18) >> 3,
5765
 
                             (flags & 0x02) >> 1,
5766
 
                             flags & 0x01);
5767
 
 
5768
 
        flags = tvb_get_guint8 (tvb, offset+2);
5769
 
        proto_tree_add_text (tree, tvb, offset+2, 1,
5770
 
                             "Partition: %u",
5771
 
                            flags);
5772
 
 
5773
 
        proto_tree_add_item (tree, hf_ssc3_locate16_loid, tvb, offset+3, 8, 0);
5774
 
 
5775
 
        flags = tvb_get_guint8 (tvb, offset+14);
5776
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
5777
 
                                    flags,
5778
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5779
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5780
 
    }
5781
 
}
5782
 
 
5783
 
static void
5784
 
dissect_ssc2_erase6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5785
 
                    guint offset, gboolean isreq, gboolean iscdb,
5786
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5787
 
{
5788
 
    guint8 flags;
5789
 
 
5790
 
    if (isreq && iscdb) {
5791
 
        if (!tree)
5792
 
            return;
5793
 
 
5794
 
        flags = tvb_get_guint8 (tvb, offset);
5795
 
        proto_tree_add_text (tree, tvb, offset, 1,
5796
 
                             "IMMED: %u, LONG: %u",
5797
 
                             (flags & 0x02) >> 1,
5798
 
                             flags & 0x01);
5799
 
 
5800
 
        flags = tvb_get_guint8 (tvb, offset+4);
5801
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5802
 
                                    flags,
5803
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5804
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5805
 
    }
5806
 
}
5807
 
 
5808
 
static void
5809
 
dissect_ssc2_erase16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5810
 
                    guint offset, gboolean isreq, gboolean iscdb,
5811
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5812
 
{
5813
 
    guint8 flags;
5814
 
 
5815
 
    if (isreq && iscdb) {
5816
 
        if (!tree)
5817
 
            return;
5818
 
 
5819
 
        flags = tvb_get_guint8 (tvb, offset);
5820
 
        proto_tree_add_text (tree, tvb, offset, 1,
5821
 
                             "FCS: %u, LCS: %u, IMMED: %u, LONG: %u",
5822
 
                             (flags & 0x08) >> 3,
5823
 
                             (flags & 0x04) >> 2,
5824
 
                             (flags & 0x02) >> 1,
5825
 
                             flags & 0x01);
5826
 
 
5827
 
        proto_tree_add_text (tree, tvb, offset+2, 1,
5828
 
                             "Partition: %u", tvb_get_guint8(tvb,offset+2));
5829
 
 
5830
 
        proto_tree_add_text (tree, tvb, offset+3, 8,
5831
 
                             "Logical Object Identifier: 0x%02x%02x%02x%02x%02x%02x%02x%02x",
5832
 
                             tvb_get_guint8(tvb,offset+3),
5833
 
                             tvb_get_guint8(tvb,offset+4),
5834
 
                             tvb_get_guint8(tvb,offset+5),
5835
 
                             tvb_get_guint8(tvb,offset+6),
5836
 
                             tvb_get_guint8(tvb,offset+7),
5837
 
                             tvb_get_guint8(tvb,offset+8),
5838
 
                             tvb_get_guint8(tvb,offset+9),
5839
 
                             tvb_get_guint8(tvb,offset+10));
5840
 
 
5841
 
        flags = tvb_get_guint8 (tvb, offset+14);
5842
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
5843
 
                                    flags,
5844
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5845
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5846
 
    }
5847
 
}
5848
 
 
5849
 
static void
5850
 
dissect_ssc2_space6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5851
 
                    guint offset, gboolean isreq, gboolean iscdb,
5852
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5853
 
{
5854
 
    guint8 flags;
5855
 
 
5856
 
    if (isreq && iscdb) {
5857
 
        if (!tree)
5858
 
            return;
5859
 
 
5860
 
        flags = tvb_get_guint8 (tvb, offset);
5861
 
        proto_tree_add_text (tree, tvb, offset, 1,
5862
 
                             "CODE: %u",
5863
 
                             flags & 0x0f);
5864
 
 
5865
 
        proto_tree_add_item (tree, hf_ssc3_space6_count, tvb, offset+1, 3, 0);
5866
 
 
5867
 
        flags = tvb_get_guint8 (tvb, offset+4);
5868
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5869
 
                                    flags,
5870
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5871
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5872
 
    }
5873
 
}
5874
 
 
5875
 
static void
5876
 
dissect_ssc2_space16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5877
 
                    guint offset, gboolean isreq, gboolean iscdb,
5878
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5879
 
{
5880
 
    guint8 flags;
5881
 
 
5882
 
    if (isreq && iscdb) {
5883
 
        if (!tree)
5884
 
            return;
5885
 
 
5886
 
        flags = tvb_get_guint8 (tvb, offset);
5887
 
        proto_tree_add_text (tree, tvb, offset, 1,
5888
 
                             "CODE: %u",
5889
 
                             flags & 0x0f);
5890
 
 
5891
 
        proto_tree_add_item (tree, hf_ssc3_space16_count, tvb, offset+3, 8, 0);
5892
 
 
5893
 
        proto_tree_add_text (tree, tvb, offset+11, 2,
5894
 
                             "Parameter Len: %u",
5895
 
                             tvb_get_ntohs (tvb, offset+11));
5896
 
 
5897
 
        flags = tvb_get_guint8 (tvb, offset+14);
5898
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
5899
 
                                    flags,
5900
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5901
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5902
 
    }
5903
 
}
5904
 
 
5905
 
static void
5906
 
dissect_ssc2_formatmedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5907
 
                    guint offset, gboolean isreq, gboolean iscdb,
5908
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5909
 
{
5910
 
    guint8 flags;
5911
 
 
5912
 
    if (isreq && iscdb) {
5913
 
        if (!tree)
5914
 
            return;
5915
 
 
5916
 
        flags = tvb_get_guint8 (tvb, offset);
5917
 
        proto_tree_add_text (tree, tvb, offset, 1,
5918
 
                             "VERIFY: %u, IMMED: %u",
5919
 
                             (flags & 0x02) >> 1,
5920
 
                             flags & 0x01);
5921
 
 
5922
 
        proto_tree_add_text (tree, tvb, offset+1, 1,
5923
 
                             "Format: 0x%02x", tvb_get_guint8(tvb,offset+1)&0x0f);
5924
 
 
5925
 
        proto_tree_add_item (tree, hf_scsi_rdwr10_xferlen, tvb, offset+2, 2, 0);
5926
 
 
5927
 
        flags = tvb_get_guint8 (tvb, offset+4);
5928
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+4, 1,
5929
 
                                    flags,
5930
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5931
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5932
 
    }
5933
 
}
5934
 
 
5935
 
static void
5936
 
dissect_smc2_movemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
5937
 
                    guint offset, gboolean isreq, gboolean iscdb,
5938
 
                    guint payload_len _U_, scsi_task_data_t *cdata _U_)
5939
 
{
5940
 
    guint8 flags;
5941
 
 
5942
 
    if (tree && isreq && iscdb) {
5943
 
        proto_tree_add_text (tree, tvb, offset+1, 2,
5944
 
                             "Medium Transport Address: %u",
5945
 
                             tvb_get_ntohs (tvb, offset+1));
5946
 
        proto_tree_add_text (tree, tvb, offset+3, 2,
5947
 
                             "Source Address: %u",
5948
 
                             tvb_get_ntohs (tvb, offset+3));
5949
 
        proto_tree_add_text (tree, tvb, offset+5, 2,
5950
 
                             "Destination Address: %u",
5951
 
                             tvb_get_ntohs (tvb, offset+5));
5952
 
        flags = tvb_get_guint8 (tvb, offset+9);
5953
 
        proto_tree_add_text (tree, tvb, offset+9, 1,
5954
 
                             "INV: %u", flags & 0x01);
5955
 
        flags = tvb_get_guint8 (tvb, offset+10);
5956
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
5957
 
                                    flags,
5958
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
5959
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
5960
 
    }
5961
 
}
5962
 
 
5963
 
#define MT_ELEM  0x1
5964
 
#define ST_ELEM  0x2
5965
 
#define I_E_ELEM 0x3
5966
 
#define DT_ELEM  0x4
5967
 
 
5968
 
static const value_string element_type_code_vals[] = {
5969
 
    {0x0,      "All element types"},
5970
 
    {MT_ELEM,  "Medium transport element"},
5971
 
    {ST_ELEM,  "Storage element"},
5972
 
    {I_E_ELEM, "Import/export element"},
5973
 
    {DT_ELEM,  "Data transfer element"},
5974
 
    {0, NULL}
5975
 
};
5976
 
 
5977
 
#define PVOLTAG 0x80
5978
 
#define AVOLTAG 0x40
5979
 
 
5980
 
#define EXCEPT 0x04
5981
 
 
5982
 
#define ID_VALID 0x20
5983
 
#define LU_VALID 0x10
5984
 
 
5985
 
#define SVALID 0x80
5986
 
 
5987
 
static void
5988
 
dissect_scsi_smc2_volume_tag (tvbuff_t *tvb, packet_info *pinfo _U_,
5989
 
                              proto_tree *tree, guint offset,
5990
 
                              const char *name)
5991
 
{
5992
 
    char volid[32+1];
5993
 
    char *p;
5994
 
 
5995
 
    tvb_memcpy (tvb, (guint8 *)volid, offset, 32);
5996
 
    p = &volid[32];
5997
 
    for (;;) {
5998
 
        *p = '\0';
5999
 
        if (p == volid)
6000
 
            break;
6001
 
        if (*(p - 1) != ' ')
6002
 
            break;
6003
 
        p--;
6004
 
    }
6005
 
    proto_tree_add_text (tree, tvb, offset, 36,
6006
 
                         "%s: Volume Identification = \"%s\", Volume Sequence Number = %u",
6007
 
                         name, volid, tvb_get_ntohs (tvb, offset+34));
6008
 
}
6009
 
 
6010
 
static void
6011
 
dissect_scsi_smc2_element (tvbuff_t *tvb, packet_info *pinfo _U_,
6012
 
                         proto_tree *tree, guint offset,
6013
 
                         guint elem_bytecnt, guint8 elem_type,
6014
 
                         guint8 voltag_flags)
6015
 
{
6016
 
    guint8 flags;
6017
 
    guint8 ident_len;
6018
 
 
6019
 
    if (elem_bytecnt < 2)
6020
 
        return;
6021
 
    proto_tree_add_text (tree, tvb, offset, 2,
6022
 
                         "Element Address: %u",
6023
 
                         tvb_get_ntohs (tvb, offset));
6024
 
    offset += 2;
6025
 
    elem_bytecnt -= 2;
6026
 
 
6027
 
    if (elem_bytecnt < 1)
6028
 
        return;
6029
 
    flags = tvb_get_guint8 (tvb, offset);
6030
 
    switch (elem_type) {
6031
 
 
6032
 
    case MT_ELEM:
6033
 
        proto_tree_add_text (tree, tvb, offset, 1,
6034
 
                            "EXCEPT: %u, FULL: %u",
6035
 
                             (flags & EXCEPT) >> 2, flags & 0x01);
6036
 
        break;
6037
 
 
6038
 
    case ST_ELEM:
6039
 
    case DT_ELEM:
6040
 
        proto_tree_add_text (tree, tvb, offset, 1,
6041
 
                             "ACCESS: %u, EXCEPT: %u, FULL: %u",
6042
 
                             (flags & 0x08) >> 3,
6043
 
                             (flags & EXCEPT) >> 2, flags & 0x01);
6044
 
        break;
6045
 
 
6046
 
    case I_E_ELEM:
6047
 
        proto_tree_add_text (tree, tvb, offset, 1,
6048
 
                             "cmc: %u, INENAB: %u, EXENAB: %u, ACCESS: %u, EXCEPT: %u, IMPEXP: %u, FULL: %u",
6049
 
                             (flags & 0x40) >> 6,
6050
 
                             (flags & 0x20) >> 5,
6051
 
                             (flags & 0x10) >> 4,
6052
 
                             (flags & 0x08) >> 3,
6053
 
                             (flags & EXCEPT) >> 2,
6054
 
                             (flags & 0x02) >> 1,
6055
 
                             flags & 0x01);
6056
 
        break;
6057
 
    }
6058
 
    offset += 1;
6059
 
    elem_bytecnt -= 1;
6060
 
 
6061
 
    if (elem_bytecnt < 1)
6062
 
        return;
6063
 
    offset += 1; /* reserved */
6064
 
    elem_bytecnt -= 1;
6065
 
 
6066
 
    if (elem_bytecnt < 2)
6067
 
        return;
6068
 
    if (flags & EXCEPT) {
6069
 
        proto_tree_add_text (tree, tvb, offset, 2,
6070
 
                             "Additional Sense Code+Qualifier: %s",
6071
 
                             val_to_str (tvb_get_ntohs (tvb, offset),
6072
 
                                         scsi_asc_val, "Unknown (0x%04x)"));
6073
 
    }
6074
 
    offset += 2;
6075
 
    elem_bytecnt -= 2;
6076
 
 
6077
 
    if (elem_bytecnt < 3)
6078
 
        return;
6079
 
    switch (elem_type) {
6080
 
 
6081
 
    case DT_ELEM:
6082
 
        flags = tvb_get_guint8 (tvb, offset);
6083
 
        if (flags & LU_VALID) {
6084
 
            proto_tree_add_text (tree, tvb, offset, 1,
6085
 
                                 "NOT BUS: %u, ID VALID: %u, LU VALID: 1, LUN: %u",
6086
 
                                 (flags & 0x80) >> 7,
6087
 
                                 (flags & ID_VALID) >> 5,
6088
 
                                 flags & 0x07);
6089
 
        } else if (flags & ID_VALID) {
6090
 
            proto_tree_add_text (tree, tvb, offset, 1,
6091
 
                                 "ID VALID: 1, LU VALID: 0");
6092
 
        } else {
6093
 
            proto_tree_add_text (tree, tvb, offset, 1,
6094
 
                                 "ID VALID: 0, LU VALID: 0");
6095
 
        }
6096
 
        offset += 1;
6097
 
        if (flags & ID_VALID) {
6098
 
            proto_tree_add_text (tree, tvb, offset, 1,
6099
 
                                 "SCSI Bus Address: %u",
6100
 
                                 tvb_get_guint8 (tvb, offset));
6101
 
        }
6102
 
        offset += 1;
6103
 
        offset += 1; /* reserved */
6104
 
        break;
6105
 
 
6106
 
    default:
6107
 
        offset += 3; /* reserved */
6108
 
        break;
6109
 
    }
6110
 
    elem_bytecnt -= 3;
6111
 
 
6112
 
    if (elem_bytecnt < 3)
6113
 
        return;
6114
 
    flags = tvb_get_guint8 (tvb, offset);
6115
 
    if (flags & SVALID) {
6116
 
        proto_tree_add_text (tree, tvb, offset, 1,
6117
 
                             "SVALID: 1, INVERT: %u",
6118
 
                             (flags & 0x40) >> 6);
6119
 
        offset += 1;
6120
 
        proto_tree_add_text (tree, tvb, offset, 2,
6121
 
                             "Source Storage Element Address: %u",
6122
 
                             tvb_get_ntohs (tvb, offset));
6123
 
        offset += 2;
6124
 
    } else {
6125
 
        proto_tree_add_text (tree, tvb, offset, 1,
6126
 
                             "SVALID: 0");
6127
 
        offset += 3;
6128
 
    }
6129
 
    elem_bytecnt -= 3;
6130
 
 
6131
 
    if (voltag_flags & PVOLTAG) {
6132
 
        if (elem_bytecnt < 36)
6133
 
            return;
6134
 
        dissect_scsi_smc2_volume_tag (tvb, pinfo, tree, offset,
6135
 
                                      "Primary Volume Tag Information");
6136
 
        offset += 36;
6137
 
        elem_bytecnt -= 36;
6138
 
    }
6139
 
 
6140
 
    if (voltag_flags & AVOLTAG) {
6141
 
        if (elem_bytecnt < 36)
6142
 
            return;
6143
 
        dissect_scsi_smc2_volume_tag (tvb, pinfo, tree, offset,
6144
 
                                      "Alternate Volume Tag Information");
6145
 
        offset += 36;
6146
 
        elem_bytecnt -= 36;
6147
 
    }
6148
 
 
6149
 
    if (elem_bytecnt < 1)
6150
 
        return;
6151
 
    flags = tvb_get_guint8 (tvb, offset);
6152
 
    proto_tree_add_text (tree, tvb, offset, 1,
6153
 
                         "Code Set: %s",
6154
 
                         val_to_str (flags & 0x0F,
6155
 
                                     scsi_devid_codeset_val,
6156
 
                                     "Unknown (0x%02x)"));
6157
 
    offset += 1;
6158
 
    elem_bytecnt -= 1;
6159
 
 
6160
 
    if (elem_bytecnt < 1)
6161
 
        return;
6162
 
    flags = tvb_get_guint8 (tvb, offset);
6163
 
    proto_tree_add_text (tree, tvb, offset, 1,
6164
 
                         "Identifier Type: %s",
6165
 
                         val_to_str ((flags & 0x0F),
6166
 
                                     scsi_devid_idtype_val,
6167
 
                                     "Unknown (0x%02x)"));
6168
 
    offset += 1;
6169
 
    elem_bytecnt -= 1;
6170
 
 
6171
 
    if (elem_bytecnt < 1)
6172
 
        return;
6173
 
    offset += 1; /* reserved */
6174
 
    elem_bytecnt -= 1;
6175
 
 
6176
 
    if (elem_bytecnt < 1)
6177
 
        return;
6178
 
    ident_len = tvb_get_guint8 (tvb, offset);
6179
 
    proto_tree_add_text (tree, tvb, offset, 1,
6180
 
                         "Identifier Length: %u",
6181
 
                         ident_len);
6182
 
    offset += 1;
6183
 
    elem_bytecnt -= 1;
6184
 
 
6185
 
    if (ident_len != 0) {
6186
 
        if (elem_bytecnt < ident_len)
6187
 
            return;
6188
 
        proto_tree_add_text (tree, tvb, offset, ident_len,
6189
 
                             "Identifier: %s",
6190
 
                             tvb_bytes_to_str (tvb, offset, ident_len));
6191
 
        offset += ident_len;
6192
 
        elem_bytecnt -= ident_len;
6193
 
    }
6194
 
    if (elem_bytecnt != 0) {
6195
 
        proto_tree_add_text (tree, tvb, offset, elem_bytecnt,
6196
 
                             "Vendor-specific Data: %s",
6197
 
                             tvb_bytes_to_str (tvb, offset, elem_bytecnt));
6198
 
    }
6199
 
}
6200
 
 
6201
 
static void
6202
 
dissect_scsi_smc2_elements (tvbuff_t *tvb, packet_info *pinfo,
6203
 
                            proto_tree *tree, guint offset,
6204
 
                            guint desc_bytecnt, guint8 elem_type,
6205
 
                            guint8 voltag_flags, guint16 elem_desc_len)
6206
 
{
6207
 
    guint elem_bytecnt;
6208
 
 
6209
 
    while (desc_bytecnt != 0) {
6210
 
        elem_bytecnt = elem_desc_len;
6211
 
        if (elem_bytecnt > desc_bytecnt)
6212
 
            elem_bytecnt = desc_bytecnt;
6213
 
        dissect_scsi_smc2_element (tvb, pinfo, tree, offset, elem_bytecnt,
6214
 
                                   elem_type, voltag_flags);
6215
 
        offset += elem_bytecnt;
6216
 
        desc_bytecnt -= elem_bytecnt;
6217
 
    }
6218
 
}
6219
 
 
6220
 
static void
6221
 
dissect_smc2_readelementstatus (tvbuff_t *tvb, packet_info *pinfo,
6222
 
                         proto_tree *tree, guint offset, gboolean isreq,
6223
 
                         gboolean iscdb,
6224
 
                         guint payload_len _U_, scsi_task_data_t *cdata _U_)
6225
 
{
6226
 
    guint8 flags;
6227
 
    guint numelem, bytecnt, desc_bytecnt;
6228
 
    guint8 elem_type;
6229
 
    guint8 voltag_flags;
6230
 
    guint16 elem_desc_len;
6231
 
 
6232
 
    if (!tree)
6233
 
        return;
6234
 
 
6235
 
    if (isreq && iscdb) {
6236
 
        flags = tvb_get_guint8 (tvb, offset);
6237
 
        proto_tree_add_text (tree, tvb, offset, 1,
6238
 
                             "VOLTAG: %u, Element Type Code: %s",
6239
 
                             (flags & 0x10) >> 4,
6240
 
                             val_to_str (flags & 0xF, element_type_code_vals,
6241
 
                                         "Unknown (0x%x)"));
6242
 
        proto_tree_add_text (tree, tvb, offset+1, 2,
6243
 
                             "Starting Element Address: %u",
6244
 
                             tvb_get_ntohs (tvb, offset+1));
6245
 
        proto_tree_add_text (tree, tvb, offset+3, 2,
6246
 
                             "Number of Elements: %u",
6247
 
                             tvb_get_ntohs (tvb, offset+3));
6248
 
        flags = tvb_get_guint8 (tvb, offset+4);
6249
 
        proto_tree_add_text (tree, tvb, offset+4, 1,
6250
 
                             "CURDATA: %u, DVCID: %u",
6251
 
                             (flags & 0x02) >> 1, flags & 0x01);
6252
 
        proto_tree_add_text (tree, tvb, offset+6, 3,
6253
 
                             "Allocation Length: %u",
6254
 
                             tvb_get_ntoh24 (tvb, offset+6));
6255
 
        flags = tvb_get_guint8 (tvb, offset+10);
6256
 
        proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
6257
 
                                    flags,
6258
 
                                    "Vendor Unique = %u, NACA = %u, Link = %u",
6259
 
                                    flags & 0xC0, flags & 0x4, flags & 0x1);
6260
 
    }
6261
 
    else if (!isreq) {
6262
 
        proto_tree_add_text (tree, tvb, offset, 2,
6263
 
                             "First Element Address Reported: %u",
6264
 
                             tvb_get_ntohs (tvb, offset));
6265
 
        offset += 2;
6266
 
        numelem = tvb_get_ntohs (tvb, offset);
6267
 
        proto_tree_add_text (tree, tvb, offset, 2,
6268
 
                             "Number of Elements Available: %u", numelem);
6269
 
        offset += 2;
6270
 
        offset += 1; /* reserved */
6271
 
        bytecnt = tvb_get_ntoh24 (tvb, offset);
6272
 
        proto_tree_add_text (tree, tvb, offset, 3,
6273
 
                             "Byte Count of Report Available: %u", bytecnt);
6274
 
        offset += 3;
6275
 
        while (bytecnt != 0) {
6276
 
            if (bytecnt < 1)
6277
 
                break;
6278
 
            elem_type = tvb_get_guint8 (tvb, offset);
6279
 
            proto_tree_add_text (tree, tvb, offset, 1,
6280
 
                                 "Element Type Code: %s",
6281
 
                                 val_to_str (elem_type, element_type_code_vals,
6282
 
                                             "Unknown (0x%x)"));
6283
 
            offset += 1;
6284
 
            bytecnt -= 1;
6285
 
 
6286
 
            if (bytecnt < 1)
6287
 
                break;
6288
 
            voltag_flags = tvb_get_guint8 (tvb, offset);
6289
 
            proto_tree_add_text (tree, tvb, offset, 1,
6290
 
                                 "PVOLTAG: %u, AVOLTAG: %u",
6291
 
                                 (voltag_flags & PVOLTAG) >> 7,
6292
 
                                 (voltag_flags & AVOLTAG) >> 6);
6293
 
            offset += 1;
6294
 
            bytecnt -= 1;
6295
 
 
6296
 
            if (bytecnt < 2)
6297
 
                break;
6298
 
            elem_desc_len = tvb_get_ntohs (tvb, offset);
6299
 
            proto_tree_add_text (tree, tvb, offset, 2,
6300
 
                                 "Element Descriptor Length: %u",
6301
 
                                 elem_desc_len);
6302
 
            offset += 2;
6303
 
            bytecnt -= 2;
6304
 
 
6305
 
            if (bytecnt < 1)
6306
 
                break;
6307
 
            offset += 1; /* reserved */
6308
 
            bytecnt -= 1;
6309
 
 
6310
 
            if (bytecnt < 3)
6311
 
                break;
6312
 
            desc_bytecnt = tvb_get_ntoh24 (tvb, offset);
6313
 
            proto_tree_add_text (tree, tvb, offset, 3,
6314
 
                                 "Byte Count Of Descriptor Data Available: %u",
6315
 
                                 desc_bytecnt);
6316
 
            offset += 3;
6317
 
            bytecnt -= 3;
6318
 
 
6319
 
            if (desc_bytecnt > bytecnt)
6320
 
                desc_bytecnt = bytecnt;
6321
 
            dissect_scsi_smc2_elements (tvb, pinfo, tree, offset,
6322
 
                                        desc_bytecnt, elem_type,
6323
 
                                        voltag_flags, elem_desc_len);
6324
 
            offset += desc_bytecnt;
6325
 
            bytecnt -= desc_bytecnt;
6326
 
        }
6327
 
    }
6328
 
}
 
3404
 
 
3405
 
 
3406
 
6329
3407
 
6330
3408
void
6331
3409
dissect_scsi_rsp (tvbuff_t *tvb, packet_info *pinfo,
6382
3460
    ti=proto_tree_add_uint(scsi_tree, hf_scsi_status, tvb, 0, 0, scsi_status);
6383
3461
    PROTO_ITEM_SET_GENERATED(ti);
6384
3462
    if (check_col (pinfo->cinfo, COL_INFO)) {
6385
 
         col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI: Response LUN: 0x%02x (%s) (%s)", itlq->lun, 
 
3463
         col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI: Response LUN: 0x%02x (%s) (%s)", itlq->lun,
6386
3464
        val_to_str(itlq->scsi_opcode, csdata->cdb_vals, "CDB:0x%02x"),
6387
3465
        val_to_str(scsi_status, scsi_status_val, "Unknown (0x%08x)"));
6388
3466
 
6690
3768
/*SPC 0xff*/{NULL}
6691
3769
};
6692
3770
 
6693
 
static scsi_cdb_table_t sbc[256] = {
6694
 
/*SPC 0x00*/{dissect_spc3_testunitready},
6695
 
/*SBC 0x01*/{NULL},
6696
 
/*SBC 0x02*/{NULL},
6697
 
/*SPC 0x03*/{dissect_spc3_requestsense},
6698
 
/*SBC 0x04*/{dissect_sbc2_formatunit},
6699
 
/*SBC 0x05*/{NULL},
6700
 
/*SBC 0x06*/{NULL},
6701
 
/*SBC 0x07*/{dissect_sbc2_reassignblocks},
6702
 
/*SBC 0x08*/{dissect_sbc2_readwrite6},
6703
 
/*SBC 0x09*/{NULL},
6704
 
/*SBC 0x0a*/{dissect_sbc2_readwrite6},
6705
 
/*SBC 0x0b*/{NULL},
6706
 
/*SBC 0x0c*/{NULL},
6707
 
/*SBC 0x0d*/{NULL},
6708
 
/*SBC 0x0e*/{NULL},
6709
 
/*SBC 0x0f*/{NULL},
6710
 
/*SBC 0x10*/{NULL},
6711
 
/*SBC 0x11*/{NULL},
6712
 
/*SPC 0x12*/{dissect_spc3_inquiry},
6713
 
/*SBC 0x13*/{NULL},
6714
 
/*SBC 0x14*/{NULL},
6715
 
/*SPC 0x15*/{dissect_spc3_modeselect6},
6716
 
/*SBC 0x16*/{NULL},
6717
 
/*SBC 0x17*/{NULL},
6718
 
/*SBC 0x18*/{NULL},
6719
 
/*SBC 0x19*/{NULL},
6720
 
/*SPC 0x1a*/{dissect_spc3_modesense6},
6721
 
/*SBC 0x1b*/{dissect_sbc2_startstopunit},
6722
 
/*SBC 0x1c*/{NULL},
6723
 
/*SPC 0x1d*/{dissect_spc3_senddiagnostic},
6724
 
/*SBC 0x1e*/{dissect_spc3_preventallowmediaremoval},
6725
 
/*SBC 0x1f*/{NULL},
6726
 
/*SBC 0x20*/{NULL},
6727
 
/*SBC 0x21*/{NULL},
6728
 
/*SBC 0x22*/{NULL},
6729
 
/*SBC 0x23*/{NULL},
6730
 
/*SBC 0x24*/{NULL},
6731
 
/*SBC 0x25*/{dissect_sbc2_readcapacity10},
6732
 
/*SBC 0x26*/{NULL},
6733
 
/*SBC 0x27*/{NULL},
6734
 
/*SBC 0x28*/{dissect_sbc2_readwrite10},
6735
 
/*SBC 0x29*/{NULL},
6736
 
/*SBC 0x2a*/{dissect_sbc2_readwrite10},
6737
 
/*SBC 0x2b*/{NULL},
6738
 
/*SBC 0x2c*/{NULL},
6739
 
/*SBC 0x2d*/{NULL},
6740
 
/*SBC 0x2e*/{dissect_sbc2_wrverify10},
6741
 
/*SBC 0x2f*/{dissect_sbc2_verify10},
6742
 
/*SBC 0x30*/{NULL},
6743
 
/*SBC 0x31*/{NULL},
6744
 
/*SBC 0x32*/{NULL},
6745
 
/*SBC 0x33*/{NULL},
6746
 
/*SBC 0x34*/{NULL},
6747
 
/*SBC 0x35*/{NULL},
6748
 
/*SBC 0x36*/{NULL},
6749
 
/*SBC 0x37*/{dissect_sbc2_readdefectdata10},
6750
 
/*SBC 0x38*/{NULL},
6751
 
/*SBC 0x39*/{NULL},
6752
 
/*SBC 0x3a*/{NULL},
6753
 
/*SPC 0x3b*/{dissect_spc3_writebuffer},
6754
 
/*SBC 0x3c*/{NULL},
6755
 
/*SBC 0x3d*/{NULL},
6756
 
/*SBC 0x3e*/{NULL},
6757
 
/*SBC 0x3f*/{NULL},
6758
 
/*SBC 0x40*/{NULL},
6759
 
/*SBC 0x41*/{NULL},
6760
 
/*SBC 0x42*/{NULL},
6761
 
/*SBC 0x43*/{NULL},
6762
 
/*SBC 0x44*/{NULL},
6763
 
/*SBC 0x45*/{NULL},
6764
 
/*SBC 0x46*/{NULL},
6765
 
/*SBC 0x47*/{NULL},
6766
 
/*SBC 0x48*/{NULL},
6767
 
/*SBC 0x49*/{NULL},
6768
 
/*SBC 0x4a*/{NULL},
6769
 
/*SBC 0x4b*/{NULL},
6770
 
/*SPC 0x4c*/{dissect_spc3_logselect},
6771
 
/*SPC 0x4d*/{dissect_spc3_logsense},
6772
 
/*SBC 0x4e*/{NULL},
6773
 
/*SBC 0x4f*/{NULL},
6774
 
/*SBC 0x50*/{NULL},
6775
 
/*SBC 0x51*/{NULL},
6776
 
/*SBC 0x52*/{NULL},
6777
 
/*SBC 0x53*/{NULL},
6778
 
/*SBC 0x54*/{NULL},
6779
 
/*SPC 0x55*/{dissect_spc3_modeselect10},
6780
 
/*SBC 0x56*/{NULL},
6781
 
/*SBC 0x57*/{NULL},
6782
 
/*SBC 0x58*/{NULL},
6783
 
/*SBC 0x59*/{NULL},
6784
 
/*SPC 0x5a*/{dissect_spc3_modesense10},
6785
 
/*SBC 0x5b*/{NULL},
6786
 
/*SBC 0x5c*/{NULL},
6787
 
/*SBC 0x5d*/{NULL},
6788
 
/*SPC 0x5e*/{dissect_spc3_persistentreservein},
6789
 
/*SPC 0x5f*/{dissect_spc3_persistentreserveout},
6790
 
/*SBC 0x60*/{NULL},
6791
 
/*SBC 0x61*/{NULL},
6792
 
/*SBC 0x62*/{NULL},
6793
 
/*SBC 0x63*/{NULL},
6794
 
/*SBC 0x64*/{NULL},
6795
 
/*SBC 0x65*/{NULL},
6796
 
/*SBC 0x66*/{NULL},
6797
 
/*SBC 0x67*/{NULL},
6798
 
/*SBC 0x68*/{NULL},
6799
 
/*SBC 0x69*/{NULL},
6800
 
/*SBC 0x6a*/{NULL},
6801
 
/*SBC 0x6b*/{NULL},
6802
 
/*SBC 0x6c*/{NULL},
6803
 
/*SBC 0x6d*/{NULL},
6804
 
/*SBC 0x6e*/{NULL},
6805
 
/*SBC 0x6f*/{NULL},
6806
 
/*SBC 0x70*/{NULL},
6807
 
/*SBC 0x71*/{NULL},
6808
 
/*SBC 0x72*/{NULL},
6809
 
/*SBC 0x73*/{NULL},
6810
 
/*SBC 0x74*/{NULL},
6811
 
/*SBC 0x75*/{NULL},
6812
 
/*SBC 0x76*/{NULL},
6813
 
/*SBC 0x77*/{NULL},
6814
 
/*SBC 0x78*/{NULL},
6815
 
/*SBC 0x79*/{NULL},
6816
 
/*SBC 0x7a*/{NULL},
6817
 
/*SBC 0x7b*/{NULL},
6818
 
/*SBC 0x7c*/{NULL},
6819
 
/*SBC 0x7d*/{NULL},
6820
 
/*SBC 0x7e*/{NULL},
6821
 
/*SBC 0x7f*/{NULL},
6822
 
/*SBC 0x80*/{NULL},
6823
 
/*SBC 0x81*/{NULL},
6824
 
/*SBC 0x82*/{NULL},
6825
 
/*SPC 0x83*/{dissect_spc3_extcopy},
6826
 
/*SBC 0x84*/{NULL},
6827
 
/*SBC 0x85*/{NULL},
6828
 
/*SBC 0x86*/{NULL},
6829
 
/*SBC 0x87*/{NULL},
6830
 
/*SBC 0x88*/{dissect_sbc2_readwrite16},
6831
 
/*SBC 0x89*/{NULL},
6832
 
/*SBC 0x8a*/{dissect_sbc2_readwrite16},
6833
 
/*SBC 0x8b*/{NULL},
6834
 
/*SBC 0x8c*/{NULL},
6835
 
/*SBC 0x8d*/{NULL},
6836
 
/*SBC 0x8e*/{dissect_sbc2_wrverify16},
6837
 
/*SBC 0x8f*/{dissect_sbc2_verify16},
6838
 
/*SBC 0x90*/{NULL},
6839
 
/*SBC 0x91*/{NULL},
6840
 
/*SBC 0x92*/{NULL},
6841
 
/*SBC 0x93*/{NULL},
6842
 
/*SBC 0x94*/{NULL},
6843
 
/*SBC 0x95*/{NULL},
6844
 
/*SBC 0x96*/{NULL},
6845
 
/*SBC 0x97*/{NULL},
6846
 
/*SBC 0x98*/{NULL},
6847
 
/*SBC 0x99*/{NULL},
6848
 
/*SBC 0x9a*/{NULL},
6849
 
/*SBC 0x9b*/{NULL},
6850
 
/*SBC 0x9c*/{NULL},
6851
 
/*SBC 0x9d*/{NULL},
6852
 
/*SBC 0x9e*/{dissect_sbc2_serviceactionin16},
6853
 
/*SBC 0x9f*/{NULL},
6854
 
/*SPC 0xa0*/{dissect_spc3_reportluns},
6855
 
/*SBC 0xa1*/{NULL},
6856
 
/*SBC 0xa2*/{NULL},
6857
 
/*SBC 0xa3*/{NULL},
6858
 
/*SBC 0xa4*/{NULL},
6859
 
/*SBC 0xa5*/{NULL},
6860
 
/*SBC 0xa6*/{NULL},
6861
 
/*SBC 0xa7*/{NULL},
6862
 
/*SBC 0xa8*/{dissect_sbc2_readwrite12},
6863
 
/*SBC 0xa9*/{NULL},
6864
 
/*SBC 0xaa*/{dissect_sbc2_readwrite12},
6865
 
/*SBC 0xab*/{NULL},
6866
 
/*SBC 0xac*/{NULL},
6867
 
/*SBC 0xad*/{NULL},
6868
 
/*SBC 0xae*/{dissect_sbc2_wrverify12},
6869
 
/*SBC 0xaf*/{dissect_sbc2_verify12},
6870
 
/*SBC 0xb0*/{NULL},
6871
 
/*SBC 0xb1*/{NULL},
6872
 
/*SBC 0xb2*/{NULL},
6873
 
/*SBC 0xb3*/{NULL},
6874
 
/*SBC 0xb4*/{NULL},
6875
 
/*SBC 0xb5*/{NULL},
6876
 
/*SBC 0xb6*/{NULL},
6877
 
/*SBC 0xb7*/{dissect_sbc2_readdefectdata12},
6878
 
/*SBC 0xb8*/{NULL},
6879
 
/*SBC 0xb9*/{NULL},
6880
 
/*SBC 0xba*/{NULL},
6881
 
/*SBC 0xbb*/{NULL},
6882
 
/*SBC 0xbc*/{NULL},
6883
 
/*SBC 0xbd*/{NULL},
6884
 
/*SBC 0xbe*/{NULL},
6885
 
/*SBC 0xbf*/{NULL},
6886
 
/*SBC 0xc0*/{NULL},
6887
 
/*SBC 0xc1*/{NULL},
6888
 
/*SBC 0xc2*/{NULL},
6889
 
/*SBC 0xc3*/{NULL},
6890
 
/*SBC 0xc4*/{NULL},
6891
 
/*SBC 0xc5*/{NULL},
6892
 
/*SBC 0xc6*/{NULL},
6893
 
/*SBC 0xc7*/{NULL},
6894
 
/*SBC 0xc8*/{NULL},
6895
 
/*SBC 0xc9*/{NULL},
6896
 
/*SBC 0xca*/{NULL},
6897
 
/*SBC 0xcb*/{NULL},
6898
 
/*SBC 0xcc*/{NULL},
6899
 
/*SBC 0xcd*/{NULL},
6900
 
/*SBC 0xce*/{NULL},
6901
 
/*SBC 0xcf*/{NULL},
6902
 
/*SBC 0xd0*/{NULL},
6903
 
/*SBC 0xd1*/{NULL},
6904
 
/*SBC 0xd2*/{NULL},
6905
 
/*SBC 0xd3*/{NULL},
6906
 
/*SBC 0xd4*/{NULL},
6907
 
/*SBC 0xd5*/{NULL},
6908
 
/*SBC 0xd6*/{NULL},
6909
 
/*SBC 0xd7*/{NULL},
6910
 
/*SBC 0xd8*/{NULL},
6911
 
/*SBC 0xd9*/{NULL},
6912
 
/*SBC 0xda*/{NULL},
6913
 
/*SBC 0xdb*/{NULL},
6914
 
/*SBC 0xdc*/{NULL},
6915
 
/*SBC 0xdd*/{NULL},
6916
 
/*SBC 0xde*/{NULL},
6917
 
/*SBC 0xdf*/{NULL},
6918
 
/*SBC 0xe0*/{NULL},
6919
 
/*SBC 0xe1*/{NULL},
6920
 
/*SBC 0xe2*/{NULL},
6921
 
/*SBC 0xe3*/{NULL},
6922
 
/*SBC 0xe4*/{NULL},
6923
 
/*SBC 0xe5*/{NULL},
6924
 
/*SBC 0xe6*/{NULL},
6925
 
/*SBC 0xe7*/{NULL},
6926
 
/*SBC 0xe8*/{NULL},
6927
 
/*SBC 0xe9*/{NULL},
6928
 
/*SBC 0xea*/{NULL},
6929
 
/*SBC 0xeb*/{NULL},
6930
 
/*SBC 0xec*/{NULL},
6931
 
/*SBC 0xed*/{NULL},
6932
 
/*SBC 0xee*/{NULL},
6933
 
/*SBC 0xef*/{NULL},
6934
 
/*SBC 0xf0*/{NULL},
6935
 
/*SBC 0xf1*/{NULL},
6936
 
/*SBC 0xf2*/{NULL},
6937
 
/*SBC 0xf3*/{NULL},
6938
 
/*SBC 0xf4*/{NULL},
6939
 
/*SBC 0xf5*/{NULL},
6940
 
/*SBC 0xf6*/{NULL},
6941
 
/*SBC 0xf7*/{NULL},
6942
 
/*SBC 0xf8*/{NULL},
6943
 
/*SBC 0xf9*/{NULL},
6944
 
/*SBC 0xfa*/{NULL},
6945
 
/*SBC 0xfb*/{NULL},
6946
 
/*SBC 0xfc*/{NULL},
6947
 
/*SBC 0xfd*/{NULL},
6948
 
/*SBC 0xfe*/{NULL},
6949
 
/*SBC 0xff*/{NULL}
6950
 
};
6951
 
 
6952
 
static scsi_cdb_table_t ssc[256] = {
6953
 
/*SPC 0x00*/{dissect_spc3_testunitready},
6954
 
/*SSC 0x01*/{dissect_ssc2_rewind},
6955
 
/*SSC 0x02*/{NULL},
6956
 
/*SPC 0x03*/{dissect_spc3_requestsense},
6957
 
/*SSC 0x04*/{dissect_ssc2_formatmedium},
6958
 
/*SSC 0x05*/{dissect_ssc2_readblocklimits},
6959
 
/*SSC 0x06*/{NULL},
6960
 
/*SSC 0x07*/{NULL},
6961
 
/*SSC 0x08*/{dissect_ssc2_read6},
6962
 
/*SSC 0x09*/{NULL},
6963
 
/*SSC 0x0a*/{dissect_ssc2_write6},
6964
 
/*SSC 0x0b*/{NULL},
6965
 
/*SSC 0x0c*/{NULL},
6966
 
/*SSC 0x0d*/{NULL},
6967
 
/*SSC 0x0e*/{NULL},
6968
 
/*SSC 0x0f*/{NULL},
6969
 
/*SSC 0x10*/{dissect_ssc2_writefilemarks6},
6970
 
/*SSC 0x11*/{dissect_ssc2_space6},
6971
 
/*SPC 0x12*/{dissect_spc3_inquiry},
6972
 
/*SSC 0x13*/{NULL},
6973
 
/*SSC 0x14*/{NULL},
6974
 
/*SPC 0x15*/{dissect_spc3_modeselect6},
6975
 
/*SSC 0x16*/{NULL},
6976
 
/*SSC 0x17*/{NULL},
6977
 
/*SSC 0x18*/{NULL},
6978
 
/*SSC 0x19*/{dissect_ssc2_erase6},
6979
 
/*SPC 0x1a*/{dissect_spc3_modesense6},
6980
 
/*SSC 0x1b*/{dissect_ssc2_loadunload},
6981
 
/*SSC 0x1c*/{NULL},
6982
 
/*SPC 0x1d*/{dissect_spc3_senddiagnostic},
6983
 
/*SSC 0x1e*/{dissect_spc3_preventallowmediaremoval},
6984
 
/*SSC 0x1f*/{NULL},
6985
 
/*SSC 0x20*/{NULL},
6986
 
/*SSC 0x21*/{NULL},
6987
 
/*SSC 0x22*/{NULL},
6988
 
/*SSC 0x23*/{NULL},
6989
 
/*SSC 0x24*/{NULL},
6990
 
/*SSC 0x25*/{NULL},
6991
 
/*SSC 0x26*/{NULL},
6992
 
/*SSC 0x27*/{NULL},
6993
 
/*SSC 0x28*/{NULL},
6994
 
/*SSC 0x29*/{NULL},
6995
 
/*SSC 0x2a*/{NULL},
6996
 
/*SSC 0x2b*/{dissect_ssc2_locate10},
6997
 
/*SSC 0x2c*/{NULL},
6998
 
/*SSC 0x2d*/{NULL},
6999
 
/*SSC 0x2e*/{NULL},
7000
 
/*SSC 0x2f*/{NULL},
7001
 
/*SSC 0x30*/{NULL},
7002
 
/*SSC 0x31*/{NULL},
7003
 
/*SSC 0x32*/{NULL},
7004
 
/*SSC 0x33*/{NULL},
7005
 
/*SSC 0x34*/{dissect_ssc2_readposition},
7006
 
/*SSC 0x35*/{NULL},
7007
 
/*SSC 0x36*/{NULL},
7008
 
/*SSC 0x37*/{NULL},
7009
 
/*SSC 0x38*/{NULL},
7010
 
/*SSC 0x39*/{NULL},
7011
 
/*SSC 0x3a*/{NULL},
7012
 
/*SPC 0x3b*/{dissect_spc3_writebuffer},
7013
 
/*SSC 0x3c*/{NULL},
7014
 
/*SSC 0x3d*/{NULL},
7015
 
/*SSC 0x3e*/{NULL},
7016
 
/*SSC 0x3f*/{NULL},
7017
 
/*SSC 0x40*/{NULL},
7018
 
/*SSC 0x41*/{NULL},
7019
 
/*SSC 0x42*/{NULL},
7020
 
/*SSC 0x43*/{NULL},
7021
 
/*SSC 0x44*/{NULL},
7022
 
/*SSC 0x45*/{NULL},
7023
 
/*SSC 0x46*/{NULL},
7024
 
/*SSC 0x47*/{NULL},
7025
 
/*SSC 0x48*/{NULL},
7026
 
/*SSC 0x49*/{NULL},
7027
 
/*SSC 0x4a*/{NULL},
7028
 
/*SSC 0x4b*/{NULL},
7029
 
/*SPC 0x4c*/{dissect_spc3_logselect},
7030
 
/*SPC 0x4d*/{dissect_spc3_logsense},
7031
 
/*SSC 0x4e*/{NULL},
7032
 
/*SSC 0x4f*/{NULL},
7033
 
/*SSC 0x50*/{NULL},
7034
 
/*SSC 0x51*/{NULL},
7035
 
/*SSC 0x52*/{NULL},
7036
 
/*SSC 0x53*/{NULL},
7037
 
/*SSC 0x54*/{NULL},
7038
 
/*SPC 0x55*/{dissect_spc3_modeselect10},
7039
 
/*SSC 0x56*/{NULL},
7040
 
/*SSC 0x57*/{NULL},
7041
 
/*SSC 0x58*/{NULL},
7042
 
/*SSC 0x59*/{NULL},
7043
 
/*SPC 0x5a*/{dissect_spc3_modesense10},
7044
 
/*SSC 0x5b*/{NULL},
7045
 
/*SSC 0x5c*/{NULL},
7046
 
/*SSC 0x5d*/{NULL},
7047
 
/*SPC 0x5e*/{dissect_spc3_persistentreservein},
7048
 
/*SPC 0x5f*/{dissect_spc3_persistentreserveout},
7049
 
/*SSC 0x60*/{NULL},
7050
 
/*SSC 0x61*/{NULL},
7051
 
/*SSC 0x62*/{NULL},
7052
 
/*SSC 0x63*/{NULL},
7053
 
/*SSC 0x64*/{NULL},
7054
 
/*SSC 0x65*/{NULL},
7055
 
/*SSC 0x66*/{NULL},
7056
 
/*SSC 0x67*/{NULL},
7057
 
/*SSC 0x68*/{NULL},
7058
 
/*SSC 0x69*/{NULL},
7059
 
/*SSC 0x6a*/{NULL},
7060
 
/*SSC 0x6b*/{NULL},
7061
 
/*SSC 0x6c*/{NULL},
7062
 
/*SSC 0x6d*/{NULL},
7063
 
/*SSC 0x6e*/{NULL},
7064
 
/*SSC 0x6f*/{NULL},
7065
 
/*SSC 0x70*/{NULL},
7066
 
/*SSC 0x71*/{NULL},
7067
 
/*SSC 0x72*/{NULL},
7068
 
/*SSC 0x73*/{NULL},
7069
 
/*SSC 0x74*/{NULL},
7070
 
/*SSC 0x75*/{NULL},
7071
 
/*SSC 0x76*/{NULL},
7072
 
/*SSC 0x77*/{NULL},
7073
 
/*SSC 0x78*/{NULL},
7074
 
/*SSC 0x79*/{NULL},
7075
 
/*SSC 0x7a*/{NULL},
7076
 
/*SSC 0x7b*/{NULL},
7077
 
/*SSC 0x7c*/{NULL},
7078
 
/*SSC 0x7d*/{NULL},
7079
 
/*SSC 0x7e*/{NULL},
7080
 
/*SSC 0x7f*/{NULL},
7081
 
/*SSC 0x80*/{NULL},
7082
 
/*SSC 0x81*/{NULL},
7083
 
/*SSC 0x82*/{NULL},
7084
 
/*SPC 0x83*/{dissect_spc3_extcopy},
7085
 
/*SSC 0x84*/{NULL},
7086
 
/*SSC 0x85*/{NULL},
7087
 
/*SSC 0x86*/{NULL},
7088
 
/*SSC 0x87*/{NULL},
7089
 
/*SSC 0x88*/{NULL},
7090
 
/*SSC 0x89*/{NULL},
7091
 
/*SSC 0x8a*/{NULL},
7092
 
/*SSC 0x8b*/{NULL},
7093
 
/*SSC 0x8c*/{NULL},
7094
 
/*SSC 0x8d*/{NULL},
7095
 
/*SSC 0x8e*/{NULL},
7096
 
/*SSC 0x8f*/{NULL},
7097
 
/*SSC 0x90*/{NULL},
7098
 
/*SSC 0x91*/{dissect_ssc2_space16},
7099
 
/*SSC 0x92*/{dissect_ssc2_locate16},
7100
 
/*SSC 0x93*/{dissect_ssc2_erase16},
7101
 
/*SSC 0x94*/{NULL},
7102
 
/*SSC 0x95*/{NULL},
7103
 
/*SSC 0x96*/{NULL},
7104
 
/*SSC 0x97*/{NULL},
7105
 
/*SSC 0x98*/{NULL},
7106
 
/*SSC 0x99*/{NULL},
7107
 
/*SSC 0x9a*/{NULL},
7108
 
/*SSC 0x9b*/{NULL},
7109
 
/*SSC 0x9c*/{NULL},
7110
 
/*SSC 0x9d*/{NULL},
7111
 
/*SSC 0x9e*/{NULL},
7112
 
/*SSC 0x9f*/{NULL},
7113
 
/*SPC 0xa0*/{dissect_spc3_reportluns},
7114
 
/*SSC 0xa1*/{NULL},
7115
 
/*SSC 0xa2*/{NULL},
7116
 
/*SSC 0xa3*/{NULL},
7117
 
/*SSC 0xa4*/{NULL},
7118
 
/*SSC 0xa5*/{dissect_smc2_movemedium},
7119
 
/*SSC 0xa6*/{NULL},
7120
 
/*SSC 0xa7*/{dissect_smc2_movemedium},
7121
 
/*SSC 0xa8*/{NULL},
7122
 
/*SSC 0xa9*/{NULL},
7123
 
/*SSC 0xaa*/{NULL},
7124
 
/*SSC 0xab*/{NULL},
7125
 
/*SSC 0xac*/{NULL},
7126
 
/*SSC 0xad*/{NULL},
7127
 
/*SSC 0xae*/{NULL},
7128
 
/*SSC 0xaf*/{NULL},
7129
 
/*SSC 0xb0*/{NULL},
7130
 
/*SSC 0xb1*/{NULL},
7131
 
/*SSC 0xb2*/{NULL},
7132
 
/*SSC 0xb3*/{NULL},
7133
 
/*SSC 0xb4*/{dissect_smc2_readelementstatus},
7134
 
/*SSC 0xb5*/{NULL},
7135
 
/*SSC 0xb6*/{NULL},
7136
 
/*SSC 0xb7*/{NULL},
7137
 
/*SSC 0xb8*/{dissect_smc2_readelementstatus},
7138
 
/*SSC 0xb9*/{NULL},
7139
 
/*SSC 0xba*/{NULL},
7140
 
/*SSC 0xbb*/{NULL},
7141
 
/*SSC 0xbc*/{NULL},
7142
 
/*SSC 0xbd*/{NULL},
7143
 
/*SSC 0xbe*/{NULL},
7144
 
/*SSC 0xbf*/{NULL},
7145
 
/*SSC 0xc0*/{NULL},
7146
 
/*SSC 0xc1*/{NULL},
7147
 
/*SSC 0xc2*/{NULL},
7148
 
/*SSC 0xc3*/{NULL},
7149
 
/*SSC 0xc4*/{NULL},
7150
 
/*SSC 0xc5*/{NULL},
7151
 
/*SSC 0xc6*/{NULL},
7152
 
/*SSC 0xc7*/{NULL},
7153
 
/*SSC 0xc8*/{NULL},
7154
 
/*SSC 0xc9*/{NULL},
7155
 
/*SSC 0xca*/{NULL},
7156
 
/*SSC 0xcb*/{NULL},
7157
 
/*SSC 0xcc*/{NULL},
7158
 
/*SSC 0xcd*/{NULL},
7159
 
/*SSC 0xce*/{NULL},
7160
 
/*SSC 0xcf*/{NULL},
7161
 
/*SSC 0xd0*/{NULL},
7162
 
/*SSC 0xd1*/{NULL},
7163
 
/*SSC 0xd2*/{NULL},
7164
 
/*SSC 0xd3*/{NULL},
7165
 
/*SSC 0xd4*/{NULL},
7166
 
/*SSC 0xd5*/{NULL},
7167
 
/*SSC 0xd6*/{NULL},
7168
 
/*SSC 0xd7*/{NULL},
7169
 
/*SSC 0xd8*/{NULL},
7170
 
/*SSC 0xd9*/{NULL},
7171
 
/*SSC 0xda*/{NULL},
7172
 
/*SSC 0xdb*/{NULL},
7173
 
/*SSC 0xdc*/{NULL},
7174
 
/*SSC 0xdd*/{NULL},
7175
 
/*SSC 0xde*/{NULL},
7176
 
/*SSC 0xdf*/{NULL},
7177
 
/*SSC 0xe0*/{NULL},
7178
 
/*SSC 0xe1*/{NULL},
7179
 
/*SSC 0xe2*/{NULL},
7180
 
/*SSC 0xe3*/{NULL},
7181
 
/*SSC 0xe4*/{NULL},
7182
 
/*SSC 0xe5*/{NULL},
7183
 
/*SSC 0xe6*/{NULL},
7184
 
/*SSC 0xe7*/{NULL},
7185
 
/*SSC 0xe8*/{NULL},
7186
 
/*SSC 0xe9*/{NULL},
7187
 
/*SSC 0xea*/{NULL},
7188
 
/*SSC 0xeb*/{NULL},
7189
 
/*SSC 0xec*/{NULL},
7190
 
/*SSC 0xed*/{NULL},
7191
 
/*SSC 0xee*/{NULL},
7192
 
/*SSC 0xef*/{NULL},
7193
 
/*SSC 0xf0*/{NULL},
7194
 
/*SSC 0xf1*/{NULL},
7195
 
/*SSC 0xf2*/{NULL},
7196
 
/*SSC 0xf3*/{NULL},
7197
 
/*SSC 0xf4*/{NULL},
7198
 
/*SSC 0xf5*/{NULL},
7199
 
/*SSC 0xf6*/{NULL},
7200
 
/*SSC 0xf7*/{NULL},
7201
 
/*SSC 0xf8*/{NULL},
7202
 
/*SSC 0xf9*/{NULL},
7203
 
/*SSC 0xfa*/{NULL},
7204
 
/*SSC 0xfb*/{NULL},
7205
 
/*SSC 0xfc*/{NULL},
7206
 
/*SSC 0xfd*/{NULL},
7207
 
/*SSC 0xfe*/{NULL},
7208
 
/*SSC 0xff*/{NULL}
7209
 
};
7210
 
 
7211
 
static scsi_cdb_table_t smc[256] = {
7212
 
/*SPC 0x00*/{dissect_spc3_testunitready},
7213
 
/*SMC 0x01*/{NULL},
7214
 
/*SMC 0x02*/{NULL},
7215
 
/*SPC 0x03*/{dissect_spc3_requestsense},
7216
 
/*SMC 0x04*/{NULL},
7217
 
/*SMC 0x05*/{NULL},
7218
 
/*SMC 0x06*/{NULL},
7219
 
/*SMC 0x07*/{NULL},
7220
 
/*SMC 0x08*/{NULL},
7221
 
/*SMC 0x09*/{NULL},
7222
 
/*SMC 0x0a*/{NULL},
7223
 
/*SMC 0x0b*/{NULL},
7224
 
/*SMC 0x0c*/{NULL},
7225
 
/*SMC 0x0d*/{NULL},
7226
 
/*SMC 0x0e*/{NULL},
7227
 
/*SMC 0x0f*/{NULL},
7228
 
/*SMC 0x10*/{NULL},
7229
 
/*SMC 0x11*/{NULL},
7230
 
/*SPC 0x12*/{dissect_spc3_inquiry},
7231
 
/*SMC 0x13*/{NULL},
7232
 
/*SMC 0x14*/{NULL},
7233
 
/*SPC 0x15*/{dissect_spc3_modeselect6},
7234
 
/*SPC 0x16*/{dissect_spc2_reserve6},
7235
 
/*SPC 0x17*/{dissect_spc2_release6},
7236
 
/*SMC 0x18*/{NULL},
7237
 
/*SMC 0x19*/{NULL},
7238
 
/*SPC 0x1a*/{dissect_spc3_modesense6},
7239
 
/*SMC 0x1b*/{NULL},
7240
 
/*SMC 0x1c*/{NULL},
7241
 
/*SPC 0x1d*/{dissect_spc3_senddiagnostic},
7242
 
/*SMC 0x1e*/{dissect_spc3_preventallowmediaremoval},
7243
 
/*SMC 0x1f*/{NULL},
7244
 
/*SMC 0x20*/{NULL},
7245
 
/*SMC 0x21*/{NULL},
7246
 
/*SMC 0x22*/{NULL},
7247
 
/*SMC 0x23*/{NULL},
7248
 
/*SMC 0x24*/{NULL},
7249
 
/*SMC 0x25*/{NULL},
7250
 
/*SMC 0x26*/{NULL},
7251
 
/*SMC 0x27*/{NULL},
7252
 
/*SMC 0x28*/{NULL},
7253
 
/*SMC 0x29*/{NULL},
7254
 
/*SMC 0x2a*/{NULL},
7255
 
/*SMC 0x2b*/{NULL},
7256
 
/*SMC 0x2c*/{NULL},
7257
 
/*SMC 0x2d*/{NULL},
7258
 
/*SMC 0x2e*/{NULL},
7259
 
/*SMC 0x2f*/{NULL},
7260
 
/*SMC 0x30*/{NULL},
7261
 
/*SMC 0x31*/{NULL},
7262
 
/*SMC 0x32*/{NULL},
7263
 
/*SMC 0x33*/{NULL},
7264
 
/*SMC 0x34*/{NULL},
7265
 
/*SMC 0x35*/{NULL},
7266
 
/*SMC 0x36*/{NULL},
7267
 
/*SMC 0x37*/{NULL},
7268
 
/*SMC 0x38*/{NULL},
7269
 
/*SMC 0x39*/{NULL},
7270
 
/*SMC 0x3a*/{NULL},
7271
 
/*SPC 0x3b*/{dissect_spc3_writebuffer},
7272
 
/*SMC 0x3c*/{NULL},
7273
 
/*SMC 0x3d*/{NULL},
7274
 
/*SMC 0x3e*/{NULL},
7275
 
/*SMC 0x3f*/{NULL},
7276
 
/*SMC 0x40*/{NULL},
7277
 
/*SMC 0x41*/{NULL},
7278
 
/*SMC 0x42*/{NULL},
7279
 
/*SMC 0x43*/{NULL},
7280
 
/*SMC 0x44*/{NULL},
7281
 
/*SMC 0x45*/{NULL},
7282
 
/*SMC 0x46*/{NULL},
7283
 
/*SMC 0x47*/{NULL},
7284
 
/*SMC 0x48*/{NULL},
7285
 
/*SMC 0x49*/{NULL},
7286
 
/*SMC 0x4a*/{NULL},
7287
 
/*SMC 0x4b*/{NULL},
7288
 
/*SPC 0x4c*/{dissect_spc3_logselect},
7289
 
/*SPC 0x4d*/{dissect_spc3_logsense},
7290
 
/*SMC 0x4e*/{NULL},
7291
 
/*SMC 0x4f*/{NULL},
7292
 
/*SMC 0x50*/{NULL},
7293
 
/*SMC 0x51*/{NULL},
7294
 
/*SMC 0x52*/{NULL},
7295
 
/*SMC 0x53*/{NULL},
7296
 
/*SMC 0x54*/{NULL},
7297
 
/*SPC 0x55*/{dissect_spc3_modeselect10},
7298
 
/*SPC 0x56*/{dissect_spc2_reserve10},
7299
 
/*SPC 0x57*/{dissect_spc2_release10},
7300
 
/*SMC 0x58*/{NULL},
7301
 
/*SMC 0x59*/{NULL},
7302
 
/*SPC 0x5a*/{dissect_spc3_modesense10},
7303
 
/*SMC 0x5b*/{NULL},
7304
 
/*SMC 0x5c*/{NULL},
7305
 
/*SMC 0x5d*/{NULL},
7306
 
/*SPC 0x5e*/{dissect_spc3_persistentreservein},
7307
 
/*SPC 0x5f*/{dissect_spc3_persistentreserveout},
7308
 
/*SMC 0x60*/{NULL},
7309
 
/*SMC 0x61*/{NULL},
7310
 
/*SMC 0x62*/{NULL},
7311
 
/*SMC 0x63*/{NULL},
7312
 
/*SMC 0x64*/{NULL},
7313
 
/*SMC 0x65*/{NULL},
7314
 
/*SMC 0x66*/{NULL},
7315
 
/*SMC 0x67*/{NULL},
7316
 
/*SMC 0x68*/{NULL},
7317
 
/*SMC 0x69*/{NULL},
7318
 
/*SMC 0x6a*/{NULL},
7319
 
/*SMC 0x6b*/{NULL},
7320
 
/*SMC 0x6c*/{NULL},
7321
 
/*SMC 0x6d*/{NULL},
7322
 
/*SMC 0x6e*/{NULL},
7323
 
/*SMC 0x6f*/{NULL},
7324
 
/*SMC 0x70*/{NULL},
7325
 
/*SMC 0x71*/{NULL},
7326
 
/*SMC 0x72*/{NULL},
7327
 
/*SMC 0x73*/{NULL},
7328
 
/*SMC 0x74*/{NULL},
7329
 
/*SMC 0x75*/{NULL},
7330
 
/*SMC 0x76*/{NULL},
7331
 
/*SMC 0x77*/{NULL},
7332
 
/*SMC 0x78*/{NULL},
7333
 
/*SMC 0x79*/{NULL},
7334
 
/*SMC 0x7a*/{NULL},
7335
 
/*SMC 0x7b*/{NULL},
7336
 
/*SMC 0x7c*/{NULL},
7337
 
/*SMC 0x7d*/{NULL},
7338
 
/*SMC 0x7e*/{NULL},
7339
 
/*SMC 0x7f*/{NULL},
7340
 
/*SMC 0x80*/{NULL},
7341
 
/*SMC 0x81*/{NULL},
7342
 
/*SMC 0x82*/{NULL},
7343
 
/*SMC 0x83*/{NULL},
7344
 
/*SMC 0x84*/{NULL},
7345
 
/*SMC 0x85*/{NULL},
7346
 
/*SMC 0x86*/{NULL},
7347
 
/*SMC 0x87*/{NULL},
7348
 
/*SMC 0x88*/{NULL},
7349
 
/*SMC 0x89*/{NULL},
7350
 
/*SMC 0x8a*/{NULL},
7351
 
/*SMC 0x8b*/{NULL},
7352
 
/*SMC 0x8c*/{NULL},
7353
 
/*SMC 0x8d*/{NULL},
7354
 
/*SMC 0x8e*/{NULL},
7355
 
/*SMC 0x8f*/{NULL},
7356
 
/*SMC 0x90*/{NULL},
7357
 
/*SMC 0x91*/{NULL},
7358
 
/*SMC 0x92*/{NULL},
7359
 
/*SMC 0x93*/{NULL},
7360
 
/*SMC 0x94*/{NULL},
7361
 
/*SMC 0x95*/{NULL},
7362
 
/*SMC 0x96*/{NULL},
7363
 
/*SMC 0x97*/{NULL},
7364
 
/*SMC 0x98*/{NULL},
7365
 
/*SMC 0x99*/{NULL},
7366
 
/*SMC 0x9a*/{NULL},
7367
 
/*SMC 0x9b*/{NULL},
7368
 
/*SMC 0x9c*/{NULL},
7369
 
/*SMC 0x9d*/{NULL},
7370
 
/*SMC 0x9e*/{NULL},
7371
 
/*SMC 0x9f*/{NULL},
7372
 
/*SPC 0xa0*/{dissect_spc3_reportluns},
7373
 
/*SMC 0xa1*/{NULL},
7374
 
/*SMC 0xa2*/{NULL},
7375
 
/*SMC 0xa3*/{NULL},
7376
 
/*SMC 0xa4*/{NULL},
7377
 
/*SMC 0xa5*/{dissect_smc2_movemedium},
7378
 
/*SMC 0xa6*/{NULL},
7379
 
/*SMC 0xa7*/{dissect_smc2_movemedium},
7380
 
/*SMC 0xa8*/{NULL},
7381
 
/*SMC 0xa9*/{NULL},
7382
 
/*SMC 0xaa*/{NULL},
7383
 
/*SMC 0xab*/{NULL},
7384
 
/*SMC 0xac*/{NULL},
7385
 
/*SMC 0xad*/{NULL},
7386
 
/*SMC 0xae*/{NULL},
7387
 
/*SMC 0xaf*/{NULL},
7388
 
/*SMC 0xb0*/{NULL},
7389
 
/*SMC 0xb1*/{NULL},
7390
 
/*SMC 0xb2*/{NULL},
7391
 
/*SMC 0xb3*/{NULL},
7392
 
/*SMC 0xb4*/{dissect_smc2_readelementstatus},
7393
 
/*SMC 0xb5*/{NULL},
7394
 
/*SMC 0xb6*/{NULL},
7395
 
/*SMC 0xb7*/{NULL},
7396
 
/*SMC 0xb8*/{dissect_smc2_readelementstatus},
7397
 
/*SMC 0xb9*/{NULL},
7398
 
/*SMC 0xba*/{NULL},
7399
 
/*SMC 0xbb*/{NULL},
7400
 
/*SMC 0xbc*/{NULL},
7401
 
/*SMC 0xbd*/{NULL},
7402
 
/*SMC 0xbe*/{NULL},
7403
 
/*SMC 0xbf*/{NULL},
7404
 
/*SMC 0xc0*/{NULL},
7405
 
/*SMC 0xc1*/{NULL},
7406
 
/*SMC 0xc2*/{NULL},
7407
 
/*SMC 0xc3*/{NULL},
7408
 
/*SMC 0xc4*/{NULL},
7409
 
/*SMC 0xc5*/{NULL},
7410
 
/*SMC 0xc6*/{NULL},
7411
 
/*SMC 0xc7*/{NULL},
7412
 
/*SMC 0xc8*/{NULL},
7413
 
/*SMC 0xc9*/{NULL},
7414
 
/*SMC 0xca*/{NULL},
7415
 
/*SMC 0xcb*/{NULL},
7416
 
/*SMC 0xcc*/{NULL},
7417
 
/*SMC 0xcd*/{NULL},
7418
 
/*SMC 0xce*/{NULL},
7419
 
/*SMC 0xcf*/{NULL},
7420
 
/*SMC 0xd0*/{NULL},
7421
 
/*SMC 0xd1*/{NULL},
7422
 
/*SMC 0xd2*/{NULL},
7423
 
/*SMC 0xd3*/{NULL},
7424
 
/*SMC 0xd4*/{NULL},
7425
 
/*SMC 0xd5*/{NULL},
7426
 
/*SMC 0xd6*/{NULL},
7427
 
/*SMC 0xd7*/{NULL},
7428
 
/*SMC 0xd8*/{NULL},
7429
 
/*SMC 0xd9*/{NULL},
7430
 
/*SMC 0xda*/{NULL},
7431
 
/*SMC 0xdb*/{NULL},
7432
 
/*SMC 0xdc*/{NULL},
7433
 
/*SMC 0xdd*/{NULL},
7434
 
/*SMC 0xde*/{NULL},
7435
 
/*SMC 0xdf*/{NULL},
7436
 
/*SMC 0xe0*/{NULL},
7437
 
/*SMC 0xe1*/{NULL},
7438
 
/*SMC 0xe2*/{NULL},
7439
 
/*SMC 0xe3*/{NULL},
7440
 
/*SMC 0xe4*/{NULL},
7441
 
/*SMC 0xe5*/{NULL},
7442
 
/*SMC 0xe6*/{NULL},
7443
 
/*SMC 0xe7*/{NULL},
7444
 
/*SMC 0xe8*/{NULL},
7445
 
/*SMC 0xe9*/{NULL},
7446
 
/*SMC 0xea*/{NULL},
7447
 
/*SMC 0xeb*/{NULL},
7448
 
/*SMC 0xec*/{NULL},
7449
 
/*SMC 0xed*/{NULL},
7450
 
/*SMC 0xee*/{NULL},
7451
 
/*SMC 0xef*/{NULL},
7452
 
/*SMC 0xf0*/{NULL},
7453
 
/*SMC 0xf1*/{NULL},
7454
 
/*SMC 0xf2*/{NULL},
7455
 
/*SMC 0xf3*/{NULL},
7456
 
/*SMC 0xf4*/{NULL},
7457
 
/*SMC 0xf5*/{NULL},
7458
 
/*SMC 0xf6*/{NULL},
7459
 
/*SMC 0xf7*/{NULL},
7460
 
/*SMC 0xf8*/{NULL},
7461
 
/*SMC 0xf9*/{NULL},
7462
 
/*SMC 0xfa*/{NULL},
7463
 
/*SMC 0xfb*/{NULL},
7464
 
/*SMC 0xfc*/{NULL},
7465
 
/*SMC 0xfd*/{NULL},
7466
 
/*SMC 0xfe*/{NULL},
7467
 
/*SMC 0xff*/{NULL}
7468
 
};
7469
 
 
7470
 
static scsi_cdb_table_t mmc[256] = {
7471
 
/*SPC 0x00*/{dissect_spc3_testunitready},
7472
 
/*MMC 0x01*/{NULL},
7473
 
/*MMC 0x02*/{NULL},
7474
 
/*SPC 0x03*/{dissect_spc3_requestsense},
7475
 
/*MMC 0x04*/{NULL},
7476
 
/*MMC 0x05*/{NULL},
7477
 
/*MMC 0x06*/{NULL},
7478
 
/*MMC 0x07*/{NULL},
7479
 
/*MMC 0x08*/{NULL},
7480
 
/*MMC 0x09*/{NULL},
7481
 
/*MMC 0x0a*/{NULL},
7482
 
/*MMC 0x0b*/{NULL},
7483
 
/*MMC 0x0c*/{NULL},
7484
 
/*MMC 0x0d*/{NULL},
7485
 
/*MMC 0x0e*/{NULL},
7486
 
/*MMC 0x0f*/{NULL},
7487
 
/*MMC 0x10*/{NULL},
7488
 
/*MMC 0x11*/{NULL},
7489
 
/*SPC 0x12*/{dissect_spc3_inquiry},
7490
 
/*MMC 0x13*/{NULL},
7491
 
/*MMC 0x14*/{NULL},
7492
 
/*MMC 0x15*/{NULL},
7493
 
/*MMC 0x16*/{NULL},
7494
 
/*MMC 0x17*/{NULL},
7495
 
/*MMC 0x18*/{NULL},
7496
 
/*MMC 0x19*/{NULL},
7497
 
/*MMC 0x1a*/{NULL},
7498
 
/*MMC 0x1b*/{dissect_sbc2_startstopunit},
7499
 
/*MMC 0x1c*/{NULL},
7500
 
/*MMC 0x1d*/{NULL},
7501
 
/*MMC 0x1e*/{dissect_spc3_preventallowmediaremoval},
7502
 
/*MMC 0x1f*/{NULL},
7503
 
/*MMC 0x20*/{NULL},
7504
 
/*MMC 0x21*/{NULL},
7505
 
/*MMC 0x22*/{NULL},
7506
 
/*MMC 0x23*/{NULL},
7507
 
/*MMC 0x24*/{NULL},
7508
 
/*MMC 0x25*/{dissect_sbc2_readcapacity10},
7509
 
/*MMC 0x26*/{NULL},
7510
 
/*MMC 0x27*/{NULL},
7511
 
/*MMC 0x28*/{dissect_sbc2_readwrite10},
7512
 
/*MMC 0x29*/{NULL},
7513
 
/*MMC 0x2a*/{dissect_sbc2_readwrite10},
7514
 
/*MMC 0x2b*/{NULL},
7515
 
/*MMC 0x2c*/{NULL},
7516
 
/*MMC 0x2d*/{NULL},
7517
 
/*MMC 0x2e*/{NULL},
7518
 
/*MMC 0x2f*/{NULL},
7519
 
/*MMC 0x30*/{NULL},
7520
 
/*MMC 0x31*/{NULL},
7521
 
/*MMC 0x32*/{NULL},
7522
 
/*MMC 0x33*/{NULL},
7523
 
/*MMC 0x34*/{NULL},
7524
 
/*MMC 0x35*/{dissect_mmc4_synchronizecache},
7525
 
/*MMC 0x36*/{NULL},
7526
 
/*MMC 0x37*/{NULL},
7527
 
/*MMC 0x38*/{NULL},
7528
 
/*MMC 0x39*/{NULL},
7529
 
/*MMC 0x3a*/{NULL},
7530
 
/*SPC 0x3b*/{dissect_spc3_writebuffer},
7531
 
/*MMC 0x3c*/{NULL},
7532
 
/*MMC 0x3d*/{NULL},
7533
 
/*MMC 0x3e*/{NULL},
7534
 
/*MMC 0x3f*/{NULL},
7535
 
/*MMC 0x40*/{NULL},
7536
 
/*MMC 0x41*/{NULL},
7537
 
/*MMC 0x42*/{NULL},
7538
 
/*MMC 0x43*/{dissect_mmc4_readtocpmaatip},
7539
 
/*MMC 0x44*/{NULL},
7540
 
/*MMC 0x45*/{NULL},
7541
 
/*MMC 0x46*/{dissect_mmc4_getconfiguration},
7542
 
/*MMC 0x47*/{NULL},
7543
 
/*MMC 0x48*/{NULL},
7544
 
/*MMC 0x49*/{NULL},
7545
 
/*MMC 0x4a*/{dissect_mmc4_geteventstatusnotification},
7546
 
/*MMC 0x4b*/{NULL},
7547
 
/*MMC 0x4c*/{NULL},
7548
 
/*MMC 0x4d*/{NULL},
7549
 
/*MMC 0x4e*/{NULL},
7550
 
/*MMC 0x4f*/{NULL},
7551
 
/*MMC 0x50*/{NULL},
7552
 
/*MMC 0x51*/{dissect_mmc4_readdiscinformation},
7553
 
/*MMC 0x52*/{dissect_mmc4_readtrackinformation},
7554
 
/*MMC 0x53*/{dissect_mmc4_reservetrack},
7555
 
/*MMC 0x54*/{NULL},
7556
 
/*SPC 0x55*/{dissect_spc3_modeselect10},
7557
 
/*MMC 0x56*/{NULL},
7558
 
/*MMC 0x57*/{NULL},
7559
 
/*MMC 0x58*/{NULL},
7560
 
/*MMC 0x59*/{NULL},
7561
 
/*SPC 0x5a*/{dissect_spc3_modesense10},
7562
 
/*MMC 0x5b*/{NULL},
7563
 
/*MMC 0x5c*/{dissect_mmc4_readbuffercapacity},
7564
 
/*MMC 0x5d*/{NULL},
7565
 
/*MMC 0x5e*/{NULL},
7566
 
/*MMC 0x5f*/{NULL},
7567
 
/*MMC 0x60*/{NULL},
7568
 
/*MMC 0x61*/{NULL},
7569
 
/*MMC 0x62*/{NULL},
7570
 
/*MMC 0x63*/{NULL},
7571
 
/*MMC 0x64*/{NULL},
7572
 
/*MMC 0x65*/{NULL},
7573
 
/*MMC 0x66*/{NULL},
7574
 
/*MMC 0x67*/{NULL},
7575
 
/*MMC 0x68*/{NULL},
7576
 
/*MMC 0x69*/{NULL},
7577
 
/*MMC 0x6a*/{NULL},
7578
 
/*MMC 0x6b*/{NULL},
7579
 
/*MMC 0x6c*/{NULL},
7580
 
/*MMC 0x6d*/{NULL},
7581
 
/*MMC 0x6e*/{NULL},
7582
 
/*MMC 0x6f*/{NULL},
7583
 
/*MMC 0x70*/{NULL},
7584
 
/*MMC 0x71*/{NULL},
7585
 
/*MMC 0x72*/{NULL},
7586
 
/*MMC 0x73*/{NULL},
7587
 
/*MMC 0x74*/{NULL},
7588
 
/*MMC 0x75*/{NULL},
7589
 
/*MMC 0x76*/{NULL},
7590
 
/*MMC 0x77*/{NULL},
7591
 
/*MMC 0x78*/{NULL},
7592
 
/*MMC 0x79*/{NULL},
7593
 
/*MMC 0x7a*/{NULL},
7594
 
/*MMC 0x7b*/{NULL},
7595
 
/*MMC 0x7c*/{NULL},
7596
 
/*MMC 0x7d*/{NULL},
7597
 
/*MMC 0x7e*/{NULL},
7598
 
/*MMC 0x7f*/{NULL},
7599
 
/*MMC 0x80*/{NULL},
7600
 
/*MMC 0x81*/{NULL},
7601
 
/*MMC 0x82*/{NULL},
7602
 
/*MMC 0x83*/{NULL},
7603
 
/*MMC 0x84*/{NULL},
7604
 
/*MMC 0x85*/{NULL},
7605
 
/*MMC 0x86*/{NULL},
7606
 
/*MMC 0x87*/{NULL},
7607
 
/*MMC 0x88*/{NULL},
7608
 
/*MMC 0x89*/{NULL},
7609
 
/*MMC 0x8a*/{NULL},
7610
 
/*MMC 0x8b*/{NULL},
7611
 
/*MMC 0x8c*/{NULL},
7612
 
/*MMC 0x8d*/{NULL},
7613
 
/*MMC 0x8e*/{NULL},
7614
 
/*MMC 0x8f*/{NULL},
7615
 
/*MMC 0x90*/{NULL},
7616
 
/*MMC 0x91*/{NULL},
7617
 
/*MMC 0x92*/{NULL},
7618
 
/*MMC 0x93*/{NULL},
7619
 
/*MMC 0x94*/{NULL},
7620
 
/*MMC 0x95*/{NULL},
7621
 
/*MMC 0x96*/{NULL},
7622
 
/*MMC 0x97*/{NULL},
7623
 
/*MMC 0x98*/{NULL},
7624
 
/*MMC 0x99*/{NULL},
7625
 
/*MMC 0x9a*/{NULL},
7626
 
/*MMC 0x9b*/{NULL},
7627
 
/*MMC 0x9c*/{NULL},
7628
 
/*MMC 0x9d*/{NULL},
7629
 
/*MMC 0x9e*/{NULL},
7630
 
/*MMC 0x9f*/{NULL},
7631
 
/*SPC 0xa0*/{dissect_spc3_reportluns},
7632
 
/*MMC 0xa1*/{NULL},
7633
 
/*MMC 0xa2*/{NULL},
7634
 
/*MMC 0xa3*/{NULL},
7635
 
/*MMC 0xa4*/{dissect_mmc4_reportkey},
7636
 
/*MMC 0xa5*/{NULL},
7637
 
/*MMC 0xa6*/{NULL},
7638
 
/*MMC 0xa7*/{NULL},
7639
 
/*MMC 0xa8*/{dissect_sbc2_readwrite12},
7640
 
/*MMC 0xa9*/{NULL},
7641
 
/*MMC 0xaa*/{dissect_sbc2_readwrite12},
7642
 
/*MMC 0xab*/{NULL},
7643
 
/*MMC 0xac*/{dissect_mmc4_getperformance},
7644
 
/*MMC 0xad*/{dissect_mmc4_readdiscstructure},
7645
 
/*MMC 0xae*/{NULL},
7646
 
/*MMC 0xaf*/{NULL},
7647
 
/*MMC 0xb0*/{NULL},
7648
 
/*MMC 0xb1*/{NULL},
7649
 
/*MMC 0xb2*/{NULL},
7650
 
/*MMC 0xb3*/{NULL},
7651
 
/*MMC 0xb4*/{NULL},
7652
 
/*MMC 0xb5*/{NULL},
7653
 
/*MMC 0xb6*/{dissect_mmc4_setstreaming},
7654
 
/*MMC 0xb7*/{NULL},
7655
 
/*MMC 0xb8*/{NULL},
7656
 
/*MMC 0xb9*/{NULL},
7657
 
/*MMC 0xba*/{NULL},
7658
 
/*MMC 0xbb*/{dissect_mmc4_setcdspeed},
7659
 
/*MMC 0xbc*/{NULL},
7660
 
/*MMC 0xbd*/{NULL},
7661
 
/*MMC 0xbe*/{NULL},
7662
 
/*MMC 0xbf*/{NULL},
7663
 
/*MMC 0xc0*/{NULL},
7664
 
/*MMC 0xc1*/{NULL},
7665
 
/*MMC 0xc2*/{NULL},
7666
 
/*MMC 0xc3*/{NULL},
7667
 
/*MMC 0xc4*/{NULL},
7668
 
/*MMC 0xc5*/{NULL},
7669
 
/*MMC 0xc6*/{NULL},
7670
 
/*MMC 0xc7*/{NULL},
7671
 
/*MMC 0xc8*/{NULL},
7672
 
/*MMC 0xc9*/{NULL},
7673
 
/*MMC 0xca*/{NULL},
7674
 
/*MMC 0xcb*/{NULL},
7675
 
/*MMC 0xcc*/{NULL},
7676
 
/*MMC 0xcd*/{NULL},
7677
 
/*MMC 0xce*/{NULL},
7678
 
/*MMC 0xcf*/{NULL},
7679
 
/*MMC 0xd0*/{NULL},
7680
 
/*MMC 0xd1*/{NULL},
7681
 
/*MMC 0xd2*/{NULL},
7682
 
/*MMC 0xd3*/{NULL},
7683
 
/*MMC 0xd4*/{NULL},
7684
 
/*MMC 0xd5*/{NULL},
7685
 
/*MMC 0xd6*/{NULL},
7686
 
/*MMC 0xd7*/{NULL},
7687
 
/*MMC 0xd8*/{NULL},
7688
 
/*MMC 0xd9*/{NULL},
7689
 
/*MMC 0xda*/{NULL},
7690
 
/*MMC 0xdb*/{NULL},
7691
 
/*MMC 0xdc*/{NULL},
7692
 
/*MMC 0xdd*/{NULL},
7693
 
/*MMC 0xde*/{NULL},
7694
 
/*MMC 0xdf*/{NULL},
7695
 
/*MMC 0xe0*/{NULL},
7696
 
/*MMC 0xe1*/{NULL},
7697
 
/*MMC 0xe2*/{NULL},
7698
 
/*MMC 0xe3*/{NULL},
7699
 
/*MMC 0xe4*/{NULL},
7700
 
/*MMC 0xe5*/{NULL},
7701
 
/*MMC 0xe6*/{NULL},
7702
 
/*MMC 0xe7*/{NULL},
7703
 
/*MMC 0xe8*/{NULL},
7704
 
/*MMC 0xe9*/{NULL},
7705
 
/*MMC 0xea*/{NULL},
7706
 
/*MMC 0xeb*/{NULL},
7707
 
/*MMC 0xec*/{NULL},
7708
 
/*MMC 0xed*/{NULL},
7709
 
/*MMC 0xee*/{NULL},
7710
 
/*MMC 0xef*/{NULL},
7711
 
/*MMC 0xf0*/{NULL},
7712
 
/*MMC 0xf1*/{NULL},
7713
 
/*MMC 0xf2*/{NULL},
7714
 
/*MMC 0xf3*/{NULL},
7715
 
/*MMC 0xf4*/{NULL},
7716
 
/*MMC 0xf5*/{NULL},
7717
 
/*MMC 0xf6*/{NULL},
7718
 
/*MMC 0xf7*/{NULL},
7719
 
/*MMC 0xf8*/{NULL},
7720
 
/*MMC 0xf9*/{NULL},
7721
 
/*MMC 0xfa*/{NULL},
7722
 
/*MMC 0xfb*/{NULL},
7723
 
/*MMC 0xfc*/{NULL},
7724
 
/*MMC 0xfd*/{NULL},
7725
 
/*MMC 0xfe*/{NULL},
7726
 
/*MMC 0xff*/{NULL}
7727
 
};
7728
3771
 
7729
3772
/* This function must be called with walid pointers for both itlq and itl */
7730
3773
void
7836
3879
void
7837
3880
dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
7838
3881
                      gboolean isreq, itlq_nexus_t *itlq, itl_nexus_t *itl,
7839
 
                      guint32 relative_offset _U_)
 
3882
                      guint32 relative_offset)
7840
3883
{
7841
3884
    int offset=0;
7842
3885
    proto_item *ti;
7850
3893
    guint32 expected_length;
7851
3894
    fragment_data *ipfd_head=NULL;
7852
3895
    tvbuff_t *next_tvb=tvb;
7853
 
    gboolean   update_col_info = TRUE;
 
3896
    gboolean   update_col_info = TRUE, more_frags = FALSE;
7854
3897
 
7855
3898
    if(!itlq || !itl){
7856
3899
        /* we have no record of this exchange and so we can't dissect the
7942
3985
        }
7943
3986
    }
7944
3987
 
7945
 
    /* If we dont have the entire PDU there is no point in even trying 
 
3988
    /* If we dont have the entire PDU there is no point in even trying
7946
3989
     * reassembly
7947
3990
     */
7948
3991
    if(tvb_length_remaining(tvb, offset)!=tvb_reported_length_remaining(tvb, offset)){
7977
4020
 
7978
4021
 
7979
4022
    /* Start reassembly */
7980
 
    ipfd_head = fragment_add_check(tvb, offset, pinfo, 
 
4023
 
 
4024
    if (tvb_length_remaining(tvb, offset) < 0) {
 
4025
        goto end_of_payload;
 
4026
    }
 
4027
    if ((tvb_length_remaining(tvb,offset) + relative_offset) != expected_length) {
 
4028
        more_frags = TRUE;
 
4029
    }
 
4030
    ipfd_head = fragment_add_check(tvb, offset, pinfo,
7981
4031
                             itlq->first_exchange_frame, /* key */
7982
4032
                             scsi_fragment_table,
7983
4033
                             scsi_reassembled_table,
7984
4034
                             relative_offset,
7985
4035
                             tvb_length_remaining(tvb, offset),
7986
 
                             (tvb_length_remaining(tvb,offset)+relative_offset)!=expected_length);
 
4036
                             more_frags);
7987
4037
    next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled SCSI DATA", ipfd_head, &scsi_frag_items, &update_col_info, tree);
7988
4038
 
7989
4039
    if( ipfd_head && ipfd_head->reassembled_in != pinfo->fd->num ){
8057
4107
 
8058
4108
    switch(cmdset&SCSI_CMDSET_MASK){
8059
4109
    case SCSI_DEV_SBC:
8060
 
        csdata->hf_opcode=hf_scsi_sbcopcode;
8061
 
        csdata->cdb_vals=scsi_sbc2_vals;
8062
 
        csdata->cdb_table=sbc;
 
4110
        csdata->hf_opcode=hf_scsi_sbc_opcode;
 
4111
        csdata->cdb_vals=scsi_sbc_vals;
 
4112
        csdata->cdb_table=scsi_sbc_table;
8063
4113
        break;
8064
4114
    case SCSI_DEV_CDROM:
8065
 
        csdata->hf_opcode=hf_scsi_mmcopcode;
 
4115
        csdata->hf_opcode=hf_scsi_mmc_opcode;
8066
4116
        csdata->cdb_vals=scsi_mmc_vals;
8067
 
        csdata->cdb_table=mmc;
 
4117
        csdata->cdb_table=scsi_mmc_table;
8068
4118
        break;
8069
4119
    case SCSI_DEV_SSC:
8070
 
        csdata->hf_opcode=hf_scsi_sscopcode;
8071
 
        csdata->cdb_vals=scsi_ssc2_vals;
8072
 
        csdata->cdb_table=ssc;
 
4120
        csdata->hf_opcode=hf_scsi_ssc_opcode;
 
4121
        csdata->cdb_vals=scsi_ssc_vals;
 
4122
        csdata->cdb_table=scsi_ssc_table;
8073
4123
        break;
8074
4124
    case SCSI_DEV_SMC:
8075
 
        csdata->hf_opcode=hf_scsi_smcopcode;
8076
 
        csdata->cdb_vals=scsi_smc2_vals;
8077
 
        csdata->cdb_table=smc;
 
4125
        csdata->hf_opcode=hf_scsi_smc_opcode;
 
4126
        csdata->cdb_vals=scsi_smc_vals;
 
4127
        csdata->cdb_table=scsi_smc_table;
8078
4128
        break;
8079
4129
    case SCSI_DEV_OSD:
8080
4130
        csdata->hf_opcode=hf_scsi_osd_opcode;
8090
4140
 
8091
4141
    return csdata;
8092
4142
}
8093
 
   
 
4143
 
8094
4144
 
8095
4145
void
8096
4146
proto_register_scsi (void)
8108
4158
        { &hf_scsi_spcopcode,
8109
4159
          {"SPC-2 Opcode", "scsi.spc.opcode", FT_UINT8, BASE_HEX,
8110
4160
           VALS (scsi_spc2_vals), 0x0, "", HFILL}},
8111
 
        { &hf_scsi_mmcopcode,
8112
 
          {"MMC Opcode", "scsi.mmc.opcode", FT_UINT8, BASE_HEX,
8113
 
           VALS (scsi_mmc_vals), 0x0, "", HFILL}},
8114
 
        { &hf_scsi_sbcopcode,
8115
 
          {"SBC-2 Opcode", "scsi.sbc.opcode", FT_UINT8, BASE_HEX,
8116
 
           VALS (scsi_sbc2_vals), 0x0, "", HFILL}},
8117
 
        { &hf_scsi_sscopcode,
8118
 
          {"SSC-2 Opcode", "scsi.ssc.opcode", FT_UINT8, BASE_HEX,
8119
 
           VALS (scsi_ssc2_vals), 0x0, "", HFILL}},
8120
 
        { &hf_scsi_smcopcode,
8121
 
          {"SMC-2 Opcode", "scsi.smc.opcode", FT_UINT8, BASE_HEX,
8122
 
           VALS (scsi_smc2_vals), 0x0, "", HFILL}},
8123
4161
        { &hf_scsi_control,
8124
4162
          {"Control", "scsi.cdb.control", FT_UINT8, BASE_HEX, NULL, 0x0, "",
8125
4163
           HFILL}},
8170
4208
           VALS (scsi_spc2_modepage_val), 0x3F, "", HFILL}},
8171
4209
        { &hf_scsi_sbcpagecode,
8172
4210
          {"SBC-2 Page Code", "scsi.mode.sbc.pagecode", FT_UINT8, BASE_HEX,
8173
 
           VALS (scsi_sbc2_modepage_val), 0x3F, "", HFILL}},
 
4211
           VALS (scsi_sbc_modepage_val), 0x3F, "", HFILL}},
8174
4212
        { &hf_scsi_sscpagecode,
8175
4213
          {"SSC-2 Page Code", "scsi.mode.ssc.pagecode", FT_UINT8, BASE_HEX,
8176
4214
           VALS (scsi_ssc2_modepage_val), 0x3F, "", HFILL}},
8204
4242
        { &hf_scsi_alloclen32,
8205
4243
          {"Allocation Length", "scsi.cdb.alloclen32", FT_UINT32, BASE_DEC,
8206
4244
           NULL, 0x0, "", HFILL}},
8207
 
        { &hf_scsi_formatunit_flags,
8208
 
          {"Flags", "scsi.formatunit.flags", FT_UINT8, BASE_HEX, NULL, 0xF8,
8209
 
           "", HFILL}},
8210
 
        { &hf_scsi_cdb_defectfmt,
8211
 
          {"Defect List Format", "scsi.cdb.defectfmt", FT_UINT8, BASE_DEC,
8212
 
           NULL, 0x7, "", HFILL}},
8213
 
        { &hf_scsi_formatunit_interleave,
8214
 
          {"Interleave", "scsi.formatunit.interleave", FT_UINT16, BASE_HEX,
8215
 
           NULL, 0x0, "", HFILL}},
8216
 
        { &hf_scsi_formatunit_vendor,
8217
 
          {"Vendor Unique", "scsi.formatunit.vendor", FT_UINT8, BASE_HEX, NULL,
8218
 
           0x0, "", HFILL}},
8219
 
        { &hf_scsi_rdwr6_lba,
8220
 
          {"Logical Block Address (LBA)", "scsi.rdwr6.lba", FT_UINT24, BASE_DEC,
8221
 
           NULL, 0x0FFFFF, "", HFILL}},
8222
 
        { &hf_scsi_rdwr6_xferlen,
8223
 
          {"Transfer Length", "scsi.rdwr6.xferlen", FT_UINT24, BASE_DEC, NULL, 0x0,
8224
 
           "", HFILL}},
8225
 
        { &hf_scsi_rdwr10_lba,
8226
 
          {"Logical Block Address (LBA)", "scsi.rdwr10.lba", FT_UINT32, BASE_DEC,
8227
 
           NULL, 0x0, "", HFILL}},
8228
 
        { &hf_scsi_rdwr10_xferlen,
8229
 
          {"Transfer Length", "scsi.rdwr10.xferlen", FT_UINT16, BASE_DEC, NULL,
8230
 
           0x0, "", HFILL}},
8231
 
        { &hf_scsi_read_flags,
8232
 
          {"Flags", "scsi.read.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "",
8233
 
           HFILL}},
8234
 
        { &hf_scsi_rdwr12_xferlen,
8235
 
          {"Transfer Length", "scsi.rdwr12.xferlen", FT_UINT32, BASE_DEC, NULL,
8236
 
           0x0, "", HFILL}},
8237
 
        { &hf_scsi_rdwr16_lba,
8238
 
          {"Logical Block Address (LBA)", "scsi.rdwr16.lba", FT_BYTES, BASE_DEC,
8239
 
           NULL, 0x0, "", HFILL}},
8240
 
        { &hf_scsi_readcapacity_flags,
8241
 
          {"Flags", "scsi.readcapacity.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
8242
 
           "", HFILL}},
8243
 
        { &hf_scsi_readcapacity_lba,
8244
 
          {"Logical Block Address", "scsi.readcapacity.lba", FT_UINT32, BASE_DEC,
8245
 
           NULL, 0x0, "", HFILL}},
8246
 
        { &hf_scsi_readcapacity_pmi,
8247
 
          {"PMI", "scsi.readcapacity.pmi", FT_UINT8, BASE_DEC, NULL, 0x1, "",
8248
 
           HFILL}},
8249
 
        { &hf_scsi_readdefdata_flags,
8250
 
          {"Flags", "scsi.readdefdata.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "",
8251
 
           HFILL}},
8252
 
        { &hf_scsi_reassignblks_flags,
8253
 
          {"Flags", "scsi.reassignblks.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "",
8254
 
           HFILL}},
8255
4245
        { &hf_scsi_inq_add_len,
8256
4246
          {"Additional Length", "scsi.inquiry.add_len", FT_UINT8, BASE_DEC,
8257
4247
           NULL, 0, "", HFILL}},
8258
4248
        { &hf_scsi_inq_qualifier,
8259
 
          {"Peripheral Qualifier", "scsi.inquiry.qualifier", FT_UINT8, BASE_HEX,
 
4249
          {"Qualifier", "scsi.inquiry.qualifier", FT_UINT8, BASE_HEX,
8260
4250
           VALS (scsi_qualifier_val), 0xE0, "", HFILL}},
 
4251
        { &hf_scsi_inq_peripheral,
 
4252
          {"Peripheral", "scsi.inquiry.preipheral", FT_UINT8, BASE_HEX,
 
4253
           NULL, 0, "", HFILL}},
8261
4254
        { &hf_scsi_inq_vendor_id,
8262
4255
          {"Vendor Id", "scsi.inquiry.vendor_id", FT_STRING, BASE_NONE,
8263
4256
           NULL, 0, "", HFILL}},
8271
4264
          {"Version Description", "scsi.inquiry.version_desc", FT_UINT16, BASE_HEX,
8272
4265
           VALS(scsi_verdesc_val), 0, "", HFILL}},
8273
4266
        { &hf_scsi_inq_devtype,
8274
 
          {"Peripheral Device Type", "scsi.inquiry.devtype", FT_UINT8, BASE_HEX,
 
4267
          {"Device Type", "scsi.inquiry.devtype", FT_UINT8, BASE_HEX,
8275
4268
           VALS (scsi_devtype_val), SCSI_DEV_BITS, "", HFILL}},
8276
4269
        { &hf_scsi_inq_rmb,
8277
4270
          {"Removable", "scsi.inquiry.removable", FT_BOOLEAN, 8,
8330
4323
        { &hf_scsi_inq_acaflags,
8331
4324
          {"Flags", "scsi.inquiry.acaflags", FT_UINT8, BASE_HEX, NULL, 0,
8332
4325
           "", HFILL}},
 
4326
        { &hf_scsi_inq_rmbflags,
 
4327
          {"Flags", "scsi.inquiry.rmbflags", FT_UINT8, BASE_HEX, NULL, 0,
 
4328
           "", HFILL}},
8333
4329
        { &hf_scsi_inq_normaca,
8334
4330
          {"NormACA", "scsi.inquiry.normaca", FT_BOOLEAN, 8, TFS(&normaca_tfs), SCSI_INQ_ACAFLAGS_NORMACA,
8335
4331
           "", HFILL}},
8411
4407
        { &hf_scsi_svcaction,
8412
4408
          {"Service Action", "scsi.spc2.svcaction", FT_UINT16, BASE_HEX, NULL,
8413
4409
           0x0, "", HFILL}},
8414
 
        { &hf_scsi_ssu_immed,
8415
 
          {"Immediate", "scsi.sbc2.ssu.immediate", FT_BOOLEAN, BASE_DEC, NULL,
8416
 
           0x1, "", HFILL}},
8417
 
        { &hf_scsi_ssu_pwr_cond,
8418
 
          {"Power Conditions", "scsi.sbc2.ssu.pwr", FT_UINT8, BASE_HEX,
8419
 
           VALS (scsi_ssu_pwrcnd_val), 0xF0, "", HFILL}},
8420
 
        { &hf_scsi_ssu_loej,
8421
 
          {"LOEJ", "scsi.sbc2.ssu.loej", FT_BOOLEAN, BASE_HEX, NULL, 0x2, "",
8422
 
           HFILL}},
8423
 
        { &hf_scsi_ssu_start,
8424
 
          {"Start", "scsi.sbc2.ssu.start", FT_BOOLEAN, BASE_HEX, NULL, 0x1,
8425
 
           "", HFILL}},
8426
4410
        { &hf_scsi_wb_mode,
8427
4411
          {"Mode", "scsi.spc2.wb.mode", FT_UINT8, BASE_HEX,
8428
4412
           VALS (scsi_wb_mode_val), 0xF, "", HFILL}},
8453
4437
        { &hf_scsi_senddiag_unitoff,
8454
4438
          {"Unit Offline", "scsi.spc2.senddiag.unitoff", FT_BOOLEAN, BASE_HEX,
8455
4439
           NULL, 0x1, "", HFILL}},
8456
 
        { &hf_scsi_key_class,
8457
 
          {"Key Class", "scsi.mmc4.key_class", FT_UINT8, BASE_HEX,
8458
 
           VALS (scsi_key_class_val), 0x00, "", HFILL}},
8459
 
        { &hf_scsi_agid,
8460
 
          {"AGID", "scsi.mmc4.agid", FT_UINT8, BASE_HEX,
8461
 
           NULL, 0xc0, "", HFILL}},
8462
 
        { &hf_scsi_key_format,
8463
 
          {"Key Format", "scsi.mmc4.key_format", FT_UINT8, BASE_HEX,
8464
 
           VALS (scsi_key_format_val), 0x3f, "", HFILL}},
8465
 
        { &hf_scsi_lba,
8466
 
          {"Logical Block Address", "scsi.lba", FT_UINT32, BASE_DEC,
8467
 
           NULL, 0x0, "", HFILL}},
8468
 
        { &hf_scsi_num_blocks,
8469
 
          {"Number of Blocks", "scsi.num_blocks", FT_UINT32, BASE_DEC,
8470
 
           NULL, 0x0, "", HFILL}},
8471
 
        { &hf_scsi_data_length,
8472
 
          {"Data Length", "scsi.data_length", FT_UINT32, BASE_DEC,
8473
 
           NULL, 0x0, "", HFILL}},
8474
 
        { &hf_scsi_report_key_type_code,
8475
 
          {"Type Code", "scsi.report_key.type_code", FT_UINT8, BASE_HEX,
8476
 
           VALS(scsi_report_key_type_code_val), 0xc0, "", HFILL}},
8477
 
        { &hf_scsi_report_key_vendor_resets,
8478
 
          {"Vendor Resets", "scsi.report_key.vendor_resets", FT_UINT8, BASE_HEX,
8479
 
           NULL, 0x38, "", HFILL}},
8480
 
        { &hf_scsi_report_key_user_changes,
8481
 
          {"User Changes", "scsi.report_key.user_changes", FT_UINT8, BASE_HEX,
8482
 
           NULL, 0x07, "", HFILL}},
8483
 
        { &hf_scsi_report_key_region_mask,
8484
 
          {"Region Mask", "scsi.report_key.region_mask", FT_UINT8, BASE_HEX,
8485
 
           NULL, 0xff, "", HFILL}},
8486
 
        { &hf_scsi_report_key_rpc_scheme,
8487
 
          {"RPC Scheme", "scsi.report_key.rpc_scheme", FT_UINT8, BASE_HEX,
8488
 
           VALS(scsi_report_key_rpc_scheme_val), 0, "", HFILL}},
8489
 
        { &hf_scsi_setcdspeed_rc,
8490
 
          {"Rotational Control", "scsi.setcdspeed.rc", FT_UINT8, BASE_HEX,
8491
 
           VALS(scsi_setcdspeed_rc_val), 0x03, "", HFILL}},
8492
 
        { &hf_scsi_getconf_rt,
8493
 
          {"RT", "scsi.getconf.rt", FT_UINT8, BASE_HEX,
8494
 
           VALS(scsi_getconf_rt_val), 0x03, "", HFILL}},
8495
 
        { &hf_scsi_getconf_current_profile,
8496
 
          {"Current Profile", "scsi.getconf.current_profile", FT_UINT16, BASE_HEX,
8497
 
           VALS(scsi_getconf_current_profile_val), 0, "", HFILL}},
8498
 
        { &hf_scsi_getconf_starting_feature,
8499
 
          {"Starting Feature", "scsi.getconf.starting_feature", FT_UINT16, BASE_HEX,
8500
 
           VALS(scsi_feature_val), 0, "", HFILL}},
8501
 
        { &hf_scsi_feature,
8502
 
          {"Feature", "scsi.feature", FT_UINT16, BASE_HEX,
8503
 
           VALS(scsi_feature_val), 0, "", HFILL}},
8504
 
        { &hf_scsi_feature_version,
8505
 
          {"Version", "scsi.feature.version", FT_UINT8, BASE_DEC,
8506
 
           NULL, 0x3c, "", HFILL}},
8507
 
        { &hf_scsi_feature_persistent,
8508
 
          {"Persistent", "scsi.feature.persistent", FT_UINT8, BASE_HEX,
8509
 
           NULL, 0x02, "", HFILL}},
8510
 
        { &hf_scsi_feature_current,
8511
 
          {"Current", "scsi.feature.current", FT_UINT8, BASE_HEX,
8512
 
           NULL, 001, "", HFILL}},
8513
 
        { &hf_scsi_feature_additional_length,
8514
 
          {"Additional Length", "scsi.feature.additional_length", FT_UINT8, BASE_DEC,
8515
 
           NULL, 0, "", HFILL}},
8516
 
        { &hf_scsi_feature_lun_sn,
8517
 
          {"LUN Serial Number", "scsi.feature.lun_sn", FT_STRING, BASE_NONE,
8518
 
           NULL, 0, "", HFILL}},
8519
 
        { &hf_scsi_feature_cdread_dap,
8520
 
          {"DAP", "scsi.feature.cdread.dap", FT_BOOLEAN, 8,
8521
 
           NULL, 0x80, "", HFILL}},
8522
 
        { &hf_scsi_feature_cdread_c2flag,
8523
 
          {"C2 Flag", "scsi.feature.cdread.c2flag", FT_BOOLEAN, 8,
8524
 
           NULL, 0x02, "", HFILL}},
8525
 
        { &hf_scsi_feature_cdread_cdtext,
8526
 
          {"CD-Text", "scsi.feature.cdread.cdtext", FT_BOOLEAN, 8,
8527
 
           NULL, 0x01, "", HFILL}},
8528
 
        { &hf_scsi_feature_dvdrw_write,
8529
 
          {"Write", "scsi.feature.dvdrw.write", FT_BOOLEAN, 8,
8530
 
           NULL, 0x01, "", HFILL}},
8531
 
        { &hf_scsi_feature_dvdrw_quickstart,
8532
 
          {"Quick Start", "scsi.feature.dvdrw.quickstart", FT_BOOLEAN, 8,
8533
 
           NULL, 0x02, "", HFILL}},
8534
 
        { &hf_scsi_feature_dvdrw_closeonly,
8535
 
          {"Close Only", "scsi.feature.dvdrw.closeonly", FT_BOOLEAN, 8,
8536
 
           NULL, 0x01, "", HFILL}},
8537
 
        { &hf_scsi_feature_dvdr_write,
8538
 
          {"Write", "scsi.feature.dvdr.write", FT_BOOLEAN, 8,
8539
 
           NULL, 0x01, "", HFILL}},
8540
 
        { &hf_scsi_feature_tao_buf,
8541
 
          {"BUF", "scsi.feature.tao.buf", FT_BOOLEAN, 8,
8542
 
           NULL, 0x40, "", HFILL}},
8543
 
        { &hf_scsi_feature_tao_rwraw,
8544
 
          {"R-W Raw", "scsi.feature.tao.rwraw", FT_BOOLEAN, 8,
8545
 
           NULL, 0x10, "", HFILL}},
8546
 
        { &hf_scsi_feature_tao_rwpack,
8547
 
          {"R-W Pack", "scsi.feature.tao.rwpack", FT_BOOLEAN, 8,
8548
 
           NULL, 0x08, "", HFILL}},
8549
 
        { &hf_scsi_feature_tao_testwrite,
8550
 
          {"Test Write", "scsi.feature.tao.testwrite", FT_BOOLEAN, 8,
8551
 
           NULL, 0x04, "", HFILL}},
8552
 
        { &hf_scsi_feature_tao_cdrw,
8553
 
          {"CD-RW", "scsi.feature.tao.cdrw", FT_BOOLEAN, 8,
8554
 
           NULL, 0x02, "", HFILL}},
8555
 
        { &hf_scsi_feature_tao_rwsubcode,
8556
 
          {"R-W Subcode", "scsi.feature.tao.rwsubcode", FT_BOOLEAN, 8,
8557
 
           NULL, 0x01, "", HFILL}},
8558
 
        { &hf_scsi_feature_dts,
8559
 
          {"Data Type Supported", "scsi.feature.dts", FT_UINT16, BASE_HEX,
8560
 
           NULL, 0xffff, "", HFILL}},
8561
 
        { &hf_scsi_feature_sao_buf,
8562
 
          {"BUF", "scsi.feature.sao.buf", FT_BOOLEAN, 8,
8563
 
           NULL, 0x40, "", HFILL}},
8564
 
        { &hf_scsi_feature_sao_sao,
8565
 
          {"SAO", "scsi.feature.sao.sao", FT_BOOLEAN, 8,
8566
 
           NULL, 0x20, "", HFILL}},
8567
 
        { &hf_scsi_feature_sao_rawms,
8568
 
          {"Raw MS", "scsi.feature.sao.rawms", FT_BOOLEAN, 8,
8569
 
           NULL, 0x10, "", HFILL}},
8570
 
        { &hf_scsi_feature_sao_raw,
8571
 
          {"Raw", "scsi.feature.sao.raw", FT_BOOLEAN, 8,
8572
 
           NULL, 0x08, "", HFILL}},
8573
 
        { &hf_scsi_feature_sao_testwrite,
8574
 
          {"Test Write", "scsi.feature.sao.testwrite", FT_BOOLEAN, 8,
8575
 
           NULL, 0x04, "", HFILL}},
8576
 
        { &hf_scsi_feature_sao_cdrw,
8577
 
          {"CD-RW", "scsi.feature.sao.cdrw", FT_BOOLEAN, 8,
8578
 
           NULL, 0x02, "", HFILL}},
8579
 
        { &hf_scsi_feature_sao_rw,
8580
 
          {"R-W", "scsi.feature.sao.rw", FT_BOOLEAN, 8,
8581
 
           NULL, 0x01, "", HFILL}},
8582
 
        { &hf_scsi_feature_sao_mcsl,
8583
 
          {"Maximum Cue Sheet Length", "scsi.feature.sao.mcsl", FT_UINT24, BASE_DEC,
8584
 
           NULL, 0, "", HFILL}},
8585
 
        { &hf_scsi_feature_dvdr_buf,
8586
 
          {"BUF", "scsi.feature.dvdr.buf", FT_BOOLEAN, 8,
8587
 
           NULL, 0x40, "", HFILL}},
8588
 
        { &hf_scsi_feature_dvdr_testwrite,
8589
 
          {"Test Write", "scsi.feature.dvdr.testwrite", FT_BOOLEAN, 8,
8590
 
           NULL, 0x04, "", HFILL}},
8591
 
        { &hf_scsi_feature_dvdr_dvdrw,
8592
 
          {"DVD-RW", "scsi.feature.dvdr.dvdrw", FT_BOOLEAN, 8,
8593
 
           NULL, 0x02, "", HFILL}},
8594
 
        { &hf_scsi_feature_profile,
8595
 
          {"Profile", "scsi.feature.profile", FT_UINT16, BASE_HEX,
8596
 
           VALS(scsi_getconf_current_profile_val), 0, "", HFILL}},
8597
 
        { &hf_scsi_feature_profile_current,
8598
 
          {"Current", "scsi.feature.profile.current", FT_BOOLEAN, 8,
8599
 
           NULL, 0x01, "", HFILL}},
8600
 
        { &hf_scsi_feature_isw_buf,
8601
 
          {"BUF", "scsi.feature.isw.buf", FT_BOOLEAN, 8,
8602
 
           NULL, 0x01, "", HFILL}},
8603
 
        { &hf_scsi_feature_isw_num_linksize,
8604
 
          {"Number of Link Sizes", "scsi.feature.isw.num_linksize", FT_UINT8, BASE_DEC,
8605
 
           NULL, 0, "", HFILL}},
8606
 
        { &hf_scsi_feature_isw_linksize,
8607
 
          {"Link Size", "scsi.feature.isw.linksize", FT_UINT8, BASE_DEC,
8608
 
           NULL, 0, "", HFILL}},
8609
 
        { &hf_scsi_readtoc_time,
8610
 
          {"Time", "scsi.readtoc.time", FT_BOOLEAN, 8,
8611
 
           NULL, 0x02, "", HFILL}},
8612
 
        { &hf_scsi_readtoc_format,
8613
 
          {"Format", "scsi.readtoc.format", FT_UINT8, BASE_HEX,
8614
 
           NULL, 0x0f, "", HFILL}},
8615
 
        { &hf_scsi_track,
8616
 
          {"Track", "scsi.track", FT_UINT32, BASE_DEC,
8617
 
           NULL, 0, "", HFILL}},
8618
 
        { &hf_scsi_track_size,
8619
 
          {"Track Size", "scsi.track_size", FT_UINT32, BASE_DEC,
8620
 
           NULL, 0, "", HFILL}},
8621
 
        { &hf_scsi_session,
8622
 
          {"Session", "scsi.session", FT_UINT32, BASE_DEC,
8623
 
           NULL, 0, "", HFILL}},
8624
 
        { &hf_scsi_first_track,
8625
 
          {"First Track", "scsi.first_track", FT_UINT8, BASE_DEC,
8626
 
           NULL, 0, "", HFILL}},
8627
 
        { &hf_scsi_readtoc_first_session,
8628
 
          {"First Session", "scsi.readtoc.first_session", FT_UINT8, BASE_DEC,
8629
 
           NULL, 0, "", HFILL}},
8630
 
        { &hf_scsi_readtoc_last_track,
8631
 
          {"Last Track", "scsi.readtoc.last_track", FT_UINT8, BASE_DEC,
8632
 
           NULL, 0, "", HFILL}},
8633
 
        { &hf_scsi_readtoc_last_session,
8634
 
          {"Last Session", "scsi.readtoc.last_session", FT_UINT8, BASE_DEC,
8635
 
           NULL, 0, "", HFILL}},
8636
 
        { &hf_scsi_q_subchannel_adr,
8637
 
          {"Q Subchannel ADR", "scsi.q.subchannel.adr", FT_UINT8, BASE_HEX,
8638
 
           VALS(scsi_q_subchannel_adr_val), 0xf0, "", HFILL}},
8639
 
        { &hf_scsi_q_subchannel_control,
8640
 
          {"Q Subchannel Control", "scsi.q.subchannel.control", FT_UINT8, BASE_HEX,
8641
 
           VALS(scsi_q_subchannel_control_val), 0x0f, "", HFILL}},
8642
 
        { &hf_scsi_track_start_address,
8643
 
          {"Track Start Address", "scsi.track_start_address", FT_UINT32, BASE_DEC,
8644
 
           NULL, 0, "", HFILL}},
8645
 
        { &hf_scsi_next_writable_address,
8646
 
          {"Next Writable Address", "scsi.next_writable_address", FT_UINT32, BASE_DEC,
8647
 
           NULL, 0, "", HFILL}},
8648
 
        { &hf_scsi_track_start_time,
8649
 
          {"Track Start Time", "scsi.track_start_time", FT_UINT32, BASE_DEC,
8650
 
           NULL, 0, "", HFILL}},
8651
 
        { &hf_scsi_synccache_immed,
8652
 
          {"IMMED", "scsi.synccache.immed", FT_BOOLEAN, 8,
8653
 
           NULL, 0x02, "", HFILL}},
8654
 
        { &hf_scsi_synccache_reladr,
8655
 
          {"RelAdr", "scsi.synccache.reladr", FT_BOOLEAN, 8,
8656
 
           NULL, 0x01, "", HFILL}},
8657
 
        { &hf_scsi_rbc_block,
8658
 
          {"BLOCK", "scsi.rbc.block", FT_BOOLEAN, 8,
8659
 
           NULL, 0x01, "", HFILL}},
8660
 
        { &hf_scsi_rbc_lob_blocks,
8661
 
          {"Buffer Len (blocks)", "scsi.rbc.lob_blocks", FT_UINT32, BASE_DEC,
8662
 
           NULL, 0, "", HFILL}},
8663
 
        { &hf_scsi_rbc_alob_blocks,
8664
 
          {"Available Buffer Len (blocks)", "scsi.rbc.alob_blocks", FT_UINT32, BASE_DEC,
8665
 
           NULL, 0, "", HFILL}},
8666
 
        { &hf_scsi_rbc_lob_bytes,
8667
 
          {"Buffer Len (bytes)", "scsi.rbc.lob_bytes", FT_UINT32, BASE_DEC,
8668
 
           NULL, 0, "", HFILL}},
8669
 
        { &hf_scsi_rbc_alob_bytes,
8670
 
          {"Available Buffer Len (bytes)", "scsi.rbc.alob_bytes", FT_UINT32, BASE_DEC,
8671
 
           NULL, 0, "", HFILL}},
8672
 
        { &hf_scsi_setstreaming_type,
8673
 
          {"Type", "scsi.setstreaming.type", FT_UINT8, BASE_DEC,
8674
 
           VALS(scsi_setstreaming_type_val), 0, "", HFILL}},
8675
 
        { &hf_scsi_setstreaming_param_len,
8676
 
          {"Parameter Length", "scsi.setstreaming.param_len", FT_UINT16, BASE_DEC,
8677
 
           NULL, 0, "", HFILL}},
8678
 
        { &hf_scsi_setstreaming_wrc,
8679
 
          {"WRC", "scsi.setstreaming.wrc", FT_UINT8, BASE_HEX,
8680
 
           NULL, 0x18, "", HFILL}},
8681
 
        { &hf_scsi_setstreaming_rdd,
8682
 
          {"RDD", "scsi.setstreaming.rdd", FT_BOOLEAN, 8,
8683
 
           NULL, 0x04, "", HFILL}},
8684
 
        { &hf_scsi_setstreaming_exact,
8685
 
          {"Exact", "scsi.setstreaming.exact", FT_BOOLEAN, 8,
8686
 
           NULL, 0x02, "", HFILL}},
8687
 
        { &hf_scsi_setstreaming_ra,
8688
 
          {"RA", "scsi.setstreaming.ra", FT_BOOLEAN, 8,
8689
 
           NULL, 0x01, "", HFILL}},
8690
 
        { &hf_scsi_setstreaming_start_lba,
8691
 
          {"Start LBA", "scsi.setstreaming.start_lbs", FT_UINT32, BASE_DEC,
8692
 
           NULL, 0, "", HFILL}},
8693
 
        { &hf_scsi_setstreaming_end_lba,
8694
 
          {"End LBA", "scsi.setstreaming.end_lba", FT_UINT32, BASE_DEC,
8695
 
           NULL, 0, "", HFILL}},
8696
 
        { &hf_scsi_setstreaming_read_size,
8697
 
          {"Read Size", "scsi.setstreaming.read_size", FT_UINT32, BASE_DEC,
8698
 
           NULL, 0, "", HFILL}},
8699
 
        { &hf_scsi_setstreaming_read_time,
8700
 
          {"Read Time", "scsi.setstreaming.read_time", FT_UINT32, BASE_DEC,
8701
 
           NULL, 0, "", HFILL}},
8702
 
        { &hf_scsi_setstreaming_write_size,
8703
 
          {"Write Size", "scsi.setstreaming.write_size", FT_UINT32, BASE_DEC,
8704
 
           NULL, 0, "", HFILL}},
8705
 
        { &hf_scsi_setstreaming_write_time,
8706
 
          {"Write Time", "scsi.setstreaming.write_time", FT_UINT32, BASE_DEC,
8707
 
           NULL, 0, "", HFILL}},
8708
 
        { &hf_scsi_reservation_size,
8709
 
          {"Reservation Size", "scsi.reservation_size", FT_UINT32, BASE_DEC,
8710
 
           NULL, 0, "", HFILL}},
8711
 
        { &hf_scsi_rti_address_type,
8712
 
          {"Address Type", "scsi.rti.address_type", FT_UINT8, BASE_HEX,
8713
 
           VALS(scsi_rti_address_type_val), 0x03, "", HFILL}},
8714
 
        { &hf_scsi_rti_damage,
8715
 
          {"Damage", "scsi.rti.damage", FT_BOOLEAN, 8,
8716
 
           NULL, 0x20, "", HFILL}},
8717
 
        { &hf_scsi_rti_copy,
8718
 
          {"Copy", "scsi.rti.copy", FT_BOOLEAN, 8,
8719
 
           NULL, 0x10, "", HFILL}},
8720
 
        { &hf_scsi_rti_track_mode,
8721
 
          {"Track Mode", "scsi.rti.track_mode", FT_UINT8, BASE_HEX,
8722
 
           NULL, 0x0f, "", HFILL}},
8723
 
        { &hf_scsi_rti_rt,
8724
 
          {"RT", "scsi.rti.rt", FT_BOOLEAN, 8,
8725
 
           NULL, 0x80, "", HFILL}},
8726
 
        { &hf_scsi_rti_blank,
8727
 
          {"Blank", "scsi.rti.blank", FT_BOOLEAN, 8,
8728
 
           NULL, 0x40, "", HFILL}},
8729
 
        { &hf_scsi_rti_packet,
8730
 
          {"Packet/Inc", "scsi.rti.packet", FT_BOOLEAN, 8,
8731
 
           NULL, 0x20, "", HFILL}},
8732
 
        { &hf_scsi_rti_fp,
8733
 
          {"FP", "scsi.rti.fp", FT_BOOLEAN, 8,
8734
 
           NULL, 0x10, "", HFILL}},
8735
 
        { &hf_scsi_rti_data_mode,
8736
 
          {"Data Mode", "scsi.rti.data_mode", FT_UINT8, BASE_HEX,
8737
 
           NULL, 0x0f, "", HFILL}},
8738
 
        { &hf_scsi_rti_lra_v,
8739
 
          {"LRA_V", "scsi.rti.lra_v", FT_BOOLEAN, 8,
8740
 
           NULL, 0x02, "", HFILL}},
8741
 
        { &hf_scsi_rti_nwa_v,
8742
 
          {"NWA_V", "scsi.rti.nwa_v", FT_BOOLEAN, 8,
8743
 
           NULL, 0x01, "", HFILL}},
8744
 
        { &hf_scsi_free_blocks,
8745
 
          {"Free Blocks", "scsi.free_blocks", FT_UINT32, BASE_DEC,
8746
 
           NULL, 0, "", HFILL}},
8747
 
        { &hf_scsi_fixed_packet_size,
8748
 
          {"Fixed Packet Size", "scsi.fixed_packet_size", FT_UINT32, BASE_DEC,
8749
 
           NULL, 0, "", HFILL}},
8750
 
        { &hf_scsi_last_recorded_address,
8751
 
          {"Last Recorded Address", "scsi.last_recorded_address", FT_UINT32, BASE_DEC,
8752
 
           NULL, 0, "", HFILL}},
8753
 
        { &hf_scsi_read_compatibility_lba,
8754
 
          {"Read Compatibility LBA", "scsi.read_compatibility_lba", FT_UINT32, BASE_DEC,
8755
 
           NULL, 0, "", HFILL}},
8756
 
        { &hf_scsi_disc_info_erasable,
8757
 
          {"Erasable", "scsi.disc_info.erasable", FT_BOOLEAN, 8,
8758
 
           NULL, 0x10, "", HFILL}},
8759
 
        { &hf_scsi_disc_info_state_of_last_session,
8760
 
          {"State Of Last Session", "scsi.disc_info.state_of_last_session", FT_UINT8, BASE_HEX,
8761
 
           VALS(scsi_disc_info_sols_val), 0x0c, "", HFILL}},
8762
 
        { &hf_scsi_disc_info_disk_status,
8763
 
          {"Disk Status", "scsi.disc_info.disk_status", FT_UINT8, BASE_HEX,
8764
 
           VALS(scsi_disc_info_disc_status_val), 0x03, "", HFILL}},
8765
 
        { &hf_scsi_disc_info_number_of_sessions,
8766
 
          {"Number Of Sessions", "scsi.disc_info.number_of_sessions", FT_UINT16, BASE_DEC,
8767
 
           NULL, 0, "", HFILL}},
8768
 
        { &hf_scsi_disc_info_first_track_in_last_session,
8769
 
          {"First Track In Last Session", "scsi.disc_info.first_track_in_last_session", FT_UINT16, BASE_DEC,
8770
 
           NULL, 0, "", HFILL}},
8771
 
        { &hf_scsi_disc_info_last_track_in_last_session,
8772
 
          {"Last Track In Last Session", "scsi.disc_info.last_track_in_last_session", FT_UINT16, BASE_DEC,
8773
 
           NULL, 0, "", HFILL}},
8774
 
        { &hf_scsi_disc_info_did_v,
8775
 
          {"DID_V", "scsi.disc_info.did_v", FT_BOOLEAN, 8,
8776
 
           NULL, 0x80, "", HFILL}},
8777
 
        { &hf_scsi_disc_info_dbc_v,
8778
 
          {"DBC_V", "scsi.disc_info.dbc_v", FT_BOOLEAN, 8,
8779
 
           NULL, 0x40, "", HFILL}},
8780
 
        { &hf_scsi_disc_info_uru,
8781
 
          {"URU", "scsi.disc_info.uru", FT_BOOLEAN, 8,
8782
 
           NULL, 0x20, "", HFILL}},
8783
 
        { &hf_scsi_disc_info_dac_v,
8784
 
          {"DAC_V", "scsi.disc_info.dac_v", FT_BOOLEAN, 8,
8785
 
           NULL, 0x10, "", HFILL}},
8786
 
        { &hf_scsi_disc_info_dbit,
8787
 
          {"Dbit", "scsi.disc_info.dbit", FT_BOOLEAN, 8,
8788
 
           NULL, 0x04, "", HFILL}},
8789
 
        { &hf_scsi_disc_info_bgfs,
8790
 
          {"BG Format Status", "scsi.disc_info.bgfs", FT_UINT8, BASE_HEX,
8791
 
           VALS(scsi_disc_info_bgfs_val), 0x03, "", HFILL}},
8792
 
        { &hf_scsi_disc_info_disc_type,
8793
 
          {"Disc Type", "scsi.disc_info.disc_type", FT_UINT8, BASE_HEX,
8794
 
           VALS(scsi_disc_info_disc_type_val), 0, "", HFILL}},
8795
 
        { &hf_scsi_disc_info_disc_identification,
8796
 
          {"Disc Identification", "scsi.disc_info.disc_identification", FT_UINT32, BASE_HEX,
8797
 
           NULL, 0, "", HFILL}},
8798
 
        { &hf_scsi_disc_info_last_session_lead_in_start_address,
8799
 
          {"Last Session Lead-In Start Address", "scsi.disc_info.last_session_lead_in_start_address", FT_UINT32, BASE_DEC,
8800
 
           NULL, 0, "", HFILL}},
8801
 
        { &hf_scsi_disc_info_last_possible_lead_out_start_address,
8802
 
          {"Last Possible Lead-Out Start Address", "scsi.disc_info.last_possible_lead_out_start_address", FT_UINT32, BASE_DEC,
8803
 
           NULL, 0, "", HFILL}},
8804
 
        { &hf_scsi_disc_info_disc_bar_code,
8805
 
          {"Disc Bar Code", "scsi.disc_info.disc_bar_code", FT_UINT64, BASE_HEX,
8806
 
           NULL, 0, "", HFILL}},
8807
 
        { &hf_sbc2_verify_lba,
8808
 
          {"LBA", "scsi.sbc2.verify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, "",
8809
 
           HFILL}},
8810
 
        { &hf_sbc2_verify_vlen,
8811
 
          {"Verification Length", "scsi.sbc2.verify.vlen", FT_UINT16,
8812
 
           BASE_DEC, NULL, 0x0, "", HFILL}},
8813
 
        { &hf_sbc2_verify_dpo,
8814
 
          {"DPO", "scsi.sbc2.verify.dpo", FT_BOOLEAN, BASE_HEX, NULL, 0x10, "",
8815
 
           HFILL}},
8816
 
        { &hf_sbc2_verify_blkvfy,
8817
 
          {"BLKVFY", "scsi.sbc2.verify.blkvfy", FT_BOOLEAN, BASE_HEX, NULL, 0x4,
8818
 
           "", HFILL}},
8819
 
        { &hf_sbc2_verify_bytchk,
8820
 
          {"BYTCHK", "scsi.sbc2.verify.bytchk", FT_BOOLEAN, BASE_HEX, NULL, 0x2,
8821
 
           "", HFILL}},
8822
 
        { &hf_sbc2_verify_reladdr,
8823
 
          {"RELADDR", "scsi.sbc2.verify.reladdr", FT_BOOLEAN, BASE_HEX, NULL,
8824
 
           0x1, "", HFILL}},
8825
 
        { &hf_sbc2_verify_vlen32,
8826
 
          {"Verification Length", "scsi.sbc2.verify.vlen32", FT_UINT32,
8827
 
           BASE_DEC, NULL, 0x0, "", HFILL}},
8828
 
        { &hf_sbc2_verify_lba64,
8829
 
          {"LBA", "scsi.sbc2.verify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0, "",
8830
 
           HFILL}},
8831
 
        { &hf_sbc2_wrverify_ebp,
8832
 
          {"EBP", "scsi.sbc2.wrverify.ebp", FT_BOOLEAN, BASE_HEX, NULL, 0x4, "",
8833
 
           HFILL}},
8834
 
        { &hf_sbc2_wrverify_lba,
8835
 
          {"LBA", "scsi.sbc2.wrverify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, "",
8836
 
           HFILL}},
8837
 
        { &hf_sbc2_wrverify_xferlen,
8838
 
          {"Transfer Length", "scsi.sbc2.wrverify.xferlen", FT_UINT16, BASE_DEC,
8839
 
           NULL, 0x0, "", HFILL}},
8840
 
        { &hf_sbc2_wrverify_lba64,
8841
 
          {"LBA", "scsi.sbc2.wrverify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0,
8842
 
           "", HFILL}},
8843
 
        { &hf_sbc2_wrverify_xferlen32,
8844
 
          {"Transfer Length", "scsi.sbc2.wrverify.xferlen32", FT_UINT32,
8845
 
           BASE_DEC, NULL, 0x0, "", HFILL}},
8846
 
        { &hf_ssc3_space6_count,
8847
 
          {"Count", "scsi.space6.count", FT_UINT24, BASE_DEC, NULL, 0x0,
8848
 
           "", HFILL}},
8849
 
        { &hf_ssc3_space16_count,
8850
 
          {"Count", "scsi.space16.count", FT_UINT64, BASE_DEC, NULL, 0x0,
8851
 
           "", HFILL}},
8852
 
        { &hf_ssc3_locate10_loid,
8853
 
          {"Logical Object Identifier", "scsi.locate10.loid", FT_UINT32, BASE_DEC, NULL, 0x0,
8854
 
           "", HFILL}},
8855
 
        { &hf_ssc3_locate16_loid,
8856
 
          {"Logical Identifier", "scsi.locate16.loid", FT_UINT64, BASE_DEC, NULL, 0x0,
8857
 
           "", HFILL}},
8858
4440
        { &hf_scsi_request_frame,
8859
4441
          { "Request in", "scsi.request_frame", FT_FRAMENUM, BASE_NONE, NULL, 0,
8860
4442
            "The request to this transaction is in this frame", HFILL }},
8904
4486
    static gint *ett[] = {
8905
4487
        &ett_scsi,
8906
4488
        &ett_scsi_page,
8907
 
        &ett_scsi_profile,
 
4489
        &ett_scsi_inq_peripheral,
8908
4490
        &ett_scsi_inq_acaflags,
 
4491
        &ett_scsi_inq_rmbflags,
8909
4492
        &ett_scsi_inq_sccsflags,
8910
4493
        &ett_scsi_inq_bqueflags,
8911
4494
        &ett_scsi_inq_reladrflags,
8927
4510
    prefs_register_enum_preference (scsi_module, "decode_scsi_messages_as",
8928
4511
                                    "Decode SCSI Messages As",
8929
4512
                                    "When Target Cannot Be Identified, Decode SCSI Messages As",
8930
 
                                    &scsi_def_devtype, 
8931
 
                                    scsi_devtype_options, 
 
4513
                                    &scsi_def_devtype,
 
4514
                                    scsi_devtype_options,
8932
4515
                                    FALSE);
8933
4516
 
8934
4517
    prefs_register_bool_preference(scsi_module, "defragment",