ia64/linux-2.6.18-xen.hg

annotate drivers/net/lne390.c @ 897:329ea0ccb344

balloon: try harder to balloon up under memory pressure.

Currently if the balloon driver is unable to increase the guest's
reservation it assumes the failure was due to reaching its full
allocation, gives up on the ballooning operation and records the limit
it reached as the "hard limit". The driver will not try again until
the target is set again (even to the same value).

However it is possible that ballooning has in fact failed due to
memory pressure in the host and therefore it is desirable to keep
attempting to reach the target in case memory becomes available. The
most likely scenario is that some guests are ballooning down while
others are ballooning up and therefore there is temporary memory
pressure while things stabilise. You would not expect a well behaved
toolstack to ask a domain to balloon to more than its allocation nor
would you expect it to deliberately over-commit memory by setting
balloon targets which exceed the total host memory.

This patch drops the concept of a hard limit and causes the balloon
driver to retry increasing the reservation on a timer in the same
manner as when decreasing the reservation.

Also if we partially succeed in increasing the reservation
(i.e. receive less pages than we asked for) then we may as well keep
those pages rather than returning them to Xen.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 05 14:01:20 2009 +0100 (2009-06-05)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 lne390.c
ian@0 3
ian@0 4 Linux driver for Mylex LNE390 EISA Network Adapter
ian@0 5
ian@0 6 Copyright (C) 1996-1998, Paul Gortmaker.
ian@0 7
ian@0 8 This software may be used and distributed according to the terms
ian@0 9 of the GNU General Public License, incorporated herein by reference.
ian@0 10
ian@0 11 Information and Code Sources:
ian@0 12
ian@0 13 1) Based upon framework of es3210 driver.
ian@0 14 2) The existing myriad of other Linux 8390 drivers by Donald Becker.
ian@0 15 3) Russ Nelson's asm packet driver provided additional info.
ian@0 16 4) Info for getting IRQ and sh-mem gleaned from the EISA cfg files.
ian@0 17
ian@0 18 The LNE390 is an EISA shared memory NS8390 implementation. Note
ian@0 19 that all memory copies to/from the board must be 32bit transfers.
ian@0 20 There are two versions of the card: the lne390a and the lne390b.
ian@0 21 Going by the EISA cfg files, the "a" has jumpers to select between
ian@0 22 BNC/AUI, but the "b" also has RJ-45 and selection is via the SCU.
ian@0 23 The shared memory address selection is also slightly different.
ian@0 24 Note that shared memory address > 1MB are supported with this driver.
ian@0 25
ian@0 26 You can try <http://www.mylex.com> if you want more info, as I've
ian@0 27 never even seen one of these cards. :)
ian@0 28
ian@0 29 Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 2000/09/01
ian@0 30 - get rid of check_region
ian@0 31 - no need to check if dev == NULL in lne390_probe1
ian@0 32 */
ian@0 33
ian@0 34 static const char *version =
ian@0 35 "lne390.c: Driver revision v0.99.1, 01/09/2000\n";
ian@0 36
ian@0 37 #include <linux/module.h>
ian@0 38 #include <linux/eisa.h>
ian@0 39 #include <linux/kernel.h>
ian@0 40 #include <linux/errno.h>
ian@0 41 #include <linux/string.h>
ian@0 42 #include <linux/delay.h>
ian@0 43 #include <linux/init.h>
ian@0 44 #include <linux/netdevice.h>
ian@0 45 #include <linux/etherdevice.h>
ian@0 46
ian@0 47 #include <asm/io.h>
ian@0 48 #include <asm/system.h>
ian@0 49
ian@0 50 #include "8390.h"
ian@0 51
ian@0 52 #define DRV_NAME "lne390"
ian@0 53
ian@0 54 static int lne390_probe1(struct net_device *dev, int ioaddr);
ian@0 55
ian@0 56 static int lne390_open(struct net_device *dev);
ian@0 57 static int lne390_close(struct net_device *dev);
ian@0 58
ian@0 59 static void lne390_reset_8390(struct net_device *dev);
ian@0 60
ian@0 61 static void lne390_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page);
ian@0 62 static void lne390_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset);
ian@0 63 static void lne390_block_output(struct net_device *dev, int count, const unsigned char *buf, const int start_page);
ian@0 64
ian@0 65 #define LNE390_START_PG 0x00 /* First page of TX buffer */
ian@0 66 #define LNE390_STOP_PG 0x80 /* Last page +1 of RX ring */
ian@0 67
ian@0 68 #define LNE390_ID_PORT 0xc80 /* Same for all EISA cards */
ian@0 69 #define LNE390_IO_EXTENT 0x20
ian@0 70 #define LNE390_SA_PROM 0x16 /* Start of e'net addr. */
ian@0 71 #define LNE390_RESET_PORT 0xc84 /* From the pkt driver source */
ian@0 72 #define LNE390_NIC_OFFSET 0x00 /* Hello, the 8390 is *here* */
ian@0 73
ian@0 74 #define LNE390_ADDR0 0x00 /* 3 byte vendor prefix */
ian@0 75 #define LNE390_ADDR1 0x80
ian@0 76 #define LNE390_ADDR2 0xe5
ian@0 77
ian@0 78 #define LNE390_ID0 0x10009835 /* 0x3598 = 01101 01100 11000 = mlx */
ian@0 79 #define LNE390_ID1 0x11009835 /* above is the 390A, this is 390B */
ian@0 80
ian@0 81 #define LNE390_CFG1 0xc84 /* NB: 0xc84 is also "reset" port. */
ian@0 82 #define LNE390_CFG2 0xc90
ian@0 83
ian@0 84 /*
ian@0 85 * You can OR any of the following bits together and assign it
ian@0 86 * to LNE390_DEBUG to get verbose driver info during operation.
ian@0 87 * Currently only the probe one is implemented.
ian@0 88 */
ian@0 89
ian@0 90 #define LNE390_D_PROBE 0x01
ian@0 91 #define LNE390_D_RX_PKT 0x02
ian@0 92 #define LNE390_D_TX_PKT 0x04
ian@0 93 #define LNE390_D_IRQ 0x08
ian@0 94
ian@0 95 #define LNE390_DEBUG 0
ian@0 96
ian@0 97 static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3};
ian@0 98 static unsigned int shmem_mapA[] __initdata = {0xff, 0xfe, 0xfd, 0xfff, 0xffe, 0xffc, 0x0d, 0x0};
ian@0 99 static unsigned int shmem_mapB[] __initdata = {0xff, 0xfe, 0x0e, 0xfff, 0xffe, 0xffc, 0x0d, 0x0};
ian@0 100
ian@0 101 /*
ian@0 102 * Probe for the card. The best way is to read the EISA ID if it
ian@0 103 * is known. Then we can check the prefix of the station address
ian@0 104 * PROM for a match against the value assigned to Mylex.
ian@0 105 */
ian@0 106
ian@0 107 static int __init do_lne390_probe(struct net_device *dev)
ian@0 108 {
ian@0 109 unsigned short ioaddr = dev->base_addr;
ian@0 110 int irq = dev->irq;
ian@0 111 int mem_start = dev->mem_start;
ian@0 112 int ret;
ian@0 113
ian@0 114 SET_MODULE_OWNER(dev);
ian@0 115
ian@0 116 if (ioaddr > 0x1ff) { /* Check a single specified location. */
ian@0 117 if (!request_region(ioaddr, LNE390_IO_EXTENT, DRV_NAME))
ian@0 118 return -EBUSY;
ian@0 119 ret = lne390_probe1(dev, ioaddr);
ian@0 120 if (ret)
ian@0 121 release_region(ioaddr, LNE390_IO_EXTENT);
ian@0 122 return ret;
ian@0 123 }
ian@0 124 else if (ioaddr > 0) /* Don't probe at all. */
ian@0 125 return -ENXIO;
ian@0 126
ian@0 127 if (!EISA_bus) {
ian@0 128 #if LNE390_DEBUG & LNE390_D_PROBE
ian@0 129 printk("lne390-debug: Not an EISA bus. Not probing high ports.\n");
ian@0 130 #endif
ian@0 131 return -ENXIO;
ian@0 132 }
ian@0 133
ian@0 134 /* EISA spec allows for up to 16 slots, but 8 is typical. */
ian@0 135 for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
ian@0 136 if (!request_region(ioaddr, LNE390_IO_EXTENT, DRV_NAME))
ian@0 137 continue;
ian@0 138 if (lne390_probe1(dev, ioaddr) == 0)
ian@0 139 return 0;
ian@0 140 release_region(ioaddr, LNE390_IO_EXTENT);
ian@0 141 dev->irq = irq;
ian@0 142 dev->mem_start = mem_start;
ian@0 143 }
ian@0 144
ian@0 145 return -ENODEV;
ian@0 146 }
ian@0 147
ian@0 148 #ifndef MODULE
ian@0 149 struct net_device * __init lne390_probe(int unit)
ian@0 150 {
ian@0 151 struct net_device *dev = alloc_ei_netdev();
ian@0 152 int err;
ian@0 153
ian@0 154 if (!dev)
ian@0 155 return ERR_PTR(-ENOMEM);
ian@0 156
ian@0 157 sprintf(dev->name, "eth%d", unit);
ian@0 158 netdev_boot_setup_check(dev);
ian@0 159
ian@0 160 err = do_lne390_probe(dev);
ian@0 161 if (err)
ian@0 162 goto out;
ian@0 163 return dev;
ian@0 164 out:
ian@0 165 free_netdev(dev);
ian@0 166 return ERR_PTR(err);
ian@0 167 }
ian@0 168 #endif
ian@0 169
ian@0 170 static int __init lne390_probe1(struct net_device *dev, int ioaddr)
ian@0 171 {
ian@0 172 int i, revision, ret;
ian@0 173 unsigned long eisa_id;
ian@0 174
ian@0 175 if (inb_p(ioaddr + LNE390_ID_PORT) == 0xff) return -ENODEV;
ian@0 176
ian@0 177 #if LNE390_DEBUG & LNE390_D_PROBE
ian@0 178 printk("lne390-debug: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + LNE390_ID_PORT));
ian@0 179 printk("lne390-debug: config regs: %#x %#x\n",
ian@0 180 inb(ioaddr + LNE390_CFG1), inb(ioaddr + LNE390_CFG2));
ian@0 181 #endif
ian@0 182
ian@0 183
ian@0 184 /* Check the EISA ID of the card. */
ian@0 185 eisa_id = inl(ioaddr + LNE390_ID_PORT);
ian@0 186 if ((eisa_id != LNE390_ID0) && (eisa_id != LNE390_ID1)) {
ian@0 187 return -ENODEV;
ian@0 188 }
ian@0 189
ian@0 190 revision = (eisa_id >> 24) & 0x01; /* 0 = rev A, 1 rev B */
ian@0 191
ian@0 192 #if 0
ian@0 193 /* Check the Mylex vendor ID as well. Not really required. */
ian@0 194 if (inb(ioaddr + LNE390_SA_PROM + 0) != LNE390_ADDR0
ian@0 195 || inb(ioaddr + LNE390_SA_PROM + 1) != LNE390_ADDR1
ian@0 196 || inb(ioaddr + LNE390_SA_PROM + 2) != LNE390_ADDR2 ) {
ian@0 197 printk("lne390.c: card not found");
ian@0 198 for(i = 0; i < ETHER_ADDR_LEN; i++)
ian@0 199 printk(" %02x", inb(ioaddr + LNE390_SA_PROM + i));
ian@0 200 printk(" (invalid prefix).\n");
ian@0 201 return -ENODEV;
ian@0 202 }
ian@0 203 #endif
ian@0 204
ian@0 205 printk("lne390.c: LNE390%X in EISA slot %d, address", 0xa+revision, ioaddr/0x1000);
ian@0 206 for(i = 0; i < ETHER_ADDR_LEN; i++)
ian@0 207 printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i)));
ian@0 208 printk(".\nlne390.c: ");
ian@0 209
ian@0 210 /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */
ian@0 211 if (dev->irq == 0) {
ian@0 212 unsigned char irq_reg = inb(ioaddr + LNE390_CFG2) >> 3;
ian@0 213 dev->irq = irq_map[irq_reg & 0x07];
ian@0 214 printk("using");
ian@0 215 } else {
ian@0 216 /* This is useless unless we reprogram the card here too */
ian@0 217 if (dev->irq == 2) dev->irq = 9; /* Doh! */
ian@0 218 printk("assigning");
ian@0 219 }
ian@0 220 printk(" IRQ %d,", dev->irq);
ian@0 221
ian@0 222 if ((ret = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev))) {
ian@0 223 printk (" unable to get IRQ %d.\n", dev->irq);
ian@0 224 return ret;
ian@0 225 }
ian@0 226
ian@0 227 if (dev->mem_start == 0) {
ian@0 228 unsigned char mem_reg = inb(ioaddr + LNE390_CFG2) & 0x07;
ian@0 229
ian@0 230 if (revision) /* LNE390B */
ian@0 231 dev->mem_start = shmem_mapB[mem_reg] * 0x10000;
ian@0 232 else /* LNE390A */
ian@0 233 dev->mem_start = shmem_mapA[mem_reg] * 0x10000;
ian@0 234 printk(" using ");
ian@0 235 } else {
ian@0 236 /* Should check for value in shmem_map and reprogram the card to use it */
ian@0 237 dev->mem_start &= 0xfff0000;
ian@0 238 printk(" assigning ");
ian@0 239 }
ian@0 240
ian@0 241 printk("%dkB memory at physical address %#lx\n",
ian@0 242 LNE390_STOP_PG/4, dev->mem_start);
ian@0 243
ian@0 244 /*
ian@0 245 BEWARE!! Some dain-bramaged EISA SCUs will allow you to put
ian@0 246 the card mem within the region covered by `normal' RAM !!!
ian@0 247
ian@0 248 ioremap() will fail in that case.
ian@0 249 */
ian@0 250 ei_status.mem = ioremap(dev->mem_start, LNE390_STOP_PG*0x100);
ian@0 251 if (!ei_status.mem) {
ian@0 252 printk(KERN_ERR "lne390.c: Unable to remap card memory above 1MB !!\n");
ian@0 253 printk(KERN_ERR "lne390.c: Try using EISA SCU to set memory below 1MB.\n");
ian@0 254 printk(KERN_ERR "lne390.c: Driver NOT installed.\n");
ian@0 255 ret = -EAGAIN;
ian@0 256 goto cleanup;
ian@0 257 }
ian@0 258 printk("lne390.c: remapped %dkB card memory to virtual address %p\n",
ian@0 259 LNE390_STOP_PG/4, ei_status.mem);
ian@0 260
ian@0 261 dev->mem_start = (unsigned long)ei_status.mem;
ian@0 262 dev->mem_end = dev->mem_start + (LNE390_STOP_PG - LNE390_START_PG)*256;
ian@0 263
ian@0 264 /* The 8390 offset is zero for the LNE390 */
ian@0 265 dev->base_addr = ioaddr;
ian@0 266
ian@0 267 ei_status.name = "LNE390";
ian@0 268 ei_status.tx_start_page = LNE390_START_PG;
ian@0 269 ei_status.rx_start_page = LNE390_START_PG + TX_PAGES;
ian@0 270 ei_status.stop_page = LNE390_STOP_PG;
ian@0 271 ei_status.word16 = 1;
ian@0 272
ian@0 273 if (ei_debug > 0)
ian@0 274 printk(version);
ian@0 275
ian@0 276 ei_status.reset_8390 = &lne390_reset_8390;
ian@0 277 ei_status.block_input = &lne390_block_input;
ian@0 278 ei_status.block_output = &lne390_block_output;
ian@0 279 ei_status.get_8390_hdr = &lne390_get_8390_hdr;
ian@0 280
ian@0 281 dev->open = &lne390_open;
ian@0 282 dev->stop = &lne390_close;
ian@0 283 #ifdef CONFIG_NET_POLL_CONTROLLER
ian@0 284 dev->poll_controller = ei_poll;
ian@0 285 #endif
ian@0 286 NS8390_init(dev, 0);
ian@0 287
ian@0 288 ret = register_netdev(dev);
ian@0 289 if (ret)
ian@0 290 goto unmap;
ian@0 291 return 0;
ian@0 292 unmap:
ian@0 293 if (ei_status.reg0)
ian@0 294 iounmap(ei_status.mem);
ian@0 295 cleanup:
ian@0 296 free_irq(dev->irq, dev);
ian@0 297 return ret;
ian@0 298 }
ian@0 299
ian@0 300 /*
ian@0 301 * Reset as per the packet driver method. Judging by the EISA cfg
ian@0 302 * file, this just toggles the "Board Enable" bits (bit 2 and 0).
ian@0 303 */
ian@0 304
ian@0 305 static void lne390_reset_8390(struct net_device *dev)
ian@0 306 {
ian@0 307 unsigned short ioaddr = dev->base_addr;
ian@0 308
ian@0 309 outb(0x04, ioaddr + LNE390_RESET_PORT);
ian@0 310 if (ei_debug > 1) printk("%s: resetting the LNE390...", dev->name);
ian@0 311
ian@0 312 mdelay(2);
ian@0 313
ian@0 314 ei_status.txing = 0;
ian@0 315 outb(0x01, ioaddr + LNE390_RESET_PORT);
ian@0 316 if (ei_debug > 1) printk("reset done\n");
ian@0 317
ian@0 318 return;
ian@0 319 }
ian@0 320
ian@0 321 /*
ian@0 322 * Note: In the following three functions is the implicit assumption
ian@0 323 * that the associated memcpy will only use "rep; movsl" as long as
ian@0 324 * we keep the counts as some multiple of doublewords. This is a
ian@0 325 * requirement of the hardware, and also prevents us from using
ian@0 326 * eth_io_copy_and_sum() since we can't guarantee it will limit
ian@0 327 * itself to doubleword access.
ian@0 328 */
ian@0 329
ian@0 330 /*
ian@0 331 * Grab the 8390 specific header. Similar to the block_input routine, but
ian@0 332 * we don't need to be concerned with ring wrap as the header will be at
ian@0 333 * the start of a page, so we optimize accordingly. (A single doubleword.)
ian@0 334 */
ian@0 335
ian@0 336 static void
ian@0 337 lne390_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
ian@0 338 {
ian@0 339 void __iomem *hdr_start = ei_status.mem + ((ring_page - LNE390_START_PG)<<8);
ian@0 340 memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
ian@0 341 hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */
ian@0 342 }
ian@0 343
ian@0 344 /*
ian@0 345 * Block input and output are easy on shared memory ethercards, the only
ian@0 346 * complication is when the ring buffer wraps. The count will already
ian@0 347 * be rounded up to a doubleword value via lne390_get_8390_hdr() above.
ian@0 348 */
ian@0 349
ian@0 350 static void lne390_block_input(struct net_device *dev, int count, struct sk_buff *skb,
ian@0 351 int ring_offset)
ian@0 352 {
ian@0 353 void __iomem *xfer_start = ei_status.mem + ring_offset - (LNE390_START_PG<<8);
ian@0 354
ian@0 355 if (ring_offset + count > (LNE390_STOP_PG<<8)) {
ian@0 356 /* Packet wraps over end of ring buffer. */
ian@0 357 int semi_count = (LNE390_STOP_PG<<8) - ring_offset;
ian@0 358 memcpy_fromio(skb->data, xfer_start, semi_count);
ian@0 359 count -= semi_count;
ian@0 360 memcpy_fromio(skb->data + semi_count,
ian@0 361 ei_status.mem + (TX_PAGES<<8), count);
ian@0 362 } else {
ian@0 363 /* Packet is in one chunk. */
ian@0 364 memcpy_fromio(skb->data, xfer_start, count);
ian@0 365 }
ian@0 366 }
ian@0 367
ian@0 368 static void lne390_block_output(struct net_device *dev, int count,
ian@0 369 const unsigned char *buf, int start_page)
ian@0 370 {
ian@0 371 void __iomem *shmem = ei_status.mem + ((start_page - LNE390_START_PG)<<8);
ian@0 372
ian@0 373 count = (count + 3) & ~3; /* Round up to doubleword */
ian@0 374 memcpy_toio(shmem, buf, count);
ian@0 375 }
ian@0 376
ian@0 377 static int lne390_open(struct net_device *dev)
ian@0 378 {
ian@0 379 ei_open(dev);
ian@0 380 return 0;
ian@0 381 }
ian@0 382
ian@0 383 static int lne390_close(struct net_device *dev)
ian@0 384 {
ian@0 385
ian@0 386 if (ei_debug > 1)
ian@0 387 printk("%s: Shutting down ethercard.\n", dev->name);
ian@0 388
ian@0 389 ei_close(dev);
ian@0 390 return 0;
ian@0 391 }
ian@0 392
ian@0 393 #ifdef MODULE
ian@0 394 #define MAX_LNE_CARDS 4 /* Max number of LNE390 cards per module */
ian@0 395 static struct net_device *dev_lne[MAX_LNE_CARDS];
ian@0 396 static int io[MAX_LNE_CARDS];
ian@0 397 static int irq[MAX_LNE_CARDS];
ian@0 398 static int mem[MAX_LNE_CARDS];
ian@0 399
ian@0 400 module_param_array(io, int, NULL, 0);
ian@0 401 module_param_array(irq, int, NULL, 0);
ian@0 402 module_param_array(mem, int, NULL, 0);
ian@0 403 MODULE_PARM_DESC(io, "I/O base address(es)");
ian@0 404 MODULE_PARM_DESC(irq, "IRQ number(s)");
ian@0 405 MODULE_PARM_DESC(mem, "memory base address(es)");
ian@0 406 MODULE_DESCRIPTION("Mylex LNE390A/B EISA Ethernet driver");
ian@0 407 MODULE_LICENSE("GPL");
ian@0 408
ian@0 409 int __init init_module(void)
ian@0 410 {
ian@0 411 struct net_device *dev;
ian@0 412 int this_dev, found = 0;
ian@0 413
ian@0 414 for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) {
ian@0 415 if (io[this_dev] == 0 && this_dev != 0)
ian@0 416 break;
ian@0 417 dev = alloc_ei_netdev();
ian@0 418 if (!dev)
ian@0 419 break;
ian@0 420 dev->irq = irq[this_dev];
ian@0 421 dev->base_addr = io[this_dev];
ian@0 422 dev->mem_start = mem[this_dev];
ian@0 423 if (do_lne390_probe(dev) == 0) {
ian@0 424 dev_lne[found++] = dev;
ian@0 425 continue;
ian@0 426 }
ian@0 427 free_netdev(dev);
ian@0 428 printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]);
ian@0 429 break;
ian@0 430 }
ian@0 431 if (found)
ian@0 432 return 0;
ian@0 433 return -ENXIO;
ian@0 434 }
ian@0 435
ian@0 436 static void cleanup_card(struct net_device *dev)
ian@0 437 {
ian@0 438 free_irq(dev->irq, dev);
ian@0 439 release_region(dev->base_addr, LNE390_IO_EXTENT);
ian@0 440 iounmap(ei_status.mem);
ian@0 441 }
ian@0 442
ian@0 443 void cleanup_module(void)
ian@0 444 {
ian@0 445 int this_dev;
ian@0 446
ian@0 447 for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) {
ian@0 448 struct net_device *dev = dev_lne[this_dev];
ian@0 449 if (dev) {
ian@0 450 unregister_netdev(dev);
ian@0 451 cleanup_card(dev);
ian@0 452 free_netdev(dev);
ian@0 453 }
ian@0 454 }
ian@0 455 }
ian@0 456 #endif /* MODULE */
ian@0 457