aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 86fa8abdd66f..7eaaa3bab547 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -9,7 +9,8 @@
9 9
10/* 10/*
11 * TODO: 11 * TODO:
12 * - IBSS mode simulation (Beacon transmission with competition for "air time") 12 * - Add TSF sync and fix IBSS beacon transmission by adding
13 * competition for "air time" at TBTT
13 * - RX filtering based on filter configuration (data->rx_filter) 14 * - RX filtering based on filter configuration (data->rx_filter)
14 */ 15 */
15 16
@@ -594,17 +595,34 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
594 struct ieee80211_vif *vif) 595 struct ieee80211_vif *vif)
595{ 596{
596 wiphy_debug(hw->wiphy, "%s (type=%d mac_addr=%pM)\n", 597 wiphy_debug(hw->wiphy, "%s (type=%d mac_addr=%pM)\n",
597 __func__, vif->type, vif->addr); 598 __func__, ieee80211_vif_type_p2p(vif),
599 vif->addr);
598 hwsim_set_magic(vif); 600 hwsim_set_magic(vif);
599 return 0; 601 return 0;
600} 602}
601 603
602 604
605static int mac80211_hwsim_change_interface(struct ieee80211_hw *hw,
606 struct ieee80211_vif *vif,
607 enum nl80211_iftype newtype,
608 bool newp2p)
609{
610 newtype = ieee80211_iftype_p2p(newtype, newp2p);
611 wiphy_debug(hw->wiphy,
612 "%s (old type=%d, new type=%d, mac_addr=%pM)\n",
613 __func__, ieee80211_vif_type_p2p(vif),
614 newtype, vif->addr);
615 hwsim_check_magic(vif);
616
617 return 0;
618}
619
603static void mac80211_hwsim_remove_interface( 620static void mac80211_hwsim_remove_interface(
604 struct ieee80211_hw *hw, struct ieee80211_vif *vif) 621 struct ieee80211_hw *hw, struct ieee80211_vif *vif)
605{ 622{
606 wiphy_debug(hw->wiphy, "%s (type=%d mac_addr=%pM)\n", 623 wiphy_debug(hw->wiphy, "%s (type=%d mac_addr=%pM)\n",
607 __func__, vif->type, vif->addr); 624 __func__, ieee80211_vif_type_p2p(vif),
625 vif->addr);
608 hwsim_check_magic(vif); 626 hwsim_check_magic(vif);
609 hwsim_clear_magic(vif); 627 hwsim_clear_magic(vif);
610} 628}
@@ -620,7 +638,8 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
620 hwsim_check_magic(vif); 638 hwsim_check_magic(vif);
621 639
622 if (vif->type != NL80211_IFTYPE_AP && 640 if (vif->type != NL80211_IFTYPE_AP &&
623 vif->type != NL80211_IFTYPE_MESH_POINT) 641 vif->type != NL80211_IFTYPE_MESH_POINT &&
642 vif->type != NL80211_IFTYPE_ADHOC)
624 return; 643 return;
625 644
626 skb = ieee80211_beacon_get(hw, vif); 645 skb = ieee80211_beacon_get(hw, vif);
@@ -1025,6 +1044,7 @@ static struct ieee80211_ops mac80211_hwsim_ops =
1025 .start = mac80211_hwsim_start, 1044 .start = mac80211_hwsim_start,
1026 .stop = mac80211_hwsim_stop, 1045 .stop = mac80211_hwsim_stop,
1027 .add_interface = mac80211_hwsim_add_interface, 1046 .add_interface = mac80211_hwsim_add_interface,
1047 .change_interface = mac80211_hwsim_change_interface,
1028 .remove_interface = mac80211_hwsim_remove_interface, 1048 .remove_interface = mac80211_hwsim_remove_interface,
1029 .config = mac80211_hwsim_config, 1049 .config = mac80211_hwsim_config,
1030 .configure_filter = mac80211_hwsim_configure_filter, 1050 .configure_filter = mac80211_hwsim_configure_filter,
@@ -1295,6 +1315,9 @@ static int __init init_mac80211_hwsim(void)
1295 hw->wiphy->interface_modes = 1315 hw->wiphy->interface_modes =
1296 BIT(NL80211_IFTYPE_STATION) | 1316 BIT(NL80211_IFTYPE_STATION) |
1297 BIT(NL80211_IFTYPE_AP) | 1317 BIT(NL80211_IFTYPE_AP) |
1318 BIT(NL80211_IFTYPE_P2P_CLIENT) |
1319 BIT(NL80211_IFTYPE_P2P_GO) |
1320 BIT(NL80211_IFTYPE_ADHOC) |
1298 BIT(NL80211_IFTYPE_MESH_POINT); 1321 BIT(NL80211_IFTYPE_MESH_POINT);
1299 1322
1300 hw->flags = IEEE80211_HW_MFP_CAPABLE | 1323 hw->flags = IEEE80211_HW_MFP_CAPABLE |