Lines Matching refs:wdata
194 struct wiimote_data *wdata);
196 struct wiimote_data *wdata);
198 void (*in_keys) (struct wiimote_data *wdata, const __u8 *keys);
199 void (*in_accel) (struct wiimote_data *wdata, const __u8 *accel);
200 void (*in_ir) (struct wiimote_data *wdata, const __u8 *ir, bool packed,
202 void (*in_mp) (struct wiimote_data *wdata, const __u8 *mp);
203 void (*in_ext) (struct wiimote_data *wdata, const __u8 *ext);
264 void __wiimote_schedule(struct wiimote_data *wdata);
266 extern void wiiproto_req_drm(struct wiimote_data *wdata, __u8 drm);
267 extern void wiiproto_req_rumble(struct wiimote_data *wdata, __u8 rumble);
268 extern void wiiproto_req_leds(struct wiimote_data *wdata, int leds);
269 extern void wiiproto_req_status(struct wiimote_data *wdata);
270 extern void wiiproto_req_accel(struct wiimote_data *wdata, __u8 accel);
271 extern void wiiproto_req_ir1(struct wiimote_data *wdata, __u8 flags);
272 extern void wiiproto_req_ir2(struct wiimote_data *wdata, __u8 flags);
273 extern int wiimote_cmd_write(struct wiimote_data *wdata, __u32 offset,
275 extern ssize_t wiimote_cmd_read(struct wiimote_data *wdata, __u32 offset,
278 #define wiiproto_req_rreg(wdata, os, sz) \ argument
279 wiiproto_req_rmem((wdata), false, (os), (sz))
280 #define wiiproto_req_reeprom(wdata, os, sz) \ argument
281 wiiproto_req_rmem((wdata), true, (os), (sz))
282 extern void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom,
287 extern int wiidebug_init(struct wiimote_data *wdata);
288 extern void wiidebug_deinit(struct wiimote_data *wdata);
298 static inline bool wiimote_cmd_pending(struct wiimote_data *wdata, int cmd, in wiimote_cmd_pending() argument
301 return wdata->state.cmd == cmd && wdata->state.opt == opt; in wiimote_cmd_pending()
305 static inline void wiimote_cmd_complete(struct wiimote_data *wdata) in wiimote_cmd_complete() argument
307 wdata->state.cmd = WIIPROTO_REQ_NULL; in wiimote_cmd_complete()
308 complete(&wdata->state.ready); in wiimote_cmd_complete()
312 static inline void wiimote_cmd_abort(struct wiimote_data *wdata) in wiimote_cmd_abort() argument
317 wdata->state.cmd = WIIPROTO_REQ_MAX; in wiimote_cmd_abort()
318 complete(&wdata->state.ready); in wiimote_cmd_abort()
321 static inline int wiimote_cmd_acquire(struct wiimote_data *wdata) in wiimote_cmd_acquire() argument
323 return mutex_lock_interruptible(&wdata->state.sync) ? -ERESTARTSYS : 0; in wiimote_cmd_acquire()
326 static inline void wiimote_cmd_acquire_noint(struct wiimote_data *wdata) in wiimote_cmd_acquire_noint() argument
328 mutex_lock(&wdata->state.sync); in wiimote_cmd_acquire_noint()
332 static inline void wiimote_cmd_set(struct wiimote_data *wdata, int cmd, in wiimote_cmd_set() argument
335 reinit_completion(&wdata->state.ready); in wiimote_cmd_set()
336 wdata->state.cmd = cmd; in wiimote_cmd_set()
337 wdata->state.opt = opt; in wiimote_cmd_set()
340 static inline void wiimote_cmd_release(struct wiimote_data *wdata) in wiimote_cmd_release() argument
342 mutex_unlock(&wdata->state.sync); in wiimote_cmd_release()
345 static inline int wiimote_cmd_wait(struct wiimote_data *wdata) in wiimote_cmd_wait() argument
353 ret = wait_for_completion_interruptible_timeout(&wdata->state.ready, HZ); in wiimote_cmd_wait()
358 else if (wdata->state.cmd != WIIPROTO_REQ_NULL) in wiimote_cmd_wait()
364 static inline int wiimote_cmd_wait_noint(struct wiimote_data *wdata) in wiimote_cmd_wait_noint() argument
369 ret = wait_for_completion_timeout(&wdata->state.ready, HZ); in wiimote_cmd_wait_noint()
372 else if (wdata->state.cmd != WIIPROTO_REQ_NULL) in wiimote_cmd_wait_noint()