Changeset 357b5f5 in mainline for uspace/srv/hw


Ignore:
Timestamp:
2011-01-23T20:09:13Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fdb9982c
Parents:
cead2aa (diff), 7e36c8d (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.

Location:
uspace/srv/hw
Files:
6 added
5 deleted
3 edited
10 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/cuda_adb/cuda_adb.c

    rcead2aa r357b5f5  
    162162        rc = devmap_device_register("adb/kbd", &devmap_handle);
    163163        if (rc != EOK) {
    164                 devmap_hangup_phone(DEVMAP_DRIVER);
    165164                printf(NAME ": Unable to register device %s.\n", "adb/kdb");
    166165                return rc;
     
    172171        rc = devmap_device_register("adb/mouse", &devmap_handle);
    173172        if (rc != EOK) {
    174                 devmap_hangup_phone(DEVMAP_DRIVER);
    175173                printf(NAME ": Unable to register device %s.\n", "adb/mouse");
    176174                return rc;
     
    195193        ipc_callid_t callid;
    196194        ipc_call_t call;
    197         ipcarg_t method;
     195        sysarg_t method;
    198196        devmap_handle_t dh;
    199197        int retval;
     
    220218        while (1) {
    221219                callid = async_get_call(&call);
    222                 method = IPC_GET_METHOD(call);
     220                method = IPC_GET_IMETHOD(call);
    223221                switch (method) {
    224222                case IPC_M_PHONE_HUNGUP:
  • uspace/srv/hw/char/i8042/i8042.c

    rcead2aa r357b5f5  
    148148                rc = devmap_device_register(name, &i8042_port[i].devmap_handle);
    149149                if (rc != EOK) {
    150                         devmap_hangup_phone(DEVMAP_DRIVER);
    151150                        printf(NAME ": Unable to register device %s.\n", name);
    152151                        return rc;
     
    219218        ipc_callid_t callid;
    220219        ipc_call_t call;
    221         ipcarg_t method;
     220        sysarg_t method;
    222221        devmap_handle_t dh;
    223222        int retval;
     
    248247        while (1) {
    249248                callid = async_get_call(&call);
    250                 method = IPC_GET_METHOD(call);
     249                method = IPC_GET_IMETHOD(call);
    251250                switch (method) {
    252251                case IPC_M_PHONE_HUNGUP:
  • uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c

    rcead2aa r357b5f5  
    9595        rc = devmap_device_register(NAMESPACE "/" NAME, &uart->devmap_handle);
    9696        if (rc != EOK) {
    97                 devmap_hangup_phone(DEVMAP_DRIVER);
    9897                printf(NAME ": Unable to register device %s.\n",
    9998                    NAMESPACE "/" NAME);
     
    116115        ipc_callid_t callid;
    117116        ipc_call_t call;
    118         ipcarg_t method;
     117        sysarg_t method;
    119118        int retval;
    120119
     
    124123        while (1) {
    125124                callid = async_get_call(&call);
    126                 method = IPC_GET_METHOD(call);
     125                method = IPC_GET_IMETHOD(call);
    127126                switch (method) {
    128127                case IPC_M_PHONE_HUNGUP:
  • uspace/srv/hw/irc/apic/apic.c

    rcead2aa r357b5f5  
    11/*
    2  * Copyright (c) 2006 Ondrej Palkovsky
     2 * Copyright (c) 2011 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #include <inttypes.h>
     29/** @addtogroup apic
     30 * @{
     31 */
     32
     33/**
     34 * @file apic.c
     35 * @brief APIC driver.
     36 */
     37
     38#include <ipc/ipc.h>
     39#include <ipc/services.h>
     40#include <ipc/irc.h>
     41#include <ipc/ns.h>
     42#include <sysinfo.h>
     43#include <as.h>
     44#include <ddi.h>
     45#include <libarch/ddi.h>
     46#include <align.h>
     47#include <bool.h>
     48#include <errno.h>
     49#include <async.h>
     50#include <align.h>
     51#include <async.h>
    3052#include <stdio.h>
    31 #include <unistd.h>
    32 #include <async.h>
    33 #include <errno.h>
    34 #include "../tester.h"
     53#include <ipc/devmap.h>
    3554
    36 #define MAX_CONNECTIONS  50
     55#define NAME  "apic"
    3756
    38 static int connections[MAX_CONNECTIONS];
     57static int apic_enable_irq(sysarg_t irq)
     58{
     59        // FIXME: TODO
     60        return ENOTSUP;
     61}
    3962
    40 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     63/** Handle one connection to APIC.
     64 *
     65 * @param iid   Hash of the request that opened the connection.
     66 * @param icall Call data of the request that opened the connection.
     67 *
     68 */
     69static void apic_connection(ipc_callid_t iid, ipc_call_t *icall)
    4170{
    42         unsigned int i;
     71        ipc_callid_t callid;
     72        ipc_call_t call;
    4373       
    44         TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash);
     74        /*
     75         * Answer the first IPC_M_CONNECT_ME_TO call.
     76         */
    4577        ipc_answer_0(iid, EOK);
    46         for (i = 0; i < MAX_CONNECTIONS; i++) {
    47                 if (!connections[i]) {
    48                         connections[i] = icall->in_phone_hash;
    49                         break;
    50                 }
    51         }
    5278       
    5379        while (true) {
    54                 ipc_call_t call;
    55                 ipc_callid_t callid = async_get_call(&call);
    56                 int retval;
     80                callid = async_get_call(&call);
    5781               
    58                 switch (IPC_GET_METHOD(call)) {
    59                 case IPC_M_PHONE_HUNGUP:
    60                         TPRINTF("Phone %" PRIun " hung up\n", icall->in_phone_hash);
    61                         retval = 0;
     82                switch (IPC_GET_IMETHOD(call)) {
     83                case IRC_ENABLE_INTERRUPT:
     84                        ipc_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
    6285                        break;
    63                 case IPC_TEST_METHOD:
    64                         TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n",
    65                             icall->in_phone_hash, callid);
     86                case IRC_CLEAR_INTERRUPT:
     87                        /* Noop */
    6688                        ipc_answer_0(callid, EOK);
    6789                        break;
    6890                default:
    69                         TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n",
    70                             icall->in_phone_hash, callid);
    71                         ipc_answer_0(callid, ENOENT);
     91                        ipc_answer_0(callid, EINVAL);
    7292                        break;
    7393                }
     
    7595}
    7696
    77 const char *test_register(void)
     97/** Initialize the APIC driver.
     98 *
     99 */
     100static bool apic_init(void)
    78101{
    79         async_set_client_connection(client_connection);
     102        sysarg_t apic;
    80103       
    81         ipcarg_t phonead;
    82         int res = ipc_connect_to_me(PHONE_NS, IPC_TEST_SERVICE, 0, 0, &phonead);
    83         if (res != 0)
    84                 return "Failed registering IPC service";
     104        if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {
     105                printf(NAME ": No APIC found\n");
     106                return false;
     107        }
    85108       
    86         TPRINTF("Registered as service %u, accepting connections\n", IPC_TEST_SERVICE);
     109        async_set_client_connection(apic_connection);
     110        sysarg_t phonead;
     111        ipc_connect_to_me(PHONE_NS, SERVICE_APIC, 0, 0, &phonead);
     112       
     113        return true;
     114}
     115
     116int main(int argc, char **argv)
     117{
     118        printf(NAME ": HelenOS APIC driver\n");
     119       
     120        if (!apic_init())
     121                return -1;
     122       
     123        printf(NAME ": Accepting connections\n");
    87124        async_manager();
    88125       
    89         return NULL;
     126        /* Never reached */
     127        return 0;
    90128}
     129
     130/**
     131 * @}
     132 */
  • uspace/srv/hw/irc/fhc/fhc.c

    rcead2aa r357b5f5  
    3838#include <ipc/ipc.h>
    3939#include <ipc/services.h>
    40 #include <ipc/bus.h>
     40#include <ipc/irc.h>
    4141#include <ipc/ns.h>
    4242#include <sysinfo.h>
     
    8282       
    8383                callid = async_get_call(&call);
    84                 switch (IPC_GET_METHOD(call)) {
    85                 case BUS_CLEAR_INTERRUPT:
     84                switch (IPC_GET_IMETHOD(call)) {
     85                case IRC_ENABLE_INTERRUPT:
     86                        /* Noop */
     87                        ipc_answer_0(callid, EOK);
     88                        break;
     89                case IRC_CLEAR_INTERRUPT:
    8690                        inr = IPC_GET_ARG1(call);
    8791                        switch (inr) {
     
    133137       
    134138        async_set_client_connection(fhc_connection);
    135         ipcarg_t phonead;
     139        sysarg_t phonead;
    136140        ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead);
    137141       
  • uspace/srv/hw/irc/obio/obio.c

    rcead2aa r357b5f5  
    4444#include <ipc/ipc.h>
    4545#include <ipc/services.h>
    46 #include <ipc/bus.h>
     46#include <ipc/irc.h>
    4747#include <ipc/ns.h>
    4848#include <sysinfo.h>
     
    9292       
    9393                callid = async_get_call(&call);
    94                 switch (IPC_GET_METHOD(call)) {
    95                 case BUS_CLEAR_INTERRUPT:
     94                switch (IPC_GET_IMETHOD(call)) {
     95                case IRC_ENABLE_INTERRUPT:
     96                        /* Noop */
     97                        ipc_answer_0(callid, EOK);
     98                        break;
     99                case IRC_CLEAR_INTERRUPT:
    96100                        inr = IPC_GET_ARG1(call);
    97101                        base_virt[OBIO_CIR(inr & INO_MASK)] = 0;
     
    134138       
    135139        async_set_client_connection(obio_connection);
    136         ipcarg_t phonead;
     140        sysarg_t phonead;
    137141        ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead);
    138142       
  • uspace/srv/hw/netif/ne2000/Makefile

    rcead2aa r357b5f5  
    3939-include $(CONFIG_MAKEFILE)
    4040
    41 ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
    42         LIBS += $(USPACE_PREFIX)/srv/net/nil/eth/libeth.a
    43 endif
    44 
    45 BINARY = dp8390
     41BINARY = ne2000
    4642
    4743SOURCES = \
    4844        dp8390.c \
    49         dp8390_module.c \
    5045        ne2000.c
    5146
Note: See TracChangeset for help on using the changeset viewer.