def readcapacity16(self, **kwargs): """ Returns a ReadCapacity16 Instance :param kwargs: a dict with key/value pairs alloc_len = 32, size of requested datain :return: a ReadCapacity16 instance """ opcode = next(get_opcode(self.device.opcodes, '9E')) cmd = ReadCapacity16(opcode=opcode, **kwargs) self.execute(cmd) cmd.unmarshall() return cmd
def reportpriority(self, **kwargs): """ Return a ReportPriority Instance :param kwargs: a dict with key/value pairs priority=0, specifies information to be returned in data_in buffer alloclen=16384, size of requested datain :return: a ReportLuns instance """ opcode = next(get_opcode(self.device.opcodes, 'A3')) cmd = ReportPriority(opcode=opcode, **kwargs) self.execute(cmd) cmd.unmarshall() return cmd
def getlbastatus(self, lba, **kwargs): """ Returns a GetLBAStatus Instance :param lba: starting lba :param kwargs: a dict with key/value pairs alloc_len = 16384: size of requested datain :return: a GetLBAStatus instance """ opcode = next(get_opcode(self.device.opcodes, '9E')) cmd = GetLBAStatus(opcode, lba, **kwargs) self.execute(cmd) cmd.unmarshall() return cmd
def build_cdb(self, priority, alloclen): """ Build a ReportPriority CDB :param priority: specifies information to be returned in data_in buffer :param alloclen: the max number of bytes allocated for the data_in buffer :return: a byte array representing a code descriptor block """ opcode = next(get_opcode(self.scsi.device.opcodes, 'A3')) cdb = {'opcode': opcode.value, 'service_action': opcode.serviceaction.REPORT_PRIORITY, 'priority_reported': priority, 'alloc_len': alloclen, } return self.marshall_cdb(cdb)
def readcapacity16(self, **kwargs): """ Returns a ReadCapacity16 Instance :param kwargs: a dict with key/value pairs alloc_len = 32, size of requested datain :return: a ReadCapacity16 instance """ opcode = next(get_opcode(self.device.opcodes, '9E')) cmd = ReadCapacity16(opcode=opcode, **kwargs) self.execute(cmd) SCSI.unmarshall(cmd) return cmd
def reportpriority(self, **kwargs): """ Return a ReportPriority Instance :param kwargs: a dict with key/value pairs priority=0, specifies information to be returned in data_in buffer alloclen=16384, size of requested datain :return: a ReportLuns instance """ opcode = next(get_opcode(self.device.opcodes, 'A3')) cmd = ReportPriority(opcode=opcode, **kwargs) self.execute(cmd) SCSI.unmarshall(cmd) return cmd
def build_cdb(self, priority, alloclen): """ Build a ReportPriority CDB :param priority: specifies information to be returned in data_in buffer :param alloclen: the max number of bytes allocated for the data_in buffer :return: a byte array representing a code descriptor block """ opcode = next(get_opcode(self.scsi.device.opcodes, 'A3')) cdb = { 'opcode': opcode.value, 'service_action': opcode.serviceaction.REPORT_PRIORITY, 'priority_reported': priority, 'alloc_len': alloclen, } return self.marshall_cdb(cdb)
def getlbastatus(self, lba, **kwargs): """ Returns a GetLBAStatus Instance :param lba: starting lba :param kwargs: a dict with key/value pairs alloc_len = 16384: size of requested datain :return: a GetLBAStatus instance """ opcode = next(get_opcode(self.device.opcodes, '9E')) cmd = GetLBAStatus(opcode, lba, **kwargs) self.execute(cmd) SCSI.unmarshall(cmd) return cmd