|
@@ -558,10 +558,10 @@ int iwl_mvm_add_aux_sta(struct iwl_mvm *mvm)
|
|
|
* @vif: the interface to which the broadcast station is added
|
|
|
* @bsta: the broadcast station to add.
|
|
|
*/
|
|
|
-int iwl_mvm_send_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
- struct iwl_mvm_int_sta *bsta)
|
|
|
+int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
{
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
+ struct iwl_mvm_int_sta *bsta = &mvmvif->bcast_sta;
|
|
|
static const u8 _baddr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
|
const u8 *baddr = _baddr;
|
|
|
|
|
@@ -579,19 +579,40 @@ int iwl_mvm_send_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
|
|
|
/* Send the FW a request to remove the station from it's internal data
|
|
|
* structures, but DO NOT remove the entry from the local data structures. */
|
|
|
-int iwl_mvm_send_rm_bcast_sta(struct iwl_mvm *mvm,
|
|
|
- struct iwl_mvm_int_sta *bsta)
|
|
|
+int iwl_mvm_send_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
{
|
|
|
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
int ret;
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
|
- ret = iwl_mvm_rm_sta_common(mvm, bsta->sta_id);
|
|
|
+ ret = iwl_mvm_rm_sta_common(mvm, mvmvif->bcast_sta.sta_id);
|
|
|
if (ret)
|
|
|
IWL_WARN(mvm, "Failed sending remove station\n");
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+int iwl_mvm_alloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
+{
|
|
|
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
+ u32 qmask;
|
|
|
+
|
|
|
+ lockdep_assert_held(&mvm->mutex);
|
|
|
+
|
|
|
+ qmask = iwl_mvm_mac_get_queues_mask(mvm, vif);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * The firmware defines the TFD queue mask to only be relevant
|
|
|
+ * for *unicast* queues, so the multicast (CAB) queue shouldn't
|
|
|
+ * be included.
|
|
|
+ */
|
|
|
+ if (vif->type == NL80211_IFTYPE_AP)
|
|
|
+ qmask &= ~BIT(vif->cab_queue);
|
|
|
+
|
|
|
+ return iwl_mvm_allocate_int_sta(mvm, &mvmvif->bcast_sta, qmask,
|
|
|
+ ieee80211_vif_type_p2p(vif));
|
|
|
+}
|
|
|
+
|
|
|
/* Allocate a new station entry for the broadcast station to the given vif,
|
|
|
* and send it to the FW.
|
|
|
* Note that each P2P mac should have its own broadcast station.
|
|
@@ -599,45 +620,47 @@ int iwl_mvm_send_rm_bcast_sta(struct iwl_mvm *mvm,
|
|
|
* @mvm: the mvm component
|
|
|
* @vif: the interface to which the broadcast station is added
|
|
|
* @bsta: the broadcast station to add. */
|
|
|
-int iwl_mvm_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|
|
- struct iwl_mvm_int_sta *bsta)
|
|
|
+int iwl_mvm_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
{
|
|
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
- static const u8 baddr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
|
- u32 qmask;
|
|
|
+ struct iwl_mvm_int_sta *bsta = &mvmvif->bcast_sta;
|
|
|
int ret;
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
|
- qmask = iwl_mvm_mac_get_queues_mask(mvm, vif);
|
|
|
- ret = iwl_mvm_allocate_int_sta(mvm, bsta, qmask,
|
|
|
- ieee80211_vif_type_p2p(vif));
|
|
|
+ ret = iwl_mvm_alloc_bcast_sta(mvm, vif);
|
|
|
if (ret)
|
|
|
return ret;
|
|
|
|
|
|
- ret = iwl_mvm_add_int_sta_common(mvm, bsta, baddr,
|
|
|
- mvmvif->id, mvmvif->color);
|
|
|
+ ret = iwl_mvm_send_add_bcast_sta(mvm, vif);
|
|
|
|
|
|
if (ret)
|
|
|
iwl_mvm_dealloc_int_sta(mvm, bsta);
|
|
|
+
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+void iwl_mvm_dealloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
+{
|
|
|
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
|
|
+
|
|
|
+ iwl_mvm_dealloc_int_sta(mvm, &mvmvif->bcast_sta);
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Send the FW a request to remove the station from it's internal data
|
|
|
* structures, and in addition remove it from the local data structure.
|
|
|
*/
|
|
|
-int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *bsta)
|
|
|
+int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|
|
{
|
|
|
int ret;
|
|
|
|
|
|
lockdep_assert_held(&mvm->mutex);
|
|
|
|
|
|
- ret = iwl_mvm_rm_sta_common(mvm, bsta->sta_id);
|
|
|
- if (ret)
|
|
|
- return ret;
|
|
|
+ ret = iwl_mvm_send_rm_bcast_sta(mvm, vif);
|
|
|
+
|
|
|
+ iwl_mvm_dealloc_bcast_sta(mvm, vif);
|
|
|
|
|
|
- iwl_mvm_dealloc_int_sta(mvm, bsta);
|
|
|
return ret;
|
|
|
}
|
|
|
|