Exemplo n.º 1
0
        public virtual StorApiStatus GetErrorRecoveryTime(bool isReadTimer, ref ushort value)
        {
            StorApiStatus storApiStatus = StorApiStatusEnum.STOR_NO_ERROR;
            ATACmdInfo    atacmdInfo    = new ATACmdInfo();

            atacmdInfo.datalen      = 512u;
            atacmdInfo.registers[0] = 214;
            atacmdInfo.registers[1] = 1;
            atacmdInfo.registers[2] = 224;
            atacmdInfo.registers[3] = 79;
            atacmdInfo.registers[4] = 194;
            atacmdInfo.registers[6] = 176;
            COMMAND_ERROR_RECOVERY_CONTROL t = new COMMAND_ERROR_RECOVERY_CONTROL
            {
                Control   = 3,
                Function  = 2,
                Selection = (ushort)(isReadTimer ? 1 : 2),
                Value     = 0
            };

            atacmdInfo.data = Ata.StructToByteArray <COMMAND_ERROR_RECOVERY_CONTROL>(t, 512);
            storApiStatus   = this.ATACmd(ref atacmdInfo);
            if (storApiStatus == StorApiStatusEnum.STOR_NO_ERROR)
            {
                value = (ushort)((int)atacmdInfo.registers[2] << 8 | (int)atacmdInfo.registers[1]);
            }
            return(storApiStatus);
        }
Exemplo n.º 2
0
        public virtual StorApiStatus GetAC55(byte feat, byte parm1, ref uint value)
        {
            StorApiStatus storApiStatus = StorApiStatusEnum.STOR_NO_ERROR;

            storApiStatus = this.EnableVSC(true);
            if (storApiStatus != StorApiStatusEnum.STOR_NO_ERROR)
            {
                return(storApiStatus);
            }
            ATACmdInfo atacmdInfo = new ATACmdInfo();

            atacmdInfo.datalen      = 512u;
            atacmdInfo.registers[0] = 214;
            atacmdInfo.registers[1] = 1;
            atacmdInfo.registers[2] = 190;
            atacmdInfo.registers[3] = 79;
            atacmdInfo.registers[4] = 194;
            atacmdInfo.registers[6] = 176;
            KEY_SECT t = new KEY_SECT
            {
                ActionCode   = 55,
                FunctionCode = 11,
                Parm1        = 48879,
                Parm2        = 57005,
                Parm3        = (ushort)feat,
                Parm4        = (ushort)parm1
            };

            atacmdInfo.data = Ata.StructToByteArray <KEY_SECT>(t, 512);
            storApiStatus   = this.ATACmd(ref atacmdInfo);
            if (storApiStatus != StorApiStatusEnum.STOR_NO_ERROR)
            {
                this.EnableVSC(false);
                return(storApiStatus);
            }
            atacmdInfo.datalen      = 512u;
            atacmdInfo.registers[0] = 213;
            atacmdInfo.registers[1] = 1;
            atacmdInfo.registers[2] = 191;
            atacmdInfo.registers[3] = 79;
            atacmdInfo.registers[4] = 194;
            atacmdInfo.registers[6] = 176;
            atacmdInfo.data         = new byte[512];
            storApiStatus           = this.ATACmd(ref atacmdInfo);
            if (storApiStatus != StorApiStatusEnum.STOR_NO_ERROR)
            {
                this.EnableVSC(false);
                return(storApiStatus);
            }
            value = Ata.ByteArrayToStruct <FEAT_ID>(atacmdInfo.data).Data;
            this.EnableVSC(false);
            return(storApiStatus);
        }
Exemplo n.º 3
0
        public virtual StorApiStatus GetIdentity(ref short[] identity)
        {
            StorApiStatus storApiStatus = StorApiStatusEnum.STOR_NO_ERROR;
            ATACmdInfo    atacmdInfo    = new ATACmdInfo();

            atacmdInfo.datalen      = 512u;
            atacmdInfo.registers[6] = 236;
            atacmdInfo.data         = new byte[512];
            storApiStatus           = this.ATACmd(ref atacmdInfo);
            if (storApiStatus == StorApiStatusEnum.STOR_NO_ERROR)
            {
                identity = Ata.ByteArrayToShortArray(atacmdInfo.data);
            }
            return(storApiStatus);
        }
Exemplo n.º 4
0
        public virtual StorApiStatus SetAC55(byte feat, byte parm1, byte type, byte size, uint value)
        {
            StorApiStatus storApiStatus = StorApiStatusEnum.STOR_NO_ERROR;

            storApiStatus = this.EnableVSC(true);
            if (storApiStatus != StorApiStatusEnum.STOR_NO_ERROR)
            {
                return(storApiStatus);
            }
            ATACmdInfo atacmdInfo = new ATACmdInfo();

            atacmdInfo.datalen      = 512u;
            atacmdInfo.registers[0] = 214;
            atacmdInfo.registers[1] = 1;
            atacmdInfo.registers[2] = 190;
            atacmdInfo.registers[3] = 79;
            atacmdInfo.registers[4] = 194;
            atacmdInfo.registers[6] = 176;
            KEY_SECT t = new KEY_SECT
            {
                ActionCode   = 55,
                FunctionCode = 2,
                Parm1        = 48879,
                Parm2        = 57005,
                Parm3        = (ushort)feat,
                Parm4        = (ushort)parm1,
                Parm5        = (ushort)type,
                Parm6        = (ushort)size,
                Parm7        = (ushort)value
            };

            atacmdInfo.data = Ata.StructToByteArray <KEY_SECT>(t, 512);
            storApiStatus   = this.ATACmd(ref atacmdInfo);
            if (storApiStatus != StorApiStatusEnum.STOR_NO_ERROR)
            {
                this.EnableVSC(false);
                return(storApiStatus);
            }
            this.EnableVSC(false);
            return(storApiStatus);
        }