Skip to content

Commit

Permalink
Fix nasa#375, Separate network logic in pc-rtems to support generic t…
Browse files Browse the repository at this point in the history
…argets
  • Loading branch information
skliper committed Nov 14, 2023
1 parent eaf80b1 commit 1b2b747
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fsw/pc-rtems/make/build_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# This indicates where to install target binaries created during the build
# Note - this should be phased out in favor of the staging dir from OSAL BSP
set(INSTALL_SUBDIR "eeprom")
set(INSTALL_SUBDIR "nonvol")

# Some upper-level code may be gated on _RTEMS_OS_ being defined
# This is for compatibility with older build scripts which defined this symbol,
Expand Down
16 changes: 12 additions & 4 deletions fsw/pc-rtems/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
#include <errno.h>
#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
#include <rtems/rtems_dhcp_failsafe.h>
#include <bsp.h>
/* TODO Only needed for network setup, move? */
//#include <rtems/rtems_dhcp_failsafe.h>
//#include <bsp.h>

extern int rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
/* TODO in pc bug not generic, not sure where this comes from */
// extern int rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching);

/*
** cFE includes
Expand All @@ -63,6 +65,8 @@ extern int rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)

rtems_id RtemsTimerId;

/* TODO in pc but not in generic... might be the only unique stuff? */
#if 0
static unsigned char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x61};
static char net_name_str[] = "fxp1";
static char ip_addr_str[] = "10.0.2.17";
Expand All @@ -78,9 +82,11 @@ static struct rtems_bsdnet_ifconfig netdriver_config = {
/* more options can follow */
};


struct rtems_bsdnet_config rtems_bsdnet_config = {
.ifconfig = &netdriver_config, .bootp = rtems_bsdnet_do_dhcp_failsafe, /* fill if DHCP is used*/
};
#endif

/*
** 1 HZ Timer "ISR"
Expand Down Expand Up @@ -200,7 +206,9 @@ void CFE_PSP_Main(void)
/*
** Set up the virtual FS mapping for the "/cf" directory
*/
Status = OS_FileSysAddFixedMap(&fs_id, "/mnt/eeprom", "/cf");
/* TODO maybe make this into a config... or just switch to nonvol */
// Status = OS_FileSysAddFixedMap(&fs_id, "/mnt/eeprom", "/cf");
Status = OS_FileSysAddFixedMap(&fs_id, "/nonvol", "/cf");
if (Status != OS_SUCCESS)
{
/* Print for informational purposes --
Expand Down

0 comments on commit 1b2b747

Please sign in to comment.