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

Commit cab51188 authored by Ramanasarvesh Sadula's avatar Ramanasarvesh Sadula Committed by Dundi Raviteja
Browse files

wlan: Migrate to 4.14 kernel for destructor

Added API hdd_dev_setup_destructor to support for destructor
to free netdev for more than kernel version 4.14

Change-Id: I32a1019c249b72bd37bf2d8fc6bd1f3e43dd13fe
CRs-Fixed: 2696062
parent 3394facd
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2349,6 +2349,18 @@ hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
}
#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
static inline void hdd_dev_setup_destructor(struct net_device *dev)
{
   dev->destructor = free_netdev;
}
#else
static inline void hdd_dev_setup_destructor(struct net_device *dev)
{
   dev->needs_free_netdev = true;
}
#endif /* KERNEL_VERSION(4, 12, 0) */

/*
 * hdd_parse_disable_chn_cmd() - Parse the channel list received
 * in command.
+1 −2
Original line number Diff line number Diff line
@@ -5738,8 +5738,7 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd
    
        vos_mem_copy(pWlanHostapdDev->dev_addr, (void *)macAddr,sizeof(tSirMacAddr));
        vos_mem_copy(pHostapdAdapter->macAddressCurrent.bytes, (void *)macAddr, sizeof(tSirMacAddr));

        pWlanHostapdDev->destructor = free_netdev;
        hdd_dev_setup_destructor(pWlanHostapdDev);
        pWlanHostapdDev->ieee80211_ptr = &pHostapdAdapter->wdev ;
        pHostapdAdapter->wdev.wiphy = pHddCtx->wiphy;  
        pHostapdAdapter->wdev.netdev =  pWlanHostapdDev;
+1 −1
Original line number Diff line number Diff line
@@ -9165,7 +9165,7 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac
      hdd_set_station_ops( pAdapter->dev );
      pWlanDev->destructor = free_netdev;
      hdd_dev_setup_destructor(pWlanDev);
      pWlanDev->ieee80211_ptr = &pAdapter->wdev ;
      pAdapter->wdev.wiphy = pHddCtx->wiphy;  
      pAdapter->wdev.netdev =  pWlanDev;