Changeset 89c57b6 in mainline for uspace/lib/c/include/net/device.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/net/device.h

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup netif
    30  *  @{
     29/** @addtogroup libc
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  Device identifier, state and usage statistics.
     34 * Device identifier, state and usage statistics.
    3535 */
    3636
    37 #ifndef __NET_DEVICE_ID_TYPE_H__
    38 #define __NET_DEVICE_ID_TYPE_H__
     37#ifndef LIBC_DEVICE_ID_TYPE_H_
     38#define LIBC_DEVICE_ID_TYPE_H_
    3939
    4040#include <adt/int_map.h>
    4141
    42 /** Device identifier to generic type map declaration.
    43  */
    44 #define DEVICE_MAP_DECLARE              INT_MAP_DECLARE
     42/** Device identifier to generic type map declaration. */
     43#define DEVICE_MAP_DECLARE      INT_MAP_DECLARE
    4544
    46 /** Device identifier to generic type map implementation.
    47  */
     45/** Device identifier to generic type map implementation. */
    4846#define DEVICE_MAP_IMPLEMENT    INT_MAP_IMPLEMENT
    4947
    50 /** Invalid device identifier.
    51  */
    52 #define DEVICE_INVALID_ID               (-1)
     48/** Invalid device identifier. */
     49#define DEVICE_INVALID_ID       (-1)
    5350
    54 /** Device identifier type.
    55  */
    56 typedef int     device_id_t;
     51/** Device identifier type. */
     52typedef int device_id_t;
    5753
    58 /** Device state type.
    59  */
    60 typedef enum device_state       device_state_t;
     54/** Device state type. */
     55typedef enum device_state device_state_t;
    6156
    6257/** Type definition of the device usage statistics.
    63  *  @see device_stats
     58 * @see device_stats
    6459 */
    65 typedef struct device_stats     device_stats_t;
     60typedef struct device_stats device_stats_t;
    6661
    67 /** Type definition of the device usage statistics pointer.
    68  *  @see device_stats
    69  */
    70 typedef device_stats_t *        device_stats_ref;
    71 
    72 /** Device state.
    73  */
    74 enum    device_state{
    75         /** Device not present or not initialized.
    76          */
     62/** Device state. */
     63enum device_state {
     64        /** Device not present or not initialized. */
    7765        NETIF_NULL = 0,
    78         /** Device present and stopped.
    79          */
     66        /** Device present and stopped. */
    8067        NETIF_STOPPED,
    81         /** Device present and active.
    82          */
     68        /** Device present and active. */
    8369        NETIF_ACTIVE,
    84         /** Device present but unable to transmit.
    85          */
     70        /** Device present but unable to transmit. */
    8671        NETIF_CARRIER_LOST
    8772};
    8873
    89 /** Device usage statistics.
    90  */
    91 struct  device_stats{
    92         /** Total packets received.
    93          */
     74/** Device usage statistics. */
     75struct device_stats {
     76        /** Total packets received. */
    9477        unsigned long receive_packets;
    95         /** Total packets transmitted.
    96          */
     78        /** Total packets transmitted. */
    9779        unsigned long send_packets;
    98         /** Total bytes received.
    99          */
     80        /** Total bytes received. */
    10081        unsigned long receive_bytes;
    101         /** Total bytes transmitted.
    102          */
     82        /** Total bytes transmitted. */
    10383        unsigned long send_bytes;
    104         /** Bad packets received counter.
    105          */
     84        /** Bad packets received counter. */
    10685        unsigned long receive_errors;
    107         /** Packet transmition problems counter.
    108          */
     86        /** Packet transmition problems counter. */
    10987        unsigned long send_errors;
    110         /** No space in buffers counter.
    111          */
     88        /** No space in buffers counter. */
    11289        unsigned long receive_dropped;
    113         /** No space available counter.
    114          */
     90        /** No space available counter. */
    11591        unsigned long send_dropped;
    116         /** Total multicast packets received.
    117          */
     92        /** Total multicast packets received. */
    11893        unsigned long multicast;
    119         /** The number of collisions due to congestion on the medium.
    120          */
     94        /** The number of collisions due to congestion on the medium. */
    12195        unsigned long collisions;
    12296
    123         /* detailed receive_errors: */
    124         /** Received packet length error counter.
    125         */
     97        /* detailed receive_errors */
     98
     99        /** Received packet length error counter. */
    126100        unsigned long receive_length_errors;
    127         /** Receiver buffer overflow counter.
    128          */
     101        /** Receiver buffer overflow counter. */
    129102        unsigned long receive_over_errors;
    130         /** Received packet with crc error counter.
    131          */
     103        /** Received packet with crc error counter. */
    132104        unsigned long receive_crc_errors;
    133         /** Received frame alignment error counter.
    134          */
     105        /** Received frame alignment error counter. */
    135106        unsigned long receive_frame_errors;
    136         /** Receiver fifo overrun counter.
    137          */
     107        /** Receiver fifo overrun counter. */
    138108        unsigned long receive_fifo_errors;
    139         /** Receiver missed packet counter.
    140          */
     109        /** Receiver missed packet counter. */
    141110        unsigned long receive_missed_errors;
    142111
    143112        /* detailed send_errors */
    144         /** Transmitter aborted counter.
    145         */
     113
     114        /** Transmitter aborted counter. */
    146115        unsigned long send_aborted_errors;
    147         /** Transmitter carrier errors counter.
    148          */
     116        /** Transmitter carrier errors counter. */
    149117        unsigned long send_carrier_errors;
    150         /** Transmitter fifo overrun counter.
    151          */
     118        /** Transmitter fifo overrun counter. */
    152119        unsigned long send_fifo_errors;
    153         /** Transmitter carrier errors counter.
    154          */
     120        /** Transmitter carrier errors counter. */
    155121        unsigned long send_heartbeat_errors;
    156         /** Transmitter window errors counter.
    157          */
     122        /** Transmitter window errors counter. */
    158123        unsigned long send_window_errors;
    159124
    160125        /* for cslip etc */
    161         /** Total compressed packets received.
    162         */
     126       
     127        /** Total compressed packets received. */
    163128        unsigned long receive_compressed;
    164         /** Total compressed packet transmitted.
    165          */
     129        /** Total compressed packet transmitted. */
    166130        unsigned long send_compressed;
    167131};
     
    171135/** @}
    172136 */
    173 
Note: See TracChangeset for help on using the changeset viewer.