Changes in uspace/srv/net/nil/eth/eth.h [e526f08:4eca056] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.h
re526f08 r4eca056 32 32 33 33 /** @file 34 * 34 * Ethernet module. 35 35 */ 36 36 37 #ifndef __NET_ETH_H__38 #define __NET_ETH_H__37 #ifndef NET_ETH_H_ 38 #define NET_ETH_H_ 39 39 40 40 #include <fibril_synch.h> … … 45 45 46 46 /** Type definition of the Ethernet global data. 47 * 47 * @see eth_globals 48 48 */ 49 typedef struct eth_globals 49 typedef struct eth_globals eth_globals_t; 50 50 51 51 /** Type definition of the Ethernet device specific data. 52 * 52 * @see eth_device 53 53 */ 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; 54 typedef struct eth_device eth_device_t; 60 55 61 56 /** Type definition of the Ethernet protocol specific data. 62 * 57 * @see eth_proto 63 58 */ 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; 59 typedef struct eth_proto eth_proto_t; 70 60 71 61 /** Ethernet device map. 72 * 73 * 62 * Maps devices to the Ethernet device specific data. 63 * @see device.h 74 64 */ 75 DEVICE_MAP_DECLARE(eth_devices, eth_device_t) 65 DEVICE_MAP_DECLARE(eth_devices, eth_device_t); 76 66 77 67 /** Ethernet protocol map. 78 * 79 * 68 * Maps protocol identifiers to the Ethernet protocol specific data. 69 * @see int_map.h 80 70 */ 81 INT_MAP_DECLARE(eth_protos, eth_proto_t) 71 INT_MAP_DECLARE(eth_protos, eth_proto_t); 82 72 83 /** Ethernet device specific data. 84 */ 85 struct eth_device{ 86 /** Device identifier. 87 */ 73 /** Ethernet device specific data. */ 74 struct eth_device { 75 /** Device identifier. */ 88 76 device_id_t device_id; 89 /** Device driver service. 90 */ 77 /** Device driver service. */ 91 78 services_t service; 92 /** Driver phone. 93 */ 79 /** Driver phone. */ 94 80 int phone; 95 /** Maximal transmission unit. 96 */ 81 /** Maximal transmission unit. */ 97 82 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 101 88 */ 102 89 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; 109 95 }; 110 96 111 /** Ethernet protocol specific data. 112 */ 113 struct eth_proto{ 114 /** Protocol service. 115 */ 97 /** Ethernet protocol specific data. */ 98 struct eth_proto { 99 /** Protocol service. */ 116 100 services_t service; 117 /** Protocol identifier. 118 */ 101 /** Protocol identifier. */ 119 102 int protocol; 120 /** Protocol module phone. 121 */ 103 /** Protocol module phone. */ 122 104 int phone; 123 105 }; 124 106 125 /** Ethernet global data. 126 */ 127 struct eth_globals{ 128 /** Networking module phone. 129 */ 107 /** Ethernet global data. */ 108 struct eth_globals { 109 /** Networking module phone. */ 130 110 int net_phone; 131 /** Safety lock for devices. 132 */ 111 /** Safety lock for devices. */ 133 112 fibril_rwlock_t devices_lock; 134 /** All known Ethernet devices. 135 */ 113 /** All known Ethernet devices. */ 136 114 eth_devices_t devices; 137 /** Safety lock for protocols. 138 */ 115 /** Safety lock for protocols. */ 139 116 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. 142 121 */ 143 122 eth_protos_t protos; 144 /** Broadcast device hardware address.145 */146 measured_string_ refbroadcast_addr;123 124 /** Broadcast device hardware address. */ 125 measured_string_t *broadcast_addr; 147 126 }; 148 127
Note:
See TracChangeset
for help on using the changeset viewer.