mt76: mt7615: add ibss support
Enable IFTYPE_ADHOC support on 7615 devices. The feature has been tested using a mt76x2 device as wireless peer. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
19d0affadd
commit
7f4b792031
3 changed files with 15 additions and 0 deletions
|
@ -177,6 +177,9 @@ static struct ieee80211_rate mt7615_rates[] = {
|
||||||
|
|
||||||
static const struct ieee80211_iface_limit if_limits[] = {
|
static const struct ieee80211_iface_limit if_limits[] = {
|
||||||
{
|
{
|
||||||
|
.max = 1,
|
||||||
|
.types = BIT(NL80211_IFTYPE_ADHOC)
|
||||||
|
}, {
|
||||||
.max = MT7615_MAX_INTERFACES,
|
.max = MT7615_MAX_INTERFACES,
|
||||||
.types = BIT(NL80211_IFTYPE_AP) |
|
.types = BIT(NL80211_IFTYPE_AP) |
|
||||||
#ifdef CONFIG_MAC80211_MESH
|
#ifdef CONFIG_MAC80211_MESH
|
||||||
|
@ -289,6 +292,8 @@ int mt7615_register_device(struct mt7615_dev *dev)
|
||||||
wiphy->reg_notifier = mt7615_regd_notifier;
|
wiphy->reg_notifier = mt7615_regd_notifier;
|
||||||
wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
|
wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
|
||||||
|
|
||||||
|
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
|
||||||
|
|
||||||
ieee80211_hw_set(hw, TX_STATUS_NO_AMPDU_LEN);
|
ieee80211_hw_set(hw, TX_STATUS_NO_AMPDU_LEN);
|
||||||
|
|
||||||
dev->mt76.sband_2g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
|
dev->mt76.sband_2g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
|
||||||
|
@ -303,6 +308,7 @@ int mt7615_register_device(struct mt7615_dev *dev)
|
||||||
dev->dfs_state = -1;
|
dev->dfs_state = -1;
|
||||||
|
|
||||||
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
||||||
|
BIT(NL80211_IFTYPE_ADHOC) |
|
||||||
#ifdef CONFIG_MAC80211_MESH
|
#ifdef CONFIG_MAC80211_MESH
|
||||||
BIT(NL80211_IFTYPE_MESH_POINT) |
|
BIT(NL80211_IFTYPE_MESH_POINT) |
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,6 +41,7 @@ static int get_omac_idx(enum nl80211_iftype type, u32 mask)
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NL80211_IFTYPE_AP:
|
case NL80211_IFTYPE_AP:
|
||||||
case NL80211_IFTYPE_MESH_POINT:
|
case NL80211_IFTYPE_MESH_POINT:
|
||||||
|
case NL80211_IFTYPE_ADHOC:
|
||||||
/* ap use hw bssid 0 and ext bssid */
|
/* ap use hw bssid 0 and ext bssid */
|
||||||
if (~mask & BIT(HW_BSSID_0))
|
if (~mask & BIT(HW_BSSID_0))
|
||||||
return HW_BSSID_0;
|
return HW_BSSID_0;
|
||||||
|
|
|
@ -848,6 +848,11 @@ int mt7615_mcu_set_bss_info(struct mt7615_dev *dev,
|
||||||
conn_type = CONNECTION_INFRA_STA;
|
conn_type = CONNECTION_INFRA_STA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case NL80211_IFTYPE_ADHOC:
|
||||||
|
conn_type = CONNECTION_IBSS_ADHOC;
|
||||||
|
tx_wlan_idx = mvif->sta.wcid.idx;
|
||||||
|
net_type = NETWORK_IBSS;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
WARN_ON(1);
|
WARN_ON(1);
|
||||||
break;
|
break;
|
||||||
|
@ -1073,6 +1078,9 @@ int mt7615_mcu_set_sta_rec(struct mt7615_dev *dev, struct ieee80211_vif *vif,
|
||||||
case NL80211_IFTYPE_STATION:
|
case NL80211_IFTYPE_STATION:
|
||||||
req.basic.conn_type = cpu_to_le32(CONNECTION_INFRA_AP);
|
req.basic.conn_type = cpu_to_le32(CONNECTION_INFRA_AP);
|
||||||
break;
|
break;
|
||||||
|
case NL80211_IFTYPE_ADHOC:
|
||||||
|
req.basic.conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
WARN_ON(1);
|
WARN_ON(1);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue