• François Romieu's avatar
    [netdrvr r8169] Conversion of Rx data buffers to PCI DMA · 5231873b
    François Romieu authored
    - endianness is kept in a fscked state as it is in the original code
      (will be adressed in a later patch);
    - rtl8169_rx_clear() walks the buffer ring and releases the allocated
      data buffers. It needs to be used in two places: 
      - rtl8169_init_ring() failure path;
      - normal device release (i.e. rtl8169_close);
    - rtl8169_free_rx_skb() releases a Rx data buffer. Mostly an helper
      for rtl8169_rx_clear(). As such it must:
      - unmap the memory area;
      - release the skb;
      - prevent the ring descriptor from being used again;
    - rtl8169_alloc_rx_skb() prepares a Rx data buffer for use.
      As such it must:
      - allocate an skb;
      - map the memory area;
      - reflect the changes in the ring descriptor.
      This function is balanced by rtl8169_free_rx_skb().
    - rtl8169_unmap_rx() simply helps with the 80-columns limit.
    - rtl8169_rx_fill() walks a given range of the buffer ring and
      try to turn any descriptor into a ready to use one. It returns the
      count of modified descriptors and exits if an allocation fails.
      It can be seen as balanced by rtl8169_rx_clear(). Motivation:
      - partially abstract the (usually big) piece of code for the refill
        logic at the end of the Rx interrupt;
      - factorize the refill logic and the initial ring setup.
    - simple conversion of rtl8169_rx_interrupt() without rx_copybreak
      (will be adressed in a later patch).
    5231873b
r8169.c 29.5 KB