Correct device and bitmap initialization.

This commit is contained in:
Jeffrey Townsend
2017-07-06 22:13:46 +00:00
parent 1b2d889979
commit df42573905
2 changed files with 8 additions and 14 deletions

View File

@@ -56,7 +56,7 @@ sfp_get_port_path(int port, char *node_name)
int
onlp_sfpi_init(void)
{
/* Called at initialization time */
/* Called at initialization time */
return ONLP_STATUS_OK;
}
@@ -67,9 +67,7 @@ onlp_sfpi_bitmap_get(onlp_sfp_bitmap_t* bmap)
* Ports {0, 54}
*/
int p;
AIM_BITMAP_INIT(bmap, 64);
AIM_BITMAP_CLR_ALL(bmap);
for(p = 0; p < NUM_OF_SFP_PORT; p++) {
AIM_BITMAP_SET(bmap, p);
}
@@ -92,7 +90,7 @@ onlp_sfpi_is_present(int port)
AIM_LOG_ERROR("Unable to read present status from port(%d)\r\n", port);
return ONLP_STATUS_E_INTERNAL;
}
return present;
}
@@ -205,7 +203,7 @@ onlp_sfpi_eeprom_read(int port, uint8_t data[256])
* Return OK if eeprom is read
*/
memset(data, 0, 256);
if (onlp_file_read_binary(path, (char*)data, 256, 256) != 0) {
AIM_LOG_ERROR("Unable to read eeprom from port(%d)\r\n", port);
return ONLP_STATUS_E_INTERNAL;
@@ -320,6 +318,3 @@ onlp_sfpi_denit(void)
{
return ONLP_STATUS_OK;
}

View File

@@ -17,7 +17,7 @@ class OnlPlatform_x86_64_accton_as5822_54x_r0(OnlPlatformAccton,
self.new_i2c_devices(
[
# initialize multiplexer (PCA9548)
('pca9548', 0x70, 0),
('pca9548', 0x72, 0),
# initialize CPLD
('accton_i2c_cpld', 0x60, 6),
@@ -29,7 +29,7 @@ class OnlPlatform_x86_64_accton_as5822_54x_r0(OnlPlatformAccton,
# initiate PSU-2 AC Power
('as5822_54x_psu2', 0x51, 4),
('ym2401', 0x59, 4),
# inititate LM75
('lm75', 0x48, 7),
('lm75', 0x49, 8),
@@ -47,7 +47,7 @@ class OnlPlatform_x86_64_accton_as5822_54x_r0(OnlPlatformAccton,
# initialize CPLD
('accton_i2c_cpld', 0x61, 10),
('accton_i2c_cpld', 0x62, 11),
# initialize multiplexer (PCA9548)
('pca9548', 0x71, 12),
('pca9548', 0x72, 13),
@@ -55,7 +55,7 @@ class OnlPlatform_x86_64_accton_as5822_54x_r0(OnlPlatformAccton,
('pca9548', 0x74, 15),
('pca9548', 0x75, 16),
('pca9548', 0x76, 17),
('pca9548', 0x77, 17),
('pca9548', 0x71, 17),
# initiate IDPROM
('24c02', 0x57, 1),
@@ -72,4 +72,3 @@ class OnlPlatform_x86_64_accton_as5822_54x_r0(OnlPlatformAccton,
self.new_i2c_device('as5822_54x_sfp%d' % port, 0x50, port+17)
return True