Commit Graph

197 Commits

Author SHA1 Message Date
Adrian Chadd
efccc3c60c Fix pause scan time calculation (the remainder must be less than beacon interval).
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 23:03:06 +00:00
Adrian Chadd
42946b7dbc Fix active/passive dwell calculation.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:56:36 +00:00
Adrian Chadd
3289bbc9e3 Turn off led when leaving RUN state.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:55:06 +00:00
Adrian Chadd
3d9089a6f1 Add TX status codes (obtained from iwlegacy)
PR:		kern/197143
Differential Revision:	Andriy Voskoboinyk <s3erios@gmail.com>
Obtained from:	Linux drivers/net/wireless/iwlegacy
2015-05-03 22:49:47 +00:00
Adrian Chadd
b3cd88da75 Move radiooff_task to the internal taskqueue.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:47:06 +00:00
Adrian Chadd
e948ddb6d1 Use another workaround for scanning.
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:43:45 +00:00
Adrian Chadd
621f1a7594 Add wpi_check_bss_filter()
PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:34:32 +00:00
Adrian Chadd
205cb272ea Fix KASSERT statements in if_wpi_debug.h
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:32:45 +00:00
Adrian Chadd
b625a56aae Remove workaround for bug 199676.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:30:11 +00:00
Adrian Chadd
6b997e0c7d Add a few local variables to improve readability.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:13:55 +00:00
Adrian Chadd
2ead385419 Remove this; it's currently a no-op.
History note: it's good to document what the driver expects like this even
if it's currently a no-op.

Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 22:10:28 +00:00
Adrian Chadd
30b6048179 Retry twice at the same rate.
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-05-03 20:56:33 +00:00
Adrian Chadd
02d4991526 Do not access peripheral before clock stabilization.
Tested:

* Intel 3945ABG NIC, STA mode

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-04-09 04:56:24 +00:00
Adrian Chadd
655e8ba806 Fix buffer overflow introduced in previous commits (unbreaks 802.11a capable NICs).
Tested:

* PCIe Intel 3945ABG NIC

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-04-09 04:51:39 +00:00
Konstantin Belousov
69a2ec4a19 Fix build with clang 3.6, silence -Wcast-qual warning.
Sponsored by:	The FreeBSD Foundation
Acked by:	adrian
2015-03-15 23:05:36 +00:00
Adrian Chadd
e2ad437112 Add a new taskqueue (device specific, not net80211 ic->tq); use it for
device restart.

(Committers note - once scan overhaul and a few other things have been
fixed in net80211 to not block things in the taskqueue, this can disappear
and the device specific taskqueues in other drivers can also go away.)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:32:11 +00:00
Adrian Chadd
a5403e3157 Workaround delays caused by vmem_check().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:30:20 +00:00
Adrian Chadd
2e79e29307 Fix scan timeouts with powersave enabled.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:29:36 +00:00
Adrian Chadd
fd06b53774 Don't unlock mutex in interrupt thread (except for wpi_rx_done() - for now) -
fixes various races between wpi_notif_intr() and wpi_stop_locked().

(attachment 154381)

Committers note: yes, unlock/if_input/lock has to go away, but that'll
have to be done later.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:29:18 +00:00
Adrian Chadd
062c813943 Reformatting changes.
(attachment 154380)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:27:50 +00:00
Adrian Chadd
b52207dbd2 Use correct types
(attachment 154379)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:27:03 +00:00
Adrian Chadd
5effcbfd6c Add another lock for the TX path.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:26:22 +00:00
Adrian Chadd
fc5870b418 Add an extra mutex for qfullmsk / ring->queued variables.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:25:06 +00:00
Adrian Chadd
a6b6ca52c6 Regroup ring state checks in wpi_tx_done().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:24:11 +00:00
Adrian Chadd
84ad7b3667 Don't use sc->qfullmsk in wpi_start().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:23:45 +00:00
Adrian Chadd
d74e544a1d turn sc_tx_timeout into its own callout, rather than a global watchdog
timer.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:22:03 +00:00
Adrian Chadd
446685e49c Add mutex for RXON structure; convert some callouts/lock use to use
RXON rather than the global WPI lock.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:20:58 +00:00
Adrian Chadd
9e7aab73cd Use WPI_FILTER_BSS for checking current state.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:19:52 +00:00
Adrian Chadd
0bc39fc6f8 Split TX and scan timeouts; use a callout now for the scan timeout.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:19:15 +00:00
Adrian Chadd
726ddc2648 Add experimental HOSTAP support.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:18:18 +00:00
Adrian Chadd
8483c8c339 Merge wpi_start() and wpi_start_locked().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:17:58 +00:00
Adrian Chadd
7d4ee533d4 Minor optimisation in wpi_limit_dwell()
PR:		kenr/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:17:03 +00:00
Adrian Chadd
cfe9b1ceb2 Rearrange checks in wpi_send_rxon().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:12:57 +00:00
Adrian Chadd
cec45f0495 Fix some printfs(); add some debugging.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:12:05 +00:00
Adrian Chadd
39060fa992 Add more KASSERTs.
(Committer note: these checks will have to be re-established in a future
commit as /well/ as having the KASSERTs.)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:11:00 +00:00
Adrian Chadd
0b90e84501 Disable powersave in IBSS mode (packet loss > 90%.)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:09:29 +00:00
Adrian Chadd
e49a7038fc Do some cleanup before device startup.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:08:54 +00:00
Adrian Chadd
b9858d864a Acquire ifq lock when checking / modifying IFF_DRV_OACTIVE flag.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:08:24 +00:00
Adrian Chadd
77cf0b82c2 Merge wpi_init() and wpi_init_locked().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:07:43 +00:00
Adrian Chadd
5ca7739522 Refactor wpi_ioctl().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:06:36 +00:00
Adrian Chadd
0528191a1a Add WPI_DEBUG_NODE + some debugging.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:05:59 +00:00
Adrian Chadd
a6df6cfe65 * Add new debug category
* Refactor out / restructure / extend debugging information

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:04:55 +00:00
Adrian Chadd
32e4f2f7e9 Remove unrelated comment.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:03:48 +00:00
Adrian Chadd
419435b847 Remove unnecessary assignment.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 21:02:59 +00:00
Adrian Chadd
7b52621191 Remove unnecessary debug output.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:55:23 +00:00
Adrian Chadd
d29fcfb7c3 Add support for AES-CCMP group keys.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:54:40 +00:00
Adrian Chadd
735c606726 Encrypt frame if IEEE80211_BPF_CRYPTO is set.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:54:10 +00:00
Adrian Chadd
b56fed3da0 Use separate mutex for wv_bcbuf and wv_boff structures.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:53:46 +00:00
Adrian Chadd
d036bb20e3 Add prefixes to field names.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:52:47 +00:00
Adrian Chadd
6f8421f8a5 Use ieee80211_beacon_update() for dynamic beacon contents.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:51:56 +00:00
Adrian Chadd
21f6580ed8 Move beacon initialisation to wpi_init_beacon()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:51:06 +00:00
Adrian Chadd
565248e2ad Use a static buffer in wpi_cmd - rather than alloc/free'ing the
beacon buffer frequently.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:50:23 +00:00
Adrian Chadd
0b455e8fba Use WPI_RSSI_OFFSET instead of stat->noise (always 0 for me)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:48:32 +00:00
Adrian Chadd
7e0d52321f Fix debug category in wpi_read_eeprom_band()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:48:00 +00:00
Adrian Chadd
d138d3badc Move IBSS assocation processing to wpi_newassoc().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:46:24 +00:00
Adrian Chadd
4eaf2ee348 wpi_tx_done() shouldn't wait for wpi_start().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:45:43 +00:00
Adrian Chadd
7964dd56b7 Add node table lock - addresses LOR in wpi_node_free().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:44:52 +00:00
Adrian Chadd
f736d89885 Optimise sc->rev processing.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:43:58 +00:00
Adrian Chadd
45ac43f30f Use ring->queued for WPI_CMD_TX_DATA only.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:43:22 +00:00
Adrian Chadd
10550f6135 Move some code under WPI_LOCK().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:42:41 +00:00
Adrian Chadd
0b093122eb Remove unnecessary locking.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:41:57 +00:00
Adrian Chadd
ff62db1d9d Eliminate the WPI_FLAG_BUSY flag.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:40:59 +00:00
Adrian Chadd
63f576999e Add separate lock for TX queues.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:40:11 +00:00
Adrian Chadd
0ebca24555 Wrap node addition in STA mode into wpi_add_sta_node().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:35:25 +00:00
Adrian Chadd
eca2eb395c Replace kernel unit allocator with local set of functions.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:34:26 +00:00
Adrian Chadd
f15520d9b0 Move key processing in wpi_tx_data.
(This is in preparation for further work to support hardware encryption.)

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:33:13 +00:00
Adrian Chadd
f319a41c66 Remove some un-needed variables.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:32:12 +00:00
Adrian Chadd
7167f5fc02 Reformatting - break lines ~ 80 characters.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:31:21 +00:00
Adrian Chadd
7f1299c5cd wpi_intr(): remove duplicate code
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:30:03 +00:00
Adrian Chadd
8e4cf38ac7 Replace few numbers with named constants.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:29:22 +00:00
Adrian Chadd
a5e093b0e0 Wrap cast to (struct wpi_node *) into WPI_NODE macros
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:23:58 +00:00
Adrian Chadd
76fdf7eb35 msleep() -> mtx_sleep()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:22:16 +00:00
Adrian Chadd
cb0de40f2a Fix warning: Value stored to 'supportsa' is never read.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:21:30 +00:00
Adrian Chadd
96dadeb0aa Fix error handling in wpi_scan().
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:20:43 +00:00
Adrian Chadd
bb086d4e83 Fix indentation - non-functional change.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:19:54 +00:00
Adrian Chadd
ebf62e08fb Check some variables only on active TX rings
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:19:01 +00:00
Adrian Chadd
5f25a0e970 Use correct pointer for wpi_softc
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:18:09 +00:00
Adrian Chadd
01729242e5 Fix panics in wpi_tx_done() when powersave is enabled
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:17:25 +00:00
Adrian Chadd
71258eb207 Fix races between wpi_rx_done() and wpi_stop()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:15:10 +00:00
Adrian Chadd
e336bd5499 Divide ackfailcnt by 2 (firmware decreases rate after two unsuccessful retries)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:13:58 +00:00
Adrian Chadd
811fe0a8fb Run callout_reset() with mutex held.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:13:07 +00:00
Adrian Chadd
0c66281c5f Add missed ieee80211_draintask()
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:12:16 +00:00
Adrian Chadd
9facf2b90a Fix a typo (IEEE80211_S_SCAN -> IEEE80211_F_SCAN)
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:10:55 +00:00
Adrian Chadd
893edbea10 Fix mbuf mapping errors in wpi_cmd2() + add check for nsegs
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-15 20:09:47 +00:00
Adrian Chadd
8a28176add Undo some issues from the previous big patch - there's no padding on RX,
so remove DATAPAD and re-do the padding in the TX path manually.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-03-08 01:47:10 +00:00
Adrian Chadd
3de934a7a4 Use the correct mac addresses when initialising things.
PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3rios@gmail.com>
2015-03-08 01:44:57 +00:00
Adrian Chadd
fae61c6918 More fixes to wpi(4), again not by me! Woo!
- Use IEEE80211_F_DATAPAD;
- (c->ic_flags & IEEE80211_CHAN_PASSIVE) -> IEEE80211_IS_CHAN_PASSIVE(c);
- Convert ackfailcnt to int (there is dereference to *(int *) in ieee80211_ratectl_tx_complete());
- Fix & move cleanup to the end in wpi_rx_done();
- Add missed lock in wpi_update_beacon();
- Try to fix powersave.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2015-02-14 17:45:53 +00:00
Adrian Chadd
692ad7ca94 Big wpi(4) overhaul! Not by me!
This is a sync against iwn(4) and openbsd.

- Add power management support;
- Add background scanning support;
- Fix few LORs;
- Handle rfkill switch state changes properly;
- Fix recovering after firmware failure;
- Add more error checking;
- Cleanup & disable by default debug output;
- Update macroses names;
- Other various fixes;
- Add IBSS support:
  - don't set data_ntries field for management frames;
- Add AHDEMO support:
    - fix padding;
- Sync eeprom functions;
- Use CMD_RXON_ASSOC where possible;
- Enable HW CCMP encryption/decryption for pairwise keys;
- Fix filter flags for CMD_RXON.

Tested (by submitter) - iwn 3945 NIC.  I have one somewhere; I'll
validate this later on and revert it if it's a problem.

Thanks!

PR:		197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
2015-02-07 23:11:38 +00:00
Adrian Chadd
e54c8bda3e Remove some hard-coded IE assembly over to use net80211 methods.
PR:		kern/196069
Submitted by:	 Andriy Voskoboinyk <s3erios@gmail.com>
2014-12-20 20:07:48 +00:00
Gleb Smirnoff
c8dfaf382f Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
Hans Petter Selasky
af3b2549c4 Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
Glen Barber
37a107a407 Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory
2014-06-27 22:05:21 +00:00
Hans Petter Selasky
3da1cf1e88 Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after:	2 weeks
Sponsored by:	Mellanox Technologies
2014-06-27 16:33:43 +00:00
John Baldwin
c34f1a08c6 Fix teardown of static DMA allocations in various NIC drivers:
- Add missing calls to bus_dmamap_unload() in et(4).
- Check the bus address against 0 to decide when to call
  bus_dmamap_unload() instead of comparing the bus_dma map against NULL.
- Check the virtual address against NULL to decide when to call
  bus_dmamem_free() instead of comparing the bus_dma map against NULL.
- Don't clear bus_dma map pointers to NULL for static allocations.
  Instead, treat the value as completely opaque.
- Pass the correct virtual address to bus_dmamem_free() in wpi(4) instead
  of trying to free a pointer to the virtual address.

Reviewed by:	yongari
2014-06-17 14:47:49 +00:00
Kevin Lo
5945b5f5ab Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
Marius Strobl
da67681dd3 - Probe with BUS_PROBE_DEFAULT instead of 0.
- Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0
  devices.
- There's no need to keep track of resource IDs.
- Quiesce the interrupt before actually detaching.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	1 week
2013-12-29 23:46:59 +00:00
Eitan Adler
7a22215c53 Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
Gleb Smirnoff
76039bc84f The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 17:58:36 +00:00
Gleb Smirnoff
c6499eccad Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.
2012-12-04 09:32:43 +00:00
Adrian Chadd
81c2214dda Add a missing #include, required for IEEE80211_DEBUG. 2012-06-01 06:20:39 +00:00