Lines Matching refs:wdata

193 		      struct wiimote_data *wdata);
195 struct wiimote_data *wdata);
197 void (*in_keys) (struct wiimote_data *wdata, const __u8 *keys);
198 void (*in_accel) (struct wiimote_data *wdata, const __u8 *accel);
199 void (*in_ir) (struct wiimote_data *wdata, const __u8 *ir, bool packed,
201 void (*in_mp) (struct wiimote_data *wdata, const __u8 *mp);
202 void (*in_ext) (struct wiimote_data *wdata, const __u8 *ext);
263 void __wiimote_schedule(struct wiimote_data *wdata);
265 extern void wiiproto_req_drm(struct wiimote_data *wdata, __u8 drm);
266 extern void wiiproto_req_rumble(struct wiimote_data *wdata, __u8 rumble);
267 extern void wiiproto_req_leds(struct wiimote_data *wdata, int leds);
268 extern void wiiproto_req_status(struct wiimote_data *wdata);
269 extern void wiiproto_req_accel(struct wiimote_data *wdata, __u8 accel);
270 extern void wiiproto_req_ir1(struct wiimote_data *wdata, __u8 flags);
271 extern void wiiproto_req_ir2(struct wiimote_data *wdata, __u8 flags);
272 extern int wiimote_cmd_write(struct wiimote_data *wdata, __u32 offset,
274 extern ssize_t wiimote_cmd_read(struct wiimote_data *wdata, __u32 offset,
277 #define wiiproto_req_rreg(wdata, os, sz) \ argument
278 wiiproto_req_rmem((wdata), false, (os), (sz))
279 #define wiiproto_req_reeprom(wdata, os, sz) \ argument
280 wiiproto_req_rmem((wdata), true, (os), (sz))
281 extern void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom,
286 extern int wiidebug_init(struct wiimote_data *wdata);
287 extern void wiidebug_deinit(struct wiimote_data *wdata);
297 static inline bool wiimote_cmd_pending(struct wiimote_data *wdata, int cmd, in wiimote_cmd_pending() argument
300 return wdata->state.cmd == cmd && wdata->state.opt == opt; in wiimote_cmd_pending()
304 static inline void wiimote_cmd_complete(struct wiimote_data *wdata) in wiimote_cmd_complete() argument
306 wdata->state.cmd = WIIPROTO_REQ_NULL; in wiimote_cmd_complete()
307 complete(&wdata->state.ready); in wiimote_cmd_complete()
311 static inline void wiimote_cmd_abort(struct wiimote_data *wdata) in wiimote_cmd_abort() argument
316 wdata->state.cmd = WIIPROTO_REQ_MAX; in wiimote_cmd_abort()
317 complete(&wdata->state.ready); in wiimote_cmd_abort()
320 static inline int wiimote_cmd_acquire(struct wiimote_data *wdata) in wiimote_cmd_acquire() argument
322 return mutex_lock_interruptible(&wdata->state.sync) ? -ERESTARTSYS : 0; in wiimote_cmd_acquire()
325 static inline void wiimote_cmd_acquire_noint(struct wiimote_data *wdata) in wiimote_cmd_acquire_noint() argument
327 mutex_lock(&wdata->state.sync); in wiimote_cmd_acquire_noint()
331 static inline void wiimote_cmd_set(struct wiimote_data *wdata, int cmd, in wiimote_cmd_set() argument
334 reinit_completion(&wdata->state.ready); in wiimote_cmd_set()
335 wdata->state.cmd = cmd; in wiimote_cmd_set()
336 wdata->state.opt = opt; in wiimote_cmd_set()
339 static inline void wiimote_cmd_release(struct wiimote_data *wdata) in wiimote_cmd_release() argument
341 mutex_unlock(&wdata->state.sync); in wiimote_cmd_release()
344 static inline int wiimote_cmd_wait(struct wiimote_data *wdata) in wiimote_cmd_wait() argument
352 ret = wait_for_completion_interruptible_timeout(&wdata->state.ready, HZ); in wiimote_cmd_wait()
357 else if (wdata->state.cmd != WIIPROTO_REQ_NULL) in wiimote_cmd_wait()
363 static inline int wiimote_cmd_wait_noint(struct wiimote_data *wdata) in wiimote_cmd_wait_noint() argument
368 ret = wait_for_completion_timeout(&wdata->state.ready, HZ); in wiimote_cmd_wait_noint()
371 else if (wdata->state.cmd != WIIPROTO_REQ_NULL) in wiimote_cmd_wait_noint()