Lines Matching refs:command_info
218 struct whiteheat_command_private *command_info;
283 command_info = kmalloc(sizeof(struct whiteheat_command_private),
285 if (!command_info)
288 mutex_init(&command_info->mutex);
289 command_info->port_running = 0;
290 init_waitqueue_head(&command_info->wait_command);
291 usb_set_serial_port_data(command_port, command_info);
477 struct whiteheat_command_private *command_info;
482 command_info = usb_get_serial_port_data(command_port);
483 if (!command_info) {
484 dev_dbg(&urb->dev->dev, "%s - command_info is NULL, exiting.\n", __func__);
494 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
495 wake_up(&command_info->wait_command);
502 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
503 wake_up(&command_info->wait_command);
505 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
506 wake_up(&command_info->wait_command);
512 (urb->actual_length - 1 <= sizeof(command_info->result_buffer))) {
513 memcpy(command_info->result_buffer, &data[1],
515 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
516 wake_up(&command_info->wait_command);
535 struct whiteheat_command_private *command_info;
545 command_info = usb_get_serial_port_data(command_port);
550 mutex_lock(&command_info->mutex);
551 command_info->command_finished = false;
564 t = wait_event_timeout(command_info->wait_command,
565 (bool)command_info->command_finished, COMMAND_TIMEOUT);
569 if (command_info->command_finished == false) {
575 if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) {
581 if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) {
586 info->mcr = command_info->result_buffer[0];
591 mutex_unlock(&command_info->mutex);
762 struct whiteheat_command_private *command_info;
766 command_info = usb_get_serial_port_data(command_port);
767 mutex_lock(&command_info->mutex);
768 if (!command_info->port_running) {
780 command_info->port_running++;
783 mutex_unlock(&command_info->mutex);
791 struct whiteheat_command_private *command_info;
794 command_info = usb_get_serial_port_data(command_port);
795 mutex_lock(&command_info->mutex);
796 command_info->port_running--;
797 if (!command_info->port_running)
799 mutex_unlock(&command_info->mutex);