Changes between Version 21 and Version 22 of DeviceDrivers
- Timestamp:
- 2011-11-16T13:14:58Z (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeviceDrivers
v21 v22 167 167 }}} 168 168 169 Create 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 171 The 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 169 173 ==== ddf_fun_destroy ==== 170 174 … … 173 177 }}} 174 178 179 Destroy 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 175 181 ==== ddf_fun_add_match_id ==== 176 182 … … 191 197 }}} 192 198 199 Bind 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 193 201 ==== ddf_fun_unbind ==== 194 202 … … 196 204 int ddf_fun_unbind(ddf_fun_t *fun) 197 205 }}} 206 207 Unbind 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. 198 208 199 209 ==== ddf_fun_online ====