Changes in / [0472cf17:b3b79981] in mainline
- Files:
-
- 13 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/ipc/interfaces.h
r0472cf17 rb3b79981 202 202 FOURCC_COMPACT('w', 'm', 'g', 't') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK, 203 203 INTERFACE_TBARCFG_NOTIFY = 204 FOURCC_COMPACT('t', 'b', 'c', 'f') | IFACE_EXCHANGE_SERIALIZE, 205 INTERFACE_PCAP_CONTROL = 206 FOURCC_COMPACT('p', 'c', 't', 'l') | IFACE_EXCHANGE_SERIALIZE, 204 FOURCC_COMPACT('t', 'b', 'c', 'f') | IFACE_EXCHANGE_SERIALIZE 207 205 } iface_t; 208 206 -
uspace/app/meson.build
r0472cf17 rb3b79981 71 71 'nic', 72 72 'nterm', 73 'pcapctl',74 73 'ofw', 75 74 'pci', -
uspace/drv/nic/e1k/e1k.c
r0472cf17 rb3b79981 49 49 #include <nic.h> 50 50 #include <ops/nic.h> 51 #include <pcapdump_iface.h>52 51 #include "e1k.h" 53 52 … … 175 174 /** Lock for EEPROM access */ 176 175 fibril_mutex_t eeprom_lock; 177 178 176 } e1000_t; 179 177 … … 1191 1189 if (frame != NULL) { 1192 1190 memcpy(frame->data, e1000->rx_frame_virt[next_tail], frame_size); 1193 1194 1191 nic_received_frame(nic, frame); 1195 1192 } else { … … 2201 2198 goto err_fun_bind; 2202 2199 2203 rc = nic_fun_add_to_cats(fun); 2204 if (rc != EOK) { 2205 ddf_msg(LVL_ERROR, "Failed adding function to categories"); 2206 ddf_fun_unbind(fun); 2207 return rc; 2208 } 2200 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC); 2201 if (rc != EOK) 2202 goto err_add_to_cat; 2203 2209 2204 return EOK; 2210 2205 2211 //err_add_to_cat:2212 //ddf_fun_unbind(fun);2206 err_add_to_cat: 2207 ddf_fun_unbind(fun); 2213 2208 err_fun_bind: 2214 2209 err_rx_structure: … … 2370 2365 2371 2366 memcpy(e1000->tx_frame_virt[tdt], data, size); 2367 2372 2368 tx_descriptor_addr->phys_addr = PTR_TO_U64(e1000->tx_frame_phys[tdt]); 2373 2369 tx_descriptor_addr->length = size; -
uspace/drv/nic/e1k/meson.build
r0472cf17 rb3b79981 27 27 # 28 28 29 deps = [ 'nic' , 'pcap']29 deps = [ 'nic' ] 30 30 src = files('e1k.c') -
uspace/drv/nic/ne2k/ne2k.c
r0472cf17 rb3b79981 43 43 #include <str_error.h> 44 44 #include <async.h> 45 #include <ddf/log.h>46 45 #include "dp8390.h" 47 46 … … 450 449 } 451 450 452 rc = nic_fun_add_to_cats(fun);451 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC); 453 452 if (rc != EOK) { 454 ddf_msg(LVL_ERROR, "Failed adding function to categories");455 453 ddf_fun_unbind(fun); 454 ddf_fun_destroy(fun); 456 455 return rc; 457 456 } … … 483 482 nic_driver_implement(&ne2k_driver_ops, &ne2k_dev_ops, &ne2k_nic_iface); 484 483 485 ddf_log_init(NAME);486 484 return ddf_driver_main(&ne2k_driver); 487 485 } -
uspace/drv/nic/rtl8139/driver.c
r0472cf17 rb3b79981 42 42 #include <stdio.h> 43 43 #include <str.h> 44 #include <pcapdump_iface.h>45 44 46 45 #include "defs.h" … … 1306 1305 goto err_fun_create; 1307 1306 } 1308 1309 rc = nic_fun_add_to_cats(fun); 1307 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC); 1310 1308 if (rc != EOK) { 1311 ddf_msg(LVL_ERROR, "Failed adding function to categories"); 1312 ddf_fun_unbind(fun); 1313 return rc; 1309 ddf_msg(LVL_ERROR, "Failed adding function to category"); 1310 goto err_fun_bind; 1314 1311 } 1315 1312 … … 1319 1316 return EOK; 1320 1317 1321 //err_fun_bind:1322 //ddf_fun_unbind(fun);1318 err_fun_bind: 1319 ddf_fun_unbind(fun); 1323 1320 err_fun_create: 1324 1321 ddf_fun_destroy(fun); -
uspace/drv/nic/rtl8169/driver.c
r0472cf17 rb3b79981 458 458 } 459 459 460 rc = nic_fun_add_to_cats(fun);460 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC); 461 461 if (rc != EOK) { 462 ddf_msg(LVL_ERROR, "Failed adding function to categories"); 463 ddf_fun_unbind(fun); 464 return rc; 462 ddf_msg(LVL_ERROR, "Failed adding function to category"); 463 goto err_fun_bind; 465 464 } 466 465 … … 469 468 return EOK; 470 469 471 //err_fun_bind:472 //ddf_fun_unbind(fun);470 err_fun_bind: 471 ddf_fun_unbind(fun); 473 472 err_fun_create: 474 473 ddf_fun_destroy(fun); -
uspace/drv/nic/virtio-net/virtio-net.c
r0472cf17 rb3b79981 43 43 44 44 #include <virtio-pci.h> 45 #include <pcapdump_iface.h>46 45 47 46 #define NAME "virtio-net" … … 429 428 } 430 429 431 rc = nic_fun_add_to_cats(fun);430 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC); 432 431 if (rc != EOK) { 433 ddf_msg(LVL_ERROR, "Failed adding function to categories"); 434 ddf_fun_unbind(fun); 435 return rc; 432 ddf_msg(LVL_ERROR, "Failed adding function to category"); 433 goto unbind; 436 434 } 437 435 … … 441 439 return EOK; 442 440 443 //unbind:444 //ddf_fun_unbind(fun);441 unbind: 442 ddf_fun_unbind(fun); 445 443 destroy: 446 444 ddf_fun_destroy(fun); -
uspace/lib/c/include/ipc/services.h
r0472cf17 rb3b79981 67 67 #define SERVICE_NAME_VBD "vbd" 68 68 #define SERVICE_NAME_VOLSRV "volsrv" 69 #define SERVICE_NAME_DUMPPCAP "dumppcap" 69 70 70 #endif 71 71 -
uspace/lib/meson.build
r0472cf17 rb3b79981 82 82 'minix', 83 83 'nettl', 84 'pcap',85 84 'ofw', 86 85 'pcm', -
uspace/lib/nic/include/nic.h
r0472cf17 rb3b79981 44 44 #include <device/hw_res_parsed.h> 45 45 #include <ops/nic.h> 46 #include <pcap_iface.h>47 46 48 47 #define DEVICE_CATEGORY_NIC "nic" … … 279 278 extern void nic_sw_period_stop(nic_t *); 280 279 281 /* pcapdump interface */282 extern pcap_iface_t *nic_get_pcap_iface(nic_t *);283 284 extern errno_t nic_fun_add_to_cats(ddf_fun_t *fun);285 286 280 #endif // __NIC_H__ 287 281 -
uspace/lib/nic/include/nic_driver.h
r0472cf17 rb3b79981 46 46 #include <nic/nic.h> 47 47 #include <async.h> 48 #include <pcapdump_iface.h>49 48 50 49 #include "nic.h" … … 196 195 */ 197 196 poll_request_handler on_poll_request; 198 199 /** Interface for dumping packets */200 pcap_iface_t pcapdump;201 202 197 /** Data specific for particular driver */ 203 198 void *specific; -
uspace/lib/nic/include/nic_impl.h
r0472cf17 rb3b79981 87 87 extern void nic_close_impl(ddf_fun_t *fun); 88 88 89 extern void nic_device_added_impl(ddf_dev_t *dev); 90 89 91 #endif 90 92 -
uspace/lib/nic/meson.build
r0472cf17 rb3b79981 27 27 # 28 28 29 deps = [ 'drv' , 'pcap']29 deps = [ 'drv' ] 30 30 c_args = [ '-DLIBNIC_INTERNAL', ] 31 31 src = files( -
uspace/lib/nic/src/nic_driver.c
r0472cf17 rb3b79981 47 47 #include <ops/nic.h> 48 48 #include <errno.h> 49 #include <pcapdump_iface.h>50 49 51 50 #include "nic_driver.h" … … 523 522 * calls it inside send_frame handler (with locked main lock) 524 523 */ 525 pcapdump_packet(nic_get_pcap_iface(nic_data), frame->data, frame->size);526 524 fibril_rwlock_read_lock(&nic_data->rxc_lock); 527 525 nic_frame_type_t frame_type; … … 562 560 fibril_rwlock_write_unlock(&nic_data->stats_lock); 563 561 } 564 //pcapdump_packet(nic_get_pcap_iface(nic_data), frame->data, frame->size);565 562 nic_release_frame(nic_data, frame); 566 563 } … … 651 648 nic_data->dev = device; 652 649 653 errno_t pcap_rc = pcapdump_init(nic_get_pcap_iface(nic_data));654 if (pcap_rc != EOK) {655 printf("Failed creating pcapdump port\n");656 }657 658 650 return nic_data; 659 651 } … … 1141 1133 } 1142 1134 1143 pcap_iface_t *nic_get_pcap_iface(nic_t *nic_data)1144 {1145 return &nic_data->pcapdump;1146 }1147 1148 1135 /** @} 1149 1136 */ -
uspace/lib/nic/src/nic_impl.c
r0472cf17 rb3b79981 40 40 #include <ipc/services.h> 41 41 #include <ns.h> 42 #include <pcapdump_iface.h>43 42 #include "nic_driver.h" 44 43 #include "nic_ev.h" … … 180 179 return EBUSY; 181 180 } 182 pcapdump_packet(nic_get_pcap_iface(nic_data), data, size); 181 183 182 nic_data->send_frame(nic_data, data, size); 184 183 fibril_rwlock_read_unlock(&nic_data->main_lock); … … 844 843 } 845 844 846 errno_t nic_fun_add_to_cats(ddf_fun_t *fun)847 {848 errno_t rc;849 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);850 if (rc != EOK)851 goto err_add_to_cat;852 853 rc = ddf_fun_add_to_category(fun, "pcap");854 if (rc != EOK) {855 //ddf_msg(LVL_ERROR, "Failed adding function to category pcap");856 goto err_add_to_cat;857 }858 return EOK;859 860 err_add_to_cat:861 ddf_fun_unbind(fun);862 return rc;863 }864 865 845 /** @} 866 846 */ -
uspace/srv/locsrv/locsrv.c
r0472cf17 rb3b79981 1393 1393 categ_dir_add_cat(&cdir, cat); 1394 1394 1395 cat = category_new("pcap");1396 categ_dir_add_cat(&cdir, cat);1397 1395 return true; 1398 1396 }
Note:
See TracChangeset
for help on using the changeset viewer.