vmod/vmodttl: fixed bug related to luns not ordered and/or not starting from zero.
[ht-drivers.git] / vmod / driver / modulbus_register.h
blob8caeb20ecc60a2bfbdedd231aaa5cff813738364
1 #ifndef _CARRIER_H_
2 #define _CARRIER_H_
4 /**
5 * @brief definition of an address space as provided by the
6 * carrier driver
7 */
8 struct carrier_as {
9 unsigned long address;
10 int width;
11 int size;
12 int is_big_endian;
16 /* @brief type of a mezzanine isr */
17 typedef int (*isrcb_t)(
18 void *device_id,
19 void* extra);
21 /* @brief type of a get_address_space entry point */
22 typedef int (*gas_t)(
23 struct carrier_as *as,
24 int board_number,
25 int board_position,
26 int address_space_number);
28 /* @brief type of a register_isr entry point */
29 typedef int (*risr_t)(
30 isrcb_t callback,
31 void *dev,
32 int board_number,
33 int board_position);
37 /** @brief register a carrier's entry points in the carrier
38 * register module
39 * @param carrier_type official name of the driver
40 * @param get_address_space its gas_t entry point
41 * @param register_isr its risr_t entry point
43 * @return 0 on success
44 * @return <0 on failure
46 int modulbus_carrier_register(
47 char *carrier_type,
48 gas_t get_address_space,
49 risr_t register_isr);
51 /** @brief unregister a carrier from the entry point list
53 * @param name official name of the driver
55 * @return 0 on success
56 * @return <0 on failure
59 int modulbus_carrier_unregister(char *name);
61 /** @brief get a carrier's entry point for getting address spaces
62 * @param - official name of the carrier driver
64 * @return - a valid pointer to the entry point
65 * @return - NULL on failure
67 gas_t modulbus_carrier_as_entry(char *carrier);
69 /** @brief get a carrier's entry point for registering ISR callbacks
70 * @param - official name of the carrier driver
72 * @return - a valid pointer to the entry point
73 * @return - NULL on failure
75 risr_t modulbus_carrier_isr_entry(char *carrier);
77 #endif /*_CARRIER_H_ */