Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 9a2eb14 in mainline for uspace/srv/hw/irc/icp-ic/icp-ic.c


Ignore:
Timestamp:
2017-10-15T15:04:15Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial
Children:
1974f56a
Parents:
75911d24
Message:

As a temporary measure, let IRC servers use the location service for DDF-compatible naming. This is needed until all interrupt controller drivers are in DDF and we can switch to DDF-based naming.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/irc/icp-ic/icp-ic.c

    r75911d24 r9a2eb14  
    4141#include <errno.h>
    4242#include <io/log.h>
    43 #include <ipc/services.h>
    4443#include <ipc/irc.h>
    45 #include <ns.h>
     44#include <loc.h>
    4645#include <sysinfo.h>
    4746#include <stdio.h>
     
    121120        char *pstr = NULL;
    122121        size_t platform_size;
     122        category_id_t irc_cat;
     123        service_id_t svc_id;
    123124        void *regs;
    124125        int rc;
     
    155156
    156157        async_set_fallback_port_handler(icpic_connection, NULL);
    157         service_register(SERVICE_IRC);
     158
     159        rc = loc_server_register(NAME);
     160        if (rc != EOK) {
     161                printf("%s: Failed registering server. (%d)\n", NAME, rc);
     162                return rc;
     163        }
     164
     165        rc = loc_service_register("irc/" NAME, &svc_id);
     166        if (rc != EOK) {
     167                printf("%s: Failed registering service. (%d)\n", NAME, rc);
     168                return rc;
     169        }
     170
     171        rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING);
     172        if (rc != EOK) {
     173                printf("%s: Failed resolving category 'iplink' (%d).\n", NAME,
     174                    rc);
     175                goto error;
     176        }
     177
     178        rc = loc_service_add_to_cat(svc_id, irc_cat);
     179        if (rc != EOK) {
     180                printf("%s: Failed adding service to category (%d).\n", NAME,
     181                    rc);
     182                goto error;
     183        }
    158184
    159185        free(platform);
Note: See TracChangeset for help on using the changeset viewer.