Commit bb74359b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB keyspan driver

Added support for the 19QI and 19QW devices.
Updated the firmware images with new versions.
minor cleanups to the driver.
parent e639ff6e
......@@ -28,6 +28,8 @@ dep_tristate ' USB Keyspan USA-xxx Serial Driver' CONFIG_USB_SERIAL_KEYSPAN $CO
dep_mbool ' USB Keyspan USA-19 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19 $CONFIG_USB_SERIAL_KEYSPAN
dep_mbool ' USB Keyspan USA-18X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA18X $CONFIG_USB_SERIAL_KEYSPAN
dep_mbool ' USB Keyspan USA-19W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19W $CONFIG_USB_SERIAL_KEYSPAN
dep_mbool ' USB Keyspan USA-19QW Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19QW $CONFIG_USB_SERIAL_KEYSPAN
dep_mbool ' USB Keyspan USA-19QI Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19QI $CONFIG_USB_SERIAL_KEYSPAN
dep_mbool ' USB Keyspan USA-49W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA49W $CONFIG_USB_SERIAL_KEYSPAN
dep_tristate ' USB KL5KUSB105 (Palmconnect) Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KLSI $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL
dep_tristate ' USB MCT Single Port Serial Driver' CONFIG_USB_SERIAL_MCT_U232 $CONFIG_USB_SERIAL
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
Keyspan USB to Serial Converter driver
(C) Copyright (C) 2000-2001
Hugh Blemings <hugh@misc.nu>
Hugh Blemings <hugh@blemings.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -72,11 +72,16 @@ static void keyspan_break_ctl (struct usb_serial_port *port,
static int keyspan_fake_startup (struct usb_serial *serial);
static int keyspan_usa19_calc_baud (u32 baud_rate, u32 baudclk,
u8 *rate_hi, u8 *rate_low, u8 *prescaler);
u8 *rate_hi, u8 *rate_low,
u8 *prescaler, int portnum);
static int keyspan_usa19w_calc_baud (u32 baud_rate, u32 baudclk,
u8 *rate_hi, u8 *rate_low, u8 *prescaler);
u8 *rate_hi, u8 *rate_low,
u8 *prescaler, int portnum);
static int keyspan_usa28_calc_baud (u32 baud_rate, u32 baudclk,
u8 *rate_hi, u8 *rate_low,
u8 *prescaler, int portnum);
//static void keyspan_usa19_setup_urbs (struct usb_serial *serial);
static int keyspan_usa28_send_setup (struct usb_serial *serial,
......@@ -134,6 +139,18 @@ struct ezusb_hex_record {
static const struct ezusb_hex_record *keyspan_usa19_firmware = NULL;
#endif
#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QI
#include "keyspan_usa19qi_fw.h"
#else
static const struct ezusb_hex_record *keyspan_usa19qi_firmware = NULL;
#endif
#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QW
#include "keyspan_usa19qw_fw.h"
#else
static const struct ezusb_hex_record *keyspan_usa19qw_firmware = NULL;
#endif
#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA18X
#include "keyspan_usa18x_fw.h"
#else
......@@ -158,12 +175,11 @@ struct ezusb_hex_record {
#define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */
#define KEYSPAN_USA19_BAUDCLK (12000000L)
#define KEYSPAN_USA19W_BAUDCLK (24000000L)
#define KEYSPAN_USA28_BAUDCLK (1843200L)
#define KEYSPAN_USA28X_BAUDCLK (12000000L)
#define KEYSPAN_USA49W_BAUDCLK (48000000L)
/* Some constants used to characterise each device.
There is a four port device due later in the year,
we allow for it now in the following */
/* Some constants used to characterise each device. */
#define KEYSPAN_MAX_NUM_PORTS (4)
#define KEYSPAN_MAX_FLIPS (2)
......@@ -174,6 +190,8 @@ struct ezusb_hex_record {
/* Product IDs for the eight products supported, pre-renumeration */
#define keyspan_usa18x_pre_product_id 0x0105
#define keyspan_usa19_pre_product_id 0x0103
#define keyspan_usa19qi_pre_product_id 0x010b
#define keyspan_usa19qw_pre_product_id 0x0118
#define keyspan_usa19w_pre_product_id 0x0106
#define keyspan_usa28_pre_product_id 0x0101
#define keyspan_usa28x_pre_product_id 0x0102
......@@ -186,6 +204,8 @@ struct ezusb_hex_record {
so it's not an issue. */
#define keyspan_usa18x_product_id 0x0112
#define keyspan_usa19_product_id 0x0107
#define keyspan_usa19qi_product_id 0x010c
#define keyspan_usa19qw_product_id 0x0119
#define keyspan_usa19w_product_id 0x0108
#define keyspan_usa28_product_id 0x010f
#define keyspan_usa28x_product_id 0x0110
......@@ -229,9 +249,8 @@ struct keyspan_device_details {
int glocont_endpoint;
int (*calculate_baud_rate) (u32 baud_rate, u32 baudclk,
u8 *rate_hi, u8 *rate_low, u8 *prescaler);
u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum);
u32 baudclk;
};
/* Now for each device type we setup the device detail
......@@ -270,6 +289,38 @@ static const struct keyspan_device_details usa19_device_details = {
KEYSPAN_USA19_BAUDCLK /* base baud clock */
};
static const struct keyspan_device_details usa19qi_device_details = {
keyspan_usa19qi_product_id, /* product ID */
msg_usa28, /* msg type*/
1, /* num ports */
1, /* indat endpoint flip */
1, /* outdat endpoint flip */
{0x81}, /* per port indat */
{0x01}, /* per port outdat */
{0x83}, /* per port inack */
{0x03}, /* per port outcont */
0x84, /* instat endpoint */
-1, /* glocont endpoint */
keyspan_usa28_calc_baud, /* calc baud rate */
KEYSPAN_USA19_BAUDCLK /* base baud clock */
};
static const struct keyspan_device_details usa19qw_device_details = {
keyspan_usa19qw_product_id, /* product ID */
msg_usa26, /* msg type*/
1, /* num ports */
0, /* indat endpoint flip */
1, /* outdat endpoint flip */
{0x81}, /* per port indat */
{0x01}, /* per port outdat */
{0x85}, /* per port inack */
{0x05}, /* per port outcont */
0x87, /* instat endpoint */
0x07, /* glocont endpoint */
keyspan_usa19w_calc_baud, /* calc baud rate */
KEYSPAN_USA19W_BAUDCLK /* base baud clock */
};
static const struct keyspan_device_details usa19w_device_details = {
keyspan_usa19w_product_id, /* product ID */
msg_usa26, /* msg type*/
......@@ -286,6 +337,22 @@ static const struct keyspan_device_details usa19w_device_details = {
KEYSPAN_USA19W_BAUDCLK /* base baud clock */
};
static const struct keyspan_device_details usa28_device_details = {
keyspan_usa28_product_id, /* product ID */
msg_usa28, /* msg type*/
2, /* num ports */
1, /* indat endpoint flip */
1, /* outdat endpoint flip */
{0x81, 0x83}, /* per port indat */
{0x01, 0x03}, /* per port outdat */
{0x85, 0x86}, /* per port inack */
{0x05, 0x06}, /* per port outcont */
0x87, /* instat endpoint */
0x07, /* glocont endpoint */
keyspan_usa28_calc_baud, /* calc baud rate */
KEYSPAN_USA28_BAUDCLK
};
static const struct keyspan_device_details usa28x_device_details = {
keyspan_usa28x_product_id, /* product ID */
msg_usa26, /* msg type*/
......@@ -339,9 +406,13 @@ static const struct keyspan_device_details usa49w_device_details = {
static const struct keyspan_device_details *keyspan_devices[] = {
&usa18x_device_details,
&usa19_device_details,
&usa19qi_device_details,
&usa19qw_device_details,
&usa19w_device_details,
&usa28_device_details,
&usa28x_device_details,
&usa28xa_device_details,
/* 28xb not required as it renumerates as a 28x */
&usa49w_device_details,
NULL
};
......@@ -350,6 +421,8 @@ static __devinitdata struct usb_device_id keyspan_ids_combined[] = {
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) },
......@@ -358,6 +431,8 @@ static __devinitdata struct usb_device_id keyspan_ids_combined[] = {
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
......@@ -376,6 +451,8 @@ MODULE_DEVICE_TABLE(usb, keyspan_ids_combined);
static __devinitdata struct usb_device_id keyspan_pre_ids[] = {
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) },
......@@ -392,10 +469,8 @@ static __devinitdata struct usb_device_id keyspan_usa18x_ids[] = {
static __devinitdata struct usb_device_id keyspan_usa19_ids[] = {
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) },
{ } /* Terminating entry */
};
static __devinitdata struct usb_device_id keyspan_usa19w_ids[] = {
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) },
{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) },
{ } /* Terminating entry */
};
......@@ -478,29 +553,6 @@ static struct usb_serial_device_type keyspan_usa19_device = {
};
static struct usb_serial_device_type keyspan_usa19w_device = {
owner: THIS_MODULE,
name: "Keyspan USA19W",
id_table: keyspan_usa19w_ids,
num_interrupt_in: NUM_DONT_CARE,
num_bulk_in: 3,
num_bulk_out: 4,
num_ports: 1,
open: keyspan_open,
close: keyspan_close,
write: keyspan_write,
write_room: keyspan_write_room,
chars_in_buffer: keyspan_chars_in_buffer,
throttle: keyspan_rx_throttle,
unthrottle: keyspan_rx_unthrottle,
ioctl: keyspan_ioctl,
set_termios: keyspan_set_termios,
break_ctl: keyspan_break_ctl,
startup: keyspan_startup,
shutdown: keyspan_shutdown,
};
static struct usb_serial_device_type keyspan_usa28_device = {
owner: THIS_MODULE,
name: "Keyspan USA28",
......@@ -511,9 +563,15 @@ static struct usb_serial_device_type keyspan_usa28_device = {
num_ports: 2,
open: keyspan_open,
close: keyspan_close,
write: keyspan_write,
write_room: keyspan_write_room,
chars_in_buffer: keyspan_chars_in_buffer,
throttle: keyspan_rx_throttle,
unthrottle: keyspan_rx_unthrottle,
ioctl: keyspan_ioctl,
set_termios: keyspan_set_termios,
startup: keyspan_startup,
shutdown: keyspan_shutdown,
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -44,7 +44,7 @@
Buffer formats for RX/TX data messages are not defined by
a structure, but are described here:
USB OUT (host -> USA26, transmit) messages contain a
USB OUT (host -> USAxx, transmit) messages contain a
REQUEST_ACK indicator (set to 0xff to request an ACK at the
completion of transmit; 0x00 otherwise), followed by data:
......@@ -52,25 +52,48 @@
with a total data length of 63.
USB IN (USA26 -> host, receive) messages contain either a zero
flag (indicating no error in any data bytes):
USB IN (USAxx -> host, receive) messages begin with a status
byte in which the 0x80 bit is either:
00 DAT DAT DAT ...
(a) 0x80 bit clear
indicates that the bytes following it are all data
bytes:
for a total of 63 data bytes, or a non-zero status flag (indicating
that all data bytes will be preceded by status flag):
STAT DATA DATA DATA DATA DATA ...
STAT DAT STAT DAT STAT DAT ...
for a total of up to 63 DATA bytes,
for a total of 32 data bytes. The valid bits in the STAT bytes are:
or:
(b) 0x80 bit set
indiates that the bytes following alternate data and
status bytes:
STAT DATA STAT DATA STAT DATA STAT DATA ...
for a total of up to 32 DATA bytes.
The valid bits in the STAT bytes are:
OVERRUN 0x02
PARITY 0x04
FRAMING 0x08
BREAK 0x10
Note: a "no status" RX data message (first byte zero) can serve as
a "break off" indicator.
Notes:
(1) The OVERRUN bit can appear in either (a) or (b) format
messages, but the but the PARITY/FRAMING/BREAK bits
only appear in (b) format messages.
(2) For the host to determine the exact point at which the
overrun occurred (to identify the point in the data
stream at which the data was lost), it needs to count
128 characters, starting at the first character of the
message in which OVERRUN was reported; the lost character(s)
would have been received between the 128th and 129th
characters.
(3) An RX data message in which the first byte has 0x80 clear
serves as a "break off" indicator.
revision history:
......@@ -80,6 +103,7 @@
1999apr14 add resetDataToggle to control message
2000jan04 merge with usa17msg.h
2000jun01 add extended BSD-style copyright text
2001jul05 change message format to improve OVERRUN case
Note on shared names:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -41,14 +41,10 @@
4th revision: USA49W version
See usa26msg.h for description of message formats
Third revision: USA28X version (aka USA26)
Buffer formats for RX/TX data messages are not defined by
a structure, but are described here:
USB OUT (host -> USA26, transmit) messages contain a
USB OUT (host -> USAxx, transmit) messages contain a
REQUEST_ACK indicator (set to 0xff to request an ACK at the
completion of transmit; 0x00 otherwise), followed by data:
......@@ -56,17 +52,28 @@
with a total data length of 63.
USB IN (USA26 -> host, receive) messages contain either a zero
flag (indicating no error in any data bytes):
USB IN (USAxx -> host, receive) messages begin with a status
byte in which the 0x80 bit is either:
(a) 0x80 bit clear
indicates that the bytes following it are all data
bytes:
STAT DATA DATA DATA DATA DATA ...
for a total of up to 63 DATA bytes,
or:
00 DAT DAT DAT ...
(b) 0x80 bit set
indiates that the bytes following alternate data and
status bytes:
for a total of 63 data bytes, or a non-zero status flag (indicating
that all data bytes will be preceded by status flag):
STAT DATA STAT DATA STAT DATA STAT DATA ...
STAT DAT STAT DAT STAT DAT ...
for a total of up to 32 DATA bytes.
for a total of 32 data bytes. The valid bits in the STAT bytes are:
The valid bits in the STAT bytes are:
OVERRUN 0x02
PARITY 0x04
......@@ -75,9 +82,19 @@
Notes:
1. a "no status" RX data message (first byte zero) can serve as
a "break off" indicator.
2. a control message specifying disablePort will be answered
(1) The OVERRUN bit can appear in either (a) or (b) format
messages, but the but the PARITY/FRAMING/BREAK bits
only appear in (b) format messages.
(2) For the host to determine the exact point at which the
overrun occurred (to identify the point in the data
stream at which the data was lost), it needs to count
128 characters, starting at the first character of the
message in which OVERRUN was reported; the lost character(s)
would have been received between the 128th and 129th
characters.
(3) An RX data message in which the first byte has 0x80 clear
serves as a "break off" indicator.
(4) a control message specifying disablePort will be answered
with a status message, but no further status will be sent
until a control messages with enablePort is sent
......@@ -92,6 +109,7 @@
2000mar09 change to support 4 ports
2000may03 change external clocking to match USA-49W hardware
2000jun01 add extended BSD-style copyright text
2001jul05 change message format to improve OVERRUN case
*/
#ifndef __USA49MSG__
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment