Ignore:
File:
1 edited

Legend:

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

    re526f08 r4eca056  
    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;
    55 
    56 /** Type definition of the Ethernet device specific data pointer.
    57  *  @see eth_device
    58  */
    59 typedef eth_device_t *          eth_device_ref;
     54typedef struct eth_device eth_device_t;
    6055
    6156/** Type definition of the Ethernet protocol specific data.
    62  *  @see eth_proto
     57 * @see eth_proto
    6358 */
    64 typedef struct eth_proto        eth_proto_t;
    65 
    66 /** Type definition of the Ethernet protocol specific data pointer.
    67  *  @see eth_proto
    68  */
    69 typedef eth_proto_t *           eth_proto_ref;
     59typedef struct eth_proto eth_proto_t;
    7060
    7161/** Ethernet device map.
    72  *  Maps devices to the Ethernet device specific data.
    73  *  @see device.h
     62 * Maps devices to the Ethernet device specific data.
     63 * @see device.h
    7464 */
    75 DEVICE_MAP_DECLARE(eth_devices, eth_device_t)
     65DEVICE_MAP_DECLARE(eth_devices, eth_device_t);
    7666
    7767/** Ethernet protocol map.
    78  *  Maps protocol identifiers to the Ethernet protocol specific data.
    79  *  @see int_map.h
     68 * Maps protocol identifiers to the Ethernet protocol specific data.
     69 * @see int_map.h
    8070 */
    81 INT_MAP_DECLARE(eth_protos, eth_proto_t)
     71INT_MAP_DECLARE(eth_protos, eth_proto_t);
    8272
    83 /** Ethernet device specific data.
    84  */
    85 struct  eth_device{
    86         /** Device identifier.
    87          */
     73/** Ethernet device specific data. */
     74struct eth_device {
     75        /** Device identifier. */
    8876        device_id_t device_id;
    89         /** Device driver service.
    90          */
     77        /** Device driver service. */
    9178        services_t service;
    92         /** Driver phone.
    93          */
     79        /** Driver phone. */
    9480        int phone;
    95         /** Maximal transmission unit.
    96          */
     81        /** Maximal transmission unit. */
    9782        size_t mtu;
    98         /** Various device flags.
    99          *  @see ETH_DUMMY
    100          *  @see ETH_MODE_MASK
     83       
     84        /**
     85         * Various device flags.
     86         * @see ETH_DUMMY
     87         * @see ETH_MODE_MASK
    10188         */
    10289        int flags;
    103         /** Actual device hardware address.
    104          */
    105         measured_string_ref addr;
    106         /** Actual device hardware address data.
    107          */
    108         char * addr_data;
     90       
     91        /** Actual device hardware address. */
     92        measured_string_t *addr;
     93        /** Actual device hardware address data. */
     94        char *addr_data;
    10995};
    11096
    111 /** Ethernet protocol specific data.
    112  */
    113 struct eth_proto{
    114         /** Protocol service.
    115          */
     97/** Ethernet protocol specific data. */
     98struct eth_proto {
     99        /** Protocol service. */
    116100        services_t service;
    117         /** Protocol identifier.
    118          */
     101        /** Protocol identifier. */
    119102        int protocol;
    120         /** Protocol module phone.
    121          */
     103        /** Protocol module phone. */
    122104        int phone;
    123105};
    124106
    125 /** Ethernet global data.
    126  */
    127 struct  eth_globals{
    128         /** Networking module phone.
    129          */
     107/** Ethernet global data. */
     108struct eth_globals {
     109        /** Networking module phone. */
    130110        int net_phone;
    131         /** Safety lock for devices.
    132          */
     111        /** Safety lock for devices. */
    133112        fibril_rwlock_t devices_lock;
    134         /** All known Ethernet devices.
    135          */
     113        /** All known Ethernet devices. */
    136114        eth_devices_t devices;
    137         /** Safety lock for protocols.
    138          */
     115        /** Safety lock for protocols. */
    139116        fibril_rwlock_t protos_lock;
    140         /** Protocol map.
    141          *  Service phone map for each protocol.
     117       
     118        /**
     119         * Protocol map.
     120         * Service phone map for each protocol.
    142121         */
    143122        eth_protos_t protos;
    144         /** Broadcast device hardware address.
    145         */
    146         measured_string_ref broadcast_addr;
     123       
     124        /** Broadcast device hardware address. */
     125        measured_string_t *broadcast_addr;
    147126};
    148127
Note: See TracChangeset for help on using the changeset viewer.