PERFORCE change 45544 for review
Scott Long
scottl at FreeBSD.org
Sun Jan 18 10:02:19 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=45544
Change 45544 by scottl at scottl-netperf on 2004/01/18 10:00:47
IFC @45542
Affected files ...
.. //depot/projects/netperf/sys/amd64/include/md_var.h#5 integrate
.. //depot/projects/netperf/sys/boot/forth/frames.4th#2 integrate
.. //depot/projects/netperf/sys/boot/pc98/libpc98/vidconsole.c#3 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_sa.c#3 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-chipset.c#17 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-pci.h#9 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-raid.c#9 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cam.c#12 integrate
.. //depot/projects/netperf/sys/dev/ciss/ciss.c#9 integrate
.. //depot/projects/netperf/sys/dev/gx/if_gx.c#5 integrate
.. //depot/projects/netperf/sys/dev/ips/ips.c#4 integrate
.. //depot/projects/netperf/sys/dev/mii/ukphy.c#3 integrate
.. //depot/projects/netperf/sys/dev/mly/mly.c#5 integrate
.. //depot/projects/netperf/sys/dev/pci/pci_pci.c#6 integrate
.. //depot/projects/netperf/sys/dev/ppbus/vpo.c#3 integrate
.. //depot/projects/netperf/sys/dev/sio/sio.c#11 integrate
.. //depot/projects/netperf/sys/dev/sound/pci/neomagic-coeff.h#3 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/dsp.c#5 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/mixer.c#4 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/sound.c#5 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/sound.h#4 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/vchan.c#3 integrate
.. //depot/projects/netperf/sys/dev/usb/umass.c#8 integrate
.. //depot/projects/netperf/sys/dev/usb/usb_subr.c#4 integrate
.. //depot/projects/netperf/sys/dev/usb/usbdevs#14 integrate
.. //depot/projects/netperf/sys/dev/usb/usbdevs.h#14 integrate
.. //depot/projects/netperf/sys/dev/usb/usbdevs_data.h#14 integrate
.. //depot/projects/netperf/sys/kern/uipc_cow.c#3 integrate
.. //depot/projects/netperf/sys/kern/uipc_socket.c#8 integrate
.. //depot/projects/netperf/sys/rpc/rpcclnt.c#4 integrate
.. //depot/projects/netperf/sys/vm/uma_int.h#6 integrate
.. //depot/projects/netperf/sys/vm/vm_object.c#14 integrate
Differences ...
==== //depot/projects/netperf/sys/amd64/include/md_var.h#5 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.69 2003/11/17 08:58:14 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.70 2004/01/17 13:13:48 phk Exp $
*/
#ifndef _MACHINE_MD_VAR_H_
@@ -47,7 +47,6 @@
extern u_int cpu_id;
extern u_int cpu_procinfo;
extern char cpu_vendor[];
-extern uint16_t *elan_mmcr;
extern char kstack[];
extern char sigcode[];
extern int szsigcode;
==== //depot/projects/netperf/sys/boot/forth/frames.4th#2 (text+ko) ====
@@ -1,6 +1,6 @@
\ Words implementing frame drawing
\ XXX Filled boxes are left as an exercise for the reader... ;-/
-\ $FreeBSD: src/sys/boot/forth/frames.4th,v 1.1 2003/05/30 09:29:23 scottl Exp $
+\ $FreeBSD: src/sys/boot/forth/frames.4th,v 1.2 2004/01/18 04:13:27 nyan Exp $
marker task-frames.4th
@@ -12,27 +12,49 @@
variable rb_el
variable fill
-\ Single frames
-196 constant sh_el
-179 constant sv_el
-218 constant slt_el
-192 constant slb_el
-191 constant srt_el
-217 constant srb_el
-\ Double frames
-205 constant dh_el
-186 constant dv_el
-201 constant dlt_el
-200 constant dlb_el
-187 constant drt_el
-188 constant drb_el
-\ Fillings
-0 constant fill_none
-32 constant fill_blank
-176 constant fill_dark
-177 constant fill_med
-178 constant fill_bright
-
+s" arch-pc98" environment? [if]
+ \ Single frames
+ 149 constant sh_el
+ 150 constant sv_el
+ 152 constant slt_el
+ 154 constant slb_el
+ 153 constant srt_el
+ 155 constant srb_el
+ \ Double frames
+ 149 constant dh_el
+ 150 constant dv_el
+ 152 constant dlt_el
+ 154 constant dlb_el
+ 153 constant drt_el
+ 155 constant drb_el
+ \ Fillings
+ 0 constant fill_none
+ 32 constant fill_blank
+ 135 constant fill_dark
+ 135 constant fill_med
+ 135 constant fill_bright
+[else]
+ \ Single frames
+ 196 constant sh_el
+ 179 constant sv_el
+ 218 constant slt_el
+ 192 constant slb_el
+ 191 constant srt_el
+ 217 constant srb_el
+ \ Double frames
+ 205 constant dh_el
+ 186 constant dv_el
+ 201 constant dlt_el
+ 200 constant dlb_el
+ 187 constant drt_el
+ 188 constant drb_el
+ \ Fillings
+ 0 constant fill_none
+ 32 constant fill_blank
+ 176 constant fill_dark
+ 177 constant fill_med
+ 178 constant fill_bright
+[then]
: hline ( len x y -- ) \ Draw horizontal single line
at-xy \ move cursor
==== //depot/projects/netperf/sys/boot/pc98/libpc98/vidconsole.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/vidconsole.c,v 1.11 2003/09/08 09:11:20 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/vidconsole.c,v 1.12 2004/01/18 04:10:45 nyan Exp $");
#include <stand.h>
#include <bootstrap.h>
@@ -422,7 +422,7 @@
{
#ifdef PC98
- *crtat = (c == 0x5c ? 0xfc : c);
+ *crtat = (c == 0x5c ? 0xfc : (c & 0xff));
*(crtat + 0x1000) = at2pc98(fgcol, bgcol);
#else
v86.ctl = 0;
==== //depot/projects/netperf/sys/cam/scsi/scsi_sa.c#3 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.97 2003/09/13 02:01:56 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.98 2004/01/18 00:17:14 johan Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -2403,7 +2403,7 @@
* Grotesque as it seems, the few times
* I've actually seen a non-zero resid,
* the tape drive actually lied and had
- * writtent all the data!.
+ * written all the data!.
*/
csio->resid = 0;
}
==== //depot/projects/netperf/sys/dev/ata/ata-chipset.c#17 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.56 2004/01/14 21:26:34 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.57 2004/01/17 23:34:13 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -1585,7 +1585,8 @@
struct ata_pci_controller *ctlr = device_get_softc(dev);
struct ata_chip_id *idx;
static struct ata_chip_id ids[] =
- {{ ATA_SII3112, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" },
+ {{ ATA_SII3114, 0x00, SIIMEMIO, SII4CH, ATA_SA150, "SiI 3114" },
+ { ATA_SII3112, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" },
{ ATA_SII3112_1, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" },
{ ATA_SII3112, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3112" },
{ ATA_SII3112_1, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3112" },
@@ -1640,10 +1641,14 @@
ctlr->chip->text);
}
+ if (ctlr->chip->cfg2 & SII4CH)
+ ctlr->channels = 4;
+
/* enable interrupt as BIOS might not */
pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1);
/* setup chipset defaults as BIOS might not */
+#if 0
pci_write_config(dev, 0xa2, 0x328a, 2);
pci_write_config(dev, 0xa4, 0x328a328a, 4);
pci_write_config(dev, 0xa8, 0x22082208, 4);
@@ -1652,7 +1657,7 @@
pci_write_config(dev, 0xe4, 0x328a328a, 4);
pci_write_config(dev, 0xe8, 0x22082208, 4);
pci_write_config(dev, 0xec, 0x40094009, 4);
-
+#endif
ctlr->allocate = ata_sii_mio_allocate;
if (ctlr->chip->max_dma >= ATA_SA150)
ctlr->setmode = ata_sata_setmode;
@@ -1685,24 +1690,25 @@
ata_sii_mio_allocate(device_t dev, struct ata_channel *ch)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+ int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2);
int i;
for (i = ATA_DATA; i <= ATA_STATUS; i++) {
ch->r_io[i].res = ctlr->r_io2;
- ch->r_io[i].offset = 0x80 + i + (ch->unit << 6);
+ ch->r_io[i].offset = 0x80 + i + (unit01 << 6) + (unit10 << 9);
}
ch->r_io[ATA_ALTSTAT].res = ctlr->r_io2;
- ch->r_io[ATA_ALTSTAT].offset = 0x8a + (ch->unit << 6);
+ ch->r_io[ATA_ALTSTAT].offset = 0x8a + (unit01 << 6) + (unit10 << 9);
ch->r_io[ATA_BMCMD_PORT].res = ctlr->r_io2;
- ch->r_io[ATA_BMCMD_PORT].offset = 0x00 + (ch->unit << 3);
+ ch->r_io[ATA_BMCMD_PORT].offset = 0x00 + (unit01 << 3) + (unit10 << 9);
ch->r_io[ATA_BMSTAT_PORT].res = ctlr->r_io2;
- ch->r_io[ATA_BMSTAT_PORT].offset = 0x02 + (ch->unit << 3);
+ ch->r_io[ATA_BMSTAT_PORT].offset = 0x02 + (unit01 << 3) + (unit10 << 9);
ch->r_io[ATA_BMDTP_PORT].res = ctlr->r_io2;
- ch->r_io[ATA_BMDTP_PORT].offset = 0x04 + (ch->unit << 3);
+ ch->r_io[ATA_BMDTP_PORT].offset = 0x04 + (unit01 << 3) + (unit10 << 9);
ch->r_io[ATA_BMDEVSPEC_0].res = ctlr->r_io2;
- ch->r_io[ATA_BMDEVSPEC_0].offset = 0xa1 + (ch->unit << 6);
+ ch->r_io[ATA_BMDEVSPEC_0].offset = 0xa1 + (unit01 << 6) + (unit10 << 9);
ch->r_io[ATA_BMDEVSPEC_1].res = ctlr->r_io2;
- ch->r_io[ATA_BMDEVSPEC_1].offset = 0x100 + (ch->unit << 7);
+ ch->r_io[ATA_BMDEVSPEC_1].offset = 0x100 + (unit01 << 7) + (unit10 << 9);
ch->r_io[ATA_IDX_ADDR].res = ctlr->r_io2;
if (ctlr->chip->max_dma >= ATA_SA150)
==== //depot/projects/netperf/sys/dev/ata/ata-pci.h#9 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.20 2003/12/18 08:07:05 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.21 2004/01/17 23:34:13 sos Exp $
*/
/* structure holding chipset config info */
@@ -158,9 +158,10 @@
#define ATA_CSB6_1 0x02171166
#define ATA_SILICON_IMAGE_ID 0x1095
-#define ATA_SII0680 0x06801095
+#define ATA_SII3114 0x31141095
#define ATA_SII3112 0x31121095
#define ATA_SII3112_1 0x02401095
+#define ATA_SII0680 0x06801095
#define ATA_CMD646 0x06461095
#define ATA_CMD648 0x06481095
#define ATA_CMD649 0x06491095
@@ -257,6 +258,7 @@
#define SIIINTR 0x01
#define SIISETCLK 0x02
#define SIIBUG 0x04
+#define SII4CH 0x08
#define SIS_SOUTH 1
#define SISSATA 2
==== //depot/projects/netperf/sys/dev/ata/ata-raid.c#9 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.75 2004/01/14 21:26:35 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.77 2004/01/18 15:58:30 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -1308,9 +1308,11 @@
sizeof(struct highpoint_raid_conf),
(caddr_t)config, AR_WRITE)) {
printf("ar%d: Highpoint write conf failed\n", rdp->lun);
+ free(config, M_AR);
return -1;
}
}
+ free(config, M_AR);
}
return 0;
}
@@ -1603,9 +1605,11 @@
(caddr_t)config, AR_WRITE)) {
printf("ar%d: %s write conf failed\n",
rdp->lun, local ? "FreeBSD" : "Promise");
+ free(config, M_AR);
return -1;
}
}
+ free(config, M_AR);
}
return 0;
}
==== //depot/projects/netperf/sys/dev/ata/atapi-cam.c#12 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.31 2004/01/14 21:26:35 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.32 2004/01/18 17:21:15 ru Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -683,8 +683,10 @@
union ccb *ccb = malloc(sizeof(union ccb), M_ATACAM, M_WAITOK | M_ZERO);
if (xpt_create_path(&path, xpt_periph, cam_sim_path(sim),
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)
+ CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+ free(ccb, M_ATACAM);
return;
+ }
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("Rescanning ATAPI bus.\n"));
xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/);
==== //depot/projects/netperf/sys/dev/ciss/ciss.c#9 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.33 2003/12/13 07:54:07 ps Exp $
+ * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.34 2004/01/18 16:55:01 ru Exp $
*/
/*
@@ -2167,6 +2167,7 @@
if (xpt_create_path(&sc->ciss_cam_path, xpt_periph, cam_sim_path(sc->ciss_cam_sim), target, 0)
!= CAM_REQ_CMP) {
ciss_printf(sc, "rescan failed (can't create path)\n");
+ free(ccb, M_TEMP);
return;
}
==== //depot/projects/netperf/sys/dev/gx/if_gx.c#5 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/gx/if_gx.c,v 1.13 2003/10/31 18:32:01 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/gx/if_gx.c,v 1.14 2004/01/18 10:15:48 yar Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -350,13 +350,13 @@
ifp->if_init = gx_init;
ifp->if_mtu = ETHERMTU;
ifp->if_snd.ifq_maxlen = GX_TX_RING_CNT - 1;
- ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
+ ifp->if_capabilities = IFCAP_VLAN_HWTAGGING;
/* see if we can enable hardware checksumming */
- if (gx->gx_vflags & GXF_CSUM) {
- ifp->if_capabilities = IFCAP_HWCSUM;
- ifp->if_capenable = ifp->if_capabilities;
- }
+ if (gx->gx_vflags & GXF_CSUM)
+ ifp->if_capabilities |= IFCAP_HWCSUM;
+
+ ifp->if_capenable = ifp->if_capabilities;
/* figure out transciever type */
if (gx->gx_vflags & GXF_FORCE_TBI ||
==== //depot/projects/netperf/sys/dev/ips/ips.c#4 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ips/ips.c,v 1.6 2003/11/27 08:37:36 mbr Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ips/ips.c,v 1.7 2004/01/18 17:34:11 ru Exp $");
#include <dev/ips/ips.h>
#include <sys/stat.h>
@@ -169,6 +169,7 @@
mask = splbio();
if(sc->state & IPS_OFFLINE){
splx(mask);
+ free(waiter, M_DEVBUF);
return EIO;
}
command = SLIST_FIRST(&sc->free_cmd_list);
==== //depot/projects/netperf/sys/dev/mii/ukphy.c#3 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/ukphy.c,v 1.14 2003/08/24 17:54:10 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/ukphy.c,v 1.15 2004/01/17 10:44:39 phk Exp $");
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/ukphy.c,v 1.14 2003/08/24 17:54:10 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/ukphy.c,v 1.15 2004/01/17 10:44:39 phk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -167,6 +167,7 @@
printf("\n");
MIIBUS_MEDIAINIT(sc->mii_dev);
+ mii_phy_setmedia(sc);
return(0);
}
==== //depot/projects/netperf/sys/dev/mly/mly.c#5 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/mly/mly.c,v 1.31 2003/09/02 17:30:36 jhb Exp $
+ * $FreeBSD: src/sys/dev/mly/mly.c,v 1.32 2004/01/18 12:49:36 ru Exp $
*/
#include <sys/param.h>
@@ -2031,6 +2031,7 @@
if (xpt_create_path(&sc->mly_cam_path, xpt_periph,
cam_sim_path(sc->mly_cam_sim[bus]), target, 0) != CAM_REQ_CMP) {
mly_printf(sc, "rescan failed (can't create path)\n");
+ free(ccb, M_TEMP);
return;
}
xpt_setup_ccb(&ccb->ccb_h, sc->mly_cam_path, 5/*priority (low)*/);
==== //depot/projects/netperf/sys/dev/pci/pci_pci.c#6 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.29 2004/01/11 06:52:31 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.30 2004/01/17 21:54:04 imp Exp $");
/*
* PCI:PCI bridge support.
@@ -321,11 +321,12 @@
}
} else {
ok = 1;
+#if 0
if (start < sc->iobase && end > sc->iolimit) {
start = sc->iobase;
end = sc->iolimit;
}
-
+#endif
}
if (end < start) {
device_printf(dev, "ioport: end (%lx) < start (%lx)\n", end, start);
@@ -376,6 +377,7 @@
}
} else if (!ok) {
ok = 1; /* subtractive bridge: always ok */
+#if 0
if (pcib_is_nonprefetch_open(sc)) {
if (start < sc->membase && end > sc->memlimit) {
start = sc->membase;
@@ -388,6 +390,7 @@
end = sc->pmemlimit;
}
}
+#endif
}
if (end < start) {
device_printf(dev, "memory: end (%lx) < start (%lx)\n", end, start);
==== //depot/projects/netperf/sys/dev/ppbus/vpo.c#3 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ppbus/vpo.c,v 1.29 2003/08/24 17:54:16 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ppbus/vpo.c,v 1.31 2004/01/18 13:09:38 ru Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -191,6 +191,7 @@
if (xpt_create_path(&path, xpt_periph, cam_sim_path(vpo->sim), 0, 0)
!= CAM_REQ_CMP) {
/* A failure is benign as the user can do a manual rescan */
+ free(ccb, M_TEMP);
return;
}
==== //depot/projects/netperf/sys/dev/sio/sio.c#11 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/sio/sio.c,v 1.417 2003/12/24 04:11:10 bde Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/sio/sio.c,v 1.418 2004/01/18 12:26:33 ru Exp $");
#include "opt_comconsole.h"
#include "opt_compat.h"
@@ -508,8 +508,10 @@
return (ENXIO);
com = malloc(sizeof(*com), M_DEVBUF, M_NOWAIT | M_ZERO);
- if (com == NULL)
+ if (com == NULL) {
+ bus_release_resource(dev, SYS_RES_IOPORT, rid, port);
return (ENOMEM);
+ }
device_set_softc(dev, com);
com->bst = rman_get_bustag(port);
com->bsh = rman_get_bushandle(port);
==== //depot/projects/netperf/sys/dev/sound/pci/neomagic-coeff.h#3 (text+ko) ====
@@ -25,12 +25,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/sound/pci/neomagic-coeff.h,v 1.2 2003/09/07 16:28:03 cg Exp $
+ * $FreeBSD: src/sys/dev/sound/pci/neomagic-coeff.h,v 1.3 2004/01/17 10:37:10 phk Exp $
*/
#define NM_TOTAL_COEFF_COUNT 0x3158
-static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
+static u_char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21,
0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01,
0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD,
==== //depot/projects/netperf/sys/dev/sound/pcm/dsp.c#5 (text+ko) ====
@@ -29,7 +29,7 @@
#include <dev/sound/pcm/sound.h>
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.67 2003/11/11 05:38:28 scottl Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.68 2004/01/17 10:37:11 phk Exp $");
#define OLDPCM_IOCTL
@@ -455,15 +455,11 @@
* on dsp devices.
*/
- if (IOCGROUP(cmd) == 'M') {
- dev_t pdev;
-
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(PCMUNIT(i_dev), SND_DEV_CTL, 0));
- return mixer_ioctl(pdev, cmd, arg, mode, td);
- }
+ d = dsp_get_info(i_dev);
+ if (IOCGROUP(cmd) == 'M')
+ return mixer_ioctl(d->mixer_dev, cmd, arg, mode, td);
s = spltty();
- d = dsp_get_info(i_dev);
getchns(i_dev, &rdch, &wrch, 0);
kill = 0;
@@ -580,7 +576,7 @@
(wrch? chn_getformats(wrch) : 0xffffffff);
if (rdch && wrch)
p->formats |= (dsp_get_flags(i_dev) & SD_F_SIMPLEX)? 0 : AFMT_FULLDUPLEX;
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(PCMUNIT(i_dev), SND_DEV_CTL, 0));
+ pdev = d->mixer_dev;
p->mixers = 1; /* default: one mixer */
p->inputs = pdev->si_drv1? mix_getdevs(pdev->si_drv1) : 0;
p->left = p->right = 100;
@@ -1051,12 +1047,26 @@
int
dsp_register(int unit, int channel)
{
- make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_DSP, channel),
+ dev_t dt;
+ int r;
+
+ dt = make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_DSP, channel),
UID_ROOT, GID_WHEEL, 0666, "dsp%d.%d", unit, channel);
- make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_DSP16, channel),
+ r = pcm_regdevt(dt, unit, SND_DEV_DSP, channel);
+ if (r)
+ return r;
+
+ dt = make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_DSP16, channel),
UID_ROOT, GID_WHEEL, 0666, "dspW%d.%d", unit, channel);
- make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_AUDIO, channel),
+ r = pcm_regdevt(dt, unit, SND_DEV_DSP16, channel);
+ if (r)
+ return r;
+
+ dt = make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_AUDIO, channel),
UID_ROOT, GID_WHEEL, 0666, "audio%d.%d", unit, channel);
+ r = pcm_regdevt(dt, unit, SND_DEV_AUDIO, channel);
+ if (r)
+ return r;
return 0;
}
@@ -1064,23 +1074,46 @@
int
dsp_registerrec(int unit, int channel)
{
- make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_DSPREC, channel),
+ dev_t dt;
+ int r;
+
+ dt = make_dev(&dsp_cdevsw, PCMMKMINOR(unit, SND_DEV_DSPREC, channel),
UID_ROOT, GID_WHEEL, 0666, "dspr%d.%d", unit, channel);
- return 0;
+ r = pcm_regdevt(dt, unit, SND_DEV_DSPREC, channel);
+
+ return r;
}
int
dsp_unregister(int unit, int channel)
{
dev_t pdev;
+ int r;
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_DSP, channel));
+ pdev = pcm_getdevt(unit, SND_DEV_DSP, channel);
+ if (pdev == NULL)
+ return ENOENT;
destroy_dev(pdev);
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_DSP16, channel));
+ r = pcm_unregdevt(unit, SND_DEV_DSP, channel);
+ if (r)
+ return r;
+
+ pdev = pcm_getdevt(unit, SND_DEV_DSP16, channel);
+ if (pdev == NULL)
+ return ENOENT;
destroy_dev(pdev);
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_AUDIO, channel));
+ r = pcm_unregdevt(unit, SND_DEV_DSP16, channel);
+ if (r)
+ return r;
+
+ pdev = pcm_getdevt(unit, SND_DEV_AUDIO, channel);
+ if (pdev == NULL)
+ return ENOENT;
destroy_dev(pdev);
+ r = pcm_unregdevt(unit, SND_DEV_AUDIO, channel);
+ if (r)
+ return r;
return 0;
}
@@ -1089,11 +1122,15 @@
dsp_unregisterrec(int unit, int channel)
{
dev_t pdev;
+ int r;
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_DSPREC, channel));
+ pdev = pcm_getdevt(unit, SND_DEV_DSPREC, channel);
+ if (pdev == NULL)
+ return ENOENT;
destroy_dev(pdev);
+ r = pcm_unregdevt(unit, SND_DEV_DSPREC, channel);
- return 0;
+ return r;
}
#ifdef USING_DEVFS
@@ -1126,7 +1163,7 @@
cont = 1;
for (i = 0; cont; i++) {
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(unit, devtype, i));
+ pdev = pcm_getdevt(unit, devtype, i);
if (pdev->si_flags & SI_NAMED) {
if ((pdev->si_drv1 == NULL) && (pdev->si_drv2 == NULL)) {
*dev = pdev;
==== //depot/projects/netperf/sys/dev/sound/pcm/mixer.c#4 (text+ko) ====
@@ -28,7 +28,7 @@
#include "mixer_if.h"
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.33 2003/11/11 05:38:28 scottl Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.34 2004/01/17 10:37:11 phk Exp $");
MALLOC_DEFINE(M_MIXER, "mixer", "mixer");
@@ -87,13 +87,11 @@
static dev_t
mixer_get_devt(device_t dev)
{
- dev_t pdev;
- int unit;
+ struct snddev_info *snddev;
- unit = device_get_unit(dev);
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(unit, SND_DEV_CTL, 0));
+ snddev = device_get_softc(dev);
- return pdev;
+ return snddev->mixer_dev;
}
#ifdef SND_DYNSYSCTL
@@ -187,6 +185,7 @@
int
mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
{
+ struct snddev_info *snddev;
struct snd_mixer *m;
u_int16_t v;
dev_t pdev;
@@ -213,6 +212,8 @@
pdev = make_dev(&mixer_cdevsw, PCMMKMINOR(unit, SND_DEV_CTL, 0),
UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit);
pdev->si_drv1 = m;
+ snddev = device_get_softc(dev);
+ snddev->mixer_dev = pdev;
return 0;
@@ -478,14 +479,14 @@
static void
mixer_clone(void *arg, char *name, int namelen, dev_t *dev)
{
- dev_t pdev;
+ struct snddev_info *sd;
if (*dev != NODEV)
return;
if (strcmp(name, "mixer") == 0) {
- pdev = makedev(SND_CDEV_MAJOR, PCMMKMINOR(snd_unit, SND_DEV_CTL, 0));
- if (pdev->si_flags & SI_NAMED)
- *dev = pdev;
+ sd = devclass_get_softc(pcm_devclass, snd_unit);
+ if (sd != NULL)
+ *dev = sd->mixer_dev;
}
}
==== //depot/projects/netperf/sys/dev/sound/pcm/sound.c#5 (text+ko) ====
@@ -31,30 +31,8 @@
#include "feeder_if.h"
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.86 2003/12/08 01:08:03 truckman Exp $");
-
-#ifndef PCM_DEBUG_MTX
-struct snddev_channel {
- SLIST_ENTRY(snddev_channel) link;
- struct pcm_channel *channel;
-};
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.87 2004/01/17 10:37:11 phk Exp $");
-struct snddev_info {
- SLIST_HEAD(, snddev_channel) channels;
- struct pcm_channel *fakechan;
- unsigned devcount, playcount, reccount, vchancount;
- unsigned flags;
- int inprog;
- unsigned int bufsz;
- void *devinfo;
- device_t dev;
- char status[SND_STATUSLEN];
- struct sysctl_ctx_list sysctl_tree;
- struct sysctl_oid *sysctl_tree_top;
- struct mtx *lock;
-};
-#endif
-
devclass_t pcm_devclass;
int pcm_veto_load = 1;
@@ -475,6 +453,7 @@
{
struct snddev_channel *sce;
int unit = device_get_unit(d->dev);
+#if 0
int ourlock;
ourlock = 0;
@@ -482,13 +461,16 @@
snd_mtxlock(d->lock);
ourlock = 1;
}
+#endif
SLIST_FOREACH(sce, &d->channels, link) {
if (sce->channel == ch)
goto gotit;
}
+#if 0
if (ourlock)
snd_mtxunlock(d->lock);
+#endif
return EINVAL;
gotit:
SLIST_REMOVE(&d->channels, sce, snddev_channel, link);
@@ -505,8 +487,10 @@
else
d->playcount--;
+#if 0
if (ourlock)
snd_mtxunlock(d->lock);
+#endif
free(sce, M_DEVBUF);
return 0;
@@ -554,9 +538,7 @@
struct pcm_channel *ch;
int error = 0;
- snd_mtxlock(d->lock);
sce = SLIST_FIRST(&d->channels);
- snd_mtxunlock(d->lock);
ch = sce->channel;
error = pcm_chn_remove(d, sce->channel, SLIST_EMPTY(&ch->children));
@@ -652,6 +634,9 @@
d->vchancount = 0;
d->inprog = 0;
+ SLIST_INIT(&d->channels);
+ SLIST_INIT(&d->channels);
+
if (((numplay == 0) || (numrec == 0)) && (numplay != numrec))
d->flags |= SD_F_SIMPLEX;
@@ -725,10 +710,87 @@
fkchan_kill(d->fakechan);
sndstat_unregister(dev);
+ snd_mtxunlock(d->lock);
snd_mtxfree(d->lock);
return 0;
}
+int
+pcm_regdevt(dev_t dev, unsigned unit, unsigned type, unsigned channel)
+{
+ struct snddev_info *d;
+ struct snddev_devt *dt;
+
+ d = devclass_get_softc(pcm_devclass, unit);
+ KASSERT((d != NULL), ("bad d"));
+ KASSERT((dev != NULL), ("bad dev"));
+
+ dt = malloc(sizeof(*dt), M_DEVBUF, M_ZERO | M_WAITOK);
+ if (dt == NULL)
+ return ENOMEM;
+ dt->dev = dev;
+ dt->type = type;
+ dt->channel = channel;
+
+ snd_mtxlock(d->lock);
+ SLIST_INSERT_HEAD(&d->devs, dt, link);
+ snd_mtxunlock(d->lock);
+
+ return 0;
+}
+
+dev_t
+pcm_getdevt(unsigned unit, unsigned type, unsigned channel)
+{
+ struct snddev_info *d;
+ struct snddev_devt *dt;
+
+ d = devclass_get_softc(pcm_devclass, unit);
+ KASSERT((d != NULL), ("bad d"));
+
+#if 0
+ snd_mtxlock(d->lock);
+#endif
+ SLIST_FOREACH(dt, &d->devs, link) {
+ if ((dt->type == type) && (dt->channel == channel))
+ return dt->dev;
+ }
+#if 0
+ snd_mtxunlock(d->lock);
+#endif
+
+ return NULL;
+}
+
+int
+pcm_unregdevt(unsigned unit, unsigned type, unsigned channel)
+{
+ struct snddev_info *d;
+ struct snddev_devt *dt;
+
+ d = devclass_get_softc(pcm_devclass, unit);
+ KASSERT((d != NULL), ("bad d"));
+
+#if 0
+ snd_mtxlock(d->lock);
+#endif
+ SLIST_FOREACH(dt, &d->devs, link) {
+ if ((dt->type == type) && (dt->channel == channel)) {
+ SLIST_REMOVE(&d->devs, dt, snddev_devt, link);
+ free(dt, M_DEVBUF);
+#if 0
+ snd_mtxunlock(d->lock);
+#endif
+ return 0;
+ }
+ }
+#if 0
+ snd_mtxunlock(d->lock);
+#endif
+
+ return ENOENT;
+}
+
/************************************************************************/
static int
@@ -778,7 +840,7 @@
c = sce->channel;
sbuf_printf(s, "\n\t");
- /* it would be bettet to indent child channels */
+ /* it would be better to indent child channels */
sbuf_printf(s, "%s[%s]: ", c->parentchannel? c->parentchannel->name : "", c->name);
sbuf_printf(s, "spd %d", c->speed);
if (c->speed != sndbuf_getspd(c->bufhard))
==== //depot/projects/netperf/sys/dev/sound/pcm/sound.h#4 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.52 2003/09/07 16:28:03 cg Exp $
+ * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.53 2004/01/17 10:37:11 phk Exp $
*/
/*
@@ -234,6 +234,10 @@
void pcm_setflags(device_t dev, u_int32_t val);
void *pcm_getdevinfo(device_t dev);
+int pcm_regdevt(dev_t dev, unsigned unit, unsigned type, unsigned channel);
+dev_t pcm_getdevt(unsigned unit, unsigned type, unsigned channel);
+int pcm_unregdevt(unsigned unit, unsigned type, unsigned channel);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list