diff mbox

brcmfmac: Turn off ARP offloading when configured for AP.

Message ID 1370508957-12709-1-git-send-email-arend@broadcom.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arend van Spriel June 6, 2013, 8:55 a.m. UTC
From: Hante Meuleman <meuleman@broadcom.com>

[backport of upstream commit b3657453f16a7b84eab9b93bb9a9a2901ffc70af]

ARP offloading should only be used in STA or P2P client mode. It
is currently configured once at init. When being configured for AP
ARP offloading should be turned off and when AP mode is left it can
be turned back on.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 .../net/wireless/brcm80211/brcmfmac/dhd_common.c   |   18 ---------
 .../net/wireless/brcm80211/brcmfmac/fwil_types.h   |    6 +++
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |   40 +++++++++++++++++++-
 3 files changed, 45 insertions(+), 19 deletions(-)

Comments

Ben Hutchings June 13, 2013, 2:54 a.m. UTC | #1
On Thu, 2013-06-06 at 10:55 +0200, Arend van Spriel wrote:
> From: Hante Meuleman <meuleman@broadcom.com>
> 
> [backport of upstream commit b3657453f16a7b84eab9b93bb9a9a2901ffc70af]
[...]

You didn't say which version(s) this is for, but it certainly doesn't
apply to 3.2.

Ben.
Arend van Spriel June 13, 2013, 8:22 a.m. UTC | #2
On 06/13/2013 04:54 AM, Ben Hutchings wrote:
> On Thu, 2013-06-06 at 10:55 +0200, Arend van Spriel wrote:
>> From: Hante Meuleman <meuleman@broadcom.com>
>>
>> [backport of upstream commit b3657453f16a7b84eab9b93bb9a9a2901ffc70af]
> [...]
>
> You didn't say which version(s) this is for, but it certainly doesn't
> apply to 3.2.
>
> Ben.
>

I actually did the backport because I got notified the upstream commit 
did not apply to 3.9-stable (see [1]).

Gr. AvS

[1] http://mid.gmane.org/13704614501119@kroah.org

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel June 13, 2013, 8:23 a.m. UTC | #3
On 06/13/2013 10:22 AM, Arend van Spriel wrote:
> On 06/13/2013 04:54 AM, Ben Hutchings wrote:
>> On Thu, 2013-06-06 at 10:55 +0200, Arend van Spriel wrote:
>>> From: Hante Meuleman <meuleman@broadcom.com>
>>>
>>> [backport of upstream commit b3657453f16a7b84eab9b93bb9a9a2901ffc70af]
>> [...]
>>
>> You didn't say which version(s) this is for, but it certainly doesn't
>> apply to 3.2.
>>
>> Ben.
>>
>
> I actually did the backport because I got notified the upstream commit
> did not apply to 3.9-stable (see [1]).

In 3.2 brcmfmac did not support AP mode so that explains the fact that 
is does not apply ;-)

> Gr. AvS
>
> [1] http://mid.gmane.org/13704614501119@kroah.org


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel June 19, 2013, 7:27 a.m. UTC | #4
On 06/06/2013 10:55 AM, Arend van Spriel wrote:
> From: Hante Meuleman <meuleman@broadcom.com>

Hi Greg,

I noticed your review announcement for v3.9.7 and did not see the change 
below. I sent it to stable because the original upstream commit did not 
apply. Did I miss some step in the process?

Regards,
Arend

> [backport of upstream commit b3657453f16a7b84eab9b93bb9a9a2901ffc70af]
>
> ARP offloading should only be used in STA or P2P client mode. It
> is currently configured once at init. When being configured for AP
> ARP offloading should be turned off and when AP mode is left it can
> be turned back on.
>
> Reviewed-by: Arend Van Spriel <arend@broadcom.com>
> Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
> ---
>   .../net/wireless/brcm80211/brcmfmac/dhd_common.c   |   18 ---------
>   .../net/wireless/brcm80211/brcmfmac/fwil_types.h   |    6 +++
>   .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |   40 +++++++++++++++++++-
>   3 files changed, 45 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
> index 4544342..9480e19 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
> @@ -26,7 +26,6 @@
>   #include "fwil.h"
>
>   #define PKTFILTER_BUF_SIZE		128
> -#define BRCMF_ARPOL_MODE		0xb	/* agent|snoop|peer_autoreply */
>   #define BRCMF_DEFAULT_BCN_TIMEOUT	3
>   #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME	40
>   #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME	40
> @@ -337,23 +336,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
>   		goto done;
>   	}
>
> -	/* Try to set and enable ARP offload feature, this may fail */
> -	err = brcmf_fil_iovar_int_set(ifp, "arp_ol", BRCMF_ARPOL_MODE);
> -	if (err) {
> -		brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
> -			  BRCMF_ARPOL_MODE, err);
> -		err = 0;
> -	} else {
> -		err = brcmf_fil_iovar_int_set(ifp, "arpoe", 1);
> -		if (err) {
> -			brcmf_dbg(TRACE, "failed to enable ARP offload err = %d\n",
> -				  err);
> -			err = 0;
> -		} else
> -			brcmf_dbg(TRACE, "successfully enabled ARP offload to 0x%x\n",
> -				  BRCMF_ARPOL_MODE);
> -	}
> -
>   	/* Setup packet filter */
>   	brcmf_c_pktfilter_offload_set(ifp, BRCMF_DEFAULT_PACKET_FILTER);
>   	brcmf_c_pktfilter_offload_enable(ifp, BRCMF_DEFAULT_PACKET_FILTER,
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
> index 0f2c83b..665ef69 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
> @@ -23,6 +23,12 @@
>
>   #define BRCMF_FIL_ACTION_FRAME_SIZE	1800
>
> +/* ARP Offload feature flags for arp_ol iovar */
> +#define BRCMF_ARP_OL_AGENT		0x00000001
> +#define BRCMF_ARP_OL_SNOOP		0x00000002
> +#define BRCMF_ARP_OL_HOST_AUTO_REPLY	0x00000004
> +#define BRCMF_ARP_OL_PEER_AUTO_REPLY	0x00000008
> +
>
>   enum brcmf_fil_p2p_if_types {
>   	BRCMF_FIL_P2P_IF_CLIENT,
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
> index 78da3ef..d5c4e24 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
> @@ -505,6 +505,38 @@ send_key_to_dongle(struct net_device *ndev, struct brcmf_wsec_key *key)
>   	return err;
>   }
>
> +static s32
> +brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable)
> +{
> +	s32 err;
> +	u32 mode;
> +
> +	if (enable)
> +		mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
> +	else
> +		mode = 0;
> +
> +	/* Try to set and enable ARP offload feature, this may fail, then it  */
> +	/* is simply not supported and err 0 will be returned                 */
> +	err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode);
> +	if (err) {
> +		brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
> +			  mode, err);
> +		err = 0;
> +	} else {
> +		err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
> +		if (err) {
> +			brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
> +				  enable, err);
> +			err = 0;
> +		} else
> +			brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
> +				  enable, mode);
> +	}
> +
> +	return err;
> +}
> +
>   static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
>   						     const char *name,
>   						     enum nl80211_iftype type,
> @@ -3709,6 +3741,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
>   	}
>
>   	brcmf_set_mpc(ndev, 0);
> +	brcmf_configure_arp_offload(ifp, false);
>
>   	/* find the RSN_IE */
>   	rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail,
> @@ -3815,8 +3848,10 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
>   	set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
>
>   exit:
> -	if (err)
> +	if (err) {
>   		brcmf_set_mpc(ndev, 1);
> +		brcmf_configure_arp_offload(ifp, true);
> +	}
>   	return err;
>   }
>
> @@ -3857,6 +3892,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
>   			brcmf_err("bss_enable config failed %d\n", err);
>   	}
>   	brcmf_set_mpc(ndev, 1);
> +	brcmf_configure_arp_offload(ifp, true);
>   	set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state);
>   	clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
>
> @@ -4995,6 +5031,8 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
>   	if (err)
>   		goto default_conf_out;
>
> +	brcmf_configure_arp_offload(ifp, true);
> +
>   	cfg->dongle_up = true;
>   default_conf_out:
>
>


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
gregkh@linuxfoundation.org June 19, 2013, 2:19 p.m. UTC | #5
On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
> On 06/06/2013 10:55 AM, Arend van Spriel wrote:
> >From: Hante Meuleman <meuleman@broadcom.com>
> 
> Hi Greg,
> 
> I noticed your review announcement for v3.9.7 and did not see the
> change below. I sent it to stable because the original upstream
> commit did not apply. Did I miss some step in the process?

Ah, somehow I missed your patch, sorry about that, I do have it in my
mbox.  What kernel tree(s) do you want it to be applied to?  I'll pick
it up in my next round of releases.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel June 19, 2013, 3:51 p.m. UTC | #6
On 06/19/2013 04:19 PM, Greg KH wrote:
> On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
>> On 06/06/2013 10:55 AM, Arend van Spriel wrote:
>>> From: Hante Meuleman <meuleman@broadcom.com>
>>
>> Hi Greg,
>>
>> I noticed your review announcement for v3.9.7 and did not see the
>> change below. I sent it to stable because the original upstream
>> commit did not apply. Did I miss some step in the process?
>
> Ah, somehow I missed your patch, sorry about that, I do have it in my
> mbox.  What kernel tree(s) do you want it to be applied to?  I'll pick
> it up in my next round of releases.

Thanks, Greg

I backported it for the 3.9 tree. It does not apply to 3.8 so I will 
have to create another backport if I need it there.

Regards,
Arend


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
gregkh@linuxfoundation.org June 19, 2013, 4:52 p.m. UTC | #7
On Wed, Jun 19, 2013 at 05:51:46PM +0200, Arend van Spriel wrote:
> On 06/19/2013 04:19 PM, Greg KH wrote:
> >On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
> >>On 06/06/2013 10:55 AM, Arend van Spriel wrote:
> >>>From: Hante Meuleman <meuleman@broadcom.com>
> >>
> >>Hi Greg,
> >>
> >>I noticed your review announcement for v3.9.7 and did not see the
> >>change below. I sent it to stable because the original upstream
> >>commit did not apply. Did I miss some step in the process?
> >
> >Ah, somehow I missed your patch, sorry about that, I do have it in my
> >mbox.  What kernel tree(s) do you want it to be applied to?  I'll pick
> >it up in my next round of releases.
> 
> Thanks, Greg
> 
> I backported it for the 3.9 tree. It does not apply to 3.8 so I will
> have to create another backport if I need it there.

3.8 is long dead and not maintained by me anymore, but thanks.

Next time you submit stable patches, please let us know somewhere in the
patch/subject what tree it applies to, that makes our lives much easier,
otherwise I just guess and ususally get it wrong :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
gregkh@linuxfoundation.org June 20, 2013, 7:54 p.m. UTC | #8
On Wed, Jun 19, 2013 at 07:19:20AM -0700, Greg KH wrote:
> On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
> > On 06/06/2013 10:55 AM, Arend van Spriel wrote:
> > >From: Hante Meuleman <meuleman@broadcom.com>
> > 
> > Hi Greg,
> > 
> > I noticed your review announcement for v3.9.7 and did not see the
> > change below. I sent it to stable because the original upstream
> > commit did not apply. Did I miss some step in the process?
> 
> Ah, somehow I missed your patch, sorry about that, I do have it in my
> mbox.  What kernel tree(s) do you want it to be applied to?  I'll pick
> it up in my next round of releases.

Now applied, sorry for the delay.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel July 2, 2013, 8:57 p.m. UTC | #9
On 06/19/2013 06:52 PM, Greg KH wrote:
> On Wed, Jun 19, 2013 at 05:51:46PM +0200, Arend van Spriel wrote:
>> On 06/19/2013 04:19 PM, Greg KH wrote:
>>> On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
>>>> On 06/06/2013 10:55 AM, Arend van Spriel wrote:
>>>>> From: Hante Meuleman <meuleman@broadcom.com>
>>>>
>>>> Hi Greg,
>>>>
>>>> I noticed your review announcement for v3.9.7 and did not see the
>>>> change below. I sent it to stable because the original upstream
>>>> commit did not apply. Did I miss some step in the process?
>>>
>>> Ah, somehow I missed your patch, sorry about that, I do have it in my
>>> mbox.  What kernel tree(s) do you want it to be applied to?  I'll pick
>>> it up in my next round of releases.
>>
>> Thanks, Greg
>>
>> I backported it for the 3.9 tree. It does not apply to 3.8 so I will
>> have to create another backport if I need it there.
>
> 3.8 is long dead and not maintained by me anymore, but thanks.

Hi Greg,

Forgot to ask, but it seems like Canonical is maintaining additional 
stable kernel branches. I guess I should contact them for those kernel 
versions (if I care), right?

Regards,
Arend

> Next time you submit stable patches, please let us know somewhere in the
> patch/subject what tree it applies to, that makes our lives much easier,
> otherwise I just guess and ususally get it wrong :)
>
> thanks,
>
> greg k-h
>


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafał Miłecki July 3, 2013, 4:54 a.m. UTC | #10
2013/7/2 Arend van Spriel <arend@broadcom.com>:
> On 06/19/2013 06:52 PM, Greg KH wrote:
>>
>> On Wed, Jun 19, 2013 at 05:51:46PM +0200, Arend van Spriel wrote:
>>>
>>> On 06/19/2013 04:19 PM, Greg KH wrote:
>>>>
>>>> On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
>>>>>
>>>>> On 06/06/2013 10:55 AM, Arend van Spriel wrote:
>>>>>>
>>>>>> From: Hante Meuleman <meuleman@broadcom.com>
>>>>>
>>>>>
>>>>> Hi Greg,
>>>>>
>>>>> I noticed your review announcement for v3.9.7 and did not see the
>>>>> change below. I sent it to stable because the original upstream
>>>>> commit did not apply. Did I miss some step in the process?
>>>>
>>>>
>>>> Ah, somehow I missed your patch, sorry about that, I do have it in my
>>>> mbox.  What kernel tree(s) do you want it to be applied to?  I'll pick
>>>> it up in my next round of releases.
>>>
>>>
>>> Thanks, Greg
>>>
>>> I backported it for the 3.9 tree. It does not apply to 3.8 so I will
>>> have to create another backport if I need it there.
>>
>>
>> 3.8 is long dead and not maintained by me anymore, but thanks.
>
>
> Hi Greg,
>
> Forgot to ask, but it seems like Canonical is maintaining additional stable
> kernel branches. I guess I should contact them for those kernel versions (if
> I care), right?

They track Greg's stables to pick up the patches. Know from my own
experience, I didn't have to ping anyone :)
Kamal Mostafa July 3, 2013, 11:06 p.m. UTC | #11
On Wed, 2013-07-03 at 06:54 +0200, Rafa? Mi?ecki wrote:
> 2013/7/2 Arend van Spriel <arend@broadcom.com>:
> > Hi Greg,
> >
> > Forgot to ask, but it seems like Canonical is maintaining additional stable
> > kernel branches. I guess I should contact them for those kernel versions (if
> > I care), right?
> 
> They track Greg's stables to pick up the patches. Know from my own
> experience, I didn't have to ping anyone :)
> 

Yes, we're picking up cc: stable patches automatically when they apply
to the 3.8.y.z and 3.5.y.z "extended stable" branches[0], but we
certainly appreciate specific backports for those versions when they
don't apply cleanly.

 -Kamal

[0] https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Arend van Spriel July 4, 2013, 8:27 a.m. UTC | #12
On 07/04/2013 01:06 AM, Kamal Mostafa wrote:
> On Wed, 2013-07-03 at 06:54 +0200, Rafa? Mi?ecki wrote:
>> 2013/7/2 Arend van Spriel <arend@broadcom.com>:
>>> Hi Greg,
>>>
>>> Forgot to ask, but it seems like Canonical is maintaining additional stable
>>> kernel branches. I guess I should contact them for those kernel versions (if
>>> I care), right?
>>
>> They track Greg's stables to pick up the patches. Know from my own
>> experience, I didn't have to ping anyone :)
>>
>
> Yes, we're picking up cc: stable patches automatically when they apply
> to the 3.8.y.z and 3.5.y.z "extended stable" branches[0], but we
> certainly appreciate specific backports for those versions when they
> don't apply cleanly.

Thanks, Kamal

I send a backport for 3.9 and tried it on 3.8, but it does not apply so 
I would have to backport it. I will have a look and find out where to 
send them. Probably that info is on the referred wiki.

Regards,
Arend

>   -Kamal
>
> [0] https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
>
>


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
index 4544342..9480e19 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
@@ -26,7 +26,6 @@ 
 #include "fwil.h"
 
 #define PKTFILTER_BUF_SIZE		128
-#define BRCMF_ARPOL_MODE		0xb	/* agent|snoop|peer_autoreply */
 #define BRCMF_DEFAULT_BCN_TIMEOUT	3
 #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME	40
 #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME	40
@@ -337,23 +336,6 @@  int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 		goto done;
 	}
 
-	/* Try to set and enable ARP offload feature, this may fail */
-	err = brcmf_fil_iovar_int_set(ifp, "arp_ol", BRCMF_ARPOL_MODE);
-	if (err) {
-		brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
-			  BRCMF_ARPOL_MODE, err);
-		err = 0;
-	} else {
-		err = brcmf_fil_iovar_int_set(ifp, "arpoe", 1);
-		if (err) {
-			brcmf_dbg(TRACE, "failed to enable ARP offload err = %d\n",
-				  err);
-			err = 0;
-		} else
-			brcmf_dbg(TRACE, "successfully enabled ARP offload to 0x%x\n",
-				  BRCMF_ARPOL_MODE);
-	}
-
 	/* Setup packet filter */
 	brcmf_c_pktfilter_offload_set(ifp, BRCMF_DEFAULT_PACKET_FILTER);
 	brcmf_c_pktfilter_offload_enable(ifp, BRCMF_DEFAULT_PACKET_FILTER,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
index 0f2c83b..665ef69 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
@@ -23,6 +23,12 @@ 
 
 #define BRCMF_FIL_ACTION_FRAME_SIZE	1800
 
+/* ARP Offload feature flags for arp_ol iovar */
+#define BRCMF_ARP_OL_AGENT		0x00000001
+#define BRCMF_ARP_OL_SNOOP		0x00000002
+#define BRCMF_ARP_OL_HOST_AUTO_REPLY	0x00000004
+#define BRCMF_ARP_OL_PEER_AUTO_REPLY	0x00000008
+
 
 enum brcmf_fil_p2p_if_types {
 	BRCMF_FIL_P2P_IF_CLIENT,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 78da3ef..d5c4e24 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -505,6 +505,38 @@  send_key_to_dongle(struct net_device *ndev, struct brcmf_wsec_key *key)
 	return err;
 }
 
+static s32
+brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable)
+{
+	s32 err;
+	u32 mode;
+
+	if (enable)
+		mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
+	else
+		mode = 0;
+
+	/* Try to set and enable ARP offload feature, this may fail, then it  */
+	/* is simply not supported and err 0 will be returned                 */
+	err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode);
+	if (err) {
+		brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
+			  mode, err);
+		err = 0;
+	} else {
+		err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
+		if (err) {
+			brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
+				  enable, err);
+			err = 0;
+		} else
+			brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
+				  enable, mode);
+	}
+
+	return err;
+}
+
 static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
 						     const char *name,
 						     enum nl80211_iftype type,
@@ -3709,6 +3741,7 @@  brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
 	}
 
 	brcmf_set_mpc(ndev, 0);
+	brcmf_configure_arp_offload(ifp, false);
 
 	/* find the RSN_IE */
 	rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail,
@@ -3815,8 +3848,10 @@  brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
 	set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
 
 exit:
-	if (err)
+	if (err) {
 		brcmf_set_mpc(ndev, 1);
+		brcmf_configure_arp_offload(ifp, true);
+	}
 	return err;
 }
 
@@ -3857,6 +3892,7 @@  static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
 			brcmf_err("bss_enable config failed %d\n", err);
 	}
 	brcmf_set_mpc(ndev, 1);
+	brcmf_configure_arp_offload(ifp, true);
 	set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state);
 	clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
 
@@ -4995,6 +5031,8 @@  static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
 	if (err)
 		goto default_conf_out;
 
+	brcmf_configure_arp_offload(ifp, true);
+
 	cfg->dongle_up = true;
 default_conf_out: