[PATCH] Introduce DMA xmit descriptor

Denis Kirjanov kirjanov at gmail.com
Fri Sep 24 09:50:25 EDT 2010


Signed-off-by: Denis Kirjanov <kirjanov at gmail.com>
---
>From datasheet TX/RX descriptors are very similar.
I think that we can merge TX/RX in to one xmit descriptor.
In this case we shoud use
some kind of accessors to different fields.
Any suggestions?

Thanks!
diff --git a/src/pcnet.c b/src/pcnet.c
index 5a3e639..97acc7e 100644
--- a/src/pcnet.c
+++ b/src/pcnet.c
@@ -71,6 +71,20 @@ struct pcnet_dummy_init_block {
 	__le32 tx_ring;
 } __attribute__ ((__packed__));
 
+/* 32bit TX/RX descriptors */
+/* PCnet Software Design Considerations, p.5 */
+struct xmit_descr {
+	__le32 addr;
+	/* The BCNT fields of the transmit and receive descriptors
+	 * are 12-bit negative numbers representing the twos com-
+	 * plement of the buffer size in bytes
+	 */
+	__le16 size;
+	__le16 status;
+	__le32 flags;
+	__le32 reserved;
+};
+
 struct pcnet_private {
 	/* TODO:
 	 * DMA buffer management operations



More information about the Kernel-russian mailing list