56 |
56 |
57 struct ec_device; |
57 struct ec_device; |
58 typedef struct ec_device ec_device_t; /**< \see ec_device */ |
58 typedef struct ec_device ec_device_t; /**< \see ec_device */ |
59 |
59 |
60 /** |
60 /** |
61 Interrupt-Service-Routine Type |
61 Device poll function type. |
62 */ |
62 */ |
63 |
63 |
64 typedef irqreturn_t (*ec_isr_t)(int, void *, struct pt_regs *); |
64 typedef void (*ec_pollfunc_t)(struct net_device *); |
65 |
65 |
66 /*****************************************************************************/ |
66 /*****************************************************************************/ |
67 // Registration functions |
67 // Registration functions |
68 |
68 |
69 ec_device_t *ecdev_register(unsigned int master_index, |
69 ec_device_t *ecdev_register(unsigned int master_index, |
70 struct net_device *net_dev, ec_isr_t isr, |
70 struct net_device *net_dev, ec_pollfunc_t poll, |
71 struct module *module); |
71 struct module *module); |
72 void ecdev_unregister(unsigned int master_index, ec_device_t *device); |
72 void ecdev_unregister(unsigned int master_index, ec_device_t *device); |
73 |
|
74 int ecdev_start(unsigned int master_index); |
|
75 void ecdev_stop(unsigned int master_index); |
|
76 |
73 |
77 /*****************************************************************************/ |
74 /*****************************************************************************/ |
78 // Device methods |
75 // Device methods |
79 |
76 |
|
77 int ecdev_open(ec_device_t *device); |
|
78 void ecdev_close(ec_device_t *device); |
80 void ecdev_receive(ec_device_t *device, const void *data, size_t size); |
79 void ecdev_receive(ec_device_t *device, const void *data, size_t size); |
81 void ecdev_link_state(ec_device_t *device, uint8_t newstate); |
80 void ecdev_link_state(ec_device_t *device, uint8_t newstate); |
82 |
81 |
83 /*****************************************************************************/ |
82 /*****************************************************************************/ |
84 |
83 |