Commit Graph

41 Commits

Author SHA1 Message Date
ozaki-r ea0349e714 Use M_GETCTX
No functional change.
2016-05-26 05:01:11 +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
nonaka 1d319b6d93 Always use pci_intr_alloc(9)/pci_intr_release(9). 2015-11-06 14:22:17 +00:00
ozaki-r cfd6ae6bc2 Remove leading whitespaces and kind 2015-10-14 02:16:51 +00:00
nonaka 22b9180f78 Use pci_intr_alloc(). 2015-07-24 15:43:38 +00:00
nonaka c7506b40a5 iwm(4) can read the firmware image from disk when interface up.
This change is useful for full-disk encryption environment.
2015-07-22 15:18:01 +00:00
nonaka 3dc626ead2 Limit the number of dma segments used for transmitting packets to
IWM_NUM_OF_TBS - 2.  We have IWM_NUM_OF_TBS slots, but use two of those
for sending commands to the firmware.

From OpenBSD rev. 1.41.
2015-05-22 15:32:21 +00:00
nonaka 1d659cfa1d should be able to use 5GHz wireless network. 2015-05-16 07:58:19 +00:00
knakahara 5613b8fb8b if_iwm use unified establish API. 2015-05-15 08:44:15 +00:00
nonaka 242c5369e5 Added control debugging output via sysctl. 2015-04-29 03:35:09 +00:00
nonaka b789114cab Use MSI instead of legacy INTx, if available.
should fix PR/49663.
2015-04-28 15:38:02 +00:00
nonaka a9b6bcb09c Register iwm(4) with pmf(9).
Patch from Pierre Pronchery.
2015-04-15 05:40:48 +00:00
nonaka dcd2da55a2 Not all iwm hardware supports the 5GHz band. Make setting 11a rates
and scanning conditional on the 5GHz support bit in the nvm.

From OpenBSD rev. 1.39. Arranged by me.
2015-03-26 14:42:56 +00:00
nonaka c94850afe5 Fix radiotap and fixed rates. Radiotap was reporting the wrong rate for
data frames and fixed rates weren't really fixed and were converted into
the wrong hardware rate.

From OpenBSD rev.1.36.
2015-03-07 13:54:57 +00:00
khorben e8ae7f4dcb Avoid kmem_free(NULL) in iwm_read_firmware()
This code path can be hit if the firmware failed to load, for instance
if the file is not present on the filesystem. In this case
firmware_open() fails, and fw->fw_rawdata never gets allocated in the
first place.
2015-03-07 11:52:53 +00:00
nonaka 383a637dd1 stop the calibration timeout when stopping the interface.
From OpenBSD rev.1.35.
2015-03-04 16:55:11 +00:00
nonaka efa4975d06 Set/clear the IWM_MAC_FILTER_IN_BEACON flag under conditions that match what
Linux does.

From OpenBSD rev.1.34.
2015-03-04 16:53:32 +00:00
nonaka 70ec34259d Fix 11a support.
From OpenBSD rev.1.33.
2015-03-03 09:54:55 +00:00
nonaka a34f8f2de1 Make setting the MAC context bit for 11g protection when transmitting
OFDM frames conditional on the node via IEEE80211_F_USEPROT.

From OpenBSD rev.1.31.
2015-03-03 09:45:58 +00:00
nonaka f09c24be91 Don't set CTS to self. Linux stopped setting this back in
dc271ee0d04d12d6bfabacbec803289a7072fbd9 as it is known
to cause problems.

From OpenBSD rev.1.30.
2015-03-03 09:41:31 +00:00
nonaka b0ceebdce6 sc_fixed_ridx is initialised to 0 but tested as it it were initialised
to -1.  The result of this is tx frames were always sent out at fixed
rate 0 instead of ni_txrate.

Match the iwn behaviour and test ic_fixed_rate for -1 instead.

From OpenBSD rev.1.29.
2015-03-03 09:34:40 +00:00
nonaka 99577c7378 Correctly set lowest_present_ofdm in iwm_mvm_ack_rates().
From OpenBSD rev.1.28.
2015-03-03 09:27:35 +00:00
nonaka e295104504 init error to 0 in iwm_send_cmd().
From OpenBSD rev.1.27.
2015-03-03 09:22:06 +00:00
nonaka 7771544d24 match iwn and init txrate at lowest available bit-rate.
From OpenBSD rev.1.26.
2015-03-03 09:16:56 +00:00
nonaka b72eac57df workaround for interrupt coalescing bug not needed on 7265.
From OpenBSD if_iwm.c rev.1.25, if_iwmvar.h rev.1.7.
2015-03-03 09:10:45 +00:00
nonaka e9f9997b8d Correctly set lowest_present_ofdm in iwm_mvm_ack_rates().
From OpenBSD rev.1.23.
2015-03-02 12:07:27 +00:00
nonaka e139213e29 Display code number of unhandled packet. 2015-02-25 12:41:15 +00:00
christos f399fbe618 Work around Coverity CIDs 127102{0,1}: Confused by the comparison
nrates > __arraycount(lq->rs_table), coverity erroneously binds nrates
to the range [0..16), whereas it is really bound to [0..15) by
ni->ni_rates.rs_nrates (IEEE80211_RATE_MAXSIZE). We add an explicit comparison
to unconfuse it that will always succeed.
2015-02-24 12:57:58 +00:00
nonaka be0da0ea7f Revert previous change. 2015-02-24 02:26:15 +00:00
nonaka c163028673 CID 1271021: Overrunning array "in->in_ridx" of 15 bytes at byte offset 15 using index "i" (which evaluates to 15).
http://mail-index.netbsd.org/coverity-updates/2015/02/21/msg000115.html
2015-02-23 13:09:37 +00:00
nonaka 13666056c3 Make the iwm(4) hardware receive filter pass multicast traffic from OpenBSD.
Fixes inet6 autoconf, for example.
2015-02-20 16:16:06 +00:00
nonaka 0fd46ca0e9 Don't return success when hw is not ready. 2015-02-20 15:03:53 +00:00
nonaka 8472af7ed3 fix compile failure with IWM_DEBUG on i386. 2015-02-17 09:18:45 +00:00
nonaka 5a796a06c4 whitespace 2015-02-16 13:22:19 +00:00
nonaka a5940a3297 Fix compile failure with clang.
Pointed out by Herbert J. Skuhra.
2015-02-16 13:16:00 +00:00
nonaka 6ae1150524 print error message when fail to load firmware. 2015-02-14 05:00:23 +00:00
nonaka f8baa4e97e iwm(4) works now, but 2.4GHz only.
> iwm0 at pci2 dev 0 function 0: Intel Dual Band Wireless AC 3160 (rev. 0x83)
> iwm0: interrupting at ioapic0 pin 18
> iwm0: hw rev: 0x160, fw ver 25.228 (API ver 9), address XX:XX:XX:XX:XX:XX
> iwm0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
> iwm0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
2015-02-13 18:57:46 +00:00
nonaka 2f421602b2 Make some functions and variables static. 2015-02-13 18:02:32 +00:00
nonaka f4d271b3d3 Convert printf() to aprint_*(). 2015-02-13 17:40:13 +00:00
nonaka 43f20e5bff Sync with OpenBSD if_iwm.c rev.1.18. 2015-02-13 17:14:06 +00:00
pooka e11041689b Add a driver for Intel Centrino 7260 and similar wireless cards.
Supported devices should more or less match ones supported
by the Linux iwlwifi mvm driver.  Sponsored by genua mbh for OpenBSD.

This is probably the world's first Canadian cross device driver: it was
created for OpenBSD by writing and porting a NetBSD driver which was
developed in a rump kernel in Linux userspace.

Note: I don't have access to the hardware anymore, so this version is
not tested and not enabled by default.  While I tried to be careful in
adding the NetBSD bits back, it's probable that there's a snafu or two.
Feel free to send private email in case you have the hardware and there
are issues.
2015-02-07 13:20:00 +00:00