Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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