int onlp_sfpi_control_set(int port, onlp_sfp_control_t control, int value) { int rv; if (port < 0 || port >= 48) { return ONLP_STATUS_E_UNSUPPORTED; } switch(control) { case ONLP_SFP_CONTROL_TX_DISABLE: { char* path = as5812_54x_sfp_get_port_path(port, "sfp_tx_disable"); if (deviceNodeWriteInt(path, value, 0) != 0) { AIM_LOG_ERROR("Unable to set tx_disable status to port(%d)\r\n", port); rv = ONLP_STATUS_E_INTERNAL; } else { rv = ONLP_STATUS_OK; } break; } default: rv = ONLP_STATUS_E_UNSUPPORTED; break; } return rv; }
/* * This function puts the LED into the given mode. It is a more functional * interface for multimode LEDs. * * Only modes reported in the LED's capabilities will be attempted. */ int onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) { int local_id; char fullpath[50] = {0}; VALIDATE(id); local_id = ONLP_OID_ID_GET(id); sprintf(fullpath, "%s%s/%s", prefix_path, last_path[local_id], filename); if (deviceNodeWriteInt(fullpath, onlp_to_driver_led_mode(local_id, mode), 0) != 0) { return ONLP_STATUS_E_INTERNAL; } return ONLP_STATUS_OK; }
static int set_equalizer_type(int type) { return deviceNodeWriteInt(SFP_EEPROM_NODE(sfp_equalizer), type, 0); }
static int set_active_port(int front_port) { return deviceNodeWriteInt(SFP_EEPROM_NODE(sfp_active_port), front_port, 0); }