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 Jan 11, 2024
1 parent 79518b3 commit c7e6ee4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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
13 changes: 10 additions & 3 deletions fsw/pc-rtems/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
#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);

Expand Down Expand Up @@ -63,6 +64,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 +81,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 +205,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 c7e6ee4

Please sign in to comment.