code: func EmulateModeSense(cmd *SCSICmd, wce bool) (SCSIResponse, error) {
  	pgs := &bytes.Buffer{}
  	outlen := int(cmd.XferLen())
  
  	page := cmd.GetCDB(2)
  	if page == 0x3f || page == 0x08 {
  		CachingModePage(pgs, wce)
  	}
  	scsiCmd := cmd.Command()
  
  	dsp := byte(0x10) // Support DPO/FUA
  
  	pgdata := pgs.Bytes()
  	var hdr []byte
  	if scsiCmd == scsi.ModeSense {
  		// MODE_SENSE_6
  		hdr = make([]byte, 4)
  		hdr[0] = byte(len(pgdata) + 3)
  		hdr[1] = 0x00 // Device type
  		hdr[2] = dsp
  	} else {
  		// MODE_SENSE_10
  		hdr = make([]byte, 8)
  		order := binary.BigEndian
  		order.PutUint16(hdr, uint16(len(pgdata)+6))
  		hdr[2] = 0x00 // Device type
  		hdr[3] = dsp
  	}
  	data := append(hdr, pgdata...)
  	if outlen < len(data) {
  		data = data[:outlen]
  	}
  	cmd.Write(data)
  	return cmd.Ok(), nil
  }
docs: // EmulateModeSense responds to a static Mode Sense command. `wce` enables or diables
  // the SCSI "Write Cache Enabled" flag.