Changes between Version 2 and Version 3 of mnc_driver
- Timestamp:
- Dec 3, 2016, 4:48:33 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
mnc_driver
v2 v3 37 37 == Access Functions == 38 38 39 === 1) void '''_mnc_init'''( ) ===39 === 1) void '''_mnc_init'''( ) === 40 40 This function allocates memory for the RX_CHBUF and TX_CHBUF implementing the RX and TX queues for all channels. It uses a round-robin policy, to distribute one CHBUF 41 41 per cluster if the number of clusters is larger than 2 * NB_NIC_CHANNELS. It initialises both the CHBUF descriptors, 42 42 and the hardware NIC registers. 43 43 44 === 2) unsigned int '''_mnc_writable'''( unsigned int channel, unsigned int length ) ===44 === 2) unsigned int '''_mnc_writable'''( unsigned int channel, unsigned int length ) === 45 45 This function returns a Boolean indicating if an Ethernet packet of a given length can be stored in the TX queue defined by the channel argument. 46 46 The internal state of the queue (write pointer) can be modified if required. … … 59 59 * return a non-zero value if packet can be read / return zero if queue is empty. 60 60 61 === 4) void '''_mnc_write'''( unsigned int channel , void * buffer , unsigned int length ) ===61 === 4) void '''_mnc_write'''( unsigned int channel , void * buffer , unsigned int length ) === 62 62 This function writes an Ethernet packet in the TX queue defined by the channel argument. It should be called after the _mnc_writable() function. 63 63 * '''channel''' : channel index … … 65 65 * '''length''' : Ethernet packet length (bytes) 66 66 67 === 5) int'''_mnc_read'''( unsigned int channel , void * buffer ) ===67 === 5) void '''_mnc_read'''( unsigned int channel , void * buffer ) === 68 68 This function read an Ethernet packet from the RX queue defined by the channel argument. It should be called after the _mnc_readable() function. 69 69 * '''channel''' : channel index 70 70 * '''buffer''' : pointer on buffer containing packet 71 71 72 === 6) void '''_mnc_set_global_register( unsigned int index , unsigned int value ) ===72 === 6) void '''_mnc_set_global_register( unsigned int index , unsigned int value ) === 73 73 This function set a given value in a given NIC global register. 74 74 * '''index''' : register index 75 75 * '''value''' : value to be written 76 76 77 === 7) unsigned int '''_mnc_get_global_register( unsigned int index ) ===77 === 7) unsigned int '''_mnc_get_global_register( unsigned int index ) === 78 78 This function returns the value contained in a given NIC global register. 79 79 * '''index''' : register index … … 82 82 == __ Interrupt Service Routines__ == 83 83 84 === 8) void '''_nic_rx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 85 This interrupt Service Routine handles IRQs from a NIC_RX channel. 86 WARNING : Not fully implemented yet : no IRQ acknowledge... 84 === 8) void '''_mnc_rx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 85 This Interrupt Service Routine handles IRQs from a NIC_RX channel. 87 86 88 === 9) void '''_nic_tx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 89 This interrupt Service Routine handles IRQs from a NIC_TX channel. 90 WARNING : Not fully implemented yet : no IRQ acknowledge... 87 === 9) void '''_mnc_tx_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 88 This Interrupt Service Routine handles IRQs from a NIC_TX channel.