Main Page   Data Structures   File List   Data Fields   Globals  

can_open.c File Reference

More...


Functions

int can_open (__LDDK_OPEN_PARAM)
 int open(const char *pathname, int flags); opens the CAN device for following operations. More...


Variables

int Can_isopen [4] = { 0, 0, 0, 0}


Detailed Description

Author(s):
Heinz-Jürgen Oertel, port GmbH
Revision:
1.3
Date:
2001/09/04 15:51:44


Function Documentation

int can_open ( __LDDK_OPEN_PARAM )
 

int open(const char *pathname, int flags); opens the CAN device for following operations.

Parameters:
pathname   device pathname, usual /dev/can?
flags   is one of O_RDONLY, O_WRONLY or O_RDWR which request opening the file read-only, write-only or read/write, respectively.

The open call is used to "open" the device. Doing a first initialization according the to values in the /proc/sys/Can file system. Additional an ISR function is assigned to the IRQ.

The CLK OUT pin is configured for creating the same frequency like the chips input frequency fclk (XTAL).

Returns:
open return the new file descriptor, or -1 if an error occurred (in which case, errno is set appropriately).
ERRORS
the following errors can occur
  • ENXIO the file is a device special file and no corresponding device exists.
  • EINVAL illegal minor device number
  • EINVAL wrong IO-model format in /proc/sys/Can/IOmodel
  • EBUSY IRQ for hardware is not available
  • EBUSY I/O region for hardware is not available


Generated at Fre Sep 14 16:40:18 CEST 2001 CAN driver can4linux by port GmbH service@port.de , © 1997-2001