Commit df12c1f543b228daae7a2fbcfd3bb12a6faab38a
Committed by
Paul Brook
1 parent
068daedd
Fix xilinx_ethlite breakage by 4f1c942b
Namely the new xilinx_ethlite used by mircoblaze. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Showing
1 changed file
with
8 additions
and
8 deletions
hw/xilinx_ethlite.c
| ... | ... | @@ -160,28 +160,28 @@ static CPUWriteMemoryFunc *eth_write[] = { |
| 160 | 160 | NULL, NULL, ð_writel, |
| 161 | 161 | }; |
| 162 | 162 | |
| 163 | -static int eth_can_rx(void *opaque) | |
| 163 | +static int eth_can_rx(VLANClientState *vc) | |
| 164 | 164 | { |
| 165 | - struct xlx_ethlite *s = opaque; | |
| 165 | + struct xlx_ethlite *s = vc->opaque; | |
| 166 | 166 | int r; |
| 167 | 167 | r = !(s->regs[R_RX_CTRL0] & CTRL_S); |
| 168 | 168 | qemu_log("%s %d\n", __func__, r); |
| 169 | 169 | return r; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | -static void eth_rx(void *opaque, const uint8_t *buf, int size) | |
| 172 | +static ssize_t eth_rx(VLANClientState *vc, const uint8_t *buf, size_t size) | |
| 173 | 173 | { |
| 174 | - struct xlx_ethlite *s = opaque; | |
| 174 | + struct xlx_ethlite *s = vc->opaque; | |
| 175 | 175 | unsigned int rxbase = s->rxbuf * (0x800 / 4); |
| 176 | 176 | int i; |
| 177 | 177 | |
| 178 | 178 | /* DA filter. */ |
| 179 | 179 | if (!(buf[0] & 0x80) && memcmp(&s->macaddr[0], buf, 6)) |
| 180 | - return; | |
| 180 | + return size; | |
| 181 | 181 | |
| 182 | 182 | if (s->regs[rxbase + R_RX_CTRL0] & CTRL_S) { |
| 183 | 183 | D(qemu_log("ethlite lost packet %x\n", s->regs[R_RX_CTRL0])); |
| 184 | - return; | |
| 184 | + return -1; | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | D(qemu_log("%s %d rxbase=%x\n", __func__, size, rxbase)); |
| ... | ... | @@ -199,7 +199,7 @@ static void eth_rx(void *opaque, const uint8_t *buf, int size) |
| 199 | 199 | |
| 200 | 200 | /* If c_rx_pingpong was set flip buffers. */ |
| 201 | 201 | s->rxbuf ^= s->c_rx_pingpong; |
| 202 | - return; | |
| 202 | + return size; | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | static void eth_cleanup(VLANClientState *vc) |
| ... | ... | @@ -223,7 +223,7 @@ static void xilinx_ethlite_init(SysBusDevice *dev) |
| 223 | 223 | |
| 224 | 224 | qdev_get_macaddr(&dev->qdev, s->macaddr); |
| 225 | 225 | s->vc = qdev_get_vlan_client(&dev->qdev, |
| 226 | - eth_rx, eth_can_rx, eth_cleanup, s); | |
| 226 | + eth_can_rx, eth_rx, NULL, eth_cleanup, s); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static void xilinx_ethlite_register(void) | ... | ... |