[pxe] Fix interoperability with the Intel DOS UNDI driver
authorMichael Brown <mcb30@etherboot.org>
Tue, 23 Jun 2009 21:42:55 +0000 (22:42 +0100)
committerMichael Brown <mcb30@etherboot.org>
Tue, 23 Jun 2009 21:42:55 +0000 (22:42 +0100)
The Intel DOS UNDI driver fails when run on top of gPXE because we do
not fill in the ServiceFlags field in PXENV_UNDI_GET_IFACE_INFO.

Fix by filling in the ServiceFlags field with reasonable values
indicating our approximate feature capabilities.

src/arch/i386/include/pxe_api.h
src/arch/i386/interface/pxe/pxe_undi.c

index b72c1ec..fd4dd7a 100644 (file)
@@ -1417,6 +1417,25 @@ extern PXENV_EXIT_t pxenv_undi_get_nic_type (
 /** PXE API function code for pxenv_undi_get_iface_info() */
 #define        PXENV_UNDI_GET_IFACE_INFO       0x0013
 
 /** PXE API function code for pxenv_undi_get_iface_info() */
 #define        PXENV_UNDI_GET_IFACE_INFO       0x0013
 
+/** Broadcast supported */
+#define SUPPORTED_BROADCAST            0x0001
+/** Multicast supported */
+#define SUPPORTED_MULTICAST            0x0002
+/** Functional/group addressing supported */
+#define SUPPORTED_GROUP                        0x0004
+/** Promiscuous mode supported */
+#define SUPPORTED_PROMISCUOUS          0x0008
+/** Software settable station address */
+#define SUPPORTED_SET_STATION_ADDRESS  0x0010
+/** InitiateDiagnostics supported */
+#define SUPPORTED_DIAGNOSTICS          0x0040
+/** Reset MAC supported */
+#define SUPPORTED_RESET                        0x0400
+/** Open / Close Adapter supported */
+#define SUPPORTED_OPEN_CLOSE           0x0800
+/** Interrupt Request supported */
+#define SUPPORTED_IRQ                  0x1000
+
 /** Parameter block for pxenv_undi_get_iface_info() */
 struct s_PXENV_UNDI_GET_IFACE_INFO {
        PXENV_STATUS_t  Status;         /**< PXE status code */
 /** Parameter block for pxenv_undi_get_iface_info() */
 struct s_PXENV_UNDI_GET_IFACE_INFO {
        PXENV_STATUS_t  Status;         /**< PXE status code */
index 90e837c..fd07f14 100644 (file)
@@ -534,7 +534,10 @@ PXENV_EXIT_t pxenv_undi_get_iface_info ( struct s_PXENV_UNDI_GET_IFACE_INFO
        snprintf ( ( char * ) undi_get_iface_info->IfaceType,
                   sizeof ( undi_get_iface_info->IfaceType ), "gPXE" );
        undi_get_iface_info->LinkSpeed = 10000000; /* 10 Mbps */
        snprintf ( ( char * ) undi_get_iface_info->IfaceType,
                   sizeof ( undi_get_iface_info->IfaceType ), "gPXE" );
        undi_get_iface_info->LinkSpeed = 10000000; /* 10 Mbps */
-       undi_get_iface_info->ServiceFlags = 0;
+       undi_get_iface_info->ServiceFlags =
+               ( SUPPORTED_BROADCAST | SUPPORTED_MULTICAST |
+                 SUPPORTED_SET_STATION_ADDRESS | SUPPORTED_RESET |
+                 SUPPORTED_OPEN_CLOSE | SUPPORTED_IRQ );
        memset ( undi_get_iface_info->Reserved, 0,
                 sizeof(undi_get_iface_info->Reserved) );
 
        memset ( undi_get_iface_info->Reserved, 0,
                 sizeof(undi_get_iface_info->Reserved) );