From: David van Moolenbroek Date: Sat, 28 Nov 2009 13:28:55 +0000 (+0000) Subject: Alternative VirtualBox/Lance driver workaround X-Git-Tag: v3.1.6~186 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch10.html?a=commitdiff_plain;h=ad259e92afd7b80eb4494f405f560540e135ca34;p=minix.git Alternative VirtualBox/Lance driver workaround --- diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index ec94bbf5b..38c22f46c 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -487,7 +487,6 @@ message *mp; int port; ether_card_t *ec; message reply_mess; - static int first_time = 1; pci_init(); @@ -562,11 +561,8 @@ message *mp; ec->flags |= ECF_BROAD; ec->client = mp->m_source; - if (first_time) - { - first_time = 0; - ec_reinit(ec); - } + + ec_reinit(ec); reply_mess.m_type = DL_CONF_REPLY; reply_mess.m3_i1 = mp->DL_PORT; diff --git a/servers/inet/mnx_eth.c b/servers/inet/mnx_eth.c index 440e348da..798d87cfc 100644 --- a/servers/inet/mnx_eth.c +++ b/servers/inet/mnx_eth.c @@ -124,6 +124,7 @@ PUBLIC void osdep_eth_init() eth_port->etp_osdep.etp_port= ecp->ec_port; eth_port->etp_osdep.etp_task= tasknr; + eth_port->etp_osdep.etp_recvconf= 0; eth_port->etp_osdep.etp_send_ev= 0; ev_init(ð_port->etp_osdep.etp_recvev); @@ -554,7 +555,7 @@ eth_port_t *eth_port; u32_t flags; { int r; - unsigned dl_flags; + unsigned dl_flags, mask; message mess, repl_mess; assert(!eth_port->etp_vlan); @@ -577,6 +578,13 @@ u32_t flags; return; } + mask = NWEO_EN_BROAD | NWEO_EN_MULTI | NWEO_EN_PROMISC; + if ((eth_port->etp_osdep.etp_recvconf & mask) == (flags & mask)) + { + /* No change for the driver, so don't send an update */ + return; + } + eth_port->etp_osdep.etp_recvconf= flags; dl_flags= DL_NOMODE; if (flags & NWEO_EN_BROAD) diff --git a/servers/inet/sr.c b/servers/inet/sr.c index 25e4282af..c374534fe 100644 --- a/servers/inet/sr.c +++ b/servers/inet/sr.c @@ -95,9 +95,9 @@ FORWARD _PROTOTYPE ( void sr_status, (message *m) ); #endif FORWARD _PROTOTYPE ( void sr_reply_, (mq_t *m, int reply, int is_revive) ); FORWARD _PROTOTYPE ( sr_fd_t *sr_getchannel, (int minor)); -FORWARD _PROTOTYPE ( acc_t *sr_get_userdata, (int fd, vir_bytes offset, - vir_bytes count, int for_ioctl) ); -FORWARD _PROTOTYPE ( int sr_put_userdata, (int fd, vir_bytes offset, +FORWARD _PROTOTYPE ( acc_t *sr_get_userdata, (int fd, size_t offset, + size_t count, int for_ioctl) ); +FORWARD _PROTOTYPE ( int sr_put_userdata, (int fd, size_t offset, acc_t *data, int for_ioctl) ); #ifdef __minix_vmd #define sr_select_res 0 @@ -876,8 +876,8 @@ int is_revive; PRIVATE acc_t *sr_get_userdata (fd, offset, count, for_ioctl) int fd; -vir_bytes offset; -vir_bytes count; +size_t offset; +size_t count; int for_ioctl; { sr_fd_t *loc_fd; @@ -966,7 +966,7 @@ assert (loc_fd->srf_flags & ip_flag); PRIVATE int sr_put_userdata (fd, offset, data, for_ioctl) int fd; -vir_bytes offset; +size_t offset; acc_t *data; int for_ioctl; {