Changeset db96017 in mainline for uspace/lib/c/include
- Timestamp:
- 2012-04-07T17:41:44Z (14 years ago)
- 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. - Location:
- uspace/lib/c/include
- Files:
-
- 5 added
- 25 edited
- 2 moved
-
adt/hash_set.h (added)
-
adt/hash_table.h (modified) (1 diff)
-
as.h (modified) (1 diff)
-
async.h (modified) (2 diffs)
-
bitops.h (modified) (1 diff)
-
ddi.h (modified) (1 diff)
-
device/hw_res.h (modified) (4 diffs)
-
device/hw_res_parsed.h (added)
-
device/nic.h (added)
-
device/pci.h (moved) (moved from uspace/lib/net/include/netif_remote.h ) (2 diffs)
-
devman.h (modified) (1 diff)
-
errno.h (modified) (1 diff)
-
fibril.h (modified) (1 diff)
-
fibril_synch.h (modified) (2 diffs)
-
ipc/dev_iface.h (modified) (1 diff)
-
ipc/il.h (modified) (1 diff)
-
ipc/ipc.h (modified) (1 diff)
-
ipc/net.h (modified) (3 diffs)
-
ipc/net_net.h (modified) (1 diff)
-
ipc/nil.h (modified) (2 diffs)
-
ipc/services.h (modified) (1 diff)
-
ipc/vfs.h (modified) (2 diffs)
-
loc.h (modified) (1 diff)
-
net/device.h (modified) (1 diff)
-
net/packet.h (modified) (3 diffs)
-
net/packet_header.h (modified) (2 diffs)
-
nic/eth_phys.h (added)
-
nic/nic.h (added)
-
str.h (modified) (3 diffs)
-
sysinfo.h (modified) (1 diff)
-
vfs/vfs.h (modified) (2 diffs)
-
vfs/vfs_mtab.h (moved) (moved from uspace/srv/hw/char/i8042/i8042.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
rb69e4c0 rdb96017 86 86 extern bool hash_table_create(hash_table_t *, hash_count_t, hash_count_t, 87 87 hash_table_operations_t *); 88 extern void hash_table_clear(hash_table_t *); 88 89 extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *); 89 90 extern link_t *hash_table_find(hash_table_t *, unsigned long []); -
uspace/lib/c/include/as.h
rb69e4c0 rdb96017 59 59 extern int as_area_destroy(void *); 60 60 extern void *set_maxheapsize(size_t); 61 extern void *as_get_mappable_page(size_t);62 61 extern int as_get_physical_mapping(const void *, uintptr_t *); 63 62 -
uspace/lib/c/include/async.h
rb69e4c0 rdb96017 346 346 */ 347 347 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 357 extern int async_share_in_start(async_exch_t *, size_t, sysarg_t, 358 unsigned int *, void **); 359 359 extern bool async_share_in_receive(ipc_callid_t *, size_t *); 360 360 extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int); … … 362 362 extern int async_share_out_start(async_exch_t *, void *, unsigned int); 363 363 extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *); 364 extern int async_share_out_finalize(ipc_callid_t, void * );364 extern int async_share_out_finalize(ipc_callid_t, void **); 365 365 366 366 /* -
uspace/lib/c/include/bitops.h
rb69e4c0 rdb96017 40 40 /** Mask with bit @a n set. */ 41 41 #define BIT_V(type, n) \ 42 ((type) 1 << ((n) - 1))42 ((type) 1 << (n)) 43 43 44 44 /** Mask with rightmost @a n bits set. */ 45 45 #define BIT_RRANGE(type, n) \ 46 (BIT_V(type, (n) + 1) - 1)46 (BIT_V(type, (n)) - 1) 47 47 48 48 /** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */ -
uspace/lib/c/include/ddi.h
rb69e4c0 rdb96017 41 41 42 42 extern int device_assign_devno(void); 43 extern int physmem_map(void *, void *, unsigned long, int); 43 44 extern int physmem_map(void *, size_t, unsigned int, void **); 45 46 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **); 47 extern int dmamem_map_anonymous(size_t, unsigned int, unsigned int, void **, 48 void **); 49 extern int dmamem_unmap(void *, size_t); 50 extern int dmamem_unmap_anonymous(void *); 51 44 52 extern int iospace_enable(task_id_t, void *, unsigned long); 45 53 extern 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 55 extern int irq_register(int, int, int, irq_code_t *); 56 extern int irq_unregister(int, int); 48 57 49 58 #endif -
uspace/lib/c/include/device/hw_res.h
rb69e4c0 rdb96017 40 40 #include <bool.h> 41 41 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 42 50 /** HW resource provider interface */ 43 51 typedef enum { 44 52 HW_RES_GET_RESOURCE_LIST = 0, 45 HW_RES_ENABLE_INTERRUPT 53 HW_RES_ENABLE_INTERRUPT, 54 HW_RES_DMA_CHANNEL_SETUP, 46 55 } hw_res_method_t; 47 56 … … 50 59 INTERRUPT, 51 60 IO_RANGE, 52 MEM_RANGE 61 MEM_RANGE, 62 DMA_CHANNEL_8, 63 DMA_CHANNEL_16, 53 64 } hw_res_type_t; 54 65 … … 77 88 int irq; 78 89 } interrupt; 90 91 union { 92 unsigned int dma8; 93 unsigned int dma16; 94 } dma_channel; 79 95 } res; 80 96 } hw_resource_t; … … 98 114 extern bool hw_res_enable_interrupt(async_sess_t *); 99 115 116 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t, 117 uint16_t, uint8_t); 118 100 119 #endif 101 120 -
uspace/lib/c/include/device/pci.h
rb69e4c0 rdb96017 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2011 Jiri Michalec 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib net29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 /** @file 33 */ 32 34 33 #ifndef LIB NET_NETIF_REMOTE_H_34 #define LIB NET_NETIF_REMOTE_H_35 #ifndef LIBC_DEVICE_PCI_H_ 36 #define LIBC_DEVICE_PCI_H_ 35 37 36 #include <ipc/services.h>37 #include <adt/measured_strings.h>38 #include <net/device.h>39 #include <net/packet.h>40 38 #include <async.h> 41 39 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 42 typedef 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 52 extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *); 53 extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *); 54 extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *); 55 56 extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t); 57 extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t); 58 extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t); 51 59 52 60 #endif -
uspace/lib/c/include/devman.h
rb69e4c0 rdb96017 46 46 extern void devman_exchange_end(async_exch_t *); 47 47 48 extern int devman_driver_register(const char * , async_client_conn_t);48 extern int devman_driver_register(const char *); 49 49 extern int devman_add_function(const char *, fun_type_t, match_id_list_t *, 50 50 devman_handle_t, devman_handle_t *); -
uspace/lib/c/include/errno.h
rb69e4c0 rdb96017 96 96 #define ENOTCONN (-10057) 97 97 98 #define ECONNREFUSED (-10058) 99 100 #define ECONNABORTED (-10059) 101 98 102 /** The requested operation was not performed. Try again later. */ 99 103 #define EAGAIN (-11002) -
uspace/lib/c/include/fibril.h
rb69e4c0 rdb96017 41 41 42 42 #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) 46 48 47 49 #define FIBRIL_SERIALIZED 1 -
uspace/lib/c/include/fibril_synch.h
rb69e4c0 rdb96017 107 107 fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name) 108 108 109 typedef void (*fibril_timer_fun_t)(void *); 110 111 typedef 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 */ 129 typedef 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 109 140 extern void fibril_mutex_initialize(fibril_mutex_t *); 110 141 extern void fibril_mutex_lock(fibril_mutex_t *); … … 129 160 extern void fibril_condvar_broadcast(fibril_condvar_t *); 130 161 162 extern fibril_timer_t *fibril_timer_create(void); 163 extern void fibril_timer_destroy(fibril_timer_t *); 164 extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t, 165 void *); 166 extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *); 167 131 168 #endif 132 169 -
uspace/lib/c/include/ipc/dev_iface.h
rb69e4c0 rdb96017 36 36 typedef enum { 37 37 HW_RES_DEV_IFACE = 0, 38 /** Character device interface */ 38 39 CHAR_DEV_IFACE, 39 40 41 /** Network interface controller interface */ 42 NIC_DEV_IFACE, 43 40 44 /** Interface provided by any PCI device. */ 41 45 PCI_DEV_IFACE, -
uspace/lib/c/include/ipc/il.h
rb69e4c0 rdb96017 54 54 NET_IL_MTU_CHANGED, 55 55 56 /** 57 * Device address changed message 58 * @see il_addr_changed_msg() 59 */ 60 NET_IL_ADDR_CHANGED, 61 56 62 /** Packet received message. 57 63 * @see il_received_msg() -
uspace/lib/c/include/ipc/ipc.h
rb69e4c0 rdb96017 271 271 */ 272 272 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 282 extern int ipc_share_in_start(int, size_t, sysarg_t, unsigned int *, void **); 283 283 extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int); 284 284 extern int ipc_share_out_start(int, void *, unsigned int); 285 extern int ipc_share_out_finalize(ipc_callid_t, void * );285 extern int ipc_share_out_finalize(ipc_callid_t, void **); 286 286 extern int ipc_data_read_start(int, void *, size_t); 287 287 extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t); -
uspace/lib/c/include/ipc/net.h
rb69e4c0 rdb96017 277 277 * 278 278 */ 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)) 280 280 281 281 /** Return the packet identifier message argument. … … 298 298 * 299 299 */ 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)) 301 329 302 330 /** Return the maximum transmission unit message argument. … … 305 333 * 306 334 */ 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)) 329 336 330 337 /** Return the error service message argument. -
uspace/lib/c/include/ipc/net_net.h
rb69e4c0 rdb96017 43 43 /** Networking subsystem central module messages. */ 44 44 typedef enum { 45 /** Return s thegeneral configuration45 /** Return general configuration 46 46 * @see net_get_conf_req() 47 47 */ 48 48 NET_NET_GET_CONF = NET_FIRST, 49 /** Return s thedevice specific configuration49 /** Return device specific configuration 50 50 * @see net_get_device_conf_req() 51 51 */ 52 52 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 55 57 } net_messages; 56 58 -
uspace/lib/c/include/ipc/nil.h
rb69e4c0 rdb96017 46 46 */ 47 47 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,56 48 /** Send packet queue message. 57 49 * @see nil_send_msg() … … 69 61 * @see nil_get_broadcast_addr() 70 62 */ 71 NET_NIL_BROADCAST_ADDR ,63 NET_NIL_BROADCAST_ADDR 72 64 } nil_messages; 73 65 -
uspace/lib/c/include/ipc/services.h
rb69e4c0 rdb96017 49 49 SERVICE_CLIPBOARD = FOURCC('c', 'l', 'i', 'p'), 50 50 SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '), 51 SERVICE_LO = FOURCC('l', 'o', ' ', ' '),52 SERVICE_NE2000 = FOURCC('n', 'e', '2', 'k'),53 51 SERVICE_ETHERNET = FOURCC('e', 't', 'h', ' '), 54 52 SERVICE_NILDUMMY = FOURCC('n', 'i', 'l', 'd'), -
uspace/lib/c/include/ipc/vfs.h
rb69e4c0 rdb96017 42 42 #define FS_NAME_MAXLEN 20 43 43 #define MAX_PATH_LEN (64 * 1024) 44 #define MAX_MNTOPTS_LEN 256 44 45 #define PLB_SIZE (2 * MAX_PATH_LEN) 45 46 … … 80 81 VFS_IN_DUP, 81 82 VFS_IN_WAIT_HANDLE, 83 VFS_IN_MTAB_GET, 82 84 } vfs_in_request_t; 83 85 -
uspace/lib/c/include/loc.h
rb69e4c0 rdb96017 46 46 extern void loc_exchange_end(async_exch_t *); 47 47 48 extern int loc_server_register(const char * , async_client_conn_t);48 extern int loc_server_register(const char *); 49 49 extern int loc_service_register(const char *, service_id_t *); 50 50 extern int loc_service_register_with_iface(const char *, service_id_t *, -
uspace/lib/c/include/net/device.h
rb69e4c0 rdb96017 32 32 33 33 /** @file 34 * Device identifier, state and usage statistics.34 * Network device. 35 35 */ 36 36 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_ 39 39 40 40 #include <adt/int_map.h> 41 #include <nic/nic.h> 41 42 42 43 /** Device identifier to generic type map declaration. */ 43 #define DEVICE_MAP_DECLARE INT_MAP_DECLARE44 #define DEVICE_MAP_DECLARE INT_MAP_DECLARE 44 45 45 46 /** 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. */ 50 typedef int nic_device_id_t; 47 51 48 52 /** 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) 132 54 133 55 #endif -
uspace/lib/c/include/net/packet.h
rb69e4c0 rdb96017 38 38 #define LIBC_PACKET_H_ 39 39 40 #include <sys/types.h> 41 40 42 /** Packet identifier type. 41 43 * Value zero is used as an invalid identifier. 42 44 */ 43 typedef int packet_id_t;45 typedef sysarg_t packet_id_t; 44 46 45 47 /** Type definition of the packet. … … 51 53 * @see packet_dimension 52 54 */ 53 typedef struct packet_dimension packet_dimension_t;55 typedef struct packet_dimension packet_dimension_t; 54 56 55 57 /** Packet dimension. */ … … 71 73 extern packet_t *pm_find(packet_id_t); 72 74 extern int pm_add(packet_t *); 75 extern void pm_remove(packet_t *); 73 76 extern int pm_init(void); 74 77 extern void pm_destroy(void); -
uspace/lib/c/include/net/packet_header.h
rb69e4c0 rdb96017 61 61 #define PACKET_MAGIC_VALUE 0x11227788 62 62 63 /** Maximum total length of the packet */ 64 #define PACKET_MAX_LENGTH 65536 65 63 66 /** Packet header. */ 64 67 struct packet { … … 85 88 */ 86 89 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; 87 96 88 97 /** Stored source and destination addresses length. */ -
uspace/lib/c/include/str.h
rb69e4c0 rdb96017 61 61 extern size_t wstr_size(const wchar_t *str); 62 62 63 extern size_t str_nsize(const char *str, size_t max_size); 64 extern size_t wstr_nsize(const wchar_t *str, size_t max_size); 65 63 66 extern size_t str_lsize(const char *str, size_t max_len); 64 67 extern size_t wstr_lsize(const wchar_t *str, size_t max_len); … … 91 94 extern char *str_rchr(const char *str, wchar_t ch); 92 95 96 extern void str_rtrim(char *str, wchar_t ch); 97 extern void str_ltrim(char *str, wchar_t ch); 98 93 99 extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos); 94 100 extern bool wstr_remove(wchar_t *str, size_t pos); … … 100 106 extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *); 101 107 extern 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 *);108 extern int str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *); 103 109 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); 104 110 -
uspace/lib/c/include/sysinfo.h
rb69e4c0 rdb96017 40 40 #include <abi/sysinfo.h> 41 41 42 extern char *sysinfo_get_keys(const char *, size_t *); 42 43 extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *); 43 44 extern int sysinfo_get_value(const char *, sysarg_t *); 44 45 extern void *sysinfo_get_data(const char *, size_t *); 46 extern void *sysinfo_get_property(const char *, const char *, size_t *); 45 47 46 48 #endif -
uspace/lib/c/include/vfs/vfs.h
rb69e4c0 rdb96017 39 39 #include <ipc/vfs.h> 40 40 #include <ipc/loc.h> 41 #include <adt/list.h> 41 42 #include <stdio.h> 42 43 #include <async.h> 44 #include "vfs_mtab.h" 43 45 44 46 enum vfs_change_state_type { … … 55 57 56 58 extern int fd_wait(void); 59 extern int get_mtab_list(list_t *mtab_list); 57 60 58 61 extern async_exch_t *vfs_exchange_begin(void); -
uspace/lib/c/include/vfs/vfs_mtab.h
rb69e4c0 rdb96017 1 1 /* 2 * Copyright (c) 20 06 Josef Cejka2 * Copyright (c) 2011 Maurizio Lombardi 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup kbd_port 30 * @ingroup kbd 29 /** @addtogroup libc 31 30 * @{ 32 31 */ 33 34 32 /** @file 35 * @brief i8042 port driver.36 33 */ 37 34 38 #ifndef i8042_H_39 #define i8042_H_35 #ifndef LIBC_VFS_MTAB_H_ 36 #define LIBC_VFS_MTAB_H_ 40 37 41 38 #include <sys/types.h> 42 #include < libarch/ddi.h>43 #include <a sync.h>39 #include <ipc/vfs.h> 40 #include <adt/list.h> 44 41 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 { 42 typedef 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; 55 48 service_id_t service_id; 56 async_sess_t *client_sess; 57 } i8042_port_t; 49 } mtab_ent_t; 58 50 59 51 #endif 60 52 61 /** 62 * @} 53 /** @} 63 54 */
Note:
See TracChangeset
for help on using the changeset viewer.
