diff options
author | Alan Cox <alan@linux.intel.com> | 2010-05-04 15:40:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 14:36:07 -0400 |
commit | 375d65db27544a183aed5e14aa2ed487c796c78d (patch) | |
tree | eaab9c08efaf8a0da36106bf702f16c6238c59dd /drivers/staging/rar_register/rar_register.h | |
parent | a9d26f00b8b1b2a79e42cfa4ca20ec9a1c11c1d2 (diff) |
Staging: rar and memrar updates
rar: perform a clean up pass
- Move to a registration model where each RAR is claimed/unclaimed
- Use that to fix the client stuff (one client per RAR so no need to queue stuff)
- Support unregister so drivers can rmmod themselves safely
- Fix locking hang on calling rar lock from rar callback
- Clean up
- Kerneldoc
Folded in the memrar update as Greg asked
- Fix various unload related bugs
- Use the per RAR allocator/deallocator
- Add kerneldoc
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rar_register/rar_register.h')
-rw-r--r-- | drivers/staging/rar_register/rar_register.h | 62 |
1 files changed, 11 insertions, 51 deletions
diff --git a/drivers/staging/rar_register/rar_register.h b/drivers/staging/rar_register/rar_register.h index 29ade0f361d..ffa805780f8 100644 --- a/drivers/staging/rar_register/rar_register.h +++ b/drivers/staging/rar_register/rar_register.h | |||
@@ -21,63 +21,23 @@ | |||
21 | #ifndef _RAR_REGISTER_H | 21 | #ifndef _RAR_REGISTER_H |
22 | #define _RAR_REGISTER_H | 22 | #define _RAR_REGISTER_H |
23 | 23 | ||
24 | # include <linux/types.h> | 24 | #include <linux/types.h> |
25 | 25 | ||
26 | /* following are used both in drivers as well as user space apps */ | 26 | /* following are used both in drivers as well as user space apps */ |
27 | enum RAR_type { | ||
28 | RAR_TYPE_VIDEO = 0, | ||
29 | RAR_TYPE_AUDIO, | ||
30 | RAR_TYPE_IMAGE, | ||
31 | RAR_TYPE_DATA | ||
32 | }; | ||
33 | 27 | ||
34 | #ifdef __KERNEL__ | 28 | #define RAR_TYPE_VIDEO 0 |
29 | #define RAR_TYPE_AUDIO 1 | ||
30 | #define RAR_TYPE_IMAGE 2 | ||
31 | #define RAR_TYPE_DATA 3 | ||
35 | 32 | ||
36 | /* PCI device id for controller */ | 33 | #ifdef __KERNEL__ |
37 | #define PCI_RAR_DEVICE_ID 0x4110 | ||
38 | 34 | ||
39 | /* The register_rar function is to used by other device drivers | 35 | struct rar_device; |
40 | * to ensure that this driver is ready. As we cannot be sure of | ||
41 | * the compile/execute order of dirvers in ther kernel, it is | ||
42 | * best to give this driver a callback function to call when | ||
43 | * it is ready to give out addresses. The callback function | ||
44 | * would have those steps that continue the initialization of | ||
45 | * a driver that do require a valid RAR address. One of those | ||
46 | * steps would be to call get_rar_address() | ||
47 | * This function return 0 on success an -1 on failure. | ||
48 | */ | ||
49 | int register_rar(int (*callback)(void *yourparameter), void *yourparameter); | ||
50 | 36 | ||
51 | /* The get_rar_address function is used by other device drivers | 37 | int register_rar(int num, |
52 | * to obtain RAR address information on a RAR. It takes two | 38 | int (*callback)(unsigned long data), unsigned long data); |
53 | * parameter: | 39 | void unregister_rar(int num); |
54 | * | 40 | int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end); |
55 | * int rar_index | ||
56 | * The rar_index is an index to the rar for which you wish to retrieve | ||
57 | * the address information. | ||
58 | * Values can be 0,1, or 2. | ||
59 | * | ||
60 | * struct RAR_address_struct is a pointer to a place to which the function | ||
61 | * can return the address structure for the RAR. | ||
62 | * | ||
63 | * The function returns a 0 upon success or a -1 if there is no RAR | ||
64 | * facility on this system. | ||
65 | */ | ||
66 | int rar_get_address(int rar_index, | ||
67 | dma_addr_t *start_address, | ||
68 | dma_addr_t *end_address); | ||
69 | |||
70 | /* The lock_rar function is ued by other device drivers to lock an RAR. | ||
71 | * once an RAR is locked, it stays locked until the next system reboot. | ||
72 | * The function takes one parameter: | ||
73 | * | ||
74 | * int rar_index | ||
75 | * The rar_index is an index to the rar that you want to lock. | ||
76 | * Values can be 0,1, or 2. | ||
77 | * | ||
78 | * The function returns a 0 upon success or a -1 if there is no RAR | ||
79 | * facility on this system. | ||
80 | */ | ||
81 | int rar_lock(int rar_index); | 41 | int rar_lock(int rar_index); |
82 | 42 | ||
83 | #endif /* __KERNEL__ */ | 43 | #endif /* __KERNEL__ */ |