Commit Graph

54 Commits

Author SHA1 Message Date
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Doug Ambrisko
50b09b375f Fix panic from having multiple locks held when updating firmware. AN_LOCK
was asserted during a tsleep resulting in a panic in tsleep.
2003-08-20 05:52:48 +00:00
Doug Ambrisko
e8ef0c2923 - Add support for Cisco latest firmware RID sizes that supports 25 SSIDs!
- Fix up TX speed changes.
- Make mpi-350 cards sort-of work with new firmware.  It RXs okay but TXs
  only work for about 14 packets then fails to get an interrupt.  The
  TX watchdog fires.  It has been reported that my hack for now doesn't
  break cards with the older firmware.  It appears my card has lost
  the ability to RX or TX at all but other peoples cards work.  I assume
  it got damaged in tansport.

MFC:	1 week.
2003-08-20 03:46:05 +00:00
Sam Leffler
2c71d3c795 update for new 802.11 support 2003-06-28 06:17:26 +00:00
Poul-Henning Kamp
b3c481ae1a Remove break after return.
Add XXX comment where intent is unclear.

Found by:	FlexeLint
2003-06-01 09:27:33 +00:00
Warner Losh
5414629575 Don't lock in the attach routine. It isn't required. Register the
interrupt handler last.  This gets rid of the sleep while locked
messages.

Reviewed by: ambrisko
2003-04-10 05:12:45 +00:00
David E. O'Brien
8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +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
Doug Ambrisko
b376d47740 - Fixes for suspend/resume code (MPI-350)
- Cache temp. keys so they are preserved across suspend/resume (MPI-350)
- Reads and writes are real fast to the MPI-350 causing early timeouts so
  wait do some DELAYs to slow things down in the spin loops.
- Stream line setting RIDs when they are better to be set via another
  function
- Add better support for setting home key via "ifconfig an0 wepkey 9:<key>"

Tested by:	Peter Radcliffe <pir@pir.net> (in -stable)
		myself in -current & -stable
MFC in:		3 days
2003-02-08 04:41:17 +00:00
Doug Ambrisko
01de2955e4 Support for suspend/resume in laptops. Loosely based on the wi(4) patches
but not quite.  The memory descriptors and most of the card parameters
need to be writen to the card.

MFC in:		3 days
2003-02-05 03:37:42 +00:00
Doug Ambrisko
e61838b128 Some small enhancments
-	Implement TX power control with hints to code in Linux driver
	by Douglas S. J. De Couto <decouto@lcs.mit.edu>
      -	Update ifmedia support to use ieee80211_rate2media and
	ieee80211_media2rate.  Note doesn't work with stock ifconfig
	since there seems to be an issue with the setmedia code.
	"ancontrol -t" works now, before it did nothing.
      -	Fix spelling error in header.
2003-02-02 22:49:31 +00:00
Doug Ambrisko
0738490650 Fix some style and incorrect indentation level bugs.
Questioned by:	phk (for the indentation problem)
2003-01-30 15:01:17 +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
Doug Ambrisko
6cafe2646a Add support for MPI-350 the mini-pci Cisco Aironet card. This needs more
work.  The interface was gleaned from the Linux driver.  Currently only
one RX & one TX buffer are used.  Firmware support is not tested so for the
MPI-350 so it is disabled.  Signal cache and monitor mode are not supported
yet.  Signal cache is not supported since in encapsulation mode ethernet
frames are returned by the chip.  LAN monitor mode support will be added
shortly.  Thanks to Warner for the MPI-350 card he sent me.

Add support for RSSI map from PR kern/32880 which was incomplete.  Enhanced
with the ability to select the cache mode of raw, dbm or per-cent.

Clean up Signal/Noise/Quality structures and units with help from
Marco Molteni.

Change flash to use a malloc'ed buffer when needed.

PR:		kern/32880
Submitted by:	Douglas S. J. De Couto decouto@pdos.lcs.mit.edu,
		Marco Molteni
MFC:		3 weeks
2002-12-29 19:22:07 +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
John Baldwin
fee174cd9c Fix warning where sizeof(size_t) != sizeof(int). 2002-11-06 18:55:24 +00:00
Poul-Henning Kamp
37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Bill Fenner
11ae409d07 Fix location and name of if_an_pci.c in comment. 2002-07-27 21:28:40 +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
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
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Doug Ambrisko
4359c3e645 Only allow super user to perform the Linux compatible ioctls since some
of the things they do, shouldn't be done by normal users.

MFC after:	2 days
2002-03-14 20:56:41 +00:00
Doug Ambrisko
c9977aaadf In ad-hoc mode, the "associate" bit is valid to check to see if it is
part of an ad-hoc network.  This means another station needs to be
around so they can both associate.

MFC after:	1 week
2002-02-26 05:43:05 +00:00
Brooks Davis
d24991caa8 Add missing m_free() so we actually drain the send buffer in monitor mode.
Submitted by:	Kenjiro Cho <kjc@csl.sony.co.jp>
2002-02-20 18:23:59 +00:00
Mike Smith
fe5d4a9fac Staticise the flash buffer, since it isn't needed anywhere else. 2002-01-08 10:25:12 +00:00
Doug Ambrisko
9598826172 Save stack space by converting areq in sc->areq.
Reviewed by:	Brooks Davis <brooks@freebsd.org>
		Warner Losh <imp@freebsd.org>
Approved by:	Brooks Davis <brooks@freebsd.org>
		Warner Losh <imp@freebsd.org>
2001-12-31 22:12:42 +00:00
Doug Ambrisko
0d6fcb5c0e Fix bugs in the structure for rx_frame by making gap length one byte and
a packed array so sizeof work.  This broke RFMON mode and passing
up 802.11 packets.

The Linux emulation code was derived from the open source Linux driver to
maintain compatibility.

LEAP support is added, hints from Richard Johnson.  I've verified this
locally with PC350v42510.img firmware.  More bug fixing from Marco to
fix long passwords.

Change DELAYs in flash part of driver to FLASH_DELAY which uses tsleep
so it doesn't look like your system died during a flash update.

Install header files in /usr/include/dev/an

Cleanup some ifmedia bugs add "Home" key mode to ifmedia and ancontrol.
This way you can manage 2 keys a little easier.  Map the home mode into
key 5.  Enhance ifconfig to dump the various configured SSIDs.  I use
a bunch of different ones and roam between them.  Use the syntax similar
to the WEP keys to deal with setting difference SSIDs.

Bump up up the Card capabilities RID since they added 2 bytes to it
in the latest firmware.  Thankfully we changed it from a terminal
failure so the card still worked but the driver whined.

Some cleanup patches from Marco Molteni.

Submitted by:	Richard Johnson <raj@cisco.com>
		Marco Molteni <molter@tin.it>
		and myself
Various checks: David Wolfskill <david@catwhisker.org>
Reviewed by:	Brooks Davis <brooks@freebsd.org>
		Warner Losh <imp@freebsd.org>
Approved by:	Brooks Davis <brooks@freebsd.org>
		Warner Losh <imp@freebsd.org>
Obtained from:	Linux emulation API's from Aironet driver.
2001-12-31 22:01:44 +00:00
Warner Losh
5e9d03c8be Fix comments about 'current' state of hardware/software 2001-11-15 06:17:05 +00:00
Poul-Henning Kamp
dcee186b33 fix typo.
PR:		31898
Submitted by:	Michael Lyngbøl <lyngbol@bifrost.lyngbol.dk>
2001-11-11 11:20:09 +00:00
John Baldwin
7106ca0d1a Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Brooks Davis
a744995d49 Lots of style(9) related white space fixes. Mostly missing spaces
after if, for, while, switch, '{', and '}' plus a bunch of bogus
whitespace at the end of lines.
2001-09-10 02:36:18 +00:00
Brooks Davis
51331cf32a Add support for monitor mode. This means that after enabling the
correct mode via ancontrol, you can use bpf to sniff raw 802.11 frames.
Who want's to port AirSnort. ;-)

Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com> (author)
		David Wolfskill <david@catwhisker.org> (port to current)
2001-09-10 02:05:10 +00:00
Jonathan Lemon
f9132cebdc Wrap array accesses in macros, which also happen to be lvalues:
ifnet_addrs[i - 1]  -> ifaddr_byindex(i)
        ifindex2ifnet[i]    -> ifnet_byindex(i)

This is intended to ease the conversion to SMPng.
2001-09-06 02:40:43 +00:00
Brooks Davis
1d3771386f Fix a number of bugs in the implementation of the WEP related status
functions in ifconfig.  "ifconfig an0" should output the correct
status now.  Also, make the read and write functions both more
robust and more consistant.  This should stop most of the incorrect
size complaints and eliminate the possiability of panics from firmware
that increases resource sizes.

PR:		kern/27826
Reviewed by:	imp, jlemon
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
		David Wolfskill <dhw@whistle.com>
2001-06-22 23:35:24 +00:00
Peter Wemm
70d73137b9 Fix warnings:
1831: warning: unused variable `noise'
1831: warning: unused variable `sig'
2001-06-15 00:10:30 +00:00
Poul-Henning Kamp
419d8080a4 Currently, each wireless networking driver has it's own control program
despite the fact that most people want to set exactly the same settings
regardless of which card they have.  It has been repeatidly suggested
that this configuration should be done via ifconfig.  This patch
implements the required functionality in ifconfig and add support to the
wi and an drivers.  It also provides partial, untested support for the
awi driver.

PR:		25577
Submitted by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-05-26 09:27:08 +00:00
Archie Cobbs
53046c5fd5 A few fixes..
1 Make promiscuous mode work
    2 A few header additions
    3 Allow device config before IFF_UP

These were (respectively)...

Submitted by:	Allan Saddi <asaddi@philosophysw.com>
Submitted by:	Dave Cornejo <dave@dogwood.com>
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
Tested by:	David Wolfskill <dhw@whistle.com>
2001-03-23 17:46:32 +00:00
Assar Westerlund
e4b3e35ff0 change the default mode from adhoc to bss (infrastructure)
Reviewed by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-03-12 06:13:39 +00:00
Bosko Milekic
08812b3925 Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb
2001-01-19 01:59:14 +00:00
Alfred Perlstein
82625cf321 remove unneded sys/ucred.h includes 2000-11-30 18:52:32 +00:00
Bill Paul
a614c4dc7b Close PR# 21843 and PR# 21864. This adds support for WEP and updates some
of the data structures to include new members that weren't defined in the
manual I have.

I opted to use Doug Ambrisko's WEP patches since David Cornejo's patches
did not include the necessary changes to ancontrol(8) to actually enable
and use WEP.

NOTE: I don't currently have access to an Aironet card, so I can't test
any of this. Everything compiles and close scrutiny doesn't reveal any
obvious problems, but Murphy's Law applies. This means I will probably
leave these changes in -current for a bit longer than usual until I'm
sure they work right.
2000-11-13 23:04:16 +00:00
Poul-Henning Kamp
cf9fa8e725 Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.
2000-10-29 16:06:56 +00:00
John Baldwin
35e0e5b311 Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h
2000-10-20 07:58:15 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Bill Paul
736f03e49a Convert the Aironet driver to use mutexes instead of spls. 2000-10-13 21:58:36 +00:00
Peter Wemm
3dd0dbfeb9 MF4: fix style(9) whitespace breakage. 2000-08-08 23:53:11 +00:00
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
dac3275057 - Add suser check before SIOCSAIRONET.
- Fix a splimp() w/o splx bug in the ioctl routine while I'm here.

Submitted by:	Aaron Campbell <aaron@openbsd.org>
2000-06-18 23:40:09 +00:00