Lines Matching refs:usbdev
407 struct usbnet *usbdev; member
831 static int rndis_reset(struct usbnet *usbdev) in rndis_reset() argument
833 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_reset()
844 ret = rndis_command(usbdev, (void *)reset, CONTROL_BUFFER_SIZE); in rndis_reset()
955 static int set_infra_mode(struct usbnet *usbdev, int mode);
956 static void restore_keys(struct usbnet *usbdev);
957 static int rndis_check_bssid_list(struct usbnet *usbdev, u8 *match_bssid,
960 static int rndis_start_bssid_list_scan(struct usbnet *usbdev) in rndis_start_bssid_list_scan() argument
966 return rndis_set_oid(usbdev, RNDIS_OID_802_11_BSSID_LIST_SCAN, &tmp, in rndis_start_bssid_list_scan()
970 static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) in set_essid() argument
972 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_essid()
975 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_SSID, in set_essid()
978 netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret); in set_essid()
983 netdev_dbg(usbdev->net, "%s(): radio_on = true\n", __func__); in set_essid()
989 static int set_bssid(struct usbnet *usbdev, const u8 *bssid) in set_bssid() argument
993 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_BSSID, in set_bssid()
996 netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n", in set_bssid()
1004 static int clear_bssid(struct usbnet *usbdev) in clear_bssid() argument
1010 return set_bssid(usbdev, broadcast_mac); in clear_bssid()
1013 static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) in get_bssid() argument
1018 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_BSSID, in get_bssid()
1027 static int get_association_info(struct usbnet *usbdev, in get_association_info() argument
1030 return rndis_query_oid(usbdev, in get_association_info()
1035 static bool is_associated(struct usbnet *usbdev) in is_associated() argument
1037 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in is_associated()
1043 return (get_bssid(usbdev, bssid) == 0 && !is_zero_ether_addr(bssid)); in is_associated()
1046 static int disassociate(struct usbnet *usbdev, bool reset_ssid) in disassociate() argument
1048 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in disassociate()
1053 ret = rndis_set_oid(usbdev, in disassociate()
1058 netdev_dbg(usbdev->net, "%s(): radio_on = false\n", in disassociate()
1072 set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); in disassociate()
1080 ret = set_essid(usbdev, &ssid); in disassociate()
1085 static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, in set_auth_mode() argument
1088 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_auth_mode()
1092 netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x authalg=0x%x keymgmt=0x%x\n", in set_auth_mode()
1117 ret = rndis_set_oid(usbdev, in set_auth_mode()
1121 netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n", in set_auth_mode()
1131 static int set_priv_filter(struct usbnet *usbdev) in set_priv_filter() argument
1133 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_priv_filter()
1136 netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x\n", in set_priv_filter()
1145 return rndis_set_oid(usbdev, in set_priv_filter()
1150 static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) in set_encr_mode() argument
1155 netdev_dbg(usbdev->net, "%s(): cipher_pair=0x%x cipher_group=0x%x\n", in set_encr_mode()
1172 ret = rndis_set_oid(usbdev, in set_encr_mode()
1176 netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n", in set_encr_mode()
1184 static int set_infra_mode(struct usbnet *usbdev, int mode) in set_infra_mode() argument
1186 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_infra_mode()
1190 netdev_dbg(usbdev->net, "%s(): infra_mode=0x%x\n", in set_infra_mode()
1194 ret = rndis_set_oid(usbdev, in set_infra_mode()
1198 netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n", in set_infra_mode()
1206 restore_keys(usbdev); in set_infra_mode()
1212 static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) in set_rts_threshold() argument
1216 netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold); in set_rts_threshold()
1222 return rndis_set_oid(usbdev, in set_rts_threshold()
1227 static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold) in set_frag_threshold() argument
1231 netdev_dbg(usbdev->net, "%s(): %i\n", __func__, frag_threshold); in set_frag_threshold()
1237 return rndis_set_oid(usbdev, in set_frag_threshold()
1242 static void set_default_iw_params(struct usbnet *usbdev) in set_default_iw_params() argument
1244 set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); in set_default_iw_params()
1245 set_auth_mode(usbdev, 0, NL80211_AUTHTYPE_OPEN_SYSTEM, in set_default_iw_params()
1247 set_priv_filter(usbdev); in set_default_iw_params()
1248 set_encr_mode(usbdev, RNDIS_WLAN_ALG_NONE, RNDIS_WLAN_ALG_NONE); in set_default_iw_params()
1251 static int deauthenticate(struct usbnet *usbdev) in deauthenticate() argument
1255 ret = disassociate(usbdev, true); in deauthenticate()
1256 set_default_iw_params(usbdev); in deauthenticate()
1260 static int set_channel(struct usbnet *usbdev, int channel) in set_channel() argument
1266 netdev_dbg(usbdev->net, "%s(%d)\n", __func__, channel); in set_channel()
1269 if (is_associated(usbdev)) in set_channel()
1276 ret = rndis_query_oid(usbdev, in set_channel()
1280 netdev_dbg(usbdev->net, "%s(): querying configuration failed\n", in set_channel()
1286 ret = rndis_set_oid(usbdev, in set_channel()
1290 netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret); in set_channel()
1295 static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev, in get_current_channel() argument
1298 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in get_current_channel()
1305 ret = rndis_query_oid(usbdev, in get_current_channel()
1308 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_CONFIGURATION -> %d\n", in get_current_channel()
1324 static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, in add_wep_key() argument
1327 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in add_wep_key()
1332 netdev_dbg(usbdev->net, "%s(idx: %d, len: %d)\n", in add_wep_key()
1354 ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, in add_wep_key()
1357 netdev_warn(usbdev->net, "encryption couldn't be enabled (%08X)\n", in add_wep_key()
1361 ret = rndis_set_oid(usbdev, in add_wep_key()
1365 netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n", in add_wep_key()
1378 static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, in add_wpa_key() argument
1382 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in add_wpa_key()
1388 netdev_dbg(usbdev->net, "%s(): index out of range (%i)\n", in add_wpa_key()
1393 netdev_dbg(usbdev->net, "%s(): key length out of range (%i)\n", in add_wpa_key()
1399 netdev_dbg(usbdev->net, "%s(): recv seq flag without buffer\n", in add_wpa_key()
1404 netdev_dbg(usbdev->net, "%s(): too big recv seq buffer\n", __func__); in add_wpa_key()
1412 netdev_dbg(usbdev->net, "%s(): pairwise but bssid invalid (%pM)\n", in add_wpa_key()
1417 netdev_dbg(usbdev->net, "%s(%i): flags:%i%i%i\n", in add_wpa_key()
1450 get_bssid(usbdev, ndis_key.bssid); in add_wpa_key()
1453 ret = rndis_set_oid(usbdev, in add_wpa_key()
1456 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_ADD_KEY -> %08X\n", in add_wpa_key()
1476 static int restore_key(struct usbnet *usbdev, u8 key_idx) in restore_key() argument
1478 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in restore_key()
1486 netdev_dbg(usbdev->net, "%s(): %i:%i\n", __func__, key_idx, key.len); in restore_key()
1491 return add_wep_key(usbdev, key.material, key.len, key_idx); in restore_key()
1494 static void restore_keys(struct usbnet *usbdev) in restore_keys() argument
1499 restore_key(usbdev, i); in restore_keys()
1508 static int remove_key(struct usbnet *usbdev, u8 index, const u8 *bssid) in remove_key() argument
1510 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in remove_key()
1524 netdev_dbg(usbdev->net, "%s(): %i:%s:%i\n", in remove_key()
1544 ret = rndis_set_oid(usbdev, in remove_key()
1551 ret = rndis_set_oid(usbdev, in remove_key()
1555 netdev_warn(usbdev->net, in remove_key()
1564 set_encr_mode(usbdev, RNDIS_WLAN_ALG_NONE, RNDIS_WLAN_ALG_NONE); in remove_key()
1569 static void set_multicast_list(struct usbnet *usbdev) in set_multicast_list() argument
1571 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_multicast_list()
1581 if (usbdev->net->flags & IFF_PROMISC) { in set_multicast_list()
1584 } else if (usbdev->net->flags & IFF_ALLMULTI) { in set_multicast_list()
1595 netif_addr_lock_bh(usbdev->net); in set_multicast_list()
1596 mc_count = netdev_mc_count(usbdev->net); in set_multicast_list()
1604 netif_addr_unlock_bh(usbdev->net); in set_multicast_list()
1608 netdev_for_each_mc_addr(ha, usbdev->net) in set_multicast_list()
1612 netif_addr_unlock_bh(usbdev->net); in set_multicast_list()
1618 ret = rndis_set_oid(usbdev, in set_multicast_list()
1627 netdev_dbg(usbdev->net, "RNDIS_OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n", in set_multicast_list()
1632 ret = rndis_set_oid(usbdev, RNDIS_OID_GEN_CURRENT_PACKET_FILTER, &filter, in set_multicast_list()
1635 netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n", in set_multicast_list()
1639 netdev_dbg(usbdev->net, "RNDIS_OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d\n", in set_multicast_list()
1644 static void debug_print_pmkids(struct usbnet *usbdev, in debug_print_pmkids() argument
1648 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in debug_print_pmkids()
1657 netdev_dbg(usbdev->net, "%s(): %d PMKIDs (data len: %d, entry len: " in debug_print_pmkids()
1666 netdev_dbg(usbdev->net, "%s(): bssid: %pM, " in debug_print_pmkids()
1674 static void debug_print_pmkids(struct usbnet *usbdev, in debug_print_pmkids() argument
1682 static struct ndis_80211_pmkid *get_device_pmkids(struct usbnet *usbdev) in get_device_pmkids() argument
1684 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in get_device_pmkids()
1698 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_PMKID, in get_device_pmkids()
1701 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_PMKID(%d, %d)" in get_device_pmkids()
1711 debug_print_pmkids(usbdev, pmkids, __func__); in get_device_pmkids()
1716 static int set_device_pmkids(struct usbnet *usbdev, in set_device_pmkids() argument
1725 debug_print_pmkids(usbdev, pmkids, __func__); in set_device_pmkids()
1727 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_PMKID, pmkids, in set_device_pmkids()
1730 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_PMKID(%d, %d) -> %d" in set_device_pmkids()
1738 static struct ndis_80211_pmkid *remove_pmkid(struct usbnet *usbdev, in remove_pmkid() argument
1758 netdev_dbg(usbdev->net, "%s(): bssid not found (%pM)\n", in remove_pmkid()
1777 static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev, in update_pmkid() argument
1805 netdev_dbg(usbdev->net, "%s(): out of space\n", __func__); in update_pmkid()
1841 struct usbnet *usbdev = priv->usbdev; in rndis_change_virtual_intf() local
1857 return set_infra_mode(usbdev, mode); in rndis_change_virtual_intf()
1863 struct usbnet *usbdev = priv->usbdev; in rndis_set_wiphy_params() local
1867 err = set_frag_threshold(usbdev, wiphy->frag_threshold); in rndis_set_wiphy_params()
1873 err = set_rts_threshold(usbdev, wiphy->rts_threshold); in rndis_set_wiphy_params()
1887 struct usbnet *usbdev = priv->usbdev; in rndis_set_tx_power() local
1889 netdev_dbg(usbdev->net, "%s(): type:0x%x mbm:%i\n", in rndis_set_tx_power()
1902 disassociate(usbdev, true); /* turn on radio */ in rndis_set_tx_power()
1915 struct usbnet *usbdev = priv->usbdev; in rndis_get_tx_power() local
1919 netdev_dbg(usbdev->net, "%s(): dbm:%i\n", __func__, *dbm); in rndis_get_tx_power()
1929 struct usbnet *usbdev = netdev_priv(dev); in rndis_scan() local
1930 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_scan()
1934 netdev_dbg(usbdev->net, "cfg80211.scan\n"); in rndis_scan()
1939 rndis_check_bssid_list(usbdev, NULL, NULL); in rndis_scan()
1946 ret = rndis_start_bssid_list_scan(usbdev); in rndis_scan()
1958 static bool rndis_bss_info_update(struct usbnet *usbdev, in rndis_bss_info_update() argument
1961 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_bss_info_update()
1972 netdev_dbg(usbdev->net, " found bssid: '%.32s' [%pM], len: %d\n", in rndis_bss_info_update()
2044 static int rndis_check_bssid_list(struct usbnet *usbdev, u8 *match_bssid, in rndis_check_bssid_list() argument
2052 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_check_bssid_list()
2066 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_BSSID_LIST, in rndis_check_bssid_list()
2082 netdev_dbg(usbdev->net, "%s(): buflen: %d\n", __func__, len); in rndis_check_bssid_list()
2091 if (rndis_bss_info_update(usbdev, bssid) && match_bssid && in rndis_check_bssid_list()
2101 netdev_dbg(usbdev->net, "%s(): num_items from device: %d, really found:" in rndis_check_bssid_list()
2113 struct usbnet *usbdev = priv->usbdev; in rndis_get_scan_results() local
2117 netdev_dbg(usbdev->net, "get_scan_results\n"); in rndis_get_scan_results()
2122 ret = rndis_check_bssid_list(usbdev, NULL, NULL); in rndis_get_scan_results()
2134 struct usbnet *usbdev = priv->usbdev; in rndis_connect() local
2152 netdev_err(usbdev->net, "Unsupported pairwise cipher\n"); in rndis_connect()
2162 netdev_err(usbdev->net, "Invalid keymgmt\n"); in rndis_connect()
2166 netdev_dbg(usbdev->net, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:0x%x]:0x%x)\n", in rndis_connect()
2171 if (is_associated(usbdev)) in rndis_connect()
2172 disassociate(usbdev, false); in rndis_connect()
2174 ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); in rndis_connect()
2176 netdev_dbg(usbdev->net, "connect: set_infra_mode failed, %d\n", in rndis_connect()
2181 ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, in rndis_connect()
2184 netdev_dbg(usbdev->net, "connect: set_auth_mode failed, %d\n", in rndis_connect()
2189 set_priv_filter(usbdev); in rndis_connect()
2191 ret = set_encr_mode(usbdev, pairwise, groupwise); in rndis_connect()
2193 netdev_dbg(usbdev->net, "connect: set_encr_mode failed, %d\n", in rndis_connect()
2199 ret = set_channel(usbdev, chan); in rndis_connect()
2201 netdev_dbg(usbdev->net, "connect: set_channel failed, %d\n", in rndis_connect()
2209 ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); in rndis_connect()
2211 netdev_dbg(usbdev->net, "connect: add_wep_key failed, %d (%d, %d)\n", in rndis_connect()
2219 ret = set_bssid(usbdev, sme->bssid); in rndis_connect()
2221 netdev_dbg(usbdev->net, "connect: set_bssid failed, %d\n", in rndis_connect()
2226 clear_bssid(usbdev); in rndis_connect()
2239 usbnet_pause_rx(usbdev); in rndis_connect()
2240 usbnet_purge_paused_rxq(usbdev); in rndis_connect()
2242 ret = set_essid(usbdev, &ssid); in rndis_connect()
2244 netdev_dbg(usbdev->net, "connect: set_essid failed, %d\n", ret); in rndis_connect()
2248 disassociate(usbdev, true); in rndis_connect()
2257 struct usbnet *usbdev = priv->usbdev; in rndis_disconnect() local
2259 netdev_dbg(usbdev->net, "cfg80211.disconnect(%d)\n", reason_code); in rndis_disconnect()
2264 return deauthenticate(usbdev); in rndis_disconnect()
2271 struct usbnet *usbdev = priv->usbdev; in rndis_join_ibss() local
2293 netdev_dbg(usbdev->net, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)\n", in rndis_join_ibss()
2296 if (is_associated(usbdev)) in rndis_join_ibss()
2297 disassociate(usbdev, false); in rndis_join_ibss()
2299 ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); in rndis_join_ibss()
2301 netdev_dbg(usbdev->net, "join_ibss: set_infra_mode failed, %d\n", in rndis_join_ibss()
2306 ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); in rndis_join_ibss()
2308 netdev_dbg(usbdev->net, "join_ibss: set_auth_mode failed, %d\n", in rndis_join_ibss()
2313 set_priv_filter(usbdev); in rndis_join_ibss()
2315 ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); in rndis_join_ibss()
2317 netdev_dbg(usbdev->net, "join_ibss: set_encr_mode failed, %d\n", in rndis_join_ibss()
2323 ret = set_channel(usbdev, chan); in rndis_join_ibss()
2325 netdev_dbg(usbdev->net, "join_ibss: set_channel failed, %d\n", in rndis_join_ibss()
2333 ret = set_bssid(usbdev, params->bssid); in rndis_join_ibss()
2335 netdev_dbg(usbdev->net, "join_ibss: set_bssid failed, %d\n", in rndis_join_ibss()
2340 clear_bssid(usbdev); in rndis_join_ibss()
2351 usbnet_purge_paused_rxq(usbdev); in rndis_join_ibss()
2352 usbnet_resume_rx(usbdev); in rndis_join_ibss()
2354 ret = set_essid(usbdev, &ssid); in rndis_join_ibss()
2356 netdev_dbg(usbdev->net, "join_ibss: set_essid failed, %d\n", in rndis_join_ibss()
2361 disassociate(usbdev, true); in rndis_join_ibss()
2369 struct usbnet *usbdev = priv->usbdev; in rndis_leave_ibss() local
2371 netdev_dbg(usbdev->net, "cfg80211.leave_ibss()\n"); in rndis_leave_ibss()
2376 return deauthenticate(usbdev); in rndis_leave_ibss()
2384 struct usbnet *usbdev = priv->usbdev; in rndis_add_key() local
2387 netdev_dbg(usbdev->net, "%s(%i, %pM, %08x)\n", in rndis_add_key()
2393 return add_wep_key(usbdev, params->key, params->key_len, in rndis_add_key()
2405 return add_wpa_key(usbdev, params->key, params->key_len, in rndis_add_key()
2409 netdev_dbg(usbdev->net, "%s(): unsupported cipher %08x\n", in rndis_add_key()
2419 struct usbnet *usbdev = priv->usbdev; in rndis_del_key() local
2421 netdev_dbg(usbdev->net, "%s(%i, %pM)\n", __func__, key_index, mac_addr); in rndis_del_key()
2423 return remove_key(usbdev, key_index, mac_addr); in rndis_del_key()
2430 struct usbnet *usbdev = priv->usbdev; in rndis_set_default_key() local
2433 netdev_dbg(usbdev->net, "%s(%i)\n", __func__, key_index); in rndis_set_default_key()
2445 return add_wep_key(usbdev, key.material, key.len, key_index); in rndis_set_default_key()
2448 static void rndis_fill_station_info(struct usbnet *usbdev, in rndis_fill_station_info() argument
2457 ret = rndis_query_oid(usbdev, RNDIS_OID_GEN_LINK_SPEED, &linkspeed, &len); in rndis_fill_station_info()
2464 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI, in rndis_fill_station_info()
2476 struct usbnet *usbdev = priv->usbdev; in rndis_get_station() local
2481 rndis_fill_station_info(usbdev, sinfo); in rndis_get_station()
2490 struct usbnet *usbdev = priv->usbdev; in rndis_dump_station() local
2497 rndis_fill_station_info(usbdev, sinfo); in rndis_dump_station()
2506 struct usbnet *usbdev = priv->usbdev; in rndis_set_pmksa() local
2510 netdev_dbg(usbdev->net, "%s(%pM, %08X:%08X:%08X:%08X)\n", __func__, in rndis_set_pmksa()
2515 pmkids = get_device_pmkids(usbdev); in rndis_set_pmksa()
2521 pmkids = update_pmkid(usbdev, pmkids, pmksa, wiphy->max_num_pmkids); in rndis_set_pmksa()
2527 return set_device_pmkids(usbdev, pmkids); in rndis_set_pmksa()
2534 struct usbnet *usbdev = priv->usbdev; in rndis_del_pmksa() local
2538 netdev_dbg(usbdev->net, "%s(%pM, %08X:%08X:%08X:%08X)\n", __func__, in rndis_del_pmksa()
2543 pmkids = get_device_pmkids(usbdev); in rndis_del_pmksa()
2549 pmkids = remove_pmkid(usbdev, pmkids, pmksa, wiphy->max_num_pmkids); in rndis_del_pmksa()
2555 return set_device_pmkids(usbdev, pmkids); in rndis_del_pmksa()
2561 struct usbnet *usbdev = priv->usbdev; in rndis_flush_pmksa() local
2564 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_flush_pmksa()
2571 return rndis_set_oid(usbdev, RNDIS_OID_802_11_PMKID, in rndis_flush_pmksa()
2579 struct usbnet *usbdev = priv->usbdev; in rndis_set_power_mgmt() local
2587 netdev_dbg(usbdev->net, "%s(): %s, %d\n", __func__, in rndis_set_power_mgmt()
2602 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_POWER_MODE, in rndis_set_power_mgmt()
2605 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_POWER_MODE -> %d\n", in rndis_set_power_mgmt()
2624 static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, in rndis_wlan_craft_connected_bss() argument
2627 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_craft_connected_bss()
2642 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI, in rndis_wlan_craft_connected_bss()
2646 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_RSSI -> %d, " in rndis_wlan_craft_connected_bss()
2660 channel = get_current_channel(usbdev, &beacon_period); in rndis_wlan_craft_connected_bss()
2662 netdev_warn(usbdev->net, "%s(): could not get channel.\n", in rndis_wlan_craft_connected_bss()
2670 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_SSID, in rndis_wlan_craft_connected_bss()
2672 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_SSID -> %d, len: %d, ssid: " in rndis_wlan_craft_connected_bss()
2688 netdev_dbg(usbdev->net, "%s(): channel:%d(freq), bssid:[%pM], tsf:%d, " in rndis_wlan_craft_connected_bss()
2704 static void rndis_wlan_do_link_up_work(struct usbnet *usbdev) in rndis_wlan_do_link_up_work() argument
2706 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_do_link_up_work()
2737 ret = get_association_info(usbdev, info, CONTROL_BUFFER_SIZE); in rndis_wlan_do_link_up_work()
2781 ret = get_bssid(usbdev, bssid); in rndis_wlan_do_link_up_work()
2785 netdev_dbg(usbdev->net, "link up work: [%pM]%s\n", in rndis_wlan_do_link_up_work()
2800 rndis_check_bssid_list(usbdev, bssid, &match_bss); in rndis_wlan_do_link_up_work()
2806 rndis_wlan_craft_connected_bss(usbdev, bssid, info); in rndis_wlan_do_link_up_work()
2811 cfg80211_connect_result(usbdev->net, bssid, req_ie, in rndis_wlan_do_link_up_work()
2816 .channel = get_current_channel(usbdev, NULL), in rndis_wlan_do_link_up_work()
2824 cfg80211_roamed(usbdev->net, &roam_info, GFP_KERNEL); in rndis_wlan_do_link_up_work()
2827 cfg80211_ibss_joined(usbdev->net, bssid, in rndis_wlan_do_link_up_work()
2828 get_current_channel(usbdev, NULL), in rndis_wlan_do_link_up_work()
2836 usbnet_resume_rx(usbdev); in rndis_wlan_do_link_up_work()
2837 netif_carrier_on(usbdev->net); in rndis_wlan_do_link_up_work()
2840 static void rndis_wlan_do_link_down_work(struct usbnet *usbdev) in rndis_wlan_do_link_down_work() argument
2842 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_do_link_down_work()
2848 deauthenticate(usbdev); in rndis_wlan_do_link_down_work()
2850 cfg80211_disconnected(usbdev->net, 0, NULL, 0, true, GFP_KERNEL); in rndis_wlan_do_link_down_work()
2853 netif_carrier_off(usbdev->net); in rndis_wlan_do_link_down_work()
2860 struct usbnet *usbdev = priv->usbdev; in rndis_wlan_worker() local
2863 rndis_wlan_do_link_up_work(usbdev); in rndis_wlan_worker()
2866 rndis_wlan_do_link_down_work(usbdev); in rndis_wlan_worker()
2869 set_multicast_list(usbdev); in rndis_wlan_worker()
2874 struct usbnet *usbdev = netdev_priv(dev); in rndis_wlan_set_multicast_list() local
2875 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_set_multicast_list()
2884 static void rndis_wlan_auth_indication(struct usbnet *usbdev, in rndis_wlan_auth_indication() argument
2898 netdev_info(usbdev->net, "authentication indication: too short message (%i)\n", in rndis_wlan_auth_indication()
2928 netdev_info(usbdev->net, "authentication indication: %s (0x%08x)\n", in rndis_wlan_auth_indication()
2935 cfg80211_michael_mic_failure(usbdev->net, in rndis_wlan_auth_indication()
2945 cfg80211_michael_mic_failure(usbdev->net, in rndis_wlan_auth_indication()
2956 static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, in rndis_wlan_pmkid_cand_list_indication() argument
2965 netdev_info(usbdev->net, "pmkid candidate list indication: too short message (%i)\n", in rndis_wlan_pmkid_cand_list_indication()
2976 netdev_info(usbdev->net, "pmkid candidate list indication: list larger than buffer (%i < %i)\n", in rndis_wlan_pmkid_cand_list_indication()
2983 netdev_info(usbdev->net, "pmkid candidate list indication: version %i, candidates %i\n", in rndis_wlan_pmkid_cand_list_indication()
2995 netdev_dbg(usbdev->net, "cand[%i]: flags: 0x%08x, preauth: %d, bssid: %pM\n", in rndis_wlan_pmkid_cand_list_indication()
2998 cfg80211_pmksa_candidate_notify(usbdev->net, i, cand->bssid, in rndis_wlan_pmkid_cand_list_indication()
3003 static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, in rndis_wlan_media_specific_indication() argument
3014 netdev_info(usbdev->net, "media specific indication, ignore too short message (%i < 8)\n", in rndis_wlan_media_specific_indication()
3020 netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n", in rndis_wlan_media_specific_indication()
3029 netdev_info(usbdev->net, "radio state indication: %i\n", in rndis_wlan_media_specific_indication()
3034 netdev_info(usbdev->net, "media stream mode indication: %i\n", in rndis_wlan_media_specific_indication()
3039 rndis_wlan_auth_indication(usbdev, indication, len); in rndis_wlan_media_specific_indication()
3043 rndis_wlan_pmkid_cand_list_indication(usbdev, indication, len); in rndis_wlan_media_specific_indication()
3047 netdev_info(usbdev->net, "media specific indication: unknown status type 0x%08x\n", in rndis_wlan_media_specific_indication()
3052 static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) in rndis_wlan_indication() argument
3054 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_indication()
3065 netdev_dbg(usbdev->net, "ignored RNDIS_OID_802_11_ADD_KEY triggered 'media connect'\n"); in rndis_wlan_indication()
3069 usbnet_pause_rx(usbdev); in rndis_wlan_indication()
3071 netdev_info(usbdev->net, "media connect\n"); in rndis_wlan_indication()
3079 netdev_info(usbdev->net, "media disconnect\n"); in rndis_wlan_indication()
3087 rndis_wlan_media_specific_indication(usbdev, msg, buflen); in rndis_wlan_indication()
3091 netdev_info(usbdev->net, "indication: 0x%08x\n", in rndis_wlan_indication()
3097 static int rndis_wlan_get_caps(struct usbnet *usbdev, struct wiphy *wiphy) in rndis_wlan_get_caps() argument
3105 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_get_caps()
3109 retval = rndis_query_oid(usbdev, in rndis_wlan_get_caps()
3134 retval = rndis_query_oid(usbdev, in rndis_wlan_get_caps()
3138 netdev_dbg(usbdev->net, "RNDIS_OID_802_11_CAPABILITY -> len %d, " in rndis_wlan_get_caps()
3151 static void rndis_do_cqm(struct usbnet *usbdev, s32 rssi) in rndis_do_cqm() argument
3153 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_do_cqm()
3174 cfg80211_cqm_rssi_notify(usbdev->net, event, rssi, GFP_KERNEL); in rndis_do_cqm()
3183 struct usbnet *usbdev = priv->usbdev; in rndis_device_poller() local
3193 if (!is_associated(usbdev)) { in rndis_device_poller()
3200 rndis_check_bssid_list(usbdev, NULL, NULL); in rndis_device_poller()
3203 rndis_start_bssid_list_scan(usbdev); in rndis_device_poller()
3210 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI, in rndis_device_poller()
3214 rndis_do_cqm(usbdev, le32_to_cpu(rssi)); in rndis_device_poller()
3217 netdev_dbg(usbdev->net, "dev-poller: RNDIS_OID_802_11_RSSI -> %d, rssi:%d, qual: %d\n", in rndis_device_poller()
3239 rndis_set_oid(usbdev, in rndis_device_poller()
3248 rndis_query_oid(usbdev, in rndis_device_poller()
3270 static void rndis_copy_module_params(struct usbnet *usbdev, int device_type) in rndis_copy_module_params() argument
3272 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_copy_module_params()
3318 static int unknown_early_init(struct usbnet *usbdev) in unknown_early_init() argument
3323 rndis_copy_module_params(usbdev, RNDIS_UNKNOWN); in unknown_early_init()
3331 static int bcm4320a_early_init(struct usbnet *usbdev) in bcm4320a_early_init() argument
3336 rndis_copy_module_params(usbdev, RNDIS_BCM4320A); in bcm4320a_early_init()
3345 static int bcm4320b_early_init(struct usbnet *usbdev) in bcm4320b_early_init() argument
3347 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in bcm4320b_early_init()
3350 rndis_copy_module_params(usbdev, RNDIS_BCM4320B); in bcm4320b_early_init()
3356 rndis_set_config_parameter_str(usbdev, "Country", priv->param_country); in bcm4320b_early_init()
3357 rndis_set_config_parameter_str(usbdev, "FrameBursting", in bcm4320b_early_init()
3359 rndis_set_config_parameter_str(usbdev, "Afterburner", in bcm4320b_early_init()
3362 rndis_set_config_parameter_str(usbdev, "PowerSaveMode", buf); in bcm4320b_early_init()
3364 rndis_set_config_parameter_str(usbdev, "PwrOut", buf); in bcm4320b_early_init()
3366 rndis_set_config_parameter_str(usbdev, "RoamTrigger", buf); in bcm4320b_early_init()
3368 rndis_set_config_parameter_str(usbdev, "RoamDelta", buf); in bcm4320b_early_init()
3385 static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf) in rndis_wlan_bind() argument
3401 usbdev->net->ieee80211_ptr = &priv->wdev; in rndis_wlan_bind()
3408 usbdev->driver_priv = priv; in rndis_wlan_bind()
3409 priv->usbdev = usbdev; in rndis_wlan_bind()
3424 retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); in rndis_wlan_bind()
3435 usbdev->net->netdev_ops = &rndis_wlan_netdev_ops; in rndis_wlan_bind()
3438 retval = rndis_set_oid(usbdev, in rndis_wlan_bind()
3443 retval = rndis_query_oid(usbdev, in rndis_wlan_bind()
3450 usbdev->net->flags |= IFF_MULTICAST; in rndis_wlan_bind()
3452 usbdev->net->flags &= ~IFF_MULTICAST; in rndis_wlan_bind()
3455 memcpy(wiphy->perm_addr, usbdev->net->dev_addr, ETH_ALEN); in rndis_wlan_bind()
3462 rndis_wlan_get_caps(usbdev, wiphy); in rndis_wlan_bind()
3478 set_wiphy_dev(wiphy, &usbdev->udev->dev); in rndis_wlan_bind()
3485 set_default_iw_params(usbdev); in rndis_wlan_bind()
3495 disassociate(usbdev, false); in rndis_wlan_bind()
3496 netif_carrier_off(usbdev->net); in rndis_wlan_bind()
3510 static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf) in rndis_wlan_unbind() argument
3512 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_unbind()
3515 disassociate(usbdev, false); in rndis_wlan_unbind()
3522 rndis_unbind(usbdev, intf); in rndis_wlan_unbind()
3528 static int rndis_wlan_reset(struct usbnet *usbdev) in rndis_wlan_reset() argument
3530 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_reset()
3533 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_wlan_reset()
3535 retval = rndis_reset(usbdev); in rndis_wlan_reset()
3537 netdev_warn(usbdev->net, "rndis_reset failed: %d\n", retval); in rndis_wlan_reset()
3541 set_multicast_list(usbdev); in rndis_wlan_reset()
3546 return deauthenticate(usbdev); in rndis_wlan_reset()
3549 static int rndis_wlan_stop(struct usbnet *usbdev) in rndis_wlan_stop() argument
3551 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_stop()
3555 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_wlan_stop()
3557 retval = disassociate(usbdev, false); in rndis_wlan_stop()
3577 rndis_set_oid(usbdev, RNDIS_OID_GEN_CURRENT_PACKET_FILTER, &filter, in rndis_wlan_stop()