Changeset 14419 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 20, 2008 2:50:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r13365 r14419 3156 3156 } 3157 3157 3158 static int pcnetIoportWriteU8(PCNetState *pThis, uint32_t addr, uint32_t val) 3159 { 3160 int rc = VINF_SUCCESS; 3161 3162 #ifdef PCNET_DEBUG_IO 3163 Log2(("#%d pcnetIoportWriteU8: addr=%#010x val=%#06x\n", PCNET_INST_NR, 3164 addr, val)); 3165 #endif 3166 if (RT_LIKELY(!BCR_DWIO(pThis))) 3167 { 3168 switch (addr & 0x0f) 3169 { 3170 case 0x04: /* RESET */ 3171 break; 3172 } 3173 } 3174 else 3175 Log(("#%d pcnetIoportWriteU8: addr=%#010x val=%#06x BCR_DWIO !!\n", PCNET_INST_NR, addr, val)); 3176 3177 return rc; 3178 } 3179 3180 static uint32_t pcnetIoportReadU8(PCNetState *pThis, uint32_t addr, int *pRC) 3181 { 3182 uint32_t val = ~0U; 3183 3184 *pRC = VINF_SUCCESS; 3185 3186 if (RT_LIKELY(!BCR_DWIO(pThis))) 3187 { 3188 switch (addr & 0x0f) 3189 { 3190 case 0x04: /* RESET */ 3191 pcnetSoftReset(pThis); 3192 val = 0; 3193 break; 3194 } 3195 } 3196 else 3197 Log(("#%d pcnetIoportReadU8: addr=%#010x val=%#06x BCR_DWIO !!\n", PCNET_INST_NR, addr, val & 0xff)); 3198 3199 pcnetUpdateIrq(pThis); 3200 3201 skip_update_irq: 3202 #ifdef PCNET_DEBUG_IO 3203 Log2(("#%d pcnetIoportReadU8: addr=%#010x val=%#06x\n", PCNET_INST_NR, addr, val & 0xff)); 3204 #endif 3205 return val; 3206 } 3207 3158 3208 static int pcnetIoportWriteU16(PCNetState *pThis, uint32_t addr, uint32_t val) 3159 3209 { … … 3517 3567 switch (cb) 3518 3568 { 3569 case 1: *pu32 = pcnetIoportReadU8(pThis, Port, &rc); break; 3519 3570 case 2: *pu32 = pcnetIoportReadU16(pThis, Port, &rc); break; 3520 3571 case 4: *pu32 = pcnetIoportReadU32(pThis, Port, &rc); break; 3521 3572 default: 3522 rc = VERR_IOM_IOPORT_UNUSED; 3523 break; 3573 rc = PDMDeviceDBGFStop(pThis->CTX_SUFF(pDevIns), RT_SRC_POS, 3574 "pcnetIOPortRead: unsupported op size: offset=%#10x cb=%u\n", 3575 Port, cb); 3524 3576 } 3525 3577 PDMCritSectLeave(&pThis->CritSect); … … 3558 3610 switch (cb) 3559 3611 { 3612 case 1: rc = pcnetIoportWriteU8(pThis, Port, u32); break; 3560 3613 case 2: rc = pcnetIoportWriteU16(pThis, Port, u32); break; 3561 3614 case 4: rc = pcnetIoportWriteU32(pThis, Port, u32); break; 3562 3615 default: 3563 AssertMsgFailed(("Port=%#x cb=%d u32=%#x\n", Port, cb, u32));3564 rc = VERR_INTERNAL_ERROR;3565 break;3616 rc = PDMDeviceDBGFStop(pThis->CTX_SUFF(pDevIns), RT_SRC_POS, 3617 "pcnetIOPortWrite: unsupported op size: offset=%#10x cb=%u\n", 3618 Port, cb); 3566 3619 } 3567 3620 PDMCritSectLeave(&pThis->CritSect); … … 3609 3662 case 4: *(uint32_t *)pv = pcnetMMIOReadU32(pThis, GCPhysAddr); break; 3610 3663 default: 3611 AssertMsgFailed(("cb=%d\n", cb));3612 rc = VERR_INTERNAL_ERROR;3613 break;3664 rc = PDMDeviceDBGFStop(pThis->CTX_SUFF(pDevIns), RT_SRC_POS, 3665 "pcnetMMIORead: unsupported op size: address=%RGp cb=%u\n", 3666 GCPhysAddr, cb); 3614 3667 } 3615 3668 PDMCritSectLeave(&pThis->CritSect); … … 3662 3715 case 4: pcnetMMIOWriteU32(pThis, GCPhysAddr, *(uint32_t *)pv); break; 3663 3716 default: 3664 AssertMsgFailed(("cb=%d\n", cb));3665 rc = VERR_INTERNAL_ERROR;3666 break;3717 rc = PDMDeviceDBGFStop(pThis->CTX_SUFF(pDevIns), RT_SRC_POS, 3718 "pcnetMMIOWrite: unsupported op size: address=%RGp cb=%u\n", 3719 GCPhysAddr, cb); 3667 3720 } 3668 3721 PDMCritSectLeave(&pThis->CritSect);
Note:
See TracChangeset
for help on using the changeset viewer.