func: static brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device int idx, u8 *mac, struct station_info *sinfo) struct brcmf_cfg80211_info * cfg = wiphy_to_cfg ( wiphy ) ; struct brcmf_if * ifp = netdev_priv ( ndev ) ; s32 err ; if ( idx == 0 )  cfg -> assoclist . count = cpu_to_le32 ( BRCMF_MAX_ASSOCLIST ); err = brcmf_fil_cmd_data_get ( ifp , BRCMF_C_GET_ASSOCLIST , & cfg -> assoclist , sizeof ( cfg -> assoclist ) ); if ( err )  if ( idx < le32_to_cpu ( cfg -> assoclist . count ) )  return brcmf_cfg80211_get_station ( wiphy , ndev , mac , sinfo ) ; static brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device const u8 *mac, struct station_info *sinfo) struct brcmf_if * ifp = netdev_priv ( ndev ) ; struct brcmf_scb_val_le scb_val ; struct brcmf_sta_info_le sta_info_le ; u32 sta_flags ; u32 is_tdls_peer ; s32 count_rssi ; u32 i ; if ( ! check_vif_up ( ifp -> vif ) )  static bool check_vif_up(struct brcmf_cfg80211_vif *vif) if ( ! test_bit ( BRCMF_VIF_STATUS_READY , & vif -> sme_state ) )  return false ; return true ; if ( brcmf_is_ibssmode ( ifp -> vif ) )  static bool brcmf_is_ibssmode(struct brcmf_cfg80211_vif *vif) return vif -> wdev . iftype == NL80211_IFTYPE_ADHOC ; memset ( & sta_info_le , 0 , sizeof ( sta_info_le ) ); memcpy ( & sta_info_le , mac , ETH_ALEN ); err = brcmf_fil_iovar_data_get ( ifp , "tdls_sta_info" , & sta_info_le , sizeof ( sta_info_le ) ); is_tdls_peer = ! err; if ( err )  err = brcmf_fil_iovar_data_get ( ifp , "sta_info" , & sta_info_le , sizeof ( sta_info_le ) ); if ( err < 0 )  sinfo -> filled = BIT ( NL80211_STA_INFO_INACTIVE_TIME ); sinfo -> inactive_time = le32_to_cpu ( sta_info_le . idle ) * 1000; sta_flags = le32_to_cpu ( sta_info_le . flags ); sinfo -> sta_flags . mask |= BIT ( NL80211_STA_FLAG_TDLS_PEER ); if ( is_tdls_peer )  sinfo -> sta_flags . set |= BIT ( NL80211_STA_FLAG_TDLS_PEER ); sinfo -> sta_flags . set &= ~BIT ( NL80211_STA_FLAG_TDLS_PEER ); if ( sta_flags & BRCMF_STA_ASSOC )  sinfo -> filled |= BIT ( NL80211_STA_INFO_CONNECTED_TIME ); sinfo -> connected_time = le32_to_cpu ( sta_info_le . in ); if ( sta_flags & BRCMF_STA_SCBSTATS )  sinfo -> filled |= BIT ( NL80211_STA_INFO_TX_FAILED ); sinfo -> tx_failed = le32_to_cpu ( sta_info_le . tx_failures ); sinfo -> filled |= BIT ( NL80211_STA_INFO_TX_PACKETS ); sinfo -> tx_packets = le32_to_cpu ( sta_info_le . tx_pkts ); sinfo -> tx_packets += le32_to_cpu ( sta_info_le . tx_mcast_pkts ); sinfo -> filled |= BIT ( NL80211_STA_INFO_RX_PACKETS ); sinfo -> rx_packets = le32_to_cpu ( sta_info_le . rx_ucast_pkts ); sinfo -> rx_packets += le32_to_cpu ( sta_info_le . rx_mcast_pkts ); if ( sinfo -> tx_packets )  sinfo -> filled |= BIT ( NL80211_STA_INFO_TX_BITRATE ); sinfo -> txrate . legacy = le32_to_cpu ( sta_info_le . tx_rate ) / 100; if ( sinfo -> rx_packets )  sinfo -> filled |= BIT ( NL80211_STA_INFO_RX_BITRATE ); sinfo -> rxrate . legacy = le32_to_cpu ( sta_info_le . rx_rate ) / 100; if ( le16_to_cpu ( sta_info_le . ver ) >= 4 )  sinfo -> filled |= BIT ( NL80211_STA_INFO_TX_BYTES ); sinfo -> tx_bytes = le64_to_cpu ( sta_info_le . tx_tot_bytes ); sinfo -> filled |= BIT ( NL80211_STA_INFO_RX_BYTES ); sinfo -> rx_bytes = le64_to_cpu ( sta_info_le . rx_tot_bytes ); count_rssi = 0; for (i = 0; i < BRCMF_ANT_MAX; i++) if ( sta_info_le . rssi [ i ] )  sinfo -> chain_signal_avg [ count_rssi ] = sta_info_le . rssi [ i ]; sinfo -> chain_signal [ count_rssi ] = sta_info_le . rssi [ i ]; count_rssi ++; if ( count_rssi )  if ( test_bit ( BRCMF_VIF_STATUS_CONNECTED , & ifp -> vif -> sme_state ) )  memset ( & scb_val , 0 , sizeof ( scb_val ) ); err = brcmf_fil_cmd_data_get ( ifp , BRCMF_C_GET_RSSI , & scb_val , sizeof ( scb_val ) ); if ( err )  brcmf_err ( "Could not get rssi (%d)\n" , err ); return err ; 