Ignore:
File:
1 edited

Legend:

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

    r5cd3d67 rf0b74b2  
    3030#define RTL8139_DRIVER_H_
    3131
     32#include "defs.h"
     33#include "general.h"
    3234#include <sys/types.h>
    3335#include <stdint.h>
    34 #include "defs.h"
    35 #include "general.h"
    3636
    3737/** The driver name */
    38 #define NAME  "rtl8139"
    39 
     38#define NAME "rtl8139"
    4039/** Transmittion buffers count */
    41 #define TX_BUFF_COUNT  4
    42 
    43 /** Size of buffer for one frame (2kB) */
    44 #define TX_BUFF_SIZE  (2 * 1024)
    45 
    46 /** Number of pages to allocate for TxBuffers */
    47 #define TX_PAGES  2
     40#define TX_BUFF_COUNT 4
     41/** Size of buffer for one packet
     42 *  - 2kB
     43 */
     44#define TX_BUFF_SIZE (2 * 1024)
     45/** Count of pages to allocate for TxBuffers */
     46#define TX_PAGES 2
    4847
    4948/** Size of the CRC after the received frame in the receiver buffer */
    50 #define RTL8139_CRC_SIZE  4
    51 
    52 /** The default mode of accepting unicast frames */
    53 #define RTL8139_RCR_UCAST_DEFAULT  RCR_ACCEPT_PHYS_MATCH
    54 
    55 /** The default mode of accepting multicast frames */
    56 #define RTL8139_RCR_MCAST_DEFAULT  0
    57 
    58 /** The default mode of accepting broadcast frames */
    59 #define RTL8139_RCR_BCAST_DEFAULT  RCR_ACCEPT_BROADCAST
    60 
    61 /** The default mode of accepting defect frames */
    62 #define RTL8139_RCR_DEFECT_DEFAULT  0
     49#define RTL8139_CRC_SIZE 4
     50
     51/** The default mode of accepting unicast packets */
     52#define RTL8139_RCR_UCAST_DEFAULT RCR_ACCEPT_PHYS_MATCH
     53/** The default mode of accepting multicast packets */
     54#define RTL8139_RCR_MCAST_DEFAULT 0
     55/** The default mode of accepting broadcast packets */
     56#define RTL8139_RCR_BCAST_DEFAULT RCR_ACCEPT_BROADCAST
     57/** The default mode of accepting defect packets */
     58#define RTL8139_RCR_DEFECT_DEFAULT 0
    6359
    6460/** Mask for accepting all multicast */
    65 #define RTL8139_MCAST_MASK_PROMISC  UINT64_MAX
    66 
    67 /** Data */
     61#define RTL8139_MCAST_MASK_PROMISC UINT64_MAX
     62
     63/** Data  */
    6864struct rtl8139_rcr_data {
    6965        /** Configuration part of RCR */
     
    116112        size_t tx_used;
    117113
    118         /** Buffer for receiving frames */
     114        /** Buffer for receiving packets */
    119115        void *rx_buff_phys;
    120116        void *rx_buff_virt;
     
    138134
    139135        /** Version of RT8139 controller */
    140         rtl8139_version_id_t hw_version;
     136        enum rtl8139_version_id hw_version;
    141137} rtl8139_t;
     138
    142139
    143140/* ***** Pointers casting - for both amd64 and ia32 ***** */
     
    163160 */
    164161#define IOADDR_TO_PTR(ioaddr) ((void*)((size_t)(ioaddr)))
     162
     163
    165164
    166165/* ***** Bit operation macros ***** */
     
    178177 * @return New value
    179178 */
    180 #define bit_set_part_g(src, value, mask, type) \
     179#define bit_set_part_g( src, value, mask, type ) \
    181180        ((type)(((src) & ~((type)(mask))) | ((value) & (type)(mask))))
    182181
     
    238237        bit_set_part_32(tsd_value, (size) << TSD_SIZE_SHIFT, TSD_SIZE_MASK << TSD_SIZE_SHIFT)
    239238
     239
    240240#endif
Note: See TracChangeset for help on using the changeset viewer.