Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80359a9c authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

whiteheat: coding style



Bring ezusb and whiteheat into line with the coding style

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 95da310e
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@
/* EZ-USB Control and Status Register.  Bit 0 controls 8051 reset */
#define CPUCS_REG    0x7F92

int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest)
int ezusb_writememory(struct usb_serial *serial, int address,
				unsigned char *data, int length, __u8 request)
{
	int result;
	unsigned char *transfer_buffer;
@@ -33,13 +34,16 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da

	transfer_buffer = kmemdup(data, length, GFP_KERNEL);
	if (!transfer_buffer) {
		dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __func__, length);
		dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n",
							__func__, length);
		return -ENOMEM;
	}
	result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), bRequest, 0x40, address, 0, transfer_buffer, length, 3000);
	result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
		     request, 0x40, address, 0, transfer_buffer, length, 3000);
	kfree(transfer_buffer);
	return result;
}
EXPORT_SYMBOL_GPL(ezusb_writememory);

int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit)
{
@@ -48,11 +52,9 @@ int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit)
	/* dbg("%s - %d", __func__, reset_bit); */
	response = ezusb_writememory(serial, CPUCS_REG, &reset_bit, 1, 0xa0);
	if (response < 0)
		dev_err(&serial->dev->dev, "%s- %d failed\n", __func__, reset_bit);
		dev_err(&serial->dev->dev, "%s- %d failed\n",
						__func__, reset_bit);
	return response;
}


EXPORT_SYMBOL_GPL(ezusb_writememory);
EXPORT_SYMBOL_GPL(ezusb_set_reset);
+217 −169
Original line number Diff line number Diff line
@@ -12,13 +12,15 @@
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 * See Documentation/usb/usb-serial.txt for more information on using this driver
 * See Documentation/usb/usb-serial.txt for more information on using this
 * driver
 *
 * (10/09/2002) Stuart MacDonald (stuartm@connecttech.com)
 *	Upgrade to full working driver
 *
 * (05/30/2001) gkh
 *	switched from using spinlock to a semaphore, which fixes lots of problems.
 *	switched from using spinlock to a semaphore, which fixes lots of
 *	problems.
 *
 * (04/08/2001) gb
 *	Identify version on module load.
@@ -52,9 +54,9 @@
 *	Fixed bug with port->minor that was found by Al Borchers
 *
 * (07/04/2000) gkh
 *	Added support for port settings. Baud rate can now be changed. Line signals
 *	are not transferred to and from the tty layer yet, but things seem to be 
 *	working well now.
 *	Added support for port settings. Baud rate can now be changed. Line
 *	signals are not transferred to and from the tty layer yet, but things
 *	seem to be working well now.
 *
 * (05/04/2000) gkh
 *	First cut at open and close commands. Data can flow through the ports at
@@ -75,7 +77,7 @@
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <asm/termbits.h>
#include <linux/usb.h>
#include <linux/serial_reg.h>
@@ -136,20 +138,28 @@ static struct usb_driver whiteheat_driver = {
};

/* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */
static int  whiteheat_firmware_download	(struct usb_serial *serial, const struct usb_device_id *id);
static int  whiteheat_firmware_download(struct usb_serial *serial,
					const struct usb_device_id *id);
static int  whiteheat_firmware_attach(struct usb_serial *serial);

/* function prototypes for the Connect Tech WhiteHEAT serial converter */
static int  whiteheat_attach(struct usb_serial *serial);
static void whiteheat_shutdown(struct usb_serial *serial);
static int  whiteheat_open		(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp);
static void whiteheat_close		(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp);
static int  whiteheat_write		(struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count);
static int  whiteheat_open(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp);
static void whiteheat_close(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp);
static int  whiteheat_write(struct tty_struct *tty,
			struct usb_serial_port *port,
			const unsigned char *buf, int count);
static int  whiteheat_write_room(struct tty_struct *tty);
static int  whiteheat_ioctl		(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg);
static void whiteheat_set_termios	(struct tty_struct *tty, struct usb_serial_port *port, struct ktermios * old);
static int  whiteheat_ioctl(struct tty_struct *tty, struct file *file,
			unsigned int cmd, unsigned long arg);
static void whiteheat_set_termios(struct tty_struct *tty,
			struct usb_serial_port *port, struct ktermios *old);
static int  whiteheat_tiocmget(struct tty_struct *tty, struct file *file);
static int  whiteheat_tiocmset		(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear);
static int  whiteheat_tiocmset(struct tty_struct *tty, struct file *file,
			unsigned int set, unsigned int clear);
static void whiteheat_break_ctl(struct tty_struct *tty, int break_state);
static int  whiteheat_chars_in_buffer(struct tty_struct *tty);
static void whiteheat_throttle(struct tty_struct *tty);
@@ -202,7 +212,9 @@ struct whiteheat_command_private {
	struct mutex		mutex;
	__u8			port_running;
	__u8			command_finished;
	wait_queue_head_t	wait_command;	/* for handling sleeping while waiting for a command to finish */
	wait_queue_head_t	wait_command; /* for handling sleeping whilst
						 waiting for a command to
						 finish */
	__u8			result_buffer[64];
};

@@ -239,11 +251,13 @@ static void command_port_write_callback(struct urb *urb);
static void command_port_read_callback(struct urb *urb);

static int start_port_read(struct usb_serial_port *port);
static struct whiteheat_urb_wrap *urb_to_wrap(struct urb *urb, struct list_head *head);
static struct whiteheat_urb_wrap *urb_to_wrap(struct urb *urb,
						struct list_head *head);
static struct list_head *list_first(struct list_head *head);
static void rx_data_softint(struct work_struct *work);

static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *data, __u8 datasize);
static int firm_send_command(struct usb_serial_port *port, __u8 command,
						__u8 *data, __u8 datasize);
static int firm_open(struct usb_serial_port *port);
static int firm_close(struct usb_serial_port *port);
static int firm_setup_port(struct tty_struct *tty);
@@ -278,7 +292,8 @@ static int firm_report_tx_done(struct usb_serial_port *port);
 - device renumerated itself and comes up as new device id with all
   firmware download completed.
*/
static int whiteheat_firmware_download (struct usb_serial *serial, const struct usb_device_id *id)
static int whiteheat_firmware_download(struct usb_serial *serial,
					const struct usb_device_id *id)
{
	int response, ret = -ENOENT;
	const struct firmware *loader_fw = NULL, *firmware_fw = NULL;
@@ -386,7 +401,8 @@ static int whiteheat_attach (struct usb_serial *serial)

	command_port = serial->port[COMMAND_PORT];

	pipe = usb_sndbulkpipe (serial->dev, command_port->bulk_out_endpointAddress);
	pipe = usb_sndbulkpipe(serial->dev,
			command_port->bulk_out_endpointAddress);
	command = kmalloc(2, GFP_KERNEL);
	if (!command)
		goto no_command_buffer;
@@ -402,27 +418,35 @@ static int whiteheat_attach (struct usb_serial *serial)
	 * unlinking bug in disguise. Same for the call below.
	 */
	usb_clear_halt(serial->dev, pipe);
	ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT_MS);
	ret = usb_bulk_msg(serial->dev, pipe, command, 2,
						&alen, COMMAND_TIMEOUT_MS);
	if (ret) {
		err("%s: Couldn't send command [%d]", serial->type->description, ret);
		err("%s: Couldn't send command [%d]",
				serial->type->description, ret);
		goto no_firmware;
	} else if (alen != 2) {
		err("%s: Send command incomplete [%d]", serial->type->description, alen);
		err("%s: Send command incomplete [%d]",
				serial->type->description, alen);
		goto no_firmware;
	}

	pipe = usb_rcvbulkpipe (serial->dev, command_port->bulk_in_endpointAddress);
	pipe = usb_rcvbulkpipe(serial->dev,
				command_port->bulk_in_endpointAddress);
	/* See the comment on the usb_clear_halt() above */
	usb_clear_halt(serial->dev, pipe);
	ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
	ret = usb_bulk_msg(serial->dev, pipe, result,
			sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
	if (ret) {
		err("%s: Couldn't get results [%d]", serial->type->description, ret);
		err("%s: Couldn't get results [%d]",
				serial->type->description, ret);
		goto no_firmware;
	} else if (alen != sizeof(*hw_info) + 1) {
		err("%s: Get results incomplete [%d]", serial->type->description, alen);
		err("%s: Get results incomplete [%d]",
				serial->type->description, alen);
		goto no_firmware;
	} else if (result[0] != command[0]) {
		err("%s: Command failed [%d]", serial->type->description, result[0]);
		err("%s: Command failed [%d]",
				serial->type->description, result[0]);
		goto no_firmware;
	}

@@ -436,7 +460,8 @@ static int whiteheat_attach (struct usb_serial *serial)

		info = kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
		if (info == NULL) {
			err("%s: Out of memory for port structures\n", serial->type->description);
			err("%s: Out of memory for port structures\n",
					serial->type->description);
			goto no_private;
		}

@@ -506,9 +531,11 @@ static int whiteheat_attach (struct usb_serial *serial)
		usb_set_serial_port_data(port, info);
	}

	command_info = kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL);
	command_info = kmalloc(sizeof(struct whiteheat_command_private),
								GFP_KERNEL);
	if (command_info == NULL) {
		err("%s: Out of memory for port structures\n", serial->type->description);
		err("%s: Out of memory for port structures\n",
					serial->type->description);
		goto no_command_private;
	}

@@ -525,9 +552,12 @@ static int whiteheat_attach (struct usb_serial *serial)

no_firmware:
	/* Firmware likely not running */
	err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->description);
	err("%s: If the firmware is not running (status led not blinking)\n", serial->type->description);
	err("%s: please contact support@connecttech.com\n", serial->type->description);
	err("%s: Unable to retrieve firmware version, try replugging\n",
					serial->type->description);
	err("%s: If the firmware is not running (status led not blinking)\n",
					serial->type->description);
	err("%s: please contact support@connecttech.com\n",
					serial->type->description);
	kfree(result);
	return -ENODEV;

@@ -612,7 +642,6 @@ static void whiteheat_shutdown (struct usb_serial *serial)
	return;
}


static int whiteheat_open(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp)
{
@@ -655,7 +684,8 @@ static int whiteheat_open (struct tty_struct *tty,
	/* Start reading from the device */
	retval = start_port_read(port);
	if (retval) {
		err("%s - failed submitting read urb, error %d", __func__, retval);
		err("%s - failed submitting read urb, error %d",
				__func__, retval);
		firm_close(port);
		stop_command_port(port->serial);
		goto exit;
@@ -769,16 +799,19 @@ static int whiteheat_write(struct tty_struct *tty,

		wrap = list_entry(tmp, struct whiteheat_urb_wrap, list);
		urb = wrap->urb;
		bytes = (count > port->bulk_out_size) ? port->bulk_out_size : count;
		bytes = (count > port->bulk_out_size) ?
					port->bulk_out_size : count;
		memcpy(urb->transfer_buffer, buf + sent, bytes);

		usb_serial_debug_data(debug, &port->dev, __func__, bytes, urb->transfer_buffer);
		usb_serial_debug_data(debug, &port->dev,
				__func__, bytes, urb->transfer_buffer);

		urb->dev = serial->dev;
		urb->transfer_buffer_length = bytes;
		result = usb_submit_urb(urb, GFP_ATOMIC);
		if (result) {
			err("%s - failed submitting write urb, error %d", __func__, result);
			err("%s - failed submitting write urb, error %d",
							__func__, result);
			sent = result;
			spin_lock_irqsave(&info->lock, flags);
			list_add(tmp, &info->tx_urbs_free);
@@ -796,7 +829,6 @@ static int whiteheat_write(struct tty_struct *tty,
	return sent;
}


static int whiteheat_write_room(struct tty_struct *tty)
{
	struct usb_serial_port *port = tty->driver_data;
@@ -817,7 +849,6 @@ static int whiteheat_write_room(struct tty_struct *tty)
	return (room);
}


static int whiteheat_tiocmget(struct tty_struct *tty, struct file *file)
{
	struct usb_serial_port *port = tty->driver_data;
@@ -835,7 +866,6 @@ static int whiteheat_tiocmget (struct tty_struct *tty, struct file *file)
	return modem_signals;
}


static int whiteheat_tiocmset(struct tty_struct *tty, struct file *file,
			       unsigned int set, unsigned int clear)
{
@@ -860,7 +890,8 @@ static int whiteheat_tiocmset (struct tty_struct *tty, struct file *file,
}


static int whiteheat_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg)
static int whiteheat_ioctl(struct tty_struct *tty, struct file *file,
					unsigned int cmd, unsigned long arg)
{
	struct usb_serial_port *port = tty->driver_data;
	struct serial_struct serstruct;
@@ -883,21 +914,7 @@ static int whiteheat_ioctl (struct tty_struct *tty, struct file * file, unsigned

		if (copy_to_user(user_arg, &serstruct, sizeof(serstruct)))
			return -EFAULT;

			break;

		case TIOCSSERIAL:
			if (copy_from_user(&serstruct, user_arg, sizeof(serstruct)))
				return -EFAULT;

			/*
			 * For now this is ignored. dip sets the ASYNC_[V]HI flags
			 * but this isn't used by us at all. Maybe someone somewhere
			 * will need the custom_divisor setting.
			 */

		break;

	default:
		break;
	}
@@ -906,13 +923,15 @@ static int whiteheat_ioctl (struct tty_struct *tty, struct file * file, unsigned
}


static void whiteheat_set_termios(struct tty_struct *tty, struct usb_serial_port *port, struct ktermios *old_termios)
static void whiteheat_set_termios(struct tty_struct *tty,
	struct usb_serial_port *port, struct ktermios *old_termios)
{
	/* FIXME */
	firm_setup_port(tty);
}


static void whiteheat_break_ctl(struct tty_struct *tty, int break_state) {
static void whiteheat_break_ctl(struct tty_struct *tty, int break_state)
{
	struct usb_serial_port *port = tty->driver_data;
	firm_set_break(port, break_state);
}
@@ -1017,7 +1036,8 @@ static void command_port_read_callback(struct urb *urb)
		return;
	}

	usb_serial_debug_data(debug, &command_port->dev, __func__, urb->actual_length, data);
	usb_serial_debug_data(debug, &command_port->dev,
				__func__, urb->actual_length, data);

	if (data[0] == WHITEHEAT_CMD_COMPLETE) {
		command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
@@ -1026,21 +1046,23 @@ static void command_port_read_callback(struct urb *urb)
		command_info->command_finished = WHITEHEAT_CMD_FAILURE;
		wake_up(&command_info->wait_command);
	} else if (data[0] == WHITEHEAT_EVENT) {
		/* These are unsolicited reports from the firmware, hence no waiting command to wakeup */
		/* These are unsolicited reports from the firmware, hence no
		   waiting command to wakeup */
		dbg("%s - event received", __func__);
	} else if (data[0] == WHITEHEAT_GET_DTR_RTS) {
		memcpy(command_info->result_buffer, &data[1], urb->actual_length - 1);
		memcpy(command_info->result_buffer, &data[1],
						urb->actual_length - 1);
		command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
		wake_up(&command_info->wait_command);
	} else {
	} else
		dbg("%s - bad reply from firmware", __func__);
	}

	/* Continue trying to always read */
	command_port->read_urb->dev = command_port->serial->dev;
	result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC);
	if (result)
		dbg("%s - failed resubmitting read urb, error %d", __func__, result);
		dbg("%s - failed resubmitting read urb, error %d",
			__func__, result);
}


@@ -1073,7 +1095,8 @@ static void whiteheat_read_callback(struct urb *urb)
		return;
	}

	usb_serial_debug_data(debug, &port->dev, __func__, urb->actual_length, data);
	usb_serial_debug_data(debug, &port->dev,
				__func__, urb->actual_length, data);

	spin_lock(&info->lock);
	list_add_tail(&wrap->list, &info->rx_urb_q);
@@ -1120,7 +1143,8 @@ static void whiteheat_write_callback(struct urb *urb)
/*****************************************************************************
 * Connect Tech's White Heat firmware interface
 *****************************************************************************/
static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *data, __u8 datasize)
static int firm_send_command(struct usb_serial_port *port, __u8 command,
						__u8 *data, __u8 datasize)
{
	struct usb_serial_port *command_port;
	struct whiteheat_command_private *command_info;
@@ -1170,34 +1194,39 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *d
		switch (command) {
		case WHITEHEAT_GET_DTR_RTS:
			info = usb_get_serial_port_data(port);
				memcpy(&info->mcr, command_info->result_buffer, sizeof(struct whiteheat_dr_info));
			memcpy(&info->mcr, command_info->result_buffer,
					sizeof(struct whiteheat_dr_info));
				break;
		}
	}

exit:
	mutex_unlock(&command_info->mutex);
	return retval;
}


static int firm_open(struct usb_serial_port *port) {
static int firm_open(struct usb_serial_port *port)
{
	struct whiteheat_simple open_command;

	open_command.port = port->number - port->serial->minor + 1;
	return firm_send_command(port, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command));
	return firm_send_command(port, WHITEHEAT_OPEN,
		(__u8 *)&open_command, sizeof(open_command));
}


static int firm_close(struct usb_serial_port *port) {
static int firm_close(struct usb_serial_port *port)
{
	struct whiteheat_simple close_command;

	close_command.port = port->number - port->serial->minor + 1;
	return firm_send_command(port, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command));
	return firm_send_command(port, WHITEHEAT_CLOSE,
			(__u8 *)&close_command, sizeof(close_command));
}


static int firm_setup_port(struct tty_struct *tty) {
static int firm_setup_port(struct tty_struct *tty)
{
	struct usb_serial_port *port = tty->driver_data;
	struct whiteheat_port_settings port_settings;
	unsigned int cflag = tty->termios->c_cflag;
@@ -1239,7 +1268,8 @@ static int firm_setup_port(struct tty_struct *tty) {

	/* figure out the flow control settings */
	if (cflag & CRTSCTS)
		port_settings.hflow = (WHITEHEAT_HFLOW_CTS | WHITEHEAT_HFLOW_RTS);
		port_settings.hflow = (WHITEHEAT_HFLOW_CTS |
						WHITEHEAT_HFLOW_RTS);
	else
		port_settings.hflow = WHITEHEAT_HFLOW_NONE;
	dbg("%s - hardware flow control = %s %s %s %s", __func__,
@@ -1257,7 +1287,8 @@ static int firm_setup_port(struct tty_struct *tty) {

	port_settings.xon = START_CHAR(tty);
	port_settings.xoff = STOP_CHAR(tty);
	dbg("%s - XON = %2x, XOFF = %2x", __func__, port_settings.xon, port_settings.xoff);
	dbg("%s - XON = %2x, XOFF = %2x",
			__func__, port_settings.xon, port_settings.xoff);

	/* get the baud rate wanted */
	port_settings.baud = tty_get_baud_rate(tty);
@@ -1269,59 +1300,72 @@ static int firm_setup_port(struct tty_struct *tty) {
	port_settings.lloop = 0;

	/* now send the message to the device */
	return firm_send_command(port, WHITEHEAT_SETUP_PORT, (__u8 *)&port_settings, sizeof(port_settings));
	return firm_send_command(port, WHITEHEAT_SETUP_PORT,
			(__u8 *)&port_settings, sizeof(port_settings));
}


static int firm_set_rts(struct usb_serial_port *port, __u8 onoff) {
static int firm_set_rts(struct usb_serial_port *port, __u8 onoff)
{
	struct whiteheat_set_rdb rts_command;

	rts_command.port = port->number - port->serial->minor + 1;
	rts_command.state = onoff;
	return firm_send_command(port, WHITEHEAT_SET_RTS, (__u8 *)&rts_command, sizeof(rts_command));
	return firm_send_command(port, WHITEHEAT_SET_RTS,
			(__u8 *)&rts_command, sizeof(rts_command));
}


static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff) {
static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff)
{
	struct whiteheat_set_rdb dtr_command;

	dtr_command.port = port->number - port->serial->minor + 1;
	dtr_command.state = onoff;
	return firm_send_command(port, WHITEHEAT_SET_RTS, (__u8 *)&dtr_command, sizeof(dtr_command));
	return firm_send_command(port, WHITEHEAT_SET_RTS,
			(__u8 *)&dtr_command, sizeof(dtr_command));
}


static int firm_set_break(struct usb_serial_port *port, __u8 onoff) {
static int firm_set_break(struct usb_serial_port *port, __u8 onoff)
{
	struct whiteheat_set_rdb break_command;

	break_command.port = port->number - port->serial->minor + 1;
	break_command.state = onoff;
	return firm_send_command(port, WHITEHEAT_SET_RTS, (__u8 *)&break_command, sizeof(break_command));
	return firm_send_command(port, WHITEHEAT_SET_RTS,
			(__u8 *)&break_command, sizeof(break_command));
}


static int firm_purge(struct usb_serial_port *port, __u8 rxtx) {
static int firm_purge(struct usb_serial_port *port, __u8 rxtx)
{
	struct whiteheat_purge purge_command;

	purge_command.port = port->number - port->serial->minor + 1;
	purge_command.what = rxtx;
	return firm_send_command(port, WHITEHEAT_PURGE, (__u8 *)&purge_command, sizeof(purge_command));
	return firm_send_command(port, WHITEHEAT_PURGE,
			(__u8 *)&purge_command, sizeof(purge_command));
}


static int firm_get_dtr_rts(struct usb_serial_port *port) {
static int firm_get_dtr_rts(struct usb_serial_port *port)
{
	struct whiteheat_simple get_dr_command;

	get_dr_command.port = port->number - port->serial->minor + 1;
	return firm_send_command(port, WHITEHEAT_GET_DTR_RTS, (__u8 *)&get_dr_command, sizeof(get_dr_command));
	return firm_send_command(port, WHITEHEAT_GET_DTR_RTS,
			(__u8 *)&get_dr_command, sizeof(get_dr_command));
}


static int firm_report_tx_done(struct usb_serial_port *port) {
static int firm_report_tx_done(struct usb_serial_port *port)
{
	struct whiteheat_simple close_command;

	close_command.port = port->number - port->serial->minor + 1;
	return firm_send_command(port, WHITEHEAT_REPORT_TX_DONE, (__u8 *)&close_command, sizeof(close_command));
	return firm_send_command(port, WHITEHEAT_REPORT_TX_DONE,
			(__u8 *)&close_command, sizeof(close_command));
}


@@ -1344,7 +1388,8 @@ static int start_command_port(struct usb_serial *serial)
		command_port->read_urb->dev = serial->dev;
		retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL);
		if (retval) {
			err("%s - failed submitting read urb, error %d", __func__, retval);
			err("%s - failed submitting read urb, error %d",
							__func__, retval);
			goto exit;
		}
	}
@@ -1414,7 +1459,8 @@ static int start_port_read(struct usb_serial_port *port)
}


static struct whiteheat_urb_wrap *urb_to_wrap(struct urb* urb, struct list_head *head)
static struct whiteheat_urb_wrap *urb_to_wrap(struct urb *urb,
						struct list_head *head)
{
	struct whiteheat_urb_wrap *wrap;
	struct list_head *tmp;
@@ -1463,7 +1509,8 @@ static void rx_data_softint(struct work_struct *work)
		urb = wrap->urb;

		if (tty && urb->actual_length) {
			int len = tty_buffer_request_room(tty, urb->actual_length);
			int len = tty_buffer_request_room(tty,
							urb->actual_length);
			/* This stuff can go away now I suspect */
			if (unlikely(len < urb->actual_length)) {
				spin_lock_irqsave(&info->lock, flags);
@@ -1480,7 +1527,8 @@ static void rx_data_softint(struct work_struct *work)
		urb->dev = port->serial->dev;
		result = usb_submit_urb(urb, GFP_ATOMIC);
		if (result) {
			err("%s - failed resubmitting read urb, error %d", __func__, result);
			err("%s - failed resubmitting read urb, error %d",
				__func__, result);
			spin_lock_irqsave(&info->lock, flags);
			list_add(tmp, &info->rx_urbs_free);
			continue;