[RK3288][Android6.0] WiFi之从Linkspeed看获取流程

Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

WiFi的(Link speed)连接速度可以从Settings里查看
[RK3288][Android6.0] WiFi之从Linkspeed看获取流程_第1张图片

从连接速度来看下获取WiFi信息的流程

public int getLinkSpeed() {

    return mLinkSpeed;
}

mLinkSpeed在fetchRssiLinkSpeedAndFrequencyNative()得到

fetchRssiLinkSpeedAndFrequencyNative -> WifiStateMachine.java
  mWifiNative.signalPoll  ->
    doStringCommandWithoutLogging -> //cmd: SIGNAL_POLL
      doStringCommandNative -> //通过socket发给WPAS处理
        android_net_wifi_doStringCommand ->
          doStringCommand ->
            wpa_supplicant_ctrl_iface_receive -> Ctrl_iface_unix.c //WPAS端socket接收处理函数
              wpa_supplicant_ctrl_iface_process -> Ctrl_iface.c
                wpa_supplicant_signal_poll ->
                  wpa_drv_signal_poll ->
                    wpa_s->driver->signal_poll ->
                      nl80211_signal_poll -> Driver_nl80211.c
                        nl80211_get_link_signal ->
                          nl80211_drv_msg //msg的flag是NL80211_CMD_GET_STATION
                            send_and_recv_msgs -> //通过netlink发送给kernel driver,回调函数是get_link_signal(),用来解析收到的packet
                              nl80211_get_station ->  nl80211.c //driver中对应的操作函数集在nl80211_ops中,这里是nl80211_get_station
                                rdev_get_station ->
                                  rdev->ops->get_station ->
                                    wl_cfg80211_get_station -> Wl_cfg80211.c
                                      wldev_ioctl //cmd是WLC_GET_RATE
                             

你可能感兴趣的:(子类__WiFi,WiFi,LinkSpeed)