vmxnet3_pop_rxc_descr(VMXNET3State *s, int qidx, uint32_t *descr_gen)

{

    uint8_t ring_gen;

    struct Vmxnet3_RxCompDesc rxcd;



    hwaddr daddr =

        vmxnet3_ring_curr_cell_pa(&s->rxq_descr[qidx].comp_ring);



    pci_dma_read(PCI_DEVICE(s), daddr,

                 &rxcd, sizeof(struct Vmxnet3_RxCompDesc));



    ring_gen = vmxnet3_ring_curr_gen(&s->rxq_descr[qidx].comp_ring);



    if (rxcd.gen != ring_gen) {

        *descr_gen = ring_gen;

        vmxnet3_inc_rx_completion_counter(s, qidx);

        return daddr;

    }



    return 0;

}

vmxnet3_pop_rxc_descr(VMXNET3State *s, int qidx, uint32_t *descr_gen)

{

    uint8_t ring_gen;

    struct Vmxnet3_RxCompDesc rxcd;



    hwaddr daddr =

        vmxnet3_ring_curr_cell_pa(&s->rxq_descr[qidx].comp_ring);



    pci_dma_read(PCI_DEVICE(s), daddr,

                 &rxcd, sizeof(struct Vmxnet3_RxCompDesc));



    ring_gen = vmxnet3_ring_curr_gen(&s->rxq_descr[qidx].comp_ring);



    if (rxcd.gen != ring_gen) {

        *descr_gen = ring_gen;

        vmxnet3_inc_rx_completion_counter(s, qidx);

        return daddr;

    }



    return 0;

}

    pci_dma_read(PCI_DEVICE(s), daddr,                  &rxcd, sizeof(struct Vmxnet3_RxCompDesc));
FUNC_0(VMXNET3State *VAR_0, int VAR_1, uint32_t *VAR_2)

{

    uint8_t ring_gen;

    struct Vmxnet3_RxCompDesc VAR_3;



    hwaddr daddr =

        vmxnet3_ring_curr_cell_pa(&VAR_0->rxq_descr[VAR_1].comp_ring);



    pci_dma_read(PCI_DEVICE(VAR_0), daddr,

                 &VAR_3, sizeof(struct Vmxnet3_RxCompDesc));



    ring_gen = vmxnet3_ring_curr_gen(&VAR_0->rxq_descr[VAR_1].comp_ring);



    if (VAR_3.gen != ring_gen) {

        *VAR_2 = ring_gen;

        vmxnet3_inc_rx_completion_counter(VAR_0, VAR_1);

        return daddr;

    }



    return 0;

}

FUNC_0(VMXNET3State *VAR_0, int VAR_1, uint32_t *VAR_2)
{ uint8_t ring_gen; struct Vmxnet3_RxCompDesc VAR_3; hwaddr daddr =
vmxnet3_ring_curr_cell_pa(&VAR_0->rxq_descr[VAR_1].comp_ring); pci_dma_read(PCI_DEVICE(VAR_0), daddr,
&VAR_3, sizeof(struct Vmxnet3_RxCompDesc)); ring_gen = vmxnet3_ring_curr_gen(&VAR_0->rxq_descr[VAR_1].comp_ring); if (VAR_3.gen != ring_gen) { *VAR_2 = ring_gen; vmxnet3_inc_rx_completion_counter(VAR_0, VAR_1); return daddr; } return 0; }