Changes in uspace/srv/net/nil/eth/eth.h [6067284:24ab58b3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.h
r6067284 r24ab58b3 32 32 33 33 /** @file 34 * Ethernet module.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> 41 41 #include <ipc/services.h> 42 42 43 #include <net /device.h>43 #include <net_device.h> 44 44 #include <adt/measured_strings.h> 45 45 46 46 /** Type definition of the Ethernet global data. 47 * @see eth_globals47 * @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 * @see eth_device52 * @see eth_device 53 53 */ 54 typedef struct eth_device 54 typedef struct eth_device eth_device_t; 55 55 56 56 /** Type definition of the Ethernet device specific data pointer. 57 * @see eth_device57 * @see eth_device 58 58 */ 59 typedef eth_device_t * eth_device_ref;59 typedef eth_device_t * eth_device_ref; 60 60 61 61 /** Type definition of the Ethernet protocol specific data. 62 * @see eth_proto62 * @see eth_proto 63 63 */ 64 typedef struct eth_proto 64 typedef struct eth_proto eth_proto_t; 65 65 66 66 /** Type definition of the Ethernet protocol specific data pointer. 67 * @see eth_proto67 * @see eth_proto 68 68 */ 69 typedef eth_proto_t * eth_proto_ref;69 typedef eth_proto_t * eth_proto_ref; 70 70 71 71 /** Ethernet device map. 72 * Maps devices to the Ethernet device specific data.73 * @see device.h72 * Maps devices to the Ethernet device specific data. 73 * @see device.h 74 74 */ 75 DEVICE_MAP_DECLARE(eth_devices, eth_device_t) ;75 DEVICE_MAP_DECLARE(eth_devices, eth_device_t) 76 76 77 77 /** Ethernet protocol map. 78 * Maps protocol identifiers to the Ethernet protocol specific data.79 * @see int_map.h78 * Maps protocol identifiers to the Ethernet protocol specific data. 79 * @see int_map.h 80 80 */ 81 INT_MAP_DECLARE(eth_protos, eth_proto_t) ;81 INT_MAP_DECLARE(eth_protos, eth_proto_t) 82 82 83 /** Ethernet device specific data. */ 84 struct eth_device { 85 /** Device identifier. */ 83 /** Ethernet device specific data. 84 */ 85 struct eth_device{ 86 /** Device identifier. 87 */ 86 88 device_id_t device_id; 87 /** Device driver service. */ 89 /** Device driver service. 90 */ 88 91 services_t service; 89 /** Driver phone. */ 92 /** Driver phone. 93 */ 90 94 int phone; 91 /** Maximal transmission unit. */ 95 /** Maximal transmission unit. 96 */ 92 97 size_t mtu; 93 94 /** 95 * Various device flags. 96 * @see ETH_DUMMY 97 * @see ETH_MODE_MASK 98 /** Various device flags. 99 * @see ETH_DUMMY 100 * @see ETH_MODE_MASK 98 101 */ 99 102 int flags; 100 101 /** Actual device hardware address.*/103 /** Actual device hardware address. 104 */ 102 105 measured_string_ref addr; 103 /** Actual device hardware address data. */ 104 char *addr_data; 106 /** Actual device hardware address data. 107 */ 108 char * addr_data; 105 109 }; 106 110 107 /** Ethernet protocol specific data. */ 108 struct eth_proto { 109 /** Protocol service. */ 111 /** Ethernet protocol specific data. 112 */ 113 struct eth_proto{ 114 /** Protocol service. 115 */ 110 116 services_t service; 111 /** Protocol identifier. */ 117 /** Protocol identifier. 118 */ 112 119 int protocol; 113 /** Protocol module phone. */ 120 /** Protocol module phone. 121 */ 114 122 int phone; 115 123 }; 116 124 117 /** Ethernet global data. */ 118 struct eth_globals { 119 /** Networking module phone. */ 125 /** Ethernet global data. 126 */ 127 struct eth_globals{ 128 /** Networking module phone. 129 */ 120 130 int net_phone; 121 /** Safety lock for devices. */ 131 /** Safety lock for devices. 132 */ 122 133 fibril_rwlock_t devices_lock; 123 /** All known Ethernet devices. */ 134 /** All known Ethernet devices. 135 */ 124 136 eth_devices_t devices; 125 /** Safety lock for protocols. */ 137 /** Safety lock for protocols. 138 */ 126 139 fibril_rwlock_t protos_lock; 127 128 /** 129 * Protocol map. 130 * Service phone map for each protocol. 140 /** Protocol map. 141 * Service phone map for each protocol. 131 142 */ 132 143 eth_protos_t protos; 133 134 /** Broadcast device hardware address.*/144 /** Broadcast device hardware address. 145 */ 135 146 measured_string_ref broadcast_addr; 136 147 };
Note:
See TracChangeset
for help on using the changeset viewer.