From 9c4e246a5baf43cadc6380e91fd5a6e319777278 Mon Sep 17 00:00:00 2001 From: James Lentini Date: Fri, 5 Aug 2005 17:56:56 +0000 Subject: [PATCH] r2987: Remove kernel code directory. Signed-off-by: James Lentini --- dat/kdat/Makefile | 222 ------------------- dat/kdat/kdat.c | 451 --------------------------------------- dat/kdat/kdat_api.c | 185 ---------------- dat/kdat/kdat_module.c | 187 ---------------- dat/kdat/linux/dat_osd.c | 175 --------------- dat/kdat/linux/dat_osd.h | 196 ----------------- 6 files changed, 1416 deletions(-) delete mode 100644 dat/kdat/Makefile delete mode 100644 dat/kdat/kdat.c delete mode 100644 dat/kdat/kdat_api.c delete mode 100644 dat/kdat/kdat_module.c delete mode 100644 dat/kdat/linux/dat_osd.c delete mode 100644 dat/kdat/linux/dat_osd.h diff --git a/dat/kdat/Makefile b/dat/kdat/Makefile deleted file mode 100644 index 8f7e9f9..0000000 --- a/dat/kdat/Makefile +++ /dev/null @@ -1,222 +0,0 @@ -# -# Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. -# -# This Software is licensed under one of the following licenses: -# -# 1) under the terms of the "Common Public License 1.0" a copy of which is -# in the file LICENSE.txt in the root directory. The license is also -# available from the Open Source Initiative, see -# http://www.opensource.org/licenses/cpl.php. -# -# 2) under the terms of the "The BSD License" a copy of which is in the file -# LICENSE2.txt in the root directory. The license is also available from -# the Open Source Initiative, see -# http://www.opensource.org/licenses/bsd-license.php. -# -# 3) under the terms of the "GNU General Public License (GPL) Version 2" a -# copy of which is in the file LICENSE3.txt in the root directory. The -# license is also available from the Open Source Initiative, see -# http://www.opensource.org/licenses/gpl-license.php. -# -# Licensee has the right to choose one of the above licenses. -# -# Redistributions of source code must retain the above copyright -# notice and one of the license notices. -# -# Redistributions in binary form must reproduce both the above copyright -# notice, one of the license notices in the documentation -# and/or other materials provided with the distribution. -# - -#-------------------------------------------------------------------------- -# -# MODULE: Makefile -# -# PURPOSE: Makefile for the DAT registry Linux kernel module -# -# $Id: Makefile,v 1.13 2005/03/31 21:50:48 jlentini Exp $ -#-------------------------------------------------------------------------- - -# -# This makefile is designed for both Linux 2.4.X and Linux 2.6.X. Due to -# vastly different ways in which kernel modules are compiled on these two -# versions of Linux, this makefile is seperated into two parts: one for -# 2.4.X and one for 2.6.X. -# - -#-------------------------------------------------------------------------- -# if we are compiling on Linux 2.4.X -#-------------------------------------------------------------------------- -ifeq ($(shell uname -r | cut -d \. -f 2),4) - -UNAME = $(strip $(shell /bin/uname -r)) -KERNEL_INCLUDE_DIR = /lib/modules/$(UNAME)/build/include - -TOPDIR = $(shell /bin/pwd) -COMMON = $(TOPDIR)/../common -KLINUX = $(TOPDIR)/linux - -SRC_PATH = $(TOPDIR)/ -OBJ_PATH = $(TOPDIR)/Obj/ -#TARGET_PATH = $(TOPDIR)/Target/$(UNAME)/ -TARGET_PATH = $(TOPDIR)/Target - -TARGET = $(TARGET_PATH)/dat_registry.o - -CC=gcc - -# -# CFLAGS definition -# -CFLAGS = -O -g $(CPPFLAGS) -CFLAGS += -D__KERNEL__ -CFLAGS += -D__KDAPL__ -CFLAGS += -DDAT_NO_STATIC_REGISTRY -CFLAGS += -DMODULE -CFLAGS += -I. -CFLAGS += -I../include -CFLAGS += -I./linux -CFLAGS += -I../common -CFLAGS += -I$(KERNEL_INCLUDE_DIR) -CFLAGS += -Wall -CFLAGS += -Wstrict-prototypes -# The following two lines will cause warnings to appear on the -# compile time output when including certain kernel .h files -#CFLAGS += -Wmissing-prototypes -#CFLAGS += -Wmissing-declarations -CFLAGS += -Werror - -KDAT_LINUX_SRCS = dat_osd.c - -KDAT_SRCS = kdat.c \ - kdat_api.c \ - kdat_module.c - -COMMON_SRCS = dat_dictionary.c \ - dat_dr.c \ - dat_api.c \ - dat_init.c \ - dat_strerror.c - -SRCS = $(KDAT_SRCS) $(COMMON_SRCS) $(KDAT_LINUX_SRCS) - -KDAT_LINUX_OBJS = $(KDAT_LINUX_SRCS:%.c=$(OBJ_PATH)%.o) -KDAT_OBJS = $(KDAT_SRCS:%.c=$(OBJ_PATH)%.o) -COMMON_OBJS = $(COMMON_SRCS:%.c=$(OBJ_PATH)%.o) - -OBJS = $(KDAT_OBJS) $(COMMON_OBJS) $(KDAT_LINUX_OBJS) - - -all: mkdirs $(TARGET) - -mkdirs: - @[ -d $(TARGET_PATH) ] || /bin/mkdir -p $(TARGET_PATH) - @[ -d $(OBJ_PATH) ] || /bin/mkdir -p $(OBJ_PATH) - -$(KDAT_OBJS): $(OBJ_PATH)%.o : %.c - @echo Compiling $< - $(CC) $(CFLAGS) -c $< -o $@ - -$(KDAT_LINUX_OBJS): $(OBJ_PATH)%.o : $(KLINUX)/%.c - @echo Compiling $< - $(CC) $(CFLAGS) -c $< -o $@ - -$(COMMON_OBJS): $(OBJ_PATH)%.o : $(COMMON)/%.c - @echo Compiling $< - $(CC) $(CFLAGS) -c $< -o $@ - -$(TARGET): $(OBJS) - @echo Linking $(TARGET) - $(LD) -r $^ -o $(TARGET) - -clean: - rm -f $(OBJS) - rm -f $(TARGET) - -load: $(TARGET) - @sudo insmod $(TARGET) - @sudo tail -3 /var/log/messages | grep -v sudo - -unload: - @sudo rmmod dat_registry - @sudo tail -3 /var/log/messages | grep -v sudo - -#-------------------------------------------------------------------------- -# else we are compiling on Linux 2.6.X -#-------------------------------------------------------------------------- -else - -# -# The 2.6.X portion of this makefile is intended to be: -# - read directly as the result of a user typing "make" -# - read by the kernel build system, kbuild -# - - -# Variables for both direct and kbuild sections -KDAT_COMMON = ../common -KDAT_INCLUDE = ../include -KDAT_LINUX = linux - - -#-------------------------------------------------------------------------- -# if KERNELRELEASE is not defined, assume the file is being read directly -ifeq ($(origin KERNELRELEASE), undefined) - -# Variables -KDAT_ROOT = `pwd` # directory that contains this makefile -KERNEL_ROOT = /lib/modules/`uname -r`/build # root of kernel sources - -# Tools -ECHO = /bin/echo -RM = /bin/rm - -all : - @$(ECHO) "--- Compiling DAT Registry ---" - $(MAKE) -C $(KERNEL_ROOT) M=$(KDAT_ROOT) V=1 modules - -clean : - $(RM) -rf \ - *.o .*.cmd \ - $(KDAT_LINUX)/*.o $(KDAT_LINUX)/.*.cmd \ - $(KDAT_COMMON)/*.o $(KDAT_COMMON)/.*.cmd \ - .*.d .*.o.tmp *.mod.* *.ko .tmp_versions - - -#-------------------------------------------------------------------------- -# else the file is being read by kbuild -# NOTE: Prefix all variables with "KDAT_" to avoid collisions -else - -# Local Variables -KDAT_TARGET = dat_registry - -# Kbuild Variables -EXTRA_CFLAGS += -D__KERNEL__ -EXTRA_CFLAGS += -D__KDAPL__ -EXTRA_CFLAGS += -DDAT_NO_STATIC_REGISTRY - -EXTRA_CFLAGS += -I$(src) -EXTRA_CFLAGS += -I$(src)/$(KDAT_COMMON) -EXTRA_CFLAGS += -I$(src)/$(KDAT_INCLUDE) -EXTRA_CFLAGS += -I$(src)/$(KDAT_LINUX) - -EXTRA_CFLAGS += -Wall -EXTRA_CFLAGS += -Wstrict-prototypes -EXTRA_CFLAGS += -Werror - -obj-m += $(KDAT_TARGET).o - -$(KDAT_TARGET)-objs := kdat.o \ - kdat_api.o \ - kdat_module.o \ - $(KDAT_LINUX)/dat_osd.o \ - $(KDAT_COMMON)/dat_dictionary.o \ - $(KDAT_COMMON)/dat_dr.o \ - $(KDAT_COMMON)/dat_api.o \ - $(KDAT_COMMON)/dat_init.o \ - $(KDAT_COMMON)/dat_strerror.o - -endif # if !kbuild - -endif # if 2.4.X diff --git a/dat/kdat/kdat.c b/dat/kdat/kdat.c deleted file mode 100644 index 3bcef99..0000000 --- a/dat/kdat/kdat.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. - * - * This Software is licensed under one of the following licenses: - * - * 1) under the terms of the "Common Public License 1.0" a copy of which is - * in the file LICENSE.txt in the root directory. The license is also - * available from the Open Source Initiative, see - * http://www.opensource.org/licenses/cpl.php. - * - * 2) under the terms of the "The BSD License" a copy of which is in the file - * LICENSE2.txt in the root directory. The license is also available from - * the Open Source Initiative, see - * http://www.opensource.org/licenses/bsd-license.php. - * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is in the file LICENSE3.txt in the root directory. The - * license is also available from the Open Source Initiative, see - * http://www.opensource.org/licenses/gpl-license.php. - * - * Licensee has the right to choose one of the above licenses. - * - * Redistributions of source code must retain the above copyright - * notice and one of the license notices. - * - * Redistributions in binary form must reproduce both the above copyright - * notice, one of the license notices in the documentation - * and/or other materials provided with the distribution. - */ - -/********************************************************************** - * - * MODULE: kdat.c - * - * PURPOSE: DAT Provider and Consumer registry functions. - * - * $Id: kdat.c,v 1.5 2005/03/24 05:58:34 jlentini Exp $ - **********************************************************************/ - -#include -#include /* Provider API function prototypes */ - -#include "dat_dr.h" -#include "dat_init.h" -#include "dat_osd.h" -#ifndef DAT_NO_STATIC_REGISTRY -#include "dat_sr.h" -#endif - - -#define KDAT_IS_BAD_POINTER(p) ( NULL == (p) ) - -/********************************************************************* - * * - * Internal Function Declarations * - * * - *********************************************************************/ - -DAT_BOOLEAN -kdat_check_state ( void ); - - -/********************************************************************* - * * - * External Function Definitions * - * * - *********************************************************************/ - - -/* - * - * Provider API - * - */ - - -/*********************************************************************** - * Function: dat_registry_add_provider - ***********************************************************************/ - -DAT_RETURN -dat_registry_add_provider ( - IN const DAT_PROVIDER *provider, - IN const DAT_PROVIDER_INFO *provider_info ) -{ - DAT_DR_ENTRY entry; - - dat_os_dbg_print (DAT_OS_DBG_TYPE_PROVIDER_API, - "DAT Registry: dat_registry_add_provider (%s,%x:%x,%x)\n", - provider_info->ia_name, - provider_info->dapl_version_major, - provider_info->dapl_version_minor, - provider_info->is_thread_safe); - - if ( KDAT_IS_BAD_POINTER (provider) ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG1); - } - - if ( KDAT_IS_BAD_POINTER (provider_info) ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); - } - - if ( DAT_FALSE == kdat_check_state () ) - { - return DAT_ERROR (DAT_INVALID_STATE, 0); - } - - entry.ref_count = 0; - entry.ia_open_func = provider->ia_open_func; - entry.info = *provider_info; - - return dat_dr_insert (provider_info, &entry); -} - - -//*********************************************************************** -// Function: dat_registry_remove_provider -//*********************************************************************** - -DAT_RETURN -dat_registry_remove_provider ( - IN const DAT_PROVIDER *provider, - IN const DAT_PROVIDER_INFO *provider_info ) -{ - dat_os_dbg_print (DAT_OS_DBG_TYPE_PROVIDER_API, - "DAT Registry: dat_registry_remove_provider (%s) called\n", - provider_info->ia_name); - - if ( KDAT_IS_BAD_POINTER (provider) ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG1); - } - - if ( DAT_FALSE == kdat_check_state () ) - { - return DAT_ERROR (DAT_INVALID_STATE, 0); - } - - return dat_dr_remove (provider_info); -} - - -/* - * - * Consumer API - * - */ - -/*********************************************************************** - * Function: dat_ia_open - ***********************************************************************/ - -DAT_RETURN -dat_ia_openv ( - IN const DAT_NAME_PTR name, - IN DAT_COUNT async_event_qlen, - INOUT DAT_EVD_HANDLE *async_event_handle, - OUT DAT_IA_HANDLE *ia_handle, - IN DAT_UINT32 dapl_major, - IN DAT_UINT32 dapl_minor, - IN DAT_BOOLEAN thread_safety ) -{ - DAT_IA_OPEN_FUNC ia_open_func; - DAT_PROVIDER_INFO info; - DAT_OS_SIZE len; - DAT_RETURN dat_status; - unsigned long return_handle; - - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: dat_ia_open (%s,%x:%x,%x) called\n", - name, - dapl_major, - dapl_minor, - thread_safety); - - if ( KDAT_IS_BAD_POINTER (name) ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG1); - } - - len = dat_os_strlen (name); - - if ( DAT_NAME_MAX_LENGTH < len ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG1); - } - - if ( KDAT_IS_BAD_POINTER (ia_handle) ) - { - return DAT_ERROR (DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA); - } - - if ( DAT_FALSE == kdat_check_state () ) - { - return DAT_ERROR (DAT_INVALID_STATE, 0); - } - - dat_os_strncpy (info.ia_name, name, len); - info.ia_name[len] = '\0'; - - info.dapl_version_major = dapl_major; - info.dapl_version_minor = dapl_minor; - info.is_thread_safe = thread_safety; - - /* - * Since DAT allows providers to be loaded by either the static - * registry or explicitly through OS dependent methods, do not - * return an error if no providers are loaded via the static registry. - * Don't even bother calling the static registry if DAT is compiled - * with no static registry support. - */ - -#ifndef DAT_NO_STATIC_REGISTRY - (void) dat_sr_provider_open ( &info ); -#endif - - dat_status = dat_dr_provider_open ( &info, &ia_open_func); - if ( dat_status != DAT_SUCCESS ) - { - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: dat_ia_open () provider information " - "for IA name %s not found in dynamic registry\n", - name); - - return dat_status; - } - - dat_status = (*ia_open_func) (name, - async_event_qlen, - async_event_handle, - ia_handle); - if (dat_status == DAT_SUCCESS) - { - return_handle = dats_set_ia_handle (*ia_handle); - if (return_handle >= 0) - { - *ia_handle = (DAT_IA_HANDLE)return_handle; - } - } - - return dat_status; -} - - -/************************************************************************ - * Function: dat_ia_close - ***********************************************************************/ - -DAT_RETURN -dat_ia_close ( - IN DAT_IA_HANDLE ia_handle, - IN DAT_CLOSE_FLAGS ia_flags) -{ - DAT_PROVIDER *provider; - DAT_PROVIDER_ATTR provider_attr; - DAT_IA_HANDLE dapl_ia_handle; - DAT_RETURN dat_status; - const char *ia_name; - - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: dat_ia_close () called\n"); - - dat_status = dats_get_ia_handle((unsigned long)ia_handle, - &dapl_ia_handle); - if (dat_status != DAT_SUCCESS) - { - return DAT_ERROR (DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA); - } - - if ( DAT_FALSE == kdat_check_state () ) - { - return DAT_ERROR (DAT_INVALID_STATE, 0); - } - - provider = DAT_HANDLE_TO_PROVIDER (dapl_ia_handle); - ia_name = provider->device_name; - - if ( DAT_SUCCESS != (dat_status = dat_ia_query (ia_handle, - NULL, - 0, - NULL, - DAT_PROVIDER_FIELD_ALL, - &provider_attr)) ) - { - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: query function for %s provider failed\n", - ia_name); - } - else if ( DAT_SUCCESS != (dat_status = - (*provider->ia_close_func) (dapl_ia_handle, ia_flags)) ) - { - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: close function for %s provider failed\n", - ia_name); - } - else - { - DAT_PROVIDER_INFO info; - DAT_OS_SIZE len; - - len = dat_os_strlen (ia_name); - - dat_os_assert ( len <= DAT_NAME_MAX_LENGTH ); - - dat_os_strncpy (info.ia_name, ia_name, len); - info.ia_name[len] = '\0'; - - info.dapl_version_major = provider_attr.dapl_version_major; - info.dapl_version_minor = provider_attr.dapl_version_minor; - info.is_thread_safe = provider_attr.is_thread_safe; - - dat_status = dat_dr_provider_close ( &info ); - if ( DAT_SUCCESS != dat_status ) - { - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: dynamic registry unable to close " - "provider for IA name %s\n", - ia_name); - } - - /* Remove the handle from the handle table */ - (void) dats_free_ia_handle((unsigned long)ia_handle); - -#ifndef DAT_NO_STATIC_REGISTRY - dat_status = dat_sr_provider_close ( &info ); - if ( DAT_SUCCESS != dat_status ) - { - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: static registry unable to close " - "provider for IA name %s\n", - ia_name); - } -#endif - } - - return dat_status; -} - - -//*********************************************************************** -// Function: dat_registry_list_providers -//*********************************************************************** - -DAT_RETURN -dat_registry_list_providers ( - IN DAT_COUNT max_to_return, - OUT DAT_COUNT *entries_returned, - OUT DAT_PROVIDER_INFO * (dat_provider_list[])) -{ - DAT_RETURN dat_status; - - dat_status = DAT_SUCCESS; - dat_os_dbg_print (DAT_OS_DBG_TYPE_CONSUMER_API, - "DAT Registry: dat_registry_list_providers () called\n"); - - if ( DAT_FALSE == kdat_check_state () ) - { - return DAT_ERROR (DAT_INVALID_STATE, 0); - } - - if ( ( KDAT_IS_BAD_POINTER (entries_returned) ) ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); - } - - if (0 != max_to_return && ( KDAT_IS_BAD_POINTER (dat_provider_list) ) ) - { - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG3); - } - - if ( 0 == max_to_return ) - { - /* the user is allowed to call with max_to_return set to zero. - * in which case we simply return (in *entries_returned) the - * number of providers currently installed. We must also - * (per spec) return an error - */ -#ifndef DAT_NO_STATIC_REGISTRY - (void) dat_sr_size ( entries_returned ); -#else - (void) dat_dr_size ( entries_returned ); -#endif - return DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG1); - } - else - { -#ifndef DAT_NO_STATIC_REGISTRY - dat_status = dat_sr_list (max_to_return, - entries_returned, - dat_provider_list); -#else - dat_status = dat_dr_list (max_to_return, - entries_returned, - dat_provider_list); -#endif - } - return dat_status; -} - - -/********************************************************************* - * * - * Internal Function Definitions * - * * - *********************************************************************/ - - -//*********************************************************************** -// Function: kdat_check_state -//*********************************************************************** - -/* - * This function returns TRUE if the DAT registry is in a state capable - * of handling DAT API calls and false otherwise. - */ - -DAT_BOOLEAN -kdat_check_state ( void ) -{ - DAT_MODULE_STATE state; - DAT_BOOLEAN status; - - state = dat_module_get_state (); - - if ( DAT_MODULE_STATE_UNINITIALIZED == state ) - { - dat_init (); - status = DAT_TRUE; - } - else if ( DAT_MODULE_STATE_DEINITIALIZED == state ) - { - status = DAT_FALSE; - } - else - { - status = DAT_TRUE; - } - - return status; -} - - -/* - * Local variables: - * c-indent-level: 4 - * c-basic-offset: 4 - * tab-width: 8 - * End: - */ diff --git a/dat/kdat/kdat_api.c b/dat/kdat/kdat_api.c deleted file mode 100644 index 7e2b1f8..0000000 --- a/dat/kdat/kdat_api.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. - * - * This Software is licensed under one of the following licenses: - * - * 1) under the terms of the "Common Public License 1.0" a copy of which is - * in the file LICENSE.txt in the root directory. The license is also - * available from the Open Source Initiative, see - * http://www.opensource.org/licenses/cpl.php. - * - * 2) under the terms of the "The BSD License" a copy of which is in the file - * LICENSE2.txt in the root directory. The license is also available from - * the Open Source Initiative, see - * http://www.opensource.org/licenses/bsd-license.php. - * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is in the file LICENSE3.txt in the root directory. The - * license is also available from the Open Source Initiative, see - * http://www.opensource.org/licenses/gpl-license.php. - * - * Licensee has the right to choose one of the above licenses. - * - * Redistributions of source code must retain the above copyright - * notice and one of the license notices. - * - * Redistributions in binary form must reproduce both the above copyright - * notice, one of the license notices in the documentation - * and/or other materials provided with the distribution. - */ - -/********************************************************************** - * - * MODULE: kdat.c - * - * PURPOSE: DAT Provider and Consumer registry functions. - * - * $Id: kdat_api.c,v 1.9 2005/05/02 14:00:14 jlentini Exp $ - **********************************************************************/ - -#include "dat_osd.h" -#include -#include "dat_init.h" - -DAT_RETURN dat_lmr_kcreate ( - IN DAT_IA_HANDLE ia_handle, - IN DAT_MEM_TYPE mem_type, - IN DAT_REGION_DESCRIPTION region_description, - IN DAT_VLEN length, - IN DAT_PZ_HANDLE pz_handle, - IN DAT_MEM_PRIV_FLAGS privileges, - IN DAT_MEM_OPTIMIZE_FLAGS mem_optimization, - OUT DAT_LMR_HANDLE *lmr_handle, - OUT DAT_LMR_CONTEXT *lmr_context, - OUT DAT_RMR_CONTEXT *rmr_context, - OUT DAT_VLEN *registered_length, - OUT DAT_VADDR *registered_address) -{ - DAT_IA_HANDLE dapl_ia_handle; - DAT_RETURN dat_status; - - dat_status = dats_get_ia_handle((unsigned long)ia_handle, - &dapl_ia_handle); - if (dat_status == DAT_SUCCESS) - { - dat_status = DAT_LMR_KCREATE (dapl_ia_handle, - mem_type, - region_description, - length, - pz_handle, - privileges, - mem_optimization, - lmr_handle, - lmr_context, - rmr_context, - registered_length, - registered_address); - } - - return dat_status; -} - - -DAT_RETURN dat_ia_memtype_hint ( - IN DAT_IA_HANDLE ia_handle, - IN DAT_MEM_TYPE mem_type, - IN DAT_VLEN length, - IN DAT_MEM_OPTIMIZE_FLAGS mem_optimization, - OUT DAT_VLEN * preferred_length, - OUT DAT_VADDR * preferred_alignment) -{ - DAT_IA_HANDLE dapl_ia_handle; - DAT_RETURN dat_status; - - dat_status = dats_get_ia_handle((unsigned long)ia_handle, - &dapl_ia_handle); - if (dat_status == DAT_SUCCESS) - { - dat_status = DAT_IA_MEMTYPE_HINT (dapl_ia_handle, - mem_type, - length, - mem_optimization, - preferred_length, - preferred_alignment); - } - - return dat_status; -} - - -DAT_RETURN dat_evd_kcreate ( - IN DAT_IA_HANDLE ia_handle, - IN DAT_COUNT evd_min_qlen, - IN DAT_UPCALL_POLICY upcall_policy, - IN const DAT_UPCALL_OBJECT *upcall, - IN DAT_EVD_FLAGS evd_flags, - OUT DAT_EVD_HANDLE *evd_handle) -{ - DAT_IA_HANDLE dapl_ia_handle; - DAT_RETURN dat_status; - - dat_status = dats_get_ia_handle((unsigned long)ia_handle, - &dapl_ia_handle); - if (dat_status == DAT_SUCCESS) - { - dat_status = DAT_EVD_KCREATE (dapl_ia_handle, - evd_min_qlen, - upcall_policy, - upcall, - evd_flags, - evd_handle); - } - - return dat_status; -} - - -DAT_RETURN dat_evd_modify_upcall ( - IN DAT_EVD_HANDLE evd_handle, - IN DAT_UPCALL_POLICY upcall_policy, - IN const DAT_UPCALL_OBJECT *upcall) -{ - if (evd_handle == NULL) - { - return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_REQUEST); - } - return DAT_EVD_MODIFY_UPCALL (evd_handle, - upcall_policy, - upcall); -} - - -DAT_RETURN dat_cr_handoff ( - IN DAT_CR_HANDLE cr_handle, - IN DAT_CONN_QUAL handoff) -{ - if (cr_handle == NULL) - { - return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CR); - } - return DAT_CR_HANDOFF (cr_handle, - handoff); -} - - -DAT_RETURN dat_lmr_query ( - IN DAT_LMR_HANDLE lmr_handle, - IN DAT_LMR_PARAM_MASK lmv_param_mask, - OUT DAT_LMR_PARAM *lmr_param) -{ - if (lmr_handle == NULL) - { - return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_LMR); - } - return DAT_LMR_QUERY (lmr_handle, - lmv_param_mask, - lmr_param); -} - -/* - * Local variables: - * c-indent-level: 4 - * c-basic-offset: 4 - * tab-width: 8 - * End: - */ diff --git a/dat/kdat/kdat_module.c b/dat/kdat/kdat_module.c deleted file mode 100644 index f1d0f11..0000000 --- a/dat/kdat/kdat_module.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. - * - * This Software is licensed under one of the following licenses: - * - * 1) under the terms of the "Common Public License 1.0" a copy of which is - * in the file LICENSE.txt in the root directory. The license is also - * available from the Open Source Initiative, see - * http://www.opensource.org/licenses/cpl.php. - * - * 2) under the terms of the "The BSD License" a copy of which is in the file - * LICENSE2.txt in the root directory. The license is also available from - * the Open Source Initiative, see - * http://www.opensource.org/licenses/bsd-license.php. - * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is in the file LICENSE3.txt in the root directory. The - * license is also available from the Open Source Initiative, see - * http://www.opensource.org/licenses/gpl-license.php. - * - * Licensee has the right to choose one of the above licenses. - * - * Redistributions of source code must retain the above copyright - * notice and one of the license notices. - * - * Redistributions in binary form must reproduce both the above copyright - * notice, one of the license notices in the documentation - * and/or other materials provided with the distribution. - */ - -/********************************************************************** - * - * MODULE: kdat_module.c - * - * PURPOSE: DAT registry module implementation, exists in the Linux - * kernel - * Description: a linux module implementation - * - * $Id: kdat_module.c,v 1.4 2005/03/24 05:58:34 jlentini Exp $ - **********************************************************************/ - -#define EXPORT_SYMTAB -#include -#include -#include "dat_osd.h" -#include "dat_init.h" - -#include -#include - -MODULE_LICENSE("BSD"); -MODULE_DESCRIPTION("kDAT registry for Linux kernel"); -MODULE_AUTHOR("Fujitsu PST, Network Appliance, Inc."); - -int DbgLvl = 0; -MODULE_PARM ( DbgLvl, "i" ); -MODULE_PARM_DESC(DbgLvl, "Bit mask to enable dat debugging, equivelent to DAT_DBG_TYPE"); - - -/*********************************************************************** - * init_module - * - * Entry point for a Linux module, performs simple initialization - * - * Input: - * none - * - * Output: - * none - * - * Returns: - * SUCCESS - ***********************************************************************/ - -static int -kdat_module_init (void) -{ - dat_os_printf ("<1>DAT Registry: Started\n"); - dat_init (); - - return (0); /* success */ -} - -/*********************************************************************** - * cleanup_module - * - * Entry point for a Linux module, cleans up the module on exit - * - * Input: - * none - * - * Output: - * none - * - * Returns: - * void - ***********************************************************************/ -static void -kdat_module_exit (void) -{ - dat_os_printf ("<1>DAT Registry: Stopped\n"); - dat_fini (); - - return; -} - -module_init(kdat_module_init); -module_exit(kdat_module_exit); - - -/* Module exports */ - -EXPORT_SYMBOL_NOVERS (dat_ia_openv); -EXPORT_SYMBOL_NOVERS (dat_ia_close); - -EXPORT_SYMBOL_NOVERS (dat_ia_query); -EXPORT_SYMBOL_NOVERS (dat_set_consumer_context); -EXPORT_SYMBOL_NOVERS (dat_get_consumer_context); -EXPORT_SYMBOL_NOVERS (dat_get_handle_type); -EXPORT_SYMBOL_NOVERS (dat_cr_query); -EXPORT_SYMBOL_NOVERS (dat_cr_accept); -EXPORT_SYMBOL_NOVERS (dat_cr_reject); -EXPORT_SYMBOL_NOVERS (dat_cr_handoff); -EXPORT_SYMBOL_NOVERS (dat_evd_resize); -EXPORT_SYMBOL_NOVERS (dat_evd_post_se); -EXPORT_SYMBOL_NOVERS (dat_evd_dequeue); -EXPORT_SYMBOL_NOVERS (dat_evd_query); -EXPORT_SYMBOL_NOVERS (dat_evd_free); -EXPORT_SYMBOL_NOVERS (dat_ep_create); -EXPORT_SYMBOL_NOVERS (dat_ep_query); -EXPORT_SYMBOL_NOVERS (dat_ep_modify); -EXPORT_SYMBOL_NOVERS (dat_ep_connect); -EXPORT_SYMBOL_NOVERS (dat_ep_dup_connect); -EXPORT_SYMBOL_NOVERS (dat_ep_disconnect); -EXPORT_SYMBOL_NOVERS (dat_ep_post_send); -EXPORT_SYMBOL_NOVERS (dat_ep_post_recv); -EXPORT_SYMBOL_NOVERS (dat_ep_post_rdma_read); -EXPORT_SYMBOL_NOVERS (dat_ep_post_rdma_write); -EXPORT_SYMBOL_NOVERS (dat_ep_get_status); -EXPORT_SYMBOL_NOVERS (dat_ep_free); -EXPORT_SYMBOL_NOVERS (dat_ep_reset); -EXPORT_SYMBOL_NOVERS (dat_ep_create_with_srq); -EXPORT_SYMBOL_NOVERS (dat_ep_recv_query); -EXPORT_SYMBOL_NOVERS (dat_ep_set_watermark); -EXPORT_SYMBOL_NOVERS (dat_lmr_query); -EXPORT_SYMBOL_NOVERS (dat_lmr_free); -EXPORT_SYMBOL_NOVERS (dat_lmr_sync_rdma_read); -EXPORT_SYMBOL_NOVERS (dat_lmr_sync_rdma_write); -EXPORT_SYMBOL_NOVERS (dat_rmr_create); -EXPORT_SYMBOL_NOVERS (dat_rmr_query); -EXPORT_SYMBOL_NOVERS (dat_rmr_bind); -EXPORT_SYMBOL_NOVERS (dat_rmr_free); -EXPORT_SYMBOL_NOVERS (dat_psp_create); -EXPORT_SYMBOL_NOVERS (dat_psp_create_any); -EXPORT_SYMBOL_NOVERS (dat_psp_query); -EXPORT_SYMBOL_NOVERS (dat_psp_free); -EXPORT_SYMBOL_NOVERS (dat_rsp_create); -EXPORT_SYMBOL_NOVERS (dat_rsp_query); -EXPORT_SYMBOL_NOVERS (dat_rsp_free); -EXPORT_SYMBOL_NOVERS (dat_pz_create); -EXPORT_SYMBOL_NOVERS (dat_pz_query); -EXPORT_SYMBOL_NOVERS (dat_pz_free); -EXPORT_SYMBOL_NOVERS (dat_srq_create); -EXPORT_SYMBOL_NOVERS (dat_srq_free); -EXPORT_SYMBOL_NOVERS (dat_srq_post_recv); -EXPORT_SYMBOL_NOVERS (dat_srq_query); -EXPORT_SYMBOL_NOVERS (dat_srq_resize); -EXPORT_SYMBOL_NOVERS (dat_srq_set_lw); - -EXPORT_SYMBOL_NOVERS (dat_lmr_kcreate); -EXPORT_SYMBOL_NOVERS (dat_ia_memtype_hint); -EXPORT_SYMBOL_NOVERS (dat_evd_kcreate); -EXPORT_SYMBOL_NOVERS (dat_evd_modify_upcall); - -EXPORT_SYMBOL_NOVERS (dat_registry_remove_provider); -EXPORT_SYMBOL_NOVERS (dat_registry_add_provider); - -EXPORT_SYMBOL_NOVERS (dat_strerror); - - -/* - * Local variables: - * c-indent-level: 4 - * c-basic-offset: 4 - * tab-width: 8 - * End: - */ diff --git a/dat/kdat/linux/dat_osd.c b/dat/kdat/linux/dat_osd.c deleted file mode 100644 index 0e4b670..0000000 --- a/dat/kdat/linux/dat_osd.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. - * - * This Software is licensed under one of the following licenses: - * - * 1) under the terms of the "Common Public License 1.0" a copy of which is - * in the file LICENSE.txt in the root directory. The license is also - * available from the Open Source Initiative, see - * http://www.opensource.org/licenses/cpl.php. - * - * 2) under the terms of the "The BSD License" a copy of which is in the file - * LICENSE2.txt in the root directory. The license is also available from - * the Open Source Initiative, see - * http://www.opensource.org/licenses/bsd-license.php. - * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is in the file LICENSE3.txt in the root directory. The - * license is also available from the Open Source Initiative, see - * http://www.opensource.org/licenses/gpl-license.php. - * - * Licensee has the right to choose one of the above licenses. - * - * Redistributions of source code must retain the above copyright - * notice and one of the license notices. - * - * Redistributions in binary form must reproduce both the above copyright - * notice, one of the license notices in the documentation - * and/or other materials provided with the distribution. - */ - -/********************************************************************** - * - * MODULE: dat_osd.c - * - * PURPOSE: Operating System Dependent layer - * Description: - * Provide OS dependent functions with a canonical DAT - * interface. Designed to be portable and hide OS specific quirks - * of common functions. - * - * - * $Id: dat_osd.c,v 1.10 2005/03/24 05:58:35 jlentini Exp $ - **********************************************************************/ - -#include -#include - -#include "dat_osd.h" -#include - - -/********************************************************************* - * * - * Constants * - * * - *********************************************************************/ - -#define DAT_DBG_TYPE_ENV "DAT_DBG_TYPE" -#define DAT_DBG_DEST_ENV "DAT_DBG_DEST" - - -/********************************************************************* - * * - * Enumerations * - * * - *********************************************************************/ - -typedef int DAT_OS_DBG_DEST; - -typedef enum -{ - DAT_OS_DBG_DEST_STDOUT = 0x1, - DAT_OS_DBG_DEST_SYSLOG = 0x2, - DAT_OS_DBG_DEST_ALL = 0x3 -} DAT_OS_DBG_DEST_TYPE; - - -/********************************************************************* - * * - * Global Variables * - * * - *********************************************************************/ - -static DAT_OS_DBG_TYPE_VAL g_dbg_type = 0; -static DAT_OS_DBG_DEST g_dbg_dest = DAT_OS_DBG_DEST_STDOUT; - - -/*********************************************************************** - * Function: dat_os_dbg_init - ***********************************************************************/ - -void -dat_os_dbg_init ( void ) -{ - g_dbg_type = dat_os_getenv (DAT_DBG_TYPE_ENV); - g_dbg_dest = dat_os_getenv (DAT_DBG_DEST_ENV); -} - - -/*********************************************************************** - * Function: dat_os_dbg_print - ***********************************************************************/ - -void -dat_os_dbg_print ( - DAT_OS_DBG_TYPE_VAL type, - const char * fmt, - ...) -{ - static char buf[1024]; - - if ( (DAT_OS_DBG_TYPE_ERROR == type) || (type & g_dbg_type) ) - { - va_list args; - - va_start (args, fmt); - - if ( DAT_OS_DBG_DEST_STDOUT & g_dbg_dest ) - { - vsnprintf (buf, sizeof (buf), fmt, args); - printk ("kDAPL: %s", buf); - } - - va_end (args); - } -} - - - -/*********************************************************************** - * Function: dapl_os_get_env_val - ***********************************************************************/ -/* - * dapl_os_get_env_val - * - * Update val to value of passed in environment variable if present - * - * Input: - * env_str - * - * Returns: - * value of environment variable - */ -int -dat_os_getenv ( - char *env_str ) -{ - extern int DbgLvl; /* defined in dapl_module.c */ - int def_val; - - def_val = DAT_OS_DBG_TYPE_ERROR; - - if ( strcmp (env_str, DAT_DBG_TYPE_ENV) == 0 ) - { - if (DbgLvl != 0) - { - def_val = DbgLvl; - } - } - else if ( strcmp (env_str, DAT_DBG_DEST_ENV) == 0 ) - { - ; /* do nothing */ - } - - return def_val; -} - - -/* - * Local variables: - * c-indent-level: 4 - * c-basic-offset: 4 - * tab-width: 8 - * End: - */ diff --git a/dat/kdat/linux/dat_osd.h b/dat/kdat/linux/dat_osd.h deleted file mode 100644 index bbdbf6c..0000000 --- a/dat/kdat/linux/dat_osd.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. - * - * This Software is licensed under one of the following licenses: - * - * 1) under the terms of the "Common Public License 1.0" a copy of which is - * in the file LICENSE.txt in the root directory. The license is also - * available from the Open Source Initiative, see - * http://www.opensource.org/licenses/cpl.php. - * - * 2) under the terms of the "The BSD License" a copy of which is in the file - * LICENSE2.txt in the root directory. The license is also available from - * the Open Source Initiative, see - * http://www.opensource.org/licenses/bsd-license.php. - * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is in the file LICENSE3.txt in the root directory. The - * license is also available from the Open Source Initiative, see - * http://www.opensource.org/licenses/gpl-license.php. - * - * Licensee has the right to choose one of the above licenses. - * - * Redistributions of source code must retain the above copyright - * notice and one of the license notices. - * - * Redistributions in binary form must reproduce both the above copyright - * notice, one of the license notices in the documentation - * and/or other materials provided with the distribution. - */ - -/********************************************************************** - * - * HEADER: dat_osd.h - * - * PURPOSE: Operating System Dependent layer - * Description: - * Provide OS dependent data structures & functions with - * a canonical DAT interface. Designed to be portable - * and hide OS specific quirks of common functions. - * - * $Id: dat_osd.h,v 1.10 2005/03/31 21:52:35 jlentini Exp $ - **********************************************************************/ - -#ifndef _DAT_OSD_H_ -#define _DAT_OSD_H_ - -/* - * This file is defined for Linux systems only, including it on any - * other build will cause an error - */ -#ifndef __linux__ -#error UNDEFINED OS TYPE -#endif /* __linux__ */ - -#ifndef __KERNEL__ -#error "Must compile for the kernel" -#endif /* __KERNEL__ */ - -#ifndef __KDAPL__ -#error "Must compile for KDAPL" -#endif /* __KDAPL__ */ - -/* Useful debug definitions */ -#ifndef STATIC -#define STATIC static -#endif /* STATIC */ -#ifndef INLINE -#define INLINE __inline__ -#endif /* INLINE */ - -#include -#include -#include -#include -#include -#include - - -/********************************************************************* - * * - * Debuging * - * * - *********************************************************************/ - -typedef int DAT_OS_DBG_TYPE_VAL; - -typedef enum -{ - DAT_OS_DBG_TYPE_ERROR = 0x1, - DAT_OS_DBG_TYPE_GENERIC = 0x2, - DAT_OS_DBG_TYPE_SR = 0x4, - DAT_OS_DBG_TYPE_DR = 0x8, - DAT_OS_DBG_TYPE_PROVIDER_API = 0x10, - DAT_OS_DBG_TYPE_CONSUMER_API = 0x20, - DAT_OS_DBG_TYPE_ALL = 0xff -} DAT_OS_DBG_TYPE; - -extern void dat_os_dbg_init ( void ); - -extern void dat_os_dbg_print ( - DAT_OS_DBG_TYPE_VAL type, - const char * fmt, - ...); - -/* - * Debug helper routines in the Linux kernel - */ -#define ASSERT(expr) \ - do { if(!(expr)) { \ - panic( "Assertion failed! %s:%s:%d %s\n", \ - __FILE__, __FUNCTION__, __LINE__, (#expr)); \ - } } while (0) - -#define dat_os_printf printk -#define dat_os_assert ASSERT -#define dat_os_breakpoint breakpoint - - -/********************************************************************* - * * - * Utility Functions * - * * - *********************************************************************/ - -typedef size_t DAT_OS_SIZE; - -#define DAT_ERROR(Type, SubType) ((DAT_RETURN)(DAT_CLASS_ERROR | Type | SubType)) - -int dat_os_getenv (char *env_str); - - -/********************************************************************* - * * - * Lock Functions * - * * - * Simply use spinlocks at this point. * - * * - * N.B. No lock can be taken in both common code and an upcall, * - * which has the possibility of being called in interrupt * - * context. If this is a requirement we need to change * - * from buzz locks (spinlock) to semaphores. * - *********************************************************************/ - -typedef spinlock_t DAT_OS_LOCK; - - -STATIC INLINE DAT_RETURN -dat_os_lock_init ( - IN DAT_OS_LOCK *m) -{ - spin_lock_init ( m ); - - return DAT_SUCCESS; -} - -STATIC INLINE DAT_RETURN -dat_os_lock_destroy ( - IN DAT_OS_LOCK *m) -{ - /* Nothing */ - return DAT_SUCCESS; -} - -STATIC INLINE DAT_RETURN -dat_os_lock ( - IN DAT_OS_LOCK *m) -{ - spin_lock (m); /* down(mutex); */ - return DAT_SUCCESS; -} - -STATIC INLINE DAT_RETURN -dat_os_unlock ( - IN DAT_OS_LOCK *m) -{ - spin_unlock (m); /* up(mutex); */ - return DAT_SUCCESS; -} - - -/********************************************************************* - * * - * Memory Functions * - * * - * Some memory functions are already inlined by the compiler, so we * - * use simple #defines to avoid confusing double inlines * - *********************************************************************/ -#define dat_os_alloc(size) kmalloc(size, GFP_ATOMIC) -#define dat_os_free(ptr, size) kfree(ptr) -#define dat_os_memset(loc, c, size) memset(loc, c, size) -#define dat_os_strlen(s) strlen(s) -#define dat_os_strncmp(s1, s2, n) strncmp(s1, s2, n) -#define dat_os_strncpy(dest, src, len) strncpy(dest, src, len) - - -#endif /* _DAT_OSD_H_ */ -- 2.46.0