12 Replies Latest reply on Jul 12, 2016 2:04 PM by venkats_16

    Issue with P2P on i.MX6SL EVK with 1DX module




      we are facing an issue with the P2P mode of the 1DX module on when running on i.MX6SL EVK with 1DX dev kit and Linux Kernel 3.14.52 (from Freescale's git repository).


      This problem is related to the re-establishment of a P2P GO using bcmdhd, controlled by wpa_supplicant.  After boot, a persistent P2P GO is enabled successfully.  Stations can connect and disconnect with no problems.  The P2P GO is then removed and a new P2P GO is enabled using the wpa_supplicant P2P_GROUP_ADD and P2P_GROUP_REMOVE commands.  The MAC correctly starts beaconing in its role as a P2P GO but any attempt to associate fails.  Although WLC_E_ASSOC_IND events are sent to bcmdhd, they are ignored with the error:


      (CFG80211-ERROR) wl_notify_connect_status : Invalid ndev status -1


      This occurs because wl_get_mode_by_netdev() fails to match the ndev to an ndev in the net_list for the driver.  This condition is caused by a failure to deallocate the net_info corresponding to the previously removed P2P GO. Because the deallocation failed, at the point the P2P GO is re-enabled, the net_list already holds the maximum number of net_info structures for the following interfaces:



      p2p-wlan0-0   (this should have been removed)


      During the call to wl_cfg80211_add_virtual_iface() to add the re-enabled P2P GO, wl_alloc_netinfo() is called to allocate a netinfo for the new interface.  This is the allocation that fails.  The failure return value is however ignored by wl_cfg80211_add_virtual_iface() which ploughs ahead with the setup.


      The cause of the allocation failure is actually the failure of the deallocation that occurred when the previous P2P GO was removed. Although wl_dealloc_netinfo() is called as a result of a call to wl_cfg80211_del_virtual_iface(), the ndev parameter never matches any of the devices in the net_list so nothing actually gets removed.  When wl_cfg80211_handle_ifdel() is called during the P2P GO removal, wl_cfg80211_remove_if() is called that leads to the failed call to wl_dealloc_netinfo().


      As a work-around, calling wl_dealloc_netinfo(cfg, ndev) directly after the call to wl_cfg80211_remove_if(cfg, if_event_info->ifidx, ndev) makes the problem go away.  This is almost certainly not the correct fix but I’ve included it to help illustrate the problem.


      static s32 wl_cfg80211_handle_ifdel(struct bcm_cfg80211 *cfg, wl_if_event_info *if_event_info,

      struct net_device* ndev)



      . . . .



      #if defined(BCMSDIO)

      dhd_wlfc_get_enable(dhd, &enabled);

      if (enabled && cfg->wlfc_on && dhd->op_mode != DHD_FLAG_HOSTAP_MODE &&

      dhd->op_mode != DHD_FLAG_IBSS_MODE) {


      cfg->wlfc_on = false;



      #endif /* PROP_TXSTATUS_VSDB */



      printk("wl_cfg80211_handle_ifdel if_event_info->ifidx: %d ndev->ifindex %d name: %s\n", if_event_info->ifidx, ndev->ifindex, ndev->name);

      wl_cfg80211_remove_if(cfg, if_event_info->ifidx, ndev);


      // *** work-around successfully removes correct netinfo

      wl_dealloc_netinfo(cfg, ndev);


      return BCME_OK;



      Does anybody have any insight on this ? Can somebody confirm/deny the issue ?



      Raul Benet