rc.c (47625) | rc.c (47640) |
---|---|
1/* 2 * Copyright (C) 1995 by Pavel Antonov, Moscow, Russia. 3 * Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 199 unchanged lines hidden (view full) --- 208 209/* Quick device probing */ 210static int 211rcprobe(dvp) 212 struct isa_device *dvp; 213{ 214 int irq = ffs(dvp->id_irq) - 1; 215 register int nec = dvp->id_iobase; | 1/* 2 * Copyright (C) 1995 by Pavel Antonov, Moscow, Russia. 3 * Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 199 unchanged lines hidden (view full) --- 208 209/* Quick device probing */ 210static int 211rcprobe(dvp) 212 struct isa_device *dvp; 213{ 214 int irq = ffs(dvp->id_irq) - 1; 215 register int nec = dvp->id_iobase; |
216 static int once; |
|
216 | 217 |
218 if (!once++) 219 cdevsw_add(&rc_cdevsw); 220 |
|
217 if (dvp->id_unit > NRC) 218 return 0; 219 if (!RC_VALIDADDR(nec)) { 220 printf("rc%d: illegal base address %x\n", dvp->id_unit, nec); 221 return 0; 222 } 223 if (!RC_VALIDIRQ(irq)) { 224 printf("rc%d: illegal IRQ value %d\n", dvp->id_unit, irq); --- 1280 unchanged lines hidden (view full) --- 1505 1506 for (rcnt = 50; rcnt && rcin(CD180_CCR); rcnt--) 1507 DELAY(30); 1508 if (rcnt == 0) 1509 printf("rc%d/%d: channel command timeout, rc.c line: %d\n", 1510 unit, chan, line); 1511} 1512 | 221 if (dvp->id_unit > NRC) 222 return 0; 223 if (!RC_VALIDADDR(nec)) { 224 printf("rc%d: illegal base address %x\n", dvp->id_unit, nec); 225 return 0; 226 } 227 if (!RC_VALIDIRQ(irq)) { 228 printf("rc%d: illegal IRQ value %d\n", dvp->id_unit, irq); --- 1280 unchanged lines hidden (view full) --- 1509 1510 for (rcnt = 50; rcnt && rcin(CD180_CCR); rcnt--) 1511 DELAY(30); 1512 if (rcnt == 0) 1513 printf("rc%d/%d: channel command timeout, rc.c line: %d\n", 1514 unit, chan, line); 1515} 1516 |
1513static int rc_devsw_installed; 1514 1515static void rc_drvinit(void *unused) 1516{ 1517 dev_t dev; 1518 1519 if( ! rc_devsw_installed ) { 1520 dev = makedev(CDEV_MAJOR, 0); 1521 cdevsw_add(&dev,&rc_cdevsw, NULL); 1522 rc_devsw_installed = 1; 1523 } 1524} 1525 1526SYSINIT(rcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,rc_drvinit,NULL) 1527 1528 | |
1529#endif /* NRC */ | 1517#endif /* NRC */ |