MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / LoadUnload

Method LoadUnload

cpp/devices/scsi_streamer.cpp:662–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

660}
661
662void SCSIST::LoadUnload()
663{
664 /*
665Table 176 - LOAD UNLOAD command
666+=====-========-========-========-========-========-========-========-========+
667| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
668|Byte | | | | | | | | |
669|=====+=======================================================================|
670| 0 | Operation code (1Bh) |
671|-----+-----------------------------------------------------------------------|
672| 1 | Logical unit number | Reserved | Immed |
673|-----+-----------------------------------------------------------------------|
674| 2 | Reserved |
675|-----+-----------------------------------------------------------------------|
676| 3 | Reserved |
677|-----+-----------------------------------------------------------------------|
678| 4 | Reserved | EOT | Reten | Load |
679|-----+-----------------------------------------------------------------------|
680| 5 | Control |
681+=============================================================================+
682*/
683 bool load = GetController()->GetCmd()[4] & 1;
684 bool eot = GetController()->GetCmd()[4] & 4;
685 if (load) {
686 file.rewind();
687 } else if (eot) {
688 file.seek(0, SEEK_END);
689 }
690 if (load & eot){
691 GetController()->Error(sense_key::illegal_request, asc::no_additional_sense_information, status::check_condition);
692 }
693 EnterStatusPhase();
694}
695
696void SCSIST::ReadPosition()
697{

Callers

nothing calls this directly

Calls 4

GetCmdMethod · 0.80
rewindMethod · 0.80
seekMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected