These are the public header files for the user space drivers. Signed-Off-by: Jean-Christophe DUBOIS -- Index: linux-2.6.21/drivers/axon/usr/include/axon_usr_buffer.h =================================================================== --- /dev/null +++ linux-2.6.21/drivers/axon/usr/include/axon_usr_buffer.h @@ -0,0 +1,73 @@ +/****************************************************************** + * Copyright (C) 2006 Mercury Computer Systems, Inc. + * 199 Riverneck Road + * Chelmsford, MA 01824-2820 + * (978) 256-1300 + * webinfo@mc.com + * + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + ******************************************************************/ + + +#ifndef AXON_USR_BUFFER_H +#define AXON_USR_BUFFER_H + +#include + +#include + +#include "axon_types.h" + +#define MC_AXON_BUFFER_MAGIC 'B' + + +#define MC_AXON_LOCAL_BUFFER_REGISTER _IOW(MC_AXON_BUFFER_MAGIC, 1, int) +#define MC_AXON_LOCAL_BUFFER_UNREGISTER _IOW(MC_AXON_BUFFER_MAGIC, 2, int) +#define MC_AXON_REMOTE_BUFFER_ACCESS_BY_KEY _IOW(MC_AXON_BUFFER_MAGIC, 3, int) +#define MC_AXON_REMOTE_BUFFER_ACCESS_BY_NAME _IOW(MC_AXON_BUFFER_MAGIC, 4, int) +#define MC_AXON_REMOTE_BUFFER_ACCESS_RAW _IOW(MC_AXON_BUFFER_MAGIC, 5, int) + +#define MC_AXON_BUFFER_MAXNR 5 + + +typedef __u32 axon_buffer_key_t; + +#define AXON_BUFFER_NAME_LEN 32 + + +typedef struct { + + + char name[AXON_BUFFER_NAME_LEN]; + + + axon_buffer_key_t key; + + + axon_size_t len; + + union { + + axon_addr_ptr_t vaddr; + + + plb_addr_t plb_addr; + } addr; + +} axon_buffer_ioctl_map_t; + +#endif Index: linux-2.6.21/drivers/axon/usr/include/axon_usr_buffer.h~ =================================================================== --- /dev/null +++ linux-2.6.21/drivers/axon/usr/include/axon_usr_buffer.h~ @@ -0,0 +1,93 @@ +/****************************************************************** + * Copyright (C) 2006 Mercury Computer Systems, Inc. + * 199 Riverneck Road + * Chelmsford, MA 01824-2820 + * (978) 256-1300 + * webinfo@mc.com + * + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + ******************************************************************/ + +#ifndef AXON_USR_BUFFER_H +#define AXON_USR_BUFFER_H + +#include + +#include + +#include "axon_types.h" + +#define MC_AXON_BUFFER_MAGIC 'B' + +/** + * IOCTLs supported for kernel/user communication + */ +#define MC_AXON_LOCAL_BUFFER_REGISTER _IOW(MC_AXON_BUFFER_MAGIC, 1, int) +#define MC_AXON_LOCAL_BUFFER_UNREGISTER _IOW(MC_AXON_BUFFER_MAGIC, 2, int) +#define MC_AXON_REMOTE_BUFFER_ACCESS_BY_KEY _IOW(MC_AXON_BUFFER_MAGIC, 3, int) +#define MC_AXON_REMOTE_BUFFER_ACCESS_BY_NAME _IOW(MC_AXON_BUFFER_MAGIC, 4, int) +#define MC_AXON_REMOTE_BUFFER_ACCESS_RAW _IOW(MC_AXON_BUFFER_MAGIC, 5, int) + +#define MC_AXON_BUFFER_MAXNR 5 + +/** + * Generic type for buffer ID + */ +typedef __u32 axon_buffer_key_t; + +#define AXON_BUFFER_NAME_LEN 32 + +/** + * This structure is used to request + * pinning down some pages using a virtual address + */ +typedef struct { + + /** + * We can also have a literal name + */ + char name[AXON_BUFFER_NAME_LEN]; + + /** + * Unique key returned by the driver representing the + * established mapping + */ + axon_buffer_key_t key; + + /** + * Size of the space to be locked + */ + axon_size_t len; + + union { + /** + * User virtual address to be locked and mapped into the kernel + * For MC_AXON_LOCAL_BUFFER_REGISTER + */ + axon_addr_ptr_t vaddr; + + /** + * This is for the MC_AXON_REMOTE_BUFFER_ACCESS_RAW + * It allows to access the remote side at a raw physical address + * even if there is no driver to talk to. + */ + plb_addr_t plb_addr; + } addr; + +} axon_buffer_ioctl_map_t; + +#endif /* AXON_USR_BUFFER_H */ Index: linux-2.6.21/drivers/axon/usr/include/axon_usr.h =================================================================== --- /dev/null +++ linux-2.6.21/drivers/axon/usr/include/axon_usr.h @@ -0,0 +1,101 @@ +/****************************************************************** + * Copyright (C) 2006 Mercury Computer Systems, Inc. + * 199 Riverneck Road + * Chelmsford, MA 01824-2820 + * (978) 256-1300 + * webinfo@mc.com + * + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + ******************************************************************/ + + +#ifndef AXON_USR_H +#define AXON_USR_H + +#include + +#include "axon_types.h" + +#define MC_AXON_IOC_MAGIC 'X' + + +#define MC_AXON_IOC_GETPAGES _IOWR(MC_AXON_IOC_MAGIC, 1, axon_ioctl_map_t) +#define MC_AXON_IOC_RELEASEPAGES _IOW(MC_AXON_IOC_MAGIC, 2, axon_ioctl_map_t) +#define MC_AXON_IOC_GETPAGECOUNT _IOWR(MC_AXON_IOC_MAGIC, 3, axon_ioctl_dma_req_t) +#define MC_AXON_IOC_GETPAGEINFO _IOWR(MC_AXON_IOC_MAGIC, 4, axon_ioctl_page_info_t) +#define MC_AXON_IOC_DO_DMA _IOW(MC_AXON_IOC_MAGIC, 5, axon_ioctl_dma_req_t) + +#define MC_AXON_IOC_MAXNR 5 + +typedef int axon_map_key_t; + +typedef struct { + axon_addr_ptr_t vaddr; + + axon_size_t len; + + axon_map_key_t key; + +} axon_ioctl_map_t; + +typedef struct { + + axon_map_key_t key; + + size_t count; + + axon_addr_ptr_t vaddr; + + axon_size_t vsize; + +} axon_ioctl_page_count_t; + +typedef struct { + + axon_map_key_t key; + + unsigned int index; + + plb_addr_t plb_addr; + + axon_addr_ptr_t virt_addr; + + axon_size_t offset; + + axon_size_t size; + +} axon_ioctl_page_info_t; + +typedef enum { + AXON_DMA_WRITE, + AXON_DMA_READ, +} axon_dma_req_type_t; + +typedef struct { + + + plb_addr_t paddr_dst; + + plb_addr_t paddr_src; + + axon_size_bus_t size; + + axon_dma_req_type_t type; + +} axon_ioctl_dma_req_t; + +#endif Index: linux-2.6.21/drivers/axon/usr/include/axon_usr_mbx.h =================================================================== --- /dev/null +++ linux-2.6.21/drivers/axon/usr/include/axon_usr_mbx.h @@ -0,0 +1,46 @@ +/****************************************************************** + * Copyright (C) 2006 Mercury Computer Systems, Inc. + * 199 Riverneck Road + * Chelmsford, MA 01824-2820 + * (978) 256-1300 + * webinfo@mc.com + * + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + ******************************************************************/ + + +#ifndef AXON_USR_MBX_H +#define AXON_USR_MBX_H + +#include + +#include "axon_types.h" + +#define MC_AXON_MBX_MAGIC 'M' + + +#define MC_AXON_SUBSCRIBE_CHANNEL _IOW(MC_AXON_MBX_MAGIC, 1, int) +#define MC_AXON_UNSUBSCRIBE_CHANNEL _IOW(MC_AXON_MBX_MAGIC, 2, int) + +#define MC_AXON_MBX_MAXNR 2 + +#define MC_AXON_USR_MIN_CHANNEL 0x06 +#define MC_AXON_USR_MAX_CHANNEL 0x7E + +#define MC_AXON_USR_MSG_LEN 15 + +#endif --