Commit 4f2e6c91 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

bring back SNMP support

parent e73b898a
Pipeline #287 failed with stages
in 8 seconds
...@@ -15,19 +15,19 @@ ...@@ -15,19 +15,19 @@
#include <wrc.h> #include <wrc.h>
#include <wrpc.h> #include <wrpc.h>
#include <string.h> #include <string.h>
#include <minic.h>
#include <limits.h> #include <limits.h>
#include "endpoint.h" #include "dev/endpoint.h"
#include "dev/minic.h"
#include "ipv4.h" #include "ipv4.h"
#include "ptpd_netif.h" #include "ptpd_netif.h"
#include "pps_gen.h" #include "dev/pps_gen.h"
#include "hw/etherbone-config.h" #include "hw/etherbone-config.h"
#include "revision.h" #include "revision.h"
#include "softpll_ng.h" #include "softpll_ng.h"
#include "temperature.h" #include "temperature.h"
#include "sfp.h" #include "sfp.h"
#include "syscon.h" #include "dev/syscon.h"
#include "storage.h" #include "storage.h"
...@@ -1442,6 +1442,7 @@ static int set_sdb(uint8_t *buf, struct snmp_oid *obj) ...@@ -1442,6 +1442,7 @@ static int set_sdb(uint8_t *buf, struct snmp_oid *obj)
uint8_t i2c_adr = FMC_EEPROM_ADR; uint8_t i2c_adr = FMC_EEPROM_ADR;
int blocksize = 1; int blocksize = 1;
int forced_base = 0;
apply_mode = obj->p; apply_mode = obj->p;
ret = set_value(buf, obj, apply_mode); ret = set_value(buf, obj, apply_mode);
...@@ -1449,24 +1450,27 @@ static int set_sdb(uint8_t *buf, struct snmp_oid *obj) ...@@ -1449,24 +1450,27 @@ static int set_sdb(uint8_t *buf, struct snmp_oid *obj)
return ret; return ret;
snmp_verbose("%s enter\n", __func__); snmp_verbose("%s enter\n", __func__);
if (sdb_mem_type == -1 //if (sdb_base_addr == -1
|| sdb_base_addr == -1 // || sdb_param == -1) {
|| sdb_param == -1) { // *apply_mode = applyFailedEmptyParam;
*apply_mode = applyFailedEmptyParam; // pp_printf("%s wrong params\n", __func__);
pp_printf("%s wrong params\n", __func__); // return ret;
return ret; //}
}
//if (sdb_mem_type == MEM_FLASH)
if (sdb_mem_type == MEM_FLASH) // blocksize = sdb_param * 1024;
blocksize = sdb_param * 1024; //else if (sdb_param)
else if (sdb_param) // i2c_adr = sdb_param;
i2c_adr = sdb_param;
if (sdb_base_addr == -1)
forced_base = 0;
else
forced_base = 1;
switch (*apply_mode) { switch (*apply_mode) {
case writeToFlash: case writeToFlash:
snmp_verbose("%s writeToFlash\n", __func__); snmp_verbose("%s writeToFlash\n", __func__);
if (storage_gensdbfs(sdb_mem_type, sdb_base_addr, blocksize, if (storage_sdbfs_format( &wrc_storage_dev, sdb_base_addr, forced_base) < 0)
i2c_adr) < 0)
*apply_mode = applyFailed; *apply_mode = applyFailed;
else else
*apply_mode = applySuccessful; *apply_mode = applySuccessful;
...@@ -1474,8 +1478,7 @@ static int set_sdb(uint8_t *buf, struct snmp_oid *obj) ...@@ -1474,8 +1478,7 @@ static int set_sdb(uint8_t *buf, struct snmp_oid *obj)
case eraseFlash: case eraseFlash:
snmp_verbose("%s eraseFlash\n", __func__); snmp_verbose("%s eraseFlash\n", __func__);
if (storage_sdbfs_erase(sdb_mem_type, sdb_base_addr, blocksize, if (storage_sdbfs_erase( &wrc_storage_dev, sdb_base_addr, forced_base) < 0)
i2c_adr) < 0)
*apply_mode = applyFailed; *apply_mode = applyFailed;
else else
*apply_mode = applySuccessful; *apply_mode = applySuccessful;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment