sound.c (0f55ac6c1a8552998cde0337a74ad1b464ef5070) sound.c (b3b7ccfe38b22691e7b8d08c7320106a07575953)
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * (C) 1997 Luigi Rizzo (luigi@iet.unipi.it)
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:

--- 118 unchanged lines hidden (view full) ---

127 pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_DSP16, 0));
128 dspW = make_dev_alias(pdev, "dspW");
129 pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_AUDIO, 0));
130 audio = make_dev_alias(pdev, "audio");
131 pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_CTL, 0));
132 mixer = make_dev_alias(pdev, "mixer");
133}
134
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * (C) 1997 Luigi Rizzo (luigi@iet.unipi.it)
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:

--- 118 unchanged lines hidden (view full) ---

127 pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_DSP16, 0));
128 dspW = make_dev_alias(pdev, "dspW");
129 pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_AUDIO, 0));
130 audio = make_dev_alias(pdev, "audio");
131 pdev = makedev(CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_CTL, 0));
132 mixer = make_dev_alias(pdev, "mixer");
133}
134
135SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver");
136
135static int
136sysctl_hw_sndunit(SYSCTL_HANDLER_ARGS)
137{
138 int error, unit;
139
140 unit = snd_unit;
141 error = sysctl_handle_int(oidp, &unit, sizeof(unit), req);
142 if (error == 0 && req->newptr != NULL) {
143 snd_unit = unit;
144 pcm_makelinks(NULL);
145 }
146 return (error);
147}
137static int
138sysctl_hw_sndunit(SYSCTL_HANDLER_ARGS)
139{
140 int error, unit;
141
142 unit = snd_unit;
143 error = sysctl_handle_int(oidp, &unit, sizeof(unit), req);
144 if (error == 0 && req->newptr != NULL) {
145 snd_unit = unit;
146 pcm_makelinks(NULL);
147 }
148 return (error);
149}
148SYSCTL_PROC(_hw, OID_AUTO, sndunit, CTLTYPE_INT | CTLFLAG_RW,
150SYSCTL_PROC(_hw_snd, OID_AUTO, unit, CTLTYPE_INT | CTLFLAG_RW,
149 0, sizeof(int), sysctl_hw_sndunit, "I", "");
150
151int
152pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo)
153{
154 int unit = device_get_unit(dev), idx;
155 snddev_info *d = device_get_softc(dev);
156 pcm_channel *chns, *ch;

--- 499 unchanged lines hidden ---
151 0, sizeof(int), sysctl_hw_sndunit, "I", "");
152
153int
154pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo)
155{
156 int unit = device_get_unit(dev), idx;
157 snddev_info *d = device_get_softc(dev);
158 pcm_channel *chns, *ch;

--- 499 unchanged lines hidden ---