func: static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy const char unsigned char enum nl80211_iftype u32 struct vif_params *params) struct wireless_dev * wdev ; int err ; err = brcmf_vif_add_validate ( wiphy_to_cfg ( wiphy ) , type ); static int brcmf_vif_add_validate(struct brcmf_cfg80211_info enum nl80211_iftype new_type) int iftype_num [ NUM_NL80211_IFTYPES ] ; struct brcmf_cfg80211_vif * pos ; iftype_num [ pos -> wdev . iftype ] ++; iftype_num [ new_type ] ++; return cfg80211_check_combinations ( cfg -> wiphy , 1 , 0 , iftype_num ) ; if ( err )  switch ( type )  wdev = brcmf_ap_add_vif ( wiphy , name , flags , params );  struct wireless_dev *brcmf_ap_add_vif(struct wiphy *wiphy, const char u32 *flags, struct vif_params *params) struct brcmf_cfg80211_info * cfg = wiphy_to_cfg ( wiphy ) ; struct brcmf_if * ifp = netdev_priv ( cfg_to_ndev ( cfg ) ) ; struct brcmf_cfg80211_vif * vif ; int err ; if ( brcmf_cfg80211_vif_event_armed ( cfg ) )  bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg) struct brcmf_cfg80211_vif_event * event = & cfg -> vif_event ; bool armed ; armed = event -> vif != NULL; return armed ; vif = brcmf_alloc_vif ( cfg , NL80211_IFTYPE_AP , false ); struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info enum nl80211_iftype bool pm_block) struct brcmf_cfg80211_vif * vif ; bool mbss ; vif = kzalloc ( sizeof ( * vif ) , GFP_KERNEL ); if ( ! vif )  return ERR_PTR ( - ENOMEM ) ; vif -> wdev . wiphy = cfg -> wiphy; vif -> wdev . iftype = type; vif -> pm_block = pm_block; if ( type == NL80211_IFTYPE_AP )  mbss = false; vif -> mbss = mbss; return vif ; if ( IS_ERR ( vif ) )  err = brcmf_cfg80211_request_ap_if ( ifp ); static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp) struct brcmf_mbss_ssid_le mbss_ssid_le ; int bsscfgidx ; memset ( & mbss_ssid_le , 0 , sizeof ( mbss_ssid_le ) ); bsscfgidx = brcmf_get_next_free_bsscfgidx ( ifp -> drvr ); if ( bsscfgidx < 0 )  mbss_ssid_le . bsscfgidx = cpu_to_le32 ( bsscfgidx ); mbss_ssid_le . SSID_len = cpu_to_le32 ( 5 ); sprintf ( mbss_ssid_le . SSID , "ssid%d" , bsscfgidx ); err = brcmf_fil_bsscfg_data_set ( ifp , "bsscfg:ssid" , & mbss_ssid_le , sizeof ( mbss_ssid_le ) ); if ( err < 0 )  brcmf_err ( "setting ssid failed %d\n" , err ); return err ; 