Changeset 8ff0bd2 in mainline for uspace/srv/hw/bus/cuda_adb/cuda_adb.c
- Timestamp:
- 2011-09-04T11:30:58Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03bc76a
- Parents:
- d2c67e7 (diff), deac215e (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/cuda_adb/cuda_adb.c
rd2c67e7 r8ff0bd2 43 43 #include <ddi.h> 44 44 #include <libarch/ddi.h> 45 #include < devmap.h>45 #include <loc.h> 46 46 #include <sysinfo.h> 47 47 #include <errno.h> … … 53 53 54 54 // FIXME: remove this header 55 #include < kernel/ipc/ipc_methods.h>55 #include <abi/ipc/methods.h> 56 56 57 57 #define NAME "cuda_adb" 58 58 59 static void cuda_connection(ipc_callid_t iid, ipc_call_t *icall );59 static void cuda_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg); 60 60 static int cuda_init(void); 61 61 static void cuda_irq_handler(ipc_callid_t iid, ipc_call_t *call); … … 147 147 int main(int argc, char *argv[]) 148 148 { 149 devmap_handle_t devmap_handle;149 service_id_t service_id; 150 150 int rc; 151 151 int i; … … 155 155 for (i = 0; i < ADB_MAX_ADDR; ++i) { 156 156 adb_dev[i].client_phone = -1; 157 adb_dev[i]. devmap_handle= 0;158 } 159 160 rc = devmap_driver_register(NAME, cuda_connection);157 adb_dev[i].service_id = 0; 158 } 159 160 rc = loc_server_register(NAME, cuda_connection); 161 161 if (rc < 0) { 162 printf(NAME ": Unable to register driver.\n");162 printf(NAME ": Unable to register server.\n"); 163 163 return rc; 164 164 } 165 165 166 rc = devmap_device_register("adb/kbd", &devmap_handle);166 rc = loc_service_register("adb/kbd", &service_id); 167 167 if (rc != EOK) { 168 printf(NAME ": Unable to register device %s.\n", "adb/kdb");168 printf(NAME ": Unable to register service %s.\n", "adb/kdb"); 169 169 return rc; 170 170 } 171 171 172 adb_dev[2]. devmap_handle = devmap_handle;173 adb_dev[8]. devmap_handle = devmap_handle;174 175 rc = devmap_device_register("adb/mouse", &devmap_handle);172 adb_dev[2].service_id = service_id; 173 adb_dev[8].service_id = service_id; 174 175 rc = loc_service_register("adb/mouse", &service_id); 176 176 if (rc != EOK) { 177 printf(NAME ": Unable to register device %s.\n", "adb/mouse");177 printf(NAME ": Unable to register servise %s.\n", "adb/mouse"); 178 178 return rc; 179 179 } 180 180 181 adb_dev[9]. devmap_handle = devmap_handle;181 adb_dev[9].service_id = service_id; 182 182 183 183 if (cuda_init() < 0) { … … 193 193 194 194 /** Character device connection handler */ 195 static void cuda_connection(ipc_callid_t iid, ipc_call_t *icall )195 static void cuda_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 196 196 { 197 197 ipc_callid_t callid; 198 198 ipc_call_t call; 199 199 sysarg_t method; 200 devmap_handle_t dh;200 service_id_t dsid; 201 201 int retval; 202 202 int dev_addr, i; 203 203 204 204 /* Get the device handle. */ 205 d h= IPC_GET_ARG1(*icall);205 dsid = IPC_GET_ARG1(*icall); 206 206 207 207 /* Determine which disk device is the client connecting to. */ 208 208 dev_addr = -1; 209 209 for (i = 0; i < ADB_MAX_ADDR; i++) { 210 if (adb_dev[i]. devmap_handle == dh)210 if (adb_dev[i].service_id == dsid) 211 211 dev_addr = i; 212 212 } … … 242 242 */ 243 243 for (i = 0; i < ADB_MAX_ADDR; ++i) { 244 if (adb_dev[i]. devmap_handle == dh) {244 if (adb_dev[i].service_id == dsid) { 245 245 adb_dev[i].client_phone = IPC_GET_ARG5(call); 246 246 }
Note:
See TracChangeset
for help on using the changeset viewer.