+static void rt2x00pci_rxdone_entry(struct rt2x00_dev *rt2x00dev,
+ struct queue_entry *entry)
+{
+ struct sk_buff *skb;
+ struct skb_frame_desc *skbdesc;
+ struct rxdone_entry_desc rxdesc;
+ struct queue_entry_priv_pci *entry_priv = entry->priv_data;
+
+ /*
+ * Allocate a new sk_buffer. If no new buffer available, drop the
+ * received frame and reuse the existing buffer.
+ */
+ skb = rt2x00queue_alloc_skb(entry->queue);
+ if (!skb)
+ return;
+
+ /*
+ * Extract the RXD details.
+ */
+ memset(&rxdesc, 0, sizeof(rxdesc));
+ rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc);
+
+ /*
+ * Copy the received data to the entries' skb.
+ */
+ memcpy(entry->skb->data, entry_priv->data, rxdesc.size);
+ skb_trim(entry->skb, rxdesc.size);
+
+ /*
+ * Fill in skb descriptor
+ */
+ skbdesc = get_skb_frame_desc(entry->skb);
+ memset(skbdesc, 0, sizeof(*skbdesc));
+ skbdesc->desc = entry_priv->desc;
+ skbdesc->desc_len = entry->queue->desc_size;
+ skbdesc->entry = entry;
+
+ /*
+ * Send the frame to rt2x00lib for further processing.
+ */
+ rt2x00lib_rxdone(entry, &rxdesc);
+
+ /*
+ * Replace the entries' skb with the newly allocated one.
+ */
+ entry->skb = skb;
+}
+