Commit 16c8d5e7 authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

Various USB related patches

- Add support for mpc8xx USB device.
- Add support for Common Device Class - Abstract Control Model USB console.
- Add support for flow control in USB slave devices.
- Add support for switching between gserial and cdc_acm using environment.
- Minor changes to usbdcore_omap1510.c usbdcore_omap1510.h
- Update usbcore slightly to ease host enumeration.
- Fix non-portable endian problems in usbdcore and usbdcore_ep0.
- Add AdderUSB_config as a defconfig to enable usage of the USB console
  by default with the Adder87x U-Boot port.
Patches by Bryan O'Donoghue <bodonoghue@codehermit.ie>, 29 May 2006
parent 81d72d7e
......@@ -2,6 +2,18 @@
Changes since U-Boot 1.1.4:
======================================================================
* Various USB related patches
- Add support for mpc8xx USB device.
- Add support for Common Device Class - Abstract Control Model USB console.
- Add support for flow control in USB slave devices.
- Add support for switching between gserial and cdc_acm using environment.
- Minor changes to usbdcore_omap1510.c usbdcore_omap1510.h
- Update usbcore slightly to ease host enumeration.
- Fix non-portable endian problems in usbdcore and usbdcore_ep0.
- Add AdderUSB_config as a defconfig to enable usage of the USB console
by default with the Adder87x U-Boot port.
Patch by Bryan O'Donoghue <bodonoghue@codehermit.ie>, 29 May 2006
* Fix PCI to memory window size problems on PM82x boards
We use the "automatic" mode that was used for the MPC8266ADS and
MPC8272 boards. Eventually this should be used on all boards?]
......
......@@ -58,7 +58,7 @@ ifeq ($(HOSTARCH),ppc)
CROSS_COMPILE =
else
ifeq ($(ARCH),ppc)
CROSS_COMPILE = powerpc-linux-
CROSS_COMPILE = ppc_8xx-
endif
ifeq ($(ARCH),arm)
CROSS_COMPILE = arm-linux-
......@@ -437,6 +437,9 @@ AdderII_config \
@echo "#define CONFIG_MPC852T" > include/config.h)
@./mkconfig -a Adder ppc mpc8xx adder
AdderUSB_config: unconfig
@./mkconfig -a AdderUSB ppc mpc8xx adder
ADS860_config \
FADS823_config \
FADS850SAR_config \
......
......@@ -862,7 +862,69 @@ The following options need to be configured:
for differential drivers: 0x00001000
for single ended drivers: 0x00005000
- USB Device:
Define the below if you wish to use the USB console.
Once firmware is rebuilt from a serial console issue the
command "setenv stdin usbtty; setenv stdout usbtty" and
attach your usb cable. The Unix command "dmesg" should print
it has found a new device. The environment variable usbtty
can be set to gserial or cdc_acm to enable your device to
appear to a USB host as a Linux gserial device or a
Common Device Class Abstract Control Model serial device.
If you select usbtty = gserial you should be able to enumerate
a Linux host by
# modprobe usbserial vendor=0xVendorID product=0xProductID
else if using cdc_acm, simply setting the environment
variable usbtty to be cdc_acm should suffice. The following
might be defined in YourBoardName.h
CONFIG_USB_DEVICE
Define this to build a UDC device
CONFIG_USB_TTY
Define this to have a tty type of device available to
talk to the UDC device
CFG_CONSOLE_IS_IN_ENV
Define this if you want stdin, stdout &/or stderr to
be set to usbtty.
mpc8xx:
CFG_USB_EXTC_CLK 0xBLAH
Derive USB clock from external clock "blah"
- CFG_USB_EXTC_CLK 0x02
CFG_USB_BRG_CLK 0xBLAH
Derive USB clock from brgclk
- CFG_USB_BRG_CLK 0x04
If you have a USB-IF assigned VendorID then you may wish to
define your own vendor specific values either in BoardName.h
or directly in usbd_vendor_info.h. If you don't define
CONFIG_USBD_MANUFACTURER, CONFIG_USBD_PRODUCT_NAME,
CONFIG_USBD_VENDORID and CONFIG_USBD_PRODUCTID, then U-Boot
should pretend to be a Linux device to it's target host.
CONFIG_USBD_MANUFACTURER
Define this string as the name of your company for
- CONFIG_USBD_MANUFACTURER "my company"
CONFIG_USBD_PRODUCT_NAME
Define this string as the name of your product
- CONFIG_USBD_PRODUCT_NAME "acme usb device"
CONFIG_USBD_VENDORID
Define this as your assigned Vendor ID from the USB
Implementors Forum. This *must* be a genuine Vendor ID
to avoid polluting the USB namespace.
- CONFIG_USBD_VENDORID 0xFFFF
CONFIG_USBD_PRODUCTID
Define this as the unique Product ID
for your device
- CONFIG_USBD_PRODUCTID 0xFFFF
- MMC Support:
The MMC controller on the Intel PXA is supported. To
enable this define CONFIG_MMC. The MMC can be
......
......@@ -48,7 +48,7 @@ OBJS = 3c589.o 5701rls.o ali512x.o \
ti_pci1410a.o tigon3.o tsec.o \
usb_ohci.o usbdcore.o usbdcore_ep0.o usbdcore_omap1510.o usbtty.o \
videomodes.o w83c553f.o \
ks8695eth.o
ks8695eth.o usbdcore_mpc8xx.o
all: $(LIB)
......
......@@ -2,6 +2,9 @@
* (C) Copyright 2003
* Gerry Hamel, geh@ti.com, Texas Instruments
*
* (C) Copyright 2006
* Bryan O'Donoghue, deckard@CodeHermit.ie
*
* Based on
* linux/drivers/usbd/ep0.c
*
......@@ -39,11 +42,17 @@
* function driver. This may need to change.
*
* XXX
*
* As alluded to above, a simple callback cdc_recv_setup has been implemented
* in the usb_device data structure to facilicate passing
* Common Device Class packets to a function driver.
*
* XXX
*/
#include <common.h>
#if defined(CONFIG_OMAP1510) && defined(CONFIG_USB_DEVICE)
#if defined(CONFIG_USB_DEVICE)
#include "usbdcore.h"
#if 0
......@@ -69,7 +78,7 @@ static int ep0_get_status (struct usb_device_instance *device,
char *cp;
urb->actual_length = 2;
cp = urb->buffer;
cp = (char*)urb->buffer;
cp[0] = cp[1] = 0;
switch (requesttype) {
......@@ -115,7 +124,7 @@ static int ep0_get_one (struct usb_device_instance *device, struct urb *urb,
*
* Copy configuration data to urb transfer buffer if there is room for it.
*/
static void copy_config (struct urb *urb, void *data, int max_length,
void copy_config (struct urb *urb, void *data, int max_length,
int max_buf)
{
int available;
......@@ -128,10 +137,7 @@ static void copy_config (struct urb *urb, void *data, int max_length,
dbg_ep0 (1, "data is NULL");
return;
}
if (!(length = *(unsigned char *) data)) {
dbg_ep0 (1, "length is zero");
return;
}
length = max_length;
if (length > max_length) {
dbg_ep0 (1, "length: %d >= max_length: %d", length,
......@@ -192,7 +198,7 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
/* setup tx urb */
urb->actual_length = 0;
cp = urb->buffer;
cp = (char*)urb->buffer;
dbg_ep0 (2, "%s", USBD_DEVICE_DESCRIPTORS (descriptor_type));
......@@ -200,7 +206,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
case USB_DESCRIPTOR_TYPE_DEVICE:
{
struct usb_device_descriptor *device_descriptor;
if (!
(device_descriptor =
usbd_device_device_descriptor (device, port))) {
......@@ -214,20 +219,16 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
/* correct the correct control endpoint 0 max packet size into the descriptor */
device_descriptor =
(struct usb_device_descriptor *) urb->buffer;
device_descriptor->bMaxPacketSize0 =
urb->device->bus->maxpacketsize;
}
/*dbg_ep0(3, "copied device configuration, actual_length: %x", urb->actual_length); */
dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length);
break;
case USB_DESCRIPTOR_TYPE_CONFIGURATION:
{
int bNumInterface;
struct usb_configuration_descriptor
*configuration_descriptor;
struct usb_device_descriptor *device_descriptor;
if (!
(device_descriptor =
usbd_device_device_descriptor (device, port))) {
......@@ -251,130 +252,35 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
index);
return -1;
}
dbg_ep0(0, "attempt to copy %d bytes to urb\n",cpu_to_le16(configuration_descriptor->wTotalLength));
copy_config (urb, configuration_descriptor,
sizeof (struct
usb_configuration_descriptor),
max);
/* iterate across interfaces for specified configuration */
dbg_ep0 (0, "bNumInterfaces: %d",
configuration_descriptor->bNumInterfaces);
for (bNumInterface = 0;
bNumInterface <
configuration_descriptor->bNumInterfaces;
bNumInterface++) {
int bAlternateSetting;
struct usb_interface_instance
*interface_instance;
dbg_ep0 (3, "[%d] bNumInterfaces: %d",
bNumInterface,
configuration_descriptor->bNumInterfaces);
if (! (interface_instance = usbd_device_interface_instance (device,
port, index, bNumInterface)))
{
dbg_ep0 (3, "[%d] interface_instance NULL",
bNumInterface);
return -1;
}
/* iterate across interface alternates */
for (bAlternateSetting = 0;
bAlternateSetting < interface_instance->alternates;
bAlternateSetting++) {
/*int class; */
int bNumEndpoint;
struct usb_interface_descriptor *interface_descriptor;
struct usb_alternate_instance *alternate_instance;
dbg_ep0 (3, "[%d:%d] alternates: %d",
bNumInterface,
bAlternateSetting,
interface_instance->alternates);
if (! (alternate_instance = usbd_device_alternate_instance (device, port, index, bNumInterface, bAlternateSetting))) {
dbg_ep0 (3, "[%d] alternate_instance NULL",
bNumInterface);
return -1;
}
/* copy descriptor for this interface */
copy_config (urb, alternate_instance->interface_descriptor,
sizeof (struct usb_interface_descriptor),
max);
/*dbg_ep0(3, "[%d:%d] classes: %d endpoints: %d", bNumInterface, bAlternateSetting, */
/* alternate_instance->classes, alternate_instance->endpoints); */
/* iterate across classes for this alternate interface */
#if 0
for (class = 0;
class < alternate_instance->classes;
class++) {
struct usb_class_descriptor *class_descriptor;
/*dbg_ep0(3, "[%d:%d:%d] classes: %d", bNumInterface, bAlternateSetting, */
/* class, alternate_instance->classes); */
if (!(class_descriptor = usbd_device_class_descriptor_index (device, port, index, bNumInterface, bAlternateSetting, class))) {
dbg_ep0 (3, "[%d] class NULL",
class);
return -1;
}
/* copy descriptor for this class */
copy_config (urb, class_descriptor,
sizeof (struct usb_class_descriptor),
max);
}
#endif
/* iterate across endpoints for this alternate interface */
interface_descriptor = alternate_instance->interface_descriptor;
for (bNumEndpoint = 0;
bNumEndpoint < alternate_instance->endpoints;
bNumEndpoint++) {
struct usb_endpoint_descriptor *endpoint_descriptor;
dbg_ep0 (3, "[%d:%d:%d] endpoint: %d",
bNumInterface,
bAlternateSetting,
bNumEndpoint,
interface_descriptor->
bNumEndpoints);
if (!(endpoint_descriptor = usbd_device_endpoint_descriptor_index (device, port, index, bNumInterface, bAlternateSetting, bNumEndpoint))) {
dbg_ep0 (3, "[%d] endpoint NULL",
bNumEndpoint);
return -1;
}
/* copy descriptor for this endpoint */
copy_config (urb, endpoint_descriptor,
sizeof (struct usb_endpoint_descriptor),
max);
}
}
}
dbg_ep0 (3, "lengths: %d %d",
le16_to_cpu (configuration_descriptor->wTotalLength),
urb->actual_length);
cpu_to_le16(configuration_descriptor->wTotalLength),
max);
}
break;
case USB_DESCRIPTOR_TYPE_STRING:
{
struct usb_string_descriptor *string_descriptor;
if (!(string_descriptor = usbd_get_string (index))) {
serial_printf("Invalid string index %d\n", index);
return -1;
}
/*dbg_ep0(3, "string_descriptor: %p", string_descriptor); */
dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);
copy_config (urb, string_descriptor, string_descriptor->bLength, max);
}
break;
case USB_DESCRIPTOR_TYPE_INTERFACE:
serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
return -1;
case USB_DESCRIPTOR_TYPE_ENDPOINT:
serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
return -1;
case USB_DESCRIPTOR_TYPE_HID:
{
serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
return -1; /* unsupported at this time */
#if 0
int bNumInterface =
......@@ -403,6 +309,7 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
break;
case USB_DESCRIPTOR_TYPE_REPORT:
{
serial_printf("USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
return -1; /* unsupported at this time */
#if 0
int bNumInterface =
......@@ -434,12 +341,19 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
#endif
}
break;
case USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER:
{
/* If a USB device supports both a full speed and low speed operation
* we must send a Device_Qualifier descriptor here
*/
return -1;
}
default:
return -1;
}
dbg_ep0 (1, "urb: buffer: %p buffer_length: %2d actual_length: %2d packet size: %2d",
dbg_ep0 (1, "urb: buffer: %p buffer_length: %2d actual_length: %2d tx_packetSize: %2d",
urb->buffer, urb->buffer_length, urb->actual_length,
device->bus->endpoint_array[0].tx_packetSize);
/*
......@@ -495,6 +409,12 @@ int ep0_recv_setup (struct urb *urb)
/* handle USB Standard Request (c.f. USB Spec table 9-2) */
if ((request->bmRequestType & USB_REQ_TYPE_MASK) != 0) {
if(device->device_state <= STATE_CONFIGURED){
/* Attempt to handle a CDC specific request if we are
* in the configured state.
*/
return device->cdc_recv_setup(request,urb);
}
dbg_ep0 (1, "non standard request: %x",
request->bmRequestType & USB_REQ_TYPE_MASK);
return -1; /* Stall here */
......@@ -567,6 +487,7 @@ int ep0_recv_setup (struct urb *urb)
le16_to_cpu (request->wValue) & 0xff);
case USB_REQ_GET_CONFIGURATION:
serial_printf("get config %d\n", device->configuration);
return ep0_get_one (device, urb,
device->configuration);
......@@ -642,7 +563,6 @@ int ep0_recv_setup (struct urb *urb)
/*dbg_ep0(2, "address: %d %d %d", */
/* request->wValue, le16_to_cpu(request->wValue), device->address); */
serial_printf ("DEVICE_ADDRESS_ASSIGNED.. event?\n");
return 0;
case USB_REQ_SET_DESCRIPTOR: /* XXX should we support this? */
......@@ -653,9 +573,10 @@ int ep0_recv_setup (struct urb *urb)
/* c.f. 9.4.7 - the top half of wValue is reserved */
/* */
if ((device->configuration =
le16_to_cpu (request->wValue) & 0x7f) != 0) {
le16_to_cpu (request->wValue) & 0xFF80) != 0) {
/* c.f. 9.4.7 - zero is the default or addressed state, in our case this */
/* is the same is configuration zero */
serial_printf("error setting dev->config to zero!\n");
device->configuration = 0; /* TBR - ?????? */
}
/* reset interface and alternate settings */
......
This diff is collapsed.
......@@ -645,7 +645,7 @@ static void omap1510_udc_state_changed (void)
static void omap1510_udc_setup (struct usb_endpoint_instance *endpoint)
{
UDCDBG ("-> Entering device setup");
do {
const int setup_pktsize = 8;
unsigned char *datap =
......@@ -1517,4 +1517,31 @@ void udc_startup_events (struct usb_device_instance *device)
udc_enable (device);
}
/**
* udc_irq - do pseudo interrupts
*/
void udc_irq(void)
{
/* Loop while we have interrupts.
* If we don't do this, the input chain
* polling delay is likely to miss
* host requests.
*/
while (inw (UDC_IRQ_SRC) & ~UDC_SOF_Flg) {
/* Handle any new IRQs */
omap1510_udc_irq ();
omap1510_udc_noniso_irq ();
}
}
/* Flow control */
void udc_set_nak(int epid)
{
/* TODO: implement this functionality in omap1510 */
}
void udc_unset_nak (int epid)
{
/* TODO: implement this functionality in omap1510 */
}
#endif
This diff is collapsed.
......@@ -2,6 +2,9 @@
* (C) Copyright 2003
* Gerry Hamel, geh@ti.com, Texas Instruments
*
* (C) Copyright 2006
* Bryan O'Donoghue, bodonoghue@codehermit.ie, CodeHermit
*
* 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
* the Free Software Foundation; either version 2 of the License, or
......@@ -21,44 +24,47 @@
#ifndef __USB_TTY_H__
#define __USB_TTY_H__
#include "usbdcore.h"
#if defined(CONFIG_PPC)
#include "usbdcore_mpc8xx.h"
#elif defined(CONFIG_ARM)
#include "usbdcore_omap1510.h"
#endif
#include <version_autogenerated.h>
#define NUM_CONFIGS 1
#define NUM_INTERFACES 1
#define NUM_ENDPOINTS 3
/* If no VendorID/ProductID is defined in config.h, pretend to be Linux
* DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
#define EP0_MAX_PACKET_SIZE 64
#define CONFIG_USBD_VENDORID 0x0525 /* Linux/NetChip */
#define CONFIG_USBD_PRODUCTID_GSERIAL 0xa4a6 /* gserial */
#define CONFIG_USBD_PRODUCTID_CDCACM 0xa4a7 /* CDC ACM */
#define CONFIG_USBD_MANUFACTURER "Das U-Boot"
#define CONFIG_USBD_PRODUCT_NAME U_BOOT_VERSION
#define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
#define CONFIG_USBD_INTERFACE_STR "Simple Serial Data Interface - Bulk Mode"
#define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
#define CONFIG_USBD_SERIAL_OUT_ENDPOINT 2
#define CONFIG_USBD_SERIAL_OUT_PKTSIZE 64
#define CONFIG_USBD_SERIAL_IN_ENDPOINT 1
#define CONFIG_USBD_SERIAL_IN_PKTSIZE 64
#define CONFIG_USBD_SERIAL_INT_ENDPOINT 5
#define CONFIG_USBD_SERIAL_INT_PKTSIZE 16
#define CONFIG_USBD_SERIAL_OUT_ENDPOINT UDC_OUT_ENDPOINT
#define CONFIG_USBD_SERIAL_OUT_PKTSIZE UDC_OUT_PACKET_SIZE
#define CONFIG_USBD_SERIAL_IN_ENDPOINT UDC_IN_ENDPOINT
#define CONFIG_USBD_SERIAL_IN_PKTSIZE UDC_IN_PACKET_SIZE
#define CONFIG_USBD_SERIAL_INT_ENDPOINT UDC_INT_ENDPOINT
#define CONFIG_USBD_SERIAL_INT_PKTSIZE UDC_INT_PACKET_SIZE
#define CONFIG_USBD_SERIAL_BULK_PKTSIZE UDC_BULK_PACKET_SIZE
#define USBTTY_DEVICE_CLASS COMMUNICATIONS_DEVICE_CLASS
#define USBTTY_DEVICE_SUBCLASS COMMUNICATIONS_NO_SUBCLASS
#define USBTTY_DEVICE_PROTOCOL COMMUNICATIONS_NO_PROTOCOL
#define USBTTY_INTERFACE_CLASS 0xFF /* Vendor Specific */
#define USBTTY_INTERFACE_SUBCLASS 0x02
#define USBTTY_INTERFACE_PROTOCOL 0x01
#define USBTTY_BCD_DEVICE 0x0
#define USBTTY_MAXPOWER 0x0
#define USBTTY_BCD_DEVICE 0x00
#define USBTTY_MAXPOWER 0x00
#define STR_MANUFACTURER 1
#define STR_PRODUCT 2
#define STR_SERIAL 3
#define STR_CONFIG 4
#define STR_INTERFACE 5
#define STR_LANG 0x00
#define STR_MANUFACTURER 0x01
#define STR_PRODUCT 0x02
#define STR_SERIAL 0x03
#define STR_CONFIG 0x04
#define STR_DATA_INTERFACE 0x05
#define STR_CTRL_INTERFACE 0x06
#define STR_COUNT 0x07
#endif
/*
* Copyright (C) 2006 CodeHermit.
* Bryan O'Donoghue <bodonoghue@codehermit.ie>
*
* Provides support for USB console on the Analogue & Micro Adder87x
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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 the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __ADDERUSB__
#define __ADDERUSB__
/* Include the board port */
#include "Adder.h"
#define CONFIG_USB_DEVICE /* Include UDC driver */
#define CONFIG_USB_TTY /* Bind the TTY driver to UDC */
#define CFG_USB_EXTC_CLK 0x02 /* Oscillator on EXTC_CLK 2 */
#define CFG_USB_BRG_CLK 0x04 /* or use Baud rate generator 0x04 */
#define CFG_CONSOLE_IS_IN_ENV /* Console is in env */
/* If you have a USB-IF assigned VendorID then you may wish to define
* your own vendor specific values either in BoardName.h or directly in
* usbd_vendor_info.h
*/
/*
#define CONFIG_USBD_MANUFACTURER "CodeHermit.ie"
#define CONFIG_USBD_PRODUCT_NAME "Das U-Boot"
#define CONFIG_USBD_VENDORID 0xFFFF
#define CONFIG_USBD_PRODUCTID_GSERIAL 0xFFFF
#define CONFIG_USBD_PRODUCTID_CDCACM 0xFFFE
*/
#endif /* __ADDERUSB_H__ */
/*
* (C) Copyright 2006
* Bryan O'Donoghue, deckard@codehermit.ie, CodeHermit
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
/* ACM Control Requests */
#define ACM_SEND_ENCAPSULATED_COMMAND 0x00
#define ACM_GET_ENCAPSULATED_RESPONSE 0x01
#define ACM_SET_COMM_FEATURE 0x02
#define ACM_GET_COMM_FEATRUE 0x03
#define ACM_CLEAR_COMM_FEATURE 0x04
#define ACM_SET_LINE_ENCODING 0x20
#define ACM_GET_LINE_ENCODING 0x21
#define ACM_SET_CONTROL_LINE_STATE 0x22
#define ACM_SEND_BREAK 0x23
/* ACM Notification Codes */
#define ACM_NETWORK_CONNECTION 0x00
#define ACM_RESPONSE_AVAILABLE 0x01
#define ACM_SERIAL_STATE 0x20
/* Format of response expected by a ACM_GET_LINE_ENCODING request */
struct rs232_emu{
unsigned long dter;