Search Linux Wireless

Re: [PATCH 2/3] ath9k: Add change_interface callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 26, 2010 at 6:54 PM, Rajkumar Manoharan
<rmanoharan@xxxxxxxxxxx> wrote:
> Add support to change interface type
> without bringing down the interface.
>
> Signed-off-by: Rajkumar Manoharan <rmanoharan@xxxxxxxxxxx>
> ---
[snip]
> +static int ath9k_change_interface(struct ieee80211_hw *hw,
> +                                 struct ieee80211_vif *vif,
> +                                 enum nl80211_iftype new_type,
> +                                 bool p2p)
> +{
> +       struct ath_wiphy *aphy = hw->priv;
> +       struct ath_softc *sc = aphy->sc;
> +       struct ath_common *common = ath9k_hw_common(sc->sc_ah);
> +
> +       ath_print(common, ATH_DBG_CONFIG, "Change Interface\n");
> +       mutex_lock(&sc->mutex);
> +
> +       new_type = ieee80211_iftype_p2p(new_type, p2p);
> +
> +       switch (new_type) {
> +       case NL80211_IFTYPE_AP:
> +       case NL80211_IFTYPE_ADHOC:
> +               break;

If you have to reclaim beacon in the case where you go from AP -> STA
(replicate remove_interface), don't you have to replicate what
add_interface does in this case, e.g. the check below etc?

                if (sc->nbcnvifs >= ATH_BCBUF) {
                        ret = -ENOBUFS;
                        goto out;
                }

> +       case NL80211_IFTYPE_STATION:
> +               /* Stop ANI */
> +               sc->sc_flags &= ~SC_OP_ANI_RUN;
> +               del_timer_sync(&common->ani.timer);
> +               if ((vif->type == NL80211_IFTYPE_AP) ||
> +                   (vif->type == NL80211_IFTYPE_ADHOC))
> +                       ath9k_reclaim_beacon(sc, vif);
> +               break;
> +       default:
> +               ath_print(common, ATH_DBG_FATAL,
> +                       "Interface type %d not yet supported\n", vif->type);
> +               mutex_unlock(&sc->mutex);
> +               return -ENOTSUPP;
> +       }
> +       vif->type = new_type;
> +
> +       mutex_unlock(&sc->mutex);
> +       return 0;
> +}

Also, doesn't this patch introduce yet another race condition between
configuration change in process context and bcn_tasklet?

/Björn
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux