Commit Graph

1248 Commits

Author SHA1 Message Date
Bruce Evans
04bf9e6707 Use double quotes instead of single quotes for echos to build options
headers as in most other modules Makefiles (5 yesterday, none now).
Fixed any simple nearby style bugs (not many).
2003-12-29 09:15:48 +00:00
Bruce Evans
8e128ecdf2 Fixed some style bugs (mainly the bad examples @echo, NOMAN, and non-use
of ${.TARGET}).  This was the last instances of @echo in module Makefiles
after it was removed in sio/Makefile.  NOMAN is nonsense in module
Makefiles, and was removed, but came back here and in too many other
places.
2003-12-29 09:03:38 +00:00
Bruce Evans
8a1a7f65e2 Fixed some style bugs:
- SRCS was totally disordered.
- the echos to create options headers were hidden using '@'.
- the args of echos to create options headers were single-quoted.
- the target names for the rules to create options headers were repeated.
- the unused option COMPAT_FREEBSD4 was put in opt_compat.h.
2003-12-29 08:45:38 +00:00
Bruce Evans
1c07192538 Fixed some style bugs. SRCS and the opt_*.h rules were totally
disordered.  This commit only fixes the external disorder by
rearranging whole lines.
2003-12-29 08:35:33 +00:00
Yoshihiro Takahashi
a19cac5c3c Fix to support pc98 and currect typo. 2003-12-28 12:27:34 +00:00
Warner Losh
34f40c9b63 New sio module. A number of people have suggested this over the years
(most recently bde), so I'll commit the module I've had knocking
around in my tree for a while.  This may have some rough edges, so if
you are able to build it on non-i386 platform (including pc98) please
let me know you succeeded.  When I get enough reports, I'll connect it
to the build.  If there are problems, feel free to fix them.

Suggested by: bde
2003-12-27 19:50:37 +00:00
Nate Lawson
d571e11b4f Move the acpi module down a directory. This will allow us to import
other ACPI-specific drivers into sys/modules/acpi/.
2003-12-24 03:49:38 +00:00
Bruce M Simpson
37621fd5d9 Push m_apply() and m_getptr() up into the colleciton of standard mbuf
routines, and purge them from opencrypto.

Reviewed by:	sam
Obtained from:	NetBSD
Sponsored by:	spc.org
2003-12-15 21:49:41 +00:00
Bill Paul
c42411d56f Turn off build of if_ndis.ko by default, since it depends on an
autogenerated file (ndis_driver_data.h) which by definition can't
be available unless the user creates it.
2003-12-12 04:45:15 +00:00
Bill Paul
87feaafc5b Grrr. Put the right .PATH statements in the right Makefiles. 2003-12-11 23:22:44 +00:00
Bill Paul
940311dc21 Ack! Only build if_ndis.ko and ndis.ko if arch == i386. 2003-12-11 23:06:54 +00:00
Bill Paul
c854fc1092 Commit the first cut of Project Evil, also known as the NDISulator.
Yes, it's what you think it is. Yes, you should run away now.

This is a special compatibility module for allowing Windows NDIS
miniport network drivers to be used with FreeBSD/x86. This provides
_binary_ NDIS compatibility (not source): you can run NDIS driver
code, but you can't build it. There are three main parts:

sys/compat/ndis: the NDIS compat API, which provides binary
compatibility functions for many routines in NDIS.SYS, HAL.dll
and ntoskrnl.exe in Windows (these are the three modules that
most NDIS miniport drivers use). The compat module also contains
a small PE relocator/dynalinker which relocates the Windows .SYS
image and then patches in our native routines.

sys/dev/if_ndis: the if_ndis driver wrapper. This module makes
use of the ndis compat API and can be compiled with a specially
prepared binary image file (ndis_driver_data.h) containing the
Windows .SYS image and registry key information parsed out of the
accompanying .INF file. Once if_ndis.ko is built, it can be loaded
and unloaded just like a native FreeBSD kenrel module.

usr.sbin/ndiscvt: a special utility that converts foo.sys and foo.inf
into an ndis_driver_data.h file that can be compiled into if_ndis.o.
Contains an .inf file parser graciously provided by Matt Dodd (and
mercilessly hacked upon by me) that strips out device ID info and
registry key info from a .INF file and packages it up with a binary
image array. The ndiscvt(8) utility also does some manipulation of
the segments within the .sys file to make life easier for the kernel
loader. (Doing the manipulation here saves the kernel code from having
to move things around later, which would waste memory.)

ndiscvt is only built for the i386 arch. Only files.i386 has been
updated, and none of this is turned on in GENERIC. It should probably
work on pc98. I have no idea about amd64 or ia64 at this point.

This is still a work in progress. I estimate it's about %85 done, but
I want it under CVS control so I can track subsequent changes. It has
been tested with exactly three drivers: the LinkSys LNE100TX v4 driver
(Lne100v4.sys), the sample Intel 82559 driver from the Windows DDK
(e100bex.sys) and the Broadcom BCM43xx wireless driver (bcmwl5.sys). It
still needs to have a net80211 stuff added to it. To use it, you would
do something like this:

# cd /sys/modules/ndis
# make; make load
# cd /sys/modules/if_ndis
# ndiscvt -i /path/to/foo.inf -s /path/to/foo.sys -o ndis_driver_data.h
# make; make load
# sysctl -a | grep ndis

All registry keys are mapped to sysctl nodes. Sometimes drivers refer
to registry keys that aren't mentioned in foo.inf. If this happens,
the NDIS API module creates sysctl nodes for these keys on the fly so
you can tweak them.

An example usage of the Broadcom wireless driver would be:

# sysctl hw.ndis0.EnableAutoConnect=1
# sysctl hw.ndis0.SSID="MY_SSID"
# sysctl hw.ndis0.NetworkType=0 (0 for bss, 1 for adhoc)
# ifconfig ndis0 <my ipaddr> netmask 0xffffff00 up

Things to be done:

- get rid of debug messages
- add in ndis80211 support
- defer transmissions until after a status update with
  NDIS_STATUS_CONNECTED occurs
- Create smarter lookaside list support
- Split off if_ndis_pci.c and if_ndis_pccard.c attachments
- Make sure PCMCIA support works
- Fix ndiscvt to properly parse PCMCIA device IDs from INF files
- write ndisapi.9 man page
2003-12-11 22:34:37 +00:00
Warner Losh
a0b7a7df3e hea is gone, remove its module 2003-12-07 07:04:39 +00:00
Warner Losh
f33a379b6a Remove hea module. 2003-12-07 07:03:07 +00:00
John Baldwin
b75d244710 Remove SMP option support from building the ACPI module as it is no longer
needed.

Approved by:	re (murray)
Requested by:	njl
2003-12-05 15:49:01 +00:00
John Baldwin
8eca42d505 - Reenable building of the ACPI module on i386.
- Remove 'device acpi' from i386 GENERIC and revert back to using ACPI as
  a module by default.

Approved by:	re (scottl / blanket)
2003-12-03 21:13:06 +00:00
John Baldwin
559b9254c4 Add madt.c to the list of sources for i386.
Approved by:	re (scottl / blanket)
2003-12-03 21:10:02 +00:00
Warner Losh
88afb90f3c Updated cx driver commit part 1: bring in the new kernel driver.
This is the vastly updated cx drvier from Roman Kurakin <rik@cronyx.ru>
who has been patiently waiting for this update for sometime.

The driver is mostly a rewrite from the version we have in the tree.
While some similarities remain, losing the little history that the old
driver has is not a big loss, and the re@ felt it was easier this way (less
error prone).

The userland parts of this update will be committed shortly.

The driver is not connected to the build yet.  I want to make sure I
don't break any platform at any time, so I want to test that with
these files in the tree before I continue (on the off chance I'm
forgetting a file).

I changed the DEBUG macro to CX_DEBUG from the code that was submitted
(to not break when we go to building with opt_global.h after the
release), as well adding $FreeBSD$.

Submitted by: Roman Kurakin
Approved by: re@ <scottl>
2003-12-03 07:29:38 +00:00
Nate Lawson
b6426963c4 * Add acpi_pcpu_get_id(idx, *acpi_id, *cpu_id) which fetches the
idx'th present CPU with pc_acpi_id equal to *acpi_id.  If *acpi_id
  does not match that processor's pc_acpi_id, return the value for
  ProcId derived from the MADT in *acpi_id.  If pc_acpi_id is 0xffffffff,
  always override it with the value of *acpi_id.  Finally, return
  pc_cpuid in *cpu_id and use that as our primary key.

* Use pc_cpuid as our unique key because we know it is valid since
  MD code set it.  The values for ProcId in the ASL and MADT don't
  match up on some machines (!), forcing us to fall back to ordered
  probing in that case.

* Remove some #ifdef SMP since the refcount doesn't hurt performance
  and will be needed for dynamic _CST objects.  Only one #ifdef SMP
  (for smp_rendezvous) remains.

* Hook up SMP in the compile flags in the Makefile.

Tested by:	marcel, truckman
Approved by:	re (scottl)
2003-11-26 19:01:33 +00:00
Warner Losh
3193579b66 o Remove @- from the ln and change it to a -sf. This was bogus, and
regocnized as such at the time.  Now that the other bogons in the
  tree have been fixed, we can remove this ugly kludge.
o Remove stale/bogus opt_foo.h files.  These are left over from
  by-gone resources.  And they point to the need, yet again, to
  improve the build system so meta information is only in one place.

Submitted by: ru
Reviewed by: bde
Approved by: re@ (jhb)
2003-11-19 05:08:27 +00:00
Robert Watson
2dd0f3209f Revert a NOOP change to Makefile that slipped into the last commit.
Pointed out by:	tjr
2003-11-18 00:52:30 +00:00
Robert Watson
a557af222b Introduce a MAC label reference in 'struct inpcb', which caches
the   MAC label referenced from 'struct socket' in the IPv4 and
IPv6-based protocols.  This permits MAC labels to be checked during
network delivery operations without dereferencing inp->inp_socket
to get to so->so_label, which will eventually avoid our having to
grab the socket lock during delivery at the network layer.

This change introduces 'struct inpcb' as a labeled object to the
MAC Framework, along with the normal circus of entry points:
initialization, creation from socket, destruction, as well as a
delivery access control check.

For most policies, the inpcb label will simply be a cache of the
socket label, so a new protocol switch method is introduced,
pr_sosetlabel() to notify protocols that the socket layer label
has been updated so that the cache can be updated while holding
appropriate locks.  Most protocols implement this using
pru_sosetlabel_null(), but IPv4/IPv6 protocols using inpcbs use
the the worker function in_pcbsosetlabel(), which calls into the
MAC Framework to perform a cache update.

Biba, LOMAC, and MLS implement these entry points, as do the stub
policy, and test policy.

Reviewed by:	sam, bms
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-11-18 00:39:07 +00:00
Shunsuke Akiyama
565f53bbaa Make interrupt pipe interval time configurable.
- Add kernel options: {UPLCOM,UVSCOM}_INTR_INTERVAL
- Add sysctl variables: 'hw.usb.{uplcom,uvscom}.interval'

MFC after:	1 week
2003-11-16 12:26:10 +00:00
Warner Losh
e0ce91e18b Quick hack to make the nfsclient.ko loadable again. This brings in
the nfsv4 files.  It is intended to be a short-term bridge while
alfred deals with the problem in a better way (eg, don't hesitate to
back this out when the real fix comes along).  I've not heard back
from alfred in a few hours and other people are hitting this problem.

Approved by: markm, rwatson, grog, murray
2003-11-16 00:00:06 +00:00
Nate Lawson
6b74f9b7f5 Implement Cx CPU idle states and updated throttling support.
* Use the cpu_idle_hook() to do idling for C1-C3.
* Use both _CST and the FADT to detect Cx states.
* Use both _PTC and P_CNT for controlling throttling.
* Add a notify handler to detect changes in _CST and _PSS
* Call the _INI function for each processor if present.  This will be
  done by ACPI-CA in the future.
* Fix a bug on SMP systems where CPUs will attach multiple times if the
  bus is rescan.
* Document new sysctls for controlling idling.
2003-11-15 19:26:06 +00:00
Alfred Perlstein
c3521a9fdc nfs4 client module.
Not hooked up to the build yet.
2003-11-15 01:02:00 +00:00
Bruce M Simpson
f16770ae7e Fix a bug whereby the physical endpoints of a gre(4) tunnel would not
be printed, if the module were loaded into a kernel which had INET6 enabled.

The gre(4) driver does not use INET6, nor is it specified for IPv6. The
tunnel_status() function in ifconfig(8) is somewhat overzealous and assumes
that all tunnel interfaces speak KAME ifioctls.

This fix follows the path of least resistance, by teaching gre(4) about
the two KAME ifioctls concerned.

PR:	bin/56341
2003-11-14 20:58:00 +00:00
Robert Watson
599bcd064c Following the repo-copy from src/sys/modules/mac_none/Makefile,
I neglected to update the filenames/etc in mac_stub.  Do so now.
2003-11-11 21:23:54 +00:00
Ruslan Ermilov
5a4e8b0f24 Don't compile with -g by default; there's a better way to build modules with
debug support.
2003-11-10 12:54:54 +00:00
Scott Long
7773002178 Add the Makefile glue for the udf_iconv module.
Submitted by: imura@ryu16.org
2003-11-07 09:38:05 +00:00
Hartmut Brandt
4295875a6d The layer 3 (signalling) of NgATM netgraph node: ng_uni. This node
handles user and network side signaling and partly PNNI.
2003-11-07 09:15:14 +00:00
Warner Losh
eb57864fad List the three modules that I have that aren't connected to the build. 2003-11-06 08:46:52 +00:00
Scott Long
396c3653e4 Update the udf module makefile for the udf_iconv module
Submitted by: imura@ryu16.org
2003-11-05 06:30:59 +00:00
Warner Losh
0cbc7cc255 ppbus_if.c is necessary if you are loading submodules. 2003-11-04 02:55:03 +00:00
Warner Losh
fce33fc5eb Module for cs driver 2003-11-04 01:36:35 +00:00
John Baldwin
75556f82c8 Temporarily disable the acpi(4) module on i386 until issues revolving
SMP probing and the MADT table can be sorted out.  For now, if you want
ACPI, you must compile it into your kernel statically using 'device acpi'.
2003-11-03 22:44:09 +00:00
Hartmut Brandt
ed70dde057 Put the address handling, traffic descripto handling and the
message encoding and decoding stuff into the base module. All of this
is accessed by several of the NgATM modules and putting this into
atmbase reduceds the memory footprint.
2003-11-03 09:18:52 +00:00
Hidetoshi Shimokawa
869093b15d Add dumb console driver and related bits.
dcons(4): very simple console and gdb port driver
dcons_crom(4): FireWire attachment
dconschat(8): User interface to dcons

Tested with: i386, i386-PAE, and sparc64.
2003-10-24 15:44:10 +00:00
Hartmut Brandt
0376020649 Module build infrastructure for the NgATM SAA layer. 2003-10-24 07:42:08 +00:00
Hidetoshi Shimokawa
e9e688e243 Add SBP-II target mode driver.
Though this is still incomplete and has some missing features such as
exclusive login and event notification, it may be enough for someone
who wants to play with it.

This driver is supposed to work with firewire(4), targ(4) of CAM(4)
and scsi_target(8) which can be found in /usr/share/example/scsi_target.
This driver doesn't require sbp(4) which implements initiator mode.

Sample configuration:

Kernel: (you can use modules as well)
device	firewire
device	scbus
device	targ
device	sbp_targ

After reboot:
# mdconfig -a -t malloc -s 10m
md0
# scsi_target 0:0:0 /dev/md0
(Assuming sbp_targ0 on scbus0)

You should find the 10MB HDD on FreeBSD/MacOS X/WinXP or whatever connected
to the target using FireWire.

Manpage is not finished yet.
2003-10-18 05:41:31 +00:00
Maksim Yevmenkin
0986ab12e4 Update Bluetooth code.
Reviewed by: M. Warner Losh <imp@bsdimp.com>; John Hay <jhay@freebsd.org>
Approved by: M. Warner Losh <imp@bsdimp.com> (mentor)
2003-10-12 22:04:24 +00:00
Hidetoshi Shimokawa
c4778b5d1c MFp4: Change struct fw_xfer to reduce memory copy in fwmem_*() functions.
And many changes.

* all
	- Major change of struct fw_xfer.
		o {send,recv}.buf is splitted into hdr and payload.
		o Remove unnecessary fields.
		o spd is moved under send and recv.
	- Remove unnecessary 'volatile' keyword.
	- Add definition of rtcode and extcode.

* firewire.c
	- Ignore FWDEVINVAL devices in fw_noderesolve_nodeid().
	- Check the existance of the bind before call STAILQ_REMOVE().
	- Fix bug in the fw_bindadd().
	- Change element of struct fw_bind for simplicity.
	- Check rtcode of response packet.
	- Reduce split transaction timeout to 200 msec.
		(100msec is the default value in the spec.)
	- Set watchdog timer cycle to 10 Hz.
	- Set xfer->tv just before calling fw_get_tlabel().

* fwohci.c
	- Simplifies fwohci_get_plen().

* sbp.c
	- Fix byte order of multibyte scsi_status informations.
	- Split sbp.c and sbp.h.
	- Unit number is not necessary for FIFO¤ address.
	- Reduce LOGIN_DELAY and SCAN_DELAY to 1 sec.
	- Add some constants defineded in SBP-2 spec.

* fwmem.c
	- Introduce fwmem_strategy() and reduce memory copy.
2003-10-02 04:06:56 +00:00
Max Khon
c4f02a891f - Support for multibyte charsets in LIBICONV.
- CD9660_ICONV, NTFS_ICONV and MSDOSFS_ICONV kernel options
(with corresponding modules).
- kiconv(3) for loadable charset conversion tables support.

Submitted by:	Ryuichiro Imura <imura@ryu16.org>
2003-09-26 20:26:25 +00:00
Sam Leffler
3fe1b4f5df update to reflect PFIL_HOOKS api changes
Supported by:	FreeBSD Foundation
2003-09-23 17:55:04 +00:00
Sam Leffler
134ea22494 o update PFIL_HOOKS support to current API used by netbsd
o revamp IPv4+IPv6+bridge usage to match API changes
o remove pfil_head instances from protosw entries (no longer used)
o add locking
o bump FreeBSD version for 3rd party modules

Heavy lifting by:	"Max Laier" <max@love2party.net>
Supported by:		FreeBSD Foundation
Obtained from:		NetBSD (bits of pfil.h and pfil.c)
2003-09-23 17:54:04 +00:00
Marcel Moolenaar
8225548ebf Only build the ebus driver on sparc64. It includes a header directly
from the sparc64 subtree, which breaks building non-sparc64 platforms
in the event the sparc64 subtree does not exist.
The problem is specific to the module, because non-module builds are
affected by the presence or absence of "device ebus" in the kernel
configuration.

PR: kern/56869
2003-09-17 03:00:08 +00:00
Marcel Moolenaar
991e61c934 Sort: build uart_bus_pccard.c before uart_bus_pci.c. 2003-09-15 04:53:11 +00:00
Takanori Watanabe
a9f6e997b5 Add uart pccard bus attachment,based on sio_pccard.c .
Wrote at: Hakone.
Powered by: Warner Losh's scotch whisky.
Tested by: nork
2003-09-14 16:21:06 +00:00
Bill Paul
9bac70b851 Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S
ethernet chips. This driver is pretty simple, however it contains
special DSP initialization code which is needed in order to get
the chip to negotiate a gigE link. (This special initialization
may not be needed in subsequent chip revs.) Also:

- Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS)

- Deal with shared interrupts in re_intr(): if interface isn't up,
  return.

- Fix another bug in re_gmii_writereg() (properly apply data field mask)

- Allow PHY driver to read the RL_GMEDIASTAT register via the
  re_gmii_readreg() register (this is register needed to determine
  real time link/media status).
2003-09-11 03:53:46 +00:00
Bill Paul
b9f78d2b4a Add a device driver for the Broadcom BCM4401 ethernet controller,
written by Stuart Walsh and Duncan Barclay (with some kibbitzing by
me). I'm checking it in on Stuart's behalf.

The BCM4401 is built into several x86 laptop and desktop systems. For the
moment, I have only enabled it in the x86 kernel config because although
it's a PCI device, I haven't heard of any standalone NICs that use it. If
somebody knows of one, we can easily add it to the other arches.

This driver uses register/structure data gleaned from the Linux
driver released by Broadcom, but does not contain any of the code
from the Linux driver itself. It uses busdma.
2003-09-09 18:17:23 +00:00