@@ -1468,17 +1468,54 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm,
14681468 (_usig)->value |= LE32_DEC_ENC(in_value, dec_bits, _enc_bits); \
14691469} while (0)
14701470
1471+ #define __IWL_MVM_ENC_EHT_RU (rt_data , rt_ru , fw_data , fw_ru ) \
1472+ eht->data[(rt_data)] |= \
1473+ (cpu_to_le32 \
1474+ (IEEE80211_RADIOTAP_EHT_DATA ## rt_data ## _RU_ALLOC_CC_ ## rt_ru ## _KNOWN) | \
1475+ LE32_DEC_ENC(data ## fw_data, \
1476+ IWL_RX_PHY_DATA ## fw_data ## _EHT_MU_EXT_RU_ALLOC_ ## fw_ru, \
1477+ IEEE80211_RADIOTAP_EHT_DATA ## rt_data ## _RU_ALLOC_CC_ ## rt_ru))
1478+
1479+ #define _IWL_MVM_ENC_EHT_RU (rt_data , rt_ru , fw_data , fw_ru ) \
1480+ __IWL_MVM_ENC_EHT_RU(rt_data, rt_ru, fw_data, fw_ru)
1481+
1482+ #define IEEE80211_RADIOTAP_RU_DATA_1_1_1 1
1483+ #define IEEE80211_RADIOTAP_RU_DATA_2_1_1 2
1484+ #define IEEE80211_RADIOTAP_RU_DATA_1_1_2 2
1485+ #define IEEE80211_RADIOTAP_RU_DATA_2_1_2 2
1486+ #define IEEE80211_RADIOTAP_RU_DATA_1_2_1 3
1487+ #define IEEE80211_RADIOTAP_RU_DATA_2_2_1 3
1488+ #define IEEE80211_RADIOTAP_RU_DATA_1_2_2 3
1489+ #define IEEE80211_RADIOTAP_RU_DATA_2_2_2 4
1490+
1491+ #define IWL_RX_RU_DATA_A1 2
1492+ #define IWL_RX_RU_DATA_A2 2
1493+ #define IWL_RX_RU_DATA_B1 2
1494+ #define IWL_RX_RU_DATA_B2 3
1495+ #define IWL_RX_RU_DATA_C1 3
1496+ #define IWL_RX_RU_DATA_C2 3
1497+ #define IWL_RX_RU_DATA_D1 4
1498+ #define IWL_RX_RU_DATA_D2 4
1499+
1500+ #define IWL_MVM_ENC_EHT_RU (rt_ru , fw_ru ) \
1501+ _IWL_MVM_ENC_EHT_RU(IEEE80211_RADIOTAP_RU_DATA_ ## rt_ru, \
1502+ rt_ru, \
1503+ IWL_RX_RU_DATA_ ## fw_ru, \
1504+ fw_ru)
1505+
14711506static void iwl_mvm_decode_eht_ext_mu (struct iwl_mvm * mvm ,
14721507 struct iwl_mvm_rx_phy_data * phy_data ,
14731508 struct ieee80211_rx_status * rx_status ,
14741509 struct ieee80211_radiotap_eht * eht ,
14751510 struct ieee80211_radiotap_eht_usig * usig )
14761511{
1477- __le32 data1 = phy_data -> d1 ;
1478-
14791512 if (phy_data -> with_data ) {
1513+ __le32 data1 = phy_data -> d1 ;
1514+ __le32 data2 = phy_data -> d2 ;
1515+ __le32 data3 = phy_data -> d3 ;
14801516 __le32 data4 = phy_data -> eht_d4 ;
14811517 __le32 data5 = phy_data -> d5 ;
1518+ u32 phy_bw = phy_data -> rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK ;
14821519
14831520 IWL_MVM_ENC_USIG_VALUE_MASK (usig , data5 ,
14841521 IWL_RX_PHY_DATA5_EHT_TYPE_AND_COMP ,
@@ -1493,6 +1530,55 @@ static void iwl_mvm_decode_eht_ext_mu(struct iwl_mvm *mvm,
14931530 (usig , data1 , IWL_RX_PHY_DATA1_EHT_MU_NUM_SIG_SYM_USIGA2 ,
14941531 IEEE80211_RADIOTAP_EHT_USIG2_MU_B11_B15_EHT_SIG_SYMBOLS );
14951532
1533+ eht -> user_info [0 ] |=
1534+ cpu_to_le32 (IEEE80211_RADIOTAP_EHT_USER_INFO_STA_ID_KNOWN ) |
1535+ LE32_DEC_ENC (data5 , IWL_RX_PHY_DATA5_EHT_MU_STA_ID_USR ,
1536+ IEEE80211_RADIOTAP_EHT_USER_INFO_STA_ID );
1537+
1538+ eht -> known |= cpu_to_le32 (IEEE80211_RADIOTAP_EHT_KNOWN_NR_NON_OFDMA_USERS_M );
1539+ eht -> data [7 ] |= LE32_DEC_ENC
1540+ (data5 , IWL_RX_PHY_DATA5_EHT_MU_NUM_USR_NON_OFDMA ,
1541+ IEEE80211_RADIOTAP_EHT_DATA7_NUM_OF_NON_OFDMA_USERS );
1542+
1543+ /*
1544+ * Hardware labels the content channels/RU allocation values
1545+ * as follows:
1546+ * Content Channel 1 Content Channel 2
1547+ * 20 MHz: A1
1548+ * 40 MHz: A1 B1
1549+ * 80 MHz: A1 C1 B1 D1
1550+ * 160 MHz: A1 C1 A2 C2 B1 D1 B2 D2
1551+ * 320 MHz: A1 C1 A2 C2 A3 C3 A4 C4 B1 D1 B2 D2 B3 D3 B4 D4
1552+ *
1553+ * However firmware can only give us A1-D2, so the higher
1554+ * frequencies are missing.
1555+ */
1556+
1557+ switch (phy_bw ) {
1558+ case RATE_MCS_CHAN_WIDTH_320 :
1559+ /* additional values are missing in RX metadata */
1560+ case RATE_MCS_CHAN_WIDTH_160 :
1561+ /* content channel 1 */
1562+ IWL_MVM_ENC_EHT_RU (1 _2_1 , A2 );
1563+ IWL_MVM_ENC_EHT_RU (1 _2_2 , C2 );
1564+ /* content channel 2 */
1565+ IWL_MVM_ENC_EHT_RU (2 _2_1 , B2 );
1566+ IWL_MVM_ENC_EHT_RU (2 _2_2 , D2 );
1567+ fallthrough ;
1568+ case RATE_MCS_CHAN_WIDTH_80 :
1569+ /* content channel 1 */
1570+ IWL_MVM_ENC_EHT_RU (1 _1_2 , C1 );
1571+ /* content channel 2 */
1572+ IWL_MVM_ENC_EHT_RU (2 _1_2 , D1 );
1573+ fallthrough ;
1574+ case RATE_MCS_CHAN_WIDTH_40 :
1575+ /* content channel 2 */
1576+ IWL_MVM_ENC_EHT_RU (2 _1_1 , B1 );
1577+ fallthrough ;
1578+ case RATE_MCS_CHAN_WIDTH_20 :
1579+ IWL_MVM_ENC_EHT_RU (1 _1_1 , A1 );
1580+ break ;
1581+ }
14961582 } else {
14971583 __le32 usig_a1 = phy_data -> rx_vec [0 ];
14981584 __le32 usig_a2 = phy_data -> rx_vec [1 ];
0 commit comments