2012-04-26 20:41:44

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] mac80211: mesh: Remove un-needed defines

From: Andrei Emeltchenko <[email protected]>

ieee80211_vif_is_mesh is already defined as:

<------8<--------------------------------------------------------------
| static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
| {
| #ifdef CONFIG_MAC80211_MESH
| return vif->type == NL80211_IFTYPE_MESH_POINT;
| #endif
| return false;
| }
|
<------8<--------------------------------------------------------------

Signed-off-by: Andrei Emeltchenko <[email protected]>
---
net/mac80211/cfg.c | 4 ----
net/mac80211/rx.c | 2 --
net/mac80211/sta_info.c | 4 ----
3 files changed, 10 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 677d659..72da59d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -404,7 +404,6 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
rate_idx_to_bitrate(&sinfo->rxrate, sta, sta->last_rx_rate_idx);

if (ieee80211_vif_is_mesh(&sdata->vif)) {
-#ifdef CONFIG_MAC80211_MESH
sinfo->filled |= STATION_INFO_LLID |
STATION_INFO_PLID |
STATION_INFO_PLINK_STATE;
@@ -412,7 +411,6 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->llid = le16_to_cpu(sta->llid);
sinfo->plid = le16_to_cpu(sta->plid);
sinfo->plink_state = sta->plink_state;
-#endif
}

sinfo->bss_param.flags = 0;
@@ -862,7 +860,6 @@ static int sta_apply_parameters(struct ieee80211_local *local,
&sta->sta.ht_cap);

if (ieee80211_vif_is_mesh(&sdata->vif)) {
-#ifdef CONFIG_MAC80211_MESH
if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED)
switch (params->plink_state) {
case NL80211_PLINK_LISTEN:
@@ -883,7 +880,6 @@ static int sta_apply_parameters(struct ieee80211_local *local,
mesh_plink_block(sta);
break;
}
-#endif
}

return 0;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 760d20c..aabdfe7 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2683,10 +2683,8 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx)
CALL_RXH(ieee80211_rx_h_defragment)
CALL_RXH(ieee80211_rx_h_michael_mic_verify)
/* must be after MMIC verify so header is counted in MPDU mic */
-#ifdef CONFIG_MAC80211_MESH
if (ieee80211_vif_is_mesh(&rx->sdata->vif))
CALL_RXH(ieee80211_rx_h_mesh_fwding);
-#endif
CALL_RXH(ieee80211_rx_h_amsdu)
CALL_RXH(ieee80211_rx_h_data)
CALL_RXH(ieee80211_rx_h_ctrl);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 38137cb..af85631 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -742,10 +742,8 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
__skb_queue_purge(&sta->tx_filtered[ac]);
}

-#ifdef CONFIG_MAC80211_MESH
if (ieee80211_vif_is_mesh(&sdata->vif))
mesh_accept_plinks_update(sdata);
-#endif

#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
wiphy_debug(local->hw.wiphy, "Removed STA %pM\n", sta->sta.addr);
@@ -757,12 +755,10 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
rate_control_remove_sta_debugfs(sta);
ieee80211_sta_debugfs_remove(sta);

-#ifdef CONFIG_MAC80211_MESH
if (ieee80211_vif_is_mesh(&sta->sdata->vif)) {
mesh_plink_deactivate(sta);
del_timer_sync(&sta->plink_timer);
}
-#endif

/*
* Destroy aggregation state here. It would be nice to wait for the
--
1.7.9.5



2012-04-26 21:41:52

by Thomas Pedersen

[permalink] [raw]
Subject: Re: [PATCH] mac80211: mesh: Remove un-needed defines

Hi Andrei,

On Thu, Apr 26, 2012 at 1:41 PM, Andrei Emeltchenko
<[email protected]> wrote:
> From: Andrei Emeltchenko <[email protected]>
>
> ieee80211_vif_is_mesh is already defined as:
>
> <------8<--------------------------------------------------------------
> | ?static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
> | ?{
> | ?#ifdef CONFIG_MAC80211_MESH
> | ? ? ? ? ?return vif->type == NL80211_IFTYPE_MESH_POINT;
> | ?#endif
> | ? ? ? ? ?return false;
> | ?}
> |
> <------8<--------------------------------------------------------------
>
> Signed-off-by: Andrei Emeltchenko <[email protected]

ACK if you tested w/o CONFIG_MAC80211_MESH.

Thomas

2012-05-02 18:17:48

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mac80211: mesh: Remove un-needed defines

On Thu, Apr 26, 2012 at 02:41:32PM -0700, Thomas Pedersen wrote:
> Hi Andrei,
>
> On Thu, Apr 26, 2012 at 1:41 PM, Andrei Emeltchenko
> <[email protected]> wrote:
> > From: Andrei Emeltchenko <[email protected]>
> >
> > ieee80211_vif_is_mesh is already defined as:
> >
> > <------8<--------------------------------------------------------------
> > | ?static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
> > | ?{
> > | ?#ifdef CONFIG_MAC80211_MESH
> > | ? ? ? ? ?return vif->type == NL80211_IFTYPE_MESH_POINT;
> > | ?#endif
> > | ? ? ? ? ?return false;
> > | ?}
> > |
> > <------8<--------------------------------------------------------------
> >
> > Signed-off-by: Andrei Emeltchenko <[email protected]
>
> ACK if you tested w/o CONFIG_MAC80211_MESH.

Well...did you??

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2012-05-02 19:04:54

by Thomas Pedersen

[permalink] [raw]
Subject: Re: [PATCH] mac80211: mesh: Remove un-needed defines

On Wed, May 2, 2012 at 11:12 AM, John W. Linville
<[email protected]> wrote:
> On Thu, Apr 26, 2012 at 02:41:32PM -0700, Thomas Pedersen wrote:
>> Hi Andrei,
>>
>> On Thu, Apr 26, 2012 at 1:41 PM, Andrei Emeltchenko
>> <[email protected]> wrote:
>> > From: Andrei Emeltchenko <[email protected]>
>> >
>> > ieee80211_vif_is_mesh is already defined as:
>> >
>> > <------8<--------------------------------------------------------------
>> > | ?static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
>> > | ?{
>> > | ?#ifdef CONFIG_MAC80211_MESH
>> > | ? ? ? ? ?return vif->type == NL80211_IFTYPE_MESH_POINT;
>> > | ?#endif
>> > | ? ? ? ? ?return false;
>> > | ?}
>> > |
>> > <------8<--------------------------------------------------------------
>> >
>> > Signed-off-by: Andrei Emeltchenko <[email protected]
>>
>> ACK if you tested w/o CONFIG_MAC80211_MESH.
>
> Well...did you??

He dropped the list in his final response. No, it doesn't work.

Thomas