Commit Graph

235 Commits

Author SHA1 Message Date
Robert Watson
13f4c340ae Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags.  Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags.  This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by:	pjd, bz
MFC after:	7 days
2005-08-09 10:20:02 +00:00
Sam Leffler
d365f9c760 Cleanup beacon/listen interval handling:
o separate configured beacon interval from listen interval; this
  avoids potential use of one value for the other (e.g. setting
  powersavesleep to 0 clobbers the beacon interval used in hostap
  or ibss mode)
o bounds check the beacon interval received in probe response and
  beacon frames and drop frames with bogus settings; not clear
  if we should instead clamp the value as any alteration would
  result in mismatched sta+ap configuration and probably be more
  confusing (don't want to log to the console but perhaps ok with
  rate limiting)
o while here up max beacon interval to reflect WiFi standard

Noticed by:	Martin <nakal@nurfuerspam.de>
MFC after:	1 week
2005-08-08 03:30:57 +00:00
Warner Losh
584d11ee54 When the MAC address is reported all zeros, then error is necessarily
0.  This means that we 'succeed' the attach, even after we've freed
the internal data bits.  This leads to a panic when you eject the card
with this problem.

Set error = ENXIO in the mac read zeros case.
2005-08-05 04:56:14 +00:00
Robert Watson
13b203d0d7 Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.

Problem reported by:	Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after:		1 week
2005-08-03 00:18:35 +00:00
Sam Leffler
2c39b32c94 diff reduction against p4: define IEEE80211_FIXED_RATE_NONE and use
it instead of -1
2005-07-22 16:50:18 +00:00
Brooks Davis
fc74a9f93a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
Tai-hwa Liang
566c1555c6 Honouring current authmode setting. With this patch, my wi card can now
associate to an AP which uses shared WEP key authentication.

Tested with:	"ifconfig wi0 authmode shared"
Reviewed by:	imp, sam
2005-06-02 01:51:16 +00:00
Matthew N. Dodd
71ba49aa94 Invert conditional and use continue to reduce nesting. 2005-04-13 03:36:24 +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
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
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
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
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
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
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
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
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
7988ce93e8 Minor tweaks that are effectively all style tweaks. 2003-06-11 16:51:27 +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
81f290a510 Fix interrupt race.
From NetBSD
2003-04-10 07:55:55 +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
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
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
Warner Losh
e2fcd48525 Restore a comment that was lost in the shuffle. 2003-01-16 23:38:08 +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
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
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
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
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
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
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
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
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
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
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
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
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
Warner Losh
fafbd94d8d After committing the forgotten IFM_IEEE80211_HOSTAP stuff to if_media.h,
no need for the ifdefs here anymore.
2002-04-12 06:12:21 +00:00
Warner Losh
b0152b2e40 unifdef -DWI_HOSTAP, like OpenBSD does 2002-04-12 06:01:28 +00:00
Alfred Perlstein
7344c0a194 ifdef WI_HOSTAP some stuff that seems like it needs to be ifdef'd. 2002-04-12 05:46:36 +00:00
Warner Losh
e122b676e6 Replace the original host WEP implementation with the one in OpenBSD
(apparently by markus@, at least committed by him).  This has the
advantage of not using the bad IV's from Fluhrer/Mantin/Shamir as well
as bringing the drivers a little closer together.

Also use a few constants in place of magic numbers in one place.

Obtained from: OpenBSD 1.25, 1.28, 1.36, 1.38, 1.42
2002-04-12 03:42:37 +00:00
Warner Losh
1bd2b5b4cd Integrate the hostap stuff that Thomas Skibo <skibo@packbell.net>
wrote.  This code was for 4.5-release, so I've ported it to -current
and made a few minor tweaks.  The biggest non-style tweak was to not
make access point the default.

More changes will be needed to get this actually working, but I wanted
to get a relatively pure baseline.  This doesn't seem to break what
works now.
2002-04-11 07:21:16 +00:00
Warner Losh
ea185f8108 better init 2002-04-11 03:31:45 +00:00
Warner Losh
15ffbeb81d MFNetBSD:
1.60: Add range checking, but put it higher up in the food
	chain than NetBSD (this should be fixed there as well).

Obtained From: NetBSD
2002-04-04 22:22:31 +00:00
Warner Losh
dfdbc0533d MFNetBSD:
wi.c 1.64: Table driven IDs (ichiro)
	1.59: Don't use magic numbers (ichiro)
Also, added Sony, Lucent Embedded Ids and fix minor bugs for lucent
cards (and submit those changes back to ichiro-san)

Obtained from: NetBSD
2002-04-04 21:40:37 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Warner Losh
276bdee1b5 o Reduce the gratuitous differences with NetBSD.
o OpenBSD's wiconfig tells me that a value of '2' is for sony wireless
  cards, 1 is for lucent (which we already knew) and '5' is for embedded
  lucent cards.
o Move some RID definitions to if_wavelan_ieee.h and use NetBSD names
  more often.

# more work is still needed in this area.
2002-04-04 06:28:16 +00:00
Warner Losh
a19c104dd2 Four fixes from NetBSD:
1) Properly detect the Symbol based cards (The 3Com Airconnect and their
   ilk) and only reset them *ONCE* ever.  This appears to make them work,
   but more testing is needed.  The tests that would wedge up my machine
   completely now appear to work, but I have not real access points
   handy.
2) Report both the Station firmware and the Primary firmware on Prism
   based cards.  On Lucent based cards, only report the station firmware
   since that's all it supports.  On symbol cards, report the symbol
   specific firmware name as its station firmware.
3) Better Prism 2.5 and 3 family names.  We really need to go table
   driven for this.
4) Workaround for bugs in Intersil's firmware is only needed for at most
   0.8.2 and earlier, since 0.8.3 and later appear to work.

Obtained from: NetBSD
2002-04-03 19:44:17 +00:00
Warner Losh
dbab04ca39 First cut at breaking out the bus attachment from the bus independent
part of the driver.  Also, move the softc and some other stuff to
if_wivar.h from if_wireg.h to make future merging activities easier.
2002-04-02 02:38:35 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
Warner Losh
8fcb428045 More diff reduction patches 2002-04-01 18:52:53 +00:00