Changes in / [8426912a:08abd81] in mainline


Ignore:
Files:
100 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r8426912a r08abd81  
    547547
    548548% Launch (devman) test drivers
    549 ! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (n/y)
    550 
     549! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (y/n)
     550
  • Makefile

    r8426912a r08abd81  
    9292        $(MAKE) -C uspace clean
    9393        $(MAKE) -C boot clean
    94 
    95 -include Makefile.local
  • boot/Makefile.common

    r8426912a r08abd81  
    139139        $(USPACE_PATH)/app/ping/ping \
    140140        $(USPACE_PATH)/app/stats/stats \
    141         $(USPACE_PATH)/app/sysinfo/sysinfo \
    142141        $(USPACE_PATH)/app/tasks/tasks \
    143142        $(USPACE_PATH)/app/top/top \
    144         $(USPACE_PATH)/app/usbinfo/usbinfo \
    145         $(USPACE_PATH)/app/virtusbkbd/vuk \
     143        $(USPACE_PATH)/app/sysinfo/sysinfo \
    146144        $(USPACE_PATH)/app/websrv/websrv
    147145
  • boot/arch/amd64/Makefile.inc

    r8426912a r08abd81  
    4242        pciintel \
    4343        isa \
    44         ns8250 \
    45         uhci \
    46         usbhub \
    47         usbkbd \
    48         vhc
     44        ns8250
    4945
    5046RD_DRV_CFG += \
  • uspace/Makefile

    r8426912a r08abd81  
    5151        app/trace \
    5252        app/top \
    53         app/usbinfo \
    54         app/virtusbkbd \
    5553        app/netecho \
    5654        app/nettest1 \
     
    116114                drv/ns8250 \
    117115                srv/hw/irc/apic \
    118                 srv/hw/irc/i8259 \
    119                 drv/uhci \
    120                 drv/usbhub \
    121                 drv/usbkbd \
    122                 drv/vhc
     116                srv/hw/irc/i8259
    123117endif
    124118
     
    130124                drv/ns8250 \
    131125                srv/hw/irc/apic \
    132                 srv/hw/irc/i8259 \
    133                 drv/uhci \
    134                 drv/usbhub \
    135                 drv/usbkbd \
    136                 drv/vhc
     126                srv/hw/irc/i8259
    137127endif
    138128
     
    160150        lib/packet \
    161151        lib/net
    162 
    163 ifeq ($(UARCH),amd64)
    164         LIBS += lib/usb
    165         LIBS += lib/usbvirt
    166 endif
    167 
    168 ifeq ($(UARCH),ia32)
    169         LIBS += lib/usb
    170         LIBS += lib/usbvirt
    171 endif
    172152
    173153LIBC_BUILD = $(addsuffix .build,$(LIBC))
  • uspace/Makefile.common

    r8426912a r08abd81  
    8686LIBCLUI_PREFIX = $(LIB_PREFIX)/clui
    8787
    88 
    89 LIBUSB_PREFIX = $(LIB_PREFIX)/usb
    90 LIBUSBVIRT_PREFIX = $(LIB_PREFIX)/usbvirt
    9188LIBDRV_PREFIX = $(LIB_PREFIX)/drv
    9289LIBPACKET_PREFIX = $(LIB_PREFIX)/packet
  • uspace/app/init/init.c

    r8426912a r08abd81  
    314314        getterm("term/vc5", "/app/bdsh", false);
    315315        getterm("term/vc6", "/app/klog", false);
    316         getterm("term/vc7", "/srv/devman", false);
    317316       
    318317        return 0;
  • uspace/app/tester/Makefile

    r8426912a r08abd81  
    3131BINARY = tester
    3232
    33 LIBS += $(LIBUSB_PREFIX)/libusb.a
    34 EXTRA_CFLAGS += -I$(LIBUSB_PREFIX)/include
    35 
    3633SOURCES = \
    3734        tester.c \
    38         adt/usbaddrkeep.c \
    3935        thread/thread1.c \
    4036        print/print1.c \
  • uspace/app/tester/tester.c

    r8426912a r08abd81  
    6363#include "mm/malloc1.def"
    6464#include "hw/serial/serial1.def"
    65 #include "adt/usbaddrkeep.def"
    6665#include "hw/misc/virtchar1.def"
    6766        {NULL, NULL, NULL, false}
  • uspace/app/tester/tester.h

    r8426912a r08abd81  
    8080extern const char *test_malloc1(void);
    8181extern const char *test_serial1(void);
    82 extern const char *test_usbaddrkeep(void);
    8382extern const char *test_virtchar1(void);
    8483
  • uspace/doc/doxygroups.h

    r8426912a r08abd81  
    150150         * @endcond
    151151         */
    152 
     152       
    153153/**
    154154 * @defgroup emul Emulation Libraries
     
    165165         * @ingroup emul
    166166         */
    167 
    168 /**
    169  * @defgroup usb USB
    170  * @ingroup uspace
    171  * @brief USB support for HelenOS.
    172  */
    173         /**
    174          * @defgroup libusb USB library
    175          * @ingroup usb
    176          * @brief Library for creating USB devices drivers.
    177          */
  • uspace/drv/root/root.c

    r8426912a r08abd81  
    8888
    8989        int res = child_device_register_wrapper(parent, VIRTUAL_DEVICE_NAME,
    90             VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE,
    91             NULL);
     90            VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE);
    9291
    9392        return res;
     
    137136
    138137        res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME,
    139             match_id, PLATFORM_DEVICE_MATCH_SCORE, NULL);
     138            match_id, PLATFORM_DEVICE_MATCH_SCORE);
    140139
    141140        return res;
  • uspace/drv/rootvirt/devices.def

    r8426912a r08abd81  
    2222},
    2323#endif
    24 /* Virtual USB host controller. */
    25 {
    26         .name = "usbhc",
    27         .match_id = "usb&hc=vhc"
    28 },
  • uspace/drv/rootvirt/rootvirt.c

    r8426912a r08abd81  
    8484
    8585        int rc = child_device_register_wrapper(parent, virt_dev->name,
    86             virt_dev->match_id, 10, NULL);
     86            virt_dev->match_id, 10);
    8787
    8888        if (rc == EOK) {
  • uspace/drv/test1/test1.c

    r8426912a r08abd81  
    6262
    6363        int rc = child_device_register_wrapper(parent, name,
    64             match_id, match_score, NULL);
     64            match_id, match_score);
    6565
    6666        if (rc == EOK) {
  • uspace/drv/test2/test2.c

    r8426912a r08abd81  
    6464
    6565        int rc = child_device_register_wrapper(parent, name,
    66             match_id, match_score, NULL);
     66            match_id, match_score);
    6767
    6868        if (rc == EOK) {
  • uspace/lib/c/include/assert.h

    r8426912a r08abd81  
    5757                        printf("Assertion failed (%s) at file '%s', " \
    5858                            "line %d.\n", #expr, __FILE__, __LINE__); \
    59                         stacktrace_print(); \
    60                         core(); \
    6159                        abort(); \
    6260                } \
  • uspace/lib/c/include/ipc/dev_iface.h

    r8426912a r08abd81  
    3838        HW_RES_DEV_IFACE = 0,
    3939        CHAR_DEV_IFACE,
    40 
    41         /** Interface provided by any USB device. */
    42         USB_DEV_IFACE,
    43         /** Interface provided by USB host controller. */
    44         USBHC_DEV_IFACE,
    45 
    4640        DEV_IFACE_MAX
    4741} dev_inferface_idx_t;
     
    5549        DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX)
    5650
    57 /*
    58  * The first argument is actually method (as the "real" method is used
    59  * for indexing into interfaces.
    60  */
    61 
    62 #define DEV_IPC_GET_ARG1(call) IPC_GET_ARG2((call))
    63 #define DEV_IPC_GET_ARG2(call) IPC_GET_ARG3((call))
    64 #define DEV_IPC_GET_ARG3(call) IPC_GET_ARG4((call))
    65 #define DEV_IPC_GET_ARG4(call) IPC_GET_ARG5((call))
    66 
    6751
    6852#endif
  • uspace/lib/c/include/ipc/kbd.h

    r8426912a r08abd81  
    3939
    4040#include <ipc/ipc.h>
    41 #include <ipc/dev_iface.h>
    4241
    4342typedef enum {
    44         KBD_YIELD = DEV_FIRST_CUSTOM_METHOD,
     43        KBD_YIELD = IPC_FIRST_USER_METHOD,
    4544        KBD_RECLAIM
    4645} kbd_request_t;
  • uspace/lib/drv/Makefile

    r8426912a r08abd81  
    2929
    3030USPACE_PREFIX = ../..
    31 EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include
     31EXTRA_CFLAGS = -Iinclude
    3232LIBRARY = libdrv
    3333
     
    3535        generic/driver.c \
    3636        generic/dev_iface.c \
    37         generic/remote_char_dev.c \
    3837        generic/remote_hw_res.c \
    39         generic/remote_usb.c \
    40         generic/remote_usbhc.c
     38        generic/remote_char_dev.c
    4139
    4240include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/drv/generic/dev_iface.c

    r8426912a r08abd81  
    4141#include "remote_hw_res.h"
    4242#include "remote_char_dev.h"
    43 #include "remote_usb.h"
    44 #include "remote_usbhc.h"
    4543
    4644static iface_dipatch_table_t remote_ifaces = {
    4745        .ifaces = {
    4846                &remote_hw_res_iface,
    49                 &remote_char_dev_iface,
    50                 &remote_usb_iface,
    51                 &remote_usbhc_iface
     47                &remote_char_dev_iface
    5248        }
    5349};
  • uspace/lib/drv/generic/driver.c

    r8426912a r08abd81  
    512512 */
    513513int child_device_register_wrapper(device_t *parent, const char *child_name,
    514     const char *child_match_id, int child_match_score,
    515     devman_handle_t *child_handle)
     514    const char *child_match_id, int child_match_score)
    516515{
    517516        device_t *child = NULL;
     
    540539        if (rc != EOK)
    541540                goto failure;
    542 
    543         if (child_handle != NULL) {
    544                 *child_handle = child->handle;
    545         }
    546 
     541       
    547542        return EOK;
    548543       
  • uspace/lib/drv/include/driver.h

    r8426912a r08abd81  
    146146extern int child_device_register(device_t *, device_t *);
    147147extern int child_device_register_wrapper(device_t *, const char *, const char *,
    148     int, devman_handle_t *);
     148    int);
    149149
    150150/*
  • uspace/srv/devman/devman.c

    r8426912a r08abd81  
    133133        printf(NAME": the '%s' driver was added to the list of available "
    134134            "drivers.\n", drv->name);
    135 
    136         printf(NAME ": match ids:");
    137         link_t *cur;
    138         for (cur = drv->match_ids.ids.next; cur != &drv->match_ids.ids; cur = cur->next) {
    139                 match_id_t *match_id = list_get_instance(cur, match_id_t, link);
    140                 printf(" %d:%s", match_id->score, match_id->id);
    141         }
    142         printf("\n");
    143135}
    144136
  • uspace/srv/devman/main.c

    r8426912a r08abd81  
    458458       
    459459        if (driver == NULL) {
    460                 printf(NAME ": devman_forward error - the device %" PRIun \
    461                     " (%s) is not in usable state.\n",
    462                     handle, dev->pathname);
     460                printf(NAME ": devman_forward error - the device is not in %" PRIun
     461                    " usable state.\n", handle);
    463462                ipc_answer_0(iid, ENOENT);
    464463                return;
  • uspace/srv/hid/console/console.c

    r8426912a r08abd81  
    317317static void change_console(console_t *cons)
    318318{
    319         if (cons == active_console) {
     319        if (cons == active_console)
    320320                return;
    321         }
    322321       
    323322        fb_pending_flush();
     
    459458                        if (IPC_GET_ARG1(call) == 1) {
    460459                                int newcon = gcons_mouse_btn((bool) IPC_GET_ARG2(call));
    461                                 if (newcon != -1) {
     460                                if (newcon != -1)
    462461                                        change_console(&consoles[newcon]);
    463                                 }
    464462                        }
    465463                        retval = 0;
     
    712710}
    713711
    714 static int connect_keyboard(char *path)
    715 {
    716         int fd = open(path, O_RDONLY);
    717         if (fd < 0) {
    718                 return fd;
    719         }
    720        
    721         int phone = fd_phone(fd);
    722         if (phone < 0) {
     712static bool console_init(char *input)
     713{
     714        /* Connect to input device */
     715        int input_fd = open(input, O_RDONLY);
     716        if (input_fd < 0) {
     717                printf(NAME ": Failed opening %s\n", input);
     718                return false;
     719        }
     720       
     721        kbd_phone = fd_phone(input_fd);
     722        if (kbd_phone < 0) {
    723723                printf(NAME ": Failed to connect to input device\n");
    724                 return phone;
     724                return false;
    725725        }
    726726       
    727727        /* NB: The callback connection is slotted for removal */
    728728        sysarg_t phonehash;
    729         int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, SERVICE_CONSOLE,
    730             0, 0, NULL, NULL, NULL, NULL, &phonehash);
    731         if (rc != EOK) {
     729        if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) {
    732730                printf(NAME ": Failed to create callback from input device\n");
    733                 return rc;
     731                return false;
    734732        }
    735733       
    736734        async_new_connection(phonehash, 0, NULL, keyboard_events);
    737 
    738         printf(NAME ": we got a hit (new keyboard \"%s\").\n", path);
    739 
    740         return phone;
    741 }
    742 
    743 /** Try to connect to given keyboard, bypassing provided libc routines.
    744  *
    745  * @param devmap_path Path to keyboard without /dev prefix.
    746  * @return Phone or error code.
    747  */
    748 static int connect_keyboard_bypass(char *devmap_path)
    749 {
    750         int devmap_phone = async_connect_me_to_blocking(PHONE_NS,
    751             SERVICE_DEVMAP, DEVMAP_CLIENT, 0);
    752         if (devmap_phone < 0) {
    753                 return devmap_phone;
    754         }
    755         ipc_call_t answer;
    756         aid_t req = async_send_2(devmap_phone, DEVMAP_DEVICE_GET_HANDLE,
    757             0, 0,  &answer);
    758 
    759         sysarg_t retval = async_data_write_start(devmap_phone,
    760             devmap_path, str_size(devmap_path));
    761         if (retval != EOK) {
    762                 async_wait_for(req, NULL);
    763                 ipc_hangup(devmap_phone);
    764                 return retval;
    765         }
    766 
    767         async_wait_for(req, &retval);
    768 
    769         if (retval != EOK) {
    770                 ipc_hangup(devmap_phone);
    771                 return retval;
    772         }
    773 
    774         devmap_handle_t handle = (devmap_handle_t) IPC_GET_ARG1(answer);
    775 
    776         ipc_hangup(devmap_phone);
    777 
    778         int phone = async_connect_me_to(PHONE_NS,
    779             SERVICE_DEVMAP, DEVMAP_CONNECT_TO_DEVICE, handle);
    780         if (phone < 0) {
    781                 return phone;
    782         }
    783 
    784         /* NB: The callback connection is slotted for removal */
    785         sysarg_t phonehash;
    786         int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, SERVICE_CONSOLE,
    787             0, 0, NULL, NULL, NULL, NULL, &phonehash);
    788         if (rc != EOK) {
    789                 printf(NAME ": Failed to create callback from input device\n");
    790                 return rc;
    791         }
    792 
    793         async_new_connection(phonehash, 0, NULL, keyboard_events);
    794 
    795         printf(NAME ": we got a hit (new keyboard \"/dev/%s\").\n",
    796             devmap_path);
    797 
    798         return phone;
    799 }
    800 
    801 
    802 static int check_new_keyboards(void *arg)
    803 {
    804         char *class_name = (char *) arg;
    805 
    806         int index = 1;
    807 
    808         while (true) {
    809                 async_usleep(1 * 500 * 1000);
    810                 char *path;
    811                 int rc = asprintf(&path, "class/%s\\%d", class_name, index);
    812                 if (rc < 0) {
    813                         continue;
    814                 }
    815                 rc = 0;
    816                 rc = connect_keyboard_bypass(path);
    817                 if (rc > 0) {
    818                         /* We do not allow unplug. */
    819                         index++;
    820                 }
    821 
    822                 free(path);
    823         }
    824 
    825         return EOK;
    826 }
    827 
    828 
    829 /** Start a fibril monitoring hot-plugged keyboards.
    830  */
    831 static void check_new_keyboards_in_background()
    832 {
    833         fid_t fid = fibril_create(check_new_keyboards, (void *)"keyboard");
    834         if (!fid) {
    835                 printf(NAME ": failed to create hot-plug-watch fibril.\n");
    836                 return;
    837         }
    838         fibril_add_ready(fid);
    839 }
    840 
    841 static bool console_init(char *input)
    842 {
    843         /* Connect to input device */
    844         kbd_phone = connect_keyboard(input);
    845         if (kbd_phone < 0) {
    846                 return false;
    847         }
    848 
     735       
    849736        /* Connect to mouse device */
    850737        mouse_phone = -1;
     
    862749        }
    863750       
    864         sysarg_t phonehash;
    865751        if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) {
    866752                printf(NAME ": Failed to create callback from mouse device\n");
     
    954840        async_set_interrupt_received(interrupt_received);
    955841       
    956         /* Start fibril for checking on hot-plugged keyboards. */
    957         check_new_keyboards_in_background();
    958 
    959842        return true;
    960843}
     
    976859        if (!console_init(argv[1]))
    977860                return -1;
    978 
     861       
    979862        printf(NAME ": Accepting connections\n");
    980863        async_manager();
  • uspace/srv/net/tl/udp/udp.c

    r8426912a r08abd81  
    742742        int socket_id;
    743743        size_t addrlen;
    744         size_t size = 0;
     744        size_t size;
    745745        ipc_call_t answer;
    746746        size_t answer_count;
Note: See TracChangeset for help on using the changeset viewer.