ChangeSet 1.1122.1.2, 2003/04/21 15:53:39-07:00, lucy@innosys.com [PATCH] USB: keyspan driver fixes Here are patches for keyspan.c and keyspan.h against 2.4.20 with pre7 patches applied. The fixes: - fix multi-port open control message delayed. (When multiple ports were opened one immediately following the other, only the first port opened successfully). - fix entries for the 'mpr'. (Were incorrect/incomplete.) drivers/usb/serial/keyspan.c | 15 +++++++++------ drivers/usb/serial/keyspan.h | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 7 deletions(-) diff -Nru a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c --- a/drivers/usb/serial/keyspan.c Wed Apr 23 10:50:30 2003 +++ b/drivers/usb/serial/keyspan.c Wed Apr 23 10:50:30 2003 @@ -28,6 +28,9 @@ Change History + 2003Apr16 LPM (Keyspan) fix delayed control message resend for multi-port + 'Open' case. Fix 'mpr' entries in keyspan.h (previously broken) + Wed Feb 19 22:00:00 PST 2003 (Jeffrey S. Laing ) Merged the current (1/31/03) Keyspan code with the current (2.4.21-pre4) Linux source tree. The Linux tree lacked support for the 49WLC and @@ -1427,8 +1430,8 @@ } /* Save reset port val for resend. - Don't overwrite resend for close condition. */ - if (p_priv->resend_cont != 3) + Don't overwrite resend for open/close condition. */ + if ((reset_port + 1) > p_priv->resend_cont) p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { /* dbg ("%s - already writing", __FUNCTION__); */ @@ -1577,8 +1580,8 @@ } /* Save reset port val for resend. - Don't overwrite resend for close condition. */ - if (p_priv->resend_cont != 3) + Don't overwrite resend for open/close condition. */ + if ((reset_port + 1) > p_priv->resend_cont) p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { dbg ("%s already writing", __FUNCTION__); @@ -1709,8 +1712,8 @@ } /* Save reset port val for resend. - Don't overwrite resend for close condition. */ - if (p_priv->resend_cont != 3) + Don't overwrite resend for open/close condition. */ + if ((reset_port+1) > p_priv->resend_cont) p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { /* dbg ("%s - already writing", __FUNCTION__); */ diff -Nru a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h --- a/drivers/usb/serial/keyspan.h Wed Apr 23 10:50:30 2003 +++ b/drivers/usb/serial/keyspan.h Wed Apr 23 10:50:30 2003 @@ -312,6 +312,23 @@ baudclk: KEYSPAN_USA19_BAUDCLK, }; +static const struct keyspan_device_details mpr_device_details = { + product_id: keyspan_mpr_product_id, + msg_format: msg_usa28, + num_ports: 1, + indat_endp_flip: 1, + outdat_endp_flip: 1, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {0x83}, + outcont_endpoints: {0x03}, + instat_endpoint: 0x84, + glocont_endpoint: -1, + calculate_baud_rate: keyspan_usa28_calc_baud, + baudclk: KEYSPAN_USA19_BAUDCLK, +}; + + static const struct keyspan_device_details usa19qw_device_details = { product_id: keyspan_usa19qw_product_id, msg_format: msg_usa26, @@ -430,6 +447,7 @@ &usa18x_device_details, &usa19_device_details, &usa19qi_device_details, + &mpr_device_details, &usa19qw_device_details, &usa19w_device_details, &usa28_device_details, @@ -494,7 +512,7 @@ { 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) }, - { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, { } /* Terminating entry */ };