Changeset 3a4c6d9 in mainline for uspace/drv


Ignore:
Timestamp:
2025-11-14T16:58:23Z (8 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
1ec732a, 43ef144, 7101dfb, e998d98
Parents:
d101368
git-author:
Nataliia Korop <n.corop08@…> (2025-11-14 16:57:02)
git-committer:
Jiri Svoboda <jiri@…> (2025-11-14 16:58:23)
Message:

Packet capture (thx Nataliia Korop)

Location:
uspace/drv/nic
Files:
6 edited

Legend:

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

    rd101368 r3a4c6d9  
    175175        /** Lock for EEPROM access */
    176176        fibril_mutex_t eeprom_lock;
     177
    177178} e1000_t;
    178179
     
    11921193                if (frame != NULL) {
    11931194                        memcpy(frame->data, e1000->rx_frame_virt[next_tail], frame_size);
     1195
    11941196                        nic_received_frame(nic, frame);
    11951197                } else {
     
    22012203                goto err_fun_bind;
    22022204
    2203         rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
    2204         if (rc != EOK)
    2205                 goto err_add_to_cat;
    2206 
     2205        rc = nic_fun_add_to_cats(fun);
     2206        if (rc != EOK) {
     2207                ddf_msg(LVL_ERROR, "Failed adding function to categories");
     2208                ddf_fun_unbind(fun);
     2209                return rc;
     2210        }
    22072211        return EOK;
    22082212
    2209 err_add_to_cat:
    2210         ddf_fun_unbind(fun);
    22112213err_fun_bind:
    22122214err_rx_structure:
     
    23882390
    23892391        memcpy(e1000->tx_frame_virt[tdt], data, size);
    2390 
    23912392        tx_descriptor_addr->phys_addr = PTR_TO_U64(e1000->tx_frame_phys[tdt]);
    23922393        tx_descriptor_addr->length = size;
  • uspace/drv/nic/e1k/meson.build

    rd101368 r3a4c6d9  
    2727#
    2828
    29 deps = [ 'nic' ]
     29deps = [ 'nic' , 'pcap' ]
    3030src = files('e1k.c')
  • uspace/drv/nic/ne2k/ne2k.c

    rd101368 r3a4c6d9  
    4444#include <str_error.h>
    4545#include <async.h>
     46#include <ddf/log.h>
    4647#include "dp8390.h"
    4748
     
    450451        }
    451452
    452         rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     453        rc = nic_fun_add_to_cats(fun);
    453454        if (rc != EOK) {
     455                ddf_msg(LVL_ERROR, "Failed adding function to categories");
    454456                ddf_fun_unbind(fun);
    455                 ddf_fun_destroy(fun);
    456457                return rc;
    457458        }
     
    497498        nic_driver_implement(&ne2k_driver_ops, &ne2k_dev_ops, &ne2k_nic_iface);
    498499
     500        ddf_log_init(NAME);
    499501        return ddf_driver_main(&ne2k_driver);
    500502}
  • uspace/drv/nic/rtl8139/driver.c

    rd101368 r3a4c6d9  
    13131313                goto err_fun_create;
    13141314        }
    1315         rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     1315
     1316        rc = nic_fun_add_to_cats(fun);
    13161317        if (rc != EOK) {
    1317                 ddf_msg(LVL_ERROR, "Failed adding function to category");
    1318                 goto err_fun_bind;
     1318                ddf_msg(LVL_ERROR, "Failed adding function to categories");
     1319                ddf_fun_unbind(fun);
     1320                return rc;
    13191321        }
    13201322
     
    13241326        return EOK;
    13251327
    1326 err_fun_bind:
    1327         ddf_fun_unbind(fun);
     1328        // err_fun_bind:
     1329        // ddf_fun_unbind(fun);
    13281330err_fun_create:
    13291331        ddf_fun_destroy(fun);
  • uspace/drv/nic/rtl8169/driver.c

    rd101368 r3a4c6d9  
    461461        }
    462462
    463         rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     463        rc = nic_fun_add_to_cats(fun);
    464464        if (rc != EOK) {
    465                 ddf_msg(LVL_ERROR, "Failed adding function to category");
    466                 goto err_fun_bind;
     465                ddf_msg(LVL_ERROR, "Failed adding function to categories");
     466                ddf_fun_unbind(fun);
     467                return rc;
    467468        }
    468469
     
    471472        return EOK;
    472473
    473 err_fun_bind:
    474         ddf_fun_unbind(fun);
     474        // err_fun_bind:
     475        // ddf_fun_unbind(fun);
    475476err_fun_create:
    476477        ddf_fun_destroy(fun);
  • uspace/drv/nic/virtio-net/virtio-net.c

    rd101368 r3a4c6d9  
    428428        }
    429429
    430         rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     430        rc = nic_fun_add_to_cats(fun);
    431431        if (rc != EOK) {
    432                 ddf_msg(LVL_ERROR, "Failed adding function to category");
    433                 goto unbind;
     432                ddf_msg(LVL_ERROR, "Failed adding function to categories");
     433                ddf_fun_unbind(fun);
     434                return rc;
    434435        }
    435436
     
    439440        return EOK;
    440441
    441 unbind:
    442         ddf_fun_unbind(fun);
     442        // unbind:
     443        // ddf_fun_unbind(fun);
    443444destroy:
    444445        ddf_fun_destroy(fun);
Note: See TracChangeset for help on using the changeset viewer.