mac80211.h (d6d687daaa4531c4a84b82cde46c9906c3c02f55) mac80211.h (800aa9cd3d8050c1d873a1db02d9a546dca8c42e)
1/*-
2 * Copyright (c) 2020-2022 The FreeBSD Foundation
3 * Copyright (c) 2020-2022 Bjoern A. Zeeb
4 *
5 * This software was developed by Björn Zeeb under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 148 unchanged lines hidden (view full) ---

157/* FToSAE 9 */
158/* AP peer key 10 */
159/* 802.1x suite B 11 */
160/* 802.1x suite B 384 12 */
161/* FTo802.1x 384 13 */
162/* Reserved 14-255 */
163/* Apparently 11ax defines more. Seen (19,20) mentioned. */
164
1/*-
2 * Copyright (c) 2020-2022 The FreeBSD Foundation
3 * Copyright (c) 2020-2022 Bjoern A. Zeeb
4 *
5 * This software was developed by Björn Zeeb under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 148 unchanged lines hidden (view full) ---

157/* FToSAE 9 */
158/* AP peer key 10 */
159/* 802.1x suite B 11 */
160/* 802.1x suite B 384 12 */
161/* FTo802.1x 384 13 */
162/* Reserved 14-255 */
163/* Apparently 11ax defines more. Seen (19,20) mentioned. */
164
165#define TKIP_PN_TO_IV16(_x) ((uint16_t)(_x & 0xffff))
166#define TKIP_PN_TO_IV32(_x) ((uint32_t)((_x >> 16) & 0xffffffff))
165
166struct ieee80211_sta;
167
168/* 802.11-2020 9.4.2.55.3 A-MPDU Parameters field */
169#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x3
170#define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2
171#define IEEE80211_HT_AMPDU_PARM_DENSITY (0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT)
172

--- 595 unchanged lines hidden (view full) ---

768 IEEE80211_IFACE_ITER_NORMAL = BIT(0),
769 IEEE80211_IFACE_ITER_RESUME_ALL = BIT(1),
770 IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER = BIT(2), /* seems to be an iter flag */
771
772 /* Internal flags only. */
773 /* ieee80211_iterate_active_interfaces*(). */
774 IEEE80211_IFACE_ITER__ATOMIC = BIT(6),
775 IEEE80211_IFACE_ITER__ACTIVE = BIT(7),
167
168struct ieee80211_sta;
169
170/* 802.11-2020 9.4.2.55.3 A-MPDU Parameters field */
171#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x3
172#define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2
173#define IEEE80211_HT_AMPDU_PARM_DENSITY (0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT)
174

--- 595 unchanged lines hidden (view full) ---

770 IEEE80211_IFACE_ITER_NORMAL = BIT(0),
771 IEEE80211_IFACE_ITER_RESUME_ALL = BIT(1),
772 IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER = BIT(2), /* seems to be an iter flag */
773
774 /* Internal flags only. */
775 /* ieee80211_iterate_active_interfaces*(). */
776 IEEE80211_IFACE_ITER__ATOMIC = BIT(6),
777 IEEE80211_IFACE_ITER__ACTIVE = BIT(7),
778 IEEE80211_IFACE_ITER__MTX = BIT(8),
776};
777
778enum set_key_cmd {
779 SET_KEY,
780 DISABLE_KEY,
781};
782
783/* 802.11-2020, 9.4.2.55.2 HT Capability Information field. */

--- 703 unchanged lines hidden (view full) ---

1487 void *arg)
1488{
1489
1490 flags |= IEEE80211_IFACE_ITER__ACTIVE;
1491 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1492}
1493
1494static __inline void
779};
780
781enum set_key_cmd {
782 SET_KEY,
783 DISABLE_KEY,
784};
785
786/* 802.11-2020, 9.4.2.55.2 HT Capability Information field. */

--- 703 unchanged lines hidden (view full) ---

1490 void *arg)
1491{
1492
1493 flags |= IEEE80211_IFACE_ITER__ACTIVE;
1494 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1495}
1496
1497static __inline void
1498ieee80211_iterate_active_interfaces_mtx(struct ieee80211_hw *hw,
1499 enum ieee80211_iface_iter flags,
1500 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1501 void *arg)
1502{
1503 flags |= IEEE80211_IFACE_ITER__ACTIVE;
1504 flags |= IEEE80211_IFACE_ITER__MTX;
1505 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1506}
1507
1508static __inline void
1495ieee80211_iterate_interfaces(struct ieee80211_hw *hw,
1496 enum ieee80211_iface_iter flags,
1497 void (*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1498 void *arg)
1499{
1500
1501 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1502}

--- 113 unchanged lines hidden (view full) ---

1616static __inline unsigned long
1617ieee80211_tu_to_usec(unsigned long tu)
1618{
1619
1620 return (tu * IEEE80211_DUR_TU);
1621}
1622
1623
1509ieee80211_iterate_interfaces(struct ieee80211_hw *hw,
1510 enum ieee80211_iface_iter flags,
1511 void (*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1512 void *arg)
1513{
1514
1515 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1516}

--- 113 unchanged lines hidden (view full) ---

1630static __inline unsigned long
1631ieee80211_tu_to_usec(unsigned long tu)
1632{
1633
1634 return (tu * IEEE80211_DUR_TU);
1635}
1636
1637
1624static __inline int
1638static __inline bool
1625ieee80211_action_contains_tpc(struct sk_buff *skb)
1626{
1639ieee80211_action_contains_tpc(struct sk_buff *skb)
1640{
1627 TODO();
1628 return (0);
1641 struct ieee80211_mgmt *mgmt;
1642
1643 mgmt = (struct ieee80211_mgmt *)skb->data;
1644
1645 /* Check that this is a mgmt/action frame? */
1646 if (!ieee80211_is_action(mgmt->frame_control))
1647 return (false);
1648
1649 /*
1650 * This is a bit convoluted but according to docs both actions
1651 * are checked for this. Kind-of makes sense for the only consumer
1652 * (iwlwifi) I am aware off given the txpower fields are at the
1653 * same location so firmware can update the value.
1654 */
1655 /* 80211-2020 9.6.2 Spectrum Management Action frames */
1656 /* 80211-2020 9.6.2.5 TPC Report frame format */
1657 /* 80211-2020 9.6.6 Radio Measurement action details */
1658 /* 80211-2020 9.6.6.4 Link Measurement Report frame format */
1659 /* Check that it is Spectrum Management or Radio Measurement? */
1660 if (mgmt->u.action.category != IEEE80211_ACTION_CAT_SM &&
1661 mgmt->u.action.category != IEEE80211_ACTION_CAT_RADIO_MEASUREMENT)
1662 return (false);
1663
1664 /* Check that it is TPC Report or Link Measurement Report? */
1665 KASSERT(IEEE80211_ACTION_SM_TPCREP == IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP,
1666 ("%s: SM_TPCREP %d != RADIO_MEASUREMENT_LMREP %d\n", __func__,
1667 IEEE80211_ACTION_SM_TPCREP, IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP));
1668 if (mgmt->u.action.u.tpc_report.spec_mgmt != IEEE80211_ACTION_SM_TPCREP)
1669 return (false);
1670
1671 /* 80211-2020 9.4.2.16 TPC Report element */
1672 /* Check that the ELEMID and length are correct? */
1673 if (mgmt->u.action.u.tpc_report.tpc_elem_id != IEEE80211_ELEMID_TPCREP ||
1674 mgmt->u.action.u.tpc_report.tpc_elem_length != 4)
1675 return (false);
1676
1677 /* All the right fields in the right place. */
1678 return (true);
1629}
1630
1631static __inline void
1632ieee80211_connection_loss(struct ieee80211_vif *vif)
1633{
1634
1635 linuxkpi_ieee80211_connection_loss(vif);
1636}

--- 226 unchanged lines hidden (view full) ---

1863
1864static __inline void
1865ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, int ntids)
1866{
1867 TODO();
1868}
1869
1870static __inline void
1679}
1680
1681static __inline void
1682ieee80211_connection_loss(struct ieee80211_vif *vif)
1683{
1684
1685 linuxkpi_ieee80211_connection_loss(vif);
1686}

--- 226 unchanged lines hidden (view full) ---

1913
1914static __inline void
1915ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, int ntids)
1916{
1917 TODO();
1918}
1919
1920static __inline void
1871ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr,
1872 uint8_t tid)
1873{
1874 TODO();
1875}
1876
1877static __inline void
1878ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf,
1879 uint64_t pn)
1880{
1881 TODO();
1882}
1883
1884static __inline struct sk_buff *
1885ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)

--- 35 unchanged lines hidden (view full) ---

1921}
1922
1923static __inline void
1924ieee80211_sta_eosp(struct ieee80211_sta *sta)
1925{
1926 TODO();
1927}
1928
1921ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf,
1922 uint64_t pn)
1923{
1924 TODO();
1925}
1926
1927static __inline struct sk_buff *
1928ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)

--- 35 unchanged lines hidden (view full) ---

1964}
1965
1966static __inline void
1967ieee80211_sta_eosp(struct ieee80211_sta *sta)
1968{
1969 TODO();
1970}
1971
1972static __inline int
1973ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int x)
1974{
1975 TODO("rtw8x");
1976 return (-EINVAL);
1977}
1978
1979static __inline int
1980ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid)
1981{
1982 TODO("rtw89");
1983 return (-EINVAL);
1984}
1985
1929static __inline void
1986static __inline void
1987ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr,
1988 uint8_t tid)
1989{
1990 TODO("iwlwifi");
1991}
1992
1993static __inline void
1930ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr,
1931 uint8_t tid)
1932{
1994ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr,
1995 uint8_t tid)
1996{
1933 TODO();
1997 TODO("iwlwifi/rtw8x/...");
1934}
1935
1936static __inline void
1937ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
1938{
1939 TODO();
1940}
1941
1942static __inline void
1943ieee80211_scan_completed(struct ieee80211_hw *hw,
1944 struct cfg80211_scan_info *info)
1945{
1946
1947 linuxkpi_ieee80211_scan_completed(hw, info);
1948}
1949
1950static __inline struct sk_buff *
1998}
1999
2000static __inline void
2001ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
2002{
2003 TODO();
2004}
2005
2006static __inline void
2007ieee80211_scan_completed(struct ieee80211_hw *hw,
2008 struct cfg80211_scan_info *info)
2009{
2010
2011 linuxkpi_ieee80211_scan_completed(hw, info);
2012}
2013
2014static __inline struct sk_buff *
1951ieee80211_beacon_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
2015ieee80211_beacon_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2016 uint32_t link_id)
1952{
1953 TODO();
1954 return (NULL);
1955}
1956
1957static __inline struct sk_buff *
1958ieee80211_pspoll_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
1959{

--- 69 unchanged lines hidden (view full) ---

2029
2030static __inline void
2031ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb)
2032{
2033 IMPROVE();
2034 ieee80211_tx_status(hw, skb);
2035}
2036
2017{
2018 TODO();
2019 return (NULL);
2020}
2021
2022static __inline struct sk_buff *
2023ieee80211_pspoll_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
2024{

--- 69 unchanged lines hidden (view full) ---

2094
2095static __inline void
2096ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb)
2097{
2098 IMPROVE();
2099 ieee80211_tx_status(hw, skb);
2100}
2101
2037static __inline int
2038ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int x)
2039{
2040 TODO();
2041 return (-EINVAL);
2042}
2043
2044static __inline int
2045ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid)
2046{
2047 TODO();
2048 return (-EINVAL);
2049}
2050
2051static __inline void
2052ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
2053{
2054 int i;
2055
2056 /*
2057 * Apparently clearing flags and some other fields is not right.
2058 * Given the function is called "status" we work on that part of

--- 79 unchanged lines hidden (view full) ---

2138
2139static __inline bool
2140ieee80211_txq_may_transmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2141{
2142 TODO();
2143 return (false);
2144}
2145
2102static __inline void
2103ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
2104{
2105 int i;
2106
2107 /*
2108 * Apparently clearing flags and some other fields is not right.
2109 * Given the function is called "status" we work on that part of

--- 79 unchanged lines hidden (view full) ---

2189
2190static __inline bool
2191ieee80211_txq_may_transmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2192{
2193 TODO();
2194 return (false);
2195}
2196
2146static __inline struct ieee80211_txq *
2147ieee80211_next_txq(struct ieee80211_hw *hw, uint32_t ac)
2148{
2149 TODO();
2150 return (NULL);
2151}
2152
2153static __inline void
2154ieee80211_radar_detected(struct ieee80211_hw *hw)
2155{
2156 TODO();
2157}
2158
2159static __inline void
2160ieee80211_sta_register_airtime(struct ieee80211_sta *sta,
2161 uint8_t tid, uint32_t duration, int x)
2162{
2163 TODO();
2164}
2165
2166
2167static __inline void
2197static __inline void
2198ieee80211_radar_detected(struct ieee80211_hw *hw)
2199{
2200 TODO();
2201}
2202
2203static __inline void
2204ieee80211_sta_register_airtime(struct ieee80211_sta *sta,
2205 uint8_t tid, uint32_t duration, int x)
2206{
2207 TODO();
2208}
2209
2210
2211static __inline void
2168ieee80211_return_txq(struct ieee80211_hw *hw,
2169 struct ieee80211_txq *txq, bool _t)
2212ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac)
2170{
2171 TODO();
2172}
2173
2174static __inline void
2213{
2214 TODO();
2215}
2216
2217static __inline void
2175ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint32_t ac)
2218ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint8_t ac)
2176{
2219{
2220 /* DO_NADA; */
2221}
2222
2223static __inline struct ieee80211_txq *
2224ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac)
2225{
2226
2177 TODO();
2227 TODO();
2228 return (NULL);
2178}
2179
2180static __inline void
2229}
2230
2231static __inline void
2181ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint32_t ac)
2232ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2182{
2183 TODO();
2184}
2185
2186static __inline void
2233{
2234 TODO();
2235}
2236
2237static __inline void
2187ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2238ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq,
2239 bool withoutpkts)
2188{
2189 TODO();
2190}
2191
2240{
2241 TODO();
2242}
2243
2244
2192static __inline void
2193ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter)
2194{
2195 TODO();
2196}
2197
2198static __inline int
2199ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif)

--- 109 unchanged lines hidden (view full) ---

2309
2310static __inline void
2311linuxkpi_ieee80211_send_bar(struct ieee80211_vif *vif, uint8_t *ra, uint16_t tid,
2312 uint16_t ssn)
2313{
2314 TODO();
2315}
2316
2245static __inline void
2246ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter)
2247{
2248 TODO();
2249}
2250
2251static __inline int
2252ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif)

--- 109 unchanged lines hidden (view full) ---

2362
2363static __inline void
2364linuxkpi_ieee80211_send_bar(struct ieee80211_vif *vif, uint8_t *ra, uint16_t tid,
2365 uint16_t ssn)
2366{
2367 TODO();
2368}
2369
2370static __inline void
2371ieee80211_resume_disconnect(struct ieee80211_vif *vif)
2372{
2373 TODO();
2374 return;
2375}
2376
2377static __inline int
2378ieee80211_data_to_8023(struct sk_buff *skb, const uint8_t *addr,
2379 enum nl80211_iftype iftype)
2380{
2381 TODO();
2382 return (-1);
2383}
2384
2385static __inline void
2386ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *key,
2387 uint32_t iv32, uint16_t *p1k)
2388{
2389 TODO();
2390 return;
2391}
2392
2393static __inline struct ieee80211_key_conf *
2394ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
2395 struct ieee80211_key_conf *key)
2396{
2397 TODO();
2398 return (NULL);
2399}
2400
2401static __inline void
2402ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const uint8_t *bssid,
2403 const uint8_t *replay_ctr, gfp_t gfp)
2404{
2405 TODO();
2406 return;
2407}
2408
2409static __inline void
2410ieee80211_remove_key(struct ieee80211_key_conf *key)
2411{
2412 TODO();
2413 return;
2414}
2415
2416static __inline void
2417ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid,
2418 struct ieee80211_key_seq *seq)
2419{
2420 TODO();
2421 return;
2422}
2423
2424static __inline void
2425ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif,
2426 struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp)
2427{
2428 TODO();
2429 return;
2430}
2431
2317#define ieee80211_send_bar(_v, _r, _t, _s) \
2318 linuxkpi_ieee80211_send_bar(_v, _r, _t, _s)
2319
2320#endif /* _LINUXKPI_NET_MAC80211_H */
2432#define ieee80211_send_bar(_v, _r, _t, _s) \
2433 linuxkpi_ieee80211_send_bar(_v, _r, _t, _s)
2434
2435#endif /* _LINUXKPI_NET_MAC80211_H */