 /* @file api.h
  * 
  * @brief Mainly this header should contains definition of ioctl handler. 
  * 
  * 
  * 
  */

/** @par LICENCE
 * 
 *  @verbatim
  Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module.
  
         ADDI-DATA GmbH
         Dieselstrasse 3
         D-77833 Ottersweier
         Tel: +19(0)7223/9493-0
         Fax: +49(0)7223/9493-92
         http://www.addi-data-com
         info@addi-data.com
 
 This library is free software; you can redistribute it and/or modify it under 
 the terms of the GNU Lesser General Public License as published by the 
 Free Software Foundation; either version 2.1 of the License, 
 or (at your option) any later version.
 
 This library 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 Lesser General Public License for more details.
 
 You should have received a copy of the GNU Lesser General Public License 
 along with this library; if not, write to the Free Software Foundation, 
 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 
 You also shoud find the complete LGPL in the LGPL.txt file accompanying 
 this source code.
 
 @endverbatim
**/

#ifndef __apci3701_API_H_
#define __apci3701_API_H_

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
	#define __user 
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
	#define __iomem
#endif

//------------------------------------------------------------------------------

/** Execute a command.
*
* @param pdev Pointer to a device.
* @param cmd Command to execute
* @param arg Argument of the command.
*/
extern int 
apci3701_do_ioctl(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------
/* deprecated */
int do_CMD_apci3701_CheckAndGetPCISlotNumber(struct pci_dev * pdev,unsigned int cmd, unsigned long arg);
int do_CMD_apci3701_GetHardwareInformation(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------
int do_CMD_apci3701_SetBoardInformation(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_enable_disable_primary_short_circuit_interrupt(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_enable_disable_primary_open_circuit_test(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_ream_primary_open_short_circuit_test(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_enable_disable_secondary_short_circuit_test(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_enable_disable_secondary_open_circuit_test(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_read_one_analog_input(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_initialize_transducer(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_test_channel_secondary_line_open_circuit(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_test_channel_secondary_line_short_circuit(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

int do_CMD_apci3701_test_primary_line(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);


//------------------------------------------------------------------------------
// Event Related
int do_CMD_apci3701_EventEmpty(struct pci_dev* pdev, unsigned int cmd, unsigned long arg);
int do_CMD_apci3701_EventWait(struct pci_dev* pdev, unsigned int cmd, unsigned long arg);
//------------------------------------------------------------------------------


//------------------------------------------------------------------------------
int i_APCI3701_GetBoardEeprom (struct pci_dev *pdev);
//------------------------------------------------------------------------------

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
	#undef __user
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  #undef __iomem
#endif

#endif // __apci3701_API_H_

