Changeset efdfebc in mainline for uspace/srv/net/ethip/ethip_nic.c


Ignore:
Timestamp:
2012-11-06T21:03:44Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
338810f
Parents:
de73242 (diff), 94795812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/ethip/ethip_nic.c

    rde73242 refdfebc  
    6868        rc = loc_category_get_id("nic", &iplink_cat, IPC_FLAG_BLOCKING);
    6969        if (rc != EOK) {
    70                 log_msg(LVL_ERROR, "Failed resolving category 'nic'.");
     70                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed resolving category 'nic'.");
    7171                fibril_mutex_unlock(&ethip_discovery_lock);
    7272                return ENOENT;
     
    7575        rc = loc_category_get_svcs(iplink_cat, &svcs, &count);
    7676        if (rc != EOK) {
    77                 log_msg(LVL_ERROR, "Failed getting list of IP links.");
     77                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed getting list of IP links.");
    7878                fibril_mutex_unlock(&ethip_discovery_lock);
    7979                return EIO;
     
    9393
    9494                if (!already_known) {
    95                         log_msg(LVL_DEBUG, "Found NIC '%lu'",
     95                        log_msg(LOG_DEFAULT, LVL_DEBUG, "Found NIC '%lu'",
    9696                            (unsigned long) svcs[i]);
    9797                        rc = ethip_nic_open(svcs[i]);
    9898                        if (rc != EOK)
    99                                 log_msg(LVL_ERROR, "Could not open NIC.");
     99                                log_msg(LOG_DEFAULT, LVL_ERROR, "Could not open NIC.");
    100100                }
    101101        }
     
    110110
    111111        if (nic == NULL) {
    112                 log_msg(LVL_ERROR, "Failed allocating NIC structure. "
     112                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed allocating NIC structure. "
    113113                    "Out of memory.");
    114114                return NULL;
     
    126126
    127127        if (laddr == NULL) {
    128                 log_msg(LVL_ERROR, "Failed allocating NIC address structure. "
     128                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed allocating NIC address structure. "
    129129                    "Out of memory.");
    130130                return NULL;
     
    153153        nic_address_t nic_address;
    154154       
    155         log_msg(LVL_DEBUG, "ethip_nic_open()");
     155        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_open()");
    156156        ethip_nic_t *nic = ethip_nic_new();
    157157        if (nic == NULL)
     
    160160        int rc = loc_service_get_name(sid, &nic->svc_name);
    161161        if (rc != EOK) {
    162                 log_msg(LVL_ERROR, "Failed getting service name.");
     162                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed getting service name.");
    163163                goto error;
    164164        }
     
    166166        nic->sess = loc_service_connect(EXCHANGE_SERIALIZE, sid, 0);
    167167        if (nic->sess == NULL) {
    168                 log_msg(LVL_ERROR, "Failed connecting '%s'", nic->svc_name);
     168                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed connecting '%s'", nic->svc_name);
    169169                goto error;
    170170        }
     
    174174        rc = nic_callback_create(nic->sess, ethip_nic_cb_conn, nic);
    175175        if (rc != EOK) {
    176                 log_msg(LVL_ERROR, "Failed creating callback connection "
     176                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed creating callback connection "
    177177                    "from '%s'", nic->svc_name);
    178178                goto error;
    179179        }
    180180
    181         log_msg(LVL_DEBUG, "Opened NIC '%s'", nic->svc_name);
     181        log_msg(LOG_DEFAULT, LVL_DEBUG, "Opened NIC '%s'", nic->svc_name);
    182182        list_append(&nic->nic_list, &ethip_nic_list);
    183183        in_list = true;
     
    189189        rc = nic_get_address(nic->sess, &nic_address);
    190190        if (rc != EOK) {
    191                 log_msg(LVL_ERROR, "Error getting MAC address of NIC '%s'.",
     191                log_msg(LOG_DEFAULT, LVL_ERROR, "Error getting MAC address of NIC '%s'.",
    192192                    nic->svc_name);
    193193                goto error;
     
    198198        rc = nic_set_state(nic->sess, NIC_STATE_ACTIVE);
    199199        if (rc != EOK) {
    200                 log_msg(LVL_ERROR, "Error activating NIC '%s'.",
     200                log_msg(LOG_DEFAULT, LVL_ERROR, "Error activating NIC '%s'.",
    201201                    nic->svc_name);
    202202                goto error;
    203203        }
    204204
    205         log_msg(LVL_DEBUG, "Initialized IP link service, MAC = 0x%" PRIx64,
     205        log_msg(LOG_DEFAULT, LVL_DEBUG, "Initialized IP link service, MAC = 0x%" PRIx64,
    206206            nic->mac_addr.addr);
    207207
     
    225225    ipc_call_t *call)
    226226{
    227         log_msg(LVL_DEBUG, "ethip_nic_addr_changed()");
     227        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_changed()");
    228228        async_answer_0(callid, ENOTSUP);
    229229}
     
    236236        size_t size;
    237237
    238         log_msg(LVL_DEBUG, "ethip_nic_received() nic=%p", nic);
     238        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_received() nic=%p", nic);
    239239
    240240        rc = async_data_write_accept(&data, false, 0, 0, 0, &size);
    241241        if (rc != EOK) {
    242                 log_msg(LVL_DEBUG, "data_write_accept() failed");
     242                log_msg(LOG_DEFAULT, LVL_DEBUG, "data_write_accept() failed");
    243243                return;
    244244        }
    245245
    246         log_msg(LVL_DEBUG, "Ethernet PDU contents (%zu bytes)",
     246        log_msg(LOG_DEFAULT, LVL_DEBUG, "Ethernet PDU contents (%zu bytes)",
    247247            size);
    248248
    249         log_msg(LVL_DEBUG, "call ethip_received");
     249        log_msg(LOG_DEFAULT, LVL_DEBUG, "call ethip_received");
    250250        rc = ethip_received(&nic->iplink, data, size);
    251         log_msg(LVL_DEBUG, "free data");
     251        log_msg(LOG_DEFAULT, LVL_DEBUG, "free data");
    252252        free(data);
    253253
    254         log_msg(LVL_DEBUG, "ethip_nic_received() done, rc=%d", rc);
     254        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_received() done, rc=%d", rc);
    255255        async_answer_0(callid, rc);
    256256}
     
    259259    ipc_call_t *call)
    260260{
    261         log_msg(LVL_DEBUG, "ethip_nic_device_state()");
     261        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_device_state()");
    262262        async_answer_0(callid, ENOTSUP);
    263263}
     
    267267        ethip_nic_t *nic = (ethip_nic_t *)arg;
    268268
    269         log_msg(LVL_DEBUG, "ethnip_nic_cb_conn()");
     269        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethnip_nic_cb_conn()");
    270270
    271271        while (true) {
     
    298298        int rc = loc_register_cat_change_cb(ethip_nic_cat_change_cb);
    299299        if (rc != EOK) {
    300                 log_msg(LVL_ERROR, "Failed registering callback for NIC "
     300                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering callback for NIC "
    301301                    "discovery (%d).", rc);
    302302                return rc;
     
    308308ethip_nic_t *ethip_nic_find_by_iplink_sid(service_id_t iplink_sid)
    309309{
    310         log_msg(LVL_DEBUG, "ethip_nic_find_by_iplink_sid(%u)",
     310        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid(%u)",
    311311            (unsigned) iplink_sid);
    312312
    313313        list_foreach(ethip_nic_list, link) {
    314                 log_msg(LVL_DEBUG, "ethip_nic_find_by_iplink_sid - element");
     314                log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid - element");
    315315                ethip_nic_t *nic = list_get_instance(link, ethip_nic_t,
    316316                    nic_list);
    317317
    318318                if (nic->iplink_sid == iplink_sid) {
    319                         log_msg(LVL_DEBUG, "ethip_nic_find_by_iplink_sid - found %p", nic);
     319                        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid - found %p", nic);
    320320                        return nic;
    321321                }
    322322        }
    323323
    324         log_msg(LVL_DEBUG, "ethip_nic_find_by_iplink_sid - not found");
     324        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid - not found");
    325325        return NULL;
    326326}
     
    329329{
    330330        int rc;
    331         log_msg(LVL_DEBUG, "ethip_nic_send(size=%zu)", size);
     331        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_send(size=%zu)", size);
    332332        rc = nic_send_frame(nic->sess, data, size);
    333         log_msg(LVL_DEBUG, "nic_send_frame -> %d", rc);
     333        log_msg(LOG_DEFAULT, LVL_DEBUG, "nic_send_frame -> %d", rc);
    334334        return rc;
    335335}
     
    339339        ethip_link_addr_t *laddr;
    340340
    341         log_msg(LVL_DEBUG, "ethip_nic_addr_add()");
     341        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_add()");
    342342        laddr = ethip_nic_addr_new(addr);
    343343        if (laddr == NULL)
     
    352352        ethip_link_addr_t *laddr;
    353353
    354         log_msg(LVL_DEBUG, "ethip_nic_addr_remove()");
     354        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_remove()");
    355355
    356356        laddr = ethip_nic_addr_find(nic, addr);
     
    366366    iplink_srv_addr_t *addr)
    367367{
    368         log_msg(LVL_DEBUG, "ethip_nic_addr_find()");
     368        log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_find()");
    369369
    370370        list_foreach(nic->addr_list, link) {
Note: See TracChangeset for help on using the changeset viewer.