Lines Matching refs:drv

182 set80211priv(struct atheros_driver_data *drv, int op, void *data, int len)  in set80211priv()  argument
193 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in set80211priv()
209 if (ioctl(drv->ioctl_sock, op, &iwr) < 0) { in set80211priv()
212 __func__, drv->iface, op, in set80211priv()
221 set80211param(struct atheros_driver_data *drv, int op, int arg) in set80211param() argument
226 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in set80211param()
230 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_SETPARAM, &iwr) < 0) { in set80211param()
233 __func__, drv->iface, op, athr_get_param_name(op), in set80211param()
258 atheros_configure_wpa(struct atheros_driver_data *drv, in atheros_configure_wpa() argument
296 if (set80211param(drv, IEEE80211_PARAM_MCASTCIPHER, v)) { in atheros_configure_wpa()
303 if (set80211param(drv, IEEE80211_PARAM_MCASTKEYLEN, v)) { in atheros_configure_wpa()
326 if (set80211param(drv, IEEE80211_PARAM_UCASTCIPHERS, v)) { in atheros_configure_wpa()
334 if (set80211param(drv, IEEE80211_PARAM_KEYMGTALGS, in atheros_configure_wpa()
354 if (set80211param(drv, IEEE80211_PARAM_RSNCAPS, v)) { in atheros_configure_wpa()
361 if (set80211param(drv, IEEE80211_PARAM_WPA, params->wpa)) { in atheros_configure_wpa()
371 struct atheros_driver_data *drv = priv; in atheros_set_ieee8021x() local
381 return atheros_set_privacy(drv, 0); in atheros_set_ieee8021x()
387 if (params->wpa && atheros_configure_wpa(drv, params) != 0) { in atheros_set_ieee8021x()
403 struct atheros_driver_data *drv = priv; in atheros_set_privacy() local
407 return set80211param(drv, IEEE80211_PARAM_PRIVACY, enabled); in atheros_set_privacy()
413 struct atheros_driver_data *drv = priv; in atheros_set_sta_authorized() local
426 ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, sizeof(mlme)); in atheros_set_sta_authorized()
451 struct atheros_driver_data *drv = priv; in atheros_del_key() local
466 ret = set80211priv(drv, IEEE80211_IOCTL_DELKEY, &wk, sizeof(wk)); in atheros_del_key()
481 struct atheros_driver_data *drv = priv; in atheros_set_key() local
487 return atheros_del_key(drv, addr, key_idx); in atheros_set_key()
556 ret = set80211priv(drv, IEEE80211_IOCTL_SETKEY, &wk, sizeof(wk)); in atheros_set_key()
572 struct atheros_driver_data *drv = priv; in atheros_get_seqnum() local
585 if (set80211priv(drv, IEEE80211_IOCTL_GETKEY, &wk, sizeof(wk))) { in atheros_get_seqnum()
629 struct atheros_driver_data *drv = priv; in atheros_read_sta_driver_data() local
639 if (set80211priv(drv, IEEE80211_IOCTL_STA_STATS, in atheros_read_sta_driver_data()
643 if (os_memcmp(addr, drv->acct_mac, ETH_ALEN) == 0) { in atheros_read_sta_driver_data()
644 os_memcpy(data, &drv->acct_data, sizeof(*data)); in atheros_read_sta_driver_data()
664 struct atheros_driver_data *drv = priv; in atheros_sta_clear_stats() local
672 ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, in atheros_sta_clear_stats()
686 struct atheros_driver_data *drv = priv; in atheros_set_opt_ie() local
694 wpabuf_free(drv->wpa_ie); in atheros_set_opt_ie()
695 drv->wpa_ie = wpabuf_alloc_copy(ie, ie_len); in atheros_set_opt_ie()
704 if (drv->wps_beacon_ie != NULL) { in atheros_set_opt_ie()
706 wpabuf_head(drv->wps_beacon_ie), in atheros_set_opt_ie()
707 wpabuf_len(drv->wps_beacon_ie)); in atheros_set_opt_ie()
708 app_ie->app_buflen = ie_len + wpabuf_len(drv->wps_beacon_ie); in atheros_set_opt_ie()
712 set80211priv(drv, IEEE80211_IOCTL_SET_APPIEBUF, app_ie, in atheros_set_opt_ie()
718 if (drv->wps_probe_resp_ie != NULL) { in atheros_set_opt_ie()
720 wpabuf_head(drv->wps_probe_resp_ie), in atheros_set_opt_ie()
721 wpabuf_len(drv->wps_probe_resp_ie)); in atheros_set_opt_ie()
723 wpabuf_len(drv->wps_probe_resp_ie); in atheros_set_opt_ie()
728 set80211priv(drv, IEEE80211_IOCTL_SET_APPIEBUF, app_ie, in atheros_set_opt_ie()
738 struct atheros_driver_data *drv = priv; in atheros_sta_deauth() local
748 ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, sizeof(mlme)); in atheros_sta_deauth()
762 struct atheros_driver_data *drv = priv; in atheros_sta_disassoc() local
772 ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, sizeof(mlme)); in atheros_sta_disassoc()
786 struct atheros_driver_data *drv = ctx; in atheros_set_qos_map() local
800 os_strlcpy(iwr.ifr_name, drv->iface, sizeof(iwr.ifr_name)); in atheros_set_qos_map()
820 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_DBGREQ, &iwr) < 0) { in atheros_set_qos_map()
823 __func__, drv->iface, strerror(errno)); in atheros_set_qos_map()
835 struct atheros_driver_data *drv = ctx; in atheros_raw_receive() local
867 wpa_supplicant_event(drv->hapd, EVENT_RX_PROBE_REQ, &event); in atheros_raw_receive()
871 if (os_memcmp(drv->own_addr, mgmt->bssid, ETH_ALEN) != 0) { in atheros_raw_receive()
883 drv_event_assoc(drv->hapd, mgmt->sa, iebuf, ielen, 0); in atheros_raw_receive()
890 drv_event_assoc(drv->hapd, mgmt->sa, iebuf, ielen, 1); in atheros_raw_receive()
896 wpa_supplicant_event(drv->hapd, EVENT_RX_MGMT, &event); in atheros_raw_receive()
912 wpa_supplicant_event(drv->hapd, EVENT_AUTH, &event); in atheros_raw_receive()
920 static int atheros_receive_pkt(struct atheros_driver_data *drv) in atheros_receive_pkt() argument
942 ret = set80211priv(drv, IEEE80211_IOCTL_FILTERFRAME, &filt, in atheros_receive_pkt()
949 drv->sock_raw = l2_packet_init(drv->iface, NULL, ETH_P_80211_RAW, in atheros_receive_pkt()
950 atheros_raw_receive, drv, 1); in atheros_receive_pkt()
951 if (drv->sock_raw == NULL) in atheros_receive_pkt()
957 static int atheros_reset_appfilter(struct atheros_driver_data *drv) in atheros_reset_appfilter() argument
961 return set80211priv(drv, IEEE80211_IOCTL_FILTERFRAME, &filt, in atheros_reset_appfilter()
969 struct atheros_driver_data *drv = priv; in atheros_set_wps_ie() local
985 (drv->wpa_ie != NULL)) { in atheros_set_wps_ie()
987 drv->wpa_ie); in atheros_set_wps_ie()
988 os_memcpy(&(beac_ie->app_buf[len]), wpabuf_head(drv->wpa_ie), in atheros_set_wps_ie()
989 wpabuf_len(drv->wpa_ie)); in atheros_set_wps_ie()
990 beac_ie->app_buflen += wpabuf_len(drv->wpa_ie); in atheros_set_wps_ie()
995 return set80211priv(drv, IEEE80211_IOCTL_SET_APPIEBUF, beac_ie, in atheros_set_wps_ie()
1005 struct atheros_driver_data *drv = priv; in atheros_set_ap_wps_ie() local
1012 wpabuf_free(drv->wps_beacon_ie); in atheros_set_ap_wps_ie()
1013 drv->wps_beacon_ie = beacon ? wpabuf_dup(beacon) : NULL; in atheros_set_ap_wps_ie()
1014 wpabuf_free(drv->wps_probe_resp_ie); in atheros_set_ap_wps_ie()
1015 drv->wps_probe_resp_ie = proberesp ? wpabuf_dup(proberesp) : NULL; in atheros_set_ap_wps_ie()
1038 struct atheros_driver_data *drv = priv; in atheros_sta_auth() local
1062 ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, sizeof(mlme)); in atheros_sta_auth()
1075 struct atheros_driver_data *drv = priv; in atheros_sta_assoc() local
1101 ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, sizeof(mlme)); in atheros_sta_assoc()
1112 atheros_new_sta(struct atheros_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN]) in atheros_new_sta() argument
1114 struct hostapd_data *hapd = drv->hapd; in atheros_new_sta()
1124 if (set80211priv(drv, IEEE80211_IOCTL_GETWPAIE, &ie, sizeof(ie))) { in atheros_new_sta()
1173 if (os_memcmp(addr, drv->acct_mac, ETH_ALEN) == 0) { in atheros_new_sta()
1175 os_memset(drv->acct_mac, 0, ETH_ALEN); in atheros_new_sta()
1176 os_memset(&drv->acct_data, 0, sizeof(drv->acct_data)); in atheros_new_sta()
1181 atheros_wireless_event_wireless_custom(struct atheros_driver_data *drv, in atheros_wireless_event_wireless_custom() argument
1203 wpa_supplicant_event(drv->hapd, in atheros_wireless_event_wireless_custom()
1222 hwaddr_aton(value, drv->acct_mac); in atheros_wireless_event_wireless_custom()
1224 drv->acct_data.rx_packets = val; in atheros_wireless_event_wireless_custom()
1226 drv->acct_data.tx_packets = val; in atheros_wireless_event_wireless_custom()
1228 drv->acct_data.rx_bytes = val; in atheros_wireless_event_wireless_custom()
1230 drv->acct_data.tx_bytes = val; in atheros_wireless_event_wireless_custom()
1239 wpa_supplicant_event(drv->hapd, EVENT_WPS_BUTTON_PUSHED, NULL); in atheros_wireless_event_wireless_custom()
1253 atheros_raw_receive(drv, NULL, in atheros_wireless_event_wireless_custom()
1267 atheros_raw_receive(drv, NULL, in atheros_wireless_event_wireless_custom()
1278 atheros_raw_receive(drv, NULL, in atheros_wireless_event_wireless_custom()
1292 atheros_raw_receive(drv, NULL, in atheros_wireless_event_wireless_custom()
1304 static void fetch_pending_big_events(struct atheros_driver_data *drv) in fetch_pending_big_events() argument
1316 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in fetch_pending_big_events()
1322 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_P2P_BIG_PARAM, &iwr) in fetch_pending_big_events()
1358 wpa_supplicant_event(drv->hapd, EVENT_RX_MGMT, in fetch_pending_big_events()
1371 atheros_wireless_event_atheros_custom(struct atheros_driver_data *drv, in atheros_wireless_event_atheros_custom() argument
1377 fetch_pending_big_events(drv); in atheros_wireless_event_atheros_custom()
1385 atheros_wireless_event_wireless(struct atheros_driver_data *drv, in atheros_wireless_event_wireless() argument
1404 if (drv->we_version > 18 && in atheros_wireless_event_wireless()
1420 drv_event_disassoc(drv->hapd, in atheros_wireless_event_wireless()
1424 atheros_new_sta(drv, (u8 *) iwe->u.addr.sa_data); in atheros_wireless_event_wireless()
1442 drv, (int) iwe->u.data.flags, in atheros_wireless_event_wireless()
1446 drv, buf, buf + iwe->u.data.length); in atheros_wireless_event_wireless()
1461 struct atheros_driver_data *drv = ctx; in atheros_wireless_event_rtm_newlink() local
1465 if (ifi->ifi_index != drv->ifindex) in atheros_wireless_event_rtm_newlink()
1475 drv, ((char *) attr) + rta_len, in atheros_wireless_event_rtm_newlink()
1484 atheros_get_we_version(struct atheros_driver_data *drv) in atheros_get_we_version() argument
1491 drv->we_version = 0; in atheros_get_we_version()
1503 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_get_we_version()
1510 if (ioctl(drv->ioctl_sock, SIOCGIWRANGE, &iwr) < 0) { in atheros_get_we_version()
1522 drv->we_version = range->we_version_compiled; in atheros_get_we_version()
1531 atheros_wireless_event_init(struct atheros_driver_data *drv) in atheros_wireless_event_init() argument
1535 atheros_get_we_version(drv); in atheros_wireless_event_init()
1540 cfg->ctx = drv; in atheros_wireless_event_init()
1542 drv->netlink = netlink_init(cfg); in atheros_wireless_event_init()
1543 if (drv->netlink == NULL) { in atheros_wireless_event_init()
1556 struct atheros_driver_data *drv = priv; in atheros_send_eapol() local
1587 status = l2_packet_send(drv->sock_xmit, addr, ETH_P_EAPOL, bp, len); in atheros_send_eapol()
1597 struct atheros_driver_data *drv = ctx; in handle_read() local
1598 drv_event_eapol_rx(drv->hapd, src_addr, buf + sizeof(struct l2_ethhdr), in handle_read()
1605 struct atheros_driver_data *drv; in atheros_init() local
1610 drv = os_zalloc(sizeof(struct atheros_driver_data)); in atheros_init()
1611 if (drv == NULL) { in atheros_init()
1617 drv->hapd = hapd; in atheros_init()
1618 drv->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0); in atheros_init()
1619 if (drv->ioctl_sock < 0) { in atheros_init()
1624 os_memcpy(drv->iface, params->ifname, sizeof(drv->iface)); in atheros_init()
1627 os_strlcpy(ifr.ifr_name, drv->iface, sizeof(ifr.ifr_name)); in atheros_init()
1628 if (ioctl(drv->ioctl_sock, SIOCGIFINDEX, &ifr) != 0) { in atheros_init()
1633 drv->ifindex = ifr.ifr_ifindex; in atheros_init()
1635 drv->sock_xmit = l2_packet_init(drv->iface, NULL, ETH_P_EAPOL, in atheros_init()
1636 handle_read, drv, 1); in atheros_init()
1637 if (drv->sock_xmit == NULL) in atheros_init()
1639 if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr)) in atheros_init()
1641 os_memcpy(drv->own_addr, params->own_addr, ETH_ALEN); in atheros_init()
1645 drv->sock_recv = l2_packet_init(params->bridge[0], NULL, in atheros_init()
1646 ETH_P_EAPOL, handle_read, drv, in atheros_init()
1648 if (drv->sock_recv == NULL) in atheros_init()
1650 } else if (linux_br_get(brname, drv->iface) == 0) { in atheros_init()
1653 drv->sock_recv = l2_packet_init(brname, NULL, ETH_P_EAPOL, in atheros_init()
1654 handle_read, drv, 1); in atheros_init()
1655 if (drv->sock_recv == NULL) in atheros_init()
1658 drv->sock_recv = drv->sock_xmit; in atheros_init()
1661 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_init()
1665 if (ioctl(drv->ioctl_sock, SIOCSIWMODE, &iwr) < 0) { in atheros_init()
1673 linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0); in atheros_init()
1674 atheros_set_privacy(drv, 0); /* default to no privacy */ in atheros_init()
1676 if (atheros_receive_pkt(drv)) in atheros_init()
1679 if (atheros_wireless_event_init(drv)) in atheros_init()
1682 return drv; in atheros_init()
1684 atheros_reset_appfilter(drv); in atheros_init()
1685 if (drv->sock_raw) in atheros_init()
1686 l2_packet_deinit(drv->sock_raw); in atheros_init()
1687 if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit) in atheros_init()
1688 l2_packet_deinit(drv->sock_recv); in atheros_init()
1689 if (drv->sock_xmit != NULL) in atheros_init()
1690 l2_packet_deinit(drv->sock_xmit); in atheros_init()
1691 if (drv->ioctl_sock >= 0) in atheros_init()
1692 close(drv->ioctl_sock); in atheros_init()
1693 os_free(drv); in atheros_init()
1701 struct atheros_driver_data *drv = priv; in atheros_deinit() local
1703 atheros_reset_appfilter(drv); in atheros_deinit()
1705 if (drv->wpa_ie || drv->wps_beacon_ie || drv->wps_probe_resp_ie) { in atheros_deinit()
1707 wpabuf_free(drv->wpa_ie); in atheros_deinit()
1708 wpabuf_free(drv->wps_beacon_ie); in atheros_deinit()
1709 wpabuf_free(drv->wps_probe_resp_ie); in atheros_deinit()
1711 netlink_deinit(drv->netlink); in atheros_deinit()
1712 (void) linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0); in atheros_deinit()
1713 if (drv->ioctl_sock >= 0) in atheros_deinit()
1714 close(drv->ioctl_sock); in atheros_deinit()
1715 if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit) in atheros_deinit()
1716 l2_packet_deinit(drv->sock_recv); in atheros_deinit()
1717 if (drv->sock_xmit != NULL) in atheros_deinit()
1718 l2_packet_deinit(drv->sock_xmit); in atheros_deinit()
1719 if (drv->sock_raw) in atheros_deinit()
1720 l2_packet_deinit(drv->sock_raw); in atheros_deinit()
1721 os_free(drv); in atheros_deinit()
1727 struct atheros_driver_data *drv = priv; in atheros_set_ssid() local
1731 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_set_ssid()
1736 if (ioctl(drv->ioctl_sock, SIOCSIWESSID, &iwr) < 0) { in atheros_set_ssid()
1747 struct atheros_driver_data *drv = priv; in atheros_get_ssid() local
1752 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_get_ssid()
1757 if (ioctl(drv->ioctl_sock, SIOCGIWESSID, &iwr) < 0) { in atheros_get_ssid()
1770 struct atheros_driver_data *drv = priv; in atheros_set_countermeasures() local
1772 return set80211param(drv, IEEE80211_PARAM_COUNTERMEASURES, enabled); in atheros_set_countermeasures()
1778 struct atheros_driver_data *drv = priv; in atheros_commit() local
1779 return linux_set_iface_flags(drv->ioctl_sock, drv->iface, 1); in atheros_commit()
1853 struct atheros_driver_data *drv = priv; in atheros_send_mgmt() local
1870 return set80211priv(drv, IEEE80211_IOCTL_SEND_MGMT, mgmt_frm, in atheros_send_mgmt()
1881 struct atheros_driver_data *drv = priv; in atheros_add_tspec() local
1890 retv = set80211priv(drv, IEEE80211_IOCTL_RES_REQ, &req, in atheros_add_tspec()
1904 struct atheros_driver_data *drv = priv; in atheros_add_sta_node() local
1912 return set80211priv(drv, IEEE80211_IOCTL_RES_REQ, &req, in atheros_add_sta_node()
1921 set80211big(struct atheros_driver_data *drv, int op, const void *data, int len) in set80211big() argument
1926 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in set80211big()
1934 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_P2P_BIG_PARAM, &iwr) < 0) { in set80211big()
1952 struct atheros_driver_data *drv = priv; in atheros_send_action() local
1971 res = set80211big(drv, IEEE80211_IOC_P2P_SEND_ACTION, in atheros_send_action()
1979 static int athr_wnm_tfs(struct atheros_driver_data *drv, const u8* peer, in athr_wnm_tfs() argument
1988 drv->iface, oper, MAC2STR(peer)); in athr_wnm_tfs()
2011 if (set80211priv(drv, IEEE80211_IOCTL_SET_APPIEBUF, tfs_ie, in athr_wnm_tfs()
2030 if (set80211priv(drv, IEEE80211_IOCTL_GET_APPIEBUF, tfs_ie, in athr_wnm_tfs()
2057 if (set80211priv(drv, IEEE80211_IOCTL_SET_APPIEBUF, tfs_ie, in athr_wnm_tfs()
2073 static int atheros_wnm_sleep(struct atheros_driver_data *drv, in atheros_wnm_sleep() argument
2101 ret = atheros_set_wps_ie(drv, data, dlen, IEEE80211_APPIE_FRAME_WNM); in atheros_wnm_sleep()
2112 struct atheros_driver_data *drv = priv; in atheros_wnm_oper() local
2119 return atheros_wnm_sleep(drv, peer, oper); in atheros_wnm_oper()
2124 return athr_wnm_tfs(drv, peer, buf, buf_len, oper); in atheros_wnm_oper()