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