[rt2x00-users] [RFC 2/6] rt2x00: Introduce sta_add/remove callbacks

Helmut Schaa helmut.schaa at googlemail.com
Mon Jun 6 23:24:10 AEST 2011


Am Montag, 6. Juni 2011 schrieb Ivo Van Doorn:
> Hi,
> 
> > --- a/drivers/net/wireless/rt2x00/rt2x00mac.c
> > +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
> > @@ -564,6 +564,36 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> >  EXPORT_SYMBOL_GPL(rt2x00mac_set_key);
> >  #endif /* CONFIG_RT2X00_LIB_CRYPTO */
> >
> > +int rt2x00mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> > +                     struct ieee80211_sta *sta)
> > +{
> > +       struct rt2x00_dev *rt2x00dev = hw->priv;
> > +       struct rt2x00_sta *sta_priv = (struct rt2x00_sta *)sta->drv_priv;
> > +
> > +       sta_priv->wcid = rt2x00dev->ops->lib->sta_add(rt2x00dev, vif, sta);
> 
> Why can't the driver put the WCID inside the sta_priv pointer?
> That way you allow the driver to return a status back to rt2x00lib
> when sta_add failed.

Fine with me. I'll update the patch accordingly.

> > +int rt2x00mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> > +                        struct ieee80211_sta *sta)
> > +{
> > +       struct rt2x00_dev *rt2x00dev = hw->priv;
> > +       struct rt2x00_sta *sta_priv = (struct rt2x00_sta *)sta->drv_priv;
> > +
> > +       /*
> > +        * If we never sent the STA to the device no need to clean it up.
> > +        */
> > +       if (sta_priv->wcid < 0)
> > +               return 0;
> > +
> > +       rt2x00dev->ops->lib->sta_remove(rt2x00dev, sta_priv->wcid);
> > +
> > +       return 0;
> 
> The sta_remove function from the driver has an int as return value,
> so perhaps we should send that value back to mac80211?

I'll drop the return value for now since it's not used at the moment.

Thanks,
Helmut




More information about the users mailing list