Removed some more "statement not reached" warnings.
[obnox/wireshark/wip.git] / epan / dissectors / packet-scsi-mmc.c
1 /* packet-scsi-mmc.c
2  * Ronnie Sahlberg 2006
3  * copied from packet-scsi.c
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 2002 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include <glib.h>
31 #include <string.h>
32 #include <epan/strutil.h>
33 #include <epan/packet.h>
34 #include <epan/prefs.h>
35 #include <epan/emem.h>
36 #include <epan/conversation.h>
37 #include <epan/tap.h>
38 #include "packet-scsi.h"
39 #include "packet-fc.h"
40 #include "packet-scsi-mmc.h"
41 #include "packet-scsi-sbc.h"
42
43
44 static int proto_scsi_mmc               = -1;
45 int hf_scsi_mmc_opcode                  = -1;
46 static int hf_scsi_mmc_setstreaming_type = -1;
47 static int hf_scsi_mmc_setstreaming_param_len = -1;
48 static int hf_scsi_mmc_setstreaming_wrc = -1;
49 static int hf_scsi_mmc_setstreaming_rdd = -1;
50 static int hf_scsi_mmc_setstreaming_exact = -1;
51 static int hf_scsi_mmc_setstreaming_ra = -1;
52 static int hf_scsi_mmc_setstreaming_start_lba = -1;
53 static int hf_scsi_mmc_setstreaming_end_lba = -1;
54 static int hf_scsi_mmc_setstreaming_read_size = -1;
55 static int hf_scsi_mmc_setstreaming_read_time = -1;
56 static int hf_scsi_mmc_setstreaming_write_size = -1;
57 static int hf_scsi_mmc_setstreaming_write_time = -1;
58 static int hf_scsi_mmc_setcdspeed_rc = -1;
59 static int hf_scsi_mmc_rbc_block = -1;
60 static int hf_scsi_mmc_rbc_lob_blocks = -1;
61 static int hf_scsi_mmc_rbc_alob_blocks = -1;
62 static int hf_scsi_mmc_rbc_lob_bytes = -1;
63 static int hf_scsi_mmc_rbc_alob_bytes = -1;
64 static int hf_scsi_mmc_rti_address_type = -1;
65 static int hf_scsi_mmc_rti_damage = -1;
66 static int hf_scsi_mmc_rti_copy = -1;
67 static int hf_scsi_mmc_rti_track_mode = -1;
68 static int hf_scsi_mmc_rti_rt = -1;
69 static int hf_scsi_mmc_rti_blank = -1;
70 static int hf_scsi_mmc_rti_packet = -1;
71 static int hf_scsi_mmc_rti_fp = -1;
72 static int hf_scsi_mmc_rti_data_mode = -1;
73 static int hf_scsi_mmc_rti_lra_v = -1;
74 static int hf_scsi_mmc_rti_nwa_v = -1;
75 static int hf_scsi_mmc_report_key_type_code = -1;
76 static int hf_scsi_mmc_report_key_vendor_resets = -1;
77 static int hf_scsi_mmc_report_key_user_changes = -1;
78 static int hf_scsi_mmc_report_key_region_mask = -1;
79 static int hf_scsi_mmc_report_key_rpc_scheme = -1;
80 static int hf_scsi_mmc_key_class = -1;
81 static int hf_scsi_mmc_key_format = -1;
82 static int hf_scsi_mmc_disc_info_erasable = -1;
83 static int hf_scsi_mmc_disc_info_state_of_last_session = -1;
84 static int hf_scsi_mmc_disc_info_disk_status = -1;
85 static int hf_scsi_mmc_disc_info_number_of_sessions = -1;
86 static int hf_scsi_mmc_disc_info_first_track_in_last_session = -1;
87 static int hf_scsi_mmc_disc_info_last_track_in_last_session = -1;
88 static int hf_scsi_mmc_disc_info_did_v = -1;
89 static int hf_scsi_mmc_disc_info_dbc_v = -1;
90 static int hf_scsi_mmc_disc_info_uru = -1;
91 static int hf_scsi_mmc_disc_info_dac_v = -1;
92 static int hf_scsi_mmc_disc_info_dbit = -1;
93 static int hf_scsi_mmc_disc_info_bgfs = -1;
94 static int hf_scsi_mmc_disc_info_disc_type = -1;
95 static int hf_scsi_mmc_disc_info_disc_identification = -1;
96 static int hf_scsi_mmc_disc_info_last_session_lead_in_start_address = -1;
97 static int hf_scsi_mmc_disc_info_last_possible_lead_out_start_address = -1;
98 static int hf_scsi_mmc_disc_info_disc_bar_code = -1;
99 static int hf_scsi_mmc_readtoc_time = -1;
100 static int hf_scsi_mmc_readtoc_format = -1;
101 static int hf_scsi_mmc_readtoc_first_session = -1;
102 static int hf_scsi_mmc_readtoc_last_track = -1;
103 static int hf_scsi_mmc_readtoc_last_session = -1;
104 static int hf_scsi_mmc_q_subchannel_adr = -1;
105 static int hf_scsi_mmc_q_subchannel_control = -1;
106 static int hf_scsi_mmc_agid = -1;
107 static int hf_scsi_mmc_track = -1;
108 static int hf_scsi_mmc_track_size = -1;
109 static int hf_scsi_mmc_track_start_address = -1;
110 static int hf_scsi_mmc_track_start_time = -1;
111 static int hf_scsi_mmc_lba             = -1;
112 static int hf_scsi_mmc_session = -1;
113 static int hf_scsi_mmc_data_length           = -1;
114 static int hf_scsi_mmc_getconf_rt = -1;
115 static int hf_scsi_mmc_getconf_starting_feature = -1;
116 static int hf_scsi_mmc_getconf_current_profile = -1;
117 static int hf_scsi_mmc_feature = -1;
118 static int hf_scsi_mmc_feature_version = -1;
119 static int hf_scsi_mmc_feature_persistent = -1;
120 static int hf_scsi_mmc_feature_current = -1;
121 static int hf_scsi_mmc_feature_additional_length = -1;
122 static int hf_scsi_mmc_feature_lun_sn = -1;
123 static int hf_scsi_mmc_feature_cdread_dap = -1;
124 static int hf_scsi_mmc_feature_cdread_c2flag = -1;
125 static int hf_scsi_mmc_feature_cdread_cdtext = -1;
126 static int hf_scsi_mmc_feature_dvdrw_write = -1;
127 static int hf_scsi_mmc_feature_dvdrw_quickstart = -1;
128 static int hf_scsi_mmc_feature_dvdrw_closeonly = -1;
129 static int hf_scsi_mmc_feature_dvdr_write = -1;
130 static int hf_scsi_mmc_feature_tao_buf = -1;
131 static int hf_scsi_mmc_feature_tao_rwraw = -1;
132 static int hf_scsi_mmc_feature_tao_rwpack = -1;
133 static int hf_scsi_mmc_feature_tao_testwrite = -1;
134 static int hf_scsi_mmc_feature_tao_cdrw = -1;
135 static int hf_scsi_mmc_feature_tao_rwsubcode = -1;
136 static int hf_scsi_mmc_feature_dts = -1;
137 static int hf_scsi_mmc_feature_sao_buf = -1;
138 static int hf_scsi_mmc_feature_sao_sao = -1;
139 static int hf_scsi_mmc_feature_sao_rawms = -1;
140 static int hf_scsi_mmc_feature_sao_raw = -1;
141 static int hf_scsi_mmc_feature_sao_testwrite = -1;
142 static int hf_scsi_mmc_feature_sao_cdrw = -1;
143 static int hf_scsi_mmc_feature_sao_rw = -1;
144 static int hf_scsi_mmc_feature_sao_mcsl = -1;
145 static int hf_scsi_mmc_feature_dvdr_buf = -1;
146 static int hf_scsi_mmc_feature_dvdr_testwrite = -1;
147 static int hf_scsi_mmc_feature_dvdr_dvdrw = -1;
148 static int hf_scsi_mmc_feature_profile = -1;
149 static int hf_scsi_mmc_feature_profile_current = -1;
150 static int hf_scsi_mmc_feature_isw_buf = -1;
151 static int hf_scsi_mmc_feature_isw_num_linksize = -1;
152 static int hf_scsi_mmc_feature_isw_linksize = -1;
153 static int hf_scsi_mmc_read_compatibility_lba             = -1;
154 static int hf_scsi_mmc_reservation_size = -1;
155 static int hf_scsi_mmc_last_recorded_address = -1;
156 static int hf_scsi_mmc_first_track = -1;
157 static int hf_scsi_mmc_fixed_packet_size = -1;
158 static int hf_scsi_mmc_synccache_immed = -1;
159 static int hf_scsi_mmc_synccache_reladr = -1;
160 static int hf_scsi_mmc_num_blocks      = -1;
161 static int hf_scsi_mmc_next_writable_address = -1;
162 static int hf_scsi_mmc_free_blocks = -1;
163
164
165 static gint ett_scsi_mmc_profile = -1;
166
167
168
169
170
171
172
173 static const value_string scsi_getconf_rt_val[] = {
174     {0x00,      "Return all features"},
175     {0x01,      "Return all current features"},
176     {0x02,      "Return all identified by Starting Feature"},
177     {0,NULL}
178 };
179 static const value_string scsi_getconf_current_profile_val[] = {
180     {0x0000,    "Reserved"},
181     {0x0001,    "Non-removable disk"},
182     {0x0002,    "Removable disk"},
183     {0x0003,    "MO Erasable"},
184     {0x0004,    "Optical Write Once"},
185     {0x0005,    "AS-MO"},
186     {0x0008,    "CD-ROM"},
187     {0x0009,    "CD-R"},
188     {0x000a,    "CD-RW"},
189     {0x0010,    "DVD-ROM"},
190     {0x0011,    "DVD-R"},
191     {0x0012,    "DVD-RAM"},
192     {0x0013,    "DVD-RW Restricted Overwrite"},
193     {0x0014,    "DVD-RW Sequential recording"},
194     {0x001a,    "DVD+RW"},
195     {0x001b,    "DVD+R"},
196     {0x0020,    "DDCD-ROM"},
197     {0x0021,    "DDCD-R"},
198     {0x0022,    "DDCD-RW"},
199     {0xffff,    "Logical unit not conforming to a standard profile"},
200     {0,NULL}
201 };
202
203 static const value_string scsi_feature_val[] = {
204     {0x0000,    "Profile List"},
205     {0x0001,    "Core"},
206     {0x0002,    "Morphing"},
207     {0x0003,    "Removable Medium"},
208     {0x0004,    "Write Protect"},
209     {0x0010,    "Random Readable"},
210     {0x001d,    "Multi-read"},
211     {0x001e,    "CD Read"},
212     {0x001f,    "DVD Read"},
213     {0x0020,    "Random Writeable"},
214     {0x0021,    "Incremental Streaming Writeable"},
215     {0x0022,    "Sector Erasable"},
216     {0x0023,    "Formattable"},
217     {0x0024,    "Defect Management"},
218     {0x0025,    "Write Once"},
219     {0x0026,    "Restricted Overwrite"},
220     {0x0027,    "CD-RW CAV Write"},
221     {0x0028,    "MRW"},
222     {0x0029,    "Enhanced Defect Reporting"},
223     {0x002a,    "DVD+RW"},
224     {0x002b,    "DVD+R"},
225     {0x002c,    "Rigid Restricted Overwrite"},
226     {0x002d,    "CD Track At Once"},
227     {0x002e,    "CD Mastering"},
228     {0x002f,    "DVD-R/-RW Write"},
229     {0x0030,    "DDCD Read"},
230     {0x0031,    "DDCD-R Write"},
231     {0x0032,    "DDCD-RW Write"},
232     {0x0037,    "CD-RW Media Write Support"},
233     {0x0100,    "Power Management"},
234     {0x0101,    "SMART"},
235     {0x0102,    "Embedded Changer"},
236     {0x0103,    "CD Audio analog play"},
237     {0x0104,    "Microcode Upgrade"},
238     {0x0105,    "Timeout"},
239     {0x0106,    "DVD-CSS"},
240     {0x0107,    "Real Time Streaming"},
241     {0x0108,    "Logical Unit serial number"},
242     {0x010a,    "Disc control Block"},
243     {0x010b,    "DVD CPRM"},
244     {0x010c,    "Firmware Information"},
245     {0,NULL}
246 };
247
248 static void
249 dissect_mmc4_getconfiguration (tvbuff_t *tvb, packet_info *pinfo _U_,
250                                proto_tree *tree, guint offset,
251                                gboolean isreq, gboolean iscdb,
252                                guint payload_len _U_,
253                                scsi_task_data_t *cdata _U_)
254
255 {
256     guint8 flags;
257     gint32 len;
258     guint old_offset;
259     tvbuff_t *volatile tvb_v = tvb;
260     volatile guint offset_v = offset;
261
262     if (tree && isreq && iscdb) {
263         proto_tree_add_item (tree, hf_scsi_mmc_getconf_rt, tvb_v, offset_v+0, 1, 0);
264         proto_tree_add_item (tree, hf_scsi_mmc_getconf_starting_feature, tvb_v, offset_v+1, 2, 0);
265
266         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb_v, offset_v+6, 2, 0);
267         /* we need the alloc_len in the response */
268         if(cdata){
269                 cdata->itlq->alloc_len=tvb_get_ntohs(tvb_v, offset_v+6);
270         }
271
272         flags = tvb_get_guint8 (tvb_v, offset_v+8);
273         proto_tree_add_uint_format (tree, hf_scsi_control, tvb_v, offset_v+8, 1,
274                                     flags,
275                                     "Vendor Unique = %u, NACA = %u, Link = %u",
276                                     flags & 0xC0, flags & 0x4, flags & 0x1);
277     }
278     if(!isreq) {
279         if(!cdata){
280                 return;
281         }
282
283         TRY_SCSI_CDB_ALLOC_LEN(pinfo, tvb_v, offset_v, cdata->itlq->alloc_len);
284
285         len=tvb_get_ntohl(tvb_v, offset_v+0);
286         proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb_v, offset_v, 4, 0);
287         proto_tree_add_item (tree, hf_scsi_mmc_getconf_current_profile, tvb_v, offset_v+6, 2, 0);
288         offset_v+=8;
289         len-=4;
290         while(len>0){
291                 guint16 feature;
292                 guint8 additional_length;
293                 guint8 num_linksize;
294
295                 feature=tvb_get_ntohs(tvb_v, offset_v);
296                 proto_tree_add_item (tree, hf_scsi_mmc_feature, tvb_v, offset_v, 2, 0);
297                 offset_v+=2;
298                 proto_tree_add_item (tree, hf_scsi_mmc_feature_version, tvb_v, offset_v, 1, 0);
299                 proto_tree_add_item (tree, hf_scsi_mmc_feature_persistent, tvb_v, offset_v, 1, 0);
300                 proto_tree_add_item (tree, hf_scsi_mmc_feature_current, tvb_v, offset_v, 1, 0);
301                 offset_v+=1;
302                 additional_length=tvb_get_guint8(tvb_v, offset_v);
303                 proto_tree_add_item (tree, hf_scsi_mmc_feature_additional_length, tvb_v, offset_v, 1, 0);
304                 offset_v+=1;
305                 old_offset=offset_v;
306                 switch(feature){
307                 case 0x0000: /* profile list */
308                     while(offset_v<(old_offset+additional_length)){
309                         proto_item *it=NULL;
310                         proto_tree *tr=NULL;
311                         guint16 profile;
312                         guint8  cur_profile;
313
314                         if(tree){
315                                 it=proto_tree_add_text(tree, tvb_v, offset_v, 4, "Profile:");
316                                 tr=proto_item_add_subtree(it, ett_scsi_mmc_profile);
317                         }
318
319                         profile=tvb_get_ntohs(tvb_v, offset_v);
320                         proto_tree_add_item (tr, hf_scsi_mmc_feature_profile, tvb_v, offset_v, 2, 0);
321                         proto_item_append_text(it, "%s", val_to_str(profile, scsi_getconf_current_profile_val, "Unknown 0x%04x"));
322
323                         cur_profile=tvb_get_guint8(tvb_v, offset_v+2);
324                         proto_tree_add_item (tr, hf_scsi_mmc_feature_profile_current, tvb_v, offset_v+2, 1, 0);
325                         if(cur_profile&0x01){
326                                 proto_item_append_text(it, "  [CURRENT PROFILE]");
327                         }
328
329                         offset_v+=4;
330                     }
331                     break;
332                 case 0x001d: /* multi-read */
333                 case 0x001f: /* dvd read feature */
334                     /* no data for this one */
335                     break;
336                 case 0x001e: /* cd read */
337                     proto_tree_add_item (tree, hf_scsi_mmc_feature_cdread_dap, tvb_v, offset_v, 1, 0);
338                     proto_tree_add_item (tree, hf_scsi_mmc_feature_cdread_c2flag, tvb_v, offset_v, 1, 0);
339                     proto_tree_add_item (tree, hf_scsi_mmc_feature_cdread_cdtext, tvb_v, offset_v, 1, 0);
340                     break;
341                 case 0x0021: /* incremental streaming writeable */
342                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dts, tvb_v, offset_v, 2, 0);
343                     offset_v+=2;
344                     proto_tree_add_item (tree, hf_scsi_mmc_feature_isw_buf, tvb_v, offset_v, 1, 0);
345                     offset_v+=1;
346                     num_linksize=tvb_get_guint8(tvb_v, offset_v);
347                     proto_tree_add_item (tree, hf_scsi_mmc_feature_isw_num_linksize, tvb_v, offset_v, 1, 0);
348                     offset_v+=1;
349                     while(num_linksize--){
350                         proto_tree_add_item (tree, hf_scsi_mmc_feature_isw_linksize, tvb_v, offset_v, 1, 0);
351                         offset_v+=1;
352                     }
353                     break;
354                 case 0x002a: /* dvd-rw */
355                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdrw_write, tvb_v, offset_v, 1, 0);
356                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdrw_quickstart, tvb_v, offset_v, 2, 0);
357                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdrw_closeonly, tvb_v, offset_v, 2, 0);
358                     break;
359                 case 0x002b: /* dvd-r */
360                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_write, tvb_v, offset_v, 1, 0);
361                     break;
362                 case 0x002d: /* track at once */
363                     proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_buf, tvb_v, offset_v, 1, 0);
364                     proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_rwraw, tvb_v, offset_v, 1, 0);
365                     proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_rwpack, tvb_v, offset_v, 1, 0);
366                     proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_testwrite, tvb_v, offset_v, 1, 0);
367                     proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_cdrw, tvb_v, offset_v, 1, 0);
368                     proto_tree_add_item (tree, hf_scsi_mmc_feature_tao_rwsubcode, tvb_v, offset_v, 1, 0);
369                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dts, tvb_v, offset_v+2, 2, 0);
370                     break;
371                 case 0x002e: /* session at once */
372                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_buf, tvb_v, offset_v, 1, 0);
373                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_sao, tvb_v, offset_v, 1, 0);
374                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_rawms, tvb_v, offset_v, 1, 0);
375                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_raw, tvb_v, offset_v, 1, 0);
376                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_testwrite, tvb_v, offset_v, 1, 0);
377                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_cdrw, tvb_v, offset_v, 1, 0);
378                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_rw, tvb_v, offset_v, 1, 0);
379                     proto_tree_add_item (tree, hf_scsi_mmc_feature_sao_mcsl, tvb_v, offset_v+1, 3, 0);
380                     break;
381                 case 0x002f: /* dvd-r/-rw*/
382                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_buf, tvb_v, offset_v, 1, 0);
383                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_testwrite, tvb_v, offset_v, 1, 0);
384                     proto_tree_add_item (tree, hf_scsi_mmc_feature_dvdr_dvdrw, tvb_v, offset_v, 1, 0);
385                     break;
386                 case 0x0108: /* logical unit serial number */
387                     proto_tree_add_item (tree, hf_scsi_mmc_feature_lun_sn, tvb_v, offset_v, additional_length, 0);
388                     break;
389                 default:
390                     proto_tree_add_text (tree, tvb_v, offset_v, additional_length,
391                         "SCSI/MMC Unknown Feature:0x%04x",feature);
392                     break;
393                 }
394                 old_offset+=additional_length;
395                 len-=4+additional_length;
396         }
397         END_TRY_SCSI_CDB_ALLOC_LEN;
398     }
399 }
400
401
402 static const value_string scsi_q_subchannel_adr_val[] = {
403     {0x0,       "Q-Subchannel mode info not supplied"},
404     {0x1,       "Q-Subchannel encodes current position data"},
405     {0x2,       "Q-Subchannel encodes media catalog number"},
406     {0x3,       "Q-Subchannel encodes ISRC"},
407     {0,NULL}
408 };
409 static const value_string scsi_q_subchannel_control_val[] = {
410     {0x0,       "2 Audio channels without pre-emphasis (digital copy prohibited)"},
411     {0x2,       "2 Audio channels without pre-emphasis (digital copy permitted)"},
412     {0x1,       "2 Audio channels with pre-emphasis of 50/15us (digital copy prohibited)"},
413     {0x3,       "2 Audio channels with pre-emphasis of 50/15us (digital copy permitted)"},
414     {0x8,       "audio channels without pre-emphasis (digital copy prohibited)"},
415     {0xa,       "audio channels without pre-emphasis (digital copy permitted)"},
416     {0x9,       "2 Audio channels with pre-emphasis of 50/15us (digital copy prohibited)"},
417     {0xb,       "2 Audio channels with pre-emphasis of 50/15us (digital copy permitted)"},
418     {0x4,       "Data track, recorded uninterrupted (digital copy prohibited)"},
419     {0x6,       "Data track, recorded uninterrupted (digital copy permitted)"},
420     {0x5,       "Data track, recorded incremental (digital copy prohibited)"},
421     {0x7,       "Data track, recorded incremental (digital copy permitted)"},
422     {0,NULL}
423 };
424
425 static void
426 dissect_mmc4_readtocpmaatip (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
427                      guint offset, gboolean isreq, gboolean iscdb,
428                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
429
430 {
431     guint8 flags, format;
432     gint16 len;
433
434     if (tree && isreq && iscdb) {
435         format=tvb_get_guint8(tvb, offset+1)&0x0f;
436         /* save format so we can decode the response */
437         cdata->itlq->flags=format;
438
439         switch(format){
440         case 0x00:
441         case 0x01:
442             proto_tree_add_item (tree, hf_scsi_mmc_readtoc_time, tvb, offset, 1, 0);
443             /* save time so we can pick it up in the response */
444             if(tvb_get_guint8(tvb, offset)&0x02){
445                 cdata->itlq->flags|=0x0100;
446             }
447             break;
448         }
449         proto_tree_add_item (tree, hf_scsi_mmc_readtoc_format, tvb, offset+1, 1, 0);
450
451         switch(format){
452         case 0x00:
453             proto_tree_add_item (tree, hf_scsi_mmc_track, tvb, offset+5, 1, 0);
454             /* save track so we can pick it up in the response */
455             cdata->itlq->flags|=0x0200;
456             break;
457         case 0x02:
458             proto_tree_add_item (tree, hf_scsi_mmc_session, tvb, offset+5, 1, 0);
459             /* save session so we can pick it up in the response */
460             cdata->itlq->flags|=0x0400;
461             break;
462         }
463
464         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
465
466         flags = tvb_get_guint8 (tvb, offset+8);
467         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
468                                     flags,
469                                     "Vendor Unique = %u, NACA = %u, Link = %u",
470                                     flags & 0xC0, flags & 0x4, flags & 0x1);
471
472     }
473     if(tree && (!isreq)) {
474         len=tvb_get_ntohs(tvb, offset);
475         proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, offset, 2, 0);
476         if(cdata->itlq->flags&0x0200){
477             proto_tree_add_item (tree, hf_scsi_mmc_first_track, tvb, offset+2, 1, 0);
478             proto_tree_add_item (tree, hf_scsi_mmc_readtoc_last_track, tvb, offset+3, 1, 0);
479         }
480         if(cdata->itlq->flags&0x0400){
481             proto_tree_add_item (tree, hf_scsi_mmc_readtoc_first_session, tvb, offset+2, 1, 0);
482             proto_tree_add_item (tree, hf_scsi_mmc_readtoc_last_session, tvb, offset+3, 1, 0);
483         }
484         offset+=4;
485         len-=2;
486         switch(cdata->itlq->flags&0x000f){
487         case 0x0:
488             while(len>0){
489                 proto_tree_add_item (tree, hf_scsi_mmc_q_subchannel_adr, tvb, offset+1, 1, 0);
490                 proto_tree_add_item (tree, hf_scsi_mmc_q_subchannel_control, tvb, offset+1, 1, 0);
491                 proto_tree_add_item (tree, hf_scsi_mmc_track, tvb, offset+2, 1, 0);
492                 if(cdata->itlq->flags&0x0100){
493                     proto_tree_add_item (tree, hf_scsi_mmc_track_start_time, tvb, offset+4, 4, 0);
494                 } else {
495                     proto_tree_add_item (tree, hf_scsi_mmc_track_start_address, tvb, offset+4, 4, 0);
496                 }
497                 offset+=8;
498                 len-=8;
499             }
500             break;
501         default:
502             proto_tree_add_text (tree, tvb, offset, len,
503                 "SCSI/MMC Unknown READ TOC Format:0x%04x",cdata->itlq->flags&0x000f);
504             break;
505         }
506     }
507 }
508
509 static const value_string scsi_disc_info_sols_val[] = {
510     {0x00,      "Empty Session"},
511     {0x01,      "Incomplete Session"},
512     {0x02,      "Reserved/Damaged Session"},
513     {0x03,      "Complete Session"},
514     {0,NULL}
515 };
516
517 static const value_string scsi_disc_info_disc_status_val[] = {
518     {0x00,      "Empty Disc"},
519     {0x01,      "Incomplete Disc"},
520     {0x02,      "Finalized Disc"},
521     {0x03,      "Others"},
522     {0,NULL}
523 };
524
525 static const value_string scsi_disc_info_bgfs_val[] = {
526     {0x00,      "Blank or not CD-RW/DVD-RW"},
527     {0x01,      "Background Format started but is not running nor complete"},
528     {0x02,      "Backgroung Format in progress"},
529     {0x03,      "Backgroung Format has completed"},
530     {0,NULL}
531 };
532
533 static const value_string scsi_disc_info_disc_type_val[] = {
534     {0x00,      "CD-DA or CD-ROM Disc"},
535     {0x10,      "CD-I Disc"},
536     {0x20,      "CD-ROM XA Disc or DDCD"},
537     {0xff,      "Undefined"},
538     {0,NULL}
539 };
540
541 static void
542 dissect_mmc4_readdiscinformation (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
543                      guint offset, gboolean isreq, gboolean iscdb,
544                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
545
546 {
547     guint8 flags;
548
549     if (tree && isreq && iscdb) {
550         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
551
552         flags = tvb_get_guint8 (tvb, offset+8);
553         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
554                                     flags,
555                                     "Vendor Unique = %u, NACA = %u, Link = %u",
556                                     flags & 0xC0, flags & 0x4, flags & 0x1);
557
558     }
559     if(tree && (!isreq)) {
560         proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, 0, 2, 0);
561         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_erasable, tvb, 2, 1, 0);
562         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_state_of_last_session, tvb, 2, 1, 0);
563         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disk_status, tvb, 2, 1, 0);
564         proto_tree_add_item (tree, hf_scsi_mmc_first_track, tvb, offset+3, 1, 0);
565         /* number of session  offset+4 and offset+9 */
566         proto_tree_add_uint (tree, hf_scsi_mmc_disc_info_number_of_sessions, tvb, 4, 1, (tvb_get_guint8(tvb, offset+9)<<8)|tvb_get_guint8(tvb, offset+4));
567         /* first track in last session  offset+5 and offset+10 */
568         proto_tree_add_uint (tree, hf_scsi_mmc_disc_info_first_track_in_last_session, tvb, 5, 1, (tvb_get_guint8(tvb, offset+10)<<8)|tvb_get_guint8(tvb, offset+5));
569         /*  last track in last session  offset+6 and offset+11 */
570         proto_tree_add_uint (tree, hf_scsi_mmc_disc_info_last_track_in_last_session, tvb, 6, 1, (tvb_get_guint8(tvb, offset+11)<<8)|tvb_get_guint8(tvb, offset+6));
571         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_did_v, tvb, offset+7, 1, 0);
572         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_dbc_v, tvb, offset+7, 1, 0);
573         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_uru, tvb, offset+7, 1, 0);
574         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_dac_v, tvb, offset+7, 1, 0);
575         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_dbit, tvb, offset+7, 1, 0);
576         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_bgfs, tvb, offset+7, 1, 0);
577         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disc_type, tvb, offset+8, 1, 0);
578         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disc_identification, tvb, offset+12, 4, 0);
579         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_last_session_lead_in_start_address, tvb, offset+16, 4, 0);
580         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_last_possible_lead_out_start_address, tvb, offset+20, 4, 0);
581         proto_tree_add_item (tree, hf_scsi_mmc_disc_info_disc_bar_code, tvb, offset+24, 8, 0);
582         /* XXX should add OPC table decoding here ... */
583     }
584 }
585
586 static void
587 dissect_mmc4_readdiscstructure (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
588                      guint offset, gboolean isreq, gboolean iscdb,
589                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
590
591 {
592     guint8 flags;
593
594     if (tree && isreq && iscdb) {
595         proto_tree_add_text (tree, tvb, offset+1, 4,
596                              "Address: %u",
597                              tvb_get_ntohl (tvb, offset+1));
598
599         proto_tree_add_text (tree, tvb, offset+5, 1,
600                              "Layer Number: %u",
601                              tvb_get_guint8 (tvb, offset+5));
602
603         proto_tree_add_text (tree, tvb, offset+6, 1,
604                              "Format Code: %u",
605                              tvb_get_guint8 (tvb, offset+6));
606
607         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+7, 2, 0);
608
609         flags = tvb_get_guint8 (tvb, offset+9);
610         proto_tree_add_text (tree, tvb, offset+9, 1,
611                              "AGID: %u",
612                              flags & 0xc0);
613
614         flags = tvb_get_guint8 (tvb, offset+10);
615         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
616                                     flags,
617                                     "Vendor Unique = %u, NACA = %u, Link = %u",
618                                     flags & 0xC0, flags & 0x4, flags & 0x1);
619     }
620 }
621
622 static void
623 dissect_mmc4_getperformance (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
624                      guint offset, gboolean isreq, gboolean iscdb,
625                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
626
627 {
628     guint8 flags;
629
630     if (tree && isreq && iscdb) {
631         flags = tvb_get_guint8 (tvb, offset);
632         proto_tree_add_text (tree, tvb, offset, 1,
633                              "Data Type: %u",
634                              flags & 0x1f);
635
636         proto_tree_add_text (tree, tvb, offset+1, 4,
637                              "Starting LBA: %u",
638                              tvb_get_ntohl (tvb, offset+1));
639
640         proto_tree_add_text (tree, tvb, offset+7, 2,
641                              "Maximum Number of Descriptors: %u",
642                              tvb_get_ntohs (tvb, offset+7));
643
644         flags = tvb_get_guint8 (tvb, offset+9);
645         proto_tree_add_text (tree, tvb, offset+9, 1,
646                              "Type: %u",
647                              flags);
648
649         flags = tvb_get_guint8 (tvb, offset+10);
650         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
651                                     flags,
652                                     "Vendor Unique = %u, NACA = %u, Link = %u",
653                                     flags & 0xC0, flags & 0x4, flags & 0x1);
654
655     }
656 }
657
658 static void
659 dissect_mmc4_synchronizecache (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
660                      guint offset, gboolean isreq, gboolean iscdb,
661                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
662
663 {
664     guint8 flags;
665
666     if (tree && isreq && iscdb) {
667         proto_tree_add_item (tree, hf_scsi_mmc_synccache_immed, tvb, offset, 1, 0);
668         proto_tree_add_item (tree, hf_scsi_mmc_synccache_reladr, tvb, offset, 1, 0);
669         proto_tree_add_item (tree, hf_scsi_mmc_lba, tvb, offset+1, 4, 0);
670         proto_tree_add_item (tree, hf_scsi_mmc_num_blocks, tvb, offset+6, 2, 0);
671
672         flags = tvb_get_guint8 (tvb, offset+8);
673         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
674                                     flags,
675                                     "Vendor Unique = %u, NACA = %u, Link = %u",
676                                     flags & 0xC0, flags & 0x4, flags & 0x1);
677
678     }
679 }
680
681 static const value_string scsi_key_class_val[] = {
682     {0x00, "DVD CSS/CPPM or CPRM"},
683     {0x01, "ReWriteable Security Service - A"},
684     {0,NULL}
685 };
686 static const value_string scsi_key_format_val[] = {
687     {0x00,      "AGID for CSS/CPPM"},
688     {0x01,      "Challenge Key"},
689     {0x02,      "Key 1"},
690     {0x04,      "Title Key"},
691     {0x05,      "Authentication Success Flag"},
692     {0x08,      "RPC State"},
693     {0x11,      "AGID for CPRM"},
694     {0x3f,      "None"},
695     {0,NULL}
696 };
697 static const value_string scsi_report_key_type_code_val[] = {
698     {0x00,      "NONE"},
699     {0x01,      "SET"},
700     {0x02,      "LAST CHANCE"},
701     {0x03,      "PERM"},
702     {0,NULL}
703 };
704 static const value_string scsi_report_key_rpc_scheme_val[] = {
705     {0x00,      "Unknown (RPC not enforced)"},
706     {0x01,      "RPC Phase II"},
707     {0,NULL}
708 };
709
710 static void
711 dissect_mmc4_reportkey (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
712                      guint offset, gboolean isreq, gboolean iscdb,
713                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
714
715 {
716     guint8 flags, agid, key_format, key_class;
717     proto_item *ti;
718
719     if (tree && isreq && iscdb) {
720         proto_tree_add_item (tree, hf_scsi_mmc_lba, tvb, offset+1,
721                              4, 0);
722         key_class=tvb_get_guint8(tvb, offset+6);
723         proto_tree_add_item (tree, hf_scsi_mmc_key_class, tvb, offset+6,
724                              1, 0);
725         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+7, 2, 0);
726
727         agid=tvb_get_guint8(tvb, offset+9)&0xc0;
728         key_format=tvb_get_guint8(tvb, offset+9)&0x3f;
729         switch(key_format){
730         case 0x01:
731         case 0x02:
732         case 0x04:
733         case 0x3f:
734             /* agid is only valid for some formats */
735             proto_tree_add_uint (tree, hf_scsi_mmc_agid, tvb, offset+9, 1, agid);
736             break;
737         }
738         proto_tree_add_uint (tree, hf_scsi_mmc_key_format, tvb, offset+9, 1, key_format);
739         /* save key_class/key_format so we can decode the response */
740         cdata->itlq->flags=(key_format<<8)|key_class;
741
742         flags = tvb_get_guint8 (tvb, offset+14);
743         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+14, 1,
744                                     flags,
745                                     "Vendor Unique = %u, NACA = %u, Link = %u",
746                                     flags & 0xC0, flags & 0x4, flags & 0x1);
747     }
748     if(tree && (!isreq)) {
749         switch(cdata->itlq->flags){
750         case 0x0800: /* format:RPC State  class:00 */
751             proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, offset, 2, 0);
752             proto_tree_add_item (tree, hf_scsi_mmc_report_key_type_code, tvb, offset+4, 1, 0);
753             proto_tree_add_item (tree, hf_scsi_mmc_report_key_vendor_resets, tvb, offset+4, 1, 0);
754             proto_tree_add_item (tree, hf_scsi_mmc_report_key_user_changes, tvb, offset+4, 1, 0);
755             proto_tree_add_item (tree, hf_scsi_mmc_report_key_region_mask, tvb, offset+5, 1, 0);
756             proto_tree_add_item (tree, hf_scsi_mmc_report_key_rpc_scheme, tvb, offset+6, 1, 0);
757             break;
758         default:
759             ti = proto_tree_add_text (tree, tvb, 0, 0,
760                 "SCSI/MMC Unknown Format:0x%02x/Class:0x%02x combination",
761                 cdata->itlq->flags>>8,cdata->itlq->flags&0xff);
762             PROTO_ITEM_SET_GENERATED(ti);
763             break;
764         }
765     }
766 }
767
768 static const value_string scsi_rti_address_type_val[] = {
769     {0x00,      "Logical Block Address"},
770     {0x01,      "Logical Track Number"},
771     {0x02,      "Session Number"},
772     {0,NULL}
773 };
774
775 static void
776 dissect_mmc4_readtrackinformation (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
777                      guint offset, gboolean isreq, gboolean iscdb,
778                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
779
780 {
781     guint8 flags, addresstype;
782
783     if (tree && isreq && iscdb) {
784         addresstype=tvb_get_guint8(tvb, offset)&0x03;
785         proto_tree_add_item (tree, hf_scsi_mmc_rti_address_type, tvb, offset+0, 1, 0);
786         switch(addresstype){
787         case 0x00: /* logical block address */
788             proto_tree_add_item (tree, hf_scsi_mmc_lba, tvb, offset+1,
789                              4, 0);
790             break;
791         case 0x01: /* logical track number */
792             proto_tree_add_item (tree, hf_scsi_mmc_track, tvb, offset+1,
793                              4, 0);
794             break;
795         case 0x02: /* logical session number */
796             proto_tree_add_item (tree, hf_scsi_mmc_session, tvb, offset+1,
797                              4, 0);
798             break;
799         }
800
801         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
802
803         flags = tvb_get_guint8 (tvb, offset+8);
804         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
805                                     flags,
806                                     "Vendor Unique = %u, NACA = %u, Link = %u",
807                                     flags & 0xC0, flags & 0x4, flags & 0x1);
808
809     }
810     if(tree && (!isreq)) {
811         proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, 0, 2, 0);
812         /* track  offset+2 and offset+32 */
813         proto_tree_add_uint (tree, hf_scsi_mmc_track, tvb, 2, 1, (tvb_get_guint8(tvb, offset+32)<<8)|tvb_get_guint8(tvb, offset+2));
814         /* session  offset+3 and offset+33 */
815         proto_tree_add_uint (tree, hf_scsi_mmc_session, tvb, 3, 1, (tvb_get_guint8(tvb, offset+33)<<8)|tvb_get_guint8(tvb, offset+3));
816         proto_tree_add_item (tree, hf_scsi_mmc_rti_damage, tvb, 5, 1, 0);
817         proto_tree_add_item (tree, hf_scsi_mmc_rti_copy, tvb, 5, 1, 0);
818         proto_tree_add_item (tree, hf_scsi_mmc_rti_track_mode, tvb, 5, 1, 0);
819         proto_tree_add_item (tree, hf_scsi_mmc_rti_rt, tvb, 6, 1, 0);
820         proto_tree_add_item (tree, hf_scsi_mmc_rti_blank, tvb, 6, 1, 0);
821         proto_tree_add_item (tree, hf_scsi_mmc_rti_packet, tvb, 6, 1, 0);
822         proto_tree_add_item (tree, hf_scsi_mmc_rti_fp, tvb, 6, 1, 0);
823         proto_tree_add_item (tree, hf_scsi_mmc_rti_data_mode, tvb, 6, 1, 0);
824         proto_tree_add_item (tree, hf_scsi_mmc_rti_lra_v, tvb, 7, 1, 0);
825         proto_tree_add_item (tree, hf_scsi_mmc_rti_nwa_v, tvb, 7, 1, 0);
826         proto_tree_add_item (tree, hf_scsi_mmc_track_start_address, tvb, offset+8, 4, 0);
827         proto_tree_add_item (tree, hf_scsi_mmc_next_writable_address, tvb, offset+12, 4, 0);
828         proto_tree_add_item (tree, hf_scsi_mmc_free_blocks, tvb, offset+16, 4, 0);
829         proto_tree_add_item (tree, hf_scsi_mmc_fixed_packet_size, tvb, offset+20, 4, 0);
830         proto_tree_add_item (tree, hf_scsi_mmc_track_size, tvb, offset+24, 4, 0);
831         proto_tree_add_item (tree, hf_scsi_mmc_last_recorded_address, tvb, offset+28, 4, 0);
832         proto_tree_add_item (tree, hf_scsi_mmc_read_compatibility_lba, tvb, offset+36, 4, 0);
833     }
834 }
835
836 static void
837 dissect_mmc4_geteventstatusnotification (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
838                      guint offset, gboolean isreq, gboolean iscdb,
839                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
840
841 {
842     guint8 flags;
843
844     if (tree && isreq && iscdb) {
845         flags = tvb_get_guint8 (tvb, offset);
846         proto_tree_add_text (tree, tvb, offset, 1,
847                              "Polled: %u",
848                              flags & 0x01);
849
850         flags = tvb_get_guint8 (tvb, offset+3);
851         proto_tree_add_text (tree, tvb, offset+3, 1,
852                              "Notification Class Request: %u",
853                              flags);
854
855         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
856
857         flags = tvb_get_guint8 (tvb, offset+8);
858         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
859                                     flags,
860                                     "Vendor Unique = %u, NACA = %u, Link = %u",
861                                     flags & 0xC0, flags & 0x4, flags & 0x1);
862     }
863 }
864
865
866 static void
867 dissect_mmc4_reservetrack (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
868                      guint offset, gboolean isreq, gboolean iscdb,
869                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
870
871 {
872     guint8 flags;
873
874     if (tree && isreq && iscdb) {
875         proto_tree_add_item (tree, hf_scsi_mmc_reservation_size, tvb, offset+4, 4, 0);
876
877         flags = tvb_get_guint8 (tvb, offset+8);
878         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
879                                     flags,
880                                     "Vendor Unique = %u, NACA = %u, Link = %u",
881                                     flags & 0xC0, flags & 0x4, flags & 0x1);
882
883     }
884 }
885
886
887 static void
888 dissect_mmc4_readbuffercapacity (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
889                      guint offset, gboolean isreq, gboolean iscdb,
890                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
891
892 {
893     guint8 flags;
894     gint16 len;
895
896     if (tree && isreq && iscdb) {
897         cdata->itlq->flags=0;
898         proto_tree_add_item (tree, hf_scsi_mmc_rbc_block, tvb, offset, 1, 0);
899         if(tvb_get_guint8(tvb, offset)&0x01){
900             cdata->itlq->flags=1;
901         }
902
903         proto_tree_add_item (tree, hf_scsi_alloclen16, tvb, offset+6, 2, 0);
904
905         flags = tvb_get_guint8 (tvb, offset+8);
906         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
907                                     flags,
908                                     "Vendor Unique = %u, NACA = %u, Link = %u",
909                                     flags & 0xC0, flags & 0x4, flags & 0x1);
910
911     }
912     if(tree && (!isreq)) {
913         len=tvb_get_ntohs(tvb, offset);
914         proto_tree_add_item (tree, hf_scsi_mmc_data_length, tvb, offset, 2, 0);
915         if(cdata->itlq->flags){
916             proto_tree_add_item (tree, hf_scsi_mmc_rbc_lob_blocks, tvb, offset+4, 4, 0);
917             proto_tree_add_item (tree, hf_scsi_mmc_rbc_alob_blocks, tvb, offset+8, 4, 0);
918         } else {
919             proto_tree_add_item (tree, hf_scsi_mmc_rbc_lob_bytes, tvb, offset+4, 4, 0);
920             proto_tree_add_item (tree, hf_scsi_mmc_rbc_alob_bytes, tvb, offset+8, 4, 0);
921         }
922     }
923 }
924
925
926 static const value_string scsi_setcdspeed_rc_val[] = {
927     {0x00,      "CLV and none-pure CAV"},
928     {0x01,      "Pure CAV"},
929     {0x02,      "Reserved"},
930     {0x03,      "Reserved"},
931     {0,NULL}
932 };
933
934 static void
935 dissect_mmc4_setcdspeed (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
936                      guint offset, gboolean isreq, gboolean iscdb,
937                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
938
939 {
940     guint8 flags;
941
942     if (tree && isreq && iscdb) {
943         proto_tree_add_item (tree, hf_scsi_mmc_setcdspeed_rc, tvb, offset+0, 1, 0);
944
945         proto_tree_add_text (tree, tvb, offset+1, 2,
946                              "Logical Unit Read Speed(bytes/sec): %u",
947                              tvb_get_ntohs (tvb, offset+1));
948         proto_tree_add_text (tree, tvb, offset+3, 2,
949                              "Logical Unit Write Speed(bytes/sec): %u",
950                              tvb_get_ntohs (tvb, offset+3));
951
952         flags = tvb_get_guint8 (tvb, offset+10);
953         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
954                                     flags,
955                                     "Vendor Unique = %u, NACA = %u, Link = %u",
956                                     flags & 0xC0, flags & 0x4, flags & 0x1);
957     }
958 }
959
960
961 static const value_string scsi_setstreaming_type_val[] = {
962     {0x00,      "Performance Descriptor"},
963     {0x05,      "DBI cache zone descriptor"},
964     {0,NULL}
965 };
966
967 static void
968 dissect_mmc4_setstreaming (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
969                      guint offset, gboolean isreq, gboolean iscdb,
970                      guint payload_len _U_, scsi_task_data_t *cdata _U_)
971
972 {
973     guint8 flags, type;
974     proto_item *ti;
975
976     if (tree && isreq && iscdb) {
977         type=tvb_get_guint8(tvb, offset+7);
978         cdata->itlq->flags=type;
979         proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_type, tvb, offset+7, 1, 0);
980         proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_param_len, tvb, offset+8, 2, 0);
981
982         flags = tvb_get_guint8 (tvb, offset+10);
983         proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+10, 1,
984                                     flags,
985                                     "Vendor Unique = %u, NACA = %u, Link = %u",
986                                     flags & 0xC0, flags & 0x4, flags & 0x1);
987     }
988     if(tree && isreq && (!iscdb)) {
989         switch(cdata->itlq->flags){
990         case 0x00: /* performance descriptor */
991             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_wrc, tvb, offset+0, 1, 0);
992             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_rdd, tvb, offset+0, 1, 0);
993             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_exact, tvb, offset+0, 1, 0);
994             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_ra, tvb, offset+0, 1, 0);
995             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_start_lba, tvb, offset+4, 4, 0);
996             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_end_lba, tvb, offset+8, 4, 0);
997             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_read_size, tvb, offset+12, 4, 0);
998             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_read_time, tvb, offset+16, 4, 0);
999             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_write_size, tvb, offset+20, 4, 0);
1000             proto_tree_add_item (tree, hf_scsi_mmc_setstreaming_write_time, tvb, offset+24, 4, 0);
1001             break;
1002         default:
1003             ti = proto_tree_add_text (tree, tvb, 0, 0,
1004                 "SCSI/MMC Unknown SetStreaming Type:0x%02x",cdata->itlq->flags);
1005             PROTO_ITEM_SET_GENERATED(ti);
1006             break;
1007         }
1008     }
1009 }
1010
1011
1012 /* MMC Commands */
1013 #define SCSI_MMC4_READCAPACITY10         0x25
1014 #define SCSI_MMC4_READ10                 0x28
1015 #define SCSI_MMC4_WRITE10                0x2a
1016 #define SCSI_MMC4_SYNCHRONIZECACHE       0x35
1017 #define SCSI_MMC4_READTOCPMAATIP         0x43
1018 #define SCSI_MMC4_GETCONFIGURATION       0x46
1019 #define SCSI_MMC4_GETEVENTSTATUSNOTIFY   0x4a
1020 #define SCSI_MMC4_READDISCINFORMATION    0x51
1021 #define SCSI_MMC4_READTRACKINFORMATION   0x52
1022 #define SCSI_MMC4_RESERVETRACK           0x53
1023 #define SCSI_MMC4_READBUFFERCAPACITY     0x5c
1024 #define SCSI_MMC4_REPORTKEY             0xa4
1025 #define SCSI_MMC4_READ12                 0xa8
1026 #define SCSI_MMC4_WRITE12                0xaa
1027 #define SCSI_MMC4_GETPERFORMANCE         0xac
1028 #define SCSI_MMC4_READDISCSTRUCTURE      0xad
1029 #define SCSI_MMC4_SETSTREAMING           0xb6
1030 #define SCSI_MMC4_SETCDSPEED             0xbb
1031 const value_string scsi_mmc_vals[] = {
1032     {SCSI_MMC4_GETCONFIGURATION      , "Get Configuraion"},
1033     {SCSI_MMC4_GETEVENTSTATUSNOTIFY  , "Get Event Status Notification"},
1034     {SCSI_MMC4_GETPERFORMANCE        , "Get Performance"},
1035     {SCSI_SPC_INQUIRY               , "Inquiry"},
1036     {SCSI_SPC_MODESELECT10          , "Mode Select(10)"},
1037     {SCSI_SPC_MODESENSE10           , "Mode Sense(10)"},
1038     {SCSI_SPC_PREVMEDREMOVAL        , "Prevent/Allow Medium Removal"},
1039     {SCSI_MMC4_READ10                , "Read(10)"},
1040     {SCSI_MMC4_READ12                , "Read(12)"},
1041     {SCSI_MMC4_READBUFFERCAPACITY    , "Read Buffer Capacity"},
1042     {SCSI_MMC4_READCAPACITY10        , "Read Capacity(10)"},
1043     {SCSI_MMC4_READDISCINFORMATION   , "Read Disc Information"},
1044     {SCSI_MMC4_READDISCSTRUCTURE     , "Read DISC Structure"},
1045     {SCSI_MMC4_READTOCPMAATIP        , "Read TOC/PMA/ATIP"},
1046     {SCSI_MMC4_READTRACKINFORMATION  , "Read Track Information"},
1047     {SCSI_MMC4_REPORTKEY             , "Report Key"},
1048     {SCSI_SPC_REPORTLUNS            , "Report LUNs"},
1049     {SCSI_SPC_REQSENSE              , "Request Sense"},
1050     {SCSI_MMC4_RESERVETRACK          , "Reserve Track"},
1051     {SCSI_MMC4_SETCDSPEED            , "Set CD Speed"},
1052     {SCSI_MMC4_SETSTREAMING          , "Set Streaming"},
1053     {SCSI_SBC_STARTSTOPUNIT          , "Start Stop Unit"},
1054     {SCSI_MMC4_SYNCHRONIZECACHE      , "Synchronize Cache"},
1055     {SCSI_SPC_TESTUNITRDY           , "Test Unit Ready"},
1056     {SCSI_MMC4_WRITE10               , "Write(10)"},
1057     {SCSI_MMC4_WRITE12               , "Write(12)"},
1058     {SCSI_SPC_WRITEBUFFER           , "Write Buffer"},
1059     {0, NULL},
1060 };
1061
1062
1063 scsi_cdb_table_t scsi_mmc_table[256] = {
1064 /*SPC 0x00*/{dissect_spc_testunitready},
1065 /*MMC 0x01*/{NULL},
1066 /*MMC 0x02*/{NULL},
1067 /*SPC 0x03*/{dissect_spc_requestsense},
1068 /*MMC 0x04*/{NULL},
1069 /*MMC 0x05*/{NULL},
1070 /*MMC 0x06*/{NULL},
1071 /*MMC 0x07*/{NULL},
1072 /*MMC 0x08*/{NULL},
1073 /*MMC 0x09*/{NULL},
1074 /*MMC 0x0a*/{NULL},
1075 /*MMC 0x0b*/{NULL},
1076 /*MMC 0x0c*/{NULL},
1077 /*MMC 0x0d*/{NULL},
1078 /*MMC 0x0e*/{NULL},
1079 /*MMC 0x0f*/{NULL},
1080 /*MMC 0x10*/{NULL},
1081 /*MMC 0x11*/{NULL},
1082 /*SPC 0x12*/{dissect_spc_inquiry},
1083 /*MMC 0x13*/{NULL},
1084 /*MMC 0x14*/{NULL},
1085 /*MMC 0x15*/{NULL},
1086 /*MMC 0x16*/{NULL},
1087 /*MMC 0x17*/{NULL},
1088 /*MMC 0x18*/{NULL},
1089 /*MMC 0x19*/{NULL},
1090 /*MMC 0x1a*/{NULL},
1091 /*MMC 0x1b*/{dissect_sbc_startstopunit},
1092 /*MMC 0x1c*/{NULL},
1093 /*MMC 0x1d*/{NULL},
1094 /*MMC 0x1e*/{dissect_spc_preventallowmediaremoval},
1095 /*MMC 0x1f*/{NULL},
1096 /*MMC 0x20*/{NULL},
1097 /*MMC 0x21*/{NULL},
1098 /*MMC 0x22*/{NULL},
1099 /*MMC 0x23*/{NULL},
1100 /*MMC 0x24*/{NULL},
1101 /*MMC 0x25*/{dissect_sbc_readcapacity10},
1102 /*MMC 0x26*/{NULL},
1103 /*MMC 0x27*/{NULL},
1104 /*MMC 0x28*/{dissect_sbc_read10},
1105 /*MMC 0x29*/{NULL},
1106 /*MMC 0x2a*/{dissect_sbc_write10},
1107 /*MMC 0x2b*/{NULL},
1108 /*MMC 0x2c*/{NULL},
1109 /*MMC 0x2d*/{NULL},
1110 /*MMC 0x2e*/{NULL},
1111 /*MMC 0x2f*/{NULL},
1112 /*MMC 0x30*/{NULL},
1113 /*MMC 0x31*/{NULL},
1114 /*MMC 0x32*/{NULL},
1115 /*MMC 0x33*/{NULL},
1116 /*MMC 0x34*/{NULL},
1117 /*MMC 0x35*/{dissect_mmc4_synchronizecache},
1118 /*MMC 0x36*/{NULL},
1119 /*MMC 0x37*/{NULL},
1120 /*MMC 0x38*/{NULL},
1121 /*MMC 0x39*/{NULL},
1122 /*MMC 0x3a*/{NULL},
1123 /*SPC 0x3b*/{dissect_spc_writebuffer},
1124 /*MMC 0x3c*/{NULL},
1125 /*MMC 0x3d*/{NULL},
1126 /*MMC 0x3e*/{NULL},
1127 /*MMC 0x3f*/{NULL},
1128 /*MMC 0x40*/{NULL},
1129 /*MMC 0x41*/{NULL},
1130 /*MMC 0x42*/{NULL},
1131 /*MMC 0x43*/{dissect_mmc4_readtocpmaatip},
1132 /*MMC 0x44*/{NULL},
1133 /*MMC 0x45*/{NULL},
1134 /*MMC 0x46*/{dissect_mmc4_getconfiguration},
1135 /*MMC 0x47*/{NULL},
1136 /*MMC 0x48*/{NULL},
1137 /*MMC 0x49*/{NULL},
1138 /*MMC 0x4a*/{dissect_mmc4_geteventstatusnotification},
1139 /*MMC 0x4b*/{NULL},
1140 /*MMC 0x4c*/{NULL},
1141 /*MMC 0x4d*/{NULL},
1142 /*MMC 0x4e*/{NULL},
1143 /*MMC 0x4f*/{NULL},
1144 /*MMC 0x50*/{NULL},
1145 /*MMC 0x51*/{dissect_mmc4_readdiscinformation},
1146 /*MMC 0x52*/{dissect_mmc4_readtrackinformation},
1147 /*MMC 0x53*/{dissect_mmc4_reservetrack},
1148 /*MMC 0x54*/{NULL},
1149 /*SPC 0x55*/{dissect_spc_modeselect10},
1150 /*MMC 0x56*/{NULL},
1151 /*MMC 0x57*/{NULL},
1152 /*MMC 0x58*/{NULL},
1153 /*MMC 0x59*/{NULL},
1154 /*SPC 0x5a*/{dissect_spc_modesense10},
1155 /*MMC 0x5b*/{NULL},
1156 /*MMC 0x5c*/{dissect_mmc4_readbuffercapacity},
1157 /*MMC 0x5d*/{NULL},
1158 /*MMC 0x5e*/{NULL},
1159 /*MMC 0x5f*/{NULL},
1160 /*MMC 0x60*/{NULL},
1161 /*MMC 0x61*/{NULL},
1162 /*MMC 0x62*/{NULL},
1163 /*MMC 0x63*/{NULL},
1164 /*MMC 0x64*/{NULL},
1165 /*MMC 0x65*/{NULL},
1166 /*MMC 0x66*/{NULL},
1167 /*MMC 0x67*/{NULL},
1168 /*MMC 0x68*/{NULL},
1169 /*MMC 0x69*/{NULL},
1170 /*MMC 0x6a*/{NULL},
1171 /*MMC 0x6b*/{NULL},
1172 /*MMC 0x6c*/{NULL},
1173 /*MMC 0x6d*/{NULL},
1174 /*MMC 0x6e*/{NULL},
1175 /*MMC 0x6f*/{NULL},
1176 /*MMC 0x70*/{NULL},
1177 /*MMC 0x71*/{NULL},
1178 /*MMC 0x72*/{NULL},
1179 /*MMC 0x73*/{NULL},
1180 /*MMC 0x74*/{NULL},
1181 /*MMC 0x75*/{NULL},
1182 /*MMC 0x76*/{NULL},
1183 /*MMC 0x77*/{NULL},
1184 /*MMC 0x78*/{NULL},
1185 /*MMC 0x79*/{NULL},
1186 /*MMC 0x7a*/{NULL},
1187 /*MMC 0x7b*/{NULL},
1188 /*MMC 0x7c*/{NULL},
1189 /*MMC 0x7d*/{NULL},
1190 /*MMC 0x7e*/{NULL},
1191 /*MMC 0x7f*/{NULL},
1192 /*MMC 0x80*/{NULL},
1193 /*MMC 0x81*/{NULL},
1194 /*MMC 0x82*/{NULL},
1195 /*MMC 0x83*/{NULL},
1196 /*MMC 0x84*/{NULL},
1197 /*MMC 0x85*/{NULL},
1198 /*MMC 0x86*/{NULL},
1199 /*MMC 0x87*/{NULL},
1200 /*MMC 0x88*/{NULL},
1201 /*MMC 0x89*/{NULL},
1202 /*MMC 0x8a*/{NULL},
1203 /*MMC 0x8b*/{NULL},
1204 /*MMC 0x8c*/{NULL},
1205 /*MMC 0x8d*/{NULL},
1206 /*MMC 0x8e*/{NULL},
1207 /*MMC 0x8f*/{NULL},
1208 /*MMC 0x90*/{NULL},
1209 /*MMC 0x91*/{NULL},
1210 /*MMC 0x92*/{NULL},
1211 /*MMC 0x93*/{NULL},
1212 /*MMC 0x94*/{NULL},
1213 /*MMC 0x95*/{NULL},
1214 /*MMC 0x96*/{NULL},
1215 /*MMC 0x97*/{NULL},
1216 /*MMC 0x98*/{NULL},
1217 /*MMC 0x99*/{NULL},
1218 /*MMC 0x9a*/{NULL},
1219 /*MMC 0x9b*/{NULL},
1220 /*MMC 0x9c*/{NULL},
1221 /*MMC 0x9d*/{NULL},
1222 /*MMC 0x9e*/{NULL},
1223 /*MMC 0x9f*/{NULL},
1224 /*SPC 0xa0*/{dissect_spc_reportluns},
1225 /*MMC 0xa1*/{NULL},
1226 /*MMC 0xa2*/{NULL},
1227 /*MMC 0xa3*/{NULL},
1228 /*MMC 0xa4*/{dissect_mmc4_reportkey},
1229 /*MMC 0xa5*/{NULL},
1230 /*MMC 0xa6*/{NULL},
1231 /*MMC 0xa7*/{NULL},
1232 /*MMC 0xa8*/{dissect_sbc_read12},
1233 /*MMC 0xa9*/{NULL},
1234 /*MMC 0xaa*/{dissect_sbc_write12},
1235 /*MMC 0xab*/{NULL},
1236 /*MMC 0xac*/{dissect_mmc4_getperformance},
1237 /*MMC 0xad*/{dissect_mmc4_readdiscstructure},
1238 /*MMC 0xae*/{NULL},
1239 /*MMC 0xaf*/{NULL},
1240 /*MMC 0xb0*/{NULL},
1241 /*MMC 0xb1*/{NULL},
1242 /*MMC 0xb2*/{NULL},
1243 /*MMC 0xb3*/{NULL},
1244 /*MMC 0xb4*/{NULL},
1245 /*MMC 0xb5*/{NULL},
1246 /*MMC 0xb6*/{dissect_mmc4_setstreaming},
1247 /*MMC 0xb7*/{NULL},
1248 /*MMC 0xb8*/{NULL},
1249 /*MMC 0xb9*/{NULL},
1250 /*MMC 0xba*/{NULL},
1251 /*MMC 0xbb*/{dissect_mmc4_setcdspeed},
1252 /*MMC 0xbc*/{NULL},
1253 /*MMC 0xbd*/{NULL},
1254 /*MMC 0xbe*/{NULL},
1255 /*MMC 0xbf*/{NULL},
1256 /*MMC 0xc0*/{NULL},
1257 /*MMC 0xc1*/{NULL},
1258 /*MMC 0xc2*/{NULL},
1259 /*MMC 0xc3*/{NULL},
1260 /*MMC 0xc4*/{NULL},
1261 /*MMC 0xc5*/{NULL},
1262 /*MMC 0xc6*/{NULL},
1263 /*MMC 0xc7*/{NULL},
1264 /*MMC 0xc8*/{NULL},
1265 /*MMC 0xc9*/{NULL},
1266 /*MMC 0xca*/{NULL},
1267 /*MMC 0xcb*/{NULL},
1268 /*MMC 0xcc*/{NULL},
1269 /*MMC 0xcd*/{NULL},
1270 /*MMC 0xce*/{NULL},
1271 /*MMC 0xcf*/{NULL},
1272 /*MMC 0xd0*/{NULL},
1273 /*MMC 0xd1*/{NULL},
1274 /*MMC 0xd2*/{NULL},
1275 /*MMC 0xd3*/{NULL},
1276 /*MMC 0xd4*/{NULL},
1277 /*MMC 0xd5*/{NULL},
1278 /*MMC 0xd6*/{NULL},
1279 /*MMC 0xd7*/{NULL},
1280 /*MMC 0xd8*/{NULL},
1281 /*MMC 0xd9*/{NULL},
1282 /*MMC 0xda*/{NULL},
1283 /*MMC 0xdb*/{NULL},
1284 /*MMC 0xdc*/{NULL},
1285 /*MMC 0xdd*/{NULL},
1286 /*MMC 0xde*/{NULL},
1287 /*MMC 0xdf*/{NULL},
1288 /*MMC 0xe0*/{NULL},
1289 /*MMC 0xe1*/{NULL},
1290 /*MMC 0xe2*/{NULL},
1291 /*MMC 0xe3*/{NULL},
1292 /*MMC 0xe4*/{NULL},
1293 /*MMC 0xe5*/{NULL},
1294 /*MMC 0xe6*/{NULL},
1295 /*MMC 0xe7*/{NULL},
1296 /*MMC 0xe8*/{NULL},
1297 /*MMC 0xe9*/{NULL},
1298 /*MMC 0xea*/{NULL},
1299 /*MMC 0xeb*/{NULL},
1300 /*MMC 0xec*/{NULL},
1301 /*MMC 0xed*/{NULL},
1302 /*MMC 0xee*/{NULL},
1303 /*MMC 0xef*/{NULL},
1304 /*MMC 0xf0*/{NULL},
1305 /*MMC 0xf1*/{NULL},
1306 /*MMC 0xf2*/{NULL},
1307 /*MMC 0xf3*/{NULL},
1308 /*MMC 0xf4*/{NULL},
1309 /*MMC 0xf5*/{NULL},
1310 /*MMC 0xf6*/{NULL},
1311 /*MMC 0xf7*/{NULL},
1312 /*MMC 0xf8*/{NULL},
1313 /*MMC 0xf9*/{NULL},
1314 /*MMC 0xfa*/{NULL},
1315 /*MMC 0xfb*/{NULL},
1316 /*MMC 0xfc*/{NULL},
1317 /*MMC 0xfd*/{NULL},
1318 /*MMC 0xfe*/{NULL},
1319 /*MMC 0xff*/{NULL}
1320 };
1321
1322
1323 void
1324 proto_register_scsi_mmc(void)
1325 {
1326         static hf_register_info hf[] = {
1327         { &hf_scsi_mmc_opcode,
1328           {"MMC Opcode", "scsi.mmc.opcode", FT_UINT8, BASE_HEX,
1329            VALS (scsi_mmc_vals), 0x0, "", HFILL}},
1330         { &hf_scsi_mmc_setstreaming_type,
1331           {"Type", "scsi.mmc.setstreaming.type", FT_UINT8, BASE_DEC,
1332            VALS(scsi_setstreaming_type_val), 0, "", HFILL}},
1333         { &hf_scsi_mmc_setstreaming_param_len,
1334           {"Parameter Length", "scsi.mmc.setstreaming.param_len", FT_UINT16, BASE_DEC,
1335            NULL, 0, "", HFILL}},
1336         { &hf_scsi_mmc_setstreaming_wrc,
1337           {"WRC", "scsi.mmc.setstreaming.wrc", FT_UINT8, BASE_HEX,
1338            NULL, 0x18, "", HFILL}},
1339         { &hf_scsi_mmc_setstreaming_rdd,
1340           {"RDD", "scsi.mmc.setstreaming.rdd", FT_BOOLEAN, 8,
1341            NULL, 0x04, "", HFILL}},
1342         { &hf_scsi_mmc_setstreaming_exact,
1343           {"Exact", "scsi.mmc.setstreaming.exact", FT_BOOLEAN, 8,
1344            NULL, 0x02, "", HFILL}},
1345         { &hf_scsi_mmc_setstreaming_ra,
1346           {"RA", "scsi.mmc.setstreaming.ra", FT_BOOLEAN, 8,
1347            NULL, 0x01, "", HFILL}},
1348         { &hf_scsi_mmc_setstreaming_start_lba,
1349           {"Start LBA", "scsi.mmc.setstreaming.start_lbs", FT_UINT32, BASE_DEC,
1350            NULL, 0, "", HFILL}},
1351         { &hf_scsi_mmc_setstreaming_end_lba,
1352           {"End LBA", "scsi.mmc.setstreaming.end_lba", FT_UINT32, BASE_DEC,
1353            NULL, 0, "", HFILL}},
1354         { &hf_scsi_mmc_setstreaming_read_size,
1355           {"Read Size", "scsi.mmc.setstreaming.read_size", FT_UINT32, BASE_DEC,
1356            NULL, 0, "", HFILL}},
1357         { &hf_scsi_mmc_setstreaming_read_time,
1358           {"Read Time", "scsi.mmc.setstreaming.read_time", FT_UINT32, BASE_DEC,
1359            NULL, 0, "", HFILL}},
1360         { &hf_scsi_mmc_setstreaming_write_size,
1361           {"Write Size", "scsi.mmc.setstreaming.write_size", FT_UINT32, BASE_DEC,
1362            NULL, 0, "", HFILL}},
1363         { &hf_scsi_mmc_setstreaming_write_time,
1364           {"Write Time", "scsi.mmc.setstreaming.write_time", FT_UINT32, BASE_DEC,
1365            NULL, 0, "", HFILL}},
1366         { &hf_scsi_mmc_setcdspeed_rc,
1367           {"Rotational Control", "scsi.mmc.setcdspeed.rc", FT_UINT8, BASE_HEX,
1368            VALS(scsi_setcdspeed_rc_val), 0x03, "", HFILL}},
1369         { &hf_scsi_mmc_rbc_block,
1370           {"BLOCK", "scsi.mmc.rbc.block", FT_BOOLEAN, 8,
1371            NULL, 0x01, "", HFILL}},
1372         { &hf_scsi_mmc_rbc_lob_blocks,
1373           {"Buffer Len (blocks)", "scsi.mmc.rbc.lob_blocks", FT_UINT32, BASE_DEC,
1374            NULL, 0, "", HFILL}},
1375         { &hf_scsi_mmc_rbc_alob_blocks,
1376           {"Available Buffer Len (blocks)", "scsi.mmc.rbc.alob_blocks", FT_UINT32, BASE_DEC,
1377            NULL, 0, "", HFILL}},
1378         { &hf_scsi_mmc_rbc_lob_bytes,
1379           {"Buffer Len (bytes)", "scsi.mmc.rbc.lob_bytes", FT_UINT32, BASE_DEC,
1380            NULL, 0, "", HFILL}},
1381         { &hf_scsi_mmc_rbc_alob_bytes,
1382           {"Available Buffer Len (bytes)", "scsi.mmc.rbc.alob_bytes", FT_UINT32, BASE_DEC,
1383            NULL, 0, "", HFILL}},
1384         { &hf_scsi_mmc_rti_address_type,
1385           {"Address Type", "scsi.mmc.rti.address_type", FT_UINT8, BASE_HEX,
1386            VALS(scsi_rti_address_type_val), 0x03, "", HFILL}},
1387         { &hf_scsi_mmc_rti_damage,
1388           {"Damage", "scsi.mmc.rti.damage", FT_BOOLEAN, 8,
1389            NULL, 0x20, "", HFILL}},
1390         { &hf_scsi_mmc_rti_copy,
1391           {"Copy", "scsi.mmc.rti.copy", FT_BOOLEAN, 8,
1392            NULL, 0x10, "", HFILL}},
1393         { &hf_scsi_mmc_rti_track_mode,
1394           {"Track Mode", "scsi.mmc.rti.track_mode", FT_UINT8, BASE_HEX,
1395            NULL, 0x0f, "", HFILL}},
1396         { &hf_scsi_mmc_rti_rt,
1397           {"RT", "scsi.mmc.rti.rt", FT_BOOLEAN, 8,
1398            NULL, 0x80, "", HFILL}},
1399         { &hf_scsi_mmc_rti_blank,
1400           {"Blank", "scsi.mmc.rti.blank", FT_BOOLEAN, 8,
1401            NULL, 0x40, "", HFILL}},
1402         { &hf_scsi_mmc_rti_packet,
1403           {"Packet/Inc", "scsi.mmc.rti.packet", FT_BOOLEAN, 8,
1404            NULL, 0x20, "", HFILL}},
1405         { &hf_scsi_mmc_rti_fp,
1406           {"FP", "scsi.mmc.rti.fp", FT_BOOLEAN, 8,
1407            NULL, 0x10, "", HFILL}},
1408         { &hf_scsi_mmc_rti_data_mode,
1409           {"Data Mode", "scsi.mmc.rti.data_mode", FT_UINT8, BASE_HEX,
1410            NULL, 0x0f, "", HFILL}},
1411         { &hf_scsi_mmc_rti_lra_v,
1412           {"LRA_V", "scsi.mmc.rti.lra_v", FT_BOOLEAN, 8,
1413            NULL, 0x02, "", HFILL}},
1414         { &hf_scsi_mmc_rti_nwa_v,
1415           {"NWA_V", "scsi.mmc.rti.nwa_v", FT_BOOLEAN, 8,
1416            NULL, 0x01, "", HFILL}},
1417         { &hf_scsi_mmc_report_key_type_code,
1418           {"Type Code", "scsi.mmc.report_key.type_code", FT_UINT8, BASE_HEX,
1419            VALS(scsi_report_key_type_code_val), 0xc0, "", HFILL}},
1420         { &hf_scsi_mmc_report_key_vendor_resets,
1421           {"Vendor Resets", "scsi.mmc.report_key.vendor_resets", FT_UINT8, BASE_HEX,
1422            NULL, 0x38, "", HFILL}},
1423         { &hf_scsi_mmc_report_key_user_changes,
1424           {"User Changes", "scsi.mmc.report_key.user_changes", FT_UINT8, BASE_HEX,
1425            NULL, 0x07, "", HFILL}},
1426         { &hf_scsi_mmc_report_key_region_mask,
1427           {"Region Mask", "scsi.mmc.report_key.region_mask", FT_UINT8, BASE_HEX,
1428            NULL, 0xff, "", HFILL}},
1429         { &hf_scsi_mmc_report_key_rpc_scheme,
1430           {"RPC Scheme", "scsi.mmc.report_key.rpc_scheme", FT_UINT8, BASE_HEX,
1431            VALS(scsi_report_key_rpc_scheme_val), 0, "", HFILL}},
1432         { &hf_scsi_mmc_key_class,
1433           {"Key Class", "scsi.mmc.key_class", FT_UINT8, BASE_HEX,
1434            VALS (scsi_key_class_val), 0x00, "", HFILL}},
1435         { &hf_scsi_mmc_key_format,
1436           {"Key Format", "scsi.mmc.key_format", FT_UINT8, BASE_HEX,
1437            VALS (scsi_key_format_val), 0x3f, "", HFILL}},
1438         { &hf_scsi_mmc_disc_info_erasable,
1439           {"Erasable", "scsi.mmc.disc_info.erasable", FT_BOOLEAN, 8,
1440            NULL, 0x10, "", HFILL}},
1441         { &hf_scsi_mmc_disc_info_state_of_last_session,
1442           {"State Of Last Session", "scsi.mmc.disc_info.state_of_last_session", FT_UINT8, BASE_HEX,
1443            VALS(scsi_disc_info_sols_val), 0x0c, "", HFILL}},
1444         { &hf_scsi_mmc_disc_info_disk_status,
1445           {"Disk Status", "scsi.mmc.disc_info.disk_status", FT_UINT8, BASE_HEX,
1446            VALS(scsi_disc_info_disc_status_val), 0x03, "", HFILL}},
1447         { &hf_scsi_mmc_disc_info_number_of_sessions,
1448           {"Number Of Sessions", "scsi.mmc.disc_info.number_of_sessions", FT_UINT16, BASE_DEC,
1449            NULL, 0, "", HFILL}},
1450         { &hf_scsi_mmc_disc_info_first_track_in_last_session,
1451           {"First Track In Last Session", "scsi.mmc.disc_info.first_track_in_last_session", FT_UINT16, BASE_DEC,
1452            NULL, 0, "", HFILL}},
1453         { &hf_scsi_mmc_disc_info_last_track_in_last_session,
1454           {"Last Track In Last Session", "scsi.mmc.disc_info.last_track_in_last_session", FT_UINT16, BASE_DEC,
1455            NULL, 0, "", HFILL}},
1456         { &hf_scsi_mmc_disc_info_did_v,
1457           {"DID_V", "scsi.mmc.disc_info.did_v", FT_BOOLEAN, 8,
1458            NULL, 0x80, "", HFILL}},
1459         { &hf_scsi_mmc_disc_info_dbc_v,
1460           {"DBC_V", "scsi.mmc.disc_info.dbc_v", FT_BOOLEAN, 8,
1461            NULL, 0x40, "", HFILL}},
1462         { &hf_scsi_mmc_disc_info_uru,
1463           {"URU", "scsi.mmc.disc_info.uru", FT_BOOLEAN, 8,
1464            NULL, 0x20, "", HFILL}},
1465         { &hf_scsi_mmc_disc_info_dac_v,
1466           {"DAC_V", "scsi.mmc.disc_info.dac_v", FT_BOOLEAN, 8,
1467            NULL, 0x10, "", HFILL}},
1468         { &hf_scsi_mmc_disc_info_dbit,
1469           {"Dbit", "scsi.mmc.disc_info.dbit", FT_BOOLEAN, 8,
1470            NULL, 0x04, "", HFILL}},
1471         { &hf_scsi_mmc_disc_info_bgfs,
1472           {"BG Format Status", "scsi.mmc.disc_info.bgfs", FT_UINT8, BASE_HEX,
1473            VALS(scsi_disc_info_bgfs_val), 0x03, "", HFILL}},
1474         { &hf_scsi_mmc_disc_info_disc_type,
1475           {"Disc Type", "scsi.mmc.disc_info.disc_type", FT_UINT8, BASE_HEX,
1476            VALS(scsi_disc_info_disc_type_val), 0, "", HFILL}},
1477         { &hf_scsi_mmc_disc_info_disc_identification,
1478           {"Disc Identification", "scsi.mmc.disc_info.disc_identification", FT_UINT32, BASE_HEX,
1479            NULL, 0, "", HFILL}},
1480         { &hf_scsi_mmc_disc_info_last_session_lead_in_start_address,
1481           {"Last Session Lead-In Start Address", "scsi.mmc.disc_info.last_session_lead_in_start_address", FT_UINT32, BASE_DEC,
1482            NULL, 0, "", HFILL}},
1483         { &hf_scsi_mmc_disc_info_last_possible_lead_out_start_address,
1484           {"Last Possible Lead-Out Start Address", "scsi.mmc.disc_info.last_possible_lead_out_start_address", FT_UINT32, BASE_DEC,
1485            NULL, 0, "", HFILL}},
1486         { &hf_scsi_mmc_disc_info_disc_bar_code,
1487           {"Disc Bar Code", "scsi.mmc.disc_info.disc_bar_code", FT_UINT64, BASE_HEX,
1488            NULL, 0, "", HFILL}},
1489         { &hf_scsi_mmc_readtoc_time,
1490           {"Time", "scsi.mmc.readtoc.time", FT_BOOLEAN, 8,
1491            NULL, 0x02, "", HFILL}},
1492         { &hf_scsi_mmc_readtoc_format,
1493           {"Format", "scsi.mmc.readtoc.format", FT_UINT8, BASE_HEX,
1494            NULL, 0x0f, "", HFILL}},
1495         { &hf_scsi_mmc_readtoc_first_session,
1496           {"First Session", "scsi.mmc.readtoc.first_session", FT_UINT8, BASE_DEC,
1497            NULL, 0, "", HFILL}},
1498         { &hf_scsi_mmc_readtoc_last_track,
1499           {"Last Track", "scsi.mmc.readtoc.last_track", FT_UINT8, BASE_DEC,
1500            NULL, 0, "", HFILL}},
1501         { &hf_scsi_mmc_readtoc_last_session,
1502           {"Last Session", "scsi.mmc.readtoc.last_session", FT_UINT8, BASE_DEC,
1503            NULL, 0, "", HFILL}},
1504         { &hf_scsi_mmc_q_subchannel_adr,
1505           {"Q Subchannel ADR", "scsi.mmc.q.subchannel.adr", FT_UINT8, BASE_HEX,
1506            VALS(scsi_q_subchannel_adr_val), 0xf0, "", HFILL}},
1507         { &hf_scsi_mmc_q_subchannel_control,
1508           {"Q Subchannel Control", "scsi.mmc.q.subchannel.control", FT_UINT8, BASE_HEX,
1509            VALS(scsi_q_subchannel_control_val), 0x0f, "", HFILL}},
1510         { &hf_scsi_mmc_agid,
1511           {"AGID", "scsi.mmc.agid", FT_UINT8, BASE_HEX,
1512            NULL, 0xc0, "", HFILL}},
1513         { &hf_scsi_mmc_track,
1514           {"Track", "scsi.mmc.track", FT_UINT32, BASE_DEC,
1515            NULL, 0, "", HFILL}},
1516         { &hf_scsi_mmc_track_size,
1517           {"Track Size", "scsi.mmc.track_size", FT_UINT32, BASE_DEC,
1518            NULL, 0, "", HFILL}},
1519         { &hf_scsi_mmc_track_start_address,
1520           {"Track Start Address", "scsi.mmc.track_start_address", FT_UINT32, BASE_DEC,
1521            NULL, 0, "", HFILL}},
1522         { &hf_scsi_mmc_track_start_time,
1523           {"Track Start Time", "scsi.mmc.track_start_time", FT_UINT32, BASE_DEC,
1524            NULL, 0, "", HFILL}},
1525         { &hf_scsi_mmc_lba,
1526           {"Logical Block Address", "scsi.mmc.lba", FT_UINT32, BASE_DEC,
1527            NULL, 0x0, "", HFILL}},
1528         { &hf_scsi_mmc_session,
1529           {"Session", "scsi.mmc.session", FT_UINT32, BASE_DEC,
1530            NULL, 0, "", HFILL}},
1531         { &hf_scsi_mmc_data_length,
1532           {"Data Length", "scsi.mmc.data_length", FT_UINT32, BASE_DEC,
1533            NULL, 0x0, "", HFILL}},
1534         { &hf_scsi_mmc_getconf_rt,
1535           {"RT", "scsi.mmc.getconf.rt", FT_UINT8, BASE_HEX,
1536            VALS(scsi_getconf_rt_val), 0x03, "", HFILL}},
1537         { &hf_scsi_mmc_getconf_current_profile,
1538           {"Current Profile", "scsi.mmc.getconf.current_profile", FT_UINT16, BASE_HEX,
1539            VALS(scsi_getconf_current_profile_val), 0, "", HFILL}},
1540         { &hf_scsi_mmc_getconf_starting_feature,
1541           {"Starting Feature", "scsi.mmc.getconf.starting_feature", FT_UINT16, BASE_HEX,
1542            VALS(scsi_feature_val), 0, "", HFILL}},
1543         { &hf_scsi_mmc_feature,
1544           {"Feature", "scsi.mmc.feature", FT_UINT16, BASE_HEX,
1545            VALS(scsi_feature_val), 0, "", HFILL}},
1546         { &hf_scsi_mmc_feature_version,
1547           {"Version", "scsi.mmc.feature.version", FT_UINT8, BASE_DEC,
1548            NULL, 0x3c, "", HFILL}},
1549         { &hf_scsi_mmc_feature_persistent,
1550           {"Persistent", "scsi.mmc.feature.persistent", FT_UINT8, BASE_HEX,
1551            NULL, 0x02, "", HFILL}},
1552         { &hf_scsi_mmc_feature_current,
1553           {"Current", "scsi.mmc.feature.current", FT_UINT8, BASE_HEX,
1554            NULL, 001, "", HFILL}},
1555         { &hf_scsi_mmc_feature_additional_length,
1556           {"Additional Length", "scsi.mmc.feature.additional_length", FT_UINT8, BASE_DEC,
1557            NULL, 0, "", HFILL}},
1558         { &hf_scsi_mmc_feature_lun_sn,
1559           {"LUN Serial Number", "scsi.mmc.feature.lun_sn", FT_STRING, BASE_NONE,
1560            NULL, 0, "", HFILL}},
1561         { &hf_scsi_mmc_feature_cdread_dap,
1562           {"DAP", "scsi.mmc.feature.cdread.dap", FT_BOOLEAN, 8,
1563            NULL, 0x80, "", HFILL}},
1564         { &hf_scsi_mmc_feature_cdread_c2flag,
1565           {"C2 Flag", "scsi.mmc.feature.cdread.c2flag", FT_BOOLEAN, 8,
1566            NULL, 0x02, "", HFILL}},
1567         { &hf_scsi_mmc_feature_cdread_cdtext,
1568           {"CD-Text", "scsi.mmc.feature.cdread.cdtext", FT_BOOLEAN, 8,
1569            NULL, 0x01, "", HFILL}},
1570         { &hf_scsi_mmc_feature_dvdrw_write,
1571           {"Write", "scsi.mmc.feature.dvdrw.write", FT_BOOLEAN, 8,
1572            NULL, 0x01, "", HFILL}},
1573         { &hf_scsi_mmc_feature_dvdrw_quickstart,
1574           {"Quick Start", "scsi.mmc.feature.dvdrw.quickstart", FT_BOOLEAN, 8,
1575            NULL, 0x02, "", HFILL}},
1576         { &hf_scsi_mmc_feature_dvdrw_closeonly,
1577           {"Close Only", "scsi.mmc.feature.dvdrw.closeonly", FT_BOOLEAN, 8,
1578            NULL, 0x01, "", HFILL}},
1579         { &hf_scsi_mmc_feature_dvdr_write,
1580           {"Write", "scsi.mmc.feature.dvdr.write", FT_BOOLEAN, 8,
1581            NULL, 0x01, "", HFILL}},
1582         { &hf_scsi_mmc_feature_tao_buf,
1583           {"BUF", "scsi.mmc.feature.tao.buf", FT_BOOLEAN, 8,
1584            NULL, 0x40, "", HFILL}},
1585         { &hf_scsi_mmc_feature_tao_rwraw,
1586           {"R-W Raw", "scsi.mmc.feature.tao.rwraw", FT_BOOLEAN, 8,
1587            NULL, 0x10, "", HFILL}},
1588         { &hf_scsi_mmc_feature_tao_rwpack,
1589           {"R-W Pack", "scsi.mmc.feature.tao.rwpack", FT_BOOLEAN, 8,
1590            NULL, 0x08, "", HFILL}},
1591         { &hf_scsi_mmc_feature_tao_testwrite,
1592           {"Test Write", "scsi.mmc.feature.tao.testwrite", FT_BOOLEAN, 8,
1593            NULL, 0x04, "", HFILL}},
1594         { &hf_scsi_mmc_feature_tao_cdrw,
1595           {"CD-RW", "scsi.mmc.feature.tao.cdrw", FT_BOOLEAN, 8,
1596            NULL, 0x02, "", HFILL}},
1597         { &hf_scsi_mmc_feature_tao_rwsubcode,
1598           {"R-W Subcode", "scsi.mmc.feature.tao.rwsubcode", FT_BOOLEAN, 8,
1599            NULL, 0x01, "", HFILL}},
1600         { &hf_scsi_mmc_feature_dts,
1601           {"Data Type Supported", "scsi.mmc.feature.dts", FT_UINT16, BASE_HEX,
1602            NULL, 0xffff, "", HFILL}},
1603         { &hf_scsi_mmc_feature_sao_buf,
1604           {"BUF", "scsi.mmc.feature.sao.buf", FT_BOOLEAN, 8,
1605            NULL, 0x40, "", HFILL}},
1606         { &hf_scsi_mmc_feature_sao_sao,
1607           {"SAO", "scsi.mmc.feature.sao.sao", FT_BOOLEAN, 8,
1608            NULL, 0x20, "", HFILL}},
1609         { &hf_scsi_mmc_feature_sao_rawms,
1610           {"Raw MS", "scsi.mmc.feature.sao.rawms", FT_BOOLEAN, 8,
1611            NULL, 0x10, "", HFILL}},
1612         { &hf_scsi_mmc_feature_sao_raw,
1613           {"Raw", "scsi.mmc.feature.sao.raw", FT_BOOLEAN, 8,
1614            NULL, 0x08, "", HFILL}},
1615         { &hf_scsi_mmc_feature_sao_testwrite,
1616           {"Test Write", "scsi.mmc.feature.sao.testwrite", FT_BOOLEAN, 8,
1617            NULL, 0x04, "", HFILL}},
1618         { &hf_scsi_mmc_feature_sao_cdrw,
1619           {"CD-RW", "scsi.mmc.feature.sao.cdrw", FT_BOOLEAN, 8,
1620            NULL, 0x02, "", HFILL}},
1621         { &hf_scsi_mmc_feature_sao_rw,
1622           {"R-W", "scsi.mmc.feature.sao.rw", FT_BOOLEAN, 8,
1623            NULL, 0x01, "", HFILL}},
1624         { &hf_scsi_mmc_feature_sao_mcsl,
1625           {"Maximum Cue Sheet Length", "scsi.mmc.feature.sao.mcsl", FT_UINT24, BASE_DEC,
1626            NULL, 0, "", HFILL}},
1627         { &hf_scsi_mmc_feature_dvdr_buf,
1628           {"BUF", "scsi.mmc.feature.dvdr.buf", FT_BOOLEAN, 8,
1629            NULL, 0x40, "", HFILL}},
1630         { &hf_scsi_mmc_feature_dvdr_testwrite,
1631           {"Test Write", "scsi.mmc.feature.dvdr.testwrite", FT_BOOLEAN, 8,
1632            NULL, 0x04, "", HFILL}},
1633         { &hf_scsi_mmc_feature_dvdr_dvdrw,
1634           {"DVD-RW", "scsi.mmc.feature.dvdr.dvdrw", FT_BOOLEAN, 8,
1635            NULL, 0x02, "", HFILL}},
1636         { &hf_scsi_mmc_feature_profile,
1637           {"Profile", "scsi.mmc.feature.profile", FT_UINT16, BASE_HEX,
1638            VALS(scsi_getconf_current_profile_val), 0, "", HFILL}},
1639         { &hf_scsi_mmc_feature_profile_current,
1640           {"Current", "scsi.mmc.feature.profile.current", FT_BOOLEAN, 8,
1641            NULL, 0x01, "", HFILL}},
1642         { &hf_scsi_mmc_feature_isw_buf,
1643           {"BUF", "scsi.mmc.feature.isw.buf", FT_BOOLEAN, 8,
1644            NULL, 0x01, "", HFILL}},
1645         { &hf_scsi_mmc_feature_isw_num_linksize,
1646           {"Number of Link Sizes", "scsi.mmc.feature.isw.num_linksize", FT_UINT8, BASE_DEC,
1647            NULL, 0, "", HFILL}},
1648         { &hf_scsi_mmc_feature_isw_linksize,
1649           {"Link Size", "scsi.mmc.feature.isw.linksize", FT_UINT8, BASE_DEC,
1650            NULL, 0, "", HFILL}},
1651         { &hf_scsi_mmc_read_compatibility_lba,
1652           {"Read Compatibility LBA", "scsi.mmc.read_compatibility_lba", FT_UINT32, BASE_DEC,
1653            NULL, 0, "", HFILL}},
1654         { &hf_scsi_mmc_reservation_size,
1655           {"Reservation Size", "scsi.mmc.reservation_size", FT_UINT32, BASE_DEC,
1656            NULL, 0, "", HFILL}},
1657         { &hf_scsi_mmc_last_recorded_address,
1658           {"Last Recorded Address", "scsi.mmc.last_recorded_address", FT_UINT32, BASE_DEC,
1659            NULL, 0, "", HFILL}},
1660         { &hf_scsi_mmc_first_track,
1661           {"First Track", "scsi.mmc.first_track", FT_UINT8, BASE_DEC,
1662            NULL, 0, "", HFILL}},
1663         { &hf_scsi_mmc_fixed_packet_size,
1664           {"Fixed Packet Size", "scsi.mmc.fixed_packet_size", FT_UINT32, BASE_DEC,
1665            NULL, 0, "", HFILL}},
1666         { &hf_scsi_mmc_synccache_immed,
1667           {"IMMED", "scsi.mmc.synccache.immed", FT_BOOLEAN, 8,
1668            NULL, 0x02, "", HFILL}},
1669         { &hf_scsi_mmc_synccache_reladr,
1670           {"RelAdr", "scsi.mmc.synccache.reladr", FT_BOOLEAN, 8,
1671            NULL, 0x01, "", HFILL}},
1672         { &hf_scsi_mmc_num_blocks,
1673           {"Number of Blocks", "scsi.mmc.num_blocks", FT_UINT32, BASE_DEC,
1674            NULL, 0x0, "", HFILL}},
1675         { &hf_scsi_mmc_next_writable_address,
1676           {"Next Writable Address", "scsi.mmc.next_writable_address", FT_UINT32, BASE_DEC,
1677            NULL, 0, "", HFILL}},
1678         { &hf_scsi_mmc_free_blocks,
1679           {"Free Blocks", "scsi.mmc.free_blocks", FT_UINT32, BASE_DEC,
1680            NULL, 0, "", HFILL}},
1681         };
1682
1683         /* Setup protocol subtree array */
1684         static gint *ett[] = {
1685                 &ett_scsi_mmc_profile,
1686         };
1687
1688         /* Register the protocol name and description */
1689         proto_scsi_mmc = proto_register_protocol("SCSI_MMC", "SCSI_MMC", "scsi_mmc");
1690
1691         /* Required function calls to register the header fields and subtrees used */
1692         proto_register_field_array(proto_scsi_mmc, hf, array_length(hf));
1693         proto_register_subtree_array(ett, array_length(ett));
1694 }
1695
1696 void
1697 proto_reg_handoff_scsi_mmc(void)
1698 {
1699 }
1700