Subversion Repositories HelenOS

Rev

Rev 2637 | Rev 2676 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2637 Rev 2660
Line 200... Line 200...
200
    }
200
    }
201
 
201
 
202
    /*
202
    /*
203
     * Get driver name
203
     * Get driver name
204
     */
204
     */
205
    if (!ipc_data_receive(&callid, NULL, &name_size)) {
205
    if (!ipc_data_write_receive(&callid, NULL, &name_size)) {
206
        printf("Unexpected request.\n");
206
        printf("Unexpected request.\n");
207
        free(driver);
207
        free(driver);
208
        ipc_answer_0(callid, EREFUSED);
208
        ipc_answer_0(callid, EREFUSED);
209
        ipc_answer_0(iid, EREFUSED);
209
        ipc_answer_0(iid, EREFUSED);
210
        return;
210
        return;
Line 231... Line 231...
231
    }  
231
    }  
232
 
232
 
233
    /*
233
    /*
234
     * Send confirmation to sender and get data into buffer.
234
     * Send confirmation to sender and get data into buffer.
235
     */
235
     */
236
    if (EOK != ipc_data_deliver(callid, driver->name, name_size)) {
236
    if (EOK != ipc_data_write_deliver(callid, driver->name, name_size)) {
237
        printf("Cannot read driver name.\n");
237
        printf("Cannot read driver name.\n");
238
        free(driver->name);
238
        free(driver->name);
239
        free(driver);
239
        free(driver);
240
        ipc_answer_0(iid, EREFUSED);
240
        ipc_answer_0(iid, EREFUSED);
241
        return;
241
        return;
Line 366... Line 366...
366
        ipc_answer_0(iid, ENOMEM);
366
        ipc_answer_0(iid, ENOMEM);
367
        return;
367
        return;
368
    }
368
    }
369
   
369
   
370
    /* Get device name */
370
    /* Get device name */
371
    if (!ipc_data_receive(&callid, NULL, &size)) {
371
    if (!ipc_data_write_receive(&callid, NULL, &size)) {
372
        free(device);
372
        free(device);
373
        printf("Cannot read device name.\n");
373
        printf("Cannot read device name.\n");
374
        ipc_answer_0(iid, EREFUSED);
374
        ipc_answer_0(iid, EREFUSED);
375
        return;
375
        return;
376
    }
376
    }
Line 392... Line 392...
392
        ipc_answer_0(callid, ENOMEM);
392
        ipc_answer_0(callid, ENOMEM);
393
        ipc_answer_0(iid, EREFUSED);
393
        ipc_answer_0(iid, EREFUSED);
394
        return;
394
        return;
395
    }
395
    }
396
   
396
   
397
    ipc_data_deliver(callid, device->name, size);
397
    ipc_data_write_deliver(callid, device->name, size);
398
    device->name[size] = 0;
398
    device->name[size] = 0;
399
 
399
 
400
    list_initialize(&(device->devices));
400
    list_initialize(&(device->devices));
401
    list_initialize(&(device->driver_devices));
401
    list_initialize(&(device->driver_devices));
402
 
402
 
Line 487... Line 487...
487
   
487
   
488
    /*
488
    /*
489
     * Wait for incoming message with device name (but do not
489
     * Wait for incoming message with device name (but do not
490
     * read the name itself until the buffer is allocated).
490
     * read the name itself until the buffer is allocated).
491
     */
491
     */
492
    if (!ipc_data_receive(&callid, NULL, &name_size)) {
492
    if (!ipc_data_write_receive(&callid, NULL, &name_size)) {
493
        ipc_answer_0(callid, EREFUSED);
493
        ipc_answer_0(callid, EREFUSED);
494
        ipc_answer_0(iid, EREFUSED);
494
        ipc_answer_0(iid, EREFUSED);
495
        return;
495
        return;
496
    }
496
    }
497
 
497
 
Line 511... Line 511...
511
    }  
511
    }  
512
 
512
 
513
    /*
513
    /*
514
     * Send confirmation to sender and get data into buffer.
514
     * Send confirmation to sender and get data into buffer.
515
     */
515
     */
516
    if (EOK != (retval = ipc_data_deliver(callid, name, name_size))) {
516
    if (EOK != (retval = ipc_data_write_deliver(callid, name, name_size))) {
517
        ipc_answer_0(iid, EREFUSED);
517
        ipc_answer_0(iid, EREFUSED);
518
        return;
518
        return;
519
    }
519
    }
520
 
520
 
521
    /*
521
    /*
Line 564... Line 564...
564
 
564
 
565
/*  FIXME:
565
/*  FIXME:
566
    we have no channel from DEVMAP to client ->
566
    we have no channel from DEVMAP to client ->
567
    sending must be initiated by client
567
    sending must be initiated by client
568
 
568
 
569
    int rc = ipc_data_send(phone, device->name, name_size);
569
    int rc = ipc_data_write_send(phone, device->name, name_size);
570
    if (rc != EOK) {
570
    if (rc != EOK) {
571
        async_wait_for(req, NULL);
571
        async_wait_for(req, NULL);
572
        return rc;
572
        return rc;
573
    }
573
    }
574
*/ 
574
*/