Commit Graph

353 Commits

Author SHA1 Message Date
christos
c2ec58382b - use ether_snprintf() so that we don't overwrite our buffer for printing
ethernet-like addresses
- make this compile againw without IEEE80211_DEBUG.
2016-09-27 20:20:06 +00:00
mlelstv
faca41fb2b Merge enough FreeBSD code to make RT5592 work. 2016-09-16 09:25:30 +00:00
msaitoh
8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
ozaki-r
bdb88f5405 Get rid of invalid KASSERT
The mbuf being checked is allocated in ieee80211_getmgtframe just above,
so checking NULL of its CTX is meaningless.

Pointed out by mlelstv@
2016-06-20 08:57:18 +00:00
knakahara
69c0ff04b9 apply if_start_lock() to L2 callers which call ifp->if_start() of device derivers 2016-06-20 08:30:58 +00:00
ozaki-r
cef59834c4 Use M_GETCTX and M_SETCTX instead of open-coding rcvif
No functional change.
2016-05-16 09:53:59 +00:00
mlelstv
f3c013cf09 In station mode filter packets that or not for us in case the
interface is in promiscous mode or doesn't filter packets itself.
2016-05-14 13:35:40 +00:00
mlelstv
28f11d6152 Don't check sequence number on multicast packets in station mode.
Handle overflow of 12bit sequence number.
2016-05-07 12:36:50 +00:00
christos
7da1320f48 Add 80211n ht frame. 2016-04-27 20:17:00 +00:00
knakahara
b76ec0b083 IFQ_ENQUEUE refactor (3/3) : eliminate pktattr argument from IFQ_ENQUEUE caller 2016-04-20 09:01:03 +00:00
knakahara
40b1061c07 IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
roy
111ee86de4 Revert prior. 2016-04-08 14:30:47 +00:00
roy
50101ec8fb ieee80211 users in Other OS export rssi and noise as int8_t.
We should not be the odd one out for no good reason and the majority
of the ieee80211 drivers treat rssi as int8_t.
2016-04-06 14:42:16 +00:00
ozaki-r
9c4cd06355 Introduce softint-based if_input
This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
2016-02-09 08:32:07 +00:00
dholland
1fbab01a93 More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-09-06 06:00:59 +00:00
pooka
1c4a50f192 sprinkle _KERNEL_OPT 2015-08-24 22:21:26 +00:00
pooka
76622945bf + include opt_inet.h for INET (or lack thereof)
+ include net/in_ether.h, not netinet/in_ether.h
  (did not cause a meltdown only because opt_inet.h was missing)
2015-08-24 20:58:47 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
pooka
3eab37f7f1 Use module-compatible sysctl init instead of link sets. 2014-04-07 00:07:40 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
christos
db0adb91e5 fix monitor mode channel. 2014-01-25 00:59:44 +00:00
joerg
7a17852c4d GC unused functions. Don't bother building ieee80211_acl.c, nothing in
it is non-static.
2013-09-13 20:19:53 +00:00
martin
2dd911aefa Fix return value of ieee80211_ioctl_setoptie 2013-09-12 20:44:02 +00:00
christos
45ab582ccf - add m_add() that puts an mbuf to end of a chain
- m_append() and m_align() with their family
- remove parameters from prototypes
2013-06-27 17:47:18 +00:00
christos
bf2739ea2c Putting extra l's in align does not make it more so. 2013-03-30 19:03:02 +00:00
christos
1f60acb650 remove trailing whitespace 2013-03-30 15:12:28 +00:00
christos
f3de05fd08 Use only one set of EDCA variables 2013-03-30 14:14:30 +00:00
christos
dfe8e3b0ad remove obsolete macro 2013-03-30 03:25:47 +00:00
christos
db8452b16f remove trailing space 2013-03-30 03:24:55 +00:00
christos
9cea3c23f4 remove trailing whitespace. 2013-03-30 01:06:37 +00:00
christos
393b6a6372 EDCA and QOS additions from OpenBSD 2013-03-30 01:05:48 +00:00
christos
65b3d068f8 one we is enough. 2013-03-29 02:30:18 +00:00
christos
f3b59d51b8 Don't hold 2 locks at the same time, causes lockdebug panic. Triggered by
running usb wifi interfaces as access points. What we do instead is check
the generation number upon restart, and if it changed we give up.
2013-03-29 02:26:45 +00:00
christos
8cd59a9591 trailing blanks police. 2013-03-29 02:20:17 +00:00
christos
8e7c71cac9 Instead of always checking for ANYC, make it a valid channel 2013-03-21 18:30:09 +00:00
christos
23b988d718 Don't attempt to dereference ANYC (since it is a pointer to 0x1).
Fixes random crashes in hostap mode (race conditions in the interrupt handler
while the interface comes up or down).
2013-03-21 17:10:25 +00:00
christos
ef99903991 don't print the interface name 2ice. 2013-02-04 15:44:45 +00:00
christos
9782767422 The IEEE80211_F_ flag prefix was used for both the flags in ieee80211_var.h
and for the rates in ieee80211_proto.h; rename the rate bits as _R_ to avoid
confusion.
2013-01-10 17:40:10 +00:00
matt
5523aadff2 Set max_linkhdr when attaching so when bridging/forwarding ethernet drivers
have a chance to reserve enough space to insert a max-sized 802.11 header.
2012-11-14 18:34:05 +00:00
christos
4b1f2b81a3 add more QoS bits 2012-08-20 07:30:10 +00:00
dsl
e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
christos
42c420856f - fix offsetof usage, and redundant defines
- kill pointer casts to 0
2011-12-31 20:41:58 +00:00
tls
3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
dyoung
2ed4138b61 Use atomic_ops(3) to increase/decrease node reference counts, just
like the upstream code did, because the current reference counting is
potentially racy.  This works fine in light testing.
2011-10-07 16:51:45 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
christos
6793b1da06 Change i_len in ieee80211req to be unsigned and fix other signed/unsigned
issues. From Dan Rosenberg (drosenberg at vsecurity dot com).
2011-06-12 00:07:19 +00:00
drochner
4bd7f95161 -remove references to crypto/arc4/arc4.* -- the code isn't used
anywhere afaics
 (The confusion comes probably from use of arc4random() at various places,
  but this lives in libkern and doesn't share code with the former.)
-g/c non-implementation of arc4 encryption in swcrypto(4)
-remove special casing of ARC4 in crypto(4) -- the point is that it
 doesn't use an IV, and this fact is made explicit by the new "ivsize"
 property of xforms
2011-05-23 15:37:35 +00:00
drochner
786f64be87 make michael_mic() robust against degenerate mbuf layouts like
odd sizes in the middle of a chain
2011-04-03 10:04:32 +00:00
mbalmer
1571556be6 Fix misplaced parenthesis. From henning.petersen@t-online.de, thanks. 2011-04-02 08:11:31 +00:00
tron
89953a5ba8 Remove duplicate definitions which break the build. 2011-02-25 10:45:57 +00:00