Lines Matching refs:usbdev
407 struct usbnet *usbdev; member
826 static int rndis_reset(struct usbnet *usbdev) in rndis_reset() argument
828 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_reset()
839 ret = rndis_command(usbdev, (void *)reset, CONTROL_BUFFER_SIZE); in rndis_reset()
950 static int set_infra_mode(struct usbnet *usbdev, int mode);
951 static void restore_keys(struct usbnet *usbdev);
952 static int rndis_check_bssid_list(struct usbnet *usbdev, u8 *match_bssid,
955 static int rndis_start_bssid_list_scan(struct usbnet *usbdev) in rndis_start_bssid_list_scan() argument
961 return rndis_set_oid(usbdev, RNDIS_OID_802_11_BSSID_LIST_SCAN, &tmp, in rndis_start_bssid_list_scan()
965 static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) in set_essid() argument
967 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_essid()
970 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_SSID, in set_essid()
973 netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret); in set_essid()
978 netdev_dbg(usbdev->net, "%s(): radio_on = true\n", __func__); in set_essid()
984 static int set_bssid(struct usbnet *usbdev, const u8 *bssid) in set_bssid() argument
988 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_BSSID, in set_bssid()
991 netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n", in set_bssid()
999 static int clear_bssid(struct usbnet *usbdev) in clear_bssid() argument
1005 return set_bssid(usbdev, broadcast_mac); in clear_bssid()
1008 static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) in get_bssid() argument
1013 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_BSSID, in get_bssid()
1022 static int get_association_info(struct usbnet *usbdev, in get_association_info() argument
1025 return rndis_query_oid(usbdev, in get_association_info()
1030 static bool is_associated(struct usbnet *usbdev) in is_associated() argument
1032 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in is_associated()
1038 return (get_bssid(usbdev, bssid) == 0 && !is_zero_ether_addr(bssid)); in is_associated()
1041 static int disassociate(struct usbnet *usbdev, bool reset_ssid) in disassociate() argument
1043 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in disassociate()
1048 ret = rndis_set_oid(usbdev, in disassociate()
1053 netdev_dbg(usbdev->net, "%s(): radio_on = false\n", in disassociate()
1067 set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); in disassociate()
1075 ret = set_essid(usbdev, &ssid); in disassociate()
1080 static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, in set_auth_mode() argument
1083 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_auth_mode()
1087 netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x authalg=0x%x keymgmt=0x%x\n", in set_auth_mode()
1112 ret = rndis_set_oid(usbdev, in set_auth_mode()
1116 netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n", in set_auth_mode()
1126 static int set_priv_filter(struct usbnet *usbdev) in set_priv_filter() argument
1128 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_priv_filter()
1131 netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x\n", in set_priv_filter()
1140 return rndis_set_oid(usbdev, in set_priv_filter()
1145 static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) in set_encr_mode() argument
1150 netdev_dbg(usbdev->net, "%s(): cipher_pair=0x%x cipher_group=0x%x\n", in set_encr_mode()
1167 ret = rndis_set_oid(usbdev, in set_encr_mode()
1171 netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n", in set_encr_mode()
1179 static int set_infra_mode(struct usbnet *usbdev, int mode) in set_infra_mode() argument
1181 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_infra_mode()
1185 netdev_dbg(usbdev->net, "%s(): infra_mode=0x%x\n", in set_infra_mode()
1189 ret = rndis_set_oid(usbdev, in set_infra_mode()
1193 netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n", in set_infra_mode()
1201 restore_keys(usbdev); in set_infra_mode()
1207 static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) in set_rts_threshold() argument
1211 netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold); in set_rts_threshold()
1217 return rndis_set_oid(usbdev, in set_rts_threshold()
1222 static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold) in set_frag_threshold() argument
1226 netdev_dbg(usbdev->net, "%s(): %i\n", __func__, frag_threshold); in set_frag_threshold()
1232 return rndis_set_oid(usbdev, in set_frag_threshold()
1237 static void set_default_iw_params(struct usbnet *usbdev) in set_default_iw_params() argument
1239 set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); in set_default_iw_params()
1240 set_auth_mode(usbdev, 0, NL80211_AUTHTYPE_OPEN_SYSTEM, in set_default_iw_params()
1242 set_priv_filter(usbdev); in set_default_iw_params()
1243 set_encr_mode(usbdev, RNDIS_WLAN_ALG_NONE, RNDIS_WLAN_ALG_NONE); in set_default_iw_params()
1246 static int deauthenticate(struct usbnet *usbdev) in deauthenticate() argument
1250 ret = disassociate(usbdev, true); in deauthenticate()
1251 set_default_iw_params(usbdev); in deauthenticate()
1255 static int set_channel(struct usbnet *usbdev, int channel) in set_channel() argument
1261 netdev_dbg(usbdev->net, "%s(%d)\n", __func__, channel); in set_channel()
1264 if (is_associated(usbdev)) in set_channel()
1271 ret = rndis_query_oid(usbdev, in set_channel()
1275 netdev_dbg(usbdev->net, "%s(): querying configuration failed\n", in set_channel()
1281 ret = rndis_set_oid(usbdev, in set_channel()
1285 netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret); in set_channel()
1290 static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev, in get_current_channel() argument
1293 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in get_current_channel()
1300 ret = rndis_query_oid(usbdev, in get_current_channel()
1303 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_CONFIGURATION -> %d\n", in get_current_channel()
1319 static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, in add_wep_key() argument
1322 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in add_wep_key()
1327 netdev_dbg(usbdev->net, "%s(idx: %d, len: %d)\n", in add_wep_key()
1349 ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, in add_wep_key()
1352 netdev_warn(usbdev->net, "encryption couldn't be enabled (%08X)\n", in add_wep_key()
1356 ret = rndis_set_oid(usbdev, in add_wep_key()
1360 netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n", in add_wep_key()
1373 static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, in add_wpa_key() argument
1377 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in add_wpa_key()
1383 netdev_dbg(usbdev->net, "%s(): index out of range (%i)\n", in add_wpa_key()
1388 netdev_dbg(usbdev->net, "%s(): key length out of range (%i)\n", in add_wpa_key()
1394 netdev_dbg(usbdev->net, "%s(): recv seq flag without buffer\n", in add_wpa_key()
1399 netdev_dbg(usbdev->net, "%s(): too big recv seq buffer\n", __func__); in add_wpa_key()
1407 netdev_dbg(usbdev->net, "%s(): pairwise but bssid invalid (%pM)\n", in add_wpa_key()
1412 netdev_dbg(usbdev->net, "%s(%i): flags:%i%i%i\n", in add_wpa_key()
1445 get_bssid(usbdev, ndis_key.bssid); in add_wpa_key()
1448 ret = rndis_set_oid(usbdev, in add_wpa_key()
1451 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_ADD_KEY -> %08X\n", in add_wpa_key()
1471 static int restore_key(struct usbnet *usbdev, u8 key_idx) in restore_key() argument
1473 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in restore_key()
1481 netdev_dbg(usbdev->net, "%s(): %i:%i\n", __func__, key_idx, key.len); in restore_key()
1486 return add_wep_key(usbdev, key.material, key.len, key_idx); in restore_key()
1489 static void restore_keys(struct usbnet *usbdev) in restore_keys() argument
1494 restore_key(usbdev, i); in restore_keys()
1503 static int remove_key(struct usbnet *usbdev, u8 index, const u8 *bssid) in remove_key() argument
1505 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in remove_key()
1519 netdev_dbg(usbdev->net, "%s(): %i:%s:%i\n", in remove_key()
1539 ret = rndis_set_oid(usbdev, in remove_key()
1546 ret = rndis_set_oid(usbdev, in remove_key()
1550 netdev_warn(usbdev->net, in remove_key()
1559 set_encr_mode(usbdev, RNDIS_WLAN_ALG_NONE, RNDIS_WLAN_ALG_NONE); in remove_key()
1564 static void set_multicast_list(struct usbnet *usbdev) in set_multicast_list() argument
1566 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in set_multicast_list()
1576 if (usbdev->net->flags & IFF_PROMISC) { in set_multicast_list()
1579 } else if (usbdev->net->flags & IFF_ALLMULTI) { in set_multicast_list()
1590 netif_addr_lock_bh(usbdev->net); in set_multicast_list()
1591 mc_count = netdev_mc_count(usbdev->net); in set_multicast_list()
1599 netif_addr_unlock_bh(usbdev->net); in set_multicast_list()
1603 netdev_for_each_mc_addr(ha, usbdev->net) in set_multicast_list()
1607 netif_addr_unlock_bh(usbdev->net); in set_multicast_list()
1613 ret = rndis_set_oid(usbdev, in set_multicast_list()
1622 netdev_dbg(usbdev->net, "RNDIS_OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n", in set_multicast_list()
1627 ret = rndis_set_oid(usbdev, RNDIS_OID_GEN_CURRENT_PACKET_FILTER, &filter, in set_multicast_list()
1630 netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n", in set_multicast_list()
1634 netdev_dbg(usbdev->net, "RNDIS_OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d\n", in set_multicast_list()
1639 static void debug_print_pmkids(struct usbnet *usbdev, in debug_print_pmkids() argument
1643 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in debug_print_pmkids()
1652 netdev_dbg(usbdev->net, "%s(): %d PMKIDs (data len: %d, entry len: " in debug_print_pmkids()
1661 netdev_dbg(usbdev->net, "%s(): bssid: %pM, " in debug_print_pmkids()
1669 static void debug_print_pmkids(struct usbnet *usbdev, in debug_print_pmkids() argument
1677 static struct ndis_80211_pmkid *get_device_pmkids(struct usbnet *usbdev) in get_device_pmkids() argument
1679 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in get_device_pmkids()
1693 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_PMKID, in get_device_pmkids()
1696 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_PMKID(%d, %d)" in get_device_pmkids()
1706 debug_print_pmkids(usbdev, pmkids, __func__); in get_device_pmkids()
1711 static int set_device_pmkids(struct usbnet *usbdev, in set_device_pmkids() argument
1720 debug_print_pmkids(usbdev, pmkids, __func__); in set_device_pmkids()
1722 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_PMKID, pmkids, in set_device_pmkids()
1725 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_PMKID(%d, %d) -> %d" in set_device_pmkids()
1733 static struct ndis_80211_pmkid *remove_pmkid(struct usbnet *usbdev, in remove_pmkid() argument
1753 netdev_dbg(usbdev->net, "%s(): bssid not found (%pM)\n", in remove_pmkid()
1772 static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev, in update_pmkid() argument
1800 netdev_dbg(usbdev->net, "%s(): out of space\n", __func__); in update_pmkid()
1836 struct usbnet *usbdev = priv->usbdev; in rndis_change_virtual_intf() local
1852 return set_infra_mode(usbdev, mode); in rndis_change_virtual_intf()
1858 struct usbnet *usbdev = priv->usbdev; in rndis_set_wiphy_params() local
1862 err = set_frag_threshold(usbdev, wiphy->frag_threshold); in rndis_set_wiphy_params()
1868 err = set_rts_threshold(usbdev, wiphy->rts_threshold); in rndis_set_wiphy_params()
1882 struct usbnet *usbdev = priv->usbdev; in rndis_set_tx_power() local
1884 netdev_dbg(usbdev->net, "%s(): type:0x%x mbm:%i\n", in rndis_set_tx_power()
1897 disassociate(usbdev, true); /* turn on radio */ in rndis_set_tx_power()
1910 struct usbnet *usbdev = priv->usbdev; in rndis_get_tx_power() local
1914 netdev_dbg(usbdev->net, "%s(): dbm:%i\n", __func__, *dbm); in rndis_get_tx_power()
1924 struct usbnet *usbdev = netdev_priv(dev); in rndis_scan() local
1925 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_scan()
1929 netdev_dbg(usbdev->net, "cfg80211.scan\n"); in rndis_scan()
1934 rndis_check_bssid_list(usbdev, NULL, NULL); in rndis_scan()
1941 ret = rndis_start_bssid_list_scan(usbdev); in rndis_scan()
1953 static bool rndis_bss_info_update(struct usbnet *usbdev, in rndis_bss_info_update() argument
1956 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_bss_info_update()
1967 netdev_dbg(usbdev->net, " found bssid: '%.32s' [%pM], len: %d\n", in rndis_bss_info_update()
2039 static int rndis_check_bssid_list(struct usbnet *usbdev, u8 *match_bssid, in rndis_check_bssid_list() argument
2047 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_check_bssid_list()
2061 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_BSSID_LIST, in rndis_check_bssid_list()
2077 netdev_dbg(usbdev->net, "%s(): buflen: %d\n", __func__, len); in rndis_check_bssid_list()
2087 if (rndis_bss_info_update(usbdev, bssid) && match_bssid && in rndis_check_bssid_list()
2097 netdev_dbg(usbdev->net, "%s(): num_items from device: %d, really found:" in rndis_check_bssid_list()
2109 struct usbnet *usbdev = priv->usbdev; in rndis_get_scan_results() local
2113 netdev_dbg(usbdev->net, "get_scan_results\n"); in rndis_get_scan_results()
2118 ret = rndis_check_bssid_list(usbdev, NULL, NULL); in rndis_get_scan_results()
2130 struct usbnet *usbdev = priv->usbdev; in rndis_connect() local
2148 netdev_err(usbdev->net, "Unsupported pairwise cipher\n"); in rndis_connect()
2158 netdev_err(usbdev->net, "Invalid keymgmt\n"); in rndis_connect()
2162 netdev_dbg(usbdev->net, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:0x%x]:0x%x)\n", in rndis_connect()
2167 if (is_associated(usbdev)) in rndis_connect()
2168 disassociate(usbdev, false); in rndis_connect()
2170 ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); in rndis_connect()
2172 netdev_dbg(usbdev->net, "connect: set_infra_mode failed, %d\n", in rndis_connect()
2177 ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, in rndis_connect()
2180 netdev_dbg(usbdev->net, "connect: set_auth_mode failed, %d\n", in rndis_connect()
2185 set_priv_filter(usbdev); in rndis_connect()
2187 ret = set_encr_mode(usbdev, pairwise, groupwise); in rndis_connect()
2189 netdev_dbg(usbdev->net, "connect: set_encr_mode failed, %d\n", in rndis_connect()
2195 ret = set_channel(usbdev, chan); in rndis_connect()
2197 netdev_dbg(usbdev->net, "connect: set_channel failed, %d\n", in rndis_connect()
2205 ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); in rndis_connect()
2207 netdev_dbg(usbdev->net, "connect: add_wep_key failed, %d (%d, %d)\n", in rndis_connect()
2215 ret = set_bssid(usbdev, sme->bssid); in rndis_connect()
2217 netdev_dbg(usbdev->net, "connect: set_bssid failed, %d\n", in rndis_connect()
2222 clear_bssid(usbdev); in rndis_connect()
2235 usbnet_pause_rx(usbdev); in rndis_connect()
2236 usbnet_purge_paused_rxq(usbdev); in rndis_connect()
2238 ret = set_essid(usbdev, &ssid); in rndis_connect()
2240 netdev_dbg(usbdev->net, "connect: set_essid failed, %d\n", ret); in rndis_connect()
2244 disassociate(usbdev, true); in rndis_connect()
2253 struct usbnet *usbdev = priv->usbdev; in rndis_disconnect() local
2255 netdev_dbg(usbdev->net, "cfg80211.disconnect(%d)\n", reason_code); in rndis_disconnect()
2260 return deauthenticate(usbdev); in rndis_disconnect()
2267 struct usbnet *usbdev = priv->usbdev; in rndis_join_ibss() local
2289 netdev_dbg(usbdev->net, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)\n", in rndis_join_ibss()
2292 if (is_associated(usbdev)) in rndis_join_ibss()
2293 disassociate(usbdev, false); in rndis_join_ibss()
2295 ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); in rndis_join_ibss()
2297 netdev_dbg(usbdev->net, "join_ibss: set_infra_mode failed, %d\n", in rndis_join_ibss()
2302 ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); in rndis_join_ibss()
2304 netdev_dbg(usbdev->net, "join_ibss: set_auth_mode failed, %d\n", in rndis_join_ibss()
2309 set_priv_filter(usbdev); in rndis_join_ibss()
2311 ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); in rndis_join_ibss()
2313 netdev_dbg(usbdev->net, "join_ibss: set_encr_mode failed, %d\n", in rndis_join_ibss()
2319 ret = set_channel(usbdev, chan); in rndis_join_ibss()
2321 netdev_dbg(usbdev->net, "join_ibss: set_channel failed, %d\n", in rndis_join_ibss()
2329 ret = set_bssid(usbdev, params->bssid); in rndis_join_ibss()
2331 netdev_dbg(usbdev->net, "join_ibss: set_bssid failed, %d\n", in rndis_join_ibss()
2336 clear_bssid(usbdev); in rndis_join_ibss()
2347 usbnet_purge_paused_rxq(usbdev); in rndis_join_ibss()
2348 usbnet_resume_rx(usbdev); in rndis_join_ibss()
2350 ret = set_essid(usbdev, &ssid); in rndis_join_ibss()
2352 netdev_dbg(usbdev->net, "join_ibss: set_essid failed, %d\n", in rndis_join_ibss()
2357 disassociate(usbdev, true); in rndis_join_ibss()
2365 struct usbnet *usbdev = priv->usbdev; in rndis_leave_ibss() local
2367 netdev_dbg(usbdev->net, "cfg80211.leave_ibss()\n"); in rndis_leave_ibss()
2372 return deauthenticate(usbdev); in rndis_leave_ibss()
2380 struct usbnet *usbdev = priv->usbdev; in rndis_add_key() local
2383 netdev_dbg(usbdev->net, "%s(%i, %pM, %08x)\n", in rndis_add_key()
2389 return add_wep_key(usbdev, params->key, params->key_len, in rndis_add_key()
2401 return add_wpa_key(usbdev, params->key, params->key_len, in rndis_add_key()
2405 netdev_dbg(usbdev->net, "%s(): unsupported cipher %08x\n", in rndis_add_key()
2416 struct usbnet *usbdev = priv->usbdev; in rndis_del_key() local
2418 netdev_dbg(usbdev->net, "%s(%i, %pM)\n", __func__, key_index, mac_addr); in rndis_del_key()
2420 return remove_key(usbdev, key_index, mac_addr); in rndis_del_key()
2428 struct usbnet *usbdev = priv->usbdev; in rndis_set_default_key() local
2431 netdev_dbg(usbdev->net, "%s(%i)\n", __func__, key_index); in rndis_set_default_key()
2443 return add_wep_key(usbdev, key.material, key.len, key_index); in rndis_set_default_key()
2446 static void rndis_fill_station_info(struct usbnet *usbdev, in rndis_fill_station_info() argument
2455 ret = rndis_query_oid(usbdev, RNDIS_OID_GEN_LINK_SPEED, &linkspeed, &len); in rndis_fill_station_info()
2462 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI, in rndis_fill_station_info()
2474 struct usbnet *usbdev = priv->usbdev; in rndis_get_station() local
2479 rndis_fill_station_info(usbdev, sinfo); in rndis_get_station()
2488 struct usbnet *usbdev = priv->usbdev; in rndis_dump_station() local
2495 rndis_fill_station_info(usbdev, sinfo); in rndis_dump_station()
2504 struct usbnet *usbdev = priv->usbdev; in rndis_set_pmksa() local
2508 netdev_dbg(usbdev->net, "%s(%pM, %08X:%08X:%08X:%08X)\n", __func__, in rndis_set_pmksa()
2513 pmkids = get_device_pmkids(usbdev); in rndis_set_pmksa()
2519 pmkids = update_pmkid(usbdev, pmkids, pmksa, wiphy->max_num_pmkids); in rndis_set_pmksa()
2525 return set_device_pmkids(usbdev, pmkids); in rndis_set_pmksa()
2532 struct usbnet *usbdev = priv->usbdev; in rndis_del_pmksa() local
2536 netdev_dbg(usbdev->net, "%s(%pM, %08X:%08X:%08X:%08X)\n", __func__, in rndis_del_pmksa()
2541 pmkids = get_device_pmkids(usbdev); in rndis_del_pmksa()
2547 pmkids = remove_pmkid(usbdev, pmkids, pmksa, wiphy->max_num_pmkids); in rndis_del_pmksa()
2553 return set_device_pmkids(usbdev, pmkids); in rndis_del_pmksa()
2559 struct usbnet *usbdev = priv->usbdev; in rndis_flush_pmksa() local
2562 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_flush_pmksa()
2569 return rndis_set_oid(usbdev, RNDIS_OID_802_11_PMKID, in rndis_flush_pmksa()
2577 struct usbnet *usbdev = priv->usbdev; in rndis_set_power_mgmt() local
2585 netdev_dbg(usbdev->net, "%s(): %s, %d\n", __func__, in rndis_set_power_mgmt()
2600 ret = rndis_set_oid(usbdev, RNDIS_OID_802_11_POWER_MODE, in rndis_set_power_mgmt()
2603 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_POWER_MODE -> %d\n", in rndis_set_power_mgmt()
2622 static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, in rndis_wlan_craft_connected_bss() argument
2625 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_craft_connected_bss()
2640 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI, in rndis_wlan_craft_connected_bss()
2644 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_RSSI -> %d, " in rndis_wlan_craft_connected_bss()
2658 channel = get_current_channel(usbdev, &beacon_period); in rndis_wlan_craft_connected_bss()
2660 netdev_warn(usbdev->net, "%s(): could not get channel.\n", in rndis_wlan_craft_connected_bss()
2668 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_SSID, in rndis_wlan_craft_connected_bss()
2670 netdev_dbg(usbdev->net, "%s(): RNDIS_OID_802_11_SSID -> %d, len: %d, ssid: " in rndis_wlan_craft_connected_bss()
2686 netdev_dbg(usbdev->net, "%s(): channel:%d(freq), bssid:[%pM], tsf:%d, " in rndis_wlan_craft_connected_bss()
2702 static void rndis_wlan_do_link_up_work(struct usbnet *usbdev) in rndis_wlan_do_link_up_work() argument
2704 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_do_link_up_work()
2735 ret = get_association_info(usbdev, info, CONTROL_BUFFER_SIZE); in rndis_wlan_do_link_up_work()
2779 ret = get_bssid(usbdev, bssid); in rndis_wlan_do_link_up_work()
2783 netdev_dbg(usbdev->net, "link up work: [%pM]%s\n", in rndis_wlan_do_link_up_work()
2798 rndis_check_bssid_list(usbdev, bssid, &match_bss); in rndis_wlan_do_link_up_work()
2804 rndis_wlan_craft_connected_bss(usbdev, bssid, info); in rndis_wlan_do_link_up_work()
2809 cfg80211_connect_result(usbdev->net, bssid, req_ie, in rndis_wlan_do_link_up_work()
2815 get_current_channel(usbdev, NULL), in rndis_wlan_do_link_up_work()
2823 cfg80211_roamed(usbdev->net, &roam_info, GFP_KERNEL); in rndis_wlan_do_link_up_work()
2826 cfg80211_ibss_joined(usbdev->net, bssid, in rndis_wlan_do_link_up_work()
2827 get_current_channel(usbdev, NULL), in rndis_wlan_do_link_up_work()
2835 usbnet_resume_rx(usbdev); in rndis_wlan_do_link_up_work()
2836 netif_carrier_on(usbdev->net); in rndis_wlan_do_link_up_work()
2839 static void rndis_wlan_do_link_down_work(struct usbnet *usbdev) in rndis_wlan_do_link_down_work() argument
2841 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_do_link_down_work()
2847 deauthenticate(usbdev); in rndis_wlan_do_link_down_work()
2849 cfg80211_disconnected(usbdev->net, 0, NULL, 0, true, GFP_KERNEL); in rndis_wlan_do_link_down_work()
2852 netif_carrier_off(usbdev->net); in rndis_wlan_do_link_down_work()
2859 struct usbnet *usbdev = priv->usbdev; in rndis_wlan_worker() local
2862 rndis_wlan_do_link_up_work(usbdev); in rndis_wlan_worker()
2865 rndis_wlan_do_link_down_work(usbdev); in rndis_wlan_worker()
2868 set_multicast_list(usbdev); in rndis_wlan_worker()
2873 struct usbnet *usbdev = netdev_priv(dev); in rndis_wlan_set_multicast_list() local
2874 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_set_multicast_list()
2883 static void rndis_wlan_auth_indication(struct usbnet *usbdev, in rndis_wlan_auth_indication() argument
2897 netdev_info(usbdev->net, "authentication indication: too short message (%i)\n", in rndis_wlan_auth_indication()
2927 netdev_info(usbdev->net, "authentication indication: %s (0x%08x)\n", in rndis_wlan_auth_indication()
2934 cfg80211_michael_mic_failure(usbdev->net, in rndis_wlan_auth_indication()
2944 cfg80211_michael_mic_failure(usbdev->net, in rndis_wlan_auth_indication()
2955 static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, in rndis_wlan_pmkid_cand_list_indication() argument
2964 netdev_info(usbdev->net, "pmkid candidate list indication: too short message (%i)\n", in rndis_wlan_pmkid_cand_list_indication()
2975 netdev_info(usbdev->net, "pmkid candidate list indication: list larger than buffer (%i < %i)\n", in rndis_wlan_pmkid_cand_list_indication()
2982 netdev_info(usbdev->net, "pmkid candidate list indication: version %i, candidates %i\n", in rndis_wlan_pmkid_cand_list_indication()
2994 netdev_dbg(usbdev->net, "cand[%i]: flags: 0x%08x, preauth: %d, bssid: %pM\n", in rndis_wlan_pmkid_cand_list_indication()
2997 cfg80211_pmksa_candidate_notify(usbdev->net, i, cand->bssid, in rndis_wlan_pmkid_cand_list_indication()
3002 static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, in rndis_wlan_media_specific_indication() argument
3013 netdev_info(usbdev->net, "media specific indication, ignore too short message (%i < 8)\n", in rndis_wlan_media_specific_indication()
3019 netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n", in rndis_wlan_media_specific_indication()
3028 netdev_info(usbdev->net, "radio state indication: %i\n", in rndis_wlan_media_specific_indication()
3033 netdev_info(usbdev->net, "media stream mode indication: %i\n", in rndis_wlan_media_specific_indication()
3038 rndis_wlan_auth_indication(usbdev, indication, len); in rndis_wlan_media_specific_indication()
3042 rndis_wlan_pmkid_cand_list_indication(usbdev, indication, len); in rndis_wlan_media_specific_indication()
3046 netdev_info(usbdev->net, "media specific indication: unknown status type 0x%08x\n", in rndis_wlan_media_specific_indication()
3051 static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) in rndis_wlan_indication() argument
3053 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_indication()
3064 netdev_dbg(usbdev->net, "ignored RNDIS_OID_802_11_ADD_KEY triggered 'media connect'\n"); in rndis_wlan_indication()
3068 usbnet_pause_rx(usbdev); in rndis_wlan_indication()
3070 netdev_info(usbdev->net, "media connect\n"); in rndis_wlan_indication()
3078 netdev_info(usbdev->net, "media disconnect\n"); in rndis_wlan_indication()
3086 rndis_wlan_media_specific_indication(usbdev, msg, buflen); in rndis_wlan_indication()
3090 netdev_info(usbdev->net, "indication: 0x%08x\n", in rndis_wlan_indication()
3096 static int rndis_wlan_get_caps(struct usbnet *usbdev, struct wiphy *wiphy) in rndis_wlan_get_caps() argument
3104 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_get_caps()
3108 retval = rndis_query_oid(usbdev, in rndis_wlan_get_caps()
3133 retval = rndis_query_oid(usbdev, in rndis_wlan_get_caps()
3137 netdev_dbg(usbdev->net, "RNDIS_OID_802_11_CAPABILITY -> len %d, " in rndis_wlan_get_caps()
3150 static void rndis_do_cqm(struct usbnet *usbdev, s32 rssi) in rndis_do_cqm() argument
3152 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_do_cqm()
3173 cfg80211_cqm_rssi_notify(usbdev->net, event, rssi, GFP_KERNEL); in rndis_do_cqm()
3182 struct usbnet *usbdev = priv->usbdev; in rndis_device_poller() local
3192 if (!is_associated(usbdev)) { in rndis_device_poller()
3199 rndis_check_bssid_list(usbdev, NULL, NULL); in rndis_device_poller()
3202 rndis_start_bssid_list_scan(usbdev); in rndis_device_poller()
3209 ret = rndis_query_oid(usbdev, RNDIS_OID_802_11_RSSI, in rndis_device_poller()
3213 rndis_do_cqm(usbdev, le32_to_cpu(rssi)); in rndis_device_poller()
3216 netdev_dbg(usbdev->net, "dev-poller: RNDIS_OID_802_11_RSSI -> %d, rssi:%d, qual: %d\n", in rndis_device_poller()
3238 rndis_set_oid(usbdev, in rndis_device_poller()
3247 rndis_query_oid(usbdev, in rndis_device_poller()
3269 static void rndis_copy_module_params(struct usbnet *usbdev, int device_type) in rndis_copy_module_params() argument
3271 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_copy_module_params()
3317 static int unknown_early_init(struct usbnet *usbdev) in unknown_early_init() argument
3322 rndis_copy_module_params(usbdev, RNDIS_UNKNOWN); in unknown_early_init()
3330 static int bcm4320a_early_init(struct usbnet *usbdev) in bcm4320a_early_init() argument
3335 rndis_copy_module_params(usbdev, RNDIS_BCM4320A); in bcm4320a_early_init()
3344 static int bcm4320b_early_init(struct usbnet *usbdev) in bcm4320b_early_init() argument
3346 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in bcm4320b_early_init()
3349 rndis_copy_module_params(usbdev, RNDIS_BCM4320B); in bcm4320b_early_init()
3355 rndis_set_config_parameter_str(usbdev, "Country", priv->param_country); in bcm4320b_early_init()
3356 rndis_set_config_parameter_str(usbdev, "FrameBursting", in bcm4320b_early_init()
3358 rndis_set_config_parameter_str(usbdev, "Afterburner", in bcm4320b_early_init()
3361 rndis_set_config_parameter_str(usbdev, "PowerSaveMode", buf); in bcm4320b_early_init()
3363 rndis_set_config_parameter_str(usbdev, "PwrOut", buf); in bcm4320b_early_init()
3365 rndis_set_config_parameter_str(usbdev, "RoamTrigger", buf); in bcm4320b_early_init()
3367 rndis_set_config_parameter_str(usbdev, "RoamDelta", buf); in bcm4320b_early_init()
3384 static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf) in rndis_wlan_bind() argument
3400 usbdev->net->ieee80211_ptr = &priv->wdev; in rndis_wlan_bind()
3407 usbdev->driver_priv = priv; in rndis_wlan_bind()
3408 priv->usbdev = usbdev; in rndis_wlan_bind()
3423 retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); in rndis_wlan_bind()
3434 usbdev->net->netdev_ops = &rndis_wlan_netdev_ops; in rndis_wlan_bind()
3437 retval = rndis_set_oid(usbdev, in rndis_wlan_bind()
3442 retval = rndis_query_oid(usbdev, in rndis_wlan_bind()
3449 usbdev->net->flags |= IFF_MULTICAST; in rndis_wlan_bind()
3451 usbdev->net->flags &= ~IFF_MULTICAST; in rndis_wlan_bind()
3454 memcpy(wiphy->perm_addr, usbdev->net->dev_addr, ETH_ALEN); in rndis_wlan_bind()
3461 rndis_wlan_get_caps(usbdev, wiphy); in rndis_wlan_bind()
3477 set_wiphy_dev(wiphy, &usbdev->udev->dev); in rndis_wlan_bind()
3484 set_default_iw_params(usbdev); in rndis_wlan_bind()
3494 disassociate(usbdev, false); in rndis_wlan_bind()
3495 netif_carrier_off(usbdev->net); in rndis_wlan_bind()
3509 static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf) in rndis_wlan_unbind() argument
3511 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_unbind()
3514 disassociate(usbdev, false); in rndis_wlan_unbind()
3521 rndis_unbind(usbdev, intf); in rndis_wlan_unbind()
3527 static int rndis_wlan_reset(struct usbnet *usbdev) in rndis_wlan_reset() argument
3529 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_reset()
3532 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_wlan_reset()
3534 retval = rndis_reset(usbdev); in rndis_wlan_reset()
3536 netdev_warn(usbdev->net, "rndis_reset failed: %d\n", retval); in rndis_wlan_reset()
3540 set_multicast_list(usbdev); in rndis_wlan_reset()
3545 return deauthenticate(usbdev); in rndis_wlan_reset()
3548 static int rndis_wlan_stop(struct usbnet *usbdev) in rndis_wlan_stop() argument
3550 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); in rndis_wlan_stop()
3554 netdev_dbg(usbdev->net, "%s()\n", __func__); in rndis_wlan_stop()
3556 retval = disassociate(usbdev, false); in rndis_wlan_stop()
3576 rndis_set_oid(usbdev, RNDIS_OID_GEN_CURRENT_PACKET_FILTER, &filter, in rndis_wlan_stop()