Changeset 6eab537d in mainline for uspace/drv/nic


Ignore:
Timestamp:
2024-03-10T09:38:44Z (19 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
e846bec
Parents:
192019f
Message:

moved to nic, fixed all except addressing

Location:
uspace/drv/nic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/e1k/e1k.c

    r192019f r6eab537d  
    4949#include <nic.h>
    5050#include <ops/nic.h>
     51#include <pcapdump_iface.h>
    5152#include "e1k.h"
    5253
    53 #include "pcapdump_iface.h"
    54 #include "pcap_iface.h"
    5554#define NAME  "e1k"
    5655
     
    11921191                if (frame != NULL) {
    11931192                        memcpy(frame->data, e1000->rx_frame_virt[next_tail], frame_size);
    1194                         pcapdump_packet(nic_get_pcap_iface(nic), frame->data, frame->size);
    11951193
    11961194                        nic_received_frame(nic, frame);
     
    22082206                goto err_add_to_cat;
    22092207
    2210         errno_t pcap_rc  = pcapdump_init(nic_get_pcap_iface(nic));
    2211 
    2212         if (pcap_rc != EOK) {
    2213                 printf("Failed creating pcapdump port\n");
    2214         }
    22152208        rc = ddf_fun_add_to_category(fun, "pcap");
    2216         if (rc != EOK)
     2209        if (rc != EOK) {
     2210                ddf_msg(LVL_ERROR, "Failed adding function to category pcap");
    22172211                goto err_add_to_cat;
     2212        }
    22182213
    22192214        return EOK;
     
    23802375
    23812376        memcpy(e1000->tx_frame_virt[tdt], data, size);
    2382         pcapdump_packet(nic_get_pcap_iface(nic), data, size);
    23832377        tx_descriptor_addr->phys_addr = PTR_TO_U64(e1000->tx_frame_phys[tdt]);
    23842378        tx_descriptor_addr->length = size;
  • uspace/drv/nic/virtio-net/virtio-net.c

    r192019f r6eab537d  
    4343
    4444#include <virtio-pci.h>
    45 #include "pcapdump_iface.h"
    46 #include "pcap_iface.h"
     45#include <pcapdump_iface.h>
     46
    4747#define NAME    "virtio-net"
    4848
     
    9393                if (frame) {
    9494                        memcpy(frame->data, &hdr[1], len - sizeof(*hdr));
    95                         pcapdump_packet(nic_get_pcap_iface(nic), frame->data, frame->size);
    9695                        nic_received_frame(nic, frame);
    9796                } else {
     
    353352        /* Copy packet data into the buffer just past the header */
    354353        memcpy(&hdr[1], data, size);
    355         pcapdump_packet(nic_get_pcap_iface(nic), data, size);
     354
    356355        /*
    357356         * Set the descriptor, put it into the virtqueue and notify the device
     
    433432            ddf_dev_get_name(dev));
    434433
    435         errno_t pcap_rc  = pcapdump_init(nic_get_pcap_iface(nic));
    436 
    437         if (pcap_rc != EOK) {
    438                 printf("Failed creating pcapdump port\n");
    439         }
    440434        rc = ddf_fun_add_to_category(fun, "pcap");
    441         if (rc != EOK)
     435        if (rc != EOK) {
     436                ddf_msg(LVL_ERROR, "Failed adding function to category pcap");
    442437                goto unbind;
     438        }
    443439
    444440        return EOK;
Note: See TracChangeset for help on using the changeset viewer.