Commit 375d65db authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

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: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a9d26f00
This diff is collapsed.
This diff is collapsed.
......@@ -21,63 +21,23 @@
#ifndef _RAR_REGISTER_H
#define _RAR_REGISTER_H
# include <linux/types.h>
#include <linux/types.h>
/* following are used both in drivers as well as user space apps */
enum RAR_type {
RAR_TYPE_VIDEO = 0,
RAR_TYPE_AUDIO,
RAR_TYPE_IMAGE,
RAR_TYPE_DATA
};
#ifdef __KERNEL__
#define RAR_TYPE_VIDEO 0
#define RAR_TYPE_AUDIO 1
#define RAR_TYPE_IMAGE 2
#define RAR_TYPE_DATA 3
/* PCI device id for controller */
#define PCI_RAR_DEVICE_ID 0x4110
#ifdef __KERNEL__
/* The register_rar function is to used by other device drivers
* to ensure that this driver is ready. As we cannot be sure of
* the compile/execute order of dirvers in ther kernel, it is
* best to give this driver a callback function to call when
* it is ready to give out addresses. The callback function
* would have those steps that continue the initialization of
* a driver that do require a valid RAR address. One of those
* steps would be to call get_rar_address()
* This function return 0 on success an -1 on failure.
*/
int register_rar(int (*callback)(void *yourparameter), void *yourparameter);
struct rar_device;
/* The get_rar_address function is used by other device drivers
* to obtain RAR address information on a RAR. It takes two
* parameter:
*
* int rar_index
* The rar_index is an index to the rar for which you wish to retrieve
* the address information.
* Values can be 0,1, or 2.
*
* struct RAR_address_struct is a pointer to a place to which the function
* can return the address structure for the RAR.
*
* The function returns a 0 upon success or a -1 if there is no RAR
* facility on this system.
*/
int rar_get_address(int rar_index,
dma_addr_t *start_address,
dma_addr_t *end_address);
/* The lock_rar function is ued by other device drivers to lock an RAR.
* once an RAR is locked, it stays locked until the next system reboot.
* The function takes one parameter:
*
* int rar_index
* The rar_index is an index to the rar that you want to lock.
* Values can be 0,1, or 2.
*
* The function returns a 0 upon success or a -1 if there is no RAR
* facility on this system.
*/
int register_rar(int num,
int (*callback)(unsigned long data), unsigned long data);
void unregister_rar(int num);
int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end);
int rar_lock(int rar_index);
#endif /* __KERNEL__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment