Changeset 90782c36 in mainline for uspace/drv/nic/rtl8169/driver.h


Ignore:
Timestamp:
2014-05-21T19:36:59Z (10 years ago)
Author:
Agnieszka Tabaka <nufcia@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1ac202
Parents:
fef725d
Message:

Work-in-progress driver skeleton, able to read MAC address from the card.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/rtl8169/driver.h

    rfef725d r90782c36  
    3838#define NAME  "rtl8169"
    3939
     40#define TX_BUFF_COUNT   16
     41
     42/** RTL8139 device data */
     43typedef struct rtl8169_data {
     44        /** I/O address of the device */
     45        void *regs_phys;
     46        /** Mapped I/O port */
     47        void *regs;
     48        /** The irq assigned */
     49        int irq;
     50
     51        /** Mask of the turned interupts (IMR value) */
     52        uint16_t int_mask;
     53
     54        /** The memory allocated for the transmittion buffers
     55         *  Each buffer takes 2kB
     56         */
     57        uintptr_t tx_buff_phys;
     58        void *tx_buff_virt;
     59
     60        /** Virtual adresses of the Tx buffers */
     61        void *tx_buff[TX_BUFF_COUNT];
     62
     63        /** The nubmer of the next buffer to use, index = tx_next % TX_BUFF_COUNT */
     64        size_t tx_next;
     65        /** The number of the first used buffer in the row
     66         *
     67         *  tx_used is in the interval tx_next - TX_BUFF_COUNT and tx_next:
     68         *      tx_next - TX_BUFF_COUNT: there is no useable Tx descriptor
     69         *      tx_next: all Tx descriptors are can be used
     70         */
     71        size_t tx_used;
     72
     73        /** Buffer for receiving frames */
     74        uintptr_t rx_buff_phys;
     75        void *rx_buff_virt;
     76
     77        /** Lock for receiver */
     78        fibril_mutex_t rx_lock;
     79        /** Lock for transmitter */
     80        fibril_mutex_t tx_lock;
     81
     82        /** Backward pointer to nic_data */
     83        nic_t *nic_data;
     84
     85} rtl8169_t;
     86
    4087#endif
Note: See TracChangeset for help on using the changeset viewer.