Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/nil/eth/eth.h

    r4eca056 re526f08  
    3232
    3333/** @file
    34  * Ethernet module.
     34 *  Ethernet module.
    3535 */
    3636
    37 #ifndef NET_ETH_H_
    38 #define NET_ETH_H_
     37#ifndef __NET_ETH_H__
     38#define __NET_ETH_H__
    3939
    4040#include <fibril_synch.h>
     
    4545
    4646/** Type definition of the Ethernet global data.
    47  * @see eth_globals
     47 *  @see eth_globals
    4848 */
    49 typedef struct eth_globals eth_globals_t;
     49typedef struct eth_globals      eth_globals_t;
    5050
    5151/** Type definition of the Ethernet device specific data.
    52  * @see eth_device
     52 *  @see eth_device
    5353 */
    54 typedef struct eth_device eth_device_t;
     54typedef struct eth_device       eth_device_t;
     55
     56/** Type definition of the Ethernet device specific data pointer.
     57 *  @see eth_device
     58 */
     59typedef eth_device_t *          eth_device_ref;
    5560
    5661/** Type definition of the Ethernet protocol specific data.
    57  * @see eth_proto
     62 *  @see eth_proto
    5863 */
    59 typedef struct eth_proto eth_proto_t;
     64typedef struct eth_proto        eth_proto_t;
     65
     66/** Type definition of the Ethernet protocol specific data pointer.
     67 *  @see eth_proto
     68 */
     69typedef eth_proto_t *           eth_proto_ref;
    6070
    6171/** Ethernet device map.
    62  * Maps devices to the Ethernet device specific data.
    63  * @see device.h
     72 *  Maps devices to the Ethernet device specific data.
     73 *  @see device.h
    6474 */
    65 DEVICE_MAP_DECLARE(eth_devices, eth_device_t);
     75DEVICE_MAP_DECLARE(eth_devices, eth_device_t)
    6676
    6777/** Ethernet protocol map.
    68  * Maps protocol identifiers to the Ethernet protocol specific data.
    69  * @see int_map.h
     78 *  Maps protocol identifiers to the Ethernet protocol specific data.
     79 *  @see int_map.h
    7080 */
    71 INT_MAP_DECLARE(eth_protos, eth_proto_t);
     81INT_MAP_DECLARE(eth_protos, eth_proto_t)
    7282
    73 /** Ethernet device specific data. */
    74 struct eth_device {
    75         /** Device identifier. */
     83/** Ethernet device specific data.
     84 */
     85struct  eth_device{
     86        /** Device identifier.
     87         */
    7688        device_id_t device_id;
    77         /** Device driver service. */
     89        /** Device driver service.
     90         */
    7891        services_t service;
    79         /** Driver phone. */
     92        /** Driver phone.
     93         */
    8094        int phone;
    81         /** Maximal transmission unit. */
     95        /** Maximal transmission unit.
     96         */
    8297        size_t mtu;
    83        
    84         /**
    85          * Various device flags.
    86          * @see ETH_DUMMY
    87          * @see ETH_MODE_MASK
     98        /** Various device flags.
     99         *  @see ETH_DUMMY
     100         *  @see ETH_MODE_MASK
    88101         */
    89102        int flags;
    90        
    91         /** Actual device hardware address. */
    92         measured_string_t *addr;
    93         /** Actual device hardware address data. */
    94         char *addr_data;
     103        /** Actual device hardware address.
     104         */
     105        measured_string_ref addr;
     106        /** Actual device hardware address data.
     107         */
     108        char * addr_data;
    95109};
    96110
    97 /** Ethernet protocol specific data. */
    98 struct eth_proto {
    99         /** Protocol service. */
     111/** Ethernet protocol specific data.
     112 */
     113struct eth_proto{
     114        /** Protocol service.
     115         */
    100116        services_t service;
    101         /** Protocol identifier. */
     117        /** Protocol identifier.
     118         */
    102119        int protocol;
    103         /** Protocol module phone. */
     120        /** Protocol module phone.
     121         */
    104122        int phone;
    105123};
    106124
    107 /** Ethernet global data. */
    108 struct eth_globals {
    109         /** Networking module phone. */
     125/** Ethernet global data.
     126 */
     127struct  eth_globals{
     128        /** Networking module phone.
     129         */
    110130        int net_phone;
    111         /** Safety lock for devices. */
     131        /** Safety lock for devices.
     132         */
    112133        fibril_rwlock_t devices_lock;
    113         /** All known Ethernet devices. */
     134        /** All known Ethernet devices.
     135         */
    114136        eth_devices_t devices;
    115         /** Safety lock for protocols. */
     137        /** Safety lock for protocols.
     138         */
    116139        fibril_rwlock_t protos_lock;
    117        
    118         /**
    119          * Protocol map.
    120          * Service phone map for each protocol.
     140        /** Protocol map.
     141         *  Service phone map for each protocol.
    121142         */
    122143        eth_protos_t protos;
    123        
    124         /** Broadcast device hardware address. */
    125         measured_string_t *broadcast_addr;
     144        /** Broadcast device hardware address.
     145        */
     146        measured_string_ref broadcast_addr;
    126147};
    127148
Note: See TracChangeset for help on using the changeset viewer.