AMD PCNET: Difference between revisions

m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (Bot: Replace deprecated source tag with syntaxhighlight)
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
Line 115:
You should also have a variable that stores the current 'pointer' into each buffer (i.e. what is the next one the driver expects to read/write). The card maintains separate pointers internally. You also need a simple way of incrementing the pointer (and wrapping back to the start if necessary).
 
Thus to initialize the ring buffers you'd want something like:<sourcesyntaxhighlight lang="c">int rx_buffer_ptr = 0;
int tx_buffer_ptr = 0; // pointers to transmit/receive buffers
 
Line 175:
if(!is_tx)
des[idx * de_size + 7] = 0x80;
}</sourcesyntaxhighlight>
 
=== Card registers setup ===