Changeset 14f1db0 in mainline for uspace/srv/net/netif/lo/lo.c
- Timestamp:
- 2010-04-09T12:54:57Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1caa3c2
- Parents:
- 24ab58b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/netif/lo/lo.c
r24ab58b3 r14f1db0 51 51 #include <nil_interface.h> 52 52 #include <nil_messages.h> 53 #include <netif .h>54 #include <netif_ module.h>53 #include <netif_interface.h> 54 #include <netif_local.h> 55 55 56 56 /** Default hardware address. … … 76 76 * @returns EOK otherwise. 77 77 */ 78 int change_state_message( device_refdevice, device_state_t state);78 int change_state_message(netif_device_t * device, device_state_t state); 79 79 80 80 /** Creates and returns the loopback network interface structure. … … 85 85 * @returns ENOMEM if there is not enough memory left. 86 86 */ 87 int create(device_id_t device_id, device_ref* device);87 int create(device_id_t device_id, netif_device_t * * device); 88 88 89 89 int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){ … … 103 103 ERROR_DECLARE; 104 104 105 device_refdevice;105 netif_device_t * device; 106 106 107 107 if(! stats){ … … 113 113 } 114 114 115 int change_state_message( device_refdevice, device_state_t state)115 int change_state_message(netif_device_t * device, device_state_t state) 116 116 { 117 117 if (device->state != state) { … … 127 127 } 128 128 129 int create(device_id_t device_id, device_ref* device){129 int create(device_id_t device_id, netif_device_t * * device){ 130 130 int index; 131 131 132 if( device_map_count(&netif_globals.device_map) > 0){132 if(netif_device_map_count(&netif_globals.device_map) > 0){ 133 133 return EXDEV; 134 134 }else{ 135 *device = ( device_ref) malloc(sizeof(device_t));135 *device = (netif_device_t *) malloc(sizeof(netif_device_t)); 136 136 if(!(*device)){ 137 137 return ENOMEM; … … 146 146 (** device).nil_phone = -1; 147 147 (** device).state = NETIF_STOPPED; 148 index = device_map_add(&netif_globals.device_map, (** device).device_id, * device);148 index = netif_device_map_add(&netif_globals.device_map, (** device).device_id, * device); 149 149 if(index < 0){ 150 150 free(*device); … … 166 166 ERROR_DECLARE; 167 167 168 device_refdevice;168 netif_device_t * device; 169 169 170 170 // create a new device … … 178 178 ERROR_DECLARE; 179 179 180 device_refdevice;180 netif_device_t * device; 181 181 size_t length; 182 182 packet_t next; … … 204 204 } 205 205 206 int netif_start_message( device_refdevice){206 int netif_start_message(netif_device_t * device){ 207 207 return change_state_message(device, NETIF_ACTIVE); 208 208 } 209 209 210 int netif_stop_message( device_refdevice){210 int netif_stop_message(netif_device_t * device){ 211 211 return change_state_message(device, NETIF_STOPPED); 212 212 } 213 213 214 #ifdef CONFIG_NETWORKING_modular215 216 #include <netif_standalone.h>217 218 214 /** Default thread for new connections. 219 215 * 220 * 221 * 222 * 223 */ 224 static void netif_client_connection(ipc_callid_t iid, ipc_call_t * 216 * @param[in] iid The initial message identifier. 217 * @param[in] icall The initial message call structure. 218 * 219 */ 220 static void netif_client_connection(ipc_callid_t iid, ipc_call_t *icall) 225 221 { 226 222 /* … … 254 250 } 255 251 256 /** Starts the module.257 *258 * @param argc The count of the command line arguments. Ignored parameter.259 * @param argv The command line parameters. Ignored parameter.260 *261 * @returns EOK on success.262 * @returns Other error codes as defined for each specific module start function.263 *264 */265 252 int main(int argc, char *argv[]) 266 253 { … … 274 261 } 275 262 276 #endif /* CONFIG_NETWORKING_modular */277 278 263 /** @} 279 264 */
Note:
See TracChangeset
for help on using the changeset viewer.