Search Linux Wireless

Re: [PATCH 3/4] brcmfmac: set net carrier on via test tool for AP mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/19/2020 1:09 PM, Chi-Hsien Lin wrote:
From: Kurt Lee <kurt.lee@xxxxxxxxxxx>

In manufacturing line, test tool may be used to enable SoftAP. Such
SoftAP can't pass traffic because netif carrier is off by default. To
allow such use case, let brcmfmac parse ioctl cmd, and then set iftype
to ap mode and report netif_carrier_on to upper layer.

Signed-off-by: Kurt Lee <kurt.lee@xxxxxxxxxxx>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@xxxxxxxxxxx>
---
  .../net/wireless/broadcom/brcm80211/brcmfmac/vendor.c    | 9 +++++++++
  1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c
index d07e7c7355d9..5edf5ac1167a 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c
@@ -64,6 +64,15 @@ static int brcmf_cfg80211_vndr_cmds_dcmd_handler(struct wiphy *wiphy,
                 *(char *)(dcmd_buf + len)  = '\0';
         }

+       if (cmdhdr->cmd == BRCMF_C_SET_AP) {
+               if (*(int *)(dcmd_buf) == 1) {
+                       ifp->vif->wdev.iftype = NL80211_IFTYPE_AP;
+                       brcmf_net_setcarrier(ifp, true);
+               } else {
+                       ifp->vif->wdev.iftype = NL80211_IFTYPE_STATION;
+               }
+       }
+

I prefer to keep this code path as flat as possible so I prefer no monitoring of firmware commands issued by user-space. Maybe another approach would be to set the carrier on a firmware event?

Regards,
Arend



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux