-/* $OpenBSD: midi.c,v 1.35 2015/05/12 18:05:43 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.36 2015/05/12 18:23:38 ratchov Exp $ */
/*
* Copyright (c) 2003, 2004 Alexandre Ratchov
return (sa != NULL && (sa->type == AUDIODEV_TYPE_MIDI) ? 1 : 0);
}
-void
-midi_attach(struct midi_softc *sc, struct device *parent)
-{
- struct midi_info mi;
-
- sc->isdying = 0;
- sc->hw_if->getinfo(sc->hw_hdl, &mi);
- sc->props = mi.props;
- sc->isopen = 0;
- timeout_set(&sc->timeo, midi_timeout, sc);
- printf(": <%s>\n", mi.name);
-}
-
void
midiattach(struct device *parent, struct device *self, void *aux)
{
+ struct midi_info mi;
struct midi_softc *sc = (struct midi_softc *)self;
struct audio_attach_args *sa = (struct audio_attach_args *)aux;
struct midi_hw_if *hwif = sa->hwif;
#endif
sc->hw_if = hwif;
sc->hw_hdl = hdl;
- midi_attach(sc, parent);
+ sc->isdying = 0;
+ sc->hw_if->getinfo(sc->hw_hdl, &mi);
+ sc->props = mi.props;
+ sc->isopen = 0;
+ timeout_set(&sc->timeo, midi_timeout, sc);
+ printf(": <%s>\n", mi.name);
}
int
return (UNCONF);
}
-void
-midi_getinfo(dev_t dev, struct midi_info *mi)
-{
- struct midi_softc *sc = MIDI_DEV2SC(dev);
-
- if (MIDI_UNIT(dev) >= midi_cd.cd_ndevs || sc == NULL || sc->isdying) {
- mi->name = "unconfigured";
- mi->props = 0;
- return;
- }
- sc->hw_if->getinfo(sc->hw_hdl, mi);
-}
-
struct device *
midi_attach_mi(struct midi_hw_if *hwif, void *hdl, struct device *dev)
{
arg.hdl = hdl;
return config_found(dev, &arg, midiprint);
}
-
-
-int
-midi_unit_count(void)
-{
- return midi_cd.cd_ndevs;
-}
-
-/* $OpenBSD: midi_if.h,v 1.7 2008/06/26 05:42:14 ray Exp $ */
+/* $OpenBSD: midi_if.h,v 1.8 2015/05/12 18:23:38 ratchov Exp $ */
/* $NetBSD: midi_if.h,v 1.3 1998/11/25 22:17:07 augustss Exp $ */
/*
int (*ioctl)(void *, u_long, caddr_t, int, struct proc *);
};
-void midi_attach(struct midi_softc *, struct device *);
-struct device *midi_attach_mi(struct midi_hw_if *, void *,
- struct device *);
-
-int midi_unit_count(void);
-void midi_getinfo(dev_t, struct midi_info *);
-int midi_writebytes(int, u_char *, int);
+struct device *midi_attach_mi(struct midi_hw_if *, void *, struct device *);
#endif /* _SYS_DEV_MIDI_IF_H_ */