Changes in uspace/srv/net/netif/lo/lo.c [2e236901:fb04cba8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/netif/lo/lo.c
r2e236901 rfb04cba8 64 64 netif_globals_t netif_globals; 65 65 66 int 67 netif_specific_message(ipc_callid_t callid, ipc_call_t *call, 66 int netif_specific_message(ipc_callid_t callid, ipc_call_t *call, 68 67 ipc_call_t *answer, int *answer_count) 69 68 { … … 75 74 if (!address) 76 75 return EBADMEM; 76 77 77 address->value = str_dup(DEFAULT_ADDR); 78 78 address->length = DEFAULT_ADDR_LEN; 79 79 80 return EOK; 80 81 } … … 87 88 if (!stats) 88 89 return EBADMEM; 90 89 91 rc = find_device(device_id, &device); 90 92 if (rc != EOK) 91 93 return rc; 94 92 95 memcpy(stats, (device_stats_ref) device->specific, 93 96 sizeof(device_stats_t)); 97 94 98 return EOK; 95 99 } … … 134 138 if (!*device) 135 139 return ENOMEM; 140 136 141 (*device)->specific = (device_stats_t *) malloc(sizeof(device_stats_t)); 137 142 if (!(*device)->specific) { … … 139 144 return ENOMEM; 140 145 } 146 141 147 null_device_stats((device_stats_ref) (*device)->specific); 142 148 (*device)->device_id = device_id; … … 145 151 index = netif_device_map_add(&netif_globals.device_map, 146 152 (*device)->device_id, *device); 153 147 154 if (index < 0) { 148 155 free(*device); … … 167 174 int rc; 168 175 169 / / create a new device176 /* Create a new device */ 170 177 rc = create(device_id, &device); 171 178 if (rc != EOK) 172 179 return rc; 173 // print the settings 180 181 /* Print the settings */ 174 182 printf("%s: Device created (id: %d)\n", NAME, device->device_id); 183 175 184 return EOK; 176 185 } … … 187 196 if (rc != EOK) 188 197 return EOK; 198 189 199 if (device->state != NETIF_ACTIVE) { 190 200 netif_pq_release(packet_get_id(packet)); 191 201 return EFORWARD; 192 202 } 203 193 204 next = packet; 194 205 do { … … 200 211 next = pq_next(next); 201 212 } while(next); 213 202 214 phone = device->nil_phone; 203 215 fibril_rwlock_write_unlock(&netif_globals.lock);
Note:
See TracChangeset
for help on using the changeset viewer.