···11-/* === RAR Physical Addresses === */22-struct RAR_address_struct {33- u32 low;44- u32 high;11+/*22+ * Copyright (C) 2010 Intel Corporation. All rights reserved.33+ *44+ * This program is free software; you can redistribute it and/or55+ * modify it under the terms of version 2 of the GNU General66+ * Public License as published by the Free Software Foundation.77+ *88+ * This program is distributed in the hope that it will be99+ * useful, but WITHOUT ANY WARRANTY; without even the implied1010+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR1111+ * PURPOSE. See the GNU General Public License for more details.1212+ * You should have received a copy of the GNU General Public1313+ * License along with this program; if not, write to the Free1414+ * Software Foundation, Inc., 59 Temple Place - Suite 330,1515+ * Boston, MA 02111-1307, USA.1616+ * The full GNU General Public License is included in this1717+ * distribution in the file called COPYING.1818+ */1919+2020+2121+#ifndef _RAR_REGISTER_H2222+#define _RAR_REGISTER_H2323+2424+# include <linux/types.h>2525+2626+/* following are used both in drivers as well as user space apps */2727+enum RAR_type {2828+ RAR_TYPE_VIDEO = 0,2929+ RAR_TYPE_AUDIO,3030+ RAR_TYPE_IMAGE,3131+ RAR_TYPE_DATA532};3333+3434+#ifdef __KERNEL__3535+3636+/* PCI device id for controller */3737+#define PCI_RAR_DEVICE_ID 0x41103838+3939+/* The register_rar function is to used by other device drivers4040+ * to ensure that this driver is ready. As we cannot be sure of4141+ * the compile/execute order of dirvers in ther kernel, it is4242+ * best to give this driver a callback function to call when4343+ * it is ready to give out addresses. The callback function4444+ * would have those steps that continue the initialization of4545+ * a driver that do require a valid RAR address. One of those4646+ * steps would be to call get_rar_address()4747+ * This function return 0 on success an -1 on failure.4848+ */4949+int register_rar(int (*callback)(void *yourparameter), void *yourparameter);650751/* The get_rar_address function is used by other device drivers852 * to obtain RAR address information on a RAR. It takes two···6319 * The function returns a 0 upon success or a -1 if there is no RAR6420 * facility on this system.6521 */6666-int get_rar_address(int rar_index, struct RAR_address_struct *addresses);2222+int rar_get_address(int rar_index,2323+ dma_addr_t *start_address,2424+ dma_addr_t *end_address);67256868-6969-/* The lock_rar function is used by other device drivers to lock an RAR.2626+/* The lock_rar function is ued by other device drivers to lock an RAR.7027 * once an RAR is locked, it stays locked until the next system reboot.7128 * The function takes one parameter:7229 *···7833 * The function returns a 0 upon success or a -1 if there is no RAR7934 * facility on this system.8035 */8181-int lock_rar(int rar_index);3636+int rar_lock(int rar_index);82378383-8484-/* DEBUG LEVEL MASKS */8585-#define RAR_DEBUG_LEVEL_BASIC 0x18686-8787-#define RAR_DEBUG_LEVEL_REGISTERS 0x28888-8989-#define RAR_DEBUG_LEVEL_EXTENDED 0x49090-9191-#define DEBUG_LEVEL 0x79292-9393-/* FUNCTIONAL MACROS */9494-9595-/* debug macro without paramaters */9696-#define DEBUG_PRINT_0(DEBUG_LEVEL , info) \9797-do { \9898- if (DEBUG_LEVEL) { \9999- printk(KERN_WARNING info); \100100- } \101101-} while (0)102102-103103-/* debug macro with 1 paramater */104104-#define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \105105-do { \106106- if (DEBUG_LEVEL) { \107107- printk(KERN_WARNING info , param1); \108108- } \109109-} while (0)110110-111111-/* debug macro with 2 paramaters */112112-#define DEBUG_PRINT_2(DEBUG_LEVEL , info , param1, param2) \113113-do { \114114- if (DEBUG_LEVEL) { \115115- printk(KERN_WARNING info , param1, param2); \116116- } \117117-} while (0)118118-119119-/* debug macro with 3 paramaters */120120-#define DEBUG_PRINT_3(DEBUG_LEVEL , info , param1, param2 , param3) \121121-do { \122122- if (DEBUG_LEVEL) { \123123- printk(KERN_WARNING info , param1, param2 , param3); \124124- } \125125-} while (0)126126-127127-/* debug macro with 4 paramaters */128128-#define DEBUG_PRINT_4(DEBUG_LEVEL , info , param1, param2 , param3 , param4) \129129-do { \130130- if (DEBUG_LEVEL) { \131131- printk(KERN_WARNING info , param1, param2 , param3 , param4); \132132- } \133133-} while (0)134134-3838+#endif /* __KERNEL__ */3939+#endif /* _RAR_REGISTER_H */