Changeset a46e56b in mainline for uspace/lib/drv/generic/remote_ahci.c
- Timestamp:
- 2018-03-22T06:49:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_ahci.c
r3e242d2 ra46e56b 210 210 211 211 void remote_ahci_get_sata_device_name(ddf_fun_t *fun, void *iface, 212 cap_call_handle_t c allid, ipc_call_t *call)212 cap_call_handle_t chandle, ipc_call_t *call) 213 213 { 214 214 const ahci_iface_t *ahci_iface = (ahci_iface_t *) iface; 215 215 216 216 if (ahci_iface->get_sata_device_name == NULL) { 217 async_answer_0(c allid, ENOTSUP);217 async_answer_0(chandle, ENOTSUP); 218 218 return; 219 219 } … … 224 224 char* sata_dev_name = malloc(sata_dev_name_length); 225 225 if (sata_dev_name == NULL) { 226 async_answer_0(c allid, ENOMEM);226 async_answer_0(chandle, ENOMEM); 227 227 return; 228 228 } … … 232 232 233 233 size_t real_size; 234 cap_call_handle_t c id;235 if ((async_data_read_receive(&c id, &real_size)) &&234 cap_call_handle_t call_handle; 235 if ((async_data_read_receive(&call_handle, &real_size)) && 236 236 (real_size == sata_dev_name_length)) 237 async_data_read_finalize(cid, sata_dev_name, sata_dev_name_length); 237 async_data_read_finalize(call_handle, sata_dev_name, 238 sata_dev_name_length); 238 239 239 240 free(sata_dev_name); 240 async_answer_0(c allid, ret);241 async_answer_0(chandle, ret); 241 242 } 242 243 243 244 static void remote_ahci_get_num_blocks(ddf_fun_t *fun, void *iface, 244 cap_call_handle_t c allid, ipc_call_t *call)245 cap_call_handle_t chandle, ipc_call_t *call) 245 246 { 246 247 const ahci_iface_t *ahci_iface = (ahci_iface_t *) iface; 247 248 248 249 if (ahci_iface->get_num_blocks == NULL) { 249 async_answer_0(c allid, ENOTSUP);250 async_answer_0(chandle, ENOTSUP); 250 251 return; 251 252 } … … 255 256 256 257 if (ret != EOK) 257 async_answer_0(c allid, ret);258 async_answer_0(chandle, ret); 258 259 else 259 async_answer_2(c allid, EOK, HI(blocks), LO(blocks));260 async_answer_2(chandle, EOK, HI(blocks), LO(blocks)); 260 261 } 261 262 262 263 static void remote_ahci_get_block_size(ddf_fun_t *fun, void *iface, 263 cap_call_handle_t c allid, ipc_call_t *call)264 cap_call_handle_t chandle, ipc_call_t *call) 264 265 { 265 266 const ahci_iface_t *ahci_iface = (ahci_iface_t *) iface; 266 267 267 268 if (ahci_iface->get_block_size == NULL) { 268 async_answer_0(c allid, ENOTSUP);269 async_answer_0(chandle, ENOTSUP); 269 270 return; 270 271 } … … 274 275 275 276 if (ret != EOK) 276 async_answer_0(c allid, ret);277 async_answer_0(chandle, ret); 277 278 else 278 async_answer_1(c allid, EOK, blocks);279 async_answer_1(chandle, EOK, blocks); 279 280 } 280 281 281 282 void remote_ahci_read_blocks(ddf_fun_t *fun, void *iface, 282 cap_call_handle_t c allid, ipc_call_t *call)283 cap_call_handle_t chandle, ipc_call_t *call) 283 284 { 284 285 const ahci_iface_t *ahci_iface = (ahci_iface_t *) iface; 285 286 286 287 if (ahci_iface->read_blocks == NULL) { 287 async_answer_0(c allid, ENOTSUP);288 async_answer_0(chandle, ENOTSUP); 288 289 return; 289 290 } … … 292 293 unsigned int flags; 293 294 294 cap_call_handle_t c id;295 async_share_out_receive(&c id, &maxblock_size, &flags);295 cap_call_handle_t call_handle; 296 async_share_out_receive(&call_handle, &maxblock_size, &flags); 296 297 297 298 void *buf; 298 async_share_out_finalize(c id, &buf);299 async_share_out_finalize(call_handle, &buf); 299 300 300 301 const uint64_t blocknum = … … 305 306 const errno_t ret = ahci_iface->read_blocks(fun, blocknum, cnt, buf); 306 307 307 async_answer_0(c allid, ret);308 } 309 310 void remote_ahci_write_blocks(ddf_fun_t *fun, void *iface, cap_call_handle_t c allid,308 async_answer_0(chandle, ret); 309 } 310 311 void remote_ahci_write_blocks(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, 311 312 ipc_call_t *call) 312 313 { … … 314 315 315 316 if (ahci_iface->read_blocks == NULL) { 316 async_answer_0(c allid, ENOTSUP);317 async_answer_0(chandle, ENOTSUP); 317 318 return; 318 319 } … … 321 322 unsigned int flags; 322 323 323 cap_call_handle_t c id;324 async_share_out_receive(&c id, &maxblock_size, &flags);324 cap_call_handle_t call_handle; 325 async_share_out_receive(&call_handle, &maxblock_size, &flags); 325 326 326 327 void *buf; 327 async_share_out_finalize(c id, &buf);328 async_share_out_finalize(call_handle, &buf); 328 329 329 330 const uint64_t blocknum = … … 334 335 const errno_t ret = ahci_iface->write_blocks(fun, blocknum, cnt, buf); 335 336 336 async_answer_0(c allid, ret);337 async_answer_0(chandle, ret); 337 338 } 338 339
Note:
See TracChangeset
for help on using the changeset viewer.