Changes between Version 2 and Version 3 of NewDriverClass
- Timestamp:
- Oct 8, 2009, 6:50:30 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewDriverClass
v2 v3 29 29 = Adding a header describing the class = 30 30 31 Create a file in `driver /include/device/foobar.h`. It may contain31 Create a file in `drivers/include/device/foobar.h`. It may contain 32 32 33 33 * Callback definitions, … … 35 35 * Global utility functions. 36 36 37 See [source:trunk/mutekh/driver /include/device/char.h] for sample file.37 See [source:trunk/mutekh/drivers/include/device/char.h] for sample file. 38 38 39 39 The `struct dev_class_foobar_s` is a structure holding all the class-specific request functions. 40 40 You may ensure this structure holds less pointers than the `DRV_MAX_FUNC_COUNT` 41 constant defined in [source:trunk/mutekh/driver /include/device/driver.h].41 constant defined in [source:trunk/mutekh/drivers/include/device/driver.h]. 42 42 43 43 Don't forget to protect the new header against circular inclusions with the lines: … … 52 52 = Adding a reference to the class in the driver structure = 53 53 54 Edit [source:trunk/mutekh/driver /include/device/driver.h] and add an entry in the `f` union of the `struct driver_s`.54 Edit [source:trunk/mutekh/drivers/include/device/driver.h] and add an entry in the `f` union of the `struct driver_s`. 55 55 56 56 You must protect it with the macros defined in the header of the class, in case the class is not included in legacy code.