Changeset 46577995 in mainline for uspace/drv/block/ddisk/ddisk.c
- Timestamp:
- 2018-01-04T20:50:52Z (7 years ago)
- Children:
- e211ea04
- Parents:
- facacc71
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/ddisk/ddisk.c
rfacacc71 r46577995 56 56 #define DDISK_CMD_IRQ_DEASSERT 0x4 57 57 58 static int ddisk_dev_add(ddf_dev_t *);59 static int ddisk_dev_remove(ddf_dev_t *);60 static int ddisk_dev_gone(ddf_dev_t *);61 static int ddisk_fun_online(ddf_fun_t *);62 static int ddisk_fun_offline(ddf_fun_t *);58 static errno_t ddisk_dev_add(ddf_dev_t *); 59 static errno_t ddisk_dev_remove(ddf_dev_t *); 60 static errno_t ddisk_dev_gone(ddf_dev_t *); 61 static errno_t ddisk_fun_online(ddf_fun_t *); 62 static errno_t ddisk_fun_offline(ddf_fun_t *); 63 63 64 64 static void ddisk_bd_connection(ipc_callid_t, ipc_call_t *, void *); … … 117 117 } ddisk_t; 118 118 119 static int ddisk_bd_open(bd_srvs_t *, bd_srv_t *);120 static int ddisk_bd_close(bd_srv_t *);121 static int ddisk_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);122 static int ddisk_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *,119 static errno_t ddisk_bd_open(bd_srvs_t *, bd_srv_t *); 120 static errno_t ddisk_bd_close(bd_srv_t *); 121 static errno_t ddisk_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); 122 static errno_t ddisk_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, 123 123 size_t); 124 static int ddisk_bd_get_block_size(bd_srv_t *, size_t *);125 static int ddisk_bd_get_num_blocks(bd_srv_t *, aoff64_t *);124 static errno_t ddisk_bd_get_block_size(bd_srv_t *, size_t *); 125 static errno_t ddisk_bd_get_num_blocks(bd_srv_t *, aoff64_t *); 126 126 127 127 bd_ops_t ddisk_bd_ops = { … … 188 188 } 189 189 190 int ddisk_bd_open(bd_srvs_t *bds, bd_srv_t *bd)191 { 192 return EOK; 193 } 194 195 int ddisk_bd_close(bd_srv_t *bd)190 errno_t ddisk_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 191 { 192 return EOK; 193 } 194 195 errno_t ddisk_bd_close(bd_srv_t *bd) 196 196 { 197 197 return EOK; … … 199 199 200 200 static 201 int ddisk_rw_block(ddisk_t *ddisk, bool read, aoff64_t ba, void *buf)201 errno_t ddisk_rw_block(ddisk_t *ddisk, bool read, aoff64_t ba, void *buf) 202 202 { 203 203 fibril_mutex_lock(&ddisk->lock); … … 236 236 237 237 static 238 int ddisk_bd_rw_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf,238 errno_t ddisk_bd_rw_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf, 239 239 size_t size, bool is_read) 240 240 { 241 241 ddisk_t *ddisk = (ddisk_t *) bd->srvs->sarg; 242 242 aoff64_t i; 243 int rc;243 errno_t rc; 244 244 245 245 if (size < cnt * DDISK_BLOCK_SIZE) … … 256 256 } 257 257 258 int ddisk_bd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf,258 errno_t ddisk_bd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf, 259 259 size_t size) 260 260 { … … 262 262 } 263 263 264 int ddisk_bd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,264 errno_t ddisk_bd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, 265 265 const void *buf, size_t size) 266 266 { … … 268 268 } 269 269 270 int ddisk_bd_get_block_size(bd_srv_t *bd, size_t *rsize)270 errno_t ddisk_bd_get_block_size(bd_srv_t *bd, size_t *rsize) 271 271 { 272 272 *rsize = DDISK_BLOCK_SIZE; … … 274 274 } 275 275 276 int ddisk_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)276 errno_t ddisk_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb) 277 277 { 278 278 ddisk_t *ddisk = (ddisk_t *) bd->srvs->sarg; … … 282 282 } 283 283 284 static int ddisk_get_res(ddf_dev_t *dev, ddisk_res_t *ddisk_res)284 static errno_t ddisk_get_res(ddf_dev_t *dev, ddisk_res_t *ddisk_res) 285 285 { 286 286 async_sess_t *parent_sess; 287 287 hw_res_list_parsed_t hw_res; 288 int rc;288 errno_t rc; 289 289 290 290 parent_sess = ddf_dev_parent_sess_get(dev); … … 317 317 } 318 318 319 static int ddisk_fun_create(ddisk_t *ddisk)320 { 321 int rc;319 static errno_t ddisk_fun_create(ddisk_t *ddisk) 320 { 321 errno_t rc; 322 322 ddf_fun_t *fun = NULL; 323 323 … … 350 350 } 351 351 352 static int ddisk_fun_remove(ddisk_t *ddisk)353 { 354 int rc;352 static errno_t ddisk_fun_remove(ddisk_t *ddisk) 353 { 354 errno_t rc; 355 355 356 356 if (ddisk->fun == NULL) … … 381 381 } 382 382 383 static int ddisk_fun_unbind(ddisk_t *ddisk)384 { 385 int rc;383 static errno_t ddisk_fun_unbind(ddisk_t *ddisk) 384 { 385 errno_t rc; 386 386 387 387 if (ddisk->fun == NULL) … … 410 410 * @return EOK on success or an error code. 411 411 */ 412 static int ddisk_dev_add(ddf_dev_t *dev)412 static errno_t ddisk_dev_add(ddf_dev_t *dev) 413 413 { 414 414 ddisk_t *ddisk; 415 415 ddisk_res_t res; 416 int rc;416 errno_t rc; 417 417 418 418 /* … … 530 530 531 531 532 static int ddisk_dev_remove_common(ddisk_t *ddisk, bool surprise)533 { 534 int rc;532 static errno_t ddisk_dev_remove_common(ddisk_t *ddisk, bool surprise) 533 { 534 errno_t rc; 535 535 536 536 if (!surprise) … … 558 558 } 559 559 560 static int ddisk_dev_remove(ddf_dev_t *dev)560 static errno_t ddisk_dev_remove(ddf_dev_t *dev) 561 561 { 562 562 ddisk_t *ddisk = (ddisk_t *) ddf_dev_data_get(dev); … … 566 566 } 567 567 568 static int ddisk_dev_gone(ddf_dev_t *dev)568 static errno_t ddisk_dev_gone(ddf_dev_t *dev) 569 569 { 570 570 ddisk_t *ddisk = (ddisk_t *) ddf_dev_data_get(dev); … … 574 574 } 575 575 576 static int ddisk_fun_online(ddf_fun_t *fun)576 static errno_t ddisk_fun_online(ddf_fun_t *fun) 577 577 { 578 578 ddf_msg(LVL_DEBUG, "ddisk_fun_online()"); … … 580 580 } 581 581 582 static int ddisk_fun_offline(ddf_fun_t *fun)582 static errno_t ddisk_fun_offline(ddf_fun_t *fun) 583 583 { 584 584 ddf_msg(LVL_DEBUG, "ddisk_fun_offline()");
Note:
See TracChangeset
for help on using the changeset viewer.