template_request_io

Name

template_request_io --  reserve io or memory range for can board

Synopsis

int template_request_io (struct candevice_t * candev);

Arguments

candev

pointer to candevice/board which asks for io. Field io_addr of candev is used in most cases to define start of the range

Description

The function template_request_io is used to reserve the io-memory. If your hardware uses a dedicated memory range as hardware control registers you will have to add the code to reserve this memory as well. IO_RANGE is the io-memory range that gets reserved, please adjust according your hardware. Example: #define IO_RANGE 0x100 for i82527 chips or #define IO_RANGE 0x20 for sja1000 chips in basic CAN mode.

Return Value

The function returns zero on success or -ENODEV on failure

File

src/template.c