Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Linux ARCnet driver - COM20020 chipset support |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 3 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * Written 1997 by David Woodhouse. |
| 5 | * Written 1994-1999 by Avery Pennarun. |
| 6 | * Written 1999 by Martin Mares <mj@ucw.cz>. |
| 7 | * Derived from skeleton.c by Donald Becker. |
| 8 | * |
| 9 | * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com) |
| 10 | * for sponsoring the further development of this driver. |
| 11 | * |
| 12 | * ********************** |
| 13 | * |
| 14 | * The original copyright of skeleton.c was as follows: |
| 15 | * |
| 16 | * skeleton.c Written 1993 by Donald Becker. |
| 17 | * Copyright 1993 United States Government as represented by the |
| 18 | * Director, National Security Agency. This software may only be used |
| 19 | * and distributed according to the terms of the GNU General Public License as |
| 20 | * modified by SRC, incorporated herein by reference. |
| 21 | * |
| 22 | * ********************** |
| 23 | * |
| 24 | * For more details, see drivers/net/arcnet.c |
| 25 | * |
| 26 | * ********************** |
| 27 | */ |
| 28 | #include <linux/module.h> |
| 29 | #include <linux/kernel.h> |
| 30 | #include <linux/types.h> |
| 31 | #include <linux/ioport.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #include <linux/errno.h> |
| 33 | #include <linux/delay.h> |
| 34 | #include <linux/netdevice.h> |
| 35 | #include <linux/init.h> |
Alexey Dobriyan | a6b7a40 | 2011-06-06 10:43:46 +0000 | [diff] [blame] | 36 | #include <linux/interrupt.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | #include <linux/arcdevice.h> |
| 38 | #include <linux/com20020.h> |
| 39 | |
Joe Perches | 5e7ef91 | 2015-05-05 10:05:51 -0700 | [diff] [blame] | 40 | #include <linux/io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
| 42 | #define VERSION "arcnet: COM20020 chipset support (by David Woodhouse et al.)\n" |
| 43 | |
Joe Perches | 7f5e760 | 2015-05-05 10:05:49 -0700 | [diff] [blame] | 44 | static char *clockrates[] = { |
| 45 | "XXXXXXX", "XXXXXXXX", "XXXXXX", |
| 46 | "2.5 Mb/s", "1.25Mb/s", "625 Kb/s", "312.5 Kb/s", |
| 47 | "156.25 Kb/s", "Reserved", "Reserved", "Reserved" |
| 48 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
| 50 | static void com20020_command(struct net_device *dev, int command); |
| 51 | static int com20020_status(struct net_device *dev); |
| 52 | static void com20020_setmask(struct net_device *dev, int mask); |
| 53 | static int com20020_reset(struct net_device *dev, int really_reset); |
| 54 | static void com20020_copy_to_card(struct net_device *dev, int bufnum, |
| 55 | int offset, void *buf, int count); |
| 56 | static void com20020_copy_from_card(struct net_device *dev, int bufnum, |
| 57 | int offset, void *buf, int count); |
| 58 | static void com20020_set_mc_list(struct net_device *dev); |
| 59 | static void com20020_close(struct net_device *); |
| 60 | |
| 61 | static void com20020_copy_from_card(struct net_device *dev, int bufnum, |
| 62 | int offset, void *buf, int count) |
| 63 | { |
| 64 | int ioaddr = dev->base_addr, ofs = 512 * bufnum + offset; |
| 65 | |
| 66 | /* set up the address register */ |
| 67 | outb((ofs >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); |
| 68 | outb(ofs & 0xff, _ADDR_LO); |
| 69 | |
| 70 | /* copy the data */ |
| 71 | TIME("insb", count, insb(_MEMDATA, buf, count)); |
| 72 | } |
| 73 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | static void com20020_copy_to_card(struct net_device *dev, int bufnum, |
| 75 | int offset, void *buf, int count) |
| 76 | { |
| 77 | int ioaddr = dev->base_addr, ofs = 512 * bufnum + offset; |
| 78 | |
| 79 | /* set up the address register */ |
| 80 | outb((ofs >> 8) | AUTOINCflag, _ADDR_HI); |
| 81 | outb(ofs & 0xff, _ADDR_LO); |
| 82 | |
| 83 | /* copy the data */ |
| 84 | TIME("outsb", count, outsb(_MEMDATA, buf, count)); |
| 85 | } |
| 86 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | /* Reset the card and check some basic stuff during the detection stage. */ |
| 88 | int com20020_check(struct net_device *dev) |
| 89 | { |
| 90 | int ioaddr = dev->base_addr, status; |
Wang Chen | 454d7c9 | 2008-11-12 23:37:49 -0800 | [diff] [blame] | 91 | struct arcnet_local *lp = netdev_priv(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
| 93 | ARCRESET0; |
| 94 | mdelay(RESETtime); |
| 95 | |
| 96 | lp->setup = lp->clockm ? 0 : (lp->clockp << 1); |
| 97 | lp->setup2 = (lp->clockm << 4) | 8; |
| 98 | |
| 99 | /* CHECK: should we do this for SOHARD cards ? */ |
| 100 | /* Enable P1Mode for backplane mode */ |
| 101 | lp->setup = lp->setup | P1MODE; |
| 102 | |
| 103 | SET_SUBADR(SUB_SETUP1); |
| 104 | outb(lp->setup, _XREG); |
| 105 | |
Joe Perches | 7f5e760 | 2015-05-05 10:05:49 -0700 | [diff] [blame] | 106 | if (lp->clockm != 0) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | SET_SUBADR(SUB_SETUP2); |
| 108 | outb(lp->setup2, _XREG); |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 109 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | /* must now write the magic "restart operation" command */ |
| 111 | mdelay(1); |
| 112 | outb(0x18, _COMMAND); |
| 113 | } |
| 114 | |
| 115 | lp->config = 0x21 | (lp->timeout << 3) | (lp->backplane << 2); |
| 116 | /* set node ID to 0x42 (but transmitter is disabled, so it's okay) */ |
| 117 | SETCONF; |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 118 | outb(0x42, ioaddr + BUS_ALIGN * 7); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | |
| 120 | status = ASTATUS(); |
| 121 | |
| 122 | if ((status & 0x99) != (NORXflag | TXFREEflag | RESETflag)) { |
| 123 | BUGMSG(D_NORMAL, "status invalid (%Xh).\n", status); |
| 124 | return -ENODEV; |
| 125 | } |
| 126 | BUGMSG(D_INIT_REASONS, "status after reset: %X\n", status); |
| 127 | |
| 128 | /* Enable TX */ |
| 129 | outb(0x39, _CONFIG); |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 130 | outb(inb(ioaddr + BUS_ALIGN * 8), ioaddr + BUS_ALIGN * 7); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | |
| 132 | ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); |
| 133 | |
| 134 | status = ASTATUS(); |
| 135 | BUGMSG(D_INIT_REASONS, "status after reset acknowledged: %X\n", |
| 136 | status); |
| 137 | |
| 138 | /* Read first location of memory */ |
| 139 | outb(0 | RDDATAflag | AUTOINCflag, _ADDR_HI); |
| 140 | outb(0, _ADDR_LO); |
| 141 | |
| 142 | if ((status = inb(_MEMDATA)) != TESTvalue) { |
| 143 | BUGMSG(D_NORMAL, "Signature byte not found (%02Xh != D1h).\n", |
| 144 | status); |
| 145 | return -ENODEV; |
| 146 | } |
| 147 | return 0; |
| 148 | } |
| 149 | |
Michael Grzeschik | a0d2e51 | 2014-09-29 11:55:35 +0200 | [diff] [blame] | 150 | static int com20020_set_hwaddr(struct net_device *dev, void *addr) |
| 151 | { |
| 152 | int ioaddr = dev->base_addr; |
| 153 | struct arcnet_local *lp = netdev_priv(dev); |
| 154 | struct sockaddr *hwaddr = addr; |
| 155 | |
| 156 | memcpy(dev->dev_addr, hwaddr->sa_data, 1); |
| 157 | SET_SUBADR(SUB_NODE); |
| 158 | outb(dev->dev_addr[0], _XREG); |
| 159 | |
| 160 | return 0; |
| 161 | } |
| 162 | |
Stephen Hemminger | a1799af | 2009-01-09 13:01:10 +0000 | [diff] [blame] | 163 | const struct net_device_ops com20020_netdev_ops = { |
| 164 | .ndo_open = arcnet_open, |
| 165 | .ndo_stop = arcnet_close, |
| 166 | .ndo_start_xmit = arcnet_send_packet, |
| 167 | .ndo_tx_timeout = arcnet_timeout, |
Michael Grzeschik | a0d2e51 | 2014-09-29 11:55:35 +0200 | [diff] [blame] | 168 | .ndo_set_mac_address = com20020_set_hwaddr, |
Jiri Pirko | afc4b13 | 2011-08-16 06:29:01 +0000 | [diff] [blame] | 169 | .ndo_set_rx_mode = com20020_set_mc_list, |
Stephen Hemminger | a1799af | 2009-01-09 13:01:10 +0000 | [diff] [blame] | 170 | }; |
| 171 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | /* Set up the struct net_device associated with this card. Called after |
| 173 | * probing succeeds. |
| 174 | */ |
| 175 | int com20020_found(struct net_device *dev, int shared) |
| 176 | { |
| 177 | struct arcnet_local *lp; |
| 178 | int ioaddr = dev->base_addr; |
| 179 | |
| 180 | /* Initialize the rest of the device structure. */ |
| 181 | |
Wang Chen | 454d7c9 | 2008-11-12 23:37:49 -0800 | [diff] [blame] | 182 | lp = netdev_priv(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | |
| 184 | lp->hw.owner = THIS_MODULE; |
| 185 | lp->hw.command = com20020_command; |
| 186 | lp->hw.status = com20020_status; |
| 187 | lp->hw.intmask = com20020_setmask; |
| 188 | lp->hw.reset = com20020_reset; |
| 189 | lp->hw.copy_to_card = com20020_copy_to_card; |
| 190 | lp->hw.copy_from_card = com20020_copy_from_card; |
| 191 | lp->hw.close = com20020_close; |
| 192 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | if (!dev->dev_addr[0]) |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 194 | dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8); /* FIXME: do this some other way! */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | |
| 196 | SET_SUBADR(SUB_SETUP1); |
| 197 | outb(lp->setup, _XREG); |
| 198 | |
Joe Perches | 7f5e760 | 2015-05-05 10:05:49 -0700 | [diff] [blame] | 199 | if (lp->card_flags & ARC_CAN_10MBIT) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | SET_SUBADR(SUB_SETUP2); |
| 201 | outb(lp->setup2, _XREG); |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 202 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | /* must now write the magic "restart operation" command */ |
| 204 | mdelay(1); |
| 205 | outb(0x18, _COMMAND); |
| 206 | } |
| 207 | |
| 208 | lp->config = 0x20 | (lp->timeout << 3) | (lp->backplane << 2) | 1; |
| 209 | /* Default 0x38 + register: Node ID */ |
| 210 | SETCONF; |
| 211 | outb(dev->dev_addr[0], _XREG); |
| 212 | |
| 213 | /* reserve the irq */ |
Joe Perches | a0607fd | 2009-11-18 23:29:17 -0800 | [diff] [blame] | 214 | if (request_irq(dev->irq, arcnet_interrupt, shared, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | "arcnet (COM20020)", dev)) { |
| 216 | BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq); |
| 217 | return -ENODEV; |
| 218 | } |
| 219 | |
| 220 | dev->base_addr = ioaddr; |
| 221 | |
| 222 | BUGMSG(D_NORMAL, "%s: station %02Xh found at %03lXh, IRQ %d.\n", |
| 223 | lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq); |
| 224 | |
| 225 | if (lp->backplane) |
| 226 | BUGMSG(D_NORMAL, "Using backplane mode.\n"); |
| 227 | |
| 228 | if (lp->timeout != 3) |
| 229 | BUGMSG(D_NORMAL, "Using extended timeout value of %d.\n", lp->timeout); |
| 230 | |
| 231 | BUGMSG(D_NORMAL, "Using CKP %d - data rate %s.\n", |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 232 | lp->setup >> 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | clockrates[3 - ((lp->setup2 & 0xF0) >> 4) + ((lp->setup & 0x0F) >> 1)]); |
| 234 | |
| 235 | if (register_netdev(dev)) { |
| 236 | free_irq(dev->irq, dev); |
| 237 | return -EIO; |
| 238 | } |
| 239 | return 0; |
| 240 | } |
| 241 | |
Joe Perches | f2f0a16 | 2015-05-05 10:05:52 -0700 | [diff] [blame^] | 242 | /* Do a hardware reset on the card, and set up necessary registers. |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 243 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | * This should be called as little as possible, because it disrupts the |
| 245 | * token on the network (causes a RECON) and requires a significant delay. |
| 246 | * |
| 247 | * However, it does make sure the card is in a defined state. |
| 248 | */ |
| 249 | static int com20020_reset(struct net_device *dev, int really_reset) |
| 250 | { |
Wang Chen | 454d7c9 | 2008-11-12 23:37:49 -0800 | [diff] [blame] | 251 | struct arcnet_local *lp = netdev_priv(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | u_int ioaddr = dev->base_addr; |
| 253 | u_char inbyte; |
| 254 | |
| 255 | BUGMSG(D_DEBUG, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n", |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 256 | __FILE__, __LINE__, __func__, dev, lp, dev->name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", |
| 258 | dev->name, ASTATUS()); |
| 259 | |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 260 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2); |
| 262 | /* power-up defaults */ |
| 263 | SETCONF; |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 264 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | |
| 266 | if (really_reset) { |
| 267 | /* reset the card */ |
| 268 | ARCRESET; |
| 269 | mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */ |
| 270 | } |
| 271 | /* clear flags & end reset */ |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 272 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); |
| 274 | |
| 275 | /* verify that the ARCnet signature byte is present */ |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 276 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | |
| 278 | com20020_copy_from_card(dev, 0, 0, &inbyte, 1); |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 279 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | if (inbyte != TESTvalue) { |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 281 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n"); |
| 283 | return 1; |
| 284 | } |
| 285 | /* enable extended (512-byte) packets */ |
| 286 | ACOMMAND(CONFIGcmd | EXTconf); |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 287 | BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | |
| 289 | /* done! return success. */ |
| 290 | return 0; |
| 291 | } |
| 292 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | static void com20020_setmask(struct net_device *dev, int mask) |
| 294 | { |
| 295 | u_int ioaddr = dev->base_addr; |
Joe Perches | 01a1d5a | 2015-05-05 10:05:48 -0700 | [diff] [blame] | 296 | |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 297 | BUGMSG(D_DURING, "Setting mask to %x at %x\n", mask, ioaddr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | AINTMASK(mask); |
| 299 | } |
| 300 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | static void com20020_command(struct net_device *dev, int cmd) |
| 302 | { |
| 303 | u_int ioaddr = dev->base_addr; |
Joe Perches | 01a1d5a | 2015-05-05 10:05:48 -0700 | [diff] [blame] | 304 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | ACOMMAND(cmd); |
| 306 | } |
| 307 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | static int com20020_status(struct net_device *dev) |
| 309 | { |
| 310 | u_int ioaddr = dev->base_addr; |
| 311 | |
Joe Perches | cb33464 | 2015-05-05 10:05:47 -0700 | [diff] [blame] | 312 | return ASTATUS() + (ADIAGSTATUS() << 8); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | static void com20020_close(struct net_device *dev) |
| 316 | { |
Wang Chen | 454d7c9 | 2008-11-12 23:37:49 -0800 | [diff] [blame] | 317 | struct arcnet_local *lp = netdev_priv(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | int ioaddr = dev->base_addr; |
| 319 | |
| 320 | /* disable transmitter */ |
| 321 | lp->config &= ~TXENcfg; |
| 322 | SETCONF; |
| 323 | } |
| 324 | |
| 325 | /* Set or clear the multicast filter for this adaptor. |
| 326 | * num_addrs == -1 Promiscuous mode, receive all packets |
| 327 | * num_addrs == 0 Normal mode, clear multicast list |
| 328 | * num_addrs > 0 Multicast mode, receive normal and MC packets, and do |
| 329 | * best-effort filtering. |
| 330 | * FIXME - do multicast stuff, not just promiscuous. |
| 331 | */ |
| 332 | static void com20020_set_mc_list(struct net_device *dev) |
| 333 | { |
Wang Chen | 454d7c9 | 2008-11-12 23:37:49 -0800 | [diff] [blame] | 334 | struct arcnet_local *lp = netdev_priv(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | int ioaddr = dev->base_addr; |
| 336 | |
| 337 | if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ |
| 338 | if (!(lp->setup & PROMISCset)) |
| 339 | BUGMSG(D_NORMAL, "Setting promiscuous flag...\n"); |
| 340 | SET_SUBADR(SUB_SETUP1); |
| 341 | lp->setup |= PROMISCset; |
| 342 | outb(lp->setup, _XREG); |
| 343 | } else |
| 344 | /* Disable promiscuous mode, use normal mode */ |
| 345 | { |
| 346 | if ((lp->setup & PROMISCset)) |
| 347 | BUGMSG(D_NORMAL, "Resetting promiscuous flag...\n"); |
| 348 | SET_SUBADR(SUB_SETUP1); |
| 349 | lp->setup &= ~PROMISCset; |
| 350 | outb(lp->setup, _XREG); |
| 351 | } |
| 352 | } |
| 353 | |
Randy Dunlap | ace48ff | 2006-11-08 19:51:03 -0800 | [diff] [blame] | 354 | #if defined(CONFIG_ARCNET_COM20020_PCI_MODULE) || \ |
Randy Dunlap | 2a10387 | 2007-02-12 00:52:22 -0800 | [diff] [blame] | 355 | defined(CONFIG_ARCNET_COM20020_ISA_MODULE) || \ |
| 356 | defined(CONFIG_ARCNET_COM20020_CS_MODULE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 357 | EXPORT_SYMBOL(com20020_check); |
| 358 | EXPORT_SYMBOL(com20020_found); |
David S. Miller | dd0a251 | 2009-01-25 21:17:25 -0800 | [diff] [blame] | 359 | EXPORT_SYMBOL(com20020_netdev_ops); |
Randy Dunlap | ace48ff | 2006-11-08 19:51:03 -0800 | [diff] [blame] | 360 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | |
| 362 | MODULE_LICENSE("GPL"); |
| 363 | |
Randy Dunlap | ace48ff | 2006-11-08 19:51:03 -0800 | [diff] [blame] | 364 | #ifdef MODULE |
| 365 | |
Jon Schindler | 0ebd1c1 | 2008-02-28 01:31:08 -0600 | [diff] [blame] | 366 | static int __init com20020_module_init(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | { |
| 368 | BUGLVL(D_NORMAL) printk(VERSION); |
| 369 | return 0; |
| 370 | } |
| 371 | |
Jon Schindler | 0ebd1c1 | 2008-02-28 01:31:08 -0600 | [diff] [blame] | 372 | static void __exit com20020_module_exit(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | { |
| 374 | } |
Jon Schindler | 0ebd1c1 | 2008-02-28 01:31:08 -0600 | [diff] [blame] | 375 | module_init(com20020_module_init); |
| 376 | module_exit(com20020_module_exit); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | #endif /* MODULE */ |