This commit was manufactured by cvs2svn to create branch 'RELENG_6'.

This commit is contained in:
cvs2svn 2005-12-02 00:17:35 +00:00
parent 4603995659
commit 5b47c5585e
9 changed files with 709 additions and 0 deletions

116
share/man/man4/snd_mss.4 Normal file
View File

@ -0,0 +1,116 @@
.\" Copyright (c) 2005 Joel Dahl
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (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$
.\"
.Dd December 1, 2005
.Dt SND_MSS 4
.Os
.Sh NAME
.Nm snd_mss
.Nd "Microsoft Sound System ISA PnP/non-PnP bridge device driver"
.Sh SYNOPSIS
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device sound"
.Cd "device snd_mss"
.Ed
.Pp
Alternatively, to load the driver as a module at boot time, place the
following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
snd_mss_load="YES"
.Ed
.Pp
Non-PnP cards require the following lines in
.Xr device.hints 5 :
.Bd -literal -offset indent
hint.pcm.0.at="isa"
hint.pcm.0.irq="10"
hint.pcm.0.drq="1"
hint.pcm.0.flags="0x0"
.Ed
.Sh DESCRIPTION
The
.Nm
bridge driver allows the generic audio driver,
.Xr sound 4 ,
to attach to the supported audio devices.
.Sh HARDWARE
The
.Nm
driver supports the following audio devices:
.Pp
.Bl -bullet -compact
.It
AD1845
.It
AD1848
.It
Aztech 2320
.It
CMedia CMI8330
.It
Crystal Semiconductor CS4231
.It
Crystal Semiconductor CS4232
.It
Crystal Semiconductor CS4234
.It
Crystal Semiconductor CS4235
.It
Crystal Semiconductor CS4236
.It
Crystal Semiconductor CS4237
.It
ENSONIQ SoundscapeVIVO ENS4081
.It
NeoMagic 256AV (non-AC97)
.It
OPTi 924
.It
OPTi 925
.It
OPTi 930
.It
OPTi 931
.It
OPTi 933
.It
Yamaha OPL-SA2
.It
Yamaha OPL-SA3
.El
.Sh SEE ALSO
.Xr sound 4
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 2.2.6 .
.Sh AUTHORS
This manual page was written by
.An Joel Dahl Aq joel@FreeBSD.org .

View File

@ -0,0 +1,182 @@
.\" Copyright (c) 2005 Maksim Yevmenkin <m_evmenkin@yahoo.com>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (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$
.\"
.Dd Dec 1, 2005
.Dt BLUETOOTH.DEVICE.CONF 5
.Os
.Sh NAME
.Nm bluetooth.device.conf
.Nd Bluetooth device configuration file
.Sh DESCRIPTION
Bluetooth device configuration framework provides ability to adjust certain
Bluetooth device parameters on per-device basis.
.Pp
Bluetooth device configuration files are plain text files that should conform
to basic
.Xr sh 1
syntax.
Even though Bluetooth device are not exactly shell scripts,
they are parsed and passed through shell
.Cm eval
command.
This makes it possible to use various shell tricks in the Bluetooth device
configuration files.
.Pp
The
.Pa /etc/rc.d/bluetooth
script is used to start and stop Bluetooth devices.
This script is not executed by default when system boots.
It is called by
.Xr devd 8
in response to Bluetooth device arrival and departure events.
It is possible to execute this script by hand if required.
The script accepts Bluetooth device driver name as an extra parameter.
.Pp
The system wide Bluetooth device configuration file is called
.Pa /etc/defaults/bluetooth.device.conf .
Configuration parameters set in the system wide Bluetooth device configuration
file apply to every Bluetooth device connected to the system.
.Pp
Configuration parameters overrides for the specific Bluetooth device
should be placed in the
.Pa /etc/bluetooth/DEVICE_DRIVER_NAME.conf
file.
Where
.Va DEVICE_DRIVER_NAME
is the device driver name of the Bluetooth device.
.Pp
The following list provides a name and short description for each
variable that can be set in a Bluetooth device configuration file.
.Bl -tag -width indent-two
.It Va authentication_enable
.Pq Vt bool
The
.Va authentication_enable
parameter controls if the device requires to authenticate the remote device
at connection setup.
If set to
.Dq Li YES ,
the device will try to authenticate the other device at connection setup.
Bluetooth authentication requests are handled by
.Xr hcsecd 8
daemon.
.It Va class
.Pq Vt str
The
.Va class
parameter is used to indicate the capabilities of the device to
other devices.
For more details see
https://www.bluetooth.org/foundry/assignnumb/document/baseband.
.It Va connectable
.Pq Vt bool
The
.Va connectable
parameter controls whether or not the device should periodically scan for
page attempts from other devices.
If set to
.Dq Li YES ,
the device will periodically scan for page attempts from other devices.
.It Va discoverable
.Pq Vt bool
The
.Va discoverable
parameter controls whether or not the device should periodically scan for
inquiry requests from other devices.
If set to
.Dq Li YES ,
the device will periodically scan for inquiry requests from other devices.
.It Va encryption_mode
.Pq Vt str
The
.Va encryption_mode
parameter controls if the device requires encryption to the remote device
at connection setup.
At connection setup, only the devices with the
.Va authentication_enable
parameter enabled and
.Va encryption_mode
parameter enabled will try to encrypt the connection to the other device.
Possible values are
.Dq Li NONE
encryption disabled,
.Dq Li P2P
encryption for only point-to-point packets,
or
.Dq Li ALL
encryption for both point-to-point and broadcast packets.
.It Va hci_debug_level
.Pq Vt int
HCI node debug level.
Higher values mean more verbose output.
.It Va l2cap_debug_level
.Pq Vt int
L2CAP node debug level.
Higher values mean more verbose output.
.It Va local_name
.Pq Vt str
The
.Va local_name
parameter provides the ability to modify the user friendly name for the device.
.It Va role_switch
.Pq Vt bool
The
.Va role_switch
parameter controls whether the local device should perform role switch.
By default, if role switch is supported, the local device will try to perform
role switch and become Master on incoming connection.
Some devices do not support role switch and thus incoming connections from
such devices will fail.
If
.Va role switch
is disabled then accepting device will remain Slave.
.Sh EXAMPLES
.Bl -tag -width ".Pa /etc/bluetooth/ubt0.conf"
.It Pa /etc/bluetooth/ubt0.conf
file should be used to specify configuration parameters overrides for the
first USB Bluetooth device
.Pq device driver name is ubt0 .
.It Pa /etc/bluetooth/ubt1.conf
file should be used to specify configuration parameters overrides for the
second USB Bluetooth device.
.El
.Sh FILES
.Bl -tag -width ".Pa /etc/defaults/bluetooth.device.conf" -compact
.It Pa /etc/defaults/bluetooth.device.conf
.It Pa /etc/rc.d/bluetooth
.El
.Sh SEE ALSO
.Xr ng_bt3c 4 ,
.Xr ng_h4 4 ,
.Xr ng_hci 4 ,
.Xr ng_l2cap 4 ,
.Xr ng_ubt 4 ,
.Xr devd 8 ,
.Xr hccontrol 8 ,
.Xr hcsecd 8 ,
.Xr l2control 8
.Sh AUTHORS
.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com

View File

@ -0,0 +1,50 @@
# $FreeBSD$
#
# Props to Daniel Stone for starting this script for me. I hate perl.
my $lastline = "";
my $foundopening = 0;
my $foundclosing = 0;
while (<>) {
$curline = $_;
if (!$foundopening) {
if (/Copyright/) {
$foundopening = 1;
# print the previous line we buffered, but with /*-
if ($lastline !~ /\/\*-/) {
$lastline =~ s/\/\*/\/\*-/;
}
print $lastline;
# now, print the current line.
print $curline;
} else {
# print the previous line and continue on
print $lastline;
}
} elsif ($foundopening && !$foundclosing && /\*\//) {
# print the $FreeBSD$ bits after the end of the license block
$foundclosing = 1;
print;
print "\n";
print "#include <sys/cdefs.h>\n";
print "__FBSDID(\"\$FreeBSD\$\");\n";
} elsif ($foundopening) {
# Replace headers with the system's paths. the headers we're
# concerned with are drm*.h, *_drm.h and *_drv.h
#
s/#include "(.*)_drv.h/#include "dev\/drm\/\1_drv.h/;
s/#include "(.*)_drm.h/#include "dev\/drm\/\1_drm.h/;
s/#include "mga_ucode.h/#include "dev\/drm\/mga_ucode.h/;
s/#include "r300_reg.h/#include "dev\/drm\/r300_reg.h/;
s/#include "sis_ds.h/#include "dev\/drm\/sis_ds.h/;
s/#include "drm/#include "dev\/drm\/drm/;
print;
}
$lastline = $curline;
}
# if we never found the copyright header, then we're still a line behind.
if (!$foundopening) {
print $lastline;
}

203
sys/dev/sound/pci/atiixp.h Normal file
View File

@ -0,0 +1,203 @@
/*-
* Copyright (c) 2005 Ariff Abdullah <ariff@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (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$
*/
#ifndef _ATIIXP_H_
#define _ATIIXP_H_
/*
* Constants, pretty much FreeBSD specific.
*/
/* Number of playback / recording channel */
#define ATI_IXP_NPCHAN 1
#define ATI_IXP_NRCHAN 1
#define ATI_IXP_NCHANS (ATI_IXP_NPCHAN + ATI_IXP_NRCHAN)
/*
* Maximum segments/descriptors is 256, but 2 for
* each channel should be more than enough for us.
*/
#define ATI_IXP_DMA_CHSEGS 2
#define ATI_IXP_DMA_CHSEGS_MIN 2
#define ATI_IXP_DMA_CHSEGS_MAX 256
#define ATI_IXP_DEFAULT_BUFSZ (1 << 12) /* 4096 */
#define ATI_VENDOR_ID 0x1002 /* ATI Technologies */
#define ATI_IXP_200_ID 0x4341
#define ATI_IXP_300_ID 0x4361
#define ATI_IXP_400_ID 0x4370
#define ATI_IXP_BASE_RATE 48000
/*
* Register definitions for ATI IXP
*
* References: ALSA snd-atiixp.c , OpenBSD/NetBSD auixp-*.h
*/
#define ATI_IXP_CODECS 3
#define ATI_REG_ISR 0x00 /* interrupt source */
#define ATI_REG_ISR_IN_XRUN (1U<<0)
#define ATI_REG_ISR_IN_STATUS (1U<<1)
#define ATI_REG_ISR_OUT_XRUN (1U<<2)
#define ATI_REG_ISR_OUT_STATUS (1U<<3)
#define ATI_REG_ISR_SPDF_XRUN (1U<<4)
#define ATI_REG_ISR_SPDF_STATUS (1U<<5)
#define ATI_REG_ISR_PHYS_INTR (1U<<8)
#define ATI_REG_ISR_PHYS_MISMATCH (1U<<9)
#define ATI_REG_ISR_CODEC0_NOT_READY (1U<<10)
#define ATI_REG_ISR_CODEC1_NOT_READY (1U<<11)
#define ATI_REG_ISR_CODEC2_NOT_READY (1U<<12)
#define ATI_REG_ISR_NEW_FRAME (1U<<13)
#define ATI_REG_IER 0x04 /* interrupt enable */
#define ATI_REG_IER_IN_XRUN_EN (1U<<0)
#define ATI_REG_IER_IO_STATUS_EN (1U<<1)
#define ATI_REG_IER_OUT_XRUN_EN (1U<<2)
#define ATI_REG_IER_OUT_XRUN_COND (1U<<3)
#define ATI_REG_IER_SPDF_XRUN_EN (1U<<4)
#define ATI_REG_IER_SPDF_STATUS_EN (1U<<5)
#define ATI_REG_IER_PHYS_INTR_EN (1U<<8)
#define ATI_REG_IER_PHYS_MISMATCH_EN (1U<<9)
#define ATI_REG_IER_CODEC0_INTR_EN (1U<<10)
#define ATI_REG_IER_CODEC1_INTR_EN (1U<<11)
#define ATI_REG_IER_CODEC2_INTR_EN (1U<<12)
#define ATI_REG_IER_NEW_FRAME_EN (1U<<13) /* (RO) */
#define ATI_REG_IER_SET_BUS_BUSY (1U<<14) /* (WO) audio is running */
#define ATI_REG_CMD 0x08 /* command */
#define ATI_REG_CMD_POWERDOWN (1U<<0)
#define ATI_REG_CMD_RECEIVE_EN (1U<<1)
#define ATI_REG_CMD_SEND_EN (1U<<2)
#define ATI_REG_CMD_STATUS_MEM (1U<<3)
#define ATI_REG_CMD_SPDF_OUT_EN (1U<<4)
#define ATI_REG_CMD_SPDF_STATUS_MEM (1U<<5)
#define ATI_REG_CMD_SPDF_THRESHOLD (3U<<6)
#define ATI_REG_CMD_SPDF_THRESHOLD_SHIFT 6
#define ATI_REG_CMD_IN_DMA_EN (1U<<8)
#define ATI_REG_CMD_OUT_DMA_EN (1U<<9)
#define ATI_REG_CMD_SPDF_DMA_EN (1U<<10)
#define ATI_REG_CMD_SPDF_OUT_STOPPED (1U<<11)
#define ATI_REG_CMD_SPDF_CONFIG_MASK (7U<<12)
#define ATI_REG_CMD_SPDF_CONFIG_34 (1U<<12)
#define ATI_REG_CMD_SPDF_CONFIG_78 (2U<<12)
#define ATI_REG_CMD_SPDF_CONFIG_69 (3U<<12)
#define ATI_REG_CMD_SPDF_CONFIG_01 (4U<<12)
#define ATI_REG_CMD_INTERLEAVE_SPDF (1U<<16)
#define ATI_REG_CMD_AUDIO_PRESENT (1U<<20)
#define ATI_REG_CMD_INTERLEAVE_IN (1U<<21)
#define ATI_REG_CMD_INTERLEAVE_OUT (1U<<22)
#define ATI_REG_CMD_LOOPBACK_EN (1U<<23)
#define ATI_REG_CMD_PACKED_DIS (1U<<24)
#define ATI_REG_CMD_BURST_EN (1U<<25)
#define ATI_REG_CMD_PANIC_EN (1U<<26)
#define ATI_REG_CMD_MODEM_PRESENT (1U<<27)
#define ATI_REG_CMD_ACLINK_ACTIVE (1U<<28)
#define ATI_REG_CMD_AC_SOFT_RESET (1U<<29)
#define ATI_REG_CMD_AC_SYNC (1U<<30)
#define ATI_REG_CMD_AC_RESET (1U<<31)
#define ATI_REG_PHYS_OUT_ADDR 0x0c
#define ATI_REG_PHYS_OUT_CODEC_MASK (3U<<0)
#define ATI_REG_PHYS_OUT_RW (1U<<2)
#define ATI_REG_PHYS_OUT_ADDR_EN (1U<<8)
#define ATI_REG_PHYS_OUT_ADDR_SHIFT 9
#define ATI_REG_PHYS_OUT_DATA_SHIFT 16
#define ATI_REG_PHYS_IN_ADDR 0x10
#define ATI_REG_PHYS_IN_READ_FLAG (1U<<8)
#define ATI_REG_PHYS_IN_ADDR_SHIFT 9
#define ATI_REG_PHYS_IN_DATA_SHIFT 16
#define ATI_REG_SLOTREQ 0x14
#define ATI_REG_COUNTER 0x18
#define ATI_REG_COUNTER_SLOT (3U<<0) /* slot # */
#define ATI_REG_COUNTER_BITCLOCK (31U<<8)
#define ATI_REG_IN_FIFO_THRESHOLD 0x1c
#define ATI_REG_IN_DMA_LINKPTR 0x20
#define ATI_REG_IN_DMA_DT_START 0x24 /* RO */
#define ATI_REG_IN_DMA_DT_NEXT 0x28 /* RO */
#define ATI_REG_IN_DMA_DT_CUR 0x2c /* RO */
#define ATI_REG_IN_DMA_DT_SIZE 0x30
#define ATI_REG_OUT_DMA_SLOT 0x34
#define ATI_REG_OUT_DMA_SLOT_BIT(x) (1U << ((x) - 3))
#define ATI_REG_OUT_DMA_SLOT_MASK 0x1ff
#define ATI_REG_OUT_DMA_THRESHOLD_MASK 0xf800
#define ATI_REG_OUT_DMA_THRESHOLD_SHIFT 11
#define ATI_REG_OUT_DMA_LINKPTR 0x38
#define ATI_REG_OUT_DMA_DT_START 0x3c /* RO */
#define ATI_REG_OUT_DMA_DT_NEXT 0x40 /* RO */
#define ATI_REG_OUT_DMA_DT_CUR 0x44 /* RO */
#define ATI_REG_OUT_DMA_DT_SIZE 0x48
#define ATI_REG_SPDF_CMD 0x4c
#define ATI_REG_SPDF_CMD_LFSR (1U<<4)
#define ATI_REG_SPDF_CMD_SINGLE_CH (1U<<5)
#define ATI_REG_SPDF_CMD_LFSR_ACC (0xff<<8) /* RO */
#define ATI_REG_SPDF_DMA_LINKPTR 0x50
#define ATI_REG_SPDF_DMA_DT_START 0x54 /* RO */
#define ATI_REG_SPDF_DMA_DT_NEXT 0x58 /* RO */
#define ATI_REG_SPDF_DMA_DT_CUR 0x5c /* RO */
#define ATI_REG_SPDF_DMA_DT_SIZE 0x60
#define ATI_REG_MODEM_MIRROR 0x7c
#define ATI_REG_AUDIO_MIRROR 0x80
#define ATI_REG_6CH_REORDER 0x84 /* reorder slots for 6ch */
#define ATI_REG_6CH_REORDER_EN (1U<<0) /* 3,4,7,8,6,9 -> 3,4,6,9,7,8 */
#define ATI_REG_FIFO_FLUSH 0x88
#define ATI_REG_FIFO_OUT_FLUSH (1U<<0)
#define ATI_REG_FIFO_IN_FLUSH (1U<<1)
/* LINKPTR */
#define ATI_REG_LINKPTR_EN (1U<<0)
/* [INT|OUT|SPDIF]_DMA_DT_SIZE */
#define ATI_REG_DMA_DT_SIZE (0xffffU<<0)
#define ATI_REG_DMA_FIFO_USED (0x1fU<<16)
#define ATI_REG_DMA_FIFO_FREE (0x1fU<<21)
#define ATI_REG_DMA_STATE (7U<<26)
#define ATI_MAX_DESCRIPTORS 256 /* max number of descriptor packets */
/* codec detection constant indicating the interrupt flags */
#define ALL_CODECS_NOT_READY \
(ATI_REG_ISR_CODEC0_NOT_READY | ATI_REG_ISR_CODEC1_NOT_READY |\
ATI_REG_ISR_CODEC2_NOT_READY)
#define CODEC_CHECK_BITS (ALL_CODECS_NOT_READY|ATI_REG_ISR_NEW_FRAME)
#endif

View File

@ -0,0 +1,123 @@
/*-
* Copyright (c) 2005 Takanori Watanabe
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <fs/ntfs/ntfs.h>
#include <geom/geom.h>
#include <geom/label/g_label.h>
#define G_LABEL_NTFS_DIR "ntfs"
static void
g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size)
{
struct g_provider *pp;
struct bootfile *bf;
struct attr *atr;
char *filerecp = NULL, *ap, vnchar;
struct filerec *fr;
char mftrecsz;
int recsize;
int j;
off_t voloff;
g_topology_assert_not();
pp = cp->provider;
label[0] = '\0';
bf = (struct bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL);
if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) {
goto done;
}
mftrecsz = (char)bf->bf_mftrecsz;
recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz);
if(recsize % pp->sectorsize != 0)
goto done;
voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps +
recsize * NTFS_VOLUMEINO;
if(voloff % pp->sectorsize != 0)
goto done;
filerecp = g_read_data(cp, voloff, recsize, NULL);
if (filerecp == NULL)
goto done;
fr = (struct filerec *)filerecp;
if(fr->fr_fixup.fh_magic != NTFS_FILEMAGIC){
label[0] = 0;
goto done;
}
for (ap = filerecp + fr->fr_attroff; atr = (struct attr *)ap, atr->a_hdr.a_type != -1; ap += atr->a_hdr.reclen) {
if (atr->a_hdr.a_type == NTFS_A_VOLUMENAME) {
if(atr->a_r.a_datalen >= size *2){
label[0] = 0;
goto done;
}
/*
*UNICODE to ASCII.
* Should we need to use iconv(9)?
*/
for (j = 0; j < atr->a_r.a_datalen; j++) {
vnchar = *(ap + atr->a_r.a_dataoff + j);
if ((j & 1)) {
if (vnchar) {
label[0] = 0;
goto done;
}
} else {
label[j / 2] = vnchar;
}
}
label[j / 2] = 0;
break;
}
}
done:
if (bf != NULL)
g_free(bf);
if (filerecp != NULL)
g_free(filerecp);
return;
}
const struct g_label_desc g_label_ntfs = {
.ld_taste = g_label_ntfs_taste,
.ld_dir = G_LABEL_NTFS_DIR
};

View File

@ -0,0 +1,8 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../dev/drm
KMOD = i915
SRCS = i915_dma.c i915_drv.c i915_irq.c i915_mem.c
SRCS +=device_if.h bus_if.h pci_if.h opt_drm.h
.include <bsd.kmod.mk>

View File

@ -0,0 +1,9 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../dev/drm
KMOD= savage
CFLAGS += -I${.CURDIR}/../../../dev/drm
SRCS= savage_bci.c savage_drv.c savage_state.c
SRCS+= device_if.h bus_if.h pci_if.h opt_drm.h
.include <bsd.kmod.mk>

View File

@ -0,0 +1,9 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../../dev/sound/pci
KMOD= snd_atiixp
SRCS= device_if.h bus_if.h pci_if.h
SRCS+= atiixp.c
.include <bsd.kmod.mk>

View File

@ -0,0 +1,9 @@
#
# DEFAULTS -- Default kernel configuration file for FreeBSD/powerpc
#
# $FreeBSD$
machine powerpc
# Pseudo devices.
device mem # Memory and kernel memory devices