Commit Graph

27 Commits

Author SHA1 Message Date
Archie Cobbs
21b8ebd926 Make all Ethernet drivers attach using ether_ifattach() and detach using
ether_ifdetach().

The former consolidates the operations of if_attach(), ng_ether_attach(),
and bpfattach(). The latter consolidates the corresponding detach operations.

Reviewed by:	julian, freebsd-net
2000-07-13 22:54:34 +00:00
Ollivier Robert
a0b74543ff Bring the an(4) fixes to wi(4):
- suser check
- splx() fix.

Reminded by:	Aaron Campbell <aaron@openbsd.org>
2000-06-19 00:17:13 +00:00
Archie Cobbs
2e2de7f23f Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input().
Also, remove the (incomplete) hack for matching ethernet headers
in the ip_fw code.

The good news: net result of 1016 lines removed, and this should make
bridging now work with *all* Ethernet drivers.

The bad news: it's nearly impossible to test every driver, especially
for bridging, and I was unable to get much testing help on the mailing
lists.

Reviewed by:	freebsd-net
2000-05-14 02:18:43 +00:00
Poul-Henning Kamp
3389ae9350 Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>
2000-04-19 14:58:28 +00:00
Bill Paul
339dabccd7 When in infrastructure mode, use address 3 from the 802.11 header as the
source address when receiving frames (and keep using address 2 when in
pseudo-IBSS mode). This is apparently necessary in order to obtain the
true MAC address of the sending station which is needed for PPPoE.

Patch supplied by: Blaz Zupan <blaz@amis.net>
2000-04-17 18:47:28 +00:00
Robert Watson
081d19aecd Modify if_wi.c to call bpfdetach(ifp) before if_detach(ifp), so as to
prevent a page fault if the card is ejected while BPF is in use.  This
could happen if DHCP or tcpdump was in use on that interface during
ejection.  Other drivers may also require this modification.

Reviewed by:	wes
2000-03-19 05:46:50 +00:00
Bill Paul
6f76cb1e28 Add support for WEP (encryption) for silver and gold WaveLAN/IEEE turbo cards.
Also update wicontrol to enable/disable encryption, set WEP keys and set the
TX key index. Silver cards only have 40-bit keys. This is something of a quick
hack, but it works well enough for me to commit this from the LinuxWorld
exhibit floor.

The WEP support only shows up if you have a card that supports it.

Would have been approved by: jkh, if he hadn't wandered off somewhere
Approved in his place by: msmith, who's standing right here
2000-02-02 17:59:13 +00:00
Bill Paul
8647d85ac3 Correctly set the data length when transmitting 802.3 frames (we need to
subtract the length of the SNAP header).
2000-01-12 00:57:27 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Bill Paul
bfe31f4f2a Fix invocation of bus_teardown_intr(). The last arg is supposed to be
sc->wi_intrhand, not &sc->wi_intrhand.
1999-12-08 02:00:10 +00:00
Bill Paul
dda0e6f54e Update the WaveLAN/IEEE driver:
- Convert to new bus attachment scheme. Thanks to Blaz Zupan for doing
  the initial work here. One thing I changed was to have the attach
  and detach routines work like the PCI drivers, which means that in
  theory you should be able to load and unload the driver like the PCI
  NIC drivers, however the pccard support for this hasn't settled down
  yet so it doesn't quite work. Once the pccard work is done, I'll have
  to revisit this.

- Add device wi0 to PCCARD. If we're lucky, people should be able to
  install via their WaveLAN cards now.

- Add support for signal strength caching. The wicontrol utility has
  also been updated to allow zeroing and displaying the signal strength
  cache.

- Add a /sys/modules/wi directory and fix a Makefile to builf if_wi.ko.
  Currently this module is only built for the i386 platform, though once
  the pccard stuff is done it should be able to work on the alpha too.
  (Theoretically you should be able to plug one of the WaveLAN/IEEE ISA
  cards into an alpha with an ISA slot, but we'll see how that turns out.

- Update LINT to use only device wi0. There is no true ISA version of
  the WaveLAN/IEEE so we'll never use an ISA attachment.

- Update files.i386 so that if_wi is dependent on card.
1999-11-25 20:45:49 +00:00
Peter Wemm
4a6eb2cc6c Fix a warning. 1999-11-18 08:39:02 +00:00
Warner Losh
e653ecce87 Disable old PCCARD_MODULE code.
This should fix LINT.

Prompted by: phk's explicit message about LINT breakage
1999-10-29 17:28:09 +00:00
Bill Paul
98a229f65e As suggested by phk, unconditionalize BPF support in these drivers. Since
there are stubs compiled into the kernel if BPF support is not enabled,
there aren't any problems with unresolved symbols. The modules in /modules
are compiled with BPF support enabled anyway, so the most this will do is
bloat GENERIC a little.
1999-09-23 03:32:57 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Mike Smith
3ed7a59b07 Clean up after removing sys/eventhandler.h from sys/systm.h at the last
minute.  This should cover all of the missed cases (and should let LINT
build again).
1999-08-21 22:10:49 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Bill Paul
7694cd9368 Correct the alignment of some of the members in the wi_frame structure.
The structure is the right length, but some of the members (notably
wi_q_info) were off a bit. This causes the received signal strength
values to appear bogus.
1999-07-20 20:03:42 +00:00
Dag-Erling Smørgrav
6b5ca0d83e Rename bpfilter to bpf. 1999-07-06 19:23:32 +00:00
Bill Paul
f30fba37d7 Patch the WaveLAN/IEEE driver to detect and reject oversized received
frames (or just insane received packet lengths generated due to errors
reading from the NIC's internal buffers). Anything too large to fit
safely into an mbuf cluster buffer is discarded and an error logged.

I have not observed this problem with my own cards, but on user has
reported it and adding the sanity test seems reasonable in any case.

Problem noted and patch provided by: Per Andersson <per@cdg.chalmers.se>
1999-07-04 14:40:22 +00:00
Bill Paul
32af3bf215 Small optimization: use wi_seek() in wi_read_record() and wi_write_record()
instead of frobbing the buffer access path registers directly. Saves a
few lines of duplicated code.
1999-06-06 16:44:04 +00:00
Bill Paul
33b3ee3898 - Fix up some comments in if_wi.c (no code changes)
- Mention that the 6Mbps turbo adapters are supported in HARDWARE.TXT
  and RELNOTES.TXT and the wi.4 man page
- Mention turbo adapters in the wicontrol.8 man page and provide a
  complete table of available transmit speed settings
1999-05-22 16:12:54 +00:00
Bill Paul
049e649a10 Add support to wicontrol(8) and wi(4) for enabling and configuring
power management. This will only work on newer firmware revisions; older
firmware will silently ignore the attempts to turn power management on.

Patches supplied by: Brad Karp <karp@eecs.harvard.edu>
1999-05-07 03:28:54 +00:00
Bill Paul
e566363ef1 Modify wicontrol(8) and wi(4) to allow setting the frequency of the
WaveLAN's radio modem. The default is whatever the NIC uses since NICs
sold in different countries may default to different frequencies. (The
Lose95/LoseNT software doesn't let you select the channel so it's probably
not really meant to be changed.)
1999-05-06 16:32:45 +00:00
Bill Paul
c49713fde1 Fix some byte ordering problems; I was storing string lengths wrong,
which was causing wicontrol to crash when reading string parameters
from the WaveLAN.

Patches submitted by: Brad Karp <karp@eecs.harvard.edu>
1999-05-06 03:34:02 +00:00
Bill Paul
31a08ab08e Add device driver support for the Lucent WaveLAN/IEEE 802.11 PCMCIA
adapter (and some workalikes). Also add man pages and a wicontrol
utility to manipulate some of the card parameters.

This driver was written using information gleaned from the Lucent HCF Light
library, though it does not use any of the HCF Light code itself, mainly
because it's contaminated by the GPL (but also because it's pretty gross).
The HCF Light lacks certain featurs from the full (but proprietary) HCF
library, including 802.11 frame encapsulation support, however it has
just enough register information about the Hermes chip to allow someone
with enough spare time and energy to implement a proper driver. (I would
have prefered getting my hands on the Hermes manual, but that's proprietary
too. For those who are wondering, the Linux driver uses the proprietary
HCF library, but it's provided in object code form only.)

Note that I do not have access to a WavePOINT access point, so I have
only been able to test ad-hoc mode. The wicontrol utility can turn on
BSS mode, but I don't know for certain that the NIC will associate with
an access point correctly. Testers are encouraged to send their results
to me so that I can find out if I screwed up or not.
1999-05-05 07:37:11 +00:00
Bill Paul
113a394c06 Add device driver support for the Lucent WaveLAN/IEEE 802.11 wireless
network adapters. These are all PCMCIA devices (the ISA version is a
PCMCIA to ISA bridge with a PCMCIA card plugged into it). Also add a
wicontrol utility to read and write some of the card's parameters.

Note: I do not have access to a WavePOINT access point, so I have only
been able to test this driver in ad-hoc (point to point) mode. The
wicontrol utility allows programming the desired service set name (SSID)
and enabling BSS mode, but I can't tell for sure if it works (I know the
card switches modes, but I can't verify that it joins a service set
correctly).

This driver was written using information gleaned from the Lucent HCF Light
library, which is an API library designed to simplify driver development
for devices based on the Lucent Hermes chip. Unfortunately, the HCF Light
is missing certain features (like 802.11 frame encapsulation!) which are
available only in the proprietary complete HCF code, which is not available
to the public. This driver uses none of the HCF Light code: it's very ugly
and contaminated by the GPL. IP and ARP packets are encapsulated as 802.11
frames, everything else is encapsulated as 802.3.

(It would be easier to just get the Hermes programming manual, but that's
not publically available either. For those who are wondering, the Linux
WaveLAN/IEEE driver uses the proprietary HCF code, which is provided in
object code form only. So much for supporting open source sofware.)

Multicast filter support is implemented, however it appears that the
filter doesn't work: programming in one IP mutlicast group enables them
all.
1999-05-05 07:11:38 +00:00