Changes in uspace/srv/bd/gxe_bd/gxe_bd.c [47b7006:15f3c3f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/gxe_bd/gxe_bd.c
r47b7006 r15f3c3f 43 43 #include <as.h> 44 44 #include <fibril_synch.h> 45 #include < devmap.h>45 #include <loc.h> 46 46 #include <sys/types.h> 47 47 #include <errno.h> … … 92 92 static gxe_bd_t *dev; 93 93 94 static devmap_handle_t devmap_handle[MAX_DISKS];94 static service_id_t service_id[MAX_DISKS]; 95 95 96 96 static fibril_mutex_t dev_lock[MAX_DISKS]; 97 97 98 98 static int gxe_bd_init(void); 99 static void gxe_bd_connection(ipc_callid_t iid, ipc_call_t *icall );99 static void gxe_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *); 100 100 static int gxe_bd_read_blocks(int disk_id, uint64_t ba, unsigned cnt, 101 101 void *buf); … … 126 126 char name[16]; 127 127 128 rc = devmap_driver_register(NAME, gxe_bd_connection);128 rc = loc_server_register(NAME, gxe_bd_connection); 129 129 if (rc < 0) { 130 130 printf(NAME ": Unable to register driver.\n"); … … 142 142 for (i = 0; i < MAX_DISKS; i++) { 143 143 snprintf(name, 16, "%s/disk%d", NAMESPACE, i); 144 rc = devmap_device_register(name, &devmap_handle[i]);144 rc = loc_service_register(name, &service_id[i]); 145 145 if (rc != EOK) { 146 146 printf(NAME ": Unable to register device %s.\n", name); … … 153 153 } 154 154 155 static void gxe_bd_connection(ipc_callid_t iid, ipc_call_t *icall )155 static void gxe_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 156 156 { 157 157 void *fs_va = NULL; … … 159 159 ipc_call_t call; 160 160 sysarg_t method; 161 devmap_handle_t dh;161 service_id_t dsid; 162 162 unsigned int flags; 163 163 int retval; … … 167 167 168 168 /* Get the device handle. */ 169 d h= IPC_GET_ARG1(*icall);169 dsid = IPC_GET_ARG1(*icall); 170 170 171 171 /* Determine which disk device is the client connecting to. */ 172 172 disk_id = -1; 173 173 for (i = 0; i < MAX_DISKS; i++) 174 if ( devmap_handle[i] == dh)174 if (service_id[i] == dsid) 175 175 disk_id = i; 176 176 … … 201 201 (void) async_share_out_finalize(callid, fs_va); 202 202 203 while ( 1) {203 while (true) { 204 204 callid = async_get_call(&call); 205 205 method = IPC_GET_IMETHOD(call); 206 switch (method) {207 case IPC_M_PHONE_HUNGUP:206 207 if (!method) { 208 208 /* The other side has hung up. */ 209 209 async_answer_0(callid, EOK); 210 210 return; 211 } 212 213 switch (method) { 211 214 case BD_READ_BLOCKS: 212 215 ba = MERGE_LOUP32(IPC_GET_ARG1(call),
Note:
See TracChangeset
for help on using the changeset viewer.