def _getsespage(self, page, length): # uses pt cmd = Cmd("rdr", {"pcv":1, "page_code":page, "alloc":length}) #for q in cmd.cdb: print "%.2x" % q, #print cdb = CDB(cmd.cdb) cdb.set_data_in(length) self.pt.sendcdb(cdb) return cdb.buf
def writepage(self, data): """ Write the SES page specified by integer pagenum with string, data. """ cmd = Cmd("sd", {"self-test_code":0, "pf":1, "parameter_list_length":len(data)}) cdb = CDB(cmd.cdb) cdb.set_data_out(data) result = self.pt.sendcdb(cdb) return result
def _getsespage(self, page, length): # uses pt cmd = Cmd("rdr", {"pcv": 1, "page_code": page, "alloc": length}) #for q in cmd.cdb: print "%.2x" % q, #print cdb = CDB(cmd.cdb) cdb.set_data_in(length) self.pt.sendcdb(cdb) return cdb.buf
def execute(self, command): """ Send a CLI command through SES page 0xe8. """ cmd = Cmd.clicommandout(self.expanderid, command) cdb = CDB(cmd.cdb) cdb.set_data_out(cmd.dat) self.pt.sendcdb(cdb) page = self.ses.parse(self.ses.readpage(0xe8)) return page["data"].response.val
def writepage(self, data): """ Write the SES page specified by integer pagenum with string, data. """ cmd = Cmd("sd", { "self-test_code": 0, "pf": 1, "parameter_list_length": len(data) }) cdb = CDB(cmd.cdb) cdb.set_data_out(data) result = self.pt.sendcdb(cdb) return result
def inq(pt, page=None, alloc=74): """ Create an Inquiry command, send it, and parse the results. Input: pt : ScsiPT object page : vital product page number or None alloc: size to allocate for result TODO: implement page """ cmd = Cmd("inq", {"evpd": 0, "alloc": alloc}) cdb = CDB(cmd.cdb) cdb.set_data_in(alloc) pt.sendcdb(cdb) inq = Cmd.extract(cdb.buf, Cmd.data_inquiry) return inq
def inq(pt, page=None, alloc=74): """ Create an Inquiry command, send it, and parse the results. Input: pt : ScsiPT object page : vital product page number or None alloc: size to allocate for result TODO: implement page """ cmd = Cmd("inq", {"evpd":0, "alloc":alloc}) cdb = CDB(cmd.cdb) cdb.set_data_in(alloc) pt.sendcdb(cdb) inq = Cmd.extract(cdb.buf, Cmd.data_inquiry) return inq