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