1 // SPDX-License-Identifier: GPL-2.0+
3 * USB ConnectTech WhiteHEAT driver
8 * Copyright (C) 1999 - 2001
11 * See Documentation/usb/usb-serial.rst for more information on using this
15 #include <linux/kernel.h>
16 #include <linux/errno.h>
17 #include <linux/slab.h>
18 #include <linux/tty.h>
19 #include <linux/tty_driver.h>
20 #include <linux/tty_flip.h>
21 #include <linux/module.h>
22 #include <linux/spinlock.h>
23 #include <linux/mutex.h>
24 #include <linux/uaccess.h>
25 #include <asm/termbits.h>
26 #include <linux/usb.h>
27 #include <linux/serial_reg.h>
28 #include <linux/serial.h>
29 #include <linux/usb/serial.h>
30 #include <linux/usb/ezusb.h>
31 #include "whiteheat.h" /* WhiteHEAT specific commands */
37 #define DRIVER_DESC "USB ConnectTech WhiteHEAT driver"
39 #define CONNECT_TECH_VENDOR_ID 0x0710
40 #define CONNECT_TECH_FAKE_WHITE_HEAT_ID 0x0001
41 #define CONNECT_TECH_WHITE_HEAT_ID 0x8001
44 ID tables for whiteheat are unusual, because we want to different
45 things for different versions of the device. Eventually, this
46 will be doable from a single table. But, for now, we define two
47 separate ID tables, and then a third table that combines them
48 just for the purpose of exporting the autoloading information.
50 static const struct usb_device_id id_table_std[] = {
51 { USB_DEVICE(CONNECT_TECH_VENDOR_ID, CONNECT_TECH_WHITE_HEAT_ID) },
52 { } /* Terminating entry */
55 static const struct usb_device_id id_table_prerenumeration[] = {
56 { USB_DEVICE(CONNECT_TECH_VENDOR_ID, CONNECT_TECH_FAKE_WHITE_HEAT_ID) },
57 { } /* Terminating entry */
60 static const struct usb_device_id id_table_combined[] = {
61 { USB_DEVICE(CONNECT_TECH_VENDOR_ID, CONNECT_TECH_WHITE_HEAT_ID) },
62 { USB_DEVICE(CONNECT_TECH_VENDOR_ID, CONNECT_TECH_FAKE_WHITE_HEAT_ID) },
63 { } /* Terminating entry */
66 MODULE_DEVICE_TABLE(usb, id_table_combined);
69 /* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */
70 static int whiteheat_firmware_download(struct usb_serial *serial,
71 const struct usb_device_id *id);
72 static int whiteheat_firmware_attach(struct usb_serial *serial);
74 /* function prototypes for the Connect Tech WhiteHEAT serial converter */
75 static int whiteheat_attach(struct usb_serial *serial);
76 static void whiteheat_release(struct usb_serial *serial);
77 static int whiteheat_port_probe(struct usb_serial_port *port);
78 static void whiteheat_port_remove(struct usb_serial_port *port);
79 static int whiteheat_open(struct tty_struct *tty,
80 struct usb_serial_port *port);
81 static void whiteheat_close(struct usb_serial_port *port);
82 static void whiteheat_get_serial(struct tty_struct *tty,
83 struct serial_struct *ss);
84 static void whiteheat_set_termios(struct tty_struct *tty,
85 struct usb_serial_port *port, struct ktermios *old);
86 static int whiteheat_tiocmget(struct tty_struct *tty);
87 static int whiteheat_tiocmset(struct tty_struct *tty,
88 unsigned int set, unsigned int clear);
89 static void whiteheat_break_ctl(struct tty_struct *tty, int break_state);
91 static struct usb_serial_driver whiteheat_fake_device = {
94 .name = "whiteheatnofirm",
96 .description = "Connect Tech - WhiteHEAT - (prerenumeration)",
97 .id_table = id_table_prerenumeration,
99 .probe = whiteheat_firmware_download,
100 .attach = whiteheat_firmware_attach,
103 static struct usb_serial_driver whiteheat_device = {
105 .owner = THIS_MODULE,
108 .description = "Connect Tech - WhiteHEAT",
109 .id_table = id_table_std,
113 .attach = whiteheat_attach,
114 .release = whiteheat_release,
115 .port_probe = whiteheat_port_probe,
116 .port_remove = whiteheat_port_remove,
117 .open = whiteheat_open,
118 .close = whiteheat_close,
119 .get_serial = whiteheat_get_serial,
120 .set_termios = whiteheat_set_termios,
121 .break_ctl = whiteheat_break_ctl,
122 .tiocmget = whiteheat_tiocmget,
123 .tiocmset = whiteheat_tiocmset,
124 .throttle = usb_serial_generic_throttle,
125 .unthrottle = usb_serial_generic_unthrottle,
128 static struct usb_serial_driver * const serial_drivers[] = {
129 &whiteheat_fake_device, &whiteheat_device, NULL
132 struct whiteheat_command_private {
135 __u8 command_finished;
136 wait_queue_head_t wait_command; /* for handling sleeping whilst
137 waiting for a command to
139 __u8 result_buffer[64];
142 struct whiteheat_private {
143 __u8 mcr; /* FIXME: no locking on mcr */
147 /* local function prototypes */
148 static int start_command_port(struct usb_serial *serial);
149 static void stop_command_port(struct usb_serial *serial);
150 static void command_port_write_callback(struct urb *urb);
151 static void command_port_read_callback(struct urb *urb);
153 static int firm_send_command(struct usb_serial_port *port, __u8 command,
154 __u8 *data, __u8 datasize);
155 static int firm_open(struct usb_serial_port *port);
156 static int firm_close(struct usb_serial_port *port);
157 static void firm_setup_port(struct tty_struct *tty);
158 static int firm_set_rts(struct usb_serial_port *port, __u8 onoff);
159 static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff);
160 static int firm_set_break(struct usb_serial_port *port, __u8 onoff);
161 static int firm_purge(struct usb_serial_port *port, __u8 rxtx);
162 static int firm_get_dtr_rts(struct usb_serial_port *port);
163 static int firm_report_tx_done(struct usb_serial_port *port);
166 #define COMMAND_PORT 4
167 #define COMMAND_TIMEOUT (2*HZ) /* 2 second timeout for a command */
168 #define COMMAND_TIMEOUT_MS 2000
171 /*****************************************************************************
172 * Connect Tech's White Heat prerenumeration driver functions
173 *****************************************************************************/
175 /* steps to download the firmware to the WhiteHEAT device:
176 - hold the reset (by writing to the reset bit of the CPUCS register)
177 - download the VEND_AX.HEX file to the chip using VENDOR_REQUEST-ANCHOR_LOAD
178 - release the reset (by writing to the CPUCS register)
179 - download the WH.HEX file for all addresses greater than 0x1b3f using
180 VENDOR_REQUEST-ANCHOR_EXTERNAL_RAM_LOAD
182 - download the WH.HEX file for all addresses less than 0x1b40 using
183 VENDOR_REQUEST_ANCHOR_LOAD
185 - device renumerated itself and comes up as new device id with all
186 firmware download completed.
188 static int whiteheat_firmware_download(struct usb_serial *serial,
189 const struct usb_device_id *id)
193 response = ezusb_fx1_ihex_firmware_download(serial->dev, "whiteheat_loader.fw");
195 response = ezusb_fx1_ihex_firmware_download(serial->dev, "whiteheat.fw");
203 static int whiteheat_firmware_attach(struct usb_serial *serial)
205 /* We want this device to fail to have a driver assigned to it */
210 /*****************************************************************************
211 * Connect Tech's White Heat serial driver functions
212 *****************************************************************************/
214 static int whiteheat_attach(struct usb_serial *serial)
216 struct usb_serial_port *command_port;
217 struct whiteheat_command_private *command_info;
218 struct whiteheat_hw_info *hw_info;
225 command_port = serial->port[COMMAND_PORT];
227 pipe = usb_sndbulkpipe(serial->dev,
228 command_port->bulk_out_endpointAddress);
229 command = kmalloc(2, GFP_KERNEL);
231 goto no_command_buffer;
232 command[0] = WHITEHEAT_GET_HW_INFO;
235 result = kmalloc(sizeof(*hw_info) + 1, GFP_KERNEL);
237 goto no_result_buffer;
239 * When the module is reloaded the firmware is still there and
240 * the endpoints are still in the usb core unchanged. This is the
241 * unlinking bug in disguise. Same for the call below.
243 usb_clear_halt(serial->dev, pipe);
244 ret = usb_bulk_msg(serial->dev, pipe, command, 2,
245 &alen, COMMAND_TIMEOUT_MS);
247 dev_err(&serial->dev->dev, "%s: Couldn't send command [%d]\n",
248 serial->type->description, ret);
250 } else if (alen != 2) {
251 dev_err(&serial->dev->dev, "%s: Send command incomplete [%d]\n",
252 serial->type->description, alen);
256 pipe = usb_rcvbulkpipe(serial->dev,
257 command_port->bulk_in_endpointAddress);
258 /* See the comment on the usb_clear_halt() above */
259 usb_clear_halt(serial->dev, pipe);
260 ret = usb_bulk_msg(serial->dev, pipe, result,
261 sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
263 dev_err(&serial->dev->dev, "%s: Couldn't get results [%d]\n",
264 serial->type->description, ret);
266 } else if (alen != sizeof(*hw_info) + 1) {
267 dev_err(&serial->dev->dev, "%s: Get results incomplete [%d]\n",
268 serial->type->description, alen);
270 } else if (result[0] != command[0]) {
271 dev_err(&serial->dev->dev, "%s: Command failed [%d]\n",
272 serial->type->description, result[0]);
276 hw_info = (struct whiteheat_hw_info *)&result[1];
278 dev_info(&serial->dev->dev, "%s: Firmware v%d.%02d\n",
279 serial->type->description,
280 hw_info->sw_major_rev, hw_info->sw_minor_rev);
282 command_info = kmalloc(sizeof(struct whiteheat_command_private),
285 goto no_command_private;
287 mutex_init(&command_info->mutex);
288 command_info->port_running = 0;
289 init_waitqueue_head(&command_info->wait_command);
290 usb_set_serial_port_data(command_port, command_info);
291 command_port->write_urb->complete = command_port_write_callback;
292 command_port->read_urb->complete = command_port_read_callback;
299 /* Firmware likely not running */
300 dev_err(&serial->dev->dev,
301 "%s: Unable to retrieve firmware version, try replugging\n",
302 serial->type->description);
303 dev_err(&serial->dev->dev,
304 "%s: If the firmware is not running (status led not blinking)\n",
305 serial->type->description);
306 dev_err(&serial->dev->dev,
308 serial->type->description);
321 static void whiteheat_release(struct usb_serial *serial)
323 struct usb_serial_port *command_port;
325 /* free up our private data for our command port */
326 command_port = serial->port[COMMAND_PORT];
327 kfree(usb_get_serial_port_data(command_port));
330 static int whiteheat_port_probe(struct usb_serial_port *port)
332 struct whiteheat_private *info;
334 info = kzalloc(sizeof(*info), GFP_KERNEL);
338 usb_set_serial_port_data(port, info);
343 static void whiteheat_port_remove(struct usb_serial_port *port)
345 struct whiteheat_private *info;
347 info = usb_get_serial_port_data(port);
351 static int whiteheat_open(struct tty_struct *tty, struct usb_serial_port *port)
355 retval = start_command_port(port->serial);
359 /* send an open port command */
360 retval = firm_open(port);
362 stop_command_port(port->serial);
366 retval = firm_purge(port, WHITEHEAT_PURGE_RX | WHITEHEAT_PURGE_TX);
369 stop_command_port(port->serial);
374 firm_setup_port(tty);
376 /* Work around HCD bugs */
377 usb_clear_halt(port->serial->dev, port->read_urb->pipe);
378 usb_clear_halt(port->serial->dev, port->write_urb->pipe);
380 retval = usb_serial_generic_open(tty, port);
383 stop_command_port(port->serial);
391 static void whiteheat_close(struct usb_serial_port *port)
393 firm_report_tx_done(port);
396 usb_serial_generic_close(port);
398 stop_command_port(port->serial);
401 static int whiteheat_tiocmget(struct tty_struct *tty)
403 struct usb_serial_port *port = tty->driver_data;
404 struct whiteheat_private *info = usb_get_serial_port_data(port);
405 unsigned int modem_signals = 0;
407 firm_get_dtr_rts(port);
408 if (info->mcr & UART_MCR_DTR)
409 modem_signals |= TIOCM_DTR;
410 if (info->mcr & UART_MCR_RTS)
411 modem_signals |= TIOCM_RTS;
413 return modem_signals;
416 static int whiteheat_tiocmset(struct tty_struct *tty,
417 unsigned int set, unsigned int clear)
419 struct usb_serial_port *port = tty->driver_data;
420 struct whiteheat_private *info = usb_get_serial_port_data(port);
423 info->mcr |= UART_MCR_RTS;
425 info->mcr |= UART_MCR_DTR;
427 if (clear & TIOCM_RTS)
428 info->mcr &= ~UART_MCR_RTS;
429 if (clear & TIOCM_DTR)
430 info->mcr &= ~UART_MCR_DTR;
432 firm_set_dtr(port, info->mcr & UART_MCR_DTR);
433 firm_set_rts(port, info->mcr & UART_MCR_RTS);
438 static void whiteheat_get_serial(struct tty_struct *tty, struct serial_struct *ss)
440 ss->baud_base = 460800;
444 static void whiteheat_set_termios(struct tty_struct *tty,
445 struct usb_serial_port *port, struct ktermios *old_termios)
447 firm_setup_port(tty);
450 static void whiteheat_break_ctl(struct tty_struct *tty, int break_state)
452 struct usb_serial_port *port = tty->driver_data;
453 firm_set_break(port, break_state);
457 /*****************************************************************************
458 * Connect Tech's White Heat callback routines
459 *****************************************************************************/
460 static void command_port_write_callback(struct urb *urb)
462 int status = urb->status;
465 dev_dbg(&urb->dev->dev, "nonzero urb status: %d\n", status);
471 static void command_port_read_callback(struct urb *urb)
473 struct usb_serial_port *command_port = urb->context;
474 struct whiteheat_command_private *command_info;
475 int status = urb->status;
476 unsigned char *data = urb->transfer_buffer;
479 command_info = usb_get_serial_port_data(command_port);
481 dev_dbg(&urb->dev->dev, "%s - command_info is NULL, exiting.\n", __func__);
484 if (!urb->actual_length) {
485 dev_dbg(&urb->dev->dev, "%s - empty response, exiting.\n", __func__);
489 dev_dbg(&urb->dev->dev, "%s - nonzero urb status: %d\n", __func__, status);
490 if (status != -ENOENT)
491 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
492 wake_up(&command_info->wait_command);
496 usb_serial_debug_data(&command_port->dev, __func__, urb->actual_length, data);
498 if (data[0] == WHITEHEAT_CMD_COMPLETE) {
499 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
500 wake_up(&command_info->wait_command);
501 } else if (data[0] == WHITEHEAT_CMD_FAILURE) {
502 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
503 wake_up(&command_info->wait_command);
504 } else if (data[0] == WHITEHEAT_EVENT) {
505 /* These are unsolicited reports from the firmware, hence no
506 waiting command to wakeup */
507 dev_dbg(&urb->dev->dev, "%s - event received\n", __func__);
508 } else if ((data[0] == WHITEHEAT_GET_DTR_RTS) &&
509 (urb->actual_length - 1 <= sizeof(command_info->result_buffer))) {
510 memcpy(command_info->result_buffer, &data[1],
511 urb->actual_length - 1);
512 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
513 wake_up(&command_info->wait_command);
515 dev_dbg(&urb->dev->dev, "%s - bad reply from firmware\n", __func__);
517 /* Continue trying to always read */
518 result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC);
520 dev_dbg(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n",
525 /*****************************************************************************
526 * Connect Tech's White Heat firmware interface
527 *****************************************************************************/
528 static int firm_send_command(struct usb_serial_port *port, __u8 command,
529 __u8 *data, __u8 datasize)
531 struct usb_serial_port *command_port;
532 struct whiteheat_command_private *command_info;
533 struct whiteheat_private *info;
534 struct device *dev = &port->dev;
535 __u8 *transfer_buffer;
539 dev_dbg(dev, "%s - command %d\n", __func__, command);
541 command_port = port->serial->port[COMMAND_PORT];
542 command_info = usb_get_serial_port_data(command_port);
544 if (command_port->bulk_out_size < datasize + 1)
547 mutex_lock(&command_info->mutex);
548 command_info->command_finished = false;
550 transfer_buffer = (__u8 *)command_port->write_urb->transfer_buffer;
551 transfer_buffer[0] = command;
552 memcpy(&transfer_buffer[1], data, datasize);
553 command_port->write_urb->transfer_buffer_length = datasize + 1;
554 retval = usb_submit_urb(command_port->write_urb, GFP_NOIO);
556 dev_dbg(dev, "%s - submit urb failed\n", __func__);
560 /* wait for the command to complete */
561 t = wait_event_timeout(command_info->wait_command,
562 (bool)command_info->command_finished, COMMAND_TIMEOUT);
564 usb_kill_urb(command_port->write_urb);
566 if (command_info->command_finished == false) {
567 dev_dbg(dev, "%s - command timed out.\n", __func__);
572 if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) {
573 dev_dbg(dev, "%s - command failed.\n", __func__);
578 if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) {
579 dev_dbg(dev, "%s - command completed.\n", __func__);
581 case WHITEHEAT_GET_DTR_RTS:
582 info = usb_get_serial_port_data(port);
583 info->mcr = command_info->result_buffer[0];
588 mutex_unlock(&command_info->mutex);
593 static int firm_open(struct usb_serial_port *port)
595 struct whiteheat_simple open_command;
597 open_command.port = port->port_number + 1;
598 return firm_send_command(port, WHITEHEAT_OPEN,
599 (__u8 *)&open_command, sizeof(open_command));
603 static int firm_close(struct usb_serial_port *port)
605 struct whiteheat_simple close_command;
607 close_command.port = port->port_number + 1;
608 return firm_send_command(port, WHITEHEAT_CLOSE,
609 (__u8 *)&close_command, sizeof(close_command));
613 static void firm_setup_port(struct tty_struct *tty)
615 struct usb_serial_port *port = tty->driver_data;
616 struct device *dev = &port->dev;
617 struct whiteheat_port_settings port_settings;
618 unsigned int cflag = tty->termios.c_cflag;
621 port_settings.port = port->port_number + 1;
623 port_settings.bits = tty_get_char_size(cflag);
624 dev_dbg(dev, "%s - data bits = %d\n", __func__, port_settings.bits);
626 /* determine the parity */
630 port_settings.parity = WHITEHEAT_PAR_MARK;
632 port_settings.parity = WHITEHEAT_PAR_SPACE;
635 port_settings.parity = WHITEHEAT_PAR_ODD;
637 port_settings.parity = WHITEHEAT_PAR_EVEN;
639 port_settings.parity = WHITEHEAT_PAR_NONE;
640 dev_dbg(dev, "%s - parity = %c\n", __func__, port_settings.parity);
642 /* figure out the stop bits requested */
644 port_settings.stop = 2;
646 port_settings.stop = 1;
647 dev_dbg(dev, "%s - stop bits = %d\n", __func__, port_settings.stop);
649 /* figure out the flow control settings */
651 port_settings.hflow = (WHITEHEAT_HFLOW_CTS |
652 WHITEHEAT_HFLOW_RTS);
654 port_settings.hflow = WHITEHEAT_HFLOW_NONE;
655 dev_dbg(dev, "%s - hardware flow control = %s %s %s %s\n", __func__,
656 (port_settings.hflow & WHITEHEAT_HFLOW_CTS) ? "CTS" : "",
657 (port_settings.hflow & WHITEHEAT_HFLOW_RTS) ? "RTS" : "",
658 (port_settings.hflow & WHITEHEAT_HFLOW_DSR) ? "DSR" : "",
659 (port_settings.hflow & WHITEHEAT_HFLOW_DTR) ? "DTR" : "");
661 /* determine software flow control */
663 port_settings.sflow = WHITEHEAT_SFLOW_RXTX;
665 port_settings.sflow = WHITEHEAT_SFLOW_NONE;
666 dev_dbg(dev, "%s - software flow control = %c\n", __func__, port_settings.sflow);
668 port_settings.xon = START_CHAR(tty);
669 port_settings.xoff = STOP_CHAR(tty);
670 dev_dbg(dev, "%s - XON = %2x, XOFF = %2x\n", __func__, port_settings.xon, port_settings.xoff);
672 /* get the baud rate wanted */
673 baud = tty_get_baud_rate(tty);
674 port_settings.baud = cpu_to_le32(baud);
675 dev_dbg(dev, "%s - baud rate = %u\n", __func__, baud);
677 /* fixme: should set validated settings */
678 tty_encode_baud_rate(tty, baud, baud);
680 /* handle any settings that aren't specified in the tty structure */
681 port_settings.lloop = 0;
683 /* now send the message to the device */
684 firm_send_command(port, WHITEHEAT_SETUP_PORT,
685 (__u8 *)&port_settings, sizeof(port_settings));
689 static int firm_set_rts(struct usb_serial_port *port, __u8 onoff)
691 struct whiteheat_set_rdb rts_command;
693 rts_command.port = port->port_number + 1;
694 rts_command.state = onoff;
695 return firm_send_command(port, WHITEHEAT_SET_RTS,
696 (__u8 *)&rts_command, sizeof(rts_command));
700 static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff)
702 struct whiteheat_set_rdb dtr_command;
704 dtr_command.port = port->port_number + 1;
705 dtr_command.state = onoff;
706 return firm_send_command(port, WHITEHEAT_SET_DTR,
707 (__u8 *)&dtr_command, sizeof(dtr_command));
711 static int firm_set_break(struct usb_serial_port *port, __u8 onoff)
713 struct whiteheat_set_rdb break_command;
715 break_command.port = port->port_number + 1;
716 break_command.state = onoff;
717 return firm_send_command(port, WHITEHEAT_SET_BREAK,
718 (__u8 *)&break_command, sizeof(break_command));
722 static int firm_purge(struct usb_serial_port *port, __u8 rxtx)
724 struct whiteheat_purge purge_command;
726 purge_command.port = port->port_number + 1;
727 purge_command.what = rxtx;
728 return firm_send_command(port, WHITEHEAT_PURGE,
729 (__u8 *)&purge_command, sizeof(purge_command));
733 static int firm_get_dtr_rts(struct usb_serial_port *port)
735 struct whiteheat_simple get_dr_command;
737 get_dr_command.port = port->port_number + 1;
738 return firm_send_command(port, WHITEHEAT_GET_DTR_RTS,
739 (__u8 *)&get_dr_command, sizeof(get_dr_command));
743 static int firm_report_tx_done(struct usb_serial_port *port)
745 struct whiteheat_simple close_command;
747 close_command.port = port->port_number + 1;
748 return firm_send_command(port, WHITEHEAT_REPORT_TX_DONE,
749 (__u8 *)&close_command, sizeof(close_command));
753 /*****************************************************************************
754 * Connect Tech's White Heat utility functions
755 *****************************************************************************/
756 static int start_command_port(struct usb_serial *serial)
758 struct usb_serial_port *command_port;
759 struct whiteheat_command_private *command_info;
762 command_port = serial->port[COMMAND_PORT];
763 command_info = usb_get_serial_port_data(command_port);
764 mutex_lock(&command_info->mutex);
765 if (!command_info->port_running) {
766 /* Work around HCD bugs */
767 usb_clear_halt(serial->dev, command_port->read_urb->pipe);
769 retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL);
771 dev_err(&serial->dev->dev,
772 "%s - failed submitting read urb, error %d\n",
777 command_info->port_running++;
780 mutex_unlock(&command_info->mutex);
785 static void stop_command_port(struct usb_serial *serial)
787 struct usb_serial_port *command_port;
788 struct whiteheat_command_private *command_info;
790 command_port = serial->port[COMMAND_PORT];
791 command_info = usb_get_serial_port_data(command_port);
792 mutex_lock(&command_info->mutex);
793 command_info->port_running--;
794 if (!command_info->port_running)
795 usb_kill_urb(command_port->read_urb);
796 mutex_unlock(&command_info->mutex);
799 module_usb_serial_driver(serial_drivers, id_table_combined);
801 MODULE_AUTHOR(DRIVER_AUTHOR);
802 MODULE_DESCRIPTION(DRIVER_DESC);
803 MODULE_LICENSE("GPL");
805 MODULE_FIRMWARE("whiteheat.fw");
806 MODULE_FIRMWARE("whiteheat_loader.fw");