Beispiel #1
0
static int mwl_mac80211_sta_add(struct ieee80211_hw *hw,
                                struct ieee80211_vif *vif,
                                struct ieee80211_sta *sta)
{
    struct mwl_priv *priv = hw->priv;
    struct mwl_vif *mwl_vif;
    struct mwl_sta *sta_info;
    struct ieee80211_key_conf *key;
    int rc;
    int i;

    mwl_vif = mwl_dev_get_vif(vif);
    sta_info = mwl_dev_get_sta(sta);

    memset(sta_info, 0, sizeof(*sta_info));

    if (vif->type == NL80211_IFTYPE_MESH_POINT) {
        sta_info->is_mesh_node = true;
        /* Patch mesh interface for HT based on 88W8897. When authsae or
         * wpa_supplicant is used for mesh security, HT capbility wan't
         * be set. This would be removed if problem is fixed.
         */
        sta->ht_cap.ht_supported = true;
        sta->ht_cap.cap = 0x6f;
        sta->ht_cap.mcs.rx_mask[0] = 0xff;
        sta->ht_cap.mcs.rx_mask[1] = 0xff;
        sta->ht_cap.ampdu_factor = 0x3;
        sta->ht_cap.ampdu_density = 0x5;
    }

    if (sta->ht_cap.ht_supported) {
        sta_info->is_ampdu_allowed = true;
        sta_info->is_amsdu_allowed = false;
        if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU)
            sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K;
        else
            sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_4K;
    }
    sta_info->iv16 = 1;
    sta_info->iv32 = 0;
    spin_lock_init(&sta_info->amsdu_lock);
    spin_lock_bh(&priv->sta_lock);
    list_add_tail(&sta_info->list, &priv->sta_list);
    spin_unlock_bh(&priv->sta_lock);

    if (vif->type == NL80211_IFTYPE_STATION)
        mwl_fwcmd_set_new_stn_del(hw, vif, sta->addr);

    rc = mwl_fwcmd_set_new_stn_add(hw, vif, sta);

    for (i = 0; i < NUM_WEP_KEYS; i++) {
        key = (struct ieee80211_key_conf *)mwl_vif->wep_key_conf[i].key;

        if (mwl_vif->wep_key_conf[i].enabled)
            mwl_mac80211_set_key(hw, SET_KEY, vif, sta, key);
    }

    return rc;
}
Beispiel #2
0
static void mwl_mac80211_remove_interface(struct ieee80211_hw *hw,
					  struct ieee80211_vif *vif)
{
	struct mwl_priv *priv = hw->priv;

	switch (vif->type) {
	case NL80211_IFTYPE_AP:
	case NL80211_IFTYPE_MESH_POINT:
		mwl_fwcmd_set_new_stn_del(hw, vif, vif->addr);
		break;
	case NL80211_IFTYPE_STATION:
		mwl_fwcmd_remove_mac_addr(hw, vif, vif->addr);
		break;
	default:
		break;
	}

	mwl_mac80211_remove_vif(priv, vif);
}
Beispiel #3
0
static int mwl_mac80211_sta_remove(struct ieee80211_hw *hw,
				   struct ieee80211_vif *vif,
				   struct ieee80211_sta *sta)
{
	struct mwl_priv *priv = hw->priv;
	int rc;
	struct mwl_sta *sta_info = mwl_dev_get_sta(sta);

	mwl_tx_del_sta_amsdu_pkts(sta);

	spin_lock_bh(&priv->stream_lock);
	mwl_fwcmd_del_sta_streams(hw, sta);
	spin_unlock_bh(&priv->stream_lock);

	mwl_tx_del_pkts_via_sta(hw, sta);

	rc = mwl_fwcmd_set_new_stn_del(hw, vif, sta->addr);

	spin_lock_bh(&priv->sta_lock);
	list_del(&sta_info->list);
	spin_unlock_bh(&priv->sta_lock);

	return rc;
}