Search Linux Wireless

Re: [RFC 2/2] mac80211: unify config_interface and bss_info_changed

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

 



Hi Reinette,

Thanks for your comments!

> >  #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
> >  void iwl_bss_info_changed(struct ieee80211_hw *hw,
> > -                                    struct ieee80211_vif *vif,
> > -                                    struct ieee80211_bss_conf *bss_conf,
> > -                                    u32 changes)
> > +                         struct ieee80211_vif *vif,
> > +                         struct ieee80211_bss_conf *bss_conf,
> > +                         u32 changes)
> >  {
> >         struct iwl_priv *priv = hw->priv;
> >         int ret;
> > 
> >         IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes);
> > 
> > +       if (!iwl_is_alive(priv))
> > +               return;
> > +
> > +       mutex_lock(&priv->mutex);
> > +
> > +       if ((changes & BSS_CHANGED_BSSID) && !iwl_is_rfkill(priv)) {
> > +               /* If there is currently a HW scan going on in the background
> > +                * then we need to cancel it else the RXON below will fail. */
> > +               if (iwl_scan_cancel_timeout(priv, 100)) {
> > +                       IWL_WARN(priv, "Aborted scan still in progress "
> > +                                   "after 100ms\n");
> > +                       IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
> > +                       mutex_unlock(&priv->mutex);
> > +                       return;
> > +               }
> > +               memcpy(priv->staging_rxon.bssid_addr,
> > +                      bss_conf->bssid, ETH_ALEN);
> > +
> > +               /* TODO: Audit driver for usage of these members and see
> > +                * if mac80211 deprecates them (priv->bssid looks like it
> > +                * shouldn't be there, but I haven't scanned the IBSS code
> > +                * to verify) - jpk */
> > +               memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN);
> > +
> > +               if (priv->iw_mode == NL80211_IFTYPE_AP)
> > +                       iwlcore_config_ap(priv);
> > +               else {
> > +                       int rc = iwlcore_commit_rxon(priv);
> > +                       if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
> > +                               iwl_rxon_add_station(
> > +                                       priv, priv->active_rxon.bssid_addr, 1);
> > +               }
> > +       } else {
> > +               iwl_scan_cancel_timeout(priv, 100);
> > +               priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
> > +               iwlcore_commit_rxon(priv);
> > +       }
> 
> I do not think the above if clause fully captures what was done in
> iwl_mac_config_interface(). If rfkill is enabled we do not want to send
> a command to the device. This is possible in this else clause. Perhaps
> the else can have an extra check like ...
> 
> ...
> } else if (!iwl_is_rfkill(priv)) {
> ...

Oh indeed. That looks like a bug. The entire thing was rather odd -- I
first had the code below the rest of bss_info_changed and then it just
didn't work at all. Seems iwlwifi implicitly relied on an undocumented
call ordering in mac80211 :)

> Why did you choose not to copy the code dealing with AP mode from
> iwl_mac_config_interface()? I know that the driver does not currently
> support it, but removing this code makes it harder for the case if this
> support is added back. Considering the code is not currently used, would
> you be ok with adding it as commented code?

Sure. It was just that I looked at the code:

> > -       if (priv->iw_mode == NL80211_IFTYPE_AP) {
> > -               if (!conf->bssid) {
> > -                       conf->bssid = priv->mac_addr;
> > -                       memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
> > -                       IWL_DEBUG_MAC80211(priv, "bssid was set to: %pM\n",
> > -                                          conf->bssid);
> > -               }
> > -               if (priv->ibss_beacon)
> > -                       dev_kfree_skb(priv->ibss_beacon);
> > -
> > -               priv->ibss_beacon = ieee80211_beacon_get(hw, vif);
> > -       }

and it didn't seem to make any sense to me. ibss_beacon? Also, it
doesn't depend on configuration that the beacon changed? Either way, I
can add the code back, maybe with a small cleanup.

Thanks,
johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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