CAN Device Driver Internals | ||
---|---|---|
<<< Previous | Next >>> |
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; }; |
text string with board type
board index in canhardware_t.candevice[]
IO/physical MEM address
optional reset register port
CPU translated IO/virtual MEM address
board flags: PROGRAMMABLE_IRQ .. interrupt number can be programmed into board
number of chips present on the board
number of Intel 8257 chips
number of Philips SJA100 chips
array of pointers to the chip structures
pointer to board specific operations
pointer to the root hardware structure
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.
<<< Previous | Home | Next >>> |
struct canhardware_t | Up | struct chip_t |