Lines Matching +full:cmd +full:- +full:cnt +full:- +full:name

1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
212 def __init__(self, name): argument
213 self.name = name
216 return name
233 self.name = TPM2_FMT1_ERRORS.get(rc & 0x3f, "TPM_RC_UNKNOWN")
235 self.name = TPM2_WARN_ERRORS.get(rc & 0x7f, "TPM_RC_UNKNOWN")
237 self.name = TPM2_VER1_ERRORS.get(rc & 0x7f, "TPM_RC_UNKNOWN")
239 self.name = TPM2_VER0_ERRORS.get(rc & 0x7f, "TPM_RC_UNKNOWN")
243 return '%s: cc=0x%08x, rc=0x%08x' % (self.name, self.cc, self.rc)
245 return '%s: rc=0x%08x' % (self.name, self.rc)
339 def get_algorithm(name): argument
340 alg = NAME_ALG_MAP.get(name)
342 raise UnknownAlgorithmNameError(name)
381 def send_cmd(self, cmd): argument
382 self.tpm.write(cmd)
394 sys.stderr.write('cmd' + os.linesep)
395 sys.stderr.write(hex_dump(cmd) + os.linesep)
401 cc = struct.unpack('>I', cmd[6:10])[0]
413 cmd = struct.pack(fmt,
421 rsp = self.send_cmd(cmd)
445 cmd = struct.pack(
455 self.send_cmd(cmd)
459 cmd = struct.pack(fmt,
472 return struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
501 cmd = struct.pack(fmt,
512 self.send_cmd(cmd)
516 cmd = struct.pack(fmt,
522 self.send_cmd(cmd)
526 cmd = struct.pack(fmt,
532 return self.send_cmd(cmd)[12:]
536 cmd = struct.pack(fmt,
542 self.send_cmd(cmd)
573 cmd = struct.pack(
587 return struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
611 cmd = struct.pack(
625 rsp = self.send_cmd(cmd)
638 cmd = struct.pack(
648 data_handle = struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
656 cmd = struct.pack(
666 rsp = self.send_cmd(cmd)
670 data_len = struct.unpack('>I', rsp[10:14])[0] - 2
678 cmd = struct.pack(
687 self.send_cmd(cmd)
689 def __get_cap_cnt(self, cap, pt, cnt): argument
693 cmd = struct.pack(fmt,
697 cap, pt, cnt)
699 rsp = self.send_cmd(cmd)[10:]
700 more_data, cap, cnt = struct.unpack('>BII', rsp[:9])
703 for i in range(0, cnt):
726 cmd = struct.pack(fmt,
731 rsp = self.send_cmd(cmd)[10:]
732 _, _, cnt = struct.unpack('>BII', rsp[:9])
736 for i in range(0, cnt):