struct lser_softc * attach_lser_to_lamebus(int lserno, struct lamebus_softc *sc) { struct lser_softc *ls; int slot = lamebus_probe(sc, LB_VENDOR_CS161, LBCS161_SERIAL, LOW_VERSION, HIGH_VERSION); if (slot < 0) { return NULL; } ls = kmalloc(sizeof(struct lser_softc)); if (ls==NULL) { return NULL; } (void)lserno; // unused ls->ls_busdata = sc; ls->ls_buspos = slot; lamebus_mark(sc, slot); lamebus_attach_interrupt(sc, slot, ls, lser_irq); return ls; }
struct lhd_softc * attach_lhd_to_lamebus(int lhdno, struct lamebus_softc *sc) { struct lhd_softc *lh; int slot = lamebus_probe(sc, LB_VENDOR_CS161, LBCS161_DISK, LOW_VERSION, HIGH_VERSION); if (slot < 0) { /* None found */ return NULL; } lh = kmalloc(sizeof(struct lhd_softc)); if (lh==NULL) { /* Out of memory */ return NULL; } /* Record what the lhd is attached to */ lh->lh_busdata = sc; lh->lh_buspos = slot; lh->lh_unit = lhdno; /* Mark the slot in use and collect interrupts */ lamebus_mark(sc, slot); lamebus_attach_interrupt(sc, slot, lh, lhd_irq); return lh; }
struct emu_softc * attach_emu_to_lamebus(int emuno, struct lamebus_softc *sc) { struct emu_softc *es; int slot = lamebus_probe(sc, LB_VENDOR_CS161, LBCS161_EMUFS, LOW_VERSION, HIGH_VERSION); if (slot < 0) { return NULL; } es = kmalloc(sizeof(struct emu_softc)); if (es==NULL) { return NULL; } es->e_busdata = sc; es->e_buspos = slot; es->e_unit = emuno; lamebus_mark(sc, slot); lamebus_attach_interrupt(sc, slot, es, emu_irq); return es; }
struct ltrace_softc * attach_ltrace_to_lamebus(int ltraceno, struct lamebus_softc *sc) { struct ltrace_softc *lt; int slot = lamebus_probe(sc, LB_VENDOR_CS161, LBCS161_TRACE, LOW_VERSION, HIGH_VERSION); if (slot < 0) { return NULL; } lt = kmalloc(sizeof(struct ltrace_softc)); if (lt==NULL) { return NULL; } (void)ltraceno; // unused lt->lt_busdata = sc; lt->lt_buspos = slot; lamebus_mark(sc, slot); return lt; }
struct lrandom_softc * attach_lrandom_to_lamebus(int lrandomno, struct lamebus_softc *sc) { struct lrandom_softc *lr; int slot = lamebus_probe(sc, LB_VENDOR_CS161, LBCS161_RANDOM, LOW_VERSION, HIGH_VERSION); if (slot < 0) { return NULL; } lr = kmalloc(sizeof(struct lrandom_softc)); if (lr==NULL) { return NULL; } (void)lrandomno; // unused lr->lr_bus = sc; lr->lr_buspos = slot; lamebus_mark(sc, slot); return lr; }