Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a49cbc5f authored by Amar Singhal's avatar Amar Singhal Committed by Madan Mohan Koyyalamudi
Browse files

wlan: linux regulatory changes

Properly separate out the regulatory changes when CONFIG_ENABLE_LINUX_REG
is defined and when it is not defined.

Change-Id: Ia01777a8b2e18a52b532e460a9ebcb1ab3196e50
CRs-Fixed: 538940
parent 623f659d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -172,6 +172,12 @@ void wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, struct regulatory_request
#else
int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
#endif
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
void wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
#else
int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
#endif
#endif

extern v_VOID_t hdd_connSetConnectionState( hdd_station_ctx_t *pHddStaCtx,
+8 −0
Original line number Diff line number Diff line
@@ -138,7 +138,11 @@
#define WAIT_TIME_TDLS_INITIATOR    600

/* Maximum time to get linux regulatory entry settings */
#ifdef CONFIG_ENABLE_LINUX_REG
#define LINUX_REG_WAIT_TIME 300
#else
#define CRDA_WAIT_TIME 300
#endif

/* Scan Req Timeout */
#define WLAN_WAIT_TIME_SCAN_REQ 100
@@ -1022,7 +1026,11 @@ struct hdd_context_s
   struct completion mc_sus_event_var;

   /* Completion variable for regulatory hint  */
#ifdef CONFIG_ENABLE_LINUX_REG
   struct completion linux_reg_req;
#else
   struct completion driver_crda_req;
#endif

   v_BOOL_t isWlanSuspended;

+7 −0
Original line number Diff line number Diff line
@@ -639,17 +639,22 @@ int wlan_hdd_cfg80211_init(struct device *dev,

    wiphy->mgmt_stypes = wlan_hdd_txrx_stypes;

    wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;


    /* This will disable updating of NL channels from passive to
     * active if a beacon is received on passive channel. */
    wiphy->flags |=   WIPHY_FLAG_DISABLE_BEACON_HINTS;



#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
    wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME
                 |  WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD
                 |  WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL
                    | WIPHY_FLAG_OFFCHAN_TX;
#endif

#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    if (pCfg->isFastTransitionEnabled
#ifdef FEATURE_WLAN_LFR
@@ -682,6 +687,8 @@ int wlan_hdd_cfg80211_init(struct device *dev,
       regulatory settings */

    wiphy->reg_notifier = wlan_hdd_linux_reg_notifier;
#else
    wiphy->reg_notifier = wlan_hdd_crda_reg_notifier;
#endif

    wiphy->max_scan_ssids = MAX_SCAN_SSID;
+30 −3
Original line number Diff line number Diff line
@@ -6725,7 +6725,12 @@ int hdd_wlan_startup(struct device *dev )
   init_completion(&pHddCtx->req_bmps_comp_var);
   init_completion(&pHddCtx->scan_info.scan_req_completion_event);
   init_completion(&pHddCtx->scan_info.abortscan_event_var);

#ifdef CONFIG_ENABLE_LINUX_REG
   init_completion(&pHddCtx->linux_reg_req);
#else
   init_completion(&pHddCtx->driver_crda_req);
#endif

   spin_lock_init(&pHddCtx->schedScan_lock);

@@ -6870,11 +6875,20 @@ int hdd_wlan_startup(struct device *dev )
      goto err_wdclose;
   }

#ifdef CONFIG_ENABLE_LINUX_REG
   /* registration of wiphy dev with cfg80211 */
   if (0 > wlan_hdd_cfg80211_register(wiphy))
   {
       hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wiphy register failed", __func__);
       goto err_clkvote;
   }
#endif

   status = vos_open( &pVosContext, 0);
   if ( !VOS_IS_STATUS_SUCCESS( status ))
   {
      hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_open failed", __func__);
      goto err_clkvote;
      goto err_wiphy_unregister;
   }

   pHddCtx->hHal = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, pVosContext );
@@ -7015,6 +7029,8 @@ int hdd_wlan_startup(struct device *dev )
         __func__);
      goto err_vosstop;
   }

#ifndef CONFIG_ENABLE_LINUX_REG
   wlan_hdd_cfg80211_update_reg_info( wiphy );

   /* registration of wiphy dev with cfg80211 */
@@ -7023,6 +7039,7 @@ int hdd_wlan_startup(struct device *dev )
       hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wiphy register failed", __func__);
       goto err_vosstop;
   }
#endif

   if (VOS_STA_SAP_MODE == hdd_get_conparam())
   {
@@ -7267,7 +7284,10 @@ int hdd_wlan_startup(struct device *dev )

err_close_adapter:
   hdd_close_all_adapters( pHddCtx );

#ifndef CONFIG_ENABLE_LINUX_REG
   wiphy_unregister(wiphy) ;
#endif

err_vosstop:
   vos_stop(pVosContext);
@@ -7281,7 +7301,14 @@ int hdd_wlan_startup(struct device *dev )
   }
   vos_close(pVosContext );

err_wiphy_unregister:

#ifdef CONFIG_ENABLE_LINUX_REG
   wiphy_unregister(wiphy);

err_clkvote:
#endif

   vos_chipVoteOffXOBuffer(NULL, NULL, NULL);

err_wdclose:
+1060 −767

File changed.

Preview size limit exceeded, changes collapsed.