@@ -855,7 +855,9 @@ static int wilc_mac_open(struct net_device *ndev)
855855 struct wilc_vif * vif = netdev_priv (ndev );
856856 struct wilc * wl = vif -> wilc ;
857857 int ret = 0 ;
858+ #if KERNEL_VERSION (5 , 8 , 0 ) <= LINUX_VERSION_CODE
858859 struct mgmt_frame_regs mgmt_regs = {};
860+ #endif
859861
860862 if (!wl || !wl -> dev ) {
861863 netdev_err (ndev , "device not ready\n" );
@@ -901,12 +903,24 @@ static int wilc_mac_open(struct net_device *ndev)
901903 return - EINVAL ;
902904 }
903905
906+ #if KERNEL_VERSION (5 , 8 , 0 ) <= LINUX_VERSION_CODE
904907 mgmt_regs .interface_stypes = vif -> mgmt_reg_stypes ;
905908 /* so we detect a change */
906909 vif -> mgmt_reg_stypes = 0 ;
910+
907911 wilc_update_mgmt_frame_registrations (vif -> ndev -> ieee80211_ptr -> wiphy ,
908912 vif -> ndev -> ieee80211_ptr ,
909913 & mgmt_regs );
914+ #else
915+ wilc_mgmt_frame_register (vif -> ndev -> ieee80211_ptr -> wiphy ,
916+ vif -> ndev -> ieee80211_ptr ,
917+ vif -> frame_reg [0 ].type ,
918+ vif -> frame_reg [0 ].reg );
919+ wilc_mgmt_frame_register (vif -> ndev -> ieee80211_ptr -> wiphy ,
920+ vif -> ndev -> ieee80211_ptr ,
921+ vif -> frame_reg [1 ].type ,
922+ vif -> frame_reg [1 ].reg );
923+ #endif
910924 netif_wake_queue (ndev );
911925 wl -> open_ifcs ++ ;
912926 vif -> mac_opened = 1 ;
@@ -1200,12 +1214,22 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
12001214 srcu_idx = srcu_read_lock (& wilc -> srcu );
12011215 list_for_each_entry_rcu (vif , & wilc -> vif_list , list ) {
12021216 u16 type = le16_to_cpup ((__le16 * )buff );
1217+ struct wilc_priv * priv ;
1218+ #if KERNEL_VERSION (5 , 8 , 0 ) <= LINUX_VERSION_CODE
12031219 u32 type_bit = BIT (type >> 4 );
1220+ #endif
12041221
1222+ priv = & vif -> priv ;
1223+ #if KERNEL_VERSION (5 , 8 , 0 ) <= LINUX_VERSION_CODE
12051224 if (vif -> mgmt_reg_stypes & type_bit &&
12061225 vif -> p2p_listen_state )
12071226 wilc_wfi_p2p_rx (vif , buff , size );
1208-
1227+ #else
1228+ if (((type == vif -> frame_reg [0 ].type && vif -> frame_reg [0 ].reg ) ||
1229+ (type == vif -> frame_reg [1 ].type && vif -> frame_reg [1 ].reg )) &&
1230+ vif -> p2p_listen_state )
1231+ wilc_wfi_p2p_rx (vif , buff , size );
1232+ #endif
12091233
12101234 if (vif -> monitor_flag )
12111235 wilc_wfi_monitor_rx (wilc -> monitor_dev , buff , size );
0 commit comments