Ejemplo n.º 1
0
 def __init__(self, port_num):
     # Override port_to_eeprom_mapping for class initialization
     eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
     for x in range(self.port_start, self.port_end + 1):
         port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x])
         self.port_to_eeprom_mapping[x] = port_eeprom_path
     sfputilbase.__init__(self, port_num)
Ejemplo n.º 2
0
 def __init__(self, port_num):
     # Override port_to_eeprom_mapping for class initialization
     eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
     for x in range(0, self.port_end + 1):
         self.port_to_eeprom_mapping[x] = eeprom_path.format(
             x + self.eeprom_offset)
     sfputilbase.__init__(self, port_num)
Ejemplo n.º 3
0
 def __init__(self, port_num):
     # Override port_to_eeprom_mapping for class initialization
     eeprom_path = '/sys/bus/i2c/devices/{0}-0050/sfp_eeprom'
     for x in range(self.port_start, self.port_end + 1):
         port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x+1])
         self.port_to_eeprom_mapping[x] = port_eeprom_path
     sfputilbase.__init__(self, port_num)
Ejemplo n.º 4
0
 def __init__(self, port_num):
     # Override port_to_eeprom_mapping for class initialization
     eeprom_path = '/bsp/qsfp/qsfp{0}'
     for x in range(0, self.port_end + 1):
         self.port_to_eeprom_mapping[x] = eeprom_path.format(
             x + self.eeprom_offset)
     sfputilbase.__init__(self, port_num)
Ejemplo n.º 5
0
    def __init__(self, port_num):
        # Override port_to_eeprom_mapping for class initialization
        i2c_bus = self.port_to_i2c_mapping[port_num][0]
        sfp_idx = self.port_to_i2c_mapping[port_num][1]
        proc = subprocess.Popen([i2c_set, '-y', str(i2c_bus), cpld_addr, mux_reg, str(sfp_idx)],
                                stdout=subprocess.PIPE,
                                shell=False,
                                stderr=subprocess.STDOUT)
        stdout = proc.communicate()[0]
        proc.wait()

        eeprom_path = '/sys/class/i2c-adapter/i2c-{0[0]}/{0[0]}-0050/eeprom'
        for x in range(self.port_start, self.port_end + 1):
            port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x])
            self.port_to_eeprom_mapping[x] = port_eeprom_path
        sfputilbase.__init__(self, port_num)