Changeset ea186c6 in mainline for uspace/lib/c/generic/loc.c
- Timestamp:
- 2011-08-18T20:27:26Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 921b84f
- Parents:
- 1f44b056 (diff), ef7052ec (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/lib/c/generic/loc.c
r1f44b056 rea186c6 267 267 } 268 268 269 /** Register new device.270 * 271 * The @p interface is used when forwarding connection to the driver.269 /** Register new service. 270 * 271 * The @p interface is used when forwarding connection to the server. 272 272 * If not 0, the first argument is the interface and the second argument 273 273 * is the service ID. … … 276 276 * the handle (to ensure backward compatibility). 277 277 * 278 * @param fq dn Fully qualified device name.279 * @param[out] handle Handle to the created instance of device.280 * @param interface Interface when forwarding .281 * 282 */ 283 int loc_service_register_with_iface(const char *fq dn,284 service_id_t * handle, sysarg_t interface)278 * @param fqsn Fully qualified service name 279 * @param[out] sid Service ID of new service 280 * @param interface Interface when forwarding 281 * 282 */ 283 int loc_service_register_with_iface(const char *fqsn, 284 service_id_t *sid, sysarg_t interface) 285 285 { 286 286 async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER); … … 289 289 aid_t req = async_send_2(exch, LOC_SERVICE_REGISTER, interface, 0, 290 290 &answer); 291 sysarg_t retval = async_data_write_start(exch, fq dn, str_size(fqdn));291 sysarg_t retval = async_data_write_start(exch, fqsn, str_size(fqsn)); 292 292 293 293 loc_exchange_end(exch); … … 301 301 302 302 if (retval != EOK) { 303 if ( handle!= NULL)304 * handle= -1;305 306 return retval; 307 } 308 309 if ( handle!= NULL)310 * handle= (service_id_t) IPC_GET_ARG1(answer);303 if (sid != NULL) 304 *sid = -1; 305 306 return retval; 307 } 308 309 if (sid != NULL) 310 *sid = (service_id_t) IPC_GET_ARG1(answer); 311 311 312 312 return retval; 313 313 } 314 314 315 /** Register new device. 316 * 317 * @param fqdn Fully qualified device name. 318 * @param handle Output: Handle to the created instance of device. 319 * 320 */ 321 int loc_service_register(const char *fqdn, service_id_t *handle) 322 { 323 return loc_service_register_with_iface(fqdn, handle, 0); 315 /** Register new service. 316 * 317 * @param fqsn Fully qualified service name 318 * @param sid Output: ID of new service 319 * 320 */ 321 int loc_service_register(const char *fqdn, service_id_t *sid) 322 { 323 return loc_service_register_with_iface(fqdn, sid, 0); 324 } 325 326 /** Unregister service. 327 * 328 * @param sid Service ID 329 */ 330 int loc_service_unregister(service_id_t sid) 331 { 332 async_exch_t *exch; 333 sysarg_t retval; 334 335 exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER); 336 retval = async_req_1_0(exch, LOC_SERVICE_UNREGISTER, sid); 337 loc_exchange_end(exch); 338 339 return (int)retval; 324 340 } 325 341
Note:
See TracChangeset
for help on using the changeset viewer.