Commit Graph

362 Commits

Author SHA1 Message Date
Sam Leffler
155fb57323 purge dead code
Noticed by:	Coverity Prevent analysis tool
2005-03-26 23:51:39 +00:00
Sam Leffler
f6ef5ddaa4 correct logic so we recognize timeout on alloc
Noticed by:	Coverity Prevent analysis tool
2005-03-26 23:43:54 +00:00
Sam Leffler
0c97ab9691 reclaim mbuf chain when ieee80211_crypto_encap fails
Noticed by:	David Young
2005-03-08 17:01:03 +00:00
Warner Losh
2ece8174c1 Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return
BUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vx
both support so that xl will snarf them on up.
2005-03-01 07:50:12 +00:00
Warner Losh
8d2ad0b460 The two PLANEX cards listed in pccarddevs, identified only by their
CIS, weren't actually used anywhere (other than the generic PC Card
code when certain variables are defined).  They aren't used in NetBSD
either.  Make things simpler by removing them.  Change PLANEX_2 to
PLANEX and tweak wi and owi to use that instead.  The PLANEX id seems
to actually be pci ID assigned to planex, not its pcmcia id.  Ooops.
I don't know if this is a reporting error from where this entry came
from, or if it is a mistake on PLANEX's part.  I suspect the latter,
as ACTIONTEC and NEWMEDIA made the same mistake (although new media
may be because it uses an advansys chip inside).  Make a note of this
in the file.  The 0xc entires may be JEITA assigned, so note that as
well.

# This leaves just 3 entries that are totally unknown: airvast, archos
# and edimax although the arivast number is the same assigned to
# avertec in usb...
2005-02-01 18:28:09 +00:00
Warner Losh
c5c0655590 Use Intersil chip names for the symbols, since many makers use the
intersil IDs but their own name in the CIS.
2005-01-20 18:34:22 +00:00
Warner Losh
7610c28cf1 Add support for SENAO SL-2511CD
Info submitted by: Paulo Fragoso
2005-01-20 17:46:05 +00:00
Warner Losh
c3bd3b5978 Call wi_free after we turn off the interrupts. If we call it before,
then we reference parts of the softc.

# My appologies, but this was sent to me by someone whose name I've lost.
2005-01-19 01:26:44 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Sam Leffler
3baeaf0b19 Eliminate some of the egregious bypass of the 802.11 state
machine; instead use the intended entry points.  There's still
too much incestuous knowledge about the internals of the
802.11 layer but this at least fixes adhoc mode.
2005-01-01 17:45:11 +00:00
Matthew N. Dodd
86906d256a Diff reduce wi_write_wep() relative to revision 1.168 2004-12-17 20:48:13 +00:00
Sam Leffler
181ab45653 Fix wep operation for station mode:
o don't encapsulate on tx; the chip expect a raw frame w/o the crypto header
o clear the WEP bit in the 802.11 header on rx so the 802.11 layer doesn't
  try to strip the crypto header
o clobber the "drop unencoded frames" state bit when privacy is enabled so
  rx'd frames we pass up to the 802.11 layer are not discarded as unencrypted

This stuff will need to be redone if anyone decides to add WPA support.
2004-12-17 03:57:16 +00:00
Sam Leffler
14ae1a9deb set ic_ibss_chan when entering RUN state to match ic_bss so the channel
reported when associated to an AP is correct
2004-12-17 03:36:24 +00:00
Sam Leffler
407a27b151 remove power save logic from the tx path; the driver isn't ready to support
it so don't mislead folks
2004-12-17 03:05:30 +00:00
Sam Leffler
f48445578b o Update for net80211 changes
o Import some minor fixes from netbsd
2004-12-08 17:36:28 +00:00
Max Laier
154b8df2ed Second part of ALTQ driver modifications, covering:
an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4)

Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/

Tested by:	Vaidas Damosevicius (an, ath, wi)
		Roman Divacky (vr)
Submitted by:	yongari (hme)
2004-08-01 23:58:04 +00:00
Max Laier
02b199f158 Link ALTQ to the build and break with ABI for struct ifnet. Please recompile
your (network) modules as well as any userland that might make sense of
sizeof(struct ifnet).
This does not change the queueing yet. These changes will follow in a
seperate commit. Same with the driver changes, which need case by case
evaluation.

__FreeBSD_version bump will follow.

Tested-by:	(i386)LINT
2004-06-13 17:29:10 +00:00
Warner Losh
8c81529f45 Only match cards that claim to be network cards. I've had two
different cards that matched vendor/id, but weren't wi cards.  This is
because the vendor foolishly didn't have unique product ids.  Symbol
has a serial card that would otherwise match the wi driver, for
example...

Taken from a patch for xe posted by: Carlos Velasco
2004-06-09 06:31:40 +00:00
Warner Losh
2e31e339d1 Fix disordering of pccarddevs.h noticed by bde. Also remove a few
redundant includes and fix some of the include disordering.

Submitted by: bde
2004-05-27 03:49:45 +00:00
Warner Losh
dba6dd177b Move to generating pccarddevs.h on the fly, both for the kernel and
the modules.

Also generate usbdevs.h automatically now, but a non-kernel file is
stopping that at the moment.
2004-05-26 00:53:10 +00:00
Warner Losh
fbfb97942e It turns out that the module dependency on pccard is in error. Since
there's not dependencies on pccard symboles, such a dependency is not
necessary.  This means that drivers that have multiple attachments can
not drag bogus devices into the kernel at load time.

We can't (yet) do this with pci and isa.  Drivers written for them
actually do seem to have symbols that depend on these busses'
implementation code.

ndis not touched until other things can be tested.
2004-05-08 06:04:06 +00:00
Sam Leffler
2f1ad18b34 radiotap updates:
o force little-endian byte order for header
o pad header to 32-bit boundary to guard against applications that assume
  packet data alignment
2004-04-01 00:38:45 +00:00
Sam Leffler
8d798b52fd correct xmit-side radiotap collection by tap'ing the frame before
prepending the h/w header
2004-04-01 00:33:33 +00:00
Warner Losh
2104f15e11 Add support for a new variant of the prism3 that has appaered in the
wild.  This one is marketed by D-Link model DWL-650, but appears to be
a ISL3710P-10 under the hood.

Reported by: Brian O'Shea
2004-03-25 21:58:55 +00:00
Matthew N. Dodd
f7f2bd753e Don't announce MAC addresses twice.
(ieee80211_ifattach() calls ether_ifattach().)
2004-03-20 19:57:47 +00:00
Brian Feldman
7e7a65a6fa Eliminate bogus usage of WI_RSSI_TO_DBM(). Not only does it bogusly
clip/destroy the dB value contained in the wi(4)'s receive frames,
it doesn't match with the flag set in the radiotap header
(unperturbed dB versus dBm).
2004-03-17 21:54:52 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Sam Leffler
3c898db70a update radiotap support to reflect recent changes:
o add xmit rate
o drop rx time
o add rx flags
2003-12-28 06:58:52 +00:00
Sam Leffler
437ffe1823 o eliminate widespread on-stack mbuf use for bpf by introducing
a new bpf_mtap2 routine that does the right thing for an mbuf
  and a variable-length chunk of data that should be prepended.
o while we're sweeping the drivers, use u_int32_t uniformly when
  when prepending the address family (several places were assuming
  sizeof(int) was 4)
o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated
  mbufs have been eliminated; this may better be moved to the bpf
  routines

Reviewed by:	arch@ and several others
2003-12-28 03:56:00 +00:00
Warner Losh
81e2d98d9e Fix slight disordering of supported cards. 2003-12-27 18:07:50 +00:00
Warner Losh
462fcd56a6 Older versions of the intersil firmware is a lot slower than newer
versions of the firmware.  It responds more slowly to commands, and we
bogusly failed them.  We assume that all versions of the intersil
firmware before 1.0 are 10 times slower and will give it 10x the time
to finish.

# for 5.2 we should always just assume 5s.
2003-12-09 07:41:07 +00:00
Warner Losh
51c3136508 Fix Lucent cards.
o Back out workaround for not resetting lucent cards more than once.  With
  these fixes, it appaers they are no longer necessary.
o Set wi_gone when the card goes awol: typically when we get 0xffff back from
  the card.  Also, don't interact with a card that's gone, so we fail in
  seconds rather than minutes.  Also reduce amount of time we wait to .5s
  in wi_cmd.
o clear wi_gone on ifconfig down to give some cards a chance after they wedge
  (this appears to unwedge one of my prism cards with old firmware).  ifconfig
  up will fail quickly enough if the card really is out to lunch.
o Add delay in wi_init of 100ms.
o wi_stop(ifp, 0->1) changes so that we clear sc_enabled so that we
  exit out of the interrupt routine by just acking the interrupt

Submitted by: iedowse
Approved by: re@ (scottl)

# after the freeze I'll fix some of the minor style issues that reviewers
# of this patch have told me about.
2003-12-02 04:59:59 +00:00
Brian Feldman
def19aab78 Truly fix the lockup mentioned in 1.153. The PRISM hardware is not
capable of functioning in HostAP mode with a zero-length SSID, so
use " " if one is not set.
2003-11-04 23:47:19 +00:00
Brian Feldman
8b42c60645 Despite making the card not lock up, thae workaround from 1.153 didn't
actually make hostap mode work again.  Back it out while I try to find
a solution.
2003-11-04 22:36:48 +00:00
Brian Feldman
2cb7584b69 Fix wi(4)'s WI_RID_SCAN_RES ioctl (wicontrol -L). The wrong length
is computed, so the user thinks that for non-PRISM cards there are
more APs represented than exist.
2003-11-04 00:31:58 +00:00
Brian Feldman
86e011b3e8 On my ZoomAir-branded Intersil PRISM2 cards, if you try to set the
operating mode to HostAP, the card will lock up indefinitely (but
the wi(4) driver can recover if you eject the card).  The problem is
that the card needs to be "reset" in a way before you even change the
media to hostap.  In practice this isn't as noticeable because you
probably do some operation beforehand which prevents the lock-up
before you enable hostap mode.

e.g.:
"ifconfig wi0 up media autoselect mediaopt hostap" will lock up
(if you just inserted the card).
"ifconfig wi0 up ssid foo media autoselect mediaopt hostap" won't lock up.
2003-11-04 00:24:13 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Sam Leffler
b237430cfe mark interrupt handlers MPSAFE 2003-10-29 18:32:14 +00:00
Warner Losh
2e6a21aa7f Sony PEGA-WL110 Wireless LAN
Obtained from: NetBSD (onoe-san)
2003-09-22 05:33:22 +00:00
Warner Losh
45a3024ec7 New Proxim Harmony OEM card.
Submitted by: Jeremy Bingham
2003-09-20 05:27:18 +00:00
Sam Leffler
8df91fc8bc o add experimental radiotap capture format
o add netbsd logic to convert rssi to device-independent values

Obtained from:	NetBSD (rssi conversion code)
2003-09-05 22:29:30 +00:00
Warner Losh
76387a8ff1 This doesn't work, so back them out. 2003-08-24 05:18:10 +00:00
Warner Losh
cfab163573 Return -100 rather than 0 for pccard probe routines. This allows
other drivers to attach to these cards, if so desired.
2003-08-24 03:32:47 +00:00
Warner Losh
90cf0136c4 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 07:08:17 +00:00
Warner Losh
9125ded8ee LINKSYS2 -> BROMAX 2003-08-21 17:40:59 +00:00
Warner Losh
3d844b955b Update to reflect NETGEAR_2 -> INTERSIL and INTERSIL -> INTERSIL2
changes to pccarddevs.
2003-08-21 17:13:33 +00:00
Sam Leffler
0a915fad5d MFp4 changes to fix locking issues and correct reference
count handling of station entries in hostap mode:

Input path:

o driver is now expected to find the node associated with the
  sender of a received frame; use ic_bss if none is located
o driver passes the (referenced) node into ieee80211_input for
  use within the wlan module and is responsible for cleaning up
  on return
o the antenna state is no longer passed up with each frame; this
  is now considered driver-private state and drivers are responsible
  for keeping it in the driver-private part of a node

Output path:

Revamp output path for management frames to eliminate redundant
locking that causes problems and to correct reference counting
bogosity that occurs when stations are timed out due to inactivity
(in AP mode).  On output the refcnt'd node is stashed in the pkthdr's
recvif field (yech) and retrieved by the driver.  This eliminates
an unref/ref scenario and related node table unlock/lock due to the
driver looking up the node.  This is particularly important when
stations are timed out as this causes a lock order reversal that
can result in a deadlock.  As a byproduct we also reduce the overhead
for sending management frames (minimal).  Additional fallout from
this is a change to ieee80211_encap to return a refcn't node for
tieing to the outbound frame.  Node refcnts are not reclaimed until
after a frame is completely processed (e.g. in the tx interrupt
handler).  This is especially important for timed out stations as
this deref will be the final one causing the node entry to be
reclaimed.

Additional semi-related changes:
o replace m_copym use with m_copypacket (optimization)
o add assert to verify ic_bss is never free'd during normal operation
o add comments explaining calling conventions by drivers for frames
  going in each direction
o remove extraneous code that "cannot be executed" (e.g. because
  pointers may never be null)
2003-08-19 22:17:04 +00:00
Warner Losh
88755a2793 Add microsoft mn-520 wlan card.
Submitted by: Kirk Strauser
2003-08-14 06:30:06 +00:00
Marcel Moolenaar
6098c5e1a2 Add the PCI Id of the Intersil prism3 (mini-PCI) WLAN chip. The Vaio
PCG-505BX (for example) has one of those:

wi0: <Intersil Prism3> mem 0xf8000000-0xf8000fff at device 2.0 on pci2
wi0: 802.11 address: 00:02:8a:94:d8:73
wi0: using RF:PRISM3(Mini-PCI)
wi0: Intersil Firmware: Primary (1.1.1), Station (1.5.6)
wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
2003-08-08 23:33:42 +00:00
John Polstra
c009dcfdc2 Fix a couple of bugs in the resume handler. Don't call the if_init
function unless the device is configured up.  Without this fix, the
device ends up in the RUNNING state even though it is configured down.
Also, check the RUNNING flag before calling the if_start function, in
case the if_init function failed for one reason or another.
2003-07-26 20:54:57 +00:00
Sam Leffler
6e1ca44727 o Add monitor mode support. This tested fine with prism cards but may require
newer lucent/hermes firmware than indicated (investigating).  I'm committing
  this now since it shouldn't hurt anything.
o Vaguely related, add bogus frame length check from netbsd.

Obtained from:	netbsd
2003-07-21 23:20:40 +00:00
Sam Leffler
45bbf62fb5 track changes to 802.11 code:
o override new_state method per new model
o use ieee80211_state_name instead of private copy
2003-07-20 21:38:20 +00:00
Warner Losh
f90eb14ba9 Add Addtron AWA-100 wireless PCI card
Submitted by: Robin Reagan
Pr: 37526
2003-07-19 05:53:57 +00:00
Warner Losh
9b92f5db40 Add Linksys WCF12: from Scott Lambert 2003-07-19 05:51:44 +00:00
Warner Losh
fa3682c1c9 OpenBSD calls this AIRVAST, so use that instead 2003-07-15 07:22:21 +00:00
Warner Losh
6a78c9e48a Add Siemens SpeedStream 1021
Obainted from: openbsd (in spirit); millert
2003-07-15 03:34:08 +00:00
Warner Losh
40d3bedc9e Add support for asus wl100
PR: 49033/53249
2003-07-11 09:19:04 +00:00
Warner Losh
247056ed2a Add corega PCCL-11 to match entry added to pccarddevs a while ago.
Noticed going into openbsd...
2003-07-07 07:57:35 +00:00
Scott Long
b3655267ff Revert the previous commit, it snuck in by accident.
Submitted by:	ru
2003-07-03 10:16:40 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Sam Leffler
91f243876f catch failure to fetch the card's "own channel"; this should not happen 2003-06-29 20:14:35 +00:00
Sam Leffler
2c71d3c795 update for new 802.11 support 2003-06-28 06:17:26 +00:00
Sam Leffler
3cd0b4fd09 Return support needed by dstumbler:
o add back rx monitor support
o make WI_RID_SCAN_RES DTRT
o fix a bug handling zero-length RID requests (used by dstumbler to set
  a zero-length SSID)
o make RID_SCAN_REQ DTRT
o add back WI_RID_OWN_SSID
o fix wi_scan_ap to take a channel mask and txrate (for prism cards)

These changes fix dstumbler -o (monitor mode).  A minor change to dstumbler
is needed to get normal AP scanning mode to work right; this is preferred to
modifying the driver.

PR:		kern/53187
Reviewed by:	Bruce M Simpson <bms@spc.org>
2003-06-27 00:49:04 +00:00
Warner Losh
9b1b4524e6 As a workaround for the latest problems, don't init hermes cards more
than once.  This appears to work around the hanging issues, at the
expense of warnings about bad RID allocations.  I'm not sure this is a
permanant workaround, but does appear to help in the tests that I've
done here.
2003-06-13 00:40:37 +00:00
Warner Losh
c88a674b8d ARtem ONAIR card
Submitted by: Ben Gras
2003-06-11 16:56:02 +00:00
Warner Losh
7988ce93e8 Minor tweaks that are effectively all style tweaks. 2003-06-11 16:51:27 +00:00
Warner Losh
729a248d63 Call wi_free() in all the relevant error cases. 2003-06-11 16:41:07 +00:00
Warner Losh
459caa871c Call wi_free on the failure cases of pccard.
Tested by: scottl
2003-06-11 16:39:20 +00:00
Warner Losh
854cb5a41a Don't hold a driver lock across bus_teardown_intr. Jhb points out
that one cannot generally hold a lock and call bus_teardown_intr.
This is race free with wi_intr because bus_teardown_intr won't allow
wi_intr to be called after it returns.

# jeff hsu points out that there might be a race between this unlock
# and wi_start.  While that may be true also, it won't impact this commit.

Submitted by: jhb
2003-04-29 03:22:39 +00:00
Warner Losh
c14b840a2b Initialize error. 2003-04-27 23:44:05 +00:00
Warner Losh
a4da74c1d9 Make 2/3 of my symbol cards work again. The 3rd symbol card card has
firmware 1.50.12, but 2.20.1 and 3.10.4 work.  The 1.50.12 card gets
past doing dhclient, but hangs on transmit a little after the ip
address is set.  The 1.50.12 card has always been 'cranky' and Bill
Paul's tearing it apart at FreeBSD '99 hasn't helped.

sc_reset and sc_enable are subtlely different things.  sc_reset means
exactly "WI_CMD_INI has happened."  sc_enabled means "WI_CMD_ENABLE
has been sent to the card without a WI_CMD_DISABLE following."  This
is a little different than what they mean on NetBSD (where both of
these concepts are comingled).  NetBSD will try to only enable symbol
cards once, while FreeBSD only sends the WI_CMD_INI once.

Also, only try once to reset the card on a symbol.

This makes the lucent cards no worse than before, but apparently not
much better either.  I got fewer hangs in my testing than I have in
the past, but I don't know if it is statistically significant or not.
2003-04-27 15:56:05 +00:00
Warner Losh
7110005e4b Add generic OEM1 PRISM3 card.
Submitted by: mwlucas
2003-04-27 03:34:05 +00:00
Matthew N. Dodd
f246e4a17f - Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)
2003-04-15 06:37:30 +00:00
Warner Losh
81f290a510 Fix interrupt race.
From NetBSD
2003-04-10 07:55:55 +00:00
Warner Losh
f5746231ff Make sure that pp_name is non-null before setting the device
description.  This allows us to rely entirely on the CIS entries if
necessary...
2003-04-10 04:36:02 +00:00
Warner Losh
2701fed4cf Back out the _ND change. I plan on making all drivers default to that with
a special _DESC version for those cards whose CIS is insufficient for some
reason.  This should save about 3k of kernel strings when complete.
2003-04-10 04:14:35 +00:00
Warner Losh
b899d58ee4 Use the new _ND macros to not include the description strings. If any
of the entries have a description, we'll use that to override the
description that the pccard layer generates for us.

This saves about 930 bytes in the module, so I feel it won't hurt the
crowded boot disks....

# other modules to follow
2003-04-08 15:36:43 +00:00
Warner Losh
c3805dd0ad Don't set the decription, since the pccard layer does that for us now.
Remove the duplicate entries that were there to disambiguate different
cards that were the same, yet people wanted to have different dmesg.
2003-04-08 15:26:02 +00:00
David E. O'Brien
8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
Warner Losh
fb9e391927 MFP4 27224 and 27225:
Change 27224 by imp@imp_hammer on 2003/03/22 00:16:22
	Put what I think are the correct TX RATE translation tables
	in place for LUCENT firmware.  This is based on the 4.x driver.
	Maybe it should be table driven?

	ifconfig wi0 media DS/11Mbps still fails, but it fails before
	we even get to the txrate stuff, so other things are wrong.

Change 27225 by imp@imp_hammer on 2003/03/22 00:45:11
	Default ic_fixed_rate to -1.  This is the same thing as autoselect.
	There really should be a #define for this...
2003-03-22 15:39:38 +00:00
Warner Losh
0e630ee24b o Lucent cards don't seem to like multiple buffers for tx. Use only
one tx buffer for these cards.  The old driver only used one.  We use
  1 for symbol, and 3 for prism cards.
o Don't do the maximum loops thing in the ISR.  In fact, revert to the
  old interrupt handler.  Lucent cards don't seem to work too well if
  you don't disable/enable interrupts from the card in the ISR.

Between these two changes, Lucent cards suck less.  They work in
autoselect mode only.  And seem to get 1Mbps or 2Mbps only.  Setting a
specific media speed doesn't work, and I've had a few issues even with
these patches.  They turn a former brick into a nearly useful card.

These patches work on the prism 2 and 2.5 PC Card cards that I have.
I've not tested this on PCI cards.  I suspect, but couldn't find
proof, that they were the reason that the ISR was changed so radically
from its FreeBSD roots in NetBSD.  We might need to have a variant ISR
if so.
2003-03-18 04:22:42 +00:00
Warner Losh
572ab50c54 Move symbol reset detection code back into wi_reset. This is a more
reliable way to detect if the symbol cards have been reset or not.
This makes symbol cards work better.

Submitted by: deischen
2003-03-18 02:54:39 +00:00
Warner Losh
08d49adb7f Add DLINK DWL650H
From NetBSD by way of deischen
2003-03-18 02:47:53 +00:00
Warner Losh
7a073cc3e0 Add SMC 2602W pci card, from a post to mobile@ 2003-03-18 02:45:29 +00:00
Warner Losh
fabc845e37 Remove bogus KASSERT. The 802.11 layer and the resume from suspend
code both seem to call wi_start (directly or via the if_start pointer)
without checking to see if OACTIVE is 0.  In addition, I think that
with the use of 3 transmit buffers this routine can be called with
OACTIVE set, but I might be mistaken about that (and it doesn't
matter).

Reviewed by: sam
Noticed by: imp, alfred, ambrisko
2003-03-17 13:19:28 +00:00
Warner Losh
739804813b Remove bogus UNLOCK in if_wi.c. Since we no longer WILOCK() in the
attach routine, calling WIUNLOCK in the error case of one of the ifs
for that routine is now bogus.  This should have been removed when the
WILOCK() was removed, but wasn't.

Submitted by:  "Harti Brandt" <brandt@fokus.fraunhofer.de>
2003-03-11 17:13:33 +00:00
Sam Leffler
f1dacb5270 Change default setting of hw.wi.txerate to zero so that tx error msgs are
ignored (as before).  This was the original setting but a bug in ppsratecheck
made me do stupid things.
2003-02-26 17:18:35 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Takeshi Shibagaki
a544e1117c Add YIS YWL-11B. This card has same vendor id and product id
as XI300 Wireless LAN. So use PCMCIA_CARD2().
2003-02-15 13:59:54 +00:00
Warner Losh
1a972e076a Unlock the mutex in the error case in wi_init. Otherwise we can return
from an ioctl with the lock held.

Submitted by: iedowse (by way of sam)
2003-02-02 06:35:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Sam Leffler
2a363b8963 correct default setting of hw.wi.txerate; it must be -1, not zero,
to silence all msgs (like the old driver)
2003-01-20 21:06:58 +00:00
Sam Leffler
1c56cdce18 correct sysctl names and move them to hw.wi: hw.wi.txerate controls the rate
at which tx errors are printed (default to 0); hw.wi.debug control the debug
msgs and is only present when WI_DEBUG is defined at compile time (the default
for the moment)

Requested by:	imp
2003-01-20 20:55:37 +00:00
Sam Leffler
fa15ece030 gc dead code 2003-01-20 19:45:09 +00:00
Sam Leffler
c9def0f441 default tx error rate limiting to 0 to disable tx error msgs; this is
consistent with how the old driver worked
2003-01-20 00:50:36 +00:00
Takeshi Shibagaki
3f9970c831 Add Allied Telesis WR211PCM. 2003-01-17 18:41:32 +00:00
Warner Losh
e2fcd48525 Restore a comment that was lost in the shuffle. 2003-01-16 23:38:08 +00:00
Sam Leffler
11411c79c7 wi-specific host ap support no longer needed now that it uses
the core 802.11 code

Reviewed by:	imp
2003-01-15 20:12:50 +00:00
Sam Leffler
474b12ddf0 new wi driver that uses the 802.11 link layer code
Reviewed by:	imp
Obtained from:	NetBSD (originally)
2003-01-15 20:11:31 +00:00
Matthew N. Dodd
c94b6ebc27 Suspend/resume support (mostly for MiniPCI Prism2.5 boards).
Reviewed by:	 imp
2003-01-14 23:19:32 +00:00
Mike Barcroft
51afc2ad43 Avoid casting pointers to int and using %x to print them.
Noticed by:	alpha tinderbox
2003-01-05 16:23:49 +00:00
Robert Watson
dcce7232ef Require privilege to flush the signal cache on if_an and if_wi 802.11
cards.

Reviewed by:	imp (if_wi)
2002-12-24 14:46:01 +00:00
Sam Leffler
673d91916d network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets
  up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by:	many
Approved by:	re
2002-11-14 23:54:55 +00:00
Poul-Henning Kamp
031fd299d7 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 08:48:39 +00:00
Warner Losh
aa23e9c476 o Comment out the symbol download code for 4.x.
o Add hooks for doing power management of the output signal.
o Minor hacks to make flexlint happy wrt staticness of functions.
2002-10-14 01:59:57 +00:00
Warner Losh
5c71502dad Some renamings from pccarddevs
Add Linksys WCF11
Bay eMobility 11B
2002-10-11 07:02:31 +00:00
Warner Losh
82ddfdef07 Add Planex GWNS11H
Submitted by: hanai-san
2002-10-11 05:43:38 +00:00
Warner Losh
d909f3e20c Fix comment 2002-09-29 18:42:14 +00:00
Warner Losh
7f2907fd70 Limit the TX key to a valid range
PR: 39960, 39961 (patches here pointed out problem, but didn't quite fix it)
2002-09-29 18:40:35 +00:00
Warner Losh
34c947d8b6 When setting the WI_RID_ENCRYPTION mode, we have to conditionally
set EXCLUDE_UNENCRYPTED if we're not in OPEN mode (or if we are a
symbol card).

Obtained from: OpenBSD (looks like a millert@ special)
2002-08-21 05:57:37 +00:00
Warner Losh
87c397af5c comment about the magic number -149 2002-08-21 05:35:51 +00:00
Warner Losh
abc38e4485 Treat IBSS the same as ADHOC in wi_get_cur_ssid. This makes ifconfig
work better, but might not make ibss actually work on the prism2 cards
that I have (this is the first time I've tried ibss in a long time).
2002-08-21 05:31:04 +00:00
Warner Losh
6f6efa5165 Move the symbol firmware loading routines into if_wi.
Define some basic firmware downloading commands.
2002-08-15 07:13:17 +00:00
Warner Losh
6854d13abc Follow NetBSD's lead and use WI_PORTTYPE_HOSTAP instead of _AP, since
_AP might be used in the future for cards with firmware that does AP in
firmware.
2002-08-11 08:51:08 +00:00
Warner Losh
6edfb9d7cb Fix minor typo in ID number in last commit 2002-08-05 07:48:31 +00:00
Warner Losh
cb642e2945 A definition of regulatory domains that matches the docs. 2002-08-05 07:45:57 +00:00
Warner Losh
b04a43c87c Differentiate between AT45DB011 compatible large serial flash parts
and the AT24C08 small serial flash parts.  We still report these as
the same part (since we group things already), but now we recognize
the small serial versions as well.
2002-08-05 07:24:02 +00:00
Warner Losh
ae06c30e2b Add a comment that says it looks like lucent cards have a primary
firmware revision as well (not sure which firmware versions are needed
for this, but the 6.x and 8.x 'software' versions that I have seem to
support it).

Add dBm comm quality RID.  This is like the normal comm quality rid,
except the signal and noise numbers are normalized to dBm.  Some
revisions of the prism firmware, however, don't support this RID, and
some that do support it return 0 for quality and/or noise.  Your
milage may vary.
2002-08-05 07:19:27 +00:00
Warner Losh
073eef8ca2 Add code that will download firmware to a Symbol LA4100-series of CF
cards.  Since the firmware is hard coded into the kernel, I've made it
a kernel option (WI_SYMBOL_FIRMWARE).

Note: This only downloads into the RAM of these cards.  It doesn't
download into FLASH, and is somewhat limited.  There needs to be a
better way to deal, but this works for now.  My Symbol LA4132 CF card
works now.

Obtained from: NetBSD
2002-08-03 00:19:58 +00:00
Warner Losh
3d976872ed Don't set the IFF_PROMISC bit when in hostap mode like the previous
commit bogusly did.  Instead, don't set PROMSIC in the hardware if
we're in hostap mode.  This matches more closely what openbsd did as
well.
2002-08-01 07:37:52 +00:00
Warner Losh
08c0f3d917 If we are in hostap mode, do not go into promisc mode. This causes
problems with the firmware and will result in a) poor performance and
b) the inability to associate certain types of cards (most notibly
cisco).

Idea obtained from OpenBSD, but I implemented it by clearing the
IFF_PROMISC flag rather than the refusing to honor it downstream.
2002-07-29 15:36:22 +00:00
Warner Losh
ffd283ae15 Send a disassoc packet for a STA that we don't know about that claims to
be associated with us.  From millert@openbsd.org

Obtained from: OpenBSD (I think)
2002-07-26 22:56:04 +00:00
Warner Losh
bec60c0fd8 Only INTERSIL 0.8.3 and newer firmware is supported with hostap mode.
While earlier versions can be made to work, they require various work
arounds not in the driver right now.
2002-07-26 22:54:30 +00:00
Warner Losh
fc7b12d6fc Add support for Elsa XI325, Netgear MA401RA, and Nokia C110. From OpenBSD
by various people there.
2002-07-17 04:07:07 +00:00
Warner Losh
f83c4a42ea IF_HANDOFF is no longer in -stable 2002-06-30 22:39:25 +00:00
Warner Losh
be5359fb85 On REASREQ packets, handled them earlier in processing the association
request.  We need to eat the MAC address of the packet before we go
looking at the SSID and such.  Doing do is sufficient to make Cisco
cards assocaite with prism II cards.

The submitter says that Linux does the same thing.

Submitted by: jhay
2002-06-24 07:50:41 +00:00
Warner Losh
586fdde4bc Add kernel printf bits for WI_SUPPRATES and HOSTAP_FLAGS 2002-06-24 04:42:46 +00:00
Warner Losh
890565f00b Add RID to get the DBM adjustment factor 2002-06-24 04:41:34 +00:00
Warner Losh
d5ca4da61e Add better mediaopt support for ibss and friends.
Now the driver is closer to matching the wi man page.

Submitted by: jhay (who obtained it from OpenBSD).
2002-06-19 17:37:34 +00:00
Nick Sayer
dc957e3d2b Add an entry for the US Robotics 2415.
PR:		i386/38879
Submitted by:	jordi_yc@lycos.es
MFC after:	1 week
2002-06-14 15:32:01 +00:00
Poul-Henning Kamp
f4258597dc Add one copy of crc32() and crc32_tab[] in libkern, and remove it two other
places.

Comment out crc32 related definitions in zlib.h, we don't seem to have the
corresponding code in our kernel.
2002-05-29 20:24:09 +00:00
Bruce Evans
e788f79698 Fixed printf format errors which apparently crept in while -Wformat was
disabled for gcc-3.
2002-05-25 11:18:03 +00:00
Warner Losh
3029e334b7 Use correct inactivity timeout of 2 minutes rather than 24 seconds due to
bogons introduced at some point.

Submitted by: thomas skibo
2002-05-20 19:33:49 +00:00
Warner Losh
5b6a60ea0a Use splnet() when we need to block timeouts rather than splimp() since
the former blocks software interrupts, while the latter blocks
hardware interrupts.

Avoid one place where I'm at splnet across a call to copyout.  Leave
one in place to give bde something to complain about :-).  Actaully,
I'll fix it in a subsequent commit.

Reviewed by: bde
spl conical hat to: imp
2002-05-16 06:32:37 +00:00
Warner Losh
e9f49c9c96 BDE and I have had a chance to hash this out:
o Use splnet() instead of splclock().
o Use splnet() instead of splimp().

Reviewed by: bde
2002-05-13 21:17:33 +00:00
Warner Losh
d87fc9ac63 Try to use spls more correctly 2002-05-07 18:09:19 +00:00
Warner Losh
883ee9463e skibo tells me that that I didn't apply all of his last patch, and
sent me a replacement patch that fixes the problem.  The challenge
buffer was not large enough by a factor of 4 (due to my changing the
size from 128 to 32, but not u_int8_t to u_int32_t).

MFC after: 1 day
Submitted by: skibo@pacbell.net
2002-04-30 03:46:27 +00:00
Warner Losh
0f98688eb0 We don't need the card_if.h here. It breaks the building of kernels
with wi but without pccard.  Also remove an RCS id that I don't think
we need.
2002-04-29 21:11:02 +00:00
Warner Losh
1456297748 splsoftnet is spelled splimp in FreeBSD rather than splnet. splimp is
used to protect the rest of the driver.  This is a no-op commit to current,
but is needed for the MFC.

MFC after: 1 day
2002-04-29 19:04:29 +00:00
Warner Losh
8ad896e0ad Untimeout before calling timeout. I think that I have caught all the cases
where we were scheduling a timeout multiple times, but am not positive.
2002-04-29 06:55:46 +00:00
Warner Losh
9218b6a376 Alphabetize descriptions and remove the "PCI" from the desciptions.
Suggested by: brooks
2002-04-28 02:04:28 +00:00
Warner Losh
cd5a4c63c7 This patch fixes my breakage of ssid matching. I introduced the
breakage when I tried to merge OpenBSD wi_hostap changes into the
tree.  Skibo found the problem and submitted these patches.  Thanks!

Submitted by: skibo@pacbell.net
2002-04-27 16:03:25 +00:00
Warner Losh
0853849336 Better names for the PCI cards. The biggest change is that we now
identify the Intersil Prism 2.5 PCI native card as that, rather than
Linksys, the first folks to get it to market.
2002-04-27 16:01:26 +00:00
Warner Losh
3465a702f3 Make this driver compile for -stable also to prep for MFC 2002-04-26 23:11:23 +00:00
Mike Barcroft
a30d4b3270 Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>.  This puts us in line with NetBSD and OpenBSD.
2002-04-26 22:48:23 +00:00
Warner Losh
632754e510 Implement shared secret mode for hostap mode.
Submitted by: Thomas Skibo <skibo@pacbell.net>
2002-04-22 07:09:13 +00:00
Atsushi Onoe
60f514a9a7 Some fixes for Symbol card.
- The version string doesn't need to start with 'V'.
- Symbol firmware doesn't support ROAMING_MODE nor MICROWAVE_OPEN.
Obtained from: NetBSD
2002-04-19 08:16:59 +00:00
Warner Losh
93ca0d0cfb Merge from OpenBSD's fixes:
o move timeout from wihap_info to wihap_sta_info
o sprinkle spls into the code (need to use proper -current locking)
o better use of le16toh and htole16
o fix a few leaks m_freem(m)
o minor knf
o minor de-knf to match OpenBSD
o de__P
2002-04-16 07:45:30 +00:00
Warner Losh
c8e6c42caa Minor format nit 2002-04-16 07:39:25 +00:00
Brooks Davis
39606b2e27 Fix tx-rate setting for Lucent cards.
Submitted by:	Eugene Perevyazko <john@pcs.dp.ua>
2002-04-14 23:18:40 +00:00