Changes between Version 21 and Version 22 of DeviceDrivers


Ignore:
Timestamp:
2011-11-16T13:14:58Z (12 years ago)
Author:
Jiri Svoboda
Comment:

Describe some calls for function management

Legend:

Unmodified
Added
Removed
Modified
  • DeviceDrivers

    v21 v22  
    167167}}}
    168168
     169Create a new function of the device ''dev''. ''ftype'' is either ''fun_inner'' or ''fun_exposed''. Exposed functions are exported via the Location service to clients, while inner functions are used as points for attaching child devices. ''name'' identifies the function relative to ''dev'' (it can be e.g. its address on the bus).
     170
     171The function will not be visible to the system until it is bound. ''ddf_fun_create'' will only fail if there is not enough memory. If ''ddf_fun_create'' fails, it will return NULL.
     172
    169173==== ddf_fun_destroy ====
    170174
     
    173177}}}
    174178
     179Destroy function ''fun''. ''fun'' must not be bound. An unbound function is not visible to the system. The only effect of this function is that it frees any memory/resources that the driver internally allocated for the function.
     180
    175181==== ddf_fun_add_match_id ====
    176182
     
    191197}}}
    192198
     199Bind function ''fun'' to the system. This effectively makes ''fun'' visible to the system. Between creating and binding a function the caller has a chance to set any properties on the function that should be already set when the function becomes visible to the system. ''ddf_fun_bind'' returns EOK on success, negative error code on error. Specifically this function fails if a (bound) function with conflicting name already exists in the system. If ''ddf_fun_bind'' fails, ''fun'' is unchanged (specifically, it is ''not'' destroyed automatically).
     200
    193201==== ddf_fun_unbind ====
    194202
     
    196204int ddf_fun_unbind(ddf_fun_t *fun)
    197205}}}
     206
     207Unbind function ''fun'' from the system. Makes the function ''fun'' unavailable to the system. Calling ''ddf_fun_unbind'' on an online function is interpreted as surprise removal. Calling ''ddf_fun_unbind'' on an offline function is interpreted as anticipated removal. ''ddf_fun_unbind'' returns EOK on success, negative error code on failure. ''ddf_fun_unbind'' can fail if a child driver ''dev_remove'' or ''dev_gone'' entry point fails.
    198208
    199209==== ddf_fun_online ====