libnetdriver: only block datalink messages

Previously, all incoming messages would be blocked before a DL_CONF
message arrives from the TCP/IP stack. This however makes it impossible
for a driver to process interrupts before the DL_CONF initialization.
This patch blocks only datalink messages before the initial DL_CONF,
and lets through all other messages to the driver.

Change-Id: I89988958c0bff9bb38e0379b66f6142491a67b61
This commit is contained in:
David van Moolenbroek 2013-08-18 12:04:25 +02:00
parent 1e70f9f0b3
commit 4cd78c64a4
2 changed files with 8 additions and 0 deletions

View file

@ -255,6 +255,9 @@
#define DL_RQ_BASE 0x200
#define DL_RS_BASE 0x280
#define IS_DL_RQ(type) (((type) & ~0x7f) == DL_RQ_BASE)
#define IS_DL_RS(type) (((type) & ~0x7f) == DL_RS_BASE)
/* Message types for data link layer requests. */
#define DL_CONF (DL_RQ_BASE + 0)
#define DL_GETSTAT_S (DL_RQ_BASE + 1)

View file

@ -59,6 +59,11 @@ int *status_ptr;
return r;
}
/* Let non-datalink requests through regardless. */
if (!IS_DL_RQ(m_ptr->m_type)) {
return r;
}
/* See if only DL_CONF is to be expected. */
if(conf_expected) {
if(m_ptr->m_type == DL_CONF) {