diff options
Diffstat (limited to 'include/net/caif/caif_hsi.h')
-rw-r--r-- | include/net/caif/caif_hsi.h | 71 |
1 files changed, 48 insertions, 23 deletions
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index 439dadc8102f..bcb9cc3ce98b 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
@@ -93,25 +93,25 @@ struct cfhsi_desc { | |||
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | /* Structure implemented by the CAIF HSI driver. */ | 95 | /* Structure implemented by the CAIF HSI driver. */ |
96 | struct cfhsi_drv { | 96 | struct cfhsi_cb_ops { |
97 | void (*tx_done_cb) (struct cfhsi_drv *drv); | 97 | void (*tx_done_cb) (struct cfhsi_cb_ops *drv); |
98 | void (*rx_done_cb) (struct cfhsi_drv *drv); | 98 | void (*rx_done_cb) (struct cfhsi_cb_ops *drv); |
99 | void (*wake_up_cb) (struct cfhsi_drv *drv); | 99 | void (*wake_up_cb) (struct cfhsi_cb_ops *drv); |
100 | void (*wake_down_cb) (struct cfhsi_drv *drv); | 100 | void (*wake_down_cb) (struct cfhsi_cb_ops *drv); |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /* Structure implemented by HSI device. */ | 103 | /* Structure implemented by HSI device. */ |
104 | struct cfhsi_dev { | 104 | struct cfhsi_ops { |
105 | int (*cfhsi_up) (struct cfhsi_dev *dev); | 105 | int (*cfhsi_up) (struct cfhsi_ops *dev); |
106 | int (*cfhsi_down) (struct cfhsi_dev *dev); | 106 | int (*cfhsi_down) (struct cfhsi_ops *dev); |
107 | int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 107 | int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_ops *dev); |
108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_ops *dev); |
109 | int (*cfhsi_wake_up) (struct cfhsi_dev *dev); | 109 | int (*cfhsi_wake_up) (struct cfhsi_ops *dev); |
110 | int (*cfhsi_wake_down) (struct cfhsi_dev *dev); | 110 | int (*cfhsi_wake_down) (struct cfhsi_ops *dev); |
111 | int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status); | 111 | int (*cfhsi_get_peer_wake) (struct cfhsi_ops *dev, bool *status); |
112 | int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); | 112 | int (*cfhsi_fifo_occupancy) (struct cfhsi_ops *dev, size_t *occupancy); |
113 | int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); | 113 | int (*cfhsi_rx_cancel)(struct cfhsi_ops *dev); |
114 | struct cfhsi_drv *drv; | 114 | struct cfhsi_cb_ops *cb_ops; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | /* Structure holds status of received CAIF frames processing */ | 117 | /* Structure holds status of received CAIF frames processing */ |
@@ -132,17 +132,26 @@ enum { | |||
132 | CFHSI_PRIO_LAST, | 132 | CFHSI_PRIO_LAST, |
133 | }; | 133 | }; |
134 | 134 | ||
135 | struct cfhsi_config { | ||
136 | u32 inactivity_timeout; | ||
137 | u32 aggregation_timeout; | ||
138 | u32 head_align; | ||
139 | u32 tail_align; | ||
140 | u32 q_high_mark; | ||
141 | u32 q_low_mark; | ||
142 | }; | ||
143 | |||
135 | /* Structure implemented by CAIF HSI drivers. */ | 144 | /* Structure implemented by CAIF HSI drivers. */ |
136 | struct cfhsi { | 145 | struct cfhsi { |
137 | struct caif_dev_common cfdev; | 146 | struct caif_dev_common cfdev; |
138 | struct net_device *ndev; | 147 | struct net_device *ndev; |
139 | struct platform_device *pdev; | 148 | struct platform_device *pdev; |
140 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; | 149 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; |
141 | struct cfhsi_drv drv; | 150 | struct cfhsi_cb_ops cb_ops; |
142 | struct cfhsi_dev *dev; | 151 | struct cfhsi_ops *ops; |
143 | int tx_state; | 152 | int tx_state; |
144 | struct cfhsi_rx_state rx_state; | 153 | struct cfhsi_rx_state rx_state; |
145 | unsigned long inactivity_timeout; | 154 | struct cfhsi_config cfg; |
146 | int rx_len; | 155 | int rx_len; |
147 | u8 *rx_ptr; | 156 | u8 *rx_ptr; |
148 | u8 *tx_buf; | 157 | u8 *tx_buf; |
@@ -150,8 +159,6 @@ struct cfhsi { | |||
150 | u8 *rx_flip_buf; | 159 | u8 *rx_flip_buf; |
151 | spinlock_t lock; | 160 | spinlock_t lock; |
152 | int flow_off_sent; | 161 | int flow_off_sent; |
153 | u32 q_low_mark; | ||
154 | u32 q_high_mark; | ||
155 | struct list_head list; | 162 | struct list_head list; |
156 | struct work_struct wake_up_work; | 163 | struct work_struct wake_up_work; |
157 | struct work_struct wake_down_work; | 164 | struct work_struct wake_down_work; |
@@ -164,13 +171,31 @@ struct cfhsi { | |||
164 | struct timer_list rx_slowpath_timer; | 171 | struct timer_list rx_slowpath_timer; |
165 | 172 | ||
166 | /* TX aggregation */ | 173 | /* TX aggregation */ |
167 | unsigned long aggregation_timeout; | ||
168 | int aggregation_len; | 174 | int aggregation_len; |
169 | struct timer_list aggregation_timer; | 175 | struct timer_list aggregation_timer; |
170 | 176 | ||
171 | unsigned long bits; | 177 | unsigned long bits; |
172 | }; | 178 | }; |
173 | |||
174 | extern struct platform_driver cfhsi_driver; | 179 | extern struct platform_driver cfhsi_driver; |
175 | 180 | ||
181 | /** | ||
182 | * enum ifla_caif_hsi - CAIF HSI NetlinkRT parameters. | ||
183 | * @IFLA_CAIF_HSI_INACTIVITY_TOUT: Inactivity timeout before | ||
184 | * taking the HSI wakeline down, in milliseconds. | ||
185 | * When using RT Netlink to create, destroy or configure a CAIF HSI interface, | ||
186 | * enum ifla_caif_hsi is used to specify the configuration attributes. | ||
187 | */ | ||
188 | enum ifla_caif_hsi { | ||
189 | __IFLA_CAIF_HSI_UNSPEC, | ||
190 | __IFLA_CAIF_HSI_INACTIVITY_TOUT, | ||
191 | __IFLA_CAIF_HSI_AGGREGATION_TOUT, | ||
192 | __IFLA_CAIF_HSI_HEAD_ALIGN, | ||
193 | __IFLA_CAIF_HSI_TAIL_ALIGN, | ||
194 | __IFLA_CAIF_HSI_QHIGH_WATERMARK, | ||
195 | __IFLA_CAIF_HSI_QLOW_WATERMARK, | ||
196 | __IFLA_CAIF_HSI_MAX | ||
197 | }; | ||
198 | |||
199 | extern struct cfhsi_ops *cfhsi_get_ops(void); | ||
200 | |||
176 | #endif /* CAIF_HSI_H_ */ | 201 | #endif /* CAIF_HSI_H_ */ |