Skip to contentSkip to conversation

pcnet: Avoid warning when switching back to 16bit mode

PATCH In review Helge Deller 2 participants 2 messages Mar 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcnet: Avoid warning when switching back to 16bit mode

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.

hw/net/pcnet.c +2 -1
index d9ba04bdfc..14eb2fa1b0 100644
@@ -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:
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Helge Deller

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!

Quoted 4 lines

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

Quoted 17 lines
hw/net/pcnet.c +2 -1
index d9ba04bdfc..14eb2fa1b0 100644
@@ -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: