Commit 424b45b1 authored by Alessandro Rubini's avatar Alessandro Rubini

net_path: fold into ppi, no reason to have it external

the pp instance is bound to a network interface, so avoid a separate
allocation.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent b03bc6c0
......@@ -41,7 +41,6 @@ int main(int argc, char **argv)
ppi->parentDS = calloc(1, sizeof(*ppi->parentDS));
ppi->portDS = calloc(1, sizeof(*ppi->portDS));
ppi->timePropertiesDS = calloc(1, sizeof(*ppi->timePropertiesDS));
ppi->net_path = calloc(1, sizeof(*ppi->net_path));
ppi->servo = calloc(1, sizeof(*ppi->servo));
ppi->frgn_master = calloc(1, sizeof(*ppi->frgn_master));
ppi->arch_data = calloc(1, sizeof(struct posix_arch_data));
......@@ -51,7 +50,7 @@ int main(int argc, char **argv)
if ((!ppi->defaultDS) || (!ppi->currentDS) || (!ppi->parentDS)
|| (!ppi->portDS) || (!ppi->timePropertiesDS)
|| (!ppi->net_path) || (!ppi->frgn_master) || (!ppi->arch_data)
|| (!ppi->frgn_master) || (!ppi->arch_data)
)
exit(__LINE__);
......
......@@ -144,7 +144,6 @@ struct pp_instance {
void *arch_data; /* if arch needs it */
void *ext_data; /* if protocol ext needs it */
struct pp_runtime_opts *rt_opts;
struct pp_net_path *net_path;
struct pp_servo *servo;
unsigned long flags; /* ppi-specific flags (diag mainly) */
......@@ -160,6 +159,9 @@ struct pp_instance {
unsigned char rx_buffer[PP_MAX_FRAME_LENGTH];
void *tx_frame, *rx_frame, *tx_ptp, *rx_ptp;
/* The net_path used to be allocated separately, but there's no need */
struct pp_net_path np;
/* Data sets */
DSDefault *defaultDS; /* page 65 */
DSCurrent *currentDS; /* page 67 */
......@@ -236,7 +238,7 @@ static inline struct DSTimeProperties *DSPRO(struct pp_instance *ppi)
static inline struct pp_net_path *NP(struct pp_instance *ppi)
{
return ppi->net_path;
return &ppi->np;
}
static inline struct pp_servo *SRV(struct pp_instance *ppi)
......
......@@ -21,7 +21,6 @@ void ppsi_clear_bss(void)
}
static struct pp_instance ppi_static;
static struct pp_net_path net_path_static;
CONST_VERBOSITY int pp_diag_verbosity = 0;
/* ppi fields */
......@@ -39,7 +38,6 @@ int ppsi_main(int argc, char **argv)
PP_PRINTF("bare: starting. Compiled on %s\n", __DATE__);
ppi->net_path = &net_path_static;
ppi->defaultDS = &defaultDS;
ppi->currentDS = &currentDS;
ppi->parentDS = &parentDS;
......
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