e1000: Preserve link state across device reset
PATCH 1/1 e1000: Preserve link state across device reset
A device reset does not affect the link state, only set_link does.
Signed-off-by Jan Kiszka <[email protected]>
--- hw/e1000.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
hw/e1000.c +5 -0
@@ -1133,6 +1133,11 @@ static void e1000_reset(void *opaque)memmove (d->mac_reg, mac_reg_init,sizeof mac_reg_init); d->rxbuf_min_shift =1 ;memset (&d->tx,0 ,sizeof d->tx); + +if (d->nic->nc.link_down) { + d->mac_reg[STATUS ] &= ~E1000_STATUS_LU ; + d->phy_reg[PHY_STATUS ] &= ~MII_SR_LINK_STATUS ; + } }static NetClientInfo net_e1000_info = {
Signature · 1 line
1.7.3.4
Quoted 13 lines · Jan Kiszka
A device reset does not affect the link state, only
set_linkdoes.Signed-off-by Jan Kiszka <[email protected]>--- hw/e1000.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)hw/e1000.c +0
-0@@ -1133,6 +1133,11 @@ static void e1000_reset(void *opaque)memmove (d->mac_reg, mac_reg_init,sizeof mac_reg_init);
hw/e1000.c static void e1000_reset(void *opaque) · line 1143
Quoted 10 lines
hw/e1000.c +5
-0d->rxbuf_min_shift =1 ;memset (&d->tx,0 ,sizeof d->tx); + +if (d->nic->nc.link_down) { + d->mac_reg[STATUS ] &= ~E1000_STATUS_LU ; + d->phy_reg[PHY_STATUS ] &= ~MII_SR_LINK_STATUS ; + } }static NetClientInfo net_e1000_info = {
May rather go via trivial, sorry.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Stefan Hajnoczi
AppliedQuoted 6 lines · Jan Kiszka
A device reset does not affect the link state, only
set_linkdoes.Signed-off-by Jan Kiszka <[email protected]>--- hw/e1000.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches
Stefan