Lines Matching refs:command_info
222 struct whiteheat_command_private *command_info;
287 command_info = kmalloc(sizeof(struct whiteheat_command_private),
289 if (!command_info)
292 mutex_init(&command_info->mutex);
293 command_info->port_running = 0;
294 init_waitqueue_head(&command_info->wait_command);
295 usb_set_serial_port_data(command_port, command_info);
493 struct whiteheat_command_private *command_info;
498 command_info = usb_get_serial_port_data(command_port);
499 if (!command_info) {
500 dev_dbg(&urb->dev->dev, "%s - command_info is NULL, exiting.\n", __func__);
510 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
511 wake_up(&command_info->wait_command);
518 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
519 wake_up(&command_info->wait_command);
521 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
522 wake_up(&command_info->wait_command);
528 (urb->actual_length - 1 <= sizeof(command_info->result_buffer))) {
529 memcpy(command_info->result_buffer, &data[1],
531 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
532 wake_up(&command_info->wait_command);
551 struct whiteheat_command_private *command_info;
561 command_info = usb_get_serial_port_data(command_port);
566 mutex_lock(&command_info->mutex);
567 command_info->command_finished = false;
580 t = wait_event_timeout(command_info->wait_command,
581 (bool)command_info->command_finished, COMMAND_TIMEOUT);
585 if (command_info->command_finished == false) {
591 if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) {
597 if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) {
602 info->mcr = command_info->result_buffer[0];
607 mutex_unlock(&command_info->mutex);
785 struct whiteheat_command_private *command_info;
789 command_info = usb_get_serial_port_data(command_port);
790 mutex_lock(&command_info->mutex);
791 if (!command_info->port_running) {
803 command_info->port_running++;
806 mutex_unlock(&command_info->mutex);
814 struct whiteheat_command_private *command_info;
817 command_info = usb_get_serial_port_data(command_port);
818 mutex_lock(&command_info->mutex);
819 command_info->port_running--;
820 if (!command_info->port_running)
822 mutex_unlock(&command_info->mutex);