~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/drivers/usb/pegasus.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  Copyright (c) 1999,2000 Petko Manolov - Petkan (petkan@dce.bg)
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License as published by
  6  * the Free Software Foundation; either version 2 of the License, or
  7  * (at your option) any later version.
  8  *
  9  * This program is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12  * GNU General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU General Public License
 15  * along with this program; if not, write to the Free Software
 16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 17  */
 18 
 19 
 20 #ifndef PEGASUS_DEV
 21 
 22 #define PEGASUS_II              0x80000000
 23 #define HAS_HOME_PNA            0x40000000
 24 
 25 #define PEGASUS_MTU             1500
 26 #define PEGASUS_MAX_MTU         1536
 27 
 28 #define EPROM_WRITE             0x01
 29 #define EPROM_READ              0x02
 30 #define EPROM_DONE              0x04
 31 #define EPROM_WR_ENABLE         0x10
 32 #define EPROM_LOAD              0x20
 33 
 34 #define MII_BMCR                0x00
 35 #define MII_BMSR                0x01
 36 #define BMSR_MEDIA              0x7808
 37 #define MII_ANLPA               0x05
 38 #define ANLPA_100TX_FD          0x0100
 39 #define ANLPA_100TX_HD          0x0080
 40 #define ANLPA_10T_FD            0x0040
 41 #define ANLPA_10T_HD            0x0020
 42 #define PHY_DONE                0x80
 43 #define PHY_READ                0x40
 44 #define PHY_WRITE               0x20
 45 #define DEFAULT_GPIO_RESET      0x24
 46 #define LINKSYS_GPIO_RESET      0x24
 47 #define DEFAULT_GPIO_SET        0x26
 48 
 49 #define PEGASUS_PRESENT         0x00000001
 50 #define PEGASUS_RUNNING         0x00000002
 51 #define PEGASUS_TX_BUSY         0x00000004
 52 #define PEGASUS_RX_BUSY         0x00000008
 53 #define CTRL_URB_RUNNING        0x00000010
 54 #define CTRL_URB_SLEEP          0x00000020
 55 #define PEGASUS_UNPLUG          0x00000040
 56 #define ETH_REGS_CHANGE         0x40000000
 57 #define ETH_REGS_CHANGED        0x80000000
 58 
 59 #define RX_MULTICAST            2
 60 #define RX_PROMISCUOUS          4
 61 
 62 #define REG_TIMEOUT             (HZ)
 63 #define PEGASUS_TX_TIMEOUT      (HZ*10)
 64 
 65 #define TX_UNDERRUN             0x80
 66 #define EXCESSIVE_COL           0x40
 67 #define LATE_COL                0x20
 68 #define NO_CARRIER              0x10
 69 #define LOSS_CARRIER            0x08
 70 #define JABBER_TIMEOUT          0x04
 71 
 72 #define PEGASUS_REQT_READ       0xc0
 73 #define PEGASUS_REQT_WRITE      0x40
 74 #define PEGASUS_REQ_GET_REGS    0xf0
 75 #define PEGASUS_REQ_SET_REGS    0xf1
 76 #define PEGASUS_REQ_SET_REG     PEGASUS_REQ_SET_REGS
 77 #define ALIGN(x)                x __attribute__((aligned(L1_CACHE_BYTES)))
 78 
 79 enum pegasus_registers {
 80         EthCtrl0 = 0,
 81         EthCtrl1 = 1,
 82         EthCtrl2 = 2,
 83         EthID = 0x10,
 84         Reg1d = 0x1d,
 85         EpromOffset = 0x20,
 86         EpromData = 0x21,       /* 0x21 low, 0x22 high byte */
 87         EpromCtrl = 0x23,
 88         PhyAddr = 0x25,
 89         PhyData = 0x26,         /* 0x26 low, 0x27 high byte */
 90         PhyCtrl = 0x28,
 91         UsbStst = 0x2a,
 92         EthTxStat0 = 0x2b,
 93         EthTxStat1 = 0x2c,
 94         EthRxStat = 0x2d,
 95         Reg7b = 0x7b,
 96         Gpio0 = 0x7e,
 97         Gpio1 = 0x7f,
 98         Reg81 = 0x81,
 99 };
100 
101 
102 typedef struct pegasus {
103         struct usb_device       *usb;
104         struct net_device       *net;
105         struct net_device_stats stats;
106         unsigned                flags;
107         unsigned                features;
108         int                     dev_index;
109         int                     intr_interval;
110         struct urb              ctrl_urb, rx_urb, tx_urb, intr_urb;
111         devrequest              dr;
112         wait_queue_head_t       ctrl_wait;
113         struct semaphore        ctrl_sem;
114         unsigned char           ALIGN(rx_buff[PEGASUS_MAX_MTU]);
115         unsigned char           ALIGN(tx_buff[PEGASUS_MAX_MTU]);
116         unsigned char           ALIGN(intr_buff[8]);
117         __u8                    eth_regs[4];
118         __u8                    phy;
119         __u8                    gpio_res;
120 } pegasus_t;
121 
122 
123 struct usb_eth_dev {
124         char    *name;
125         __u16   vendor;
126         __u16   device;
127         __u32   private; /* LSB is gpio reset value */
128 };
129 
130 
131 #define VENDOR_ACCTON           0x083a
132 #define VENDOR_ADMTEK           0x07a6
133 #define VENDOR_BILLIONTON       0x08dd
134 #define VENDOR_COREGA           0x07aa
135 #define VENDOR_DLINK1           0x2001
136 #define VENDOR_DLINK2           0x07b8
137 #define VENDOR_IODATA           0x04bb
138 #define VENDOR_LANEED           0x056e
139 #define VENDOR_LINKSYS          0x066b
140 #define VENDOR_MELCO            0x0411
141 #define VENDOR_SMC              0x0707
142 #define VENDOR_SOHOWARE         0x15e8
143 
144 
145 #else   /* PEGASUS_DEV */
146 
147 
148 PEGASUS_DEV( "Accton USB 10/100 Ethernet Adapter", VENDOR_ACCTON, 0x1046,
149                 DEFAULT_GPIO_RESET )
150 PEGASUS_DEV( "ADMtek ADM8511 \"Pegasus II\" USB Ethernet",
151                 VENDOR_ADMTEK, 0x8511,
152                 DEFAULT_GPIO_RESET | PEGASUS_II )
153 PEGASUS_DEV( "ADMtek AN986 \"Pegasus\" USB Ethernet (eval board)",
154                 VENDOR_ADMTEK, 0x0986,
155                 DEFAULT_GPIO_RESET | HAS_HOME_PNA )
156 PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
157                 DEFAULT_GPIO_RESET )
158 PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
159                 DEFAULT_GPIO_RESET | HAS_HOME_PNA )
160 PEGASUS_DEV( "Billionton USBEL-100", VENDOR_BILLIONTON, 0x0988,
161                 DEFAULT_GPIO_RESET )
162 PEGASUS_DEV( "Billionton USBE-100", VENDOR_BILLIONTON, 0x8511,
163                 DEFAULT_GPIO_RESET | PEGASUS_II )
164 PEGASUS_DEV( "Corega FEter USB-TX", VENDOR_COREGA, 0x0004,
165                 DEFAULT_GPIO_RESET )
166 PEGASUS_DEV( "D-Link DSB-650TX", VENDOR_DLINK1, 0x4001,
167                 LINKSYS_GPIO_RESET )
168 PEGASUS_DEV( "D-Link DSB-650TX", VENDOR_DLINK1, 0x4002,
169                 LINKSYS_GPIO_RESET )
170 PEGASUS_DEV( "D-Link DSB-650TX(PNA)", VENDOR_DLINK1, 0x4003,
171                 DEFAULT_GPIO_RESET | HAS_HOME_PNA )
172 PEGASUS_DEV( "D-Link DSB-650", VENDOR_DLINK1, 0xabc1,
173                 DEFAULT_GPIO_RESET )
174 PEGASUS_DEV( "D-Link DU-E10", VENDOR_DLINK2, 0xabc1,
175                 DEFAULT_GPIO_RESET )
176 PEGASUS_DEV( "D-Link DU-E100", VENDOR_DLINK2, 0x4002,
177                 DEFAULT_GPIO_RESET )
178 PEGASUS_DEV( "IO DATA USB ET/TX", VENDOR_IODATA, 0x0904,
179                 DEFAULT_GPIO_RESET )
180 PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002,
181                 DEFAULT_GPIO_RESET )
182 PEGASUS_DEV( "Linksys USB10TX", VENDOR_LINKSYS, 0x2202,
183                 LINKSYS_GPIO_RESET )
184 PEGASUS_DEV( "Linksys USB100TX", VENDOR_LINKSYS, 0x2203,
185                 LINKSYS_GPIO_RESET )
186 PEGASUS_DEV( "Linksys USB100TX", VENDOR_LINKSYS, 0x2204,
187                 LINKSYS_GPIO_RESET | HAS_HOME_PNA )
188 PEGASUS_DEV( "Linksys USB Ethernet Adapter", VENDOR_LINKSYS, 0x2206,
189                 LINKSYS_GPIO_RESET )
190 PEGASUS_DEV( "MELCO/BUFFALO LUA-TX", VENDOR_MELCO, 0x0001,
191                 DEFAULT_GPIO_RESET )
192 PEGASUS_DEV( "SMC 202 USB Ethernet", VENDOR_SMC, 0x0200,
193                 DEFAULT_GPIO_RESET )
194 PEGASUS_DEV( "SOHOware NUB100 Ethernet", VENDOR_SOHOWARE, 0x9100,
195                 DEFAULT_GPIO_RESET )
196 
197 
198 #endif  /* PEGASUS_DEV */
199 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.