pcnet_cs.c 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701
  1. /*======================================================================
  2. A PCMCIA ethernet driver for NS8390-based cards
  3. This driver supports the D-Link DE-650 and Linksys EthernetCard
  4. cards, the newer D-Link and Linksys combo cards, Accton EN2212
  5. cards, the RPTI EP400, and the PreMax PE-200 in non-shared-memory
  6. mode, and the IBM Credit Card Adapter, the NE4100, the Thomas
  7. Conrad ethernet card, and the Kingston KNE-PCM/x in shared-memory
  8. mode. It will also handle the Socket EA card in either mode.
  9. Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
  10. pcnet_cs.c 1.153 2003/11/09 18:53:09
  11. The network driver code is based on Donald Becker's NE2000 code:
  12. Written 1992,1993 by Donald Becker.
  13. Copyright 1993 United States Government as represented by the
  14. Director, National Security Agency. This software may be used and
  15. distributed according to the terms of the GNU General Public License,
  16. incorporated herein by reference.
  17. Donald Becker may be reached at becker@scyld.com
  18. Based also on Keith Moore's changes to Don Becker's code, for IBM
  19. CCAE support. Drivers merged back together, and shared-memory
  20. Socket EA support added, by Ken Raeburn, September 1995.
  21. ======================================================================*/
  22. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  23. #include <linux/kernel.h>
  24. #include <linux/module.h>
  25. #include <linux/ptrace.h>
  26. #include <linux/string.h>
  27. #include <linux/timer.h>
  28. #include <linux/delay.h>
  29. #include <linux/netdevice.h>
  30. #include <linux/log2.h>
  31. #include <linux/etherdevice.h>
  32. #include <linux/mii.h>
  33. #include "8390.h"
  34. #include <pcmcia/cistpl.h>
  35. #include <pcmcia/ciscode.h>
  36. #include <pcmcia/ds.h>
  37. #include <pcmcia/cisreg.h>
  38. #include <asm/io.h>
  39. #include <asm/byteorder.h>
  40. #include <asm/uaccess.h>
  41. #define PCNET_CMD 0x00
  42. #define PCNET_DATAPORT 0x10 /* NatSemi-defined port window offset. */
  43. #define PCNET_RESET 0x1f /* Issue a read to reset, a write to clear. */
  44. #define PCNET_MISC 0x18 /* For IBM CCAE and Socket EA cards */
  45. #define PCNET_START_PG 0x40 /* First page of TX buffer */
  46. #define PCNET_STOP_PG 0x80 /* Last page +1 of RX ring */
  47. /* Socket EA cards have a larger packet buffer */
  48. #define SOCKET_START_PG 0x01
  49. #define SOCKET_STOP_PG 0xff
  50. #define PCNET_RDC_TIMEOUT (2*HZ/100) /* Max wait in jiffies for Tx RDC */
  51. static const char *if_names[] = { "auto", "10baseT", "10base2"};
  52. static u32 pcnet_msg_enable;
  53. /*====================================================================*/
  54. /* Module parameters */
  55. MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
  56. MODULE_DESCRIPTION("NE2000 compatible PCMCIA ethernet driver");
  57. MODULE_LICENSE("GPL");
  58. #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
  59. INT_MODULE_PARM(if_port, 1); /* Transceiver type */
  60. INT_MODULE_PARM(use_big_buf, 1); /* use 64K packet buffer? */
  61. INT_MODULE_PARM(mem_speed, 0); /* shared mem speed, in ns */
  62. INT_MODULE_PARM(delay_output, 0); /* pause after xmit? */
  63. INT_MODULE_PARM(delay_time, 4); /* in usec */
  64. INT_MODULE_PARM(use_shmem, -1); /* use shared memory? */
  65. INT_MODULE_PARM(full_duplex, 0); /* full duplex? */
  66. /* Ugh! Let the user hardwire the hardware address for queer cards */
  67. static int hw_addr[6] = { 0, /* ... */ };
  68. module_param_array(hw_addr, int, NULL, 0);
  69. /*====================================================================*/
  70. static void mii_phy_probe(struct net_device *dev);
  71. static int pcnet_config(struct pcmcia_device *link);
  72. static void pcnet_release(struct pcmcia_device *link);
  73. static int pcnet_open(struct net_device *dev);
  74. static int pcnet_close(struct net_device *dev);
  75. static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  76. static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
  77. static void ei_watchdog(u_long arg);
  78. static void pcnet_reset_8390(struct net_device *dev);
  79. static int set_config(struct net_device *dev, struct ifmap *map);
  80. static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
  81. int stop_pg, int cm_offset);
  82. static int setup_dma_config(struct pcmcia_device *link, int start_pg,
  83. int stop_pg);
  84. static void pcnet_detach(struct pcmcia_device *p_dev);
  85. /*====================================================================*/
  86. struct hw_info {
  87. u_int offset;
  88. u_char a0, a1, a2;
  89. u_int flags;
  90. };
  91. #define DELAY_OUTPUT 0x01
  92. #define HAS_MISC_REG 0x02
  93. #define USE_BIG_BUF 0x04
  94. #define HAS_IBM_MISC 0x08
  95. #define IS_DL10019 0x10
  96. #define IS_DL10022 0x20
  97. #define HAS_MII 0x40
  98. #define USE_SHMEM 0x80 /* autodetected */
  99. #define AM79C9XX_HOME_PHY 0x00006B90 /* HomePNA PHY */
  100. #define AM79C9XX_ETH_PHY 0x00006B70 /* 10baseT PHY */
  101. #define MII_PHYID_REV_MASK 0xfffffff0
  102. #define MII_PHYID_REG1 0x02
  103. #define MII_PHYID_REG2 0x03
  104. static struct hw_info hw_info[] = {
  105. { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT },
  106. { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },
  107. { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 },
  108. { /* ASANTE FriendlyNet */ 0x4910, 0x00, 0x00, 0x94,
  109. DELAY_OUTPUT | HAS_IBM_MISC },
  110. { /* Danpex EN-6200P2 */ 0x0110, 0x00, 0x40, 0xc7, 0 },
  111. { /* DataTrek NetCard */ 0x0ff0, 0x00, 0x20, 0xe8, 0 },
  112. { /* Dayna CommuniCard E */ 0x0110, 0x00, 0x80, 0x19, 0 },
  113. { /* D-Link DE-650 */ 0x0040, 0x00, 0x80, 0xc8, 0 },
  114. { /* EP-210 Ethernet */ 0x0110, 0x00, 0x40, 0x33, 0 },
  115. { /* EP4000 Ethernet */ 0x01c0, 0x00, 0x00, 0xb4, 0 },
  116. { /* Epson EEN10B */ 0x0ff0, 0x00, 0x00, 0x48,
  117. HAS_MISC_REG | HAS_IBM_MISC },
  118. { /* ELECOM Laneed LD-CDWA */ 0xb8, 0x08, 0x00, 0x42, 0 },
  119. { /* Hypertec Ethernet */ 0x01c0, 0x00, 0x40, 0x4c, 0 },
  120. { /* IBM CCAE */ 0x0ff0, 0x08, 0x00, 0x5a,
  121. HAS_MISC_REG | HAS_IBM_MISC },
  122. { /* IBM CCAE */ 0x0ff0, 0x00, 0x04, 0xac,
  123. HAS_MISC_REG | HAS_IBM_MISC },
  124. { /* IBM CCAE */ 0x0ff0, 0x00, 0x06, 0x29,
  125. HAS_MISC_REG | HAS_IBM_MISC },
  126. { /* IBM FME */ 0x0374, 0x08, 0x00, 0x5a,
  127. HAS_MISC_REG | HAS_IBM_MISC },
  128. { /* IBM FME */ 0x0374, 0x00, 0x04, 0xac,
  129. HAS_MISC_REG | HAS_IBM_MISC },
  130. { /* Kansai KLA-PCM/T */ 0x0ff0, 0x00, 0x60, 0x87,
  131. HAS_MISC_REG | HAS_IBM_MISC },
  132. { /* NSC DP83903 */ 0x0374, 0x08, 0x00, 0x17,
  133. HAS_MISC_REG | HAS_IBM_MISC },
  134. { /* NSC DP83903 */ 0x0374, 0x00, 0xc0, 0xa8,
  135. HAS_MISC_REG | HAS_IBM_MISC },
  136. { /* NSC DP83903 */ 0x0374, 0x00, 0xa0, 0xb0,
  137. HAS_MISC_REG | HAS_IBM_MISC },
  138. { /* NSC DP83903 */ 0x0198, 0x00, 0x20, 0xe0,
  139. HAS_MISC_REG | HAS_IBM_MISC },
  140. { /* I-O DATA PCLA/T */ 0x0ff0, 0x00, 0xa0, 0xb0, 0 },
  141. { /* Katron PE-520 */ 0x0110, 0x00, 0x40, 0xf6, 0 },
  142. { /* Kingston KNE-PCM/x */ 0x0ff0, 0x00, 0xc0, 0xf0,
  143. HAS_MISC_REG | HAS_IBM_MISC },
  144. { /* Kingston KNE-PCM/x */ 0x0ff0, 0xe2, 0x0c, 0x0f,
  145. HAS_MISC_REG | HAS_IBM_MISC },
  146. { /* Kingston KNE-PC2 */ 0x0180, 0x00, 0xc0, 0xf0, 0 },
  147. { /* Maxtech PCN2000 */ 0x5000, 0x00, 0x00, 0xe8, 0 },
  148. { /* NDC Instant-Link */ 0x003a, 0x00, 0x80, 0xc6, 0 },
  149. { /* NE2000 Compatible */ 0x0ff0, 0x00, 0xa0, 0x0c, 0 },
  150. { /* Network General Sniffer */ 0x0ff0, 0x00, 0x00, 0x65,
  151. HAS_MISC_REG | HAS_IBM_MISC },
  152. { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45,
  153. HAS_MISC_REG | HAS_IBM_MISC },
  154. { /* PreMax PE-200 */ 0x07f0, 0x00, 0x20, 0xe0, 0 },
  155. { /* RPTI EP400 */ 0x0110, 0x00, 0x40, 0x95, 0 },
  156. { /* SCM Ethernet */ 0x0ff0, 0x00, 0x20, 0xcb, 0 },
  157. { /* Socket EA */ 0x4000, 0x00, 0xc0, 0x1b,
  158. DELAY_OUTPUT | HAS_MISC_REG | USE_BIG_BUF },
  159. { /* Socket LP-E CF+ */ 0x01c0, 0x00, 0xc0, 0x1b, 0 },
  160. { /* SuperSocket RE450T */ 0x0110, 0x00, 0xe0, 0x98, 0 },
  161. { /* Volktek NPL-402CT */ 0x0060, 0x00, 0x40, 0x05, 0 },
  162. { /* NEC PC-9801N-J12 */ 0x0ff0, 0x00, 0x00, 0x4c, 0 },
  163. { /* PCMCIA Technology OEM */ 0x01c8, 0x00, 0xa0, 0x0c, 0 }
  164. };
  165. #define NR_INFO ARRAY_SIZE(hw_info)
  166. static struct hw_info default_info = { 0, 0, 0, 0, 0 };
  167. static struct hw_info dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
  168. static struct hw_info dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
  169. struct pcnet_dev {
  170. struct pcmcia_device *p_dev;
  171. u_int flags;
  172. void __iomem *base;
  173. struct timer_list watchdog;
  174. int stale, fast_poll;
  175. u_char phy_id;
  176. u_char eth_phy, pna_phy;
  177. u_short link_status;
  178. u_long mii_reset;
  179. };
  180. static inline struct pcnet_dev *PRIV(struct net_device *dev)
  181. {
  182. char *p = netdev_priv(dev);
  183. return (struct pcnet_dev *)(p + sizeof(struct ei_device));
  184. }
  185. static const struct net_device_ops pcnet_netdev_ops = {
  186. .ndo_open = pcnet_open,
  187. .ndo_stop = pcnet_close,
  188. .ndo_set_config = set_config,
  189. .ndo_start_xmit = ei_start_xmit,
  190. .ndo_get_stats = ei_get_stats,
  191. .ndo_do_ioctl = ei_ioctl,
  192. .ndo_set_rx_mode = ei_set_multicast_list,
  193. .ndo_tx_timeout = ei_tx_timeout,
  194. .ndo_change_mtu = eth_change_mtu,
  195. .ndo_set_mac_address = eth_mac_addr,
  196. .ndo_validate_addr = eth_validate_addr,
  197. #ifdef CONFIG_NET_POLL_CONTROLLER
  198. .ndo_poll_controller = ei_poll,
  199. #endif
  200. };
  201. static int pcnet_probe(struct pcmcia_device *link)
  202. {
  203. struct pcnet_dev *info;
  204. struct net_device *dev;
  205. dev_dbg(&link->dev, "pcnet_attach()\n");
  206. /* Create new ethernet device */
  207. dev = __alloc_ei_netdev(sizeof(struct pcnet_dev));
  208. if (!dev) return -ENOMEM;
  209. info = PRIV(dev);
  210. info->p_dev = link;
  211. link->priv = dev;
  212. link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
  213. dev->netdev_ops = &pcnet_netdev_ops;
  214. return pcnet_config(link);
  215. } /* pcnet_attach */
  216. static void pcnet_detach(struct pcmcia_device *link)
  217. {
  218. struct net_device *dev = link->priv;
  219. dev_dbg(&link->dev, "pcnet_detach\n");
  220. unregister_netdev(dev);
  221. pcnet_release(link);
  222. free_netdev(dev);
  223. } /* pcnet_detach */
  224. /*======================================================================
  225. This probes for a card's hardware address, for card types that
  226. encode this information in their CIS.
  227. ======================================================================*/
  228. static struct hw_info *get_hwinfo(struct pcmcia_device *link)
  229. {
  230. struct net_device *dev = link->priv;
  231. u_char __iomem *base, *virt;
  232. int i, j;
  233. /* Allocate a small memory window */
  234. link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
  235. link->resource[2]->start = 0; link->resource[2]->end = 0;
  236. i = pcmcia_request_window(link, link->resource[2], 0);
  237. if (i != 0)
  238. return NULL;
  239. virt = ioremap(link->resource[2]->start,
  240. resource_size(link->resource[2]));
  241. for (i = 0; i < NR_INFO; i++) {
  242. pcmcia_map_mem_page(link, link->resource[2],
  243. hw_info[i].offset & ~(resource_size(link->resource[2])-1));
  244. base = &virt[hw_info[i].offset & (resource_size(link->resource[2])-1)];
  245. if ((readb(base+0) == hw_info[i].a0) &&
  246. (readb(base+2) == hw_info[i].a1) &&
  247. (readb(base+4) == hw_info[i].a2)) {
  248. for (j = 0; j < 6; j++)
  249. dev->dev_addr[j] = readb(base + (j<<1));
  250. break;
  251. }
  252. }
  253. iounmap(virt);
  254. j = pcmcia_release_window(link, link->resource[2]);
  255. return (i < NR_INFO) ? hw_info+i : NULL;
  256. } /* get_hwinfo */
  257. /*======================================================================
  258. This probes for a card's hardware address by reading the PROM.
  259. It checks the address against a list of known types, then falls
  260. back to a simple NE2000 clone signature check.
  261. ======================================================================*/
  262. static struct hw_info *get_prom(struct pcmcia_device *link)
  263. {
  264. struct net_device *dev = link->priv;
  265. unsigned int ioaddr = dev->base_addr;
  266. u_char prom[32];
  267. int i, j;
  268. /* This is lifted straight from drivers/net/ethernet/8390/ne.c */
  269. struct {
  270. u_char value, offset;
  271. } program_seq[] = {
  272. {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, /* Select page 0*/
  273. {0x48, EN0_DCFG}, /* Set byte-wide (0x48) access. */
  274. {0x00, EN0_RCNTLO}, /* Clear the count regs. */
  275. {0x00, EN0_RCNTHI},
  276. {0x00, EN0_IMR}, /* Mask completion irq. */
  277. {0xFF, EN0_ISR},
  278. {E8390_RXOFF, EN0_RXCR}, /* 0x20 Set to monitor */
  279. {E8390_TXOFF, EN0_TXCR}, /* 0x02 and loopback mode. */
  280. {32, EN0_RCNTLO},
  281. {0x00, EN0_RCNTHI},
  282. {0x00, EN0_RSARLO}, /* DMA starting at 0x0000. */
  283. {0x00, EN0_RSARHI},
  284. {E8390_RREAD+E8390_START, E8390_CMD},
  285. };
  286. pcnet_reset_8390(dev);
  287. mdelay(10);
  288. for (i = 0; i < ARRAY_SIZE(program_seq); i++)
  289. outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
  290. for (i = 0; i < 32; i++)
  291. prom[i] = inb(ioaddr + PCNET_DATAPORT);
  292. for (i = 0; i < NR_INFO; i++) {
  293. if ((prom[0] == hw_info[i].a0) &&
  294. (prom[2] == hw_info[i].a1) &&
  295. (prom[4] == hw_info[i].a2))
  296. break;
  297. }
  298. if ((i < NR_INFO) || ((prom[28] == 0x57) && (prom[30] == 0x57))) {
  299. for (j = 0; j < 6; j++)
  300. dev->dev_addr[j] = prom[j<<1];
  301. return (i < NR_INFO) ? hw_info+i : &default_info;
  302. }
  303. return NULL;
  304. } /* get_prom */
  305. /*======================================================================
  306. For DL10019 based cards, like the Linksys EtherFast
  307. ======================================================================*/
  308. static struct hw_info *get_dl10019(struct pcmcia_device *link)
  309. {
  310. struct net_device *dev = link->priv;
  311. int i;
  312. u_char sum;
  313. for (sum = 0, i = 0x14; i < 0x1c; i++)
  314. sum += inb_p(dev->base_addr + i);
  315. if (sum != 0xff)
  316. return NULL;
  317. for (i = 0; i < 6; i++)
  318. dev->dev_addr[i] = inb_p(dev->base_addr + 0x14 + i);
  319. i = inb(dev->base_addr + 0x1f);
  320. return ((i == 0x91)||(i == 0x99)) ? &dl10022_info : &dl10019_info;
  321. }
  322. /*======================================================================
  323. For Asix AX88190 based cards
  324. ======================================================================*/
  325. static struct hw_info *get_ax88190(struct pcmcia_device *link)
  326. {
  327. struct net_device *dev = link->priv;
  328. unsigned int ioaddr = dev->base_addr;
  329. int i, j;
  330. /* Not much of a test, but the alternatives are messy */
  331. if (link->config_base != 0x03c0)
  332. return NULL;
  333. outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */
  334. outb_p(0x00, ioaddr + EN0_RSARLO); /* DMA starting at 0x0400. */
  335. outb_p(0x04, ioaddr + EN0_RSARHI);
  336. outb_p(E8390_RREAD+E8390_START, ioaddr + E8390_CMD);
  337. for (i = 0; i < 6; i += 2) {
  338. j = inw(ioaddr + PCNET_DATAPORT);
  339. dev->dev_addr[i] = j & 0xff;
  340. dev->dev_addr[i+1] = j >> 8;
  341. }
  342. return NULL;
  343. }
  344. /*======================================================================
  345. This should be totally unnecessary... but when we can't figure
  346. out the hardware address any other way, we'll let the user hard
  347. wire it when the module is initialized.
  348. ======================================================================*/
  349. static struct hw_info *get_hwired(struct pcmcia_device *link)
  350. {
  351. struct net_device *dev = link->priv;
  352. int i;
  353. for (i = 0; i < 6; i++)
  354. if (hw_addr[i] != 0) break;
  355. if (i == 6)
  356. return NULL;
  357. for (i = 0; i < 6; i++)
  358. dev->dev_addr[i] = hw_addr[i];
  359. return &default_info;
  360. } /* get_hwired */
  361. static int try_io_port(struct pcmcia_device *link)
  362. {
  363. int j, ret;
  364. link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
  365. link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
  366. if (link->resource[0]->end == 32) {
  367. link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
  368. if (link->resource[1]->end > 0) {
  369. /* for master/slave multifunction cards */
  370. link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
  371. }
  372. } else {
  373. /* This should be two 16-port windows */
  374. link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
  375. link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
  376. }
  377. if (link->resource[0]->start == 0) {
  378. for (j = 0; j < 0x400; j += 0x20) {
  379. link->resource[0]->start = j ^ 0x300;
  380. link->resource[1]->start = (j ^ 0x300) + 0x10;
  381. link->io_lines = 16;
  382. ret = pcmcia_request_io(link);
  383. if (ret == 0)
  384. return ret;
  385. }
  386. return ret;
  387. } else {
  388. return pcmcia_request_io(link);
  389. }
  390. }
  391. static int pcnet_confcheck(struct pcmcia_device *p_dev, void *priv_data)
  392. {
  393. int *priv = priv_data;
  394. int try = (*priv & 0x1);
  395. *priv &= (p_dev->resource[2]->end >= 0x4000) ? 0x10 : ~0x10;
  396. if (p_dev->config_index == 0)
  397. return -EINVAL;
  398. if (p_dev->resource[0]->end + p_dev->resource[1]->end < 32)
  399. return -EINVAL;
  400. if (try)
  401. p_dev->io_lines = 16;
  402. return try_io_port(p_dev);
  403. }
  404. static struct hw_info *pcnet_try_config(struct pcmcia_device *link,
  405. int *has_shmem, int try)
  406. {
  407. struct net_device *dev = link->priv;
  408. struct hw_info *local_hw_info;
  409. struct pcnet_dev *info = PRIV(dev);
  410. int priv = try;
  411. int ret;
  412. ret = pcmcia_loop_config(link, pcnet_confcheck, &priv);
  413. if (ret) {
  414. dev_warn(&link->dev, "no useable port range found\n");
  415. return NULL;
  416. }
  417. *has_shmem = (priv & 0x10);
  418. if (!link->irq)
  419. return NULL;
  420. if (resource_size(link->resource[1]) == 8)
  421. link->config_flags |= CONF_ENABLE_SPKR;
  422. if ((link->manf_id == MANFID_IBM) &&
  423. (link->card_id == PRODID_IBM_HOME_AND_AWAY))
  424. link->config_index |= 0x10;
  425. ret = pcmcia_enable_device(link);
  426. if (ret)
  427. return NULL;
  428. dev->irq = link->irq;
  429. dev->base_addr = link->resource[0]->start;
  430. if (info->flags & HAS_MISC_REG) {
  431. if ((if_port == 1) || (if_port == 2))
  432. dev->if_port = if_port;
  433. else
  434. dev_notice(&link->dev, "invalid if_port requested\n");
  435. } else
  436. dev->if_port = 0;
  437. if ((link->config_base == 0x03c0) &&
  438. (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
  439. dev_info(&link->dev,
  440. "this is an AX88190 card - use axnet_cs instead.\n");
  441. return NULL;
  442. }
  443. local_hw_info = get_hwinfo(link);
  444. if (!local_hw_info)
  445. local_hw_info = get_prom(link);
  446. if (!local_hw_info)
  447. local_hw_info = get_dl10019(link);
  448. if (!local_hw_info)
  449. local_hw_info = get_ax88190(link);
  450. if (!local_hw_info)
  451. local_hw_info = get_hwired(link);
  452. return local_hw_info;
  453. }
  454. static int pcnet_config(struct pcmcia_device *link)
  455. {
  456. struct net_device *dev = link->priv;
  457. struct pcnet_dev *info = PRIV(dev);
  458. int start_pg, stop_pg, cm_offset;
  459. int has_shmem = 0;
  460. struct hw_info *local_hw_info;
  461. struct ei_device *ei_local;
  462. dev_dbg(&link->dev, "pcnet_config\n");
  463. local_hw_info = pcnet_try_config(link, &has_shmem, 0);
  464. if (!local_hw_info) {
  465. /* check whether forcing io_lines to 16 helps... */
  466. pcmcia_disable_device(link);
  467. local_hw_info = pcnet_try_config(link, &has_shmem, 1);
  468. if (local_hw_info == NULL) {
  469. dev_notice(&link->dev, "unable to read hardware net"
  470. " address for io base %#3lx\n", dev->base_addr);
  471. goto failed;
  472. }
  473. }
  474. info->flags = local_hw_info->flags;
  475. /* Check for user overrides */
  476. info->flags |= (delay_output) ? DELAY_OUTPUT : 0;
  477. if ((link->manf_id == MANFID_SOCKET) &&
  478. ((link->card_id == PRODID_SOCKET_LPE) ||
  479. (link->card_id == PRODID_SOCKET_LPE_CF) ||
  480. (link->card_id == PRODID_SOCKET_EIO)))
  481. info->flags &= ~USE_BIG_BUF;
  482. if (!use_big_buf)
  483. info->flags &= ~USE_BIG_BUF;
  484. if (info->flags & USE_BIG_BUF) {
  485. start_pg = SOCKET_START_PG;
  486. stop_pg = SOCKET_STOP_PG;
  487. cm_offset = 0x10000;
  488. } else {
  489. start_pg = PCNET_START_PG;
  490. stop_pg = PCNET_STOP_PG;
  491. cm_offset = 0;
  492. }
  493. /* has_shmem is ignored if use_shmem != -1 */
  494. if ((use_shmem == 0) || (!has_shmem && (use_shmem == -1)) ||
  495. (setup_shmem_window(link, start_pg, stop_pg, cm_offset) != 0))
  496. setup_dma_config(link, start_pg, stop_pg);
  497. ei_status.name = "NE2000";
  498. ei_status.word16 = 1;
  499. ei_status.reset_8390 = pcnet_reset_8390;
  500. if (info->flags & (IS_DL10019|IS_DL10022))
  501. mii_phy_probe(dev);
  502. SET_NETDEV_DEV(dev, &link->dev);
  503. ei_local = netdev_priv(dev);
  504. ei_local->msg_enable = pcnet_msg_enable;
  505. if (register_netdev(dev) != 0) {
  506. pr_notice("register_netdev() failed\n");
  507. goto failed;
  508. }
  509. if (info->flags & (IS_DL10019|IS_DL10022)) {
  510. u_char id = inb(dev->base_addr + 0x1a);
  511. netdev_info(dev, "NE2000 (DL100%d rev %02x): ",
  512. (info->flags & IS_DL10022) ? 22 : 19, id);
  513. if (info->pna_phy)
  514. pr_cont("PNA, ");
  515. } else {
  516. netdev_info(dev, "NE2000 Compatible: ");
  517. }
  518. pr_cont("io %#3lx, irq %d,", dev->base_addr, dev->irq);
  519. if (info->flags & USE_SHMEM)
  520. pr_cont(" mem %#5lx,", dev->mem_start);
  521. if (info->flags & HAS_MISC_REG)
  522. pr_cont(" %s xcvr,", if_names[dev->if_port]);
  523. pr_cont(" hw_addr %pM\n", dev->dev_addr);
  524. return 0;
  525. failed:
  526. pcnet_release(link);
  527. return -ENODEV;
  528. } /* pcnet_config */
  529. static void pcnet_release(struct pcmcia_device *link)
  530. {
  531. struct pcnet_dev *info = PRIV(link->priv);
  532. dev_dbg(&link->dev, "pcnet_release\n");
  533. if (info->flags & USE_SHMEM)
  534. iounmap(info->base);
  535. pcmcia_disable_device(link);
  536. }
  537. static int pcnet_suspend(struct pcmcia_device *link)
  538. {
  539. struct net_device *dev = link->priv;
  540. if (link->open)
  541. netif_device_detach(dev);
  542. return 0;
  543. }
  544. static int pcnet_resume(struct pcmcia_device *link)
  545. {
  546. struct net_device *dev = link->priv;
  547. if (link->open) {
  548. pcnet_reset_8390(dev);
  549. NS8390_init(dev, 1);
  550. netif_device_attach(dev);
  551. }
  552. return 0;
  553. }
  554. /*======================================================================
  555. MII interface support for DL10019 and DL10022 based cards
  556. On the DL10019, the MII IO direction bit is 0x10; on the DL10022
  557. it is 0x20. Setting both bits seems to work on both card types.
  558. ======================================================================*/
  559. #define DLINK_GPIO 0x1c
  560. #define DLINK_DIAG 0x1d
  561. #define DLINK_EEPROM 0x1e
  562. #define MDIO_SHIFT_CLK 0x80
  563. #define MDIO_DATA_OUT 0x40
  564. #define MDIO_DIR_WRITE 0x30
  565. #define MDIO_DATA_WRITE0 (MDIO_DIR_WRITE)
  566. #define MDIO_DATA_WRITE1 (MDIO_DIR_WRITE | MDIO_DATA_OUT)
  567. #define MDIO_DATA_READ 0x10
  568. #define MDIO_MASK 0x0f
  569. static void mdio_sync(unsigned int addr)
  570. {
  571. int bits, mask = inb(addr) & MDIO_MASK;
  572. for (bits = 0; bits < 32; bits++) {
  573. outb(mask | MDIO_DATA_WRITE1, addr);
  574. outb(mask | MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, addr);
  575. }
  576. }
  577. static int mdio_read(unsigned int addr, int phy_id, int loc)
  578. {
  579. u_int cmd = (0x06<<10)|(phy_id<<5)|loc;
  580. int i, retval = 0, mask = inb(addr) & MDIO_MASK;
  581. mdio_sync(addr);
  582. for (i = 13; i >= 0; i--) {
  583. int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE0;
  584. outb(mask | dat, addr);
  585. outb(mask | dat | MDIO_SHIFT_CLK, addr);
  586. }
  587. for (i = 19; i > 0; i--) {
  588. outb(mask, addr);
  589. retval = (retval << 1) | ((inb(addr) & MDIO_DATA_READ) != 0);
  590. outb(mask | MDIO_SHIFT_CLK, addr);
  591. }
  592. return (retval>>1) & 0xffff;
  593. }
  594. static void mdio_write(unsigned int addr, int phy_id, int loc, int value)
  595. {
  596. u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value;
  597. int i, mask = inb(addr) & MDIO_MASK;
  598. mdio_sync(addr);
  599. for (i = 31; i >= 0; i--) {
  600. int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE0;
  601. outb(mask | dat, addr);
  602. outb(mask | dat | MDIO_SHIFT_CLK, addr);
  603. }
  604. for (i = 1; i >= 0; i--) {
  605. outb(mask, addr);
  606. outb(mask | MDIO_SHIFT_CLK, addr);
  607. }
  608. }
  609. /*======================================================================
  610. EEPROM access routines for DL10019 and DL10022 based cards
  611. ======================================================================*/
  612. #define EE_EEP 0x40
  613. #define EE_ASIC 0x10
  614. #define EE_CS 0x08
  615. #define EE_CK 0x04
  616. #define EE_DO 0x02
  617. #define EE_DI 0x01
  618. #define EE_ADOT 0x01 /* DataOut for ASIC */
  619. #define EE_READ_CMD 0x06
  620. #define DL19FDUPLX 0x0400 /* DL10019 Full duplex mode */
  621. static int read_eeprom(unsigned int ioaddr, int location)
  622. {
  623. int i, retval = 0;
  624. unsigned int ee_addr = ioaddr + DLINK_EEPROM;
  625. int read_cmd = location | (EE_READ_CMD << 8);
  626. outb(0, ee_addr);
  627. outb(EE_EEP|EE_CS, ee_addr);
  628. /* Shift the read command bits out. */
  629. for (i = 10; i >= 0; i--) {
  630. short dataval = (read_cmd & (1 << i)) ? EE_DO : 0;
  631. outb_p(EE_EEP|EE_CS|dataval, ee_addr);
  632. outb_p(EE_EEP|EE_CS|dataval|EE_CK, ee_addr);
  633. }
  634. outb(EE_EEP|EE_CS, ee_addr);
  635. for (i = 16; i > 0; i--) {
  636. outb_p(EE_EEP|EE_CS | EE_CK, ee_addr);
  637. retval = (retval << 1) | ((inb(ee_addr) & EE_DI) ? 1 : 0);
  638. outb_p(EE_EEP|EE_CS, ee_addr);
  639. }
  640. /* Terminate the EEPROM access. */
  641. outb(0, ee_addr);
  642. return retval;
  643. }
  644. /*
  645. The internal ASIC registers can be changed by EEPROM READ access
  646. with EE_ASIC bit set.
  647. In ASIC mode, EE_ADOT is used to output the data to the ASIC.
  648. */
  649. static void write_asic(unsigned int ioaddr, int location, short asic_data)
  650. {
  651. int i;
  652. unsigned int ee_addr = ioaddr + DLINK_EEPROM;
  653. short dataval;
  654. int read_cmd = location | (EE_READ_CMD << 8);
  655. asic_data |= read_eeprom(ioaddr, location);
  656. outb(0, ee_addr);
  657. outb(EE_ASIC|EE_CS|EE_DI, ee_addr);
  658. read_cmd = read_cmd >> 1;
  659. /* Shift the read command bits out. */
  660. for (i = 9; i >= 0; i--) {
  661. dataval = (read_cmd & (1 << i)) ? EE_DO : 0;
  662. outb_p(EE_ASIC|EE_CS|EE_DI|dataval, ee_addr);
  663. outb_p(EE_ASIC|EE_CS|EE_DI|dataval|EE_CK, ee_addr);
  664. outb_p(EE_ASIC|EE_CS|EE_DI|dataval, ee_addr);
  665. }
  666. // sync
  667. outb(EE_ASIC|EE_CS, ee_addr);
  668. outb(EE_ASIC|EE_CS|EE_CK, ee_addr);
  669. outb(EE_ASIC|EE_CS, ee_addr);
  670. for (i = 15; i >= 0; i--) {
  671. dataval = (asic_data & (1 << i)) ? EE_ADOT : 0;
  672. outb_p(EE_ASIC|EE_CS|dataval, ee_addr);
  673. outb_p(EE_ASIC|EE_CS|dataval|EE_CK, ee_addr);
  674. outb_p(EE_ASIC|EE_CS|dataval, ee_addr);
  675. }
  676. /* Terminate the ASIC access. */
  677. outb(EE_ASIC|EE_DI, ee_addr);
  678. outb(EE_ASIC|EE_DI| EE_CK, ee_addr);
  679. outb(EE_ASIC|EE_DI, ee_addr);
  680. outb(0, ee_addr);
  681. }
  682. /*====================================================================*/
  683. static void set_misc_reg(struct net_device *dev)
  684. {
  685. unsigned int nic_base = dev->base_addr;
  686. struct pcnet_dev *info = PRIV(dev);
  687. u_char tmp;
  688. if (info->flags & HAS_MISC_REG) {
  689. tmp = inb_p(nic_base + PCNET_MISC) & ~3;
  690. if (dev->if_port == 2)
  691. tmp |= 1;
  692. if (info->flags & USE_BIG_BUF)
  693. tmp |= 2;
  694. if (info->flags & HAS_IBM_MISC)
  695. tmp |= 8;
  696. outb_p(tmp, nic_base + PCNET_MISC);
  697. }
  698. if (info->flags & IS_DL10022) {
  699. if (info->flags & HAS_MII) {
  700. /* Advertise 100F, 100H, 10F, 10H */
  701. mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 4, 0x01e1);
  702. /* Restart MII autonegotiation */
  703. mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 0, 0x0000);
  704. mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 0, 0x1200);
  705. info->mii_reset = jiffies;
  706. } else {
  707. outb(full_duplex ? 4 : 0, nic_base + DLINK_DIAG);
  708. }
  709. } else if (info->flags & IS_DL10019) {
  710. /* Advertise 100F, 100H, 10F, 10H */
  711. mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 4, 0x01e1);
  712. /* Restart MII autonegotiation */
  713. mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 0, 0x0000);
  714. mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 0, 0x1200);
  715. }
  716. }
  717. /*====================================================================*/
  718. static void mii_phy_probe(struct net_device *dev)
  719. {
  720. struct pcnet_dev *info = PRIV(dev);
  721. unsigned int mii_addr = dev->base_addr + DLINK_GPIO;
  722. int i;
  723. u_int tmp, phyid;
  724. for (i = 31; i >= 0; i--) {
  725. tmp = mdio_read(mii_addr, i, 1);
  726. if ((tmp == 0) || (tmp == 0xffff))
  727. continue;
  728. tmp = mdio_read(mii_addr, i, MII_PHYID_REG1);
  729. phyid = tmp << 16;
  730. phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2);
  731. phyid &= MII_PHYID_REV_MASK;
  732. netdev_dbg(dev, "MII at %d is 0x%08x\n", i, phyid);
  733. if (phyid == AM79C9XX_HOME_PHY) {
  734. info->pna_phy = i;
  735. } else if (phyid != AM79C9XX_ETH_PHY) {
  736. info->eth_phy = i;
  737. }
  738. }
  739. }
  740. static int pcnet_open(struct net_device *dev)
  741. {
  742. int ret;
  743. struct pcnet_dev *info = PRIV(dev);
  744. struct pcmcia_device *link = info->p_dev;
  745. unsigned int nic_base = dev->base_addr;
  746. dev_dbg(&link->dev, "pcnet_open('%s')\n", dev->name);
  747. if (!pcmcia_dev_present(link))
  748. return -ENODEV;
  749. set_misc_reg(dev);
  750. outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
  751. ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev->name, dev);
  752. if (ret)
  753. return ret;
  754. link->open++;
  755. info->phy_id = info->eth_phy;
  756. info->link_status = 0x00;
  757. setup_timer(&info->watchdog, ei_watchdog, (u_long)dev);
  758. mod_timer(&info->watchdog, jiffies + HZ);
  759. return ei_open(dev);
  760. } /* pcnet_open */
  761. /*====================================================================*/
  762. static int pcnet_close(struct net_device *dev)
  763. {
  764. struct pcnet_dev *info = PRIV(dev);
  765. struct pcmcia_device *link = info->p_dev;
  766. dev_dbg(&link->dev, "pcnet_close('%s')\n", dev->name);
  767. ei_close(dev);
  768. free_irq(dev->irq, dev);
  769. link->open--;
  770. netif_stop_queue(dev);
  771. del_timer_sync(&info->watchdog);
  772. return 0;
  773. } /* pcnet_close */
  774. /*======================================================================
  775. Hard reset the card. This used to pause for the same period that
  776. a 8390 reset command required, but that shouldn't be necessary.
  777. ======================================================================*/
  778. static void pcnet_reset_8390(struct net_device *dev)
  779. {
  780. unsigned int nic_base = dev->base_addr;
  781. int i;
  782. ei_status.txing = ei_status.dmaing = 0;
  783. outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, nic_base + E8390_CMD);
  784. outb(inb(nic_base + PCNET_RESET), nic_base + PCNET_RESET);
  785. for (i = 0; i < 100; i++) {
  786. if ((inb_p(nic_base+EN0_ISR) & ENISR_RESET) != 0)
  787. break;
  788. udelay(100);
  789. }
  790. outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */
  791. if (i == 100)
  792. netdev_err(dev, "pcnet_reset_8390() did not complete.\n");
  793. set_misc_reg(dev);
  794. } /* pcnet_reset_8390 */
  795. /*====================================================================*/
  796. static int set_config(struct net_device *dev, struct ifmap *map)
  797. {
  798. struct pcnet_dev *info = PRIV(dev);
  799. if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
  800. if (!(info->flags & HAS_MISC_REG))
  801. return -EOPNOTSUPP;
  802. else if ((map->port < 1) || (map->port > 2))
  803. return -EINVAL;
  804. dev->if_port = map->port;
  805. netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
  806. NS8390_init(dev, 1);
  807. }
  808. return 0;
  809. }
  810. /*====================================================================*/
  811. static irqreturn_t ei_irq_wrapper(int irq, void *dev_id)
  812. {
  813. struct net_device *dev = dev_id;
  814. struct pcnet_dev *info;
  815. irqreturn_t ret = ei_interrupt(irq, dev_id);
  816. if (ret == IRQ_HANDLED) {
  817. info = PRIV(dev);
  818. info->stale = 0;
  819. }
  820. return ret;
  821. }
  822. static void ei_watchdog(u_long arg)
  823. {
  824. struct net_device *dev = (struct net_device *)arg;
  825. struct pcnet_dev *info = PRIV(dev);
  826. unsigned int nic_base = dev->base_addr;
  827. unsigned int mii_addr = nic_base + DLINK_GPIO;
  828. u_short link;
  829. if (!netif_device_present(dev)) goto reschedule;
  830. /* Check for pending interrupt with expired latency timer: with
  831. this, we can limp along even if the interrupt is blocked */
  832. if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) {
  833. if (!info->fast_poll)
  834. netdev_info(dev, "interrupt(s) dropped!\n");
  835. ei_irq_wrapper(dev->irq, dev);
  836. info->fast_poll = HZ;
  837. }
  838. if (info->fast_poll) {
  839. info->fast_poll--;
  840. info->watchdog.expires = jiffies + 1;
  841. add_timer(&info->watchdog);
  842. return;
  843. }
  844. if (!(info->flags & HAS_MII))
  845. goto reschedule;
  846. mdio_read(mii_addr, info->phy_id, 1);
  847. link = mdio_read(mii_addr, info->phy_id, 1);
  848. if (!link || (link == 0xffff)) {
  849. if (info->eth_phy) {
  850. info->phy_id = info->eth_phy = 0;
  851. } else {
  852. netdev_info(dev, "MII is missing!\n");
  853. info->flags &= ~HAS_MII;
  854. }
  855. goto reschedule;
  856. }
  857. link &= 0x0004;
  858. if (link != info->link_status) {
  859. u_short p = mdio_read(mii_addr, info->phy_id, 5);
  860. netdev_info(dev, "%s link beat\n", link ? "found" : "lost");
  861. if (link && (info->flags & IS_DL10022)) {
  862. /* Disable collision detection on full duplex links */
  863. outb((p & 0x0140) ? 4 : 0, nic_base + DLINK_DIAG);
  864. } else if (link && (info->flags & IS_DL10019)) {
  865. /* Disable collision detection on full duplex links */
  866. write_asic(dev->base_addr, 4, (p & 0x140) ? DL19FDUPLX : 0);
  867. }
  868. if (link) {
  869. if (info->phy_id == info->eth_phy) {
  870. if (p)
  871. netdev_info(dev, "autonegotiation complete: "
  872. "%sbaseT-%cD selected\n",
  873. ((p & 0x0180) ? "100" : "10"),
  874. ((p & 0x0140) ? 'F' : 'H'));
  875. else
  876. netdev_info(dev, "link partner did not autonegotiate\n");
  877. }
  878. NS8390_init(dev, 1);
  879. }
  880. info->link_status = link;
  881. }
  882. if (info->pna_phy && time_after(jiffies, info->mii_reset + 6*HZ)) {
  883. link = mdio_read(mii_addr, info->eth_phy, 1) & 0x0004;
  884. if (((info->phy_id == info->pna_phy) && link) ||
  885. ((info->phy_id != info->pna_phy) && !link)) {
  886. /* isolate this MII and try flipping to the other one */
  887. mdio_write(mii_addr, info->phy_id, 0, 0x0400);
  888. info->phy_id ^= info->pna_phy ^ info->eth_phy;
  889. netdev_info(dev, "switched to %s transceiver\n",
  890. (info->phy_id == info->eth_phy) ? "ethernet" : "PNA");
  891. mdio_write(mii_addr, info->phy_id, 0,
  892. (info->phy_id == info->eth_phy) ? 0x1000 : 0);
  893. info->link_status = 0;
  894. info->mii_reset = jiffies;
  895. }
  896. }
  897. reschedule:
  898. info->watchdog.expires = jiffies + HZ;
  899. add_timer(&info->watchdog);
  900. }
  901. /*====================================================================*/
  902. static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
  903. {
  904. struct pcnet_dev *info = PRIV(dev);
  905. struct mii_ioctl_data *data = if_mii(rq);
  906. unsigned int mii_addr = dev->base_addr + DLINK_GPIO;
  907. if (!(info->flags & (IS_DL10019|IS_DL10022)))
  908. return -EINVAL;
  909. switch (cmd) {
  910. case SIOCGMIIPHY:
  911. data->phy_id = info->phy_id;
  912. case SIOCGMIIREG: /* Read MII PHY register. */
  913. data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f);
  914. return 0;
  915. case SIOCSMIIREG: /* Write MII PHY register. */
  916. mdio_write(mii_addr, data->phy_id, data->reg_num & 0x1f, data->val_in);
  917. return 0;
  918. }
  919. return -EOPNOTSUPP;
  920. }
  921. /*====================================================================*/
  922. static void dma_get_8390_hdr(struct net_device *dev,
  923. struct e8390_pkt_hdr *hdr,
  924. int ring_page)
  925. {
  926. unsigned int nic_base = dev->base_addr;
  927. if (ei_status.dmaing) {
  928. netdev_err(dev, "DMAing conflict in dma_block_input."
  929. "[DMAstat:%1x][irqlock:%1x]\n",
  930. ei_status.dmaing, ei_status.irqlock);
  931. return;
  932. }
  933. ei_status.dmaing |= 0x01;
  934. outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base + PCNET_CMD);
  935. outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
  936. outb_p(0, nic_base + EN0_RCNTHI);
  937. outb_p(0, nic_base + EN0_RSARLO); /* On page boundary */
  938. outb_p(ring_page, nic_base + EN0_RSARHI);
  939. outb_p(E8390_RREAD+E8390_START, nic_base + PCNET_CMD);
  940. insw(nic_base + PCNET_DATAPORT, hdr,
  941. sizeof(struct e8390_pkt_hdr)>>1);
  942. /* Fix for big endian systems */
  943. hdr->count = le16_to_cpu(hdr->count);
  944. outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
  945. ei_status.dmaing &= ~0x01;
  946. }
  947. /*====================================================================*/
  948. static void dma_block_input(struct net_device *dev, int count,
  949. struct sk_buff *skb, int ring_offset)
  950. {
  951. unsigned int nic_base = dev->base_addr;
  952. int xfer_count = count;
  953. char *buf = skb->data;
  954. struct ei_device *ei_local = netdev_priv(dev);
  955. if ((netif_msg_rx_status(ei_local)) && (count != 4))
  956. netdev_dbg(dev, "[bi=%d]\n", count+4);
  957. if (ei_status.dmaing) {
  958. netdev_err(dev, "DMAing conflict in dma_block_input."
  959. "[DMAstat:%1x][irqlock:%1x]\n",
  960. ei_status.dmaing, ei_status.irqlock);
  961. return;
  962. }
  963. ei_status.dmaing |= 0x01;
  964. outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base + PCNET_CMD);
  965. outb_p(count & 0xff, nic_base + EN0_RCNTLO);
  966. outb_p(count >> 8, nic_base + EN0_RCNTHI);
  967. outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);
  968. outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
  969. outb_p(E8390_RREAD+E8390_START, nic_base + PCNET_CMD);
  970. insw(nic_base + PCNET_DATAPORT,buf,count>>1);
  971. if (count & 0x01)
  972. buf[count-1] = inb(nic_base + PCNET_DATAPORT), xfer_count++;
  973. /* This was for the ALPHA version only, but enough people have been
  974. encountering problems that it is still here. */
  975. #ifdef PCMCIA_DEBUG
  976. /* DMA termination address check... */
  977. if (netif_msg_rx_status(ei_local)) {
  978. int addr, tries = 20;
  979. do {
  980. /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
  981. -- it's broken for Rx on some cards! */
  982. int high = inb_p(nic_base + EN0_RSARHI);
  983. int low = inb_p(nic_base + EN0_RSARLO);
  984. addr = (high << 8) + low;
  985. if (((ring_offset + xfer_count) & 0xff) == (addr & 0xff))
  986. break;
  987. } while (--tries > 0);
  988. if (tries <= 0)
  989. netdev_notice(dev, "RX transfer address mismatch,"
  990. "%#4.4x (expected) vs. %#4.4x (actual).\n",
  991. ring_offset + xfer_count, addr);
  992. }
  993. #endif
  994. outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
  995. ei_status.dmaing &= ~0x01;
  996. } /* dma_block_input */
  997. /*====================================================================*/
  998. static void dma_block_output(struct net_device *dev, int count,
  999. const u_char *buf, const int start_page)
  1000. {
  1001. unsigned int nic_base = dev->base_addr;
  1002. struct pcnet_dev *info = PRIV(dev);
  1003. #ifdef PCMCIA_DEBUG
  1004. int retries = 0;
  1005. struct ei_device *ei_local = netdev_priv(dev);
  1006. #endif
  1007. u_long dma_start;
  1008. #ifdef PCMCIA_DEBUG
  1009. netif_dbg(ei_local, tx_queued, dev, "[bo=%d]\n", count);
  1010. #endif
  1011. /* Round the count up for word writes. Do we need to do this?
  1012. What effect will an odd byte count have on the 8390?
  1013. I should check someday. */
  1014. if (count & 0x01)
  1015. count++;
  1016. if (ei_status.dmaing) {
  1017. netdev_err(dev, "DMAing conflict in dma_block_output."
  1018. "[DMAstat:%1x][irqlock:%1x]\n",
  1019. ei_status.dmaing, ei_status.irqlock);
  1020. return;
  1021. }
  1022. ei_status.dmaing |= 0x01;
  1023. /* We should already be in page 0, but to be safe... */
  1024. outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base+PCNET_CMD);
  1025. #ifdef PCMCIA_DEBUG
  1026. retry:
  1027. #endif
  1028. outb_p(ENISR_RDC, nic_base + EN0_ISR);
  1029. /* Now the normal output. */
  1030. outb_p(count & 0xff, nic_base + EN0_RCNTLO);
  1031. outb_p(count >> 8, nic_base + EN0_RCNTHI);
  1032. outb_p(0x00, nic_base + EN0_RSARLO);
  1033. outb_p(start_page, nic_base + EN0_RSARHI);
  1034. outb_p(E8390_RWRITE+E8390_START, nic_base + PCNET_CMD);
  1035. outsw(nic_base + PCNET_DATAPORT, buf, count>>1);
  1036. dma_start = jiffies;
  1037. #ifdef PCMCIA_DEBUG
  1038. /* This was for the ALPHA version only, but enough people have been
  1039. encountering problems that it is still here. */
  1040. /* DMA termination address check... */
  1041. if (netif_msg_tx_queued(ei_local)) {
  1042. int addr, tries = 20;
  1043. do {
  1044. int high = inb_p(nic_base + EN0_RSARHI);
  1045. int low = inb_p(nic_base + EN0_RSARLO);
  1046. addr = (high << 8) + low;
  1047. if ((start_page << 8) + count == addr)
  1048. break;
  1049. } while (--tries > 0);
  1050. if (tries <= 0) {
  1051. netdev_notice(dev, "Tx packet transfer address mismatch,"
  1052. "%#4.4x (expected) vs. %#4.4x (actual).\n",
  1053. (start_page << 8) + count, addr);
  1054. if (retries++ == 0)
  1055. goto retry;
  1056. }
  1057. }
  1058. #endif
  1059. while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
  1060. if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) {
  1061. netdev_warn(dev, "timeout waiting for Tx RDC.\n");
  1062. pcnet_reset_8390(dev);
  1063. NS8390_init(dev, 1);
  1064. break;
  1065. }
  1066. outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
  1067. if (info->flags & DELAY_OUTPUT)
  1068. udelay((long)delay_time);
  1069. ei_status.dmaing &= ~0x01;
  1070. }
  1071. /*====================================================================*/
  1072. static int setup_dma_config(struct pcmcia_device *link, int start_pg,
  1073. int stop_pg)
  1074. {
  1075. struct net_device *dev = link->priv;
  1076. ei_status.tx_start_page = start_pg;
  1077. ei_status.rx_start_page = start_pg + TX_PAGES;
  1078. ei_status.stop_page = stop_pg;
  1079. /* set up block i/o functions */
  1080. ei_status.get_8390_hdr = dma_get_8390_hdr;
  1081. ei_status.block_input = dma_block_input;
  1082. ei_status.block_output = dma_block_output;
  1083. return 0;
  1084. }
  1085. /*====================================================================*/
  1086. static void copyin(void *dest, void __iomem *src, int c)
  1087. {
  1088. u_short *d = dest;
  1089. u_short __iomem *s = src;
  1090. int odd;
  1091. if (c <= 0)
  1092. return;
  1093. odd = (c & 1); c >>= 1;
  1094. if (c) {
  1095. do { *d++ = __raw_readw(s++); } while (--c);
  1096. }
  1097. /* get last byte by fetching a word and masking */
  1098. if (odd)
  1099. *((u_char *)d) = readw(s) & 0xff;
  1100. }
  1101. static void copyout(void __iomem *dest, const void *src, int c)
  1102. {
  1103. u_short __iomem *d = dest;
  1104. const u_short *s = src;
  1105. int odd;
  1106. if (c <= 0)
  1107. return;
  1108. odd = (c & 1); c >>= 1;
  1109. if (c) {
  1110. do { __raw_writew(*s++, d++); } while (--c);
  1111. }
  1112. /* copy last byte doing a read-modify-write */
  1113. if (odd)
  1114. writew((readw(d) & 0xff00) | *(u_char *)s, d);
  1115. }
  1116. /*====================================================================*/
  1117. static void shmem_get_8390_hdr(struct net_device *dev,
  1118. struct e8390_pkt_hdr *hdr,
  1119. int ring_page)
  1120. {
  1121. void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
  1122. + (ring_page << 8)
  1123. - (ei_status.rx_start_page << 8);
  1124. copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
  1125. /* Fix for big endian systems */
  1126. hdr->count = le16_to_cpu(hdr->count);
  1127. }
  1128. /*====================================================================*/
  1129. static void shmem_block_input(struct net_device *dev, int count,
  1130. struct sk_buff *skb, int ring_offset)
  1131. {
  1132. void __iomem *base = ei_status.mem;
  1133. unsigned long offset = (TX_PAGES<<8) + ring_offset
  1134. - (ei_status.rx_start_page << 8);
  1135. char *buf = skb->data;
  1136. if (offset + count > ei_status.priv) {
  1137. /* We must wrap the input move. */
  1138. int semi_count = ei_status.priv - offset;
  1139. copyin(buf, base + offset, semi_count);
  1140. buf += semi_count;
  1141. offset = TX_PAGES<<8;
  1142. count -= semi_count;
  1143. }
  1144. copyin(buf, base + offset, count);
  1145. }
  1146. /*====================================================================*/
  1147. static void shmem_block_output(struct net_device *dev, int count,
  1148. const u_char *buf, const int start_page)
  1149. {
  1150. void __iomem *shmem = ei_status.mem + (start_page << 8);
  1151. shmem -= ei_status.tx_start_page << 8;
  1152. copyout(shmem, buf, count);
  1153. }
  1154. /*====================================================================*/
  1155. static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
  1156. int stop_pg, int cm_offset)
  1157. {
  1158. struct net_device *dev = link->priv;
  1159. struct pcnet_dev *info = PRIV(dev);
  1160. int i, window_size, offset, ret;
  1161. window_size = (stop_pg - start_pg) << 8;
  1162. if (window_size > 32 * 1024)
  1163. window_size = 32 * 1024;
  1164. /* Make sure it's a power of two. */
  1165. window_size = roundup_pow_of_two(window_size);
  1166. /* Allocate a memory window */
  1167. link->resource[3]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
  1168. link->resource[3]->flags |= WIN_USE_WAIT;
  1169. link->resource[3]->start = 0; link->resource[3]->end = window_size;
  1170. ret = pcmcia_request_window(link, link->resource[3], mem_speed);
  1171. if (ret)
  1172. goto failed;
  1173. offset = (start_pg << 8) + cm_offset;
  1174. offset -= offset % window_size;
  1175. ret = pcmcia_map_mem_page(link, link->resource[3], offset);
  1176. if (ret)
  1177. goto failed;
  1178. /* Try scribbling on the buffer */
  1179. info->base = ioremap(link->resource[3]->start,
  1180. resource_size(link->resource[3]));
  1181. for (i = 0; i < (TX_PAGES<<8); i += 2)
  1182. __raw_writew((i>>1), info->base+offset+i);
  1183. udelay(100);
  1184. for (i = 0; i < (TX_PAGES<<8); i += 2)
  1185. if (__raw_readw(info->base+offset+i) != (i>>1)) break;
  1186. pcnet_reset_8390(dev);
  1187. if (i != (TX_PAGES<<8)) {
  1188. iounmap(info->base);
  1189. pcmcia_release_window(link, link->resource[3]);
  1190. info->base = NULL;
  1191. goto failed;
  1192. }
  1193. ei_status.mem = info->base + offset;
  1194. ei_status.priv = resource_size(link->resource[3]);
  1195. dev->mem_start = (u_long)ei_status.mem;
  1196. dev->mem_end = dev->mem_start + resource_size(link->resource[3]);
  1197. ei_status.tx_start_page = start_pg;
  1198. ei_status.rx_start_page = start_pg + TX_PAGES;
  1199. ei_status.stop_page = start_pg + (
  1200. (resource_size(link->resource[3]) - offset) >> 8);
  1201. /* set up block i/o functions */
  1202. ei_status.get_8390_hdr = shmem_get_8390_hdr;
  1203. ei_status.block_input = shmem_block_input;
  1204. ei_status.block_output = shmem_block_output;
  1205. info->flags |= USE_SHMEM;
  1206. return 0;
  1207. failed:
  1208. return 1;
  1209. }
  1210. /*====================================================================*/
  1211. static const struct pcmcia_device_id pcnet_ids[] = {
  1212. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0057, 0x0021),
  1213. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0104, 0x000a),
  1214. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0105, 0xea15),
  1215. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0143, 0x3341),
  1216. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0143, 0xc0ab),
  1217. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x021b, 0x0101),
  1218. PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x08a1, 0xc0ab),
  1219. PCMCIA_PFC_DEVICE_PROD_ID12(0, "AnyCom", "Fast Ethernet + 56K COMBO", 0x578ba6e7, 0xb0ac62c4),
  1220. PCMCIA_PFC_DEVICE_PROD_ID12(0, "ATKK", "LM33-PCM-T", 0xba9eb7e2, 0x077c174e),
  1221. PCMCIA_PFC_DEVICE_PROD_ID12(0, "D-Link", "DME336T", 0x1a424a1c, 0xb23897ff),
  1222. PCMCIA_PFC_DEVICE_PROD_ID12(0, "Grey Cell", "GCS3000", 0x2a151fac, 0x48b932ae),
  1223. PCMCIA_PFC_DEVICE_PROD_ID12(0, "Linksys", "EtherFast 10&100 + 56K PC Card (PCMLM56)", 0x0733cc81, 0xb3765033),
  1224. PCMCIA_PFC_DEVICE_PROD_ID12(0, "LINKSYS", "PCMLM336", 0xf7cb0b07, 0x7a821b58),
  1225. PCMCIA_PFC_DEVICE_PROD_ID12(0, "MICRO RESEARCH", "COMBO-L/M-336", 0xb2ced065, 0x3ced0555),
  1226. PCMCIA_PFC_DEVICE_PROD_ID12(0, "PCMCIAs", "ComboCard", 0xdcfe12d3, 0xcd8906cc),
  1227. PCMCIA_PFC_DEVICE_PROD_ID12(0, "PCMCIAs", "LanModem", 0xdcfe12d3, 0xc67c648f),
  1228. PCMCIA_MFC_DEVICE_PROD_ID12(0, "IBM", "Home and Away 28.8 PC Card ", 0xb569a6e5, 0x5bd4ff2c),
  1229. PCMCIA_MFC_DEVICE_PROD_ID12(0, "IBM", "Home and Away Credit Card Adapter", 0xb569a6e5, 0x4bdf15c3),
  1230. PCMCIA_MFC_DEVICE_PROD_ID12(0, "IBM", "w95 Home and Away Credit Card ", 0xb569a6e5, 0xae911c15),
  1231. PCMCIA_MFC_DEVICE_PROD_ID123(0, "APEX DATA", "MULTICARD", "ETHERNET-MODEM", 0x11c2da09, 0x7289dc5d, 0xaad95e1f),
  1232. PCMCIA_MFC_DEVICE_PROD_ID2(0, "FAX/Modem/Ethernet Combo Card ", 0x1ed59302),
  1233. PCMCIA_DEVICE_MANF_CARD(0x0057, 0x1004),
  1234. PCMCIA_DEVICE_MANF_CARD(0x0104, 0x000d),
  1235. PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0075),
  1236. PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0145),
  1237. PCMCIA_DEVICE_MANF_CARD(0x0149, 0x0230),
  1238. PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530),
  1239. PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab),
  1240. PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110),
  1241. PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041),
  1242. PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452),
  1243. PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300),
  1244. PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0307),
  1245. PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030a),
  1246. PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1103),
  1247. PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1121),
  1248. PCMCIA_DEVICE_MANF_CARD(0xc001, 0x0009),
  1249. PCMCIA_DEVICE_PROD_ID12("2408LAN", "Ethernet", 0x352fff7f, 0x00b2e941),
  1250. PCMCIA_DEVICE_PROD_ID1234("Socket", "CF 10/100 Ethernet Card", "Revision B", "05/11/06", 0xb38bcc2e, 0x4de88352, 0xeaca6c8d, 0x7e57c22e),
  1251. PCMCIA_DEVICE_PROD_ID123("Cardwell", "PCMCIA", "ETHERNET", 0x9533672e, 0x281f1c5d, 0x3ff7175b),
  1252. PCMCIA_DEVICE_PROD_ID123("CNet ", "CN30BC", "ETHERNET", 0x9fe55d3d, 0x85601198, 0x3ff7175b),
  1253. PCMCIA_DEVICE_PROD_ID123("Digital", "Ethernet", "Adapter", 0x9999ab35, 0x00b2e941, 0x4b0d829e),
  1254. PCMCIA_DEVICE_PROD_ID123("Edimax Technology Inc.", "PCMCIA", "Ethernet Card", 0x738a0019, 0x281f1c5d, 0x5e9d92c0),
  1255. PCMCIA_DEVICE_PROD_ID123("EFA ", "EFA207", "ETHERNET", 0x3d294be4, 0xeb9aab6c, 0x3ff7175b),
  1256. PCMCIA_DEVICE_PROD_ID123("I-O DATA", "PCLA", "ETHERNET", 0x1d55d7ec, 0xe4c64d34, 0x3ff7175b),
  1257. PCMCIA_DEVICE_PROD_ID123("IO DATA", "PCLATE", "ETHERNET", 0x547e66dc, 0x6b260753, 0x3ff7175b),
  1258. PCMCIA_DEVICE_PROD_ID123("KingMax Technology Inc.", "EN10-T2", "PCMCIA Ethernet Card", 0x932b7189, 0x699e4436, 0x6f6652e0),
  1259. PCMCIA_DEVICE_PROD_ID123("PCMCIA", "PCMCIA-ETHERNET-CARD", "UE2216", 0x281f1c5d, 0xd4cd2f20, 0xb87add82),
  1260. PCMCIA_DEVICE_PROD_ID123("PCMCIA", "PCMCIA-ETHERNET-CARD", "UE2620", 0x281f1c5d, 0xd4cd2f20, 0x7d3d83a8),
  1261. PCMCIA_DEVICE_PROD_ID1("2412LAN", 0x67f236ab),
  1262. PCMCIA_DEVICE_PROD_ID12("ACCTON", "EN2212", 0xdfc6b5b2, 0xcb112a11),
  1263. PCMCIA_DEVICE_PROD_ID12("ACCTON", "EN2216-PCMCIA-ETHERNET", 0xdfc6b5b2, 0x5542bfff),
  1264. PCMCIA_DEVICE_PROD_ID12("Allied Telesis, K.K.", "CentreCOM LA100-PCM-T V2 100/10M LAN PC Card", 0xbb7fbdd7, 0xcd91cc68),
  1265. PCMCIA_DEVICE_PROD_ID12("Allied Telesis K.K.", "LA100-PCM V2", 0x36634a66, 0xc6d05997),
  1266. PCMCIA_DEVICE_PROD_ID12("Allied Telesis, K.K.", "CentreCOM LA-PCM_V2", 0xbb7fBdd7, 0x28e299f8),
  1267. PCMCIA_DEVICE_PROD_ID12("Allied Telesis K.K.", "LA-PCM V3", 0x36634a66, 0x62241d96),
  1268. PCMCIA_DEVICE_PROD_ID12("AmbiCom", "AMB8010", 0x5070a7f9, 0x82f96e96),
  1269. PCMCIA_DEVICE_PROD_ID12("AmbiCom", "AMB8610", 0x5070a7f9, 0x86741224),
  1270. PCMCIA_DEVICE_PROD_ID12("AmbiCom Inc", "AMB8002", 0x93b15570, 0x75ec3efb),
  1271. PCMCIA_DEVICE_PROD_ID12("AmbiCom Inc", "AMB8002T", 0x93b15570, 0x461c5247),
  1272. PCMCIA_DEVICE_PROD_ID12("AmbiCom Inc", "AMB8010", 0x93b15570, 0x82f96e96),
  1273. PCMCIA_DEVICE_PROD_ID12("AnyCom", "ECO Ethernet", 0x578ba6e7, 0x0a9888c1),
  1274. PCMCIA_DEVICE_PROD_ID12("AnyCom", "ECO Ethernet 10/100", 0x578ba6e7, 0x939fedbd),
  1275. PCMCIA_DEVICE_PROD_ID12("AROWANA", "PCMCIA Ethernet LAN Card", 0x313adbc8, 0x08d9f190),
  1276. PCMCIA_DEVICE_PROD_ID12("ASANTE", "FriendlyNet PC Card", 0x3a7ade0f, 0x41c64504),
  1277. PCMCIA_DEVICE_PROD_ID12("Billionton", "LNT-10TB", 0x552ab682, 0xeeb1ba6a),
  1278. PCMCIA_DEVICE_PROD_ID12("CF", "10Base-Ethernet", 0x44ebf863, 0x93ae4d79),
  1279. PCMCIA_DEVICE_PROD_ID12("CNet", "CN40BC Ethernet", 0xbc477dde, 0xfba775a7),
  1280. PCMCIA_DEVICE_PROD_ID12("COMPU-SHACK", "BASEline PCMCIA 10 MBit Ethernetadapter", 0xfa2e424d, 0xe9190d8a),
  1281. PCMCIA_DEVICE_PROD_ID12("COMPU-SHACK", "FASTline PCMCIA 10/100 Fast-Ethernet", 0xfa2e424d, 0x3953d9b9),
  1282. PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722),
  1283. PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2),
  1284. PCMCIA_DEVICE_PROD_ID12("corega", "Ether CF-TD", 0x0a21501a, 0x6589340a),
  1285. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether CF-TD LAN Card", 0x5261440f, 0x8797663b),
  1286. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd),
  1287. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d),
  1288. PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
  1289. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa),
  1290. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-TD", 0x5261440f, 0x47d5ca83),
  1291. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
  1292. PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2),
  1293. PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2),
  1294. PCMCIA_DEVICE_PROD_ID12("corega K.K.", "(CG-LAPCCTXD)", 0x5261440f, 0x73ec0d88),
  1295. PCMCIA_DEVICE_PROD_ID12("CouplerlessPCMCIA", "100BASE", 0xee5af0ad, 0x7c2add04),
  1296. PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-010", 0x77008979, 0x9d8d445d),
  1297. PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-110E 10/100M LAN Card", 0x77008979, 0xfd184814),
  1298. PCMCIA_DEVICE_PROD_ID12("DataTrek.", "NetCard ", 0x5cd66d9d, 0x84697ce0),
  1299. PCMCIA_DEVICE_PROD_ID12("Dayna Communications, Inc.", "CommuniCard E", 0x0c629325, 0xb4e7dbaf),
  1300. PCMCIA_DEVICE_PROD_ID12("Digicom", "Palladio LAN 10/100", 0x697403d8, 0xe160b995),
  1301. PCMCIA_DEVICE_PROD_ID12("Digicom", "Palladio LAN 10/100 Dongless", 0x697403d8, 0xa6d3b233),
  1302. PCMCIA_DEVICE_PROD_ID12("DIGITAL", "DEPCM-XX", 0x69616cb3, 0xe600e76e),
  1303. PCMCIA_DEVICE_PROD_ID12("D-Link", "DE-650", 0x1a424a1c, 0xf28c8398),
  1304. PCMCIA_DEVICE_PROD_ID12("D-Link", "DE-660", 0x1a424a1c, 0xd9a1d05b),
  1305. PCMCIA_DEVICE_PROD_ID12("D-Link", "DE-660+", 0x1a424a1c, 0x50dcd0ec),
  1306. PCMCIA_DEVICE_PROD_ID12("D-Link", "DFE-650", 0x1a424a1c, 0x0f0073f9),
  1307. PCMCIA_DEVICE_PROD_ID12("Dual Speed", "10/100 PC Card", 0x725b842d, 0xf1efee84),
  1308. PCMCIA_DEVICE_PROD_ID12("Dual Speed", "10/100 Port Attached PC Card", 0x725b842d, 0x2db1f8e9),
  1309. PCMCIA_DEVICE_PROD_ID12("Dynalink", "L10BC", 0x55632fd5, 0xdc65f2b1),
  1310. PCMCIA_DEVICE_PROD_ID12("DYNALINK", "L10BC", 0x6a26d1cf, 0xdc65f2b1),
  1311. PCMCIA_DEVICE_PROD_ID12("DYNALINK", "L10C", 0x6a26d1cf, 0xc4f84efb),
  1312. PCMCIA_DEVICE_PROD_ID12("E-CARD", "E-CARD", 0x6701da11, 0x6701da11),
  1313. PCMCIA_DEVICE_PROD_ID12("EIGER Labs Inc.", "Ethernet 10BaseT card", 0x53c864c6, 0xedd059f6),
  1314. PCMCIA_DEVICE_PROD_ID12("EIGER Labs Inc.", "Ethernet Combo card", 0x53c864c6, 0x929c486c),
  1315. PCMCIA_DEVICE_PROD_ID12("Ethernet", "Adapter", 0x00b2e941, 0x4b0d829e),
  1316. PCMCIA_DEVICE_PROD_ID12("Ethernet Adapter", "E2000 PCMCIA Ethernet", 0x96767301, 0x71fbbc61),
  1317. PCMCIA_DEVICE_PROD_ID12("Ethernet PCMCIA adapter", "EP-210", 0x8dd86181, 0xf2b52517),
  1318. PCMCIA_DEVICE_PROD_ID12("Fast Ethernet", "Adapter", 0xb4be14e3, 0x4b0d829e),
  1319. PCMCIA_DEVICE_PROD_ID12("Grey Cell", "GCS2000", 0x2a151fac, 0xf00555cb),
  1320. PCMCIA_DEVICE_PROD_ID12("Grey Cell", "GCS2220", 0x2a151fac, 0xc1b7e327),
  1321. PCMCIA_DEVICE_PROD_ID12("GVC", "NIC-2000p", 0x76e171bd, 0x6eb1c947),
  1322. PCMCIA_DEVICE_PROD_ID12("IBM Corp.", "Ethernet", 0xe3736c88, 0x00b2e941),
  1323. PCMCIA_DEVICE_PROD_ID12("IC-CARD", "IC-CARD", 0x60cb09a6, 0x60cb09a6),
  1324. PCMCIA_DEVICE_PROD_ID12("IC-CARD+", "IC-CARD+", 0x93693494, 0x93693494),
  1325. PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b),
  1326. PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0),
  1327. PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956),
  1328. PCMCIA_DEVICE_PROD_ID12("KENTRONICS", "KEP-230", 0xaf8144c9, 0x868f6616),
  1329. PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64),
  1330. PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5),
  1331. PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3),
  1332. PCMCIA_DEVICE_PROD_ID12("Kingston Technology Corp.", "EtheRx PC Card Ethernet Adapter", 0x313c7be3, 0x0afb54a2),
  1333. PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-10/100CD", 0x1b7827b2, 0xcda71d1c),
  1334. PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-CDF", 0x1b7827b2, 0xfec71e40),
  1335. PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-CDL/T", 0x1b7827b2, 0x79fba4f7),
  1336. PCMCIA_DEVICE_PROD_ID12("Laneed", "LD-CDS", 0x1b7827b2, 0x931afaab),
  1337. PCMCIA_DEVICE_PROD_ID12("LEMEL", "LM-N89TX PRO", 0xbbefb52f, 0xd2897a97),
  1338. PCMCIA_DEVICE_PROD_ID12("Linksys", "Combo PCMCIA EthernetCard (EC2T)", 0x0733cc81, 0x32ee8c78),
  1339. PCMCIA_DEVICE_PROD_ID12("LINKSYS", "E-CARD", 0xf7cb0b07, 0x6701da11),
  1340. PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 Integrated PC Card (PCM100)", 0x0733cc81, 0x453c3f9d),
  1341. PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100)", 0x0733cc81, 0x66c5a389),
  1342. PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V2)", 0x0733cc81, 0x3a3b28e9),
  1343. PCMCIA_DEVICE_PROD_ID12("Linksys", "HomeLink Phoneline + 10/100 Network PC Card (PCM100H1)", 0x733cc81, 0x7a3e5c3a),
  1344. PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TX", 0x88fcdeda, 0x6d772737),
  1345. PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TE", 0x88fcdeda, 0x0e714bee),
  1346. PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN20T", 0x88fcdeda, 0x81090922),
  1347. PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN10TE", 0x88fcdeda, 0xc1e2521c),
  1348. PCMCIA_DEVICE_PROD_ID12("LONGSHINE", "PCMCIA Ethernet Card", 0xf866b0b0, 0x6f6652e0),
  1349. PCMCIA_DEVICE_PROD_ID12("MACNICA", "ME1-JEIDA", 0x20841b68, 0xaf8a3578),
  1350. PCMCIA_DEVICE_PROD_ID12("Macsense", "MPC-10", 0xd830297f, 0xd265c307),
  1351. PCMCIA_DEVICE_PROD_ID12("Matsushita Electric Industrial Co.,LTD.", "CF-VEL211", 0x44445376, 0x8ded41d4),
  1352. PCMCIA_DEVICE_PROD_ID12("MAXTECH", "PCN2000", 0x78d64bc0, 0xca0ca4b8),
  1353. PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC2-T", 0x481e0094, 0xa2eb0cf3),
  1354. PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC2-TX", 0x481e0094, 0x41a6916c),
  1355. PCMCIA_DEVICE_PROD_ID12("Microcom C.E.", "Travel Card LAN 10/100", 0x4b91cec7, 0xe70220d6),
  1356. PCMCIA_DEVICE_PROD_ID12("Microdyne", "NE4200", 0x2e6da59b, 0x0478e472),
  1357. PCMCIA_DEVICE_PROD_ID12("MIDORI ELEC.", "LT-PCMT", 0x648d55c1, 0xbde526c7),
  1358. PCMCIA_DEVICE_PROD_ID12("National Semiconductor", "InfoMover 4100", 0x36e1191f, 0x60c229b9),
  1359. PCMCIA_DEVICE_PROD_ID12("National Semiconductor", "InfoMover NE4100", 0x36e1191f, 0xa6617ec8),
  1360. PCMCIA_DEVICE_PROD_ID12("NEC", "PC-9801N-J12", 0x18df0ba0, 0xbc912d76),
  1361. PCMCIA_DEVICE_PROD_ID12("NETGEAR", "FA410TX", 0x9aa79dc3, 0x60e5bc0e),
  1362. PCMCIA_DEVICE_PROD_ID12("Network Everywhere", "Fast Ethernet 10/100 PC Card", 0x820a67b6, 0x31ed1a5f),
  1363. PCMCIA_DEVICE_PROD_ID12("NextCom K.K.", "Next Hawk", 0xaedaec74, 0xad050ef1),
  1364. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "10/100Mbps Ethernet Card", 0x281f1c5d, 0x6e41773b),
  1365. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet", 0x281f1c5d, 0x00b2e941),
  1366. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "ETHERNET", 0x281f1c5d, 0x3ff7175b),
  1367. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet 10BaseT Card", 0x281f1c5d, 0x4de2f6c8),
  1368. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet Card", 0x281f1c5d, 0x5e9d92c0),
  1369. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Ethernet Combo card", 0x281f1c5d, 0x929c486c),
  1370. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "ETHERNET V1.0", 0x281f1c5d, 0x4d8817c8),
  1371. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "FastEthernet", 0x281f1c5d, 0xfe871eeb),
  1372. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "Fast-Ethernet", 0x281f1c5d, 0x45f1f3b4),
  1373. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "FAST ETHERNET CARD", 0x281f1c5d, 0xec5dbca7),
  1374. PCMCIA_DEVICE_PROD_ID12("PCMCIA LAN", "Ethernet", 0x7500e246, 0x00b2e941),
  1375. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "LNT-10TN", 0x281f1c5d, 0xe707f641),
  1376. PCMCIA_DEVICE_PROD_ID12("PCMCIAs", "ComboCard", 0xdcfe12d3, 0xcd8906cc),
  1377. PCMCIA_DEVICE_PROD_ID12("PCMCIA", "UE2212", 0x281f1c5d, 0xbf17199b),
  1378. PCMCIA_DEVICE_PROD_ID12("PCMCIA", " Ethernet NE2000 Compatible", 0x281f1c5d, 0x42d5d7e1),
  1379. PCMCIA_DEVICE_PROD_ID12("PRETEC", "Ethernet CompactLAN 10baseT 3.3V", 0xebf91155, 0x30074c80),
  1380. PCMCIA_DEVICE_PROD_ID12("PRETEC", "Ethernet CompactLAN 10BaseT 3.3V", 0xebf91155, 0x7f5a4f50),
  1381. PCMCIA_DEVICE_PROD_ID12("Psion Dacom", "Gold Card Ethernet", 0xf5f025c2, 0x3a30e110),
  1382. PCMCIA_DEVICE_PROD_ID12("=RELIA==", "Ethernet", 0xcdd0644a, 0x00b2e941),
  1383. PCMCIA_DEVICE_PROD_ID12("RIOS Systems Co.", "PC CARD3 ETHERNET", 0x7dd33481, 0x10b41826),
  1384. PCMCIA_DEVICE_PROD_ID12("RP", "1625B Ethernet NE2000 Compatible", 0xe3e66e22, 0xb96150df),
  1385. PCMCIA_DEVICE_PROD_ID12("RPTI", "EP400 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4a7e2ae0),
  1386. PCMCIA_DEVICE_PROD_ID12("RPTI", "EP401 Ethernet NE2000 Compatible", 0xdc6f88fd, 0x4bcbd7fd),
  1387. PCMCIA_DEVICE_PROD_ID12("RPTI LTD.", "EP400", 0xc53ac515, 0x81e39388),
  1388. PCMCIA_DEVICE_PROD_ID12("SCM", "Ethernet Combo card", 0xbdc3b102, 0x929c486c),
  1389. PCMCIA_DEVICE_PROD_ID12("Seiko Epson Corp.", "Ethernet", 0x09928730, 0x00b2e941),
  1390. PCMCIA_DEVICE_PROD_ID12("SMC", "EZCard-10-PCMCIA", 0xc4f8b18b, 0xfb21d265),
  1391. PCMCIA_DEVICE_PROD_ID12("Socket Communications Inc", "Socket EA PCMCIA LAN Adapter Revision D", 0xc70a4760, 0x2ade483e),
  1392. PCMCIA_DEVICE_PROD_ID12("Socket Communications Inc", "Socket EA PCMCIA LAN Adapter Revision E", 0xc70a4760, 0x5dd978a8),
  1393. PCMCIA_DEVICE_PROD_ID12("TDK", "LAK-CD031 for PCMCIA", 0x1eae9475, 0x0ed386fa),
  1394. PCMCIA_DEVICE_PROD_ID12("Telecom Device K.K.", "SuperSocket RE450T", 0x466b05f0, 0x8b74bc4f),
  1395. PCMCIA_DEVICE_PROD_ID12("Telecom Device K.K.", "SuperSocket RE550T", 0x466b05f0, 0x33c8db2a),
  1396. PCMCIA_DEVICE_PROD_ID13("Hypertec", "EP401", 0x8787bec7, 0xf6e4a31e),
  1397. PCMCIA_DEVICE_PROD_ID13("KingMax Technology Inc.", "Ethernet Card", 0x932b7189, 0x5e9d92c0),
  1398. PCMCIA_DEVICE_PROD_ID13("LONGSHINE", "EP401", 0xf866b0b0, 0xf6e4a31e),
  1399. PCMCIA_DEVICE_PROD_ID13("Xircom", "CFE-10", 0x2e3ee845, 0x22a49f89),
  1400. PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360),
  1401. PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de),
  1402. PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f),
  1403. PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a),
  1404. PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078),
  1405. /* too generic! */
  1406. /* PCMCIA_DEVICE_PROD_ID12("PCMCIA", "10/100 Ethernet Card", 0x281f1c5d, 0x11b0ffc0), */
  1407. PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "PCMCIA", "EN2218-LAN/MODEM", 0x281f1c5d, 0x570f348e, "cis/PCMLM28.cis"),
  1408. PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "PCMCIA", "UE2218-LAN/MODEM", 0x281f1c5d, 0x6fdcacee, "cis/PCMLM28.cis"),
  1409. PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "Psion Dacom", "Gold Card V34 Ethernet", 0xf5f025c2, 0x338e8155, "cis/PCMLM28.cis"),
  1410. PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "Psion Dacom", "Gold Card V34 Ethernet GSM", 0xf5f025c2, 0x4ae85d35, "cis/PCMLM28.cis"),
  1411. PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "LINKSYS", "PCMLM28", 0xf7cb0b07, 0x66881874, "cis/PCMLM28.cis"),
  1412. PCMCIA_PFC_DEVICE_CIS_PROD_ID12(0, "TOSHIBA", "Modem/LAN Card", 0xb4585a1a, 0x53f922f8, "cis/PCMLM28.cis"),
  1413. PCMCIA_MFC_DEVICE_CIS_PROD_ID12(0, "DAYNA COMMUNICATIONS", "LAN AND MODEM MULTIFUNCTION", 0x8fdf8f89, 0xdd5ed9e8, "cis/DP83903.cis"),
  1414. PCMCIA_MFC_DEVICE_CIS_PROD_ID4(0, "NSC MF LAN/Modem", 0x58fc6056, "cis/DP83903.cis"),
  1415. PCMCIA_MFC_DEVICE_CIS_MANF_CARD(0, 0x0175, 0x0000, "cis/DP83903.cis"),
  1416. PCMCIA_DEVICE_CIS_PROD_ID12("Allied Telesis,K.K", "Ethernet LAN Card", 0x2ad62f3c, 0x9fd2f0a2, "cis/LA-PCM.cis"),
  1417. PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "cis/PE520.cis"),
  1418. PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "cis/NE2K.cis"),
  1419. PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "cis/PE-200.cis"),
  1420. PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "cis/tamarack.cis"),
  1421. PCMCIA_DEVICE_PROD_ID12("Ethernet", "CF Size PC Card", 0x00b2e941, 0x43ac239b),
  1422. PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0",
  1423. 0xb4be14e3, 0x43ac239b, 0x0877b627),
  1424. PCMCIA_DEVICE_NULL
  1425. };
  1426. MODULE_DEVICE_TABLE(pcmcia, pcnet_ids);
  1427. MODULE_FIRMWARE("cis/PCMLM28.cis");
  1428. MODULE_FIRMWARE("cis/DP83903.cis");
  1429. MODULE_FIRMWARE("cis/LA-PCM.cis");
  1430. MODULE_FIRMWARE("cis/PE520.cis");
  1431. MODULE_FIRMWARE("cis/NE2K.cis");
  1432. MODULE_FIRMWARE("cis/PE-200.cis");
  1433. MODULE_FIRMWARE("cis/tamarack.cis");
  1434. static struct pcmcia_driver pcnet_driver = {
  1435. .name = "pcnet_cs",
  1436. .probe = pcnet_probe,
  1437. .remove = pcnet_detach,
  1438. .owner = THIS_MODULE,
  1439. .id_table = pcnet_ids,
  1440. .suspend = pcnet_suspend,
  1441. .resume = pcnet_resume,
  1442. };
  1443. module_pcmcia_driver(pcnet_driver);