Changes in / [522eecf:34aad53d] in mainline


Ignore:
Files:
13 added
13 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/ipc/interfaces.h

    r522eecf r34aad53d  
    202202            FOURCC_COMPACT('w', 'm', 'g', 't') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK,
    203203        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,
    205207} iface_t;
    206208
  • uspace/app/meson.build

    r522eecf r34aad53d  
    7272        'nic',
    7373        'nterm',
     74        'pcapctl',
    7475        'ofw',
    7576        'pci',
  • uspace/drv/nic/e1k/e1k.c

    r522eecf r34aad53d  
    4949#include <nic.h>
    5050#include <ops/nic.h>
     51#include <pcapdump_iface.h>
    5152#include "e1k.h"
    5253
     
    174175        /** Lock for EEPROM access */
    175176        fibril_mutex_t eeprom_lock;
     177
    176178} e1000_t;
    177179
     
    11891191                if (frame != NULL) {
    11901192                        memcpy(frame->data, e1000->rx_frame_virt[next_tail], frame_size);
     1193
    11911194                        nic_received_frame(nic, frame);
    11921195                } else {
     
    22032206                goto err_add_to_cat;
    22042207
     2208        rc = ddf_fun_add_to_category(fun, "pcap");
     2209        if (rc != EOK) {
     2210                ddf_msg(LVL_ERROR, "Failed adding function to category pcap");
     2211                goto err_add_to_cat;
     2212        }
     2213
    22052214        return EOK;
    22062215
     
    23662375
    23672376        memcpy(e1000->tx_frame_virt[tdt], data, size);
    2368 
    23692377        tx_descriptor_addr->phys_addr = PTR_TO_U64(e1000->tx_frame_phys[tdt]);
    23702378        tx_descriptor_addr->length = size;
  • uspace/drv/nic/e1k/meson.build

    r522eecf r34aad53d  
    2727#
    2828
    29 deps = [ 'nic' ]
     29deps = [ 'nic' , 'pcap' ]
    3030src = files('e1k.c')
  • uspace/drv/nic/virtio-net/virtio-net.c

    r522eecf r34aad53d  
    4343
    4444#include <virtio-pci.h>
     45#include <pcapdump_iface.h>
    4546
    4647#define NAME    "virtio-net"
     
    431432            ddf_dev_get_name(dev));
    432433
     434        rc = ddf_fun_add_to_category(fun, "pcap");
     435        if (rc != EOK) {
     436                ddf_msg(LVL_ERROR, "Failed adding function to category pcap");
     437                goto unbind;
     438        }
     439
    433440        return EOK;
    434441
  • uspace/lib/c/include/ipc/services.h

    r522eecf r34aad53d  
    6767#define SERVICE_NAME_VBD      "vbd"
    6868#define SERVICE_NAME_VOLSRV   "volsrv"
    69 
     69#define SERVICE_NAME_DUMPPCAP "dumppcap"
    7070#endif
    7171
  • uspace/lib/meson.build

    r522eecf r34aad53d  
    8181        'minix',
    8282        'nettl',
     83        'pcap',
    8384        'ofw',
    8485        'pcm',
  • uspace/lib/nic/include/nic.h

    r522eecf r34aad53d  
    4444#include <device/hw_res_parsed.h>
    4545#include <ops/nic.h>
     46#include <pcap_iface.h>
    4647
    4748#define DEVICE_CATEGORY_NIC "nic"
     
    278279extern void nic_sw_period_stop(nic_t *);
    279280
     281/* pcapdump interface */
     282extern pcap_iface_t *nic_get_pcap_iface(nic_t *);
     283
    280284#endif // __NIC_H__
    281285
  • uspace/lib/nic/include/nic_driver.h

    r522eecf r34aad53d  
    4646#include <nic/nic.h>
    4747#include <async.h>
     48#include <pcapdump_iface.h>
    4849
    4950#include "nic.h"
     
    195196         */
    196197        poll_request_handler on_poll_request;
     198
     199        /** Interface for dumping packets */
     200        pcap_iface_t pcapdump;
     201
    197202        /** Data specific for particular driver */
    198203        void *specific;
  • uspace/lib/nic/meson.build

    r522eecf r34aad53d  
    2727#
    2828
    29 deps = [ 'drv' ]
     29deps = [ 'drv' , 'pcap' ]
    3030c_args = [ '-DLIBNIC_INTERNAL', ]
    3131src = files(
  • uspace/lib/nic/src/nic_driver.c

    r522eecf r34aad53d  
    4747#include <ops/nic.h>
    4848#include <errno.h>
     49#include <pcapdump_iface.h>
    4950
    5051#include "nic_driver.h"
     
    522523         *               calls it inside send_frame handler (with locked main lock)
    523524         */
     525        pcapdump_packet(nic_get_pcap_iface(nic_data), frame->data, frame->size);
    524526        fibril_rwlock_read_lock(&nic_data->rxc_lock);
    525527        nic_frame_type_t frame_type;
     
    560562                fibril_rwlock_write_unlock(&nic_data->stats_lock);
    561563        }
     564        //pcapdump_packet(nic_get_pcap_iface(nic_data), frame->data, frame->size);
    562565        nic_release_frame(nic_data, frame);
    563566}
     
    648651        nic_data->dev = device;
    649652
     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
    650658        return nic_data;
    651659}
     
    11331141}
    11341142
     1143pcap_iface_t *nic_get_pcap_iface(nic_t *nic_data)
     1144{
     1145        return &nic_data->pcapdump;
     1146}
     1147
    11351148/** @}
    11361149 */
  • uspace/lib/nic/src/nic_impl.c

    r522eecf r34aad53d  
    4040#include <ipc/services.h>
    4141#include <ns.h>
     42#include <pcapdump_iface.h>
    4243#include "nic_driver.h"
    4344#include "nic_ev.h"
     
    179180                return EBUSY;
    180181        }
    181 
     182        pcapdump_packet(nic_get_pcap_iface(nic_data), data, size);
    182183        nic_data->send_frame(nic_data, data, size);
    183184        fibril_rwlock_read_unlock(&nic_data->main_lock);
  • uspace/srv/locsrv/locsrv.c

    r522eecf r34aad53d  
    13931393        categ_dir_add_cat(&cdir, cat);
    13941394
     1395        cat = category_new("pcap");
     1396        categ_dir_add_cat(&cdir, cat);
    13951397        return true;
    13961398}
Note: See TracChangeset for help on using the changeset viewer.