Commit 137dc023 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by David S. Miller

[IRDA]: Support for Sigmatel STIR421x chip

This patch enables support for the Sigmatel's STIR421x IrDA chip.
Once patched with Sigmatel's firmware, this chip "almost" follows the
USB-IrDA spec. Thus this patch is against irda-usb.[ch].

The code has been tested by Nick Fedchik on an STIR4210 chipset based
dongle.
Signed-off-by: default avatarSamuel Ortiz <samuel.ortiz@nokia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c1e14a6e
This diff is collapsed.
/***************************************************************************** /*****************************************************************************
* *
* Filename: irda-usb.h * Filename: irda-usb.h
* Version: 0.9b * Version: 0.10
* Description: IrDA-USB Driver * Description: IrDA-USB Driver
* Status: Experimental * Status: Experimental
* Author: Dag Brattli <dag@brattli.net> * Author: Dag Brattli <dag@brattli.net>
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* Copyright (C) 2001, Roman Weissgaerber <weissg@vienna.at> * Copyright (C) 2001, Roman Weissgaerber <weissg@vienna.at>
* Copyright (C) 2000, Dag Brattli <dag@brattli.net> * Copyright (C) 2000, Dag Brattli <dag@brattli.net>
* Copyright (C) 2001, Jean Tourrilhes <jt@hpl.hp.com> * Copyright (C) 2001, Jean Tourrilhes <jt@hpl.hp.com>
* Copyright (C) 2004, SigmaTel, Inc. <irquality@sigmatel.com>
* Copyright (C) 2005, Milan Beno <beno@pobox.sk>
* Copyright (C) 2006, Nick FEdchik <nick@fedchik.org.ua>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -31,6 +34,9 @@ ...@@ -31,6 +34,9 @@
#include <net/irda/irda.h> #include <net/irda/irda.h>
#include <net/irda/irda_device.h> /* struct irlap_cb */ #include <net/irda/irda_device.h> /* struct irlap_cb */
#define PATCH_FILE_SIZE_MAX 65536
#define PATCH_FILE_SIZE_MIN 80
#define RX_COPY_THRESHOLD 200 #define RX_COPY_THRESHOLD 200
#define IRDA_USB_MAX_MTU 2051 #define IRDA_USB_MAX_MTU 2051
#define IRDA_USB_SPEED_MTU 64 /* Weird, but work like this */ #define IRDA_USB_SPEED_MTU 64 /* Weird, but work like this */
...@@ -88,6 +94,7 @@ ...@@ -88,6 +94,7 @@
#define SPEED_576000 0x07 #define SPEED_576000 0x07
#define SPEED_1152000 0x08 #define SPEED_1152000 0x08
#define SPEED_4000000 0x09 #define SPEED_4000000 0x09
#define SPEED_16000000 0x0a
/* Basic capabilities */ /* Basic capabilities */
#define IUC_DEFAULT 0x00 /* Basic device compliant with 1.0 spec */ #define IUC_DEFAULT 0x00 /* Basic device compliant with 1.0 spec */
...@@ -100,11 +107,14 @@ ...@@ -100,11 +107,14 @@
#define IUC_SMALL_PKT 0x10 /* Device doesn't behave with big Rx packets */ #define IUC_SMALL_PKT 0x10 /* Device doesn't behave with big Rx packets */
#define IUC_MAX_WINDOW 0x20 /* Device underestimate the Rx window */ #define IUC_MAX_WINDOW 0x20 /* Device underestimate the Rx window */
#define IUC_MAX_XBOFS 0x40 /* Device need more xbofs than advertised */ #define IUC_MAX_XBOFS 0x40 /* Device need more xbofs than advertised */
#define IUC_STIR_4210 0x80 /* SigmaTel 4210/4220/4116 VFIR */
/* USB class definitions */ /* USB class definitions */
#define USB_IRDA_HEADER 0x01 #define USB_IRDA_HEADER 0x01
#define USB_CLASS_IRDA 0x02 /* USB_CLASS_APP_SPEC subclass */ #define USB_CLASS_IRDA 0x02 /* USB_CLASS_APP_SPEC subclass */
#define USB_DT_IRDA 0x21 #define USB_DT_IRDA 0x21
#define USB_IRDA_SIGMATEL_HEADER 0x03
#define IU_SIGMATEL_MAX_RX_URBS (IU_MAX_ACTIVE_RX_URBS + USB_IRDA_SIGMATEL_HEADER)
struct irda_class_desc { struct irda_class_desc {
__u8 bLength; __u8 bLength;
...@@ -123,6 +133,7 @@ struct irda_class_desc { ...@@ -123,6 +133,7 @@ struct irda_class_desc {
* (6.2.5, USB-IrDA class spec 1.0) */ * (6.2.5, USB-IrDA class spec 1.0) */
#define IU_REQ_GET_CLASS_DESC 0x06 #define IU_REQ_GET_CLASS_DESC 0x06
#define STIR421X_MAX_PATCH_DOWNLOAD_SIZE 1023
struct irda_usb_cb { struct irda_usb_cb {
struct irda_class_desc *irda_desc; struct irda_class_desc *irda_desc;
...@@ -136,7 +147,8 @@ struct irda_usb_cb { ...@@ -136,7 +147,8 @@ struct irda_usb_cb {
__u16 bulk_out_mtu; /* Max Tx packet size in bytes */ __u16 bulk_out_mtu; /* Max Tx packet size in bytes */
__u8 bulk_int_ep; /* Interrupt Endpoint assignments */ __u8 bulk_int_ep; /* Interrupt Endpoint assignments */
struct urb *rx_urb[IU_MAX_RX_URBS]; /* URBs used to receive data frames */ __u8 max_rx_urb;
struct urb **rx_urb; /* URBs used to receive data frames */
struct urb *idle_rx_urb; /* Pointer to idle URB in Rx path */ struct urb *idle_rx_urb; /* Pointer to idle URB in Rx path */
struct urb *tx_urb; /* URB used to send data frames */ struct urb *tx_urb; /* URB used to send data frames */
struct urb *speed_urb; /* URB used to send speed commands */ struct urb *speed_urb; /* URB used to send speed commands */
...@@ -157,6 +169,9 @@ struct irda_usb_cb { ...@@ -157,6 +169,9 @@ struct irda_usb_cb {
__u32 speed; /* Current speed */ __u32 speed; /* Current speed */
__s32 new_speed; /* speed we need to set */ __s32 new_speed; /* speed we need to set */
__u8 header_length; /* USB-IrDA frame header size */
int needspatch; /* device needs firmware patch */
struct timer_list rx_defer_timer; /* Wait for Rx error to clear */ struct timer_list rx_defer_timer; /* Wait for Rx error to clear */
}; };
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