diff mbox series

pcnet: Avoid warning when switching back to 16bit mode

Message ID 20190311074752.GA17747@ls3530.dellerweb.de
State New
Headers show
Series pcnet: Avoid warning when switching back to 16bit mode | expand

Commit Message

Helge Deller March 11, 2019, 7:47 a.m. UTC
When Linux is shutting down, the pcnet32 driver switches the pcnet card
back to 16bit mode to "avoid problems with dumb DOS packet driver after
a warm reboot".
This triggers the following warning in the qemu pcnet32 emulation:
Bad SWSTYLE=0x04

Avoid this qemu warning by allowing the switch-back to 16bit mode.

Signed-off-by: Helge Deller <deller@gmx.de>

Comments

Philippe Mathieu-Daudé March 11, 2019, 10:11 a.m. UTC | #1
On 3/11/19 8:47 AM, Helge Deller wrote:
> When Linux is shutting down, the pcnet32 driver switches the pcnet card
> back to 16bit mode to "avoid problems with dumb DOS packet driver after
> a warm reboot".
> This triggers the following warning in the qemu pcnet32 emulation:
> Bad SWSTYLE=0x04

This was bugging us for years, thanks!

> 
> Avoid this qemu warning by allowing the switch-back to 16bit mode.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
> diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
> index d9ba04bdfc..14eb2fa1b0 100644
> --- a/hw/net/pcnet.c
> +++ b/hw/net/pcnet.c
> @@ -1496,8 +1496,9 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)
>          case 1:
>              val |= 0x0100;
>              break;
> -        case 2:
> +        case 2: /* 32bit mode */
>          case 3:
> +        case 4: /* 16bit mode */
>              val |= 0x0300;
>              break;
>          default:
>
diff mbox series

Patch

diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index d9ba04bdfc..14eb2fa1b0 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -1496,8 +1496,9 @@  static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)
         case 1:
             val |= 0x0100;
             break;
-        case 2:
+        case 2: /* 32bit mode */
         case 3:
+        case 4: /* 16bit mode */
             val |= 0x0300;
             break;
         default: