summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c814a83)
raw | patch | inline | side by side (parent: c814a83)
author | Sandeep Nair <a0875039@ares-ubuntu> | |
Thu, 15 Mar 2012 15:33:36 +0000 (11:33 -0400) | ||
committer | Sandeep Nair <a0875039@ares-ubuntu> | |
Thu, 15 Mar 2012 15:33:36 +0000 (11:33 -0400) |
ti/runtime/netapi/tools/module/Makefile | [changed mode: 0755->0644] | patch | blob | history |
ti/runtime/netapi/tools/module/netapimod.c | [changed mode: 0755->0644] | patch | blob | history |
ti/runtime/netapi/tools/module/netapimod.h | [new file with mode: 0644] | patch | blob |
-#\r
-# File Name: Makefile\r
-#\r
-# Description: Makefile to build kernel netapi utility module.\r
-#\r
-# Copyright (C) 2011 Texas Instruments, Incorporated\r
-#\r
-# This program is free software; you can redistribute it and/or modify it\r
-# under the terms of the GNU General Public License as published by the\r
-# Free Software Foundation version 2.\r
-#\r
-# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,\r
-# whether express or implied; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-# General Public License for more details.\r
-#\r
-\r
-obj-m += netapimod.o\r
-\r
-all:\r
- make -C ../linux-appleton -I../linux-appleton/include M=`pwd` modules\r
+#
+# File Name: Makefile
+#
+# Description: Makefile to build kernel netapi utility module.
+#
+# Copyright (C) 2012 Texas Instruments, Incorporated
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation version 2.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+# whether express or implied; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+
+KDIR ?= ../linux-appleton
+
+obj-m += netapimod.o
+
+default all:
+ make -C $(KDIR) M=$$PWD modules
+
+clean:
+ make -C $(KDIR) M=$$PWD clean
+
diff --git a/ti/runtime/netapi/tools/module/netapimod.c b/ti/runtime/netapi/tools/module/netapimod.c
-/*\r
- * File name: netapi_mod.c\r
- *\r
- * Description: NETAPI utility module.\r
- *\r
- * Copyright (C) 2011 Texas Instruments, Incorporated\r
- * \r
- * This program is free software; you can redistribute it and/or modify it\r
- * under the terms of the GNU General Public License as published by the\r
- * Free Software Foundation version 2.\r
- *\r
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,\r
- * whether express or implied; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * General Public License for more details.\r
- */\r
-\r
-#include <linux/init.h>\r
-#include <linux/module.h>\r
-#include <linux/kernel.h>\r
-#include <linux/proc_fs.h>\r
-\r
-#include <linux/version.h>\r
-#include <linux/unistd.h>\r
-#include <asm/unistd.h>\r
-#include <linux/wait.h>\r
-#include <linux/sched.h>\r
-#include <linux/timer.h>\r
-#include <linux/string.h>\r
-#include <linux/if.h>\r
-\r
-#include <asm/irq.h>\r
-#include <linux/clk.h>\r
-\r
-#include <asm/mach/map.h>\r
-\r
-#include <mach/vmalloc.h>\r
-#include <mach/common.h>\r
-#include <mach/time.h>\r
-#include <mach/cputype.h>\r
-#include <mach/psc.h>\r
-#include <mach/cp_intc.h>\r
-#include <mach/irqs.h>\r
-#include <mach/gpio.h>\r
-#include <mach/hardware.h>\r
-#include <mach/cp_intd.h>\r
-#include <mach/tci6614.h>\r
-\r
-\r
-\r
-#define NETAPIMOD_DEBUG \r
-\r
-#ifdef NETAPIMOD_DEBUG\r
-# define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)\r
-#else\r
-# define DPRINTK(fmt, args...)\r
-#endif\r
-\r
-\r
-\r
-//extern long davinci_ck_get_arm_rate(void);\r
-static void MPU_Enable_userModeAccess(void)\r
-{\r
- unsigned int reg_addr,i,count,defRegVal;\r
- void __iomem * temp_reg;\r
- defRegVal = 0x3FFFFFF;\r
- reg_addr = 0x2368208;\r
- count = 5; \r
- \r
- for(i=1;i<=count;i++)\r
- {\r
- temp_reg= ioremap(reg_addr, 4);\r
- __raw_writel(defRegVal, temp_reg) ;\r
- iounmap(temp_reg);\r
- //*((unsigned int*)(reg_addr)) = defRegVal;\r
- reg_addr = reg_addr + 0x10;\r
- }\r
- \r
- reg_addr = 0x2370208;\r
- count = 16; \r
- \r
- for(i=1;i<=count;i++)\r
- {\r
- temp_reg= ioremap(reg_addr, 4);\r
- __raw_writel(defRegVal,temp_reg) ;\r
- iounmap(temp_reg);\r
- // *((unsigned int*)(reg_addr)) = defRegVal;\r
- reg_addr = reg_addr + 0x10;\r
- }\r
- \r
- \r
- reg_addr = 0x2378208;\r
- count = 1; \r
- \r
- for(i=1;i<=count;i++)\r
- {\r
- temp_reg= ioremap(reg_addr, 4);\r
- __raw_writel(defRegVal, temp_reg) ;\r
- iounmap(temp_reg);\r
-\r
-// *((unsigned int*)(reg_addr)) = defRegVal;\r
- reg_addr = reg_addr + 0x10;\r
- }\r
-}\r
-\r
-/*********************************************************************************\r
-* FUNCTION: netapi_init_proc\r
-*\r
-**********************************************************************************\r
-*\r
-* DESCRIPTION: Forms output for /proc/netapi file\r
-*********************************************************************************/\r
-static int netapi_init_proc(char *buf, char **start, off_t offset,\r
- int count, int *eof, void *data)\r
-{\r
- unsigned long val;\r
- int len=0;\r
- struct clk *clk = clk_get((struct device *) NULL,"main_div_chip_clk1"); \r
- \r
- //enable user access to qmss h/w\r
- MPU_Enable_userModeAccess(); \r
-\r
- //pmcr <- single clock, reset, enable\r
- val = 0x4|0x1;\r
- asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val));\r
-\r
- //userenr <- enable user space access [this won't work from user space obviously!]\r
- val = 1;\r
- asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r"(val));\r
-\r
- //start things \r
- val = 0x80000000;\r
- asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(val));\r
-\r
- len += sprintf(buf + len, "netapi proc entry\n");\r
- len += sprintf(buf + len, "===========================\n");\r
- len += sprintf(buf + len, "enabled PMU for user space\n");\r
- asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(val));\r
- len += sprintf(buf + len,"current ccnt = %d\n", val);\r
- len += sprintf(buf + len,"arm cpu freq = %d \n", clk? (int) clk_get_rate(clk): -1);\r
- //len += sprintf(buf + len,"arm cpu freq = %d %d\n", davinci_ck_get_arm_rate(),clk? (int) clk_get_rate(clk): -1);\r
- *eof = 1;\r
- \r
- return len;\r
-}\r
-\r
-\r
-/*********************************************************************************\r
-* FUNCTION: netapi_stats_proc\r
-*\r
-**********************************************************************************\r
-*\r
-* DESCRIPTION: Forms output for /proc/netapi_stats file\r
-*********************************************************************************/\r
-static int netapi_stats_proc(char *buf, char **start, off_t offset,\r
- int count, int *eof, void *data)\r
-{\r
- \r
- int len = 0;\r
- len += sprintf(buf + len, "NETAPI Stats:\n");\r
- len += sprintf(buf + len, "=============================================\n");\r
- len += sprintf(buf + len, "...coming...\n");\r
- *eof = 1;\r
- return len;\r
-}\r
-\r
-\r
-/*********************************************************************************\r
-* FUNCTION: netapimod_init_module\r
-*\r
-* DESCRIPTION:Initialization routine for netapi kernel device\r
-*********************************************************************************/\r
-static int __init netapimod_init_module(void)\r
-{\r
- void * priv = NULL; \r
- \r
- DPRINTK("netapimod_init_module: init\n");\r
-\r
- create_proc_read_entry("netapi", 0, NULL, netapi_init_proc, (void *)priv);\r
- // create_proc_read_entry("netapi_stats", 0, NULL, netapi_stats_proc, (void *)priv);\r
-\r
- //enable user access to qmss h/w\r
- MPU_Enable_userModeAccess();\r
-\r
- DPRINTK("NETAPI module loaded \n");\r
- return 0;\r
-}\r
-\r
-/*********************************************************************************\r
- * FUNCTION: netapimod_cleanup_module\r
- *\r
- * DESCRIPTION:\r
- *********************************************************************************/\r
-static void __exit netapimod_cleanup_module(void)\r
-{\r
- /* need to remove proc entries, etc */\r
- DPRINTK("netapi module unloaded\n");\r
- return;\r
-}\r
-\r
-module_init(netapimod_init_module);\r
-module_exit(netapimod_cleanup_module);\r
-\r
-MODULE_LICENSE("GPL v2");\r
-MODULE_AUTHOR("Texas Instruments Incorporated");\r
-MODULE_DESCRIPTION("TI NETAPI core module.");\r
-MODULE_SUPPORTED_DEVICE("Texas Instruments netapi");\r
-\r
-\r
+/*
+ * File name: netapimod.c
+ *
+ * Description: NETAPI utility module.
+ *
+ * Copyright (C) 2012 Texas Instruments, Incorporated
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+/* TODO:
+ - 64bit DMA address
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+
+#include <linux/version.h>
+#include <linux/unistd.h>
+#include <asm/unistd.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/string.h>
+#include <linux/if.h>
+
+#include <asm/uaccess.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/irq.h>
+#include <linux/clk.h>
+
+#include <asm/mach/map.h>
+
+#include <mach/vmalloc.h>
+#include <mach/common.h>
+#include <mach/time.h>
+#include <mach/cputype.h>
+#include <mach/psc.h>
+#include <mach/cp_intc.h>
+#include <mach/irqs.h>
+#include <mach/gpio.h>
+#include <mach/hardware.h>
+#include <mach/cp_intd.h>
+#include <mach/tci6614.h>
+#include <linux/hrtimer.h>
+
+#include "netapimod.h"
+
+#define NETAPIMOD_DEVNAME "netapi"
+//#define NETAPIMOD_DEBUG
+
+#ifdef NETAPIMOD_DEBUG
+# define __D(fmt, args...) printk(KERN_DEBUG "NETAPI Debug: " fmt, ## args)
+#else
+# define __D(fmt, args...)
+#endif
+
+#define __E(fmt, args...) printk(KERN_ERR "NETAPI Error: " fmt, ## args)
+
+static struct class *netapimod_class;
+static int netapimod_major;
+static atomic_t reference_count = ATOMIC_INIT(0);
+
+static dma_addr_t dmaAddr; // physical address of region
+static void * cpuAddr=NULL; //va for above
+static void * userVmaStart = NULL;
+
+//extern long davinci_ck_get_arm_rate(void);
+static void MPU_Enable_userModeAccess(void)
+{
+ unsigned int reg_addr,i,count,defRegVal;
+ void __iomem * temp_reg;
+ defRegVal = 0x3FFFFFF;
+ reg_addr = 0x2368208;
+ count = 5;
+
+ for(i=1;i<=count;i++)
+ {
+ temp_reg= ioremap(reg_addr, 4);
+ __raw_writel(defRegVal, temp_reg) ;
+ iounmap(temp_reg);
+ //*((unsigned int*)(reg_addr)) = defRegVal;
+ reg_addr = reg_addr + 0x10;
+ }
+
+ reg_addr = 0x2370208;
+ count = 16;
+
+ for(i=1;i<=count;i++)
+ {
+ temp_reg= ioremap(reg_addr, 4);
+ __raw_writel(defRegVal,temp_reg) ;
+ iounmap(temp_reg);
+ // *((unsigned int*)(reg_addr)) = defRegVal;
+ reg_addr = reg_addr + 0x10;
+ }
+
+ reg_addr = 0x2378208;
+ count = 1;
+
+ for(i=1;i<=count;i++)
+ {
+ temp_reg= ioremap(reg_addr, 4);
+ __raw_writel(defRegVal, temp_reg) ;
+ iounmap(temp_reg);
+
+// *((unsigned int*)(reg_addr)) = defRegVal;
+ reg_addr = reg_addr + 0x10;
+ }
+}
+
+/*********************************************************************************
+* FUNCTION: netapimod_init_proc
+*
+**********************************************************************************
+*
+* DESCRIPTION: Forms output for /proc/netapi file
+*********************************************************************************/
+static int netapimod_init_proc(char *buf, char **start, off_t offset,
+ int count, int *eof, void *data)
+{
+ unsigned long val;
+ int len=0;
+ struct clk *clk = clk_get((struct device *) NULL,"main_div_chip_clk1");
+ ktime_t temp1, temp2;
+ temp1 = ktime_get();
+ temp2 = ktime_get_real();
+
+ //enable user access to qmss h/w
+ MPU_Enable_userModeAccess();
+
+ //pmcr <- single clock, reset, enable
+ val = 0x4|0x1;
+ asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val));
+
+ //userenr <- enable user space access [this won't work from user space obviously!]
+ val = 1;
+ asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r"(val));
+
+ //start things
+ val = 0x80000000;
+ asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(val));
+
+ len += sprintf(buf + len, "netapi proc entry\n");
+ len += sprintf(buf + len, "===========================\n");
+ len += sprintf(buf + len, "enabled PMU for user space\n");
+ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(val));
+ len += sprintf(buf + len,"current ccnt = %ld\n", val);
+ len += sprintf(buf + len,"arm cpu freq = %d \n", clk? (int) clk_get_rate(clk): -1);
+ len += sprintf(buf + len,"cma = 0x%p \n", (void *)dmaAddr);
+ len += sprintf(buf + len,"ktime = %llx ktime_real=%llx\n", ktime_to_ns(temp1), ktime_to_ns(temp2) );
+ *eof = 1;
+
+ return len;
+}
+
+
+#if 0
+/*********************************************************************************
+* FUNCTION: netapimod_stats_proc
+*
+**********************************************************************************
+*
+* DESCRIPTION: Forms output for /proc/netapi_stats file
+*********************************************************************************/
+static int netapimod_stats_proc(char *buf, char **start, off_t offset,
+ int count, int *eof, void *data)
+{
+
+ int len = 0;
+ len += sprintf(buf + len, "NETAPI Stats:\n");
+ len += sprintf(buf + len, "=============================================\n");
+ len += sprintf(buf + len, "...coming...\n");
+ *eof = 1;
+ return len;
+}
+#endif
+
+static long netapimod_ioctl(struct file *filp, unsigned int cmd, unsigned long args)
+{
+ unsigned int __user *argp = (unsigned int __user *) args;
+ struct netapimod_block block;
+ unsigned long physp;
+
+ if (_IOC_TYPE(cmd) != _IOC_TYPE(NETAPIMOD_IOCMAGIC)) {
+ __E("ioctl(): bad command type 0x%x (should be 0x%x)\n",
+ _IOC_TYPE(cmd), _IOC_TYPE(NETAPIMOD_IOCMAGIC));
+ }
+
+ switch (cmd & NETAPIMOD_IOCCMDMASK) {
+ case NETAPIMOD_IOCGETPHYS:
+ __D("GETPHYS ioctl received.\n");
+
+ if (put_user((unsigned long)dmaAddr, argp)) {
+ return -EFAULT;
+ }
+
+ __D("GETPHYS returning %#1x\n", (unsigned int)dmaAddr);
+ break;
+
+ case NETAPIMOD_IOCCACHE:
+ __D("CACHE%s%s ioctl received.\n",
+ cmd & NETAPIMOD_WB ? "WB" : "", cmd & NETAPIMOD_INV ? "INV" : "");
+
+ if (copy_from_user(&block, argp, sizeof(block))) {
+ return -EFAULT;
+ }
+
+ physp = (unsigned long)dmaAddr + (block.addr - (unsigned long)userVmaStart);
+
+ switch (cmd & ~NETAPIMOD_IOCMAGIC) {
+ case NETAPIMOD_IOCCACHEWB:
+ dma_sync_single_for_device(NULL, (dma_addr_t)physp,
+ block.size, DMA_TO_DEVICE);
+ break;
+
+ case NETAPIMOD_IOCCACHEINV:
+ dma_sync_single_for_cpu(NULL, (dma_addr_t)physp,
+ block.size, DMA_FROM_DEVICE);
+ break;
+
+ case NETAPIMOD_IOCCACHEWBINV:
+ dma_sync_single_for_device(NULL, (dma_addr_t)physp,
+ block.size, DMA_TO_DEVICE);
+ dma_sync_single_for_cpu(NULL, (dma_addr_t)physp,
+ block.size, DMA_FROM_DEVICE);
+ break;
+
+ } /* switch cmd */
+
+ __D("CACHE%s%s ioctl returned vaddr=0x%p size=0x%x paddr=0x%p.\n",
+ cmd & NETAPIMOD_WB ? "WB" : "", cmd & NETAPIMOD_INV ? "INV" : "", (void *)block.addr, block.size, (void *)physp);
+ break;
+
+ case NETAPIMOD_IOCGETSIZE:
+ __D("GETSIZE ioctl received.\n");
+
+ if (put_user((unsigned long)NETAPIMOD_MEMSZ, argp)) {
+ return -EFAULT;
+ }
+
+ __D("GETSIZE returning %#1x\n", (unsigned int)NETAPIMOD_MEMSZ);
+ break;
+
+ default:
+ __E("Unknown ioctl received.\n");
+ return -EINVAL;
+
+ } /* switch base cmd */
+
+ return 0;
+}
+
+static int netapimod_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+ __D("mmap: vma->vm_start = %#lx\n", vma->vm_start);
+ __D("mmap: vma->vm_pgoff = %#lx\n", vma->vm_pgoff);
+ __D("mmap: vma->vm_end = %#lx\n", vma->vm_end);
+ __D("mmap: size = %#lx\n", vma->vm_end - vma->vm_start);
+
+ userVmaStart = (void *)vma->vm_start;
+ return dma_mmap_coherent(NULL, vma, cpuAddr, dmaAddr, (vma->vm_end - vma->vm_start));
+}
+
+static int netapimod_open(struct inode *inode, struct file *filp)
+{
+ __D("open: called.\n");
+
+ if (atomic_read(&reference_count)) {
+ __E("open: device already in use.\n");
+ return -EBUSY;
+ }
+
+ atomic_inc(&reference_count);
+ return 0;
+}
+
+static int netapimod_release(struct inode *inode, struct file *filp)
+{
+ __D("close: called.\n");
+
+ atomic_dec(&reference_count);
+ return 0;
+}
+
+static struct file_operations netapimod_fxns = {
+ owner: THIS_MODULE,
+ unlocked_ioctl: netapimod_ioctl,
+ mmap: netapimod_mmap,
+ open: netapimod_open,
+ release: netapimod_release
+};
+
+/*********************************************************************************
+* FUNCTION: netapimod_init_module
+*
+* DESCRIPTION:Initialization routine for netapi kernel device
+*********************************************************************************/
+static int __init netapimod_init_module(void)
+{
+ void * priv = NULL;
+
+ __D("init\n");
+
+ create_proc_read_entry(NETAPIMOD_DEVNAME, 0, NULL, netapimod_init_proc, (void *)priv);
+
+ //enable user access to qmss h/w
+ MPU_Enable_userModeAccess();
+
+ /* allocate space from CMA */
+ cpuAddr = dma_alloc_coherent(NULL, NETAPIMOD_MEMSZ, &dmaAddr, GFP_KERNEL);
+
+ if (!cpuAddr) {
+ __E("Error allocating from CMA.\n");
+ return -ENOMEM;
+ }
+
+ netapimod_major = register_chrdev(0, NETAPIMOD_DEVNAME, &netapimod_fxns);
+
+ if (netapimod_major < 0) {
+ __E("Failed to allocate major number.\n");
+ return -ENODEV;
+ }
+
+ __D("Allocated major number: %d\n", netapimod_major);
+
+ netapimod_class = class_create(THIS_MODULE, NETAPIMOD_DEVNAME);
+ if (IS_ERR(netapimod_class)) {
+ __E("Error creating netapi device class.\n");
+ return PTR_ERR(netapimod_class);
+ }
+
+ device_create(netapimod_class, NULL, MKDEV(netapimod_major, 0), NULL, NETAPIMOD_DEVNAME);
+
+ __D("module loaded\n");
+ return 0;
+}
+
+/*********************************************************************************
+ * FUNCTION: netapimod_cleanup_module
+ *
+ * DESCRIPTION:
+ *********************************************************************************/
+static void __exit netapimod_cleanup_module(void)
+{
+ if (atomic_read(&reference_count)) {
+ __E("netapi device still in use");
+ }
+
+ /* Remove netapi device */
+ device_destroy(netapimod_class, MKDEV(netapimod_major, 0));
+ unregister_chrdev(netapimod_major, NETAPIMOD_DEVNAME);
+ class_destroy(netapimod_class);
+
+ /* Free CMA buffer */
+ dma_free_coherent(NULL, NETAPIMOD_MEMSZ, cpuAddr, dmaAddr);
+
+ /* Remove netapi proc entry */
+ remove_proc_entry(NETAPIMOD_DEVNAME, NULL);
+
+ __D("module unloaded\n");
+ return;
+}
+
+module_init(netapimod_init_module);
+module_exit(netapimod_cleanup_module);
+
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Texas Instruments Incorporated");
+MODULE_DESCRIPTION("TI NETAPI core module.");
+MODULE_SUPPORTED_DEVICE("Texas Instruments netapi");
+
diff --git a/ti/runtime/netapi/tools/module/netapimod.h b/ti/runtime/netapi/tools/module/netapimod.h
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * File name: netapimod.h
+ *
+ * Description: NETAPI utility module header file.
+ *
+ * Copyright (C) 2012 Texas Instruments, Incorporated
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __TI_NETAPIMOD_H__
+#define __TI_NETAPIMOD_H__
+
+#define NETAPIMOD_IOCMAGIC 0x0000fe00
+
+/* Supported "base" ioctl cmds for the driver. */
+#define NETAPIMOD_IOCGETPHYS 1
+#define NETAPIMOD_IOCGETSIZE 2
+#define NETAPIMOD_IOCCACHE 3
+
+/* ioctl cmd "flavors" */
+#define NETAPIMOD_WB 0x00010000
+#define NETAPIMOD_INV 0x00020000
+
+/* Supported "flavors" to "base" ioctl cmds for the driver. */
+#define NETAPIMOD_IOCCACHEWBINV NETAPIMOD_IOCCACHE | NETAPIMOD_WB | NETAPIMOD_INV
+#define NETAPIMOD_IOCCACHEWB NETAPIMOD_IOCCACHE | NETAPIMOD_WB
+#define NETAPIMOD_IOCCACHEINV NETAPIMOD_IOCCACHE | NETAPIMOD_INV
+
+#define NETAPIMOD_IOCCMDMASK 0x000000ff
+
+#define NETAPIMOD_MEMSZ 0x200000
+
+struct netapimod_block {
+ unsigned long addr;
+ size_t size;
+};
+
+#endif /*__TI_NETAPIMOD_H__ */
+