Commit graph

34 commits

Author SHA1 Message Date
Bjoern A. Zeeb
f5d0b181f4 LinuxKPI: 802.11: ieee80211_start_tx_ba_session()
For as long as we do not implement the compat code for tx aggregation
return -EINVAL in ieee80211_start_tx_ba_session() as both rtw88 and
rtw89 check for this value and only then disable further attempts.

(cherry picked from commit 799051e2ca)
2022-07-01 13:49:11 +00:00
Bjoern A. Zeeb
984a45d77b LinuxKPI 802.11 / iwlwifi / rtw88 : re-factor ieee802211_sta for MLO
Working on an update for rtw88 baed on wireless-testing I ran into
a build issue with struct ieee802211_sta.  Some fields were factored
out into their own struct apparently preparing for MLO (Multi Link
Operation).

In order to be able to update one driver we have to adjust both
rtw88 and iwlwifi (and the ones still out-of-tree) now.

This is mostly a sed-replace job and no functional changes are
intended.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6cf748ad94)
2022-06-03 16:57:04 +00:00
Bjoern A. Zeeb
465776a81e LinuxKPI: 802.11 add rfkill_soft_blocked()
Add rfkill_soft_blocked() to the list of things to implement in
preparation for an iwlwifi update.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 05d6f4d696)
2022-06-03 16:56:21 +00:00
John Baldwin
ffefb63627 linuxkpi: Add parentheses to pacify -Wparentheses warnings from GCC.
Reviewed by:	bz, emaste
Differential Revision:	https://reviews.freebsd.org/D34145

(cherry picked from commit 7043ca9140)
2022-05-10 17:06:44 -07:00
Bjoern A. Zeeb
5961670050 LinuxKPI: 802.11: fill in two more TODOs
Implement ieee80211_is_data_present() and a subset of
ieee80211_is_bufferable_mmpdu() which hopefully is good enough in
the compat code for now.
This is partly in preparation for some TXQ changes coming up soon.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 00614c9c2d)
2022-05-04 13:13:11 +00:00
Bjoern A. Zeeb
d5e65e74eb LinuxKPI: 802.11 ieee80211_sn_sub() fix
In ieee80211_sn_sub() we need to shift the mask before applying it.
This fixes the logic from 978f25e840.

Reported by:	J.R. Oldroyd (fbsd opal.com)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b3e7f403a5)
2022-05-04 13:12:54 +00:00
Bjoern A. Zeeb
f71daf6a11 LinuxKPI: 802.11: start adding rate control to ieee80211_tx_status()
Start adding rate control feedback in ieee80211_tx_status() in order
for net80211 to be able to report something back (which may not
yet be the view of the firmware).  iwlwifi is reporting back an MSC 0
even with HT disabled (to be investigated) so we cannot (yet) use
the firmware/driver rate feedback directly.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 383b3e8f50)
2022-04-18 09:32:58 +00:00
Bjoern A. Zeeb
e4e2ad470e LinuxKPI: 802.11: implement ieee80211_probereq_get()
Implement ieee80211_probereq_get() needed by Realtek drivers.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ade774b19f)
2022-04-18 09:32:58 +00:00
Bjoern A. Zeeb
797188ba9a LinuxKPI: 802.11: add ieee80211_beacon_get_tim(), ieee80211_sn_sub()
Add a dummy implementation for ieee80211_beacon_get_tim().
Add the implementation for ieee80211_sn_sub().

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 978f25e840)
2022-04-14 16:38:11 +00:00
Bjoern A. Zeeb
7b9d8e33bc LinuxKPI: 802.11: fix RSSI (and NF)
As in 4a22cd6c4e nf and rss should be
signed and not unsigned.  Change the types in the header and while
here change a magic number to a define as done elsewhere (value does
not change).

When calculating c_rssi we need to make it relative so subtract nf.
And while here improve the debug output.

This will hopefully fix ifconfig wlanN list scan S:N output which
tools use to chose a BSSID and help net80211 internal calculations.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 60970a328e)
2022-04-05 14:47:13 +00:00
Bjoern A. Zeeb
2a8e509ba3 LinuxKPI: 802.11: fix compat code for i386
Compiling another driver on i386 revealed two problems:
- ieee80211_tx_info.status.status_driver_data space needs to be
  calculated.  While a pointer is 32bit vm_paddr_t is 64 bit on i386
  so we didn't fit more than one of these in but needed more space.
- the arguments to ieee80211_txq_get_depth() are expected to
  unsigned long and not uint64_t.

No user noticable changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 86220d3cbd)
2022-04-05 14:46:58 +00:00
Bjoern A. Zeeb
e269958566 LinuxKPI: 802.11: cleanup debugging
Cleanup some debugging.  Rename the global variable to be less
generic.  Hide all debugging behind #ifdef for now and turn off.
Rename the debugging sysctl so we can start adding more to the
subtree.

There is a need to change that wildly grown infrastructure into
something more homogenic soon but this should do for 13.1.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9d9ba2b79b)
2022-03-27 18:13:00 +00:00
Bjoern A. Zeeb
4836b8ac0e LinuxKPI: 802.11: use cfg80211_chandef_create()
Rather than manually setting up a chandef and then effectively forcing
a memcpy, use cfg80211_chandef_create() to do the work for us entirely.
This works here as we do not store the resulting chandef separately
for other use.

While here remove a duplicate assignment in cfg80211_chandef_create().

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4a07abdeb8)
2022-03-27 18:12:17 +00:00
Bjoern A. Zeeb
24c2117baf LinuxKPI: 802.11: implement ieee80211_beacon_loss()
Implement ieee80211_beacon_loss() similar to
ieee80211_connection_loss() with different state handling.
While here leave a comment in connection_loss() about the state
change argument.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit bb81db90f7)
2022-03-27 18:08:58 +00:00
Bjoern A. Zeeb
e596e01cc9 LinuxKPI: update 802.11 headers
Add new defines, struct members, and (stub) functions needed for an
updated iwlwifi.  Most of the defines are for rfkill or HE.

Pull in a case statement from the upcoming iwlwifi update to
not break the build.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d875aa1587)
(cherry picked from commit 9ad210c159)
2022-02-27 23:41:54 +00:00
Bjoern A. Zeeb
6ddbe66d02 LinuxKPI: 802.11 header updates and add/adjust source dependencies.
This update is for more/newer versions of drivers:
- add and properly place more structs, enums, defines needed by drivers.
- correct types of struct fields.
- make various function arguments const.
- move REG_RULE() macro to its own file regulatory.h and
  use macros for calculations.
- add linuxkpi_ieee80211_get_channel() implementation.
- change linuxkpi_ieee80211_ifattach() to return int for error checking.

No intended functional changes for iwlwifi.

Sponsored by:	The FreeBSD Foundation (partially)

(cherry picked from commit 2e183d999c)
2022-02-20 16:25:43 +00:00
Vladimir Kondratyev
2d0694b953 LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards
MFC after:	1 week
Reviewed by:	bz, emaste, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33562

(cherry picked from commit 307f78f3ed)
2022-01-22 22:34:38 +03:00
Bjoern A. Zeeb
bb53dafe14 LinuxKPI: 802.11 correct enum ieee80211_channel_flags
enum ieee80211_channel_flags are used as bit fields and not as 1..n.
Correct the values using BIT(n).

This is also hoped to fix problems with 7260 cards which come up and
panic due to an empty channel list as all channels are set disabled [1][2].
It will hopefully also fix the one or other oddity.

Reported by:	ambrisko, Mike Tancsa (mike sentex.net) [1]
Confirmed to fix by: ambrisko, Mike Tancsa (mike sentex.net) [2]
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d7ce88aafc)
2022-01-20 14:05:37 +00:00
Bjoern A. Zeeb
f27c46a850 LinuxKPI: 802.11 Refine/add DTIM/TSF handling
Correct data types related to delivery traffic indication map (DTIM)/
timing synchronization function (TSF) and implement/refine their
handling.  This information is used/needed by iwlwifi to set a station
as associated.  This will hopefully avoid more "no beacon heard"
time event failures.

The recording of the Linux specific sync_device_ts is done in the
receive path for now in case we do have the right information
available.  I need to investigate as to how-much it may make sense
to also migrate it into net80211 in the future depending on the
usage in other drivers (or how we did handle this in the past in
natively ported versions, e.g. iwm).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c8dafefaee)
2022-01-20 14:05:26 +00:00
Bjoern A. Zeeb
d12ea01e39 LinuxKPI: 802.11 update compat code for driver updates
Add more (dummy in case of HE) defines, structs, functions and another
mac80211 function pointer needed to update and support recent drivers.

(cherry picked from commit 51b461b3db)
2022-01-16 22:39:23 +00:00
Bjoern A. Zeeb
cb6bb87184 LinuxKPI / iwlwifi: fix spelling of constants
Fix the spelling of IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_*
(was "NOMIMAL").  The original version came from iwlwifi
in iwlwifi-next.  Other drivers (from wireless-testing) already
use the correct spelling and need this change in LinuxKPI.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e200809190)
2022-01-16 22:39:16 +00:00
Bjoern A. Zeeb
f8612fa7e0 LinuxKPI: add 802.11 compat code
Add 802.11 compat code for mac80211 and to a minimal degree cfg80211.
This allows us to compile and use basic functionality of wireless
drivers such as iwlwifi.

This is a constant work in progress but having it in the tree will
allow others to test and more easy to track changes and avoid having
snapshots no longer applying to branches.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6b4cac814e)
2021-12-30 18:27:45 +00:00
Bjoern A. Zeeb
79bc96d1fb LinuxKPI: add nexthdr definitions for IPv6
Add the nexthdr definitions for IPv6 which are used by wireless
drivers and were previously placed in an 80211 header file by
accident.

Obtained from:	bz_iwlwifi
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b9d984e2c5)
2021-11-19 00:01:22 +00:00
Bjoern A. Zeeb
a30fe52a12 net80211/LinuxKPI: add more radiotap definitions
Add more raditap definitions based on "names" found in actual drivers
and based on documentation from radiotap.org (where avail).

Leave one specific "duplicate" in the LinuxKPI implementation but
otherwise manage it all in net80211.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky, adrian, sam
Differential Revision: https://reviews.freebsd.org/D30641

(cherry picked from commit b5d37e5a20)
2021-07-18 00:35:03 +00:00
Bjoern A. Zeeb
2b1e0392da LinuxKPI: add addrconf_addr_solict_mult()
Introduce net/addrconf.h with an implementation to
addrconf_addr_solict_mult() used by WiFi drivers.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30416

(cherry picked from commit 095f018e49)
2021-07-18 00:35:02 +00:00
Bjoern A. Zeeb
15350a1057 LinuxKPI: net/if_inet6.h add struct inet6_dev { }
Add a dummy struct inet6_dev {}; to net/if_inet6.h.  This is currently
not used for anything but in a declaration.  Just needs to be there.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30426

(cherry picked from commit ff09f9133f)
2021-07-18 00:35:01 +00:00
Bjoern A. Zeeb
deb7fa19a7 LinuxKPI: ipv6.h add missing #include
Include linux/bitops.h for a definition of BITS_PER_LONG so that this
file can be used independently.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30429

(cherry picked from commit 762efb2d6d)
2021-07-18 00:35:01 +00:00
Mateusz Guzik
1a18003240 compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
Hans Petter Selasky
986e3bed8b Implement the ip_eth_mc_map() function in the LinuxKPI.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-06-12 08:43:49 +00:00
Ed Maste
8363051739 linuxkpi whitespace cleanup
Reviewed by:	hselasky, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14807
2018-03-23 15:50:01 +00:00
Hans Petter Selasky
82d0140707 Add full VNET support to the inet_get_local_port_range() function in
the LinuxKPI.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-03-22 15:46:31 +00:00
Hans Petter Selasky
303bd80ad5 Add support for more IPv4 and IPv6 related macros in the LinuxKPI.
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-03-22 15:44:00 +00:00
Hans Petter Selasky
8e7baabc9f Make all the LinuxKPI include files compile standalone.
Sponsored by:	Mellanox Technologies
2015-11-03 12:37:55 +00:00
Hans Petter Selasky
8d59ecb214 Finish process of moving the LinuxKPI module into the default kernel build.
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
  its subfolders.
- Update sys/conf/files and some Makefiles to use new file locations.
- Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn
  adds the LinuxKPI to all LINT builds.
- The LinuxKPI can be added to the kernel by setting the
  COMPAT_LINUXKPI option. The OFED kernel option no longer builds the
  LinuxKPI into the kernel. This was done to keep the build rules for
  the LinuxKPI in sys/conf/files simple.
- Extend the LinuxKPI module to include support for USB by moving the
  Linux USB compat from usb.ko to linuxkpi.ko.
- Bump the FreeBSD_version.
- A universe kernel build has been done.

Reviewed by:	np @ (cxgb and cxgbe related changes only)
Sponsored by:	Mellanox Technologies
2015-10-29 08:28:39 +00:00