RP2040: mDNS support in AP mode
Implement mdns in AP mode on RP2 port to allow users to access micropython device by hostname.
ports/rp2: Fix rp2 mDNS issue via new cyw43 driver hooks.
Summary
As a number of users have reported via issues and discussions, the RP2 port of MicroPython has an incomplete mDNS implementation. The code in main.c calls mdns_resp_init() which opens the UDP socket for mDNS. However, no code in the cyw43 driver of the RP2 port makes the proper calls to mdns_resp_add_netif() and mdns_resp_remove_netif() to send the announce packets. The wiznet5k driver does make these calls and was used as a model for these changes.
This PR attempts to address this by very small changes to the ports/rp2/cyw43_configport.h file.
As far as I can tell this driver is currently used only by the RP2 port.
The change uses new cyw43 driver hooks to map via driver macros CYW43_CB_TCPIP_INIT_EXTRA and CYW43_CB_TCPIP_DEINIT_EXTRA to the appropriate LWIP MDNS calls.
Testing
This was tested by building the firmware and deploying to a PicoW, starting a WLAN connection and pinging PicoW.local from several devices on the local network. I also tested changing the hostname from the default.
Trade-offs and Alternatives
Alternatively, if this PR is not accepted we should disable the partial implementation by setting LWIP_MDNS_RESPONDER to 0 in lwipopts.h so that users can implement their own mDNS solutions without E_ADDRINUSE failures. A user should not have to build their own firmware to disable a partial/broken mDNS solution.