Lines Matching refs:state
162 struct wiimote_state state;
297 /* requires the state.lock spinlock to be held */
301 return wdata->state.cmd == cmd && wdata->state.opt == opt;
304 /* requires the state.lock spinlock to be held */
307 wdata->state.cmd = WIIPROTO_REQ_NULL;
308 complete(&wdata->state.ready);
311 /* requires the state.lock spinlock to be held */
315 * reset the state.cmd field to an invalid value so no further event
317 wdata->state.cmd = WIIPROTO_REQ_MAX;
318 complete(&wdata->state.ready);
323 return mutex_lock_interruptible(&wdata->state.sync) ? -ERESTARTSYS : 0;
328 mutex_lock(&wdata->state.sync);
331 /* requires the state.lock spinlock to be held */
335 reinit_completion(&wdata->state.ready);
336 wdata->state.cmd = cmd;
337 wdata->state.opt = opt;
342 mutex_unlock(&wdata->state.sync);
350 * assume that state.cmd is set on success/failure and isn't accessed
353 ret = wait_for_completion_interruptible_timeout(&wdata->state.ready, HZ);
358 else if (wdata->state.cmd != WIIPROTO_REQ_NULL)
369 ret = wait_for_completion_timeout(&wdata->state.ready, HZ);
372 else if (wdata->state.cmd != WIIPROTO_REQ_NULL)