linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eliad Peller <eliad@wizery.com>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v7] ath5k: Allow ath5k to support virtual STA and AP interfaces.
Date: Wed, 29 Sep 2010 10:54:57 +0200	[thread overview]
Message-ID: <4CA2FEE1.7030104@wizery.com> (raw)
In-Reply-To: <1285720744-26246-1-git-send-email-greearb@candelatech.com>

On 09/29/2010 02:39 AM, greearb@candelatech.com wrote:
> @@ -2687,31 +2784,79 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
> +
> +	/* Set combined mode - when APs are configured, operate in AP mode.
> +	 * Otherwise use the mode of the new interface. This can currently
> +	 * only deal with combinations of APs and STAs I think ...
> +	 * TODO:  What to do about mixed ADHOC + STA ?
> +	 */
> +	if (sc->num_ap_vifs)
> +		sc->opmode = NL80211_IFTYPE_AP;
> +	else
> +		sc->opmode = vif->type;
> +
> +	ath5k_hw_set_opmode(ah, sc->opmode);
> +
> +	/* Any MAC address is fine, all others are included through the
> +	 * filter.
> +	 */
> +	memcpy(&sc->lladdr, vif->addr, ETH_ALEN);
>   	ath5k_hw_set_lladdr(sc->ah, vif->addr);
> -	ath5k_mode_setup(sc);
> +
> +	memcpy(&avf->lladdr, vif->addr, ETH_ALEN);
> +
> +	ath5k_mode_setup(sc, vif);
>    

i guess you'd also like to add similar logic upon interface removal.
> @@ -2724,15 +2869,29 @@ ath5k_remove_interface(struct ieee80211_hw *hw,
>   			struct ieee80211_vif *vif)
>   {
>   	struct ath5k_softc *sc = hw->priv;
> -	u8 mac[ETH_ALEN] = {};
> +	struct ath5k_vif *avf = (void *)vif->drv_priv;
> +	unsigned int i;
>
>   	mutex_lock(&sc->lock);
> -	if (sc->vif != vif)
> -		goto end;
> +	sc->nvifs--;
> +
> +	if (avf->bbuf) {
> +		ath5k_txbuf_free_skb(sc, avf->bbuf);
> +		list_add_tail(&avf->bbuf->list,&sc->bcbuf);
> +		for (i = 0; i<  ATH_BCBUF; i++) {
> +			if (sc->bslot[i] == vif) {
> +				sc->bslot[i] = NULL;
> +				break;
> +			}
> +		}
> +		avf->bbuf = NULL;
> +	}
> +	if (avf->opmode == NL80211_IFTYPE_AP)
> +		sc->num_ap_vifs--;
> +	else if (avf->opmode == NL80211_IFTYPE_ADHOC)
> +		sc->num_adhoc_vifs--;
>
> -	ath5k_hw_set_lladdr(sc->ah, mac);
> -	sc->vif = NULL;
> -end:
> +	ath5k_update_bssid_mask(sc, NULL);
>   	mutex_unlock(&sc->lock);
>   }
>
>    

Eliad.

  reply	other threads:[~2010-09-29  8:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29  0:39 [PATCH v7] ath5k: Allow ath5k to support virtual STA and AP interfaces greearb
2010-09-29  8:54 ` Eliad Peller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-09-29 17:02 greearb
2010-09-29 17:03 ` Ben Greear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CA2FEE1.7030104@wizery.com \
    --to=eliad@wizery.com \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).