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

Ivo Van Doorn ivdoorn at gmail.com
Mon Jun 6 23:58:29 AEST 2011


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.

Thanks

>> > +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.

No please keep the return value, that the mac80211 callback also has it,
so we might as well keep in sync with that callback. :)

Ivo




More information about the users mailing list