Kinsey Moore commented on a discussion on rtemslwip/greth/greth_lwip.c: 
https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/40#note_152521

 > + * MAC address, initializes the TCP/IP stack, sets IP addresses, netmask,
 > + * and gateway, and adds the network interface to LwIP. It also sets the
 > + * interface as default and brings it up.
 > + *
 > + * @param net_interface Pointer to the LwIP network interface structure.
 > + * @param ipaddr        Pointer to the desired IP address (ip_addr_t).
 > + * @param netmask       Pointer to the desired network mask (ip_addr_t).
 > + * @param gateway       Pointer to the desired gateway address (ip_addr_t).
 > + * @param mac_addr      Pointer to 6-byte MAC address. If NULL, a default
 > + *                      MAC address defined by `ETH_MAC_ADDR` is used.
 > + *
 > + * @return int Status code
 > + * @retval SUCCESS       Networking started successfully
 > + * @retval NETIF_ADD_ERR Failed to add the network interface
 > + */
 > +int start_networking(

My suggestion is to pull the implementation of start_networking() out of this 
file leaving anything not used solely by it in this file. If you think there is 
a certain amount of the implementation that would be used by other BSPs, that 
could be factored into a start_networking_shared() but I would likely leave 
that refactoring to later BSP implementations to perform.

As for why I've separated things like this, `start_networking()` is an 
application and test convenience function, not something critical to lwIP or 
the integration thereof. Some applications will use it and others will pull in 
a copy to modify anything that isn't parameterized for that application's use 
case. In the case of ZynqMP, there are 4 GEMs and which is default (or hooked 
up) varies significantly by board, so I've provided a default selection for 
each BSP variant along with the ability to set a different default via 
config.ini.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/40#note_152521
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to