Lines Matching refs:val

981         uint32_t val, rxdw0,rxdw1,rxbufLO,rxbufHI;  in rtl8139_do_receive()  local
983 cpu_physical_memory_read(cplus_rx_ring_desc, (uint8_t *)&val, 4); in rtl8139_do_receive()
984 rxdw0 = le32_to_cpu(val); in rtl8139_do_receive()
985 cpu_physical_memory_read(cplus_rx_ring_desc+4, (uint8_t *)&val, 4); in rtl8139_do_receive()
986 rxdw1 = le32_to_cpu(val); in rtl8139_do_receive()
987 cpu_physical_memory_read(cplus_rx_ring_desc+8, (uint8_t *)&val, 4); in rtl8139_do_receive()
988 rxbufLO = le32_to_cpu(val); in rtl8139_do_receive()
989 cpu_physical_memory_read(cplus_rx_ring_desc+12, (uint8_t *)&val, 4); in rtl8139_do_receive()
990 rxbufHI = le32_to_cpu(val); in rtl8139_do_receive()
1043 val = cpu_to_le32(crc32(0, buf, size)); in rtl8139_do_receive()
1045 val = 0; in rtl8139_do_receive()
1047 cpu_physical_memory_write( rx_addr+size, (uint8_t *)&val, 4); in rtl8139_do_receive()
1095 val = cpu_to_le32(rxdw0); in rtl8139_do_receive()
1096 cpu_physical_memory_write(cplus_rx_ring_desc, (uint8_t *)&val, 4); in rtl8139_do_receive()
1097 val = cpu_to_le32(rxdw1); in rtl8139_do_receive()
1098 cpu_physical_memory_write(cplus_rx_ring_desc+4, (uint8_t *)&val, 4); in rtl8139_do_receive()
1142 uint32_t val = cpu_to_le32(packet_header); in rtl8139_do_receive() local
1144 rtl8139_write_buffer(s, (uint8_t *)&val, 4); in rtl8139_do_receive()
1150 val = cpu_to_le32(crc32(0, buf, size)); in rtl8139_do_receive()
1152 val = 0; in rtl8139_do_receive()
1155 rtl8139_write_buffer(s, (uint8_t *)&val, 4); in rtl8139_do_receive()
1365 static void rtl8139_ChipCmd_write(RTL8139State *s, uint32_t val) in rtl8139_ChipCmd_write() argument
1367 val &= 0xff; in rtl8139_ChipCmd_write()
1369 DPRINTF("ChipCmd write val=0x%08x\n", val); in rtl8139_ChipCmd_write()
1371 if (val & CmdReset) in rtl8139_ChipCmd_write()
1376 if (val & CmdRxEnb) in rtl8139_ChipCmd_write()
1382 if (val & CmdTxEnb) in rtl8139_ChipCmd_write()
1390 val = SET_MASKED(val, 0xe3, s->bChipCmdState); in rtl8139_ChipCmd_write()
1393 val &= ~CmdReset; in rtl8139_ChipCmd_write()
1395 s->bChipCmdState = val; in rtl8139_ChipCmd_write()
1425 static void rtl8139_CpCmd_write(RTL8139State *s, uint32_t val) in rtl8139_CpCmd_write() argument
1427 val &= 0xffff; in rtl8139_CpCmd_write()
1429 DPRINTF("C+ command register write(w) val=0x%04x\n", val); in rtl8139_CpCmd_write()
1434 val = SET_MASKED(val, 0xff84, s->CpCmd); in rtl8139_CpCmd_write()
1436 s->CpCmd = val; in rtl8139_CpCmd_write()
1448 static void rtl8139_IntrMitigate_write(RTL8139State *s, uint32_t val) in rtl8139_IntrMitigate_write() argument
1450 DPRINTF("C+ IntrMitigate register write(w) val=0x%04x\n", val); in rtl8139_IntrMitigate_write()
1474 static void rtl8139_BasicModeCtrl_write(RTL8139State *s, uint32_t val) in rtl8139_BasicModeCtrl_write() argument
1476 val &= 0xffff; in rtl8139_BasicModeCtrl_write()
1478 DPRINTF("BasicModeCtrl register write(w) val=0x%04x\n", val); in rtl8139_BasicModeCtrl_write()
1491 val = SET_MASKED(val, mask, s->BasicModeCtrl); in rtl8139_BasicModeCtrl_write()
1493 s->BasicModeCtrl = val; in rtl8139_BasicModeCtrl_write()
1505 static void rtl8139_BasicModeStatus_write(RTL8139State *s, uint32_t val) in rtl8139_BasicModeStatus_write() argument
1507 val &= 0xffff; in rtl8139_BasicModeStatus_write()
1509 DPRINTF("BasicModeStatus register write(w) val=0x%04x\n", val); in rtl8139_BasicModeStatus_write()
1512 val = SET_MASKED(val, 0xff3f, s->BasicModeStatus); in rtl8139_BasicModeStatus_write()
1514 s->BasicModeStatus = val; in rtl8139_BasicModeStatus_write()
1526 static void rtl8139_Cfg9346_write(RTL8139State *s, uint32_t val) in rtl8139_Cfg9346_write() argument
1528 val &= 0xff; in rtl8139_Cfg9346_write()
1530 DPRINTF("Cfg9346 write val=0x%02x\n", val); in rtl8139_Cfg9346_write()
1533 val = SET_MASKED(val, 0x31, s->Cfg9346); in rtl8139_Cfg9346_write()
1535 uint32_t opmode = val & 0xc0; in rtl8139_Cfg9346_write()
1536 uint32_t eeprom_val = val & 0xf; in rtl8139_Cfg9346_write()
1546 val = 0; in rtl8139_Cfg9346_write()
1550 s->Cfg9346 = val; in rtl8139_Cfg9346_write()
1578 static void rtl8139_Config0_write(RTL8139State *s, uint32_t val) in rtl8139_Config0_write() argument
1580 val &= 0xff; in rtl8139_Config0_write()
1582 DPRINTF("Config0 write val=0x%02x\n", val); in rtl8139_Config0_write()
1588 val = SET_MASKED(val, 0xf8, s->Config0); in rtl8139_Config0_write()
1590 s->Config0 = val; in rtl8139_Config0_write()
1602 static void rtl8139_Config1_write(RTL8139State *s, uint32_t val) in rtl8139_Config1_write() argument
1604 val &= 0xff; in rtl8139_Config1_write()
1606 DPRINTF("Config1 write val=0x%02x\n", val); in rtl8139_Config1_write()
1612 val = SET_MASKED(val, 0xC, s->Config1); in rtl8139_Config1_write()
1614 s->Config1 = val; in rtl8139_Config1_write()
1626 static void rtl8139_Config3_write(RTL8139State *s, uint32_t val) in rtl8139_Config3_write() argument
1628 val &= 0xff; in rtl8139_Config3_write()
1630 DPRINTF("Config3 write val=0x%02x\n", val); in rtl8139_Config3_write()
1636 val = SET_MASKED(val, 0x8F, s->Config3); in rtl8139_Config3_write()
1638 s->Config3 = val; in rtl8139_Config3_write()
1650 static void rtl8139_Config4_write(RTL8139State *s, uint32_t val) in rtl8139_Config4_write() argument
1652 val &= 0xff; in rtl8139_Config4_write()
1654 DPRINTF("Config4 write val=0x%02x\n", val); in rtl8139_Config4_write()
1660 val = SET_MASKED(val, 0x0a, s->Config4); in rtl8139_Config4_write()
1662 s->Config4 = val; in rtl8139_Config4_write()
1674 static void rtl8139_Config5_write(RTL8139State *s, uint32_t val) in rtl8139_Config5_write() argument
1676 val &= 0xff; in rtl8139_Config5_write()
1678 DPRINTF("Config5 write val=0x%02x\n", val); in rtl8139_Config5_write()
1681 val = SET_MASKED(val, 0x80, s->Config5); in rtl8139_Config5_write()
1683 s->Config5 = val; in rtl8139_Config5_write()
1695 static void rtl8139_TxConfig_write(RTL8139State *s, uint32_t val) in rtl8139_TxConfig_write() argument
1699 DPRINTF("transmitter disabled; no TxConfig write val=0x%08x\n", val); in rtl8139_TxConfig_write()
1703 DPRINTF("TxConfig write val=0x%08x\n", val); in rtl8139_TxConfig_write()
1705 val = SET_MASKED(val, TxVersionMask | 0x8070f80f, s->TxConfig); in rtl8139_TxConfig_write()
1707 s->TxConfig = val; in rtl8139_TxConfig_write()
1710 static void rtl8139_TxConfig_writeb(RTL8139State *s, uint32_t val) in rtl8139_TxConfig_writeb() argument
1712 DPRINTF("RTL8139C TxConfig via write(b) val=0x%02x\n", val); in rtl8139_TxConfig_writeb()
1716 tc |= (val & 0x000000FF); in rtl8139_TxConfig_writeb()
1729 static void rtl8139_RxConfig_write(RTL8139State *s, uint32_t val) in rtl8139_RxConfig_write() argument
1731 DPRINTF("RxConfig write val=0x%08x\n", val); in rtl8139_RxConfig_write()
1734 val = SET_MASKED(val, 0xf0fc0040, s->RxConfig); in rtl8139_RxConfig_write()
1736 s->RxConfig = val; in rtl8139_RxConfig_write()
1927 uint32_t val, txdw0,txdw1,txbufLO,txbufHI; in rtl8139_cplus_transmit_one() local
1929 cpu_physical_memory_read(cplus_tx_ring_desc, (uint8_t *)&val, 4); in rtl8139_cplus_transmit_one()
1930 txdw0 = le32_to_cpu(val); in rtl8139_cplus_transmit_one()
1932 cpu_physical_memory_read(cplus_tx_ring_desc+4, (uint8_t *)&val, 4); in rtl8139_cplus_transmit_one()
1933 txdw1 = le32_to_cpu(val); in rtl8139_cplus_transmit_one()
1934 cpu_physical_memory_read(cplus_tx_ring_desc+8, (uint8_t *)&val, 4); in rtl8139_cplus_transmit_one()
1935 txbufLO = le32_to_cpu(val); in rtl8139_cplus_transmit_one()
1936 cpu_physical_memory_read(cplus_tx_ring_desc+12, (uint8_t *)&val, 4); in rtl8139_cplus_transmit_one()
1937 txbufHI = le32_to_cpu(val); in rtl8139_cplus_transmit_one()
2072 val = cpu_to_le32(txdw0); in rtl8139_cplus_transmit_one()
2073 cpu_physical_memory_write(cplus_tx_ring_desc, (uint8_t *)&val, 4); in rtl8139_cplus_transmit_one()
2418 static void rtl8139_TxStatus_write(RTL8139State *s, uint32_t txRegOffset, uint32_t val) in rtl8139_TxStatus_write() argument
2428 "descriptor=%d\n", txRegOffset, val, descriptor); in rtl8139_TxStatus_write()
2431 s->TxStatus[descriptor] = val; in rtl8139_TxStatus_write()
2433 if (descriptor == 0 && (val & 0x8)) in rtl8139_TxStatus_write()
2448 txRegOffset, val, descriptor); in rtl8139_TxStatus_write()
2451 val &= ~0xff00c000; /* these bits are reset on write */ in rtl8139_TxStatus_write()
2452 val = SET_MASKED(val, 0x00c00000, s->TxStatus[descriptor]); in rtl8139_TxStatus_write()
2454 s->TxStatus[descriptor] = val; in rtl8139_TxStatus_write()
2510 static void rtl8139_TxAddr_write(RTL8139State *s, uint32_t txAddrOffset, uint32_t val) in rtl8139_TxAddr_write() argument
2512 DPRINTF("TxAddr write offset=0x%x val=0x%08x\n", txAddrOffset, val); in rtl8139_TxAddr_write()
2514 s->TxAddr[txAddrOffset/4] = val; in rtl8139_TxAddr_write()
2526 static void rtl8139_RxBufPtr_write(RTL8139State *s, uint32_t val) in rtl8139_RxBufPtr_write() argument
2528 DPRINTF("RxBufPtr write val=0x%04x\n", val); in rtl8139_RxBufPtr_write()
2531 s->RxBufPtr = MOD2(val + 0x10, s->RxBufferSize); in rtl8139_RxBufPtr_write()
2557 static void rtl8139_RxBuf_write(RTL8139State *s, uint32_t val) in rtl8139_RxBuf_write() argument
2559 DPRINTF("RxBuf write val=0x%08x\n", val); in rtl8139_RxBuf_write()
2561 s->RxBuf = val; in rtl8139_RxBuf_write()
2575 static void rtl8139_IntrMask_write(RTL8139State *s, uint32_t val) in rtl8139_IntrMask_write() argument
2577 DPRINTF("IntrMask write(w) val=0x%04x\n", val); in rtl8139_IntrMask_write()
2580 val = SET_MASKED(val, 0x1e00, s->IntrMask); in rtl8139_IntrMask_write()
2582 s->IntrMask = val; in rtl8139_IntrMask_write()
2598 static void rtl8139_IntrStatus_write(RTL8139State *s, uint32_t val) in rtl8139_IntrStatus_write() argument
2600 DPRINTF("IntrStatus write(w) val=0x%04x\n", val); in rtl8139_IntrStatus_write()
2609 uint16_t newStatus = s->IntrStatus & ~val; in rtl8139_IntrStatus_write()
2651 static void rtl8139_MultiIntr_write(RTL8139State *s, uint32_t val) in rtl8139_MultiIntr_write() argument
2653 DPRINTF("MultiIntr write(w) val=0x%04x\n", val); in rtl8139_MultiIntr_write()
2656 val = SET_MASKED(val, 0xf000, s->MultiIntr); in rtl8139_MultiIntr_write()
2658 s->MultiIntr = val; in rtl8139_MultiIntr_write()
2670 static void rtl8139_io_writeb(void *opaque, uint8_t addr, uint32_t val) in rtl8139_io_writeb() argument
2679 s->phys[addr - MAC0] = val; in rtl8139_io_writeb()
2685 s->mult[addr - MAR0] = val; in rtl8139_io_writeb()
2688 rtl8139_ChipCmd_write(s, val); in rtl8139_io_writeb()
2691 rtl8139_Cfg9346_write(s, val); in rtl8139_io_writeb()
2694 rtl8139_TxConfig_writeb(s, val); in rtl8139_io_writeb()
2697 rtl8139_Config0_write(s, val); in rtl8139_io_writeb()
2700 rtl8139_Config1_write(s, val); in rtl8139_io_writeb()
2703 rtl8139_Config3_write(s, val); in rtl8139_io_writeb()
2706 rtl8139_Config4_write(s, val); in rtl8139_io_writeb()
2709 rtl8139_Config5_write(s, val); in rtl8139_io_writeb()
2714 val); in rtl8139_io_writeb()
2718 DPRINTF("HltClk write val=0x%08x\n", val); in rtl8139_io_writeb()
2719 if (val == 'R') in rtl8139_io_writeb()
2723 else if (val == 'H') in rtl8139_io_writeb()
2730 DPRINTF("C+ TxThresh write(b) val=0x%02x\n", val); in rtl8139_io_writeb()
2731 s->TxThresh = val; in rtl8139_io_writeb()
2735 DPRINTF("C+ TxPoll write(b) val=0x%02x\n", val); in rtl8139_io_writeb()
2736 if (val & (1 << 7)) in rtl8139_io_writeb()
2742 if (val & (1 << 6)) in rtl8139_io_writeb()
2752 val); in rtl8139_io_writeb()
2757 static void rtl8139_io_writew(void *opaque, uint8_t addr, uint32_t val) in rtl8139_io_writew() argument
2766 rtl8139_IntrMask_write(s, val); in rtl8139_io_writew()
2770 rtl8139_IntrStatus_write(s, val); in rtl8139_io_writew()
2774 rtl8139_MultiIntr_write(s, val); in rtl8139_io_writew()
2778 rtl8139_RxBufPtr_write(s, val); in rtl8139_io_writew()
2782 rtl8139_BasicModeCtrl_write(s, val); in rtl8139_io_writew()
2785 rtl8139_BasicModeStatus_write(s, val); in rtl8139_io_writew()
2788 DPRINTF("NWayAdvert write(w) val=0x%04x\n", val); in rtl8139_io_writew()
2789 s->NWayAdvert = val; in rtl8139_io_writew()
2792 DPRINTF("forbidden NWayLPAR write(w) val=0x%04x\n", val); in rtl8139_io_writew()
2795 DPRINTF("NWayExpansion write(w) val=0x%04x\n", val); in rtl8139_io_writew()
2796 s->NWayExpansion = val; in rtl8139_io_writew()
2800 rtl8139_CpCmd_write(s, val); in rtl8139_io_writew()
2804 rtl8139_IntrMitigate_write(s, val); in rtl8139_io_writew()
2809 addr, val); in rtl8139_io_writew()
2811 rtl8139_io_writeb(opaque, addr, val & 0xff); in rtl8139_io_writew()
2812 rtl8139_io_writeb(opaque, addr + 1, (val >> 8) & 0xff); in rtl8139_io_writew()
2857 static void rtl8139_io_writel(void *opaque, uint8_t addr, uint32_t val) in rtl8139_io_writel() argument
2871 rtl8139_TxConfig_write(s, val); in rtl8139_io_writel()
2875 rtl8139_RxConfig_write(s, val); in rtl8139_io_writel()
2879 rtl8139_TxStatus_write(s, addr-TxStatus0, val); in rtl8139_io_writel()
2883 rtl8139_TxAddr_write(s, addr-TxAddr0, val); in rtl8139_io_writel()
2887 rtl8139_RxBuf_write(s, val); in rtl8139_io_writel()
2891 DPRINTF("C+ RxRing low bits write val=0x%08x\n", val); in rtl8139_io_writel()
2892 s->RxRingAddrLO = val; in rtl8139_io_writel()
2896 DPRINTF("C+ RxRing high bits write val=0x%08x\n", val); in rtl8139_io_writel()
2897 s->RxRingAddrHI = val; in rtl8139_io_writel()
2907 DPRINTF("FlashReg TimerInt write val=0x%08x\n", val); in rtl8139_io_writel()
2908 if (s->TimerInt != val) { in rtl8139_io_writel()
2909 s->TimerInt = val; in rtl8139_io_writel()
2916 addr, val); in rtl8139_io_writel()
2917 rtl8139_io_writeb(opaque, addr, val & 0xff); in rtl8139_io_writel()
2918 rtl8139_io_writeb(opaque, addr + 1, (val >> 8) & 0xff); in rtl8139_io_writel()
2919 rtl8139_io_writeb(opaque, addr + 2, (val >> 16) & 0xff); in rtl8139_io_writel()
2920 rtl8139_io_writeb(opaque, addr + 3, (val >> 24) & 0xff); in rtl8139_io_writel()
3149 static void rtl8139_ioport_writeb(void *opaque, uint32_t addr, uint32_t val) in rtl8139_ioport_writeb() argument
3151 rtl8139_io_writeb(opaque, addr & 0xFF, val); in rtl8139_ioport_writeb()
3154 static void rtl8139_ioport_writew(void *opaque, uint32_t addr, uint32_t val) in rtl8139_ioport_writew() argument
3156 rtl8139_io_writew(opaque, addr & 0xFF, val); in rtl8139_ioport_writew()
3159 static void rtl8139_ioport_writel(void *opaque, uint32_t addr, uint32_t val) in rtl8139_ioport_writel() argument
3161 rtl8139_io_writel(opaque, addr & 0xFF, val); in rtl8139_ioport_writel()
3181 static void rtl8139_mmio_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) in rtl8139_mmio_writeb() argument
3183 rtl8139_io_writeb(opaque, addr & 0xFF, val); in rtl8139_mmio_writeb()
3186 static void rtl8139_mmio_writew(void *opaque, target_phys_addr_t addr, uint32_t val) in rtl8139_mmio_writew() argument
3188 rtl8139_io_writew(opaque, addr & 0xFF, val); in rtl8139_mmio_writew()
3191 static void rtl8139_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val) in rtl8139_mmio_writel() argument
3193 rtl8139_io_writel(opaque, addr & 0xFF, val); in rtl8139_mmio_writel()
3203 uint32_t val = rtl8139_io_readw(opaque, addr & 0xFF); in rtl8139_mmio_readw() local
3204 return val; in rtl8139_mmio_readw()
3209 uint32_t val = rtl8139_io_readl(opaque, addr & 0xFF); in rtl8139_mmio_readl() local
3210 return val; in rtl8139_mmio_readl()