From: Thomas Veerman Date: Mon, 30 Jan 2012 14:32:31 +0000 (+0000) Subject: e1000: reset hardware before stopping X-Git-Tag: v3.2.0~95 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/host.html?a=commitdiff_plain;h=d5210e9bddd8713da4db2b72de33496c690767a9;p=minix.git e1000: reset hardware before stopping --- diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index c9980b1a6..1de3a2a77 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -47,7 +47,7 @@ _PROTOTYPE( PRIVATE void e1000_readv_s, (message *mp, int from_int) ); _PROTOTYPE( PRIVATE void e1000_getstat_s, (message *mp) ); _PROTOTYPE( PRIVATE void e1000_interrupt, (message *mp) ); _PROTOTYPE( PRIVATE int e1000_link_changed, (e1000_t *e) ); -_PROTOTYPE( PRIVATE void e1000_stop, (void) ); +_PROTOTYPE( PRIVATE void e1000_stop, (e1000_t *e) ); _PROTOTYPE( PRIVATE uint32_t e1000_reg_read, (e1000_t *e, uint32_t reg) ); _PROTOTYPE( PRIVATE void e1000_reg_write, (e1000_t *e, uint32_t reg, uint32_t value) ); @@ -169,12 +169,15 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) *===========================================================================*/ PRIVATE void sef_cb_signal_handler(int signo) { - E1000_DEBUG(3, ("e1000: got signal\n")); + e1000_t *e; + e = &e1000_state; + + E1000_DEBUG(3, ("%s: got signal\n", e->name)); /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; - e1000_stop(); + e1000_stop(e); } /*===========================================================================* @@ -862,9 +865,13 @@ e1000_t *e; /*===========================================================================* * e1000_stop * *===========================================================================*/ -PRIVATE void e1000_stop() +PRIVATE void e1000_stop(e) +e1000_t *e; { - E1000_DEBUG(3, ("e1000: stop()\n")); + E1000_DEBUG(3, ("%s: stop()\n", e->name)); + + e1000_reset_hw(e); + exit(EXIT_SUCCESS); }