Changes between Version 22 and Version 23 of DeviceDrivers
- Timestamp:
- 2011-11-16T15:56:54Z (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeviceDrivers
v22 v23 226 226 227 227 The soft-state management functions are: 228 * void *ddf_dev_data_alloc(ddf_dev_t *dev, size_t size) - allocate driver-specific device data 229 * void *ddf_fun_data_alloc(ddf_fun_t *fun, size_t size) - allocate driver-specific function data 230 228 * ddf_dev_data_alloc() - allocate driver-specific device data 229 * ddf_fun_data_alloc() - allocate driver-specific function data 230 231 {{{ 232 void *ddf_dev_data_alloc(ddf_dev_t *dev, size_t size) 233 }}} 231 234 The function ''ddf_dev_data_alloc'' allocates a driver-specific data strutcure ''size'' bytes large, associated with the device ''dev''. The structure will not be deallocated by the framework until the ''dev_remove'' or ''dev_gone'' entry point returns '''and''' control exits all driver entry points that are invoked with ''dev'' as a parameter. (Internally, this is achieved using reference counting). 232 235 236 {{{ 237 void *ddf_fun_data_alloc(ddf_fun_t *fun, size_t size) 238 }}} 233 239 The function ''ddf_fun_data_alloc'' allocates a driver-specific data structure ''size'' bytes large, associated with the function ''fun''. The structure will not be deallocated by the framework until ''ddf_fun_destroy()'' is called '''and''' control exits all driver entry points that are invoked with ''fun'' as parameter. 'ddf_dev_data_alloc'' is normally called from within the ''dev_add'' emtry point. 234 240