linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	"Franky Lin" <frankyl@broadcom.com>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH v2 16/17] brcm80211: fmac: remove state from brcmf_if in fullmac
Date: Fri, 21 Oct 2011 16:16:34 +0200	[thread overview]
Message-ID: <1319206595-17138-17-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1319206595-17138-1-git-send-email-arend@broadcom.com>

From: Franky Lin <frankyl@broadcom.com>

The usage of state decrease readability. Optimize the code flow to
get rid of it

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/dhd.h      |    1 -
 .../net/wireless/brcm80211/brcmfmac/dhd_linux.c    |   10 ++--------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
index a96a91f..6da519e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
@@ -122,7 +122,6 @@
 
 /* For supporting multiple interfaces */
 #define BRCMF_MAX_IFS	16
-#define BRCMF_DEL_IF	-0xe
 
 #define DOT11_BSSTYPE_ANY			2
 #define DOT11_MAX_DEFAULT_KEYS	4
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index 394577a..719fd93 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -58,7 +58,6 @@ struct brcmf_if {
 	struct net_device *ndev;
 	struct net_device_stats stats;
 	int idx;		/* iface idx in dongle */
-	int state;		/* interface state */
 	u8 mac_addr[ETH_ALEN];	/* assigned MAC address */
 };
 
@@ -456,12 +455,10 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
 					  skb_mac_header(skb),
 					  &event, &data);
 
-		if (drvr_priv->iflist[ifidx] &&
-		    !drvr_priv->iflist[ifidx]->state)
+		if (drvr_priv->iflist[ifidx]) {
 			ifp = drvr_priv->iflist[ifidx];
-
-		if (ifp->ndev)
 			ifp->ndev->last_rx = jiffies;
+		}
 
 		drvr->dstats.rx_bytes += skb->len;
 		drvr->rx_packets++;	/* Local count */
@@ -896,7 +893,6 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, char *name, u8 *mac_addr)
 	ifp->ndev = ndev;
 	ifp->info = drvr_priv;
 	drvr_priv->iflist[ifidx] = ifp;
-	ifp->state = BRCMF_E_IF_ADD;
 	ifp->idx = ifidx;
 	if (mac_addr != NULL)
 		memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);
@@ -910,7 +906,6 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, char *name, u8 *mac_addr)
 
 	brcmf_dbg(TRACE, " ==== pid:%x, net_device for if:%s created ===\n",
 		  current->pid, ifp->ndev->name);
-	ifp->state = 0;
 
 	return 0;
 }
@@ -926,7 +921,6 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
 		brcmf_dbg(ERROR, "Null interface\n");
 		return;
 	}
-	ifp->state = BRCMF_E_IF_DEL;
 	if (ifp->ndev) {
 		if (ifidx == 0) {
 			if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
-- 
1.7.4.1



  parent reply	other threads:[~2011-10-21 14:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 14:16 [PATCH v2 00/17] fix mac80211 callback in brcmsmac and brcmfmac refactor Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 01/17] brcm80211: fmac: allow wd timer to be disabled when bus down Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 02/17] brcm80211: fmac: use brcmf_del_if for all net devices Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 03/17] brcm80211: smac: removed MPC related code Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 04/17] brcm80211: smac: removed MPC related variables Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 05/17] brcm80211: smac: removed down-on-watchdog MPC functionality Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 06/17] brcm80211: smac: removed down-on-rf-kill functionality Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 07/17] brcm80211: smac: bugfix for tx mute in brcms_b_init() Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 08/17] brcm80211: smac: fixed inconsistency in transmit mute Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 09/17] brcm80211: smac: modified Mac80211 callback interface Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 10/17] brcm80211: smac: mute transmit on ops_start Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 11/17] brcm80211: smac: changed check to confirm STA only support Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 12/17] brcm80211: smac: rename buffer endianess conversion functions Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 13/17] brcm80211: smac: use sk_buff list for handling frames in receive path Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 14/17] brcm80211: fmac: use brcmf_add_if for all net devices Arend van Spriel
2011-10-21 14:16 ` [PATCH v2 15/17] brcm80211: fmac: store brcmf_if in net device private data Arend van Spriel
2011-10-21 14:16 ` Arend van Spriel [this message]
2011-10-21 14:16 ` [PATCH v2 17/17] brcm80211: smac: change buffer endianess convert function interface Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319206595-17138-17-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=frankyl@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).