Lines Matching defs:state
161 struct wiimote_state state;
296 /* requires the state.lock spinlock to be held */
300 return wdata->state.cmd == cmd && wdata->state.opt == opt;
303 /* requires the state.lock spinlock to be held */
306 wdata->state.cmd = WIIPROTO_REQ_NULL;
307 complete(&wdata->state.ready);
310 /* requires the state.lock spinlock to be held */
314 * reset the state.cmd field to an invalid value so no further event
316 wdata->state.cmd = WIIPROTO_REQ_MAX;
317 complete(&wdata->state.ready);
322 return mutex_lock_interruptible(&wdata->state.sync) ? -ERESTARTSYS : 0;
327 mutex_lock(&wdata->state.sync);
330 /* requires the state.lock spinlock to be held */
334 reinit_completion(&wdata->state.ready);
335 wdata->state.cmd = cmd;
336 wdata->state.opt = opt;
341 mutex_unlock(&wdata->state.sync);
349 * assume that state.cmd is set on success/failure and isn't accessed
352 ret = wait_for_completion_interruptible_timeout(&wdata->state.ready, HZ);
357 else if (wdata->state.cmd != WIIPROTO_REQ_NULL)
368 ret = wait_for_completion_timeout(&wdata->state.ready, HZ);
371 else if (wdata->state.cmd != WIIPROTO_REQ_NULL)