[efi] Report errors from attempting to disconnect existing drivers

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[efi] Add ability to dump SNP device mode information

Originally-implemented-by: Curtis Larsen <larsen@dixie.edu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[efi] Reset multicast filter list when setting SNP receive filters

According to the UEFI specification, the MCastFilter parameter (which
we currently pass as NULL, along with a zero MCastFilterCnt) is
optional only if ResetMCastFilter is true.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[efi] Provide centralised definitions of commonly-used GUIDs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[efi] Open device path protocol only at point of use

Some EFI 1.10 systems (observed on an Apple iMac) do not allow us to
open the device path protocol with an attribute of
EFI_OPEN_PROTOCOL_BY_DRIVER and so we cannot maintain a safe,
long-lived pointer to the device path.  Work around this by instead
opening the device path protocol with an attribute of
EFI_OPEN_PROTOCOL_GET_PROTOCOL whenever we need to use it.

Debugged-by: Curtis Larsen <larsen@dixie.edu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[efi] Try various possible SNP receive filters

The behavior observed in the Apple EFI (1.10) RecieveFilters() call
is:

  - failure if any of the PROMISCUOUS or MULTICAST filters are
    included

  - success if only UNICAST is included, however the result is
    UNICAST|BROADCAST

  - success if only UNICAST and BROADCAST are included

  - if UNICAST, or UNICAST|BROADCAST are used, but the previous call
    tried (and failed) to set UNICAST|BROADCAST|MULTICAST, then the
    result is UNICAST|BROADCAST|MULTICAST

Work around this apparently broken SNP implementation by trying
RecieveFilterMask, then falling back to UNICAST|BROADCAST|MULTICAST,
then UNICAST|BROADCAST, and finally UNICAST.

Modified-by: Michael Brown <mcb30@ipxe.org>
Tested-by: Curtis Larsen <larsen@dixie.edu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>