struct candevice_t

Name

struct candevice_t --  CAN device/board structure

Synopsis

struct candevice_t {
  char * hwname;
  int candev_idx;
  unsigned long io_addr;
  unsigned long res_addr;
  unsigned long dev_base_addr;
  unsigned int flags;
  int nr_all_chips;
  int nr_82527_chips;
  int nr_sja1000_chips;
  struct chip_t * * chip;
  struct hwspecops_t * hwspecops;
  struct canhardware_t * hosthardware_p;
};  

Members

hwname

text string with board type

candev_idx

board index in canhardware_t.candevice[]

io_addr

IO/physical MEM address

res_addr

optional reset register port

dev_base_addr

CPU translated IO/virtual MEM address

flags

board flags: PROGRAMMABLE_IRQ .. interrupt number can be programmed into board

nr_all_chips

number of chips present on the board

nr_82527_chips

number of Intel 8257 chips

nr_sja1000_chips

number of Philips SJA100 chips

chip

array of pointers to the chip structures

hwspecops

pointer to board specific operations

hosthardware_p

pointer to the root hardware structure

Description

The structure represent configuration and state of associated board. The driver infrastructure prepares this structure and calls board type specific board_register function. The board support provided register function fills right function pointers in hwspecops structure. Then driver setup calls functions init_hw_data, init_chip_data, init_chip_data, init_obj_data and program_irq. Function init_hw_data and init_chip_data have to specify number and types of connected chips or objects respectively. The use of nr_all_chips is preferred over use of fields nr_82527_chips and nr_sja1000_chips in the board non-specific functions. The io_addr and dev_base_addr is filled from module parameters to the same value. The request_io function can fix-up dev_base_addr field if virtual address is different than bus address.