Commit 314d8605 authored by Alessandro Rubini's avatar Alessandro Rubini

pp-instance: include the VLAN list

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 09fe3233
...@@ -106,6 +106,7 @@ int main(int argc, char **argv) ...@@ -106,6 +106,7 @@ int main(int argc, char **argv)
for (i = 0; i < ppg->max_links; i++) { for (i = 0; i < ppg->max_links; i++) {
ppi = INST(ppg, i); ppi = INST(ppg, i);
ppi->glbs = ppg; // must be done before using sim_set_global_DS ppi->glbs = ppg; // must be done before using sim_set_global_DS
ppi->vlans_array_len = CONFIG_VLAN_ARRAY_SIZE;
if (sim_ppi_init(ppi, i)) if (sim_ppi_init(ppi, i))
return -1; return -1;
} }
......
...@@ -88,6 +88,7 @@ int main(int argc, char **argv) ...@@ -88,6 +88,7 @@ int main(int argc, char **argv)
NP(ppi)->ch[PP_NP_GEN].fd = -1; NP(ppi)->ch[PP_NP_GEN].fd = -1;
ppi->glbs = ppg; ppi->glbs = ppg;
ppi->vlans_array_len = CONFIG_VLAN_ARRAY_SIZE,
ppi->iface_name = ppi->cfg.iface_name; ppi->iface_name = ppi->cfg.iface_name;
ppi->port_name = ppi->cfg.port_name; ppi->port_name = ppi->cfg.port_name;
......
...@@ -78,6 +78,7 @@ struct pp_instance ppi_static = { ...@@ -78,6 +78,7 @@ struct pp_instance ppi_static = {
.portDS = &portDS, .portDS = &portDS,
.n_ops = &wrpc_net_ops, .n_ops = &wrpc_net_ops,
.t_ops = &wrpc_time_ops, .t_ops = &wrpc_time_ops,
.vlans_array_len = CONFIG_VLAN_ARRAY_SIZE,
.proto = PP_DEFAULT_PROTO, .proto = PP_DEFAULT_PROTO,
.iface_name = "wr1", .iface_name = "wr1",
.port_name = "wr1", .port_name = "wr1",
......
...@@ -203,6 +203,7 @@ int main(int argc, char **argv) ...@@ -203,6 +203,7 @@ int main(int argc, char **argv)
NP(ppi)->ch[PP_NP_GEN].fd = -1; NP(ppi)->ch[PP_NP_GEN].fd = -1;
ppi->glbs = ppg; ppi->glbs = ppg;
ppi->vlans_array_len = CONFIG_VLAN_ARRAY_SIZE;
ppi->iface_name = ppi->cfg.iface_name; ppi->iface_name = ppi->cfg.iface_name;
ppi->port_name = ppi->cfg.port_name; ppi->port_name = ppi->cfg.port_name;
ppi->portDS = calloc(1, sizeof(*ppi->portDS)); ppi->portDS = calloc(1, sizeof(*ppi->portDS));
......
...@@ -185,7 +185,9 @@ struct pp_instance { ...@@ -185,7 +185,9 @@ struct pp_instance {
char *iface_name; /* for direct actions on hardware */ char *iface_name; /* for direct actions on hardware */
char *port_name; /* for diagnostics, mainly */ char *port_name; /* for diagnostics, mainly */
int port_idx; int port_idx;
int vlans_array_len; /* those looking at shared mem must check */
int vlans[CONFIG_VLAN_ARRAY_SIZE];
int nvlans; /* according to configuration */
struct pp_instance_cfg cfg; struct pp_instance_cfg cfg;
unsigned long ptp_tx_count; unsigned long ptp_tx_count;
......
...@@ -41,6 +41,7 @@ static struct pp_instance ppi_static = { ...@@ -41,6 +41,7 @@ static struct pp_instance ppi_static = {
.t_ops = &bare_time_ops, .t_ops = &bare_time_ops,
.iface_name = "eth0", .iface_name = "eth0",
.port_name = "eth0", .port_name = "eth0",
.vlans_array_len = CONFIG_VLAN_ARRAY_SIZE,
.proto = PP_DEFAULT_PROTO, .proto = PP_DEFAULT_PROTO,
.__tx_buffer = __tx_buffer, .__tx_buffer = __tx_buffer,
.__rx_buffer = __rx_buffer, .__rx_buffer = __rx_buffer,
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
#include <ppsi/lib.h> #include <ppsi/lib.h>
#include "wr-constants.h" #include "wr-constants.h"
#define WRS_PPSI_SHMEM_VERSION 6 /* added fields n_err_state, n_err_offset, #define WRS_PPSI_SHMEM_VERSION 7 /* added vlans */
* n_err_rtt, n_err_deltas to
* wr_servo_state_t */
/* /*
* This structure is used as extension-specific data in the DSPort * This structure is used as extension-specific data in the DSPort
......
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