Changeset db96017 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2012-04-07T17:41:44Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b6913b7
Parents:
b69e4c0 (diff), 6bb169b5 (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.

Location:
uspace/lib/c/include
Files:
5 added
25 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/hash_table.h

    rb69e4c0 rdb96017  
    8686extern bool hash_table_create(hash_table_t *, hash_count_t, hash_count_t,
    8787    hash_table_operations_t *);
     88extern void hash_table_clear(hash_table_t *);
    8889extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *);
    8990extern link_t *hash_table_find(hash_table_t *, unsigned long []);
  • uspace/lib/c/include/as.h

    rb69e4c0 rdb96017  
    5959extern int as_area_destroy(void *);
    6060extern void *set_maxheapsize(size_t);
    61 extern void *as_get_mappable_page(size_t);
    6261extern int as_get_physical_mapping(const void *, uintptr_t *);
    6362
  • uspace/lib/c/include/async.h

    rb69e4c0 rdb96017  
    346346 */
    347347
    348 #define async_share_in_start_0_0(exch, dst, size) \
    349         async_share_in_start(exch, dst, size, 0, NULL)
    350 #define async_share_in_start_0_1(exch, dst, size, flags) \
    351         async_share_in_start(exch, dst, size, 0, flags)
    352 #define async_share_in_start_1_0(exch, dst, size, arg) \
    353         async_share_in_start(exch, dst, size, arg, NULL)
    354 #define async_share_in_start_1_1(exch, dst, size, arg, flags) \
    355         async_share_in_start(exch, dst, size, arg, flags)
    356 
    357 extern int async_share_in_start(async_exch_t *, void *, size_t, sysarg_t,
    358     unsigned int *);
     348#define async_share_in_start_0_0(exch, size, dst) \
     349        async_share_in_start(exch, size, 0, NULL, dst)
     350#define async_share_in_start_0_1(exch, size, flags, dst) \
     351        async_share_in_start(exch, size, 0, flags, dst)
     352#define async_share_in_start_1_0(exch, size, arg, dst) \
     353        async_share_in_start(exch, size, arg, NULL, dst)
     354#define async_share_in_start_1_1(exch, size, arg, flags, dst) \
     355        async_share_in_start(exch, size, arg, flags, dst)
     356
     357extern int async_share_in_start(async_exch_t *, size_t, sysarg_t,
     358    unsigned int *, void **);
    359359extern bool async_share_in_receive(ipc_callid_t *, size_t *);
    360360extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
     
    362362extern int async_share_out_start(async_exch_t *, void *, unsigned int);
    363363extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
    364 extern int async_share_out_finalize(ipc_callid_t, void *);
     364extern int async_share_out_finalize(ipc_callid_t, void **);
    365365
    366366/*
  • uspace/lib/c/include/bitops.h

    rb69e4c0 rdb96017  
    4040/** Mask with bit @a n set. */
    4141#define BIT_V(type, n) \
    42     ((type)1 << ((n) - 1))
     42    ((type) 1 << (n))
    4343
    4444/** Mask with rightmost @a n bits set. */
    4545#define BIT_RRANGE(type, n) \
    46     (BIT_V(type, (n) + 1) - 1)
     46    (BIT_V(type, (n)) - 1)
    4747
    4848/** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */
  • uspace/lib/c/include/ddi.h

    rb69e4c0 rdb96017  
    4141
    4242extern int device_assign_devno(void);
    43 extern int physmem_map(void *, void *, unsigned long, int);
     43
     44extern int physmem_map(void *, size_t, unsigned int, void **);
     45
     46extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **);
     47extern int dmamem_map_anonymous(size_t, unsigned int, unsigned int, void **,
     48    void **);
     49extern int dmamem_unmap(void *, size_t);
     50extern int dmamem_unmap_anonymous(void *);
     51
    4452extern int iospace_enable(task_id_t, void *, unsigned long);
    4553extern int pio_enable(void *, size_t, void **);
    46 extern int register_irq(int, int, int, irq_code_t *);
    47 extern int unregister_irq(int, int);
     54
     55extern int irq_register(int, int, int, irq_code_t *);
     56extern int irq_unregister(int, int);
    4857
    4958#endif
  • uspace/lib/c/include/device/hw_res.h

    rb69e4c0 rdb96017  
    4040#include <bool.h>
    4141
     42#define DMA_MODE_ON_DEMAND  0
     43#define DMA_MODE_WRITE      (1 << 2)
     44#define DMA_MODE_READ       (1 << 3)
     45#define DMA_MODE_AUTO       (1 << 4)
     46#define DMA_MODE_DOWN       (1 << 5)
     47#define DMA_MODE_SINGLE     (1 << 6)
     48#define DMA_MODE_BLOCK      (1 << 7)
     49
    4250/** HW resource provider interface */
    4351typedef enum {
    4452        HW_RES_GET_RESOURCE_LIST = 0,
    45         HW_RES_ENABLE_INTERRUPT
     53        HW_RES_ENABLE_INTERRUPT,
     54        HW_RES_DMA_CHANNEL_SETUP,
    4655} hw_res_method_t;
    4756
     
    5059        INTERRUPT,
    5160        IO_RANGE,
    52         MEM_RANGE
     61        MEM_RANGE,
     62        DMA_CHANNEL_8,
     63        DMA_CHANNEL_16,
    5364} hw_res_type_t;
    5465
     
    7788                        int irq;
    7889                } interrupt;
     90               
     91                union {
     92                        unsigned int dma8;
     93                        unsigned int dma16;
     94                } dma_channel;
    7995        } res;
    8096} hw_resource_t;
     
    98114extern bool hw_res_enable_interrupt(async_sess_t *);
    99115
     116extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
     117    uint16_t, uint8_t);
     118
    100119#endif
    101120
  • uspace/lib/c/include/device/pci.h

    rb69e4c0 rdb96017  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2011 Jiri Michalec
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libnet
     29/** @addtogroup libc
    3030 * @{
    3131 */
     32/** @file
     33 */
    3234
    33 #ifndef LIBNET_NETIF_REMOTE_H_
    34 #define LIBNET_NETIF_REMOTE_H_
     35#ifndef LIBC_DEVICE_PCI_H_
     36#define LIBC_DEVICE_PCI_H_
    3537
    36 #include <ipc/services.h>
    37 #include <adt/measured_strings.h>
    38 #include <net/device.h>
    39 #include <net/packet.h>
    4038#include <async.h>
    4139
    42 extern int netif_get_addr_req(async_sess_t *, device_id_t, measured_string_t **,
    43     uint8_t **);
    44 extern int netif_probe_req(async_sess_t *, device_id_t, int, void *);
    45 extern int netif_send_msg(async_sess_t *, device_id_t, packet_t *, services_t);
    46 extern int netif_start_req(async_sess_t *, device_id_t);
    47 extern int netif_stop_req(async_sess_t *, device_id_t);
    48 extern int netif_stats_req(async_sess_t *, device_id_t, device_stats_t *);
    49 extern async_sess_t *netif_bind_service(services_t, device_id_t, services_t,
    50     async_client_conn_t);
     40#define PCI_DEVICE_ID  0x02
     41
     42typedef enum {
     43        IPC_M_CONFIG_SPACE_READ_8,
     44        IPC_M_CONFIG_SPACE_READ_16,
     45        IPC_M_CONFIG_SPACE_READ_32,
     46       
     47        IPC_M_CONFIG_SPACE_WRITE_8,
     48        IPC_M_CONFIG_SPACE_WRITE_16,
     49        IPC_M_CONFIG_SPACE_WRITE_32
     50} pci_dev_iface_funcs_t;
     51
     52extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
     53extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
     54extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
     55
     56extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
     57extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
     58extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
    5159
    5260#endif
  • uspace/lib/c/include/devman.h

    rb69e4c0 rdb96017  
    4646extern void devman_exchange_end(async_exch_t *);
    4747
    48 extern int devman_driver_register(const char *, async_client_conn_t);
     48extern int devman_driver_register(const char *);
    4949extern int devman_add_function(const char *, fun_type_t, match_id_list_t *,
    5050    devman_handle_t, devman_handle_t *);
  • uspace/lib/c/include/errno.h

    rb69e4c0 rdb96017  
    9696#define ENOTCONN  (-10057)
    9797
     98#define ECONNREFUSED  (-10058)
     99
     100#define ECONNABORTED  (-10059)
     101
    98102/** The requested operation was not performed. Try again later. */
    99103#define EAGAIN  (-11002)
  • uspace/lib/c/include/fibril.h

    rb69e4c0 rdb96017  
    4141
    4242#define context_set_generic(c, _pc, stack, size, ptls) \
    43         (c)->pc = (sysarg_t) (_pc); \
    44         (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    45         (c)->tls = (sysarg_t) (ptls);
     43        do { \
     44                (c)->pc = (sysarg_t) (_pc); \
     45                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
     46                (c)->tls = (sysarg_t) (ptls); \
     47        } while (0)
    4648
    4749#define FIBRIL_SERIALIZED  1
  • uspace/lib/c/include/fibril_synch.h

    rb69e4c0 rdb96017  
    107107        fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
    108108
     109typedef void (*fibril_timer_fun_t)(void *);
     110
     111typedef enum {
     112        /** Timer has not been set or has been cleared */
     113        fts_not_set,
     114        /** Timer was set but did not fire yet */
     115        fts_active,
     116        /** Timer has fired and has not been cleared since */
     117        fts_fired,
     118        /** Timer is being destroyed */
     119        fts_cleanup
     120} fibril_timer_state_t;
     121
     122/** Fibril timer.
     123 *
     124 * When a timer is set it executes a callback function (in a separate
     125 * fibril) after a specified time interval. The timer can be cleared
     126 * (canceled) before that. From the return value of fibril_timer_clear()
     127 * one can tell whether the timer fired or not.
     128 */
     129typedef struct {
     130        fibril_mutex_t lock;
     131        fibril_condvar_t cv;
     132        fid_t fibril;
     133        fibril_timer_state_t state;
     134
     135        suseconds_t delay;
     136        fibril_timer_fun_t fun;
     137        void *arg;
     138} fibril_timer_t;
     139
    109140extern void fibril_mutex_initialize(fibril_mutex_t *);
    110141extern void fibril_mutex_lock(fibril_mutex_t *);
     
    129160extern void fibril_condvar_broadcast(fibril_condvar_t *);
    130161
     162extern fibril_timer_t *fibril_timer_create(void);
     163extern void fibril_timer_destroy(fibril_timer_t *);
     164extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t,
     165    void *);
     166extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *);
     167
    131168#endif
    132169
  • uspace/lib/c/include/ipc/dev_iface.h

    rb69e4c0 rdb96017  
    3636typedef enum {
    3737        HW_RES_DEV_IFACE = 0,
     38        /** Character device interface */
    3839        CHAR_DEV_IFACE,
    39 
     40       
     41        /** Network interface controller interface */
     42        NIC_DEV_IFACE,
     43       
    4044        /** Interface provided by any PCI device. */
    4145        PCI_DEV_IFACE,
  • uspace/lib/c/include/ipc/il.h

    rb69e4c0 rdb96017  
    5454        NET_IL_MTU_CHANGED,
    5555       
     56        /**
     57         * Device address changed message
     58         * @see il_addr_changed_msg()
     59         */
     60        NET_IL_ADDR_CHANGED,
     61
    5662        /** Packet received message.
    5763         * @see il_received_msg()
  • uspace/lib/c/include/ipc/ipc.h

    rb69e4c0 rdb96017  
    271271 */
    272272
    273 #define ipc_share_in_start_0_0(phoneid, dst, size) \
    274         ipc_share_in_start((phoneid), (dst), (size), 0, NULL)
    275 #define ipc_share_in_start_0_1(phoneid, dst, size, flags) \
    276         ipc_share_in_start((phoneid), (dst), (size), 0, (flags))
    277 #define ipc_share_in_start_1_0(phoneid, dst, size, arg) \
    278         ipc_share_in_start((phoneid), (dst), (size), (arg), NULL)
    279 #define ipc_share_in_start_1_1(phoneid, dst, size, arg, flags) \
    280         ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
    281 
    282 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
     273#define ipc_share_in_start_0_0(phoneid, size, dst) \
     274        ipc_share_in_start((phoneid), (size), 0, NULL, (dst))
     275#define ipc_share_in_start_0_1(phoneid, size, flags, dst) \
     276        ipc_share_in_start((phoneid), (size), 0, (flags), (dst))
     277#define ipc_share_in_start_1_0(phoneid, size, arg, dst) \
     278        ipc_share_in_start((phoneid), (size), (arg), NULL, (dst))
     279#define ipc_share_in_start_1_1(phoneid, size, arg, flags, dst) \
     280        ipc_share_in_start((phoneid), (size), (arg), (flags), (dst))
     281
     282extern int ipc_share_in_start(int, size_t, sysarg_t, unsigned int *, void **);
    283283extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);
    284284extern int ipc_share_out_start(int, void *, unsigned int);
    285 extern int ipc_share_out_finalize(ipc_callid_t, void *);
     285extern int ipc_share_out_finalize(ipc_callid_t, void **);
    286286extern int ipc_data_read_start(int, void *, size_t);
    287287extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);
  • uspace/lib/c/include/ipc/net.h

    rb69e4c0 rdb96017  
    277277 *
    278278 */
    279 #define IPC_GET_DEVICE(call)  ((device_id_t) IPC_GET_ARG1(call))
     279#define IPC_GET_DEVICE(call)  ((nic_device_id_t) IPC_GET_ARG1(call))
    280280
    281281/** Return the packet identifier message argument.
     
    298298 *
    299299 */
    300 #define IPC_GET_STATE(call)  ((device_state_t) IPC_GET_ARG2(call))
     300#define IPC_GET_STATE(call)  ((nic_device_state_t) IPC_GET_ARG2(call))
     301
     302/** Return the device handle argument
     303 *
     304 * @param[in] call Message call structure
     305 *
     306 */
     307#define IPC_GET_DEVICE_HANDLE(call)  ((service_id_t) IPC_GET_ARG2(call))
     308
     309/** Return the device driver service message argument.
     310 *
     311 * @param[in] call Message call structure.
     312 *
     313 */
     314#define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
     315
     316/** Return the target service message argument.
     317 *
     318 * @param[in] call Message call structure.
     319 *
     320 */
     321#define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
     322
     323/** Return the sender service message argument.
     324 *
     325 * @param[in] call Message call structure.
     326 *
     327 */
     328#define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
    301329
    302330/** Return the maximum transmission unit message argument.
     
    305333 *
    306334 */
    307 #define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG2(call))
    308 
    309 /** Return the device driver service message argument.
    310  *
    311  * @param[in] call Message call structure.
    312  *
    313  */
    314 #define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
    315 
    316 /** Return the target service message argument.
    317  *
    318  * @param[in] call Message call structure.
    319  *
    320  */
    321 #define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
    322 
    323 /** Return the sender service message argument.
    324  *
    325  * @param[in] call Message call structure.
    326  *
    327  */
    328 #define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
     335#define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG3(call))
    329336
    330337/** Return the error service message argument.
  • uspace/lib/c/include/ipc/net_net.h

    rb69e4c0 rdb96017  
    4343/** Networking subsystem central module messages. */
    4444typedef enum {
    45         /** Returns the general configuration
     45        /** Return general configuration
    4646         * @see net_get_conf_req()
    4747         */
    4848        NET_NET_GET_CONF = NET_FIRST,
    49         /** Returns the device specific configuration
     49        /** Return device specific configuration
    5050         * @see net_get_device_conf_req()
    5151         */
    5252        NET_NET_GET_DEVICE_CONF,
    53         /** Starts the networking stack. */
    54         NET_NET_STARTUP,
     53        /** Return number of mastered devices */
     54        NET_NET_GET_DEVICES_COUNT,
     55        /** Return names and device IDs of all devices */
     56        NET_NET_GET_DEVICES
    5557} net_messages;
    5658
  • uspace/lib/c/include/ipc/nil.h

    rb69e4c0 rdb96017  
    4646         */
    4747        NET_NIL_DEVICE = NET_NIL_FIRST,
    48         /** New device state message.
    49          * @see nil_device_state_msg()
    50          */
    51         NET_NIL_DEVICE_STATE,
    52         /** Received packet queue message.
    53          * @see nil_received_msg()
    54          */
    55         NET_NIL_RECEIVED,
    5648        /** Send packet queue message.
    5749         * @see nil_send_msg()
     
    6961         * @see nil_get_broadcast_addr()
    7062         */
    71         NET_NIL_BROADCAST_ADDR,
     63        NET_NIL_BROADCAST_ADDR
    7264} nil_messages;
    7365
  • uspace/lib/c/include/ipc/services.h

    rb69e4c0 rdb96017  
    4949        SERVICE_CLIPBOARD  = FOURCC('c', 'l', 'i', 'p'),
    5050        SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),
    51         SERVICE_LO         = FOURCC('l', 'o', ' ', ' '),
    52         SERVICE_NE2000     = FOURCC('n', 'e', '2', 'k'),
    5351        SERVICE_ETHERNET   = FOURCC('e', 't', 'h', ' '),
    5452        SERVICE_NILDUMMY   = FOURCC('n', 'i', 'l', 'd'),
  • uspace/lib/c/include/ipc/vfs.h

    rb69e4c0 rdb96017  
    4242#define FS_NAME_MAXLEN  20
    4343#define MAX_PATH_LEN    (64 * 1024)
     44#define MAX_MNTOPTS_LEN 256
    4445#define PLB_SIZE        (2 * MAX_PATH_LEN)
    4546
     
    8081        VFS_IN_DUP,
    8182        VFS_IN_WAIT_HANDLE,
     83        VFS_IN_MTAB_GET,
    8284} vfs_in_request_t;
    8385
  • uspace/lib/c/include/loc.h

    rb69e4c0 rdb96017  
    4646extern void loc_exchange_end(async_exch_t *);
    4747
    48 extern int loc_server_register(const char *, async_client_conn_t);
     48extern int loc_server_register(const char *);
    4949extern int loc_service_register(const char *, service_id_t *);
    5050extern int loc_service_register_with_iface(const char *, service_id_t *,
  • uspace/lib/c/include/net/device.h

    rb69e4c0 rdb96017  
    3232
    3333/** @file
    34  * Device identifier, state and usage statistics.
     34 * Network device.
    3535 */
    3636
    37 #ifndef LIBC_DEVICE_ID_TYPE_H_
    38 #define LIBC_DEVICE_ID_TYPE_H_
     37#ifndef LIBC_NET_DEVICE_H_
     38#define LIBC_NET_DEVICE_H_
    3939
    4040#include <adt/int_map.h>
     41#include <nic/nic.h>
    4142
    4243/** Device identifier to generic type map declaration. */
    43 #define DEVICE_MAP_DECLARE      INT_MAP_DECLARE
     44#define DEVICE_MAP_DECLARE  INT_MAP_DECLARE
    4445
    4546/** Device identifier to generic type map implementation. */
    46 #define DEVICE_MAP_IMPLEMENT    INT_MAP_IMPLEMENT
     47#define DEVICE_MAP_IMPLEMENT  INT_MAP_IMPLEMENT
     48
     49/** Device identifier type. */
     50typedef int nic_device_id_t;
    4751
    4852/** Invalid device identifier. */
    49 #define DEVICE_INVALID_ID       (-1)
    50 
    51 /** Device identifier type. */
    52 typedef int device_id_t;
    53 
    54 /** Device state type. */
    55 typedef enum device_state device_state_t;
    56 
    57 /** Type definition of the device usage statistics.
    58  * @see device_stats
    59  */
    60 typedef struct device_stats device_stats_t;
    61 
    62 /** Device state. */
    63 enum device_state {
    64         /** Device not present or not initialized. */
    65         NETIF_NULL = 0,
    66         /** Device present and stopped. */
    67         NETIF_STOPPED,
    68         /** Device present and active. */
    69         NETIF_ACTIVE,
    70         /** Device present but unable to transmit. */
    71         NETIF_CARRIER_LOST
    72 };
    73 
    74 /** Device usage statistics. */
    75 struct device_stats {
    76         /** Total packets received. */
    77         unsigned long receive_packets;
    78         /** Total packets transmitted. */
    79         unsigned long send_packets;
    80         /** Total bytes received. */
    81         unsigned long receive_bytes;
    82         /** Total bytes transmitted. */
    83         unsigned long send_bytes;
    84         /** Bad packets received counter. */
    85         unsigned long receive_errors;
    86         /** Packet transmition problems counter. */
    87         unsigned long send_errors;
    88         /** No space in buffers counter. */
    89         unsigned long receive_dropped;
    90         /** No space available counter. */
    91         unsigned long send_dropped;
    92         /** Total multicast packets received. */
    93         unsigned long multicast;
    94         /** The number of collisions due to congestion on the medium. */
    95         unsigned long collisions;
    96 
    97         /* detailed receive_errors */
    98 
    99         /** Received packet length error counter. */
    100         unsigned long receive_length_errors;
    101         /** Receiver buffer overflow counter. */
    102         unsigned long receive_over_errors;
    103         /** Received packet with crc error counter. */
    104         unsigned long receive_crc_errors;
    105         /** Received frame alignment error counter. */
    106         unsigned long receive_frame_errors;
    107         /** Receiver fifo overrun counter. */
    108         unsigned long receive_fifo_errors;
    109         /** Receiver missed packet counter. */
    110         unsigned long receive_missed_errors;
    111 
    112         /* detailed send_errors */
    113 
    114         /** Transmitter aborted counter. */
    115         unsigned long send_aborted_errors;
    116         /** Transmitter carrier errors counter. */
    117         unsigned long send_carrier_errors;
    118         /** Transmitter fifo overrun counter. */
    119         unsigned long send_fifo_errors;
    120         /** Transmitter carrier errors counter. */
    121         unsigned long send_heartbeat_errors;
    122         /** Transmitter window errors counter. */
    123         unsigned long send_window_errors;
    124 
    125         /* for cslip etc */
    126        
    127         /** Total compressed packets received. */
    128         unsigned long receive_compressed;
    129         /** Total compressed packet transmitted. */
    130         unsigned long send_compressed;
    131 };
     53#define NIC_DEVICE_INVALID_ID  (-1)
    13254
    13355#endif
  • uspace/lib/c/include/net/packet.h

    rb69e4c0 rdb96017  
    3838#define LIBC_PACKET_H_
    3939
     40#include <sys/types.h>
     41
    4042/** Packet identifier type.
    4143 * Value zero is used as an invalid identifier.
    4244 */
    43 typedef int packet_id_t;
     45typedef sysarg_t packet_id_t;
    4446
    4547/** Type definition of the packet.
     
    5153 * @see packet_dimension
    5254 */
    53 typedef struct packet_dimension packet_dimension_t;
     55typedef struct packet_dimension packet_dimension_t;
    5456
    5557/** Packet dimension. */
     
    7173extern packet_t *pm_find(packet_id_t);
    7274extern int pm_add(packet_t *);
     75extern void pm_remove(packet_t *);
    7376extern int pm_init(void);
    7477extern void pm_destroy(void);
  • uspace/lib/c/include/net/packet_header.h

    rb69e4c0 rdb96017  
    6161#define PACKET_MAGIC_VALUE      0x11227788
    6262
     63/** Maximum total length of the packet */
     64#define PACKET_MAX_LENGTH  65536
     65
    6366/** Packet header. */
    6467struct packet {
     
    8588         */
    8689        size_t length;
     90
     91        /** Offload info provided by the NIC */
     92        uint32_t offload_info;
     93
     94        /** Mask which bits in offload info are valid */
     95        uint32_t offload_mask;
    8796
    8897        /** Stored source and destination addresses length. */
  • uspace/lib/c/include/str.h

    rb69e4c0 rdb96017  
    6161extern size_t wstr_size(const wchar_t *str);
    6262
     63extern size_t str_nsize(const char *str, size_t max_size);
     64extern size_t wstr_nsize(const wchar_t *str, size_t max_size);
     65
    6366extern size_t str_lsize(const char *str, size_t max_len);
    6467extern size_t wstr_lsize(const wchar_t *str, size_t max_len);
     
    9194extern char *str_rchr(const char *str, wchar_t ch);
    9295
     96extern void str_rtrim(char *str, wchar_t ch);
     97extern void str_ltrim(char *str, wchar_t ch);
     98
    9399extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos);
    94100extern bool wstr_remove(wchar_t *str, size_t pos);
     
    100106extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *);
    101107extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *);
    102 extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *);
     108extern int str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *);
    103109extern int str_size_t(const char *, char **, unsigned int, bool, size_t *);
    104110
  • uspace/lib/c/include/sysinfo.h

    rb69e4c0 rdb96017  
    4040#include <abi/sysinfo.h>
    4141
     42extern char *sysinfo_get_keys(const char *, size_t *);
    4243extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *);
    4344extern int sysinfo_get_value(const char *, sysarg_t *);
    4445extern void *sysinfo_get_data(const char *, size_t *);
     46extern void *sysinfo_get_property(const char *, const char *, size_t *);
    4547
    4648#endif
  • uspace/lib/c/include/vfs/vfs.h

    rb69e4c0 rdb96017  
    3939#include <ipc/vfs.h>
    4040#include <ipc/loc.h>
     41#include <adt/list.h>
    4142#include <stdio.h>
    4243#include <async.h>
     44#include "vfs_mtab.h"
    4345
    4446enum vfs_change_state_type {
     
    5557
    5658extern int fd_wait(void);
     59extern int get_mtab_list(list_t *mtab_list);
    5760
    5861extern async_exch_t *vfs_exchange_begin(void);
  • uspace/lib/c/include/vfs/vfs_mtab.h

    rb69e4c0 rdb96017  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2011 Maurizio Lombardi
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup kbd_port
    30  * @ingroup  kbd
     29/** @addtogroup libc
    3130 * @{
    3231 */
    33 
    3432/** @file
    35  * @brief i8042 port driver.
    3633 */
    3734
    38 #ifndef i8042_H_
    39 #define i8042_H_
     35#ifndef LIBC_VFS_MTAB_H_
     36#define LIBC_VFS_MTAB_H_
    4037
    4138#include <sys/types.h>
    42 #include <libarch/ddi.h>
    43 #include <async.h>
     39#include <ipc/vfs.h>
     40#include <adt/list.h>
    4441
    45 /** i8042 HW I/O interface */
    46 struct i8042 {
    47         ioport8_t data;
    48         uint8_t pad[3];
    49         ioport8_t status;
    50 } __attribute__ ((packed));
    51 typedef struct i8042 i8042_t;
    52 
    53 /** Softstate structure, one for each serial port (primary and aux). */
    54 typedef struct {
     42typedef struct mtab_ent {
     43        link_t link;
     44        char mp[MAX_PATH_LEN];
     45        char opts[MAX_MNTOPTS_LEN];
     46        char fs_name[FS_NAME_MAXLEN];
     47        unsigned int instance;
    5548        service_id_t service_id;
    56         async_sess_t *client_sess;
    57 } i8042_port_t;
     49} mtab_ent_t;
    5850
    5951#endif
    6052
    61 /**
    62  * @}
     53/** @}
    6354 */
Note: See TracChangeset for help on using the changeset viewer.