Lines Matching +full:custom +full:- +full:temp

5  * Copyright (c) 2005-2007, Jouni Malinen <j@w1.fi>
188 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in get80211param()
191 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_GETPARAM, &iwr) < 0) in get80211param()
192 return -1; in get80211param()
206 /* Certain ioctls must use the non-inlined method */ in set80211priv()
212 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in set80211priv()
228 if (ioctl(drv->ioctl_sock, op, &iwr) < 0) { in set80211priv()
231 __func__, drv->iface, op, in set80211priv()
234 return -1; in set80211priv()
245 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in set80211param()
249 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_SETPARAM, &iwr) < 0) { in set80211param()
252 __func__, drv->iface, op, athr_get_param_name(op), in set80211param()
254 return -1; in set80211param()
282 switch (params->wpa_group) { in atheros_configure_wpa()
311 params->wpa_group); in atheros_configure_wpa()
312 return -1; in atheros_configure_wpa()
317 return -1; in atheros_configure_wpa()
321 v = (params->wpa_group == WPA_CIPHER_WEP104 ? 13 : 5); in atheros_configure_wpa()
325 return -1; in atheros_configure_wpa()
330 if (params->wpa_pairwise & WPA_CIPHER_CCMP) in atheros_configure_wpa()
333 if (params->wpa_pairwise & WPA_CIPHER_CCMP_256) in atheros_configure_wpa()
335 if (params->wpa_pairwise & WPA_CIPHER_GCMP) in atheros_configure_wpa()
337 if (params->wpa_pairwise & WPA_CIPHER_GCMP_256) in atheros_configure_wpa()
340 if (params->wpa_pairwise & WPA_CIPHER_TKIP) in atheros_configure_wpa()
342 if (params->wpa_pairwise & WPA_CIPHER_NONE) in atheros_configure_wpa()
348 return -1; in atheros_configure_wpa()
352 __func__, params->wpa_key_mgmt); in atheros_configure_wpa()
354 params->wpa_key_mgmt)) { in atheros_configure_wpa()
357 params->wpa_key_mgmt); in atheros_configure_wpa()
358 return -1; in atheros_configure_wpa()
362 if (params->rsn_preauth) in atheros_configure_wpa()
364 if (params->ieee80211w != NO_MGMT_FRAME_PROTECTION) { in atheros_configure_wpa()
366 if (params->ieee80211w == MGMT_FRAME_PROTECTION_REQUIRED) in atheros_configure_wpa()
374 return -1; in atheros_configure_wpa()
377 wpa_printf(MSG_DEBUG, "%s: enable WPA=0x%x", __func__, params->wpa); in atheros_configure_wpa()
378 if (set80211param(drv, IEEE80211_PARAM_WPA, params->wpa)) { in atheros_configure_wpa()
379 wpa_printf(MSG_INFO, "Unable to set WPA to %u", params->wpa); in atheros_configure_wpa()
380 return -1; in atheros_configure_wpa()
390 wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, params->enabled); in atheros_set_ieee8021x()
392 if (!params->enabled) { in atheros_set_ieee8021x()
396 return -1; in atheros_set_ieee8021x()
400 if (!params->wpa && !params->ieee802_1x) { in atheros_set_ieee8021x()
402 return -1; in atheros_set_ieee8021x()
404 if (params->wpa && atheros_configure_wpa(drv, params) != 0) { in atheros_set_ieee8021x()
406 return -1; in atheros_set_ieee8021x()
409 (params->wpa ? IEEE80211_AUTH_WPA : IEEE80211_AUTH_8021X))) { in atheros_set_ieee8021x()
411 return -1; in atheros_set_ieee8021x()
500 enum wpa_alg alg = params->alg; in atheros_set_key()
501 const u8 *addr = params->addr; in atheros_set_key()
502 int key_idx = params->key_idx; in atheros_set_key()
503 int set_tx = params->set_tx; in atheros_set_key()
504 const u8 *key = params->key; in atheros_set_key()
505 size_t key_len = params->key_len; in atheros_set_key()
551 return -1; in atheros_set_key()
557 return -3; in atheros_set_key()
608 return -1; in atheros_get_seqnum()
624 seq[i] = tmp[WPA_KEY_RSC_LEN - i - 1]; in atheros_get_seqnum()
640 IEEE80211_REASON_AUTH_LEAVE, -1); in atheros_flush()
662 if (ether_addr_equal(addr, drv->acct_mac)) { in atheros_read_sta_driver_data()
663 os_memcpy(data, &drv->acct_data, sizeof(*data)); in atheros_read_sta_driver_data()
669 return -1; in atheros_read_sta_driver_data()
672 data->rx_packets = stats.is_stats.ns_rx_data; in atheros_read_sta_driver_data()
673 data->rx_bytes = stats.is_stats.ns_rx_bytes; in atheros_read_sta_driver_data()
674 data->tx_packets = stats.is_stats.ns_tx_data; in atheros_read_sta_driver_data()
675 data->tx_bytes = stats.is_stats.ns_tx_bytes; in atheros_read_sta_driver_data()
713 wpabuf_free(drv->wpa_ie); in atheros_set_opt_ie()
715 drv->wpa_ie = wpabuf_alloc_copy(ie, ie_len); in atheros_set_opt_ie()
717 drv->wpa_ie = NULL; in atheros_set_opt_ie()
721 os_memcpy(&(app_ie->app_buf[0]), ie, ie_len); in atheros_set_opt_ie()
722 app_ie->app_buflen = ie_len; in atheros_set_opt_ie()
724 app_ie->app_frmtype = IEEE80211_APPIE_FRAME_BEACON; in atheros_set_opt_ie()
727 if (drv->wps_beacon_ie != NULL) { in atheros_set_opt_ie()
728 os_memcpy(&(app_ie->app_buf[ie_len]), in atheros_set_opt_ie()
729 wpabuf_head(drv->wps_beacon_ie), in atheros_set_opt_ie()
730 wpabuf_len(drv->wps_beacon_ie)); in atheros_set_opt_ie()
731 app_ie->app_buflen = ie_len + wpabuf_len(drv->wps_beacon_ie); in atheros_set_opt_ie()
734 app_ie->app_buf, app_ie->app_buflen); in atheros_set_opt_ie()
737 app_ie->app_buflen); in atheros_set_opt_ie()
740 app_ie->app_frmtype = IEEE80211_APPIE_FRAME_PROBE_RESP; in atheros_set_opt_ie()
741 if (drv->wps_probe_resp_ie != NULL) { in atheros_set_opt_ie()
742 os_memcpy(&(app_ie->app_buf[ie_len]), in atheros_set_opt_ie()
743 wpabuf_head(drv->wps_probe_resp_ie), in atheros_set_opt_ie()
744 wpabuf_len(drv->wps_probe_resp_ie)); in atheros_set_opt_ie()
745 app_ie->app_buflen = ie_len + in atheros_set_opt_ie()
746 wpabuf_len(drv->wps_probe_resp_ie); in atheros_set_opt_ie()
748 app_ie->app_buflen = ie_len; in atheros_set_opt_ie()
750 app_ie->app_buf, app_ie->app_buflen); in atheros_set_opt_ie()
753 app_ie->app_buflen); in atheros_set_opt_ie()
818 return -1; in atheros_set_qos_map()
823 os_strlcpy(iwr.ifr_name, drv->iface, sizeof(iwr.ifr_name)); in atheros_set_qos_map()
828 qos_map->valid = 1; in atheros_set_qos_map()
829 qos_map->num_dscp_except = (qos_map_set_len - 16) / 2; in atheros_set_qos_map()
830 if (qos_map->num_dscp_except) { in atheros_set_qos_map()
831 for (i = 0; i < qos_map->num_dscp_except; i++) { in atheros_set_qos_map()
832 qos_map->dscp_exception[i].dscp = qos_map_set[i * 2]; in atheros_set_qos_map()
833 qos_map->dscp_exception[i].up = qos_map_set[i * 2 + 1]; in atheros_set_qos_map()
837 up_start = qos_map_set_len - 16; in atheros_set_qos_map()
839 qos_map->up[i].low = qos_map_set[up_start + (i * 2)]; in atheros_set_qos_map()
840 qos_map->up[i].high = qos_map_set[up_start + (i * 2) + 1]; in atheros_set_qos_map()
843 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_DBGREQ, &iwr) < 0) { in atheros_set_qos_map()
846 __func__, drv->iface, strerror(errno)); in atheros_set_qos_map()
847 return -1; in atheros_set_qos_map()
870 fc = le_to_host16(mgmt->frame_control); in atheros_raw_receive()
885 event.rx_probe_req.sa = mgmt->sa; in atheros_raw_receive()
886 event.rx_probe_req.da = mgmt->da; in atheros_raw_receive()
887 event.rx_probe_req.bssid = mgmt->bssid; in atheros_raw_receive()
889 event.rx_probe_req.ie_len = len - IEEE80211_HDRLEN; in atheros_raw_receive()
890 wpa_supplicant_event(drv->hapd, EVENT_RX_PROBE_REQ, &event); in atheros_raw_receive()
895 (ether_addr_equal(drv->own_addr, mgmt->bssid) || in atheros_raw_receive()
896 is_broadcast_ether_addr(mgmt->bssid))) { in atheros_raw_receive()
900 wpa_supplicant_event(drv->hapd, EVENT_RX_MGMT, &event); in atheros_raw_receive()
904 if (!ether_addr_equal(drv->own_addr, mgmt->bssid)) { in atheros_raw_receive()
905 wpa_printf(MSG_DEBUG, "%s: BSSID does not match - ignore", in atheros_raw_receive()
912 if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.assoc_req)) in atheros_raw_receive()
914 ielen = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.assoc_req)); in atheros_raw_receive()
915 iebuf = mgmt->u.assoc_req.variable; in atheros_raw_receive()
916 drv_event_assoc(drv->hapd, mgmt->sa, iebuf, ielen, NULL, 0, in atheros_raw_receive()
917 NULL, -1, 0); in atheros_raw_receive()
920 if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.reassoc_req)) in atheros_raw_receive()
922 ielen = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.reassoc_req)); in atheros_raw_receive()
923 iebuf = mgmt->u.reassoc_req.variable; in atheros_raw_receive()
924 drv_event_assoc(drv->hapd, mgmt->sa, iebuf, ielen, NULL, 0, in atheros_raw_receive()
925 NULL, -1, 1); in atheros_raw_receive()
928 if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) in atheros_raw_receive()
931 if (le_to_host16(mgmt->u.auth.auth_alg) == WLAN_AUTH_SAE) { in atheros_raw_receive()
934 wpa_supplicant_event(drv->hapd, EVENT_RX_MGMT, &event); in atheros_raw_receive()
937 os_memcpy(event.auth.peer, mgmt->sa, ETH_ALEN); in atheros_raw_receive()
938 os_memcpy(event.auth.bssid, mgmt->bssid, ETH_ALEN); in atheros_raw_receive()
939 event.auth.auth_type = le_to_host16(mgmt->u.auth.auth_alg); in atheros_raw_receive()
941 le_to_host16(mgmt->u.auth.status_code); in atheros_raw_receive()
943 le_to_host16(mgmt->u.auth.auth_transaction); in atheros_raw_receive()
944 event.auth.ies = mgmt->u.auth.variable; in atheros_raw_receive()
945 event.auth.ies_len = len - IEEE80211_HDRLEN - in atheros_raw_receive()
946 sizeof(mgmt->u.auth); in atheros_raw_receive()
947 wpa_supplicant_event(drv->hapd, EVENT_AUTH, &event); in atheros_raw_receive()
982 drv->sock_raw = l2_packet_init(drv->iface, NULL, ETH_P_80211_RAW, in atheros_receive_pkt()
984 if (drv->sock_raw == NULL) in atheros_receive_pkt()
985 return -1; in atheros_receive_pkt()
1011 beac_ie->app_frmtype = frametype; in atheros_set_wps_ie()
1012 beac_ie->app_buflen = len; in atheros_set_wps_ie()
1014 os_memcpy(&(beac_ie->app_buf[0]), ie, len); in atheros_set_wps_ie()
1019 (drv->wpa_ie != NULL)) { in atheros_set_wps_ie()
1021 drv->wpa_ie); in atheros_set_wps_ie()
1022 os_memcpy(&(beac_ie->app_buf[len]), wpabuf_head(drv->wpa_ie), in atheros_set_wps_ie()
1023 wpabuf_len(drv->wpa_ie)); in atheros_set_wps_ie()
1024 beac_ie->app_buflen += wpabuf_len(drv->wpa_ie); in atheros_set_wps_ie()
1028 beac_ie->app_buf, beac_ie->app_buflen); in atheros_set_wps_ie()
1031 beac_ie->app_buflen); in atheros_set_wps_ie()
1041 wpa_hexdump_buf(MSG_DEBUG, "atheros: set_ap_wps_ie - beacon", beacon); in atheros_set_ap_wps_ie()
1042 wpa_hexdump_buf(MSG_DEBUG, "atheros: set_ap_wps_ie - proberesp", in atheros_set_ap_wps_ie()
1044 wpa_hexdump_buf(MSG_DEBUG, "atheros: set_ap_wps_ie - assocresp", in atheros_set_ap_wps_ie()
1046 wpabuf_free(drv->wps_beacon_ie); in atheros_set_ap_wps_ie()
1047 drv->wps_beacon_ie = beacon ? wpabuf_dup(beacon) : NULL; in atheros_set_ap_wps_ie()
1048 wpabuf_free(drv->wps_probe_resp_ie); in atheros_set_ap_wps_ie()
1049 drv->wps_probe_resp_ie = proberesp ? wpabuf_dup(proberesp) : NULL; in atheros_set_ap_wps_ie()
1057 return -1; in atheros_set_ap_wps_ie()
1075 __func__, ether_sprintf(params->addr), params->status); in atheros_sta_auth()
1079 if (params->fils_auth && drv->fils_en) { in atheros_sta_auth()
1082 os_memcpy(mlme.fils_aad.ANonce, params->fils_anonce, in atheros_sta_auth()
1084 os_memcpy(mlme.fils_aad.SNonce, params->fils_snonce, in atheros_sta_auth()
1086 os_memcpy(mlme.fils_aad.kek, params->fils_kek, in atheros_sta_auth()
1088 mlme.fils_aad.kek_len = params->fils_kek_len; in atheros_sta_auth()
1103 mlme.im_reason = params->status; in atheros_sta_auth()
1104 mlme.im_seq = params->seq; in atheros_sta_auth()
1105 os_memcpy(mlme.im_macaddr, params->addr, IEEE80211_ADDR_LEN); in atheros_sta_auth()
1106 mlme.im_optie_len = params->len; in atheros_sta_auth()
1107 if (params->len) { in atheros_sta_auth()
1108 if (params->len < IEEE80211_MAX_OPT_IE) { in atheros_sta_auth()
1109 os_memcpy(mlme.im_optie, params->ie, params->len); in atheros_sta_auth()
1114 __func__, MAC2STR(params->addr), in atheros_sta_auth()
1115 params->status, (int) params->len); in atheros_sta_auth()
1116 return -1; in atheros_sta_auth()
1123 __func__, MAC2STR(params->addr), params->status); in atheros_sta_auth()
1155 return -1; in atheros_sta_assoc()
1171 struct hostapd_data *hapd = drv->hapd; in atheros_new_sta()
1204 /* atheros-ng svn #1453 added rsn_ie. Use it, if wpa_ie was not in atheros_new_sta()
1227 drv_event_assoc(hapd, addr, iebuf, ielen, NULL, 0, NULL, -1, 0); in atheros_new_sta()
1229 if (ether_addr_equal(addr, drv->acct_mac)) { in atheros_new_sta()
1231 os_memset(drv->acct_mac, 0, ETH_ALEN); in atheros_new_sta()
1232 os_memset(&drv->acct_data, 0, sizeof(drv->acct_data)); in atheros_new_sta()
1238 char *custom, char *end) in atheros_wireless_event_wireless_custom() argument
1241 wpa_printf(MSG_DEBUG, "Custom wireless event: '%s'", custom); in atheros_wireless_event_wireless_custom()
1243 if (os_strncmp(custom, "MLME-MICHAELMICFAILURE.indication", 33) == 0) { in atheros_wireless_event_wireless_custom()
1246 pos = os_strstr(custom, "addr="); in atheros_wireless_event_wireless_custom()
1249 "MLME-MICHAELMICFAILURE.indication " in atheros_wireless_event_wireless_custom()
1259 wpa_supplicant_event(drv->hapd, in atheros_wireless_event_wireless_custom()
1263 "MLME-MICHAELMICFAILURE.indication " in atheros_wireless_event_wireless_custom()
1266 } else if (strncmp(custom, "STA-TRAFFIC-STAT", 16) == 0) { in atheros_wireless_event_wireless_custom()
1269 key = custom; in atheros_wireless_event_wireless_custom()
1278 hwaddr_aton(value, drv->acct_mac); in atheros_wireless_event_wireless_custom()
1280 drv->acct_data.rx_packets = val; in atheros_wireless_event_wireless_custom()
1282 drv->acct_data.tx_packets = val; in atheros_wireless_event_wireless_custom()
1284 drv->acct_data.rx_bytes = val; in atheros_wireless_event_wireless_custom()
1286 drv->acct_data.tx_bytes = val; in atheros_wireless_event_wireless_custom()
1290 } else if (os_strncmp(custom, "PUSH-BUTTON.indication", 22) == 0) { in atheros_wireless_event_wireless_custom()
1295 wpa_supplicant_event(drv->hapd, EVENT_WPS_BUTTON_PUSHED, NULL); in atheros_wireless_event_wireless_custom()
1296 } else if (os_strncmp(custom, "Manage.prob_req ", 16) == 0) { in atheros_wireless_event_wireless_custom()
1299 * binary data in the custom wireless event. The old way (using in atheros_wireless_event_wireless_custom()
1303 int len = atoi(custom + 16); in atheros_wireless_event_wireless_custom()
1304 if (len < 0 || MGMT_FRAM_TAG_SIZE + len > end - custom) { in atheros_wireless_event_wireless_custom()
1310 (u8 *) custom + MGMT_FRAM_TAG_SIZE, len); in atheros_wireless_event_wireless_custom()
1312 } else if (os_strncmp(custom, "Manage.assoc_req ", 17) == 0) { in atheros_wireless_event_wireless_custom()
1315 int len = atoi(custom + 17); in atheros_wireless_event_wireless_custom()
1316 if (len < 0 || MGMT_FRAM_TAG_SIZE + len > end - custom) { in atheros_wireless_event_wireless_custom()
1323 (u8 *) custom + MGMT_FRAM_TAG_SIZE, len); in atheros_wireless_event_wireless_custom()
1324 } else if (os_strncmp(custom, "Manage.auth ", 12) == 0) { in atheros_wireless_event_wireless_custom()
1326 int len = atoi(custom + 12); in atheros_wireless_event_wireless_custom()
1328 MGMT_FRAM_TAG_SIZE + len > end - custom) { in atheros_wireless_event_wireless_custom()
1334 (u8 *) custom + MGMT_FRAM_TAG_SIZE, len); in atheros_wireless_event_wireless_custom()
1335 } else if (os_strncmp(custom, "Manage.action ", 14) == 0) { in atheros_wireless_event_wireless_custom()
1338 int len = atoi(custom + 14); in atheros_wireless_event_wireless_custom()
1339 if (len < 0 || MGMT_FRAM_TAG_SIZE + len > end - custom) { in atheros_wireless_event_wireless_custom()
1346 (u8 *) custom + MGMT_FRAM_TAG_SIZE, len); in atheros_wireless_event_wireless_custom()
1371 fc = le_to_host16(hdr->frame_control); in send_action_cb_event()
1376 event.tx_status.dst = sa->dst_addr; in send_action_cb_event()
1378 event.tx_status.data_len = data_len - sizeof(*sa); in send_action_cb_event()
1379 event.tx_status.ack = sa->ack; in send_action_cb_event()
1380 wpa_supplicant_event(drv->hapd, EVENT_TX_STATUS, &event); in send_action_cb_event()
1385 * Handle size of data problem. WEXT only allows data of 256 bytes for custom
1402 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in fetch_pending_big_events()
1408 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_P2P_BIG_PARAM, &iwr) in fetch_pending_big_events()
1431 data_len -= sizeof(freq) + sizeof(frame_type); in fetch_pending_big_events()
1434 fc = le_to_host16(mgmt->frame_control); in fetch_pending_big_events()
1444 wpa_supplicant_event(drv->hapd, EVENT_RX_MGMT, in fetch_pending_big_events()
1484 char *pos, *end, *custom, *buf; in atheros_wireless_event_wireless() local
1489 while ((size_t) (end - pos) >= IW_EV_LCP_LEN) { in atheros_wireless_event_wireless()
1494 iwe->cmd, iwe->len); in atheros_wireless_event_wireless()
1495 if (iwe->len <= IW_EV_LCP_LEN || iwe->len > end - pos) in atheros_wireless_event_wireless()
1498 custom = pos + IW_EV_POINT_LEN; in atheros_wireless_event_wireless()
1499 if (drv->we_version > 18 && in atheros_wireless_event_wireless()
1500 (iwe->cmd == IWEVMICHAELMICFAILURE || in atheros_wireless_event_wireless()
1501 iwe->cmd == IWEVASSOCREQIE || in atheros_wireless_event_wireless()
1502 iwe->cmd == IWEVCUSTOM)) { in atheros_wireless_event_wireless()
1503 /* WE-19 removed the pointer from struct iw_point */ in atheros_wireless_event_wireless()
1505 int dlen = dpos - (char *) &iwe_buf; in atheros_wireless_event_wireless()
1507 sizeof(struct iw_event) - dlen); in atheros_wireless_event_wireless()
1510 custom += IW_EV_POINT_OFF; in atheros_wireless_event_wireless()
1513 switch (iwe->cmd) { in atheros_wireless_event_wireless()
1515 drv_event_disassoc(drv->hapd, in atheros_wireless_event_wireless()
1516 (u8 *) iwe->u.addr.sa_data); in atheros_wireless_event_wireless()
1519 atheros_new_sta(drv, (u8 *) iwe->u.addr.sa_data); in atheros_wireless_event_wireless()
1527 if (iwe->u.data.length > end - custom) in atheros_wireless_event_wireless()
1529 buf = os_malloc(iwe->u.data.length + 1); in atheros_wireless_event_wireless()
1532 os_memcpy(buf, custom, iwe->u.data.length); in atheros_wireless_event_wireless()
1533 buf[iwe->u.data.length] = '\0'; in atheros_wireless_event_wireless()
1535 if (iwe->u.data.flags != 0) { in atheros_wireless_event_wireless()
1537 drv, (int) iwe->u.data.flags, in atheros_wireless_event_wireless()
1541 drv, buf, buf + iwe->u.data.length); in atheros_wireless_event_wireless()
1547 pos += iwe->len; in atheros_wireless_event_wireless()
1560 if (ifi->ifi_index != drv->ifindex) in atheros_wireless_event_rtm_newlink()
1568 if (attr->rta_type == IFLA_WIRELESS) { in atheros_wireless_event_rtm_newlink()
1571 attr->rta_len - rta_len); in atheros_wireless_event_rtm_newlink()
1586 drv->we_version = 0; in atheros_get_we_version()
1595 return -1; in atheros_get_we_version()
1598 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_get_we_version()
1602 minlen = ((char *) &range->enc_capa) - (char *) range + in atheros_get_we_version()
1603 sizeof(range->enc_capa); in atheros_get_we_version()
1605 if (ioctl(drv->ioctl_sock, SIOCGIWRANGE, &iwr) < 0) { in atheros_get_we_version()
1609 return -1; in atheros_get_we_version()
1611 range->we_version_compiled >= 18) { in atheros_get_we_version()
1614 range->we_version_compiled, in atheros_get_we_version()
1615 range->we_version_source, in atheros_get_we_version()
1616 range->enc_capa); in atheros_get_we_version()
1617 drv->we_version = range->we_version_compiled; in atheros_get_we_version()
1634 return -1; in atheros_wireless_event_init()
1635 cfg->ctx = drv; in atheros_wireless_event_init()
1636 cfg->newlink_cb = atheros_wireless_event_rtm_newlink; in atheros_wireless_event_init()
1637 drv->netlink = netlink_init(cfg); in atheros_wireless_event_init()
1638 if (drv->netlink == NULL) { in atheros_wireless_event_init()
1640 return -1; in atheros_wireless_event_init()
1669 "EAPOL frame discarded, cannot malloc temp buffer of size %lu!", in atheros_send_eapol()
1671 return -1; in atheros_send_eapol()
1675 os_memcpy(eth->h_dest, addr, ETH_ALEN); in atheros_send_eapol()
1676 os_memcpy(eth->h_source, own_addr, ETH_ALEN); in atheros_send_eapol()
1677 eth->h_proto = host_to_be16(ETH_P_EAPOL); in atheros_send_eapol()
1682 status = l2_packet_send(drv->sock_xmit, addr, ETH_P_EAPOL, bp, len); in atheros_send_eapol()
1693 drv_event_eapol_rx(drv->hapd, src_addr, buf + sizeof(struct l2_ethhdr), in handle_read()
1694 len - sizeof(struct l2_ethhdr)); in handle_read()
1713 drv->fils_en = fils; in atheros_read_fils_cap()
1714 wpa_printf(MSG_DEBUG, "atheros: fils_en=%d", drv->fils_en); in atheros_read_fils_cap()
1733 drv->hapd = hapd; in atheros_init()
1734 drv->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0); in atheros_init()
1735 if (drv->ioctl_sock < 0) { in atheros_init()
1740 os_memcpy(drv->iface, params->ifname, sizeof(drv->iface)); in atheros_init()
1743 os_strlcpy(ifr.ifr_name, drv->iface, sizeof(ifr.ifr_name)); in atheros_init()
1744 if (ioctl(drv->ioctl_sock, SIOCGIFINDEX, &ifr) != 0) { in atheros_init()
1749 drv->ifindex = ifr.ifr_ifindex; in atheros_init()
1751 drv->sock_xmit = l2_packet_init(drv->iface, NULL, ETH_P_EAPOL, in atheros_init()
1753 if (drv->sock_xmit == NULL) in atheros_init()
1755 if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr)) in atheros_init()
1757 os_memcpy(drv->own_addr, params->own_addr, ETH_ALEN); in atheros_init()
1758 if (params->bridge[0]) { in atheros_init()
1760 params->bridge[0]); in atheros_init()
1761 drv->sock_recv = l2_packet_init(params->bridge[0], NULL, in atheros_init()
1764 if (drv->sock_recv == NULL) in atheros_init()
1766 } else if (linux_br_get(brname, drv->iface) == 0) { in atheros_init()
1769 drv->sock_recv = l2_packet_init(brname, NULL, ETH_P_EAPOL, in atheros_init()
1771 if (drv->sock_recv == NULL) in atheros_init()
1774 drv->sock_recv = drv->sock_xmit; in atheros_init()
1777 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_init()
1781 if (ioctl(drv->ioctl_sock, SIOCSIWMODE, &iwr) < 0) { in atheros_init()
1789 linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0); in atheros_init()
1804 if (drv->sock_raw) in atheros_init()
1805 l2_packet_deinit(drv->sock_raw); in atheros_init()
1806 if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit) in atheros_init()
1807 l2_packet_deinit(drv->sock_recv); in atheros_init()
1808 if (drv->sock_xmit != NULL) in atheros_init()
1809 l2_packet_deinit(drv->sock_xmit); in atheros_init()
1810 if (drv->ioctl_sock >= 0) in atheros_init()
1811 close(drv->ioctl_sock); in atheros_init()
1824 if (drv->wpa_ie || drv->wps_beacon_ie || drv->wps_probe_resp_ie) { in atheros_deinit()
1826 wpabuf_free(drv->wpa_ie); in atheros_deinit()
1827 wpabuf_free(drv->wps_beacon_ie); in atheros_deinit()
1828 wpabuf_free(drv->wps_probe_resp_ie); in atheros_deinit()
1830 netlink_deinit(drv->netlink); in atheros_deinit()
1831 (void) linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0); in atheros_deinit()
1832 if (drv->ioctl_sock >= 0) in atheros_deinit()
1833 close(drv->ioctl_sock); in atheros_deinit()
1834 if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit) in atheros_deinit()
1835 l2_packet_deinit(drv->sock_recv); in atheros_deinit()
1836 if (drv->sock_xmit != NULL) in atheros_deinit()
1837 l2_packet_deinit(drv->sock_xmit); in atheros_deinit()
1838 if (drv->sock_raw) in atheros_deinit()
1839 l2_packet_deinit(drv->sock_raw); in atheros_deinit()
1850 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_set_ssid()
1855 if (ioctl(drv->ioctl_sock, SIOCSIWESSID, &iwr) < 0) { in atheros_set_ssid()
1858 return -1; in atheros_set_ssid()
1871 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in atheros_get_ssid()
1876 if (ioctl(drv->ioctl_sock, SIOCGIWESSID, &iwr) < 0) { in atheros_get_ssid()
1879 ret = -1; in atheros_get_ssid()
1898 return linux_set_iface_flags(drv->ioctl_sock, drv->iface, 1); in atheros_commit()
1913 return -1; in atheros_set_authmode()
1925 wpa_printf(MSG_DEBUG, "atheros: set_ap - pairwise_ciphers=0x%x " in atheros_set_ap()
1928 params->pairwise_ciphers, params->group_cipher, in atheros_set_ap()
1929 params->key_mgmt_suites, params->auth_algs, in atheros_set_ap()
1930 params->wpa_version, params->privacy, params->interworking); in atheros_set_ap()
1932 params->ssid, params->ssid_len); in atheros_set_ap()
1933 if (params->hessid) in atheros_set_ap()
1935 MAC2STR(params->hessid)); in atheros_set_ap()
1937 params->beacon_ies); in atheros_set_ap()
1939 params->proberesp_ies); in atheros_set_ap()
1941 params->assocresp_ies); in atheros_set_ap()
1944 if (params->osen) { in atheros_set_ap()
1956 return -1; in atheros_set_ap()
1978 (unsigned long) data_len, MAC2STR(mgmt->da)); in atheros_send_mgmt()
1980 os_memcpy(mgmt_frm->macaddr, (u8 *)mgmt->da, IEEE80211_ADDR_LEN); in atheros_send_mgmt()
1981 mgmt_frm->buflen = data_len; in atheros_send_mgmt()
1982 if (&mgmt_frm->buf[0] + data_len > buf + sizeof(buf)) { in atheros_send_mgmt()
1985 return -1; in atheros_send_mgmt()
1987 os_memcpy(&mgmt_frm->buf[0], frm, data_len); in atheros_send_mgmt()
2006 os_memcpy(addts->tspecie, tspec_ie, tspec_ielen); in atheros_add_tspec()
2012 return -1; in atheros_add_tspec()
2014 os_memcpy(tspec_ie, addts->tspecie, tspec_ielen); in atheros_add_tspec()
2015 return addts->status; in atheros_add_tspec()
2028 addnode->auth_alg = auth_alg; in atheros_add_sta_node()
2043 os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); in set80211big()
2051 if (ioctl(drv->ioctl_sock, IEEE80211_IOCTL_P2P_BIG_PARAM, &iwr) < 0) { in set80211big()
2057 return -1; in set80211big()
2075 return -1; in atheros_send_action()
2076 act->freq = freq; in atheros_send_action()
2077 os_memcpy(act->dst_addr, dst, ETH_ALEN); in atheros_send_action()
2078 os_memcpy(act->src_addr, src, ETH_ALEN); in atheros_send_action()
2079 os_memcpy(act->bssid, bssid, ETH_ALEN); in atheros_send_action()
2083 __func__, act->freq, wait, MAC2STR(act->dst_addr), in atheros_send_action()
2084 MAC2STR(act->src_addr), MAC2STR(act->bssid)); in atheros_send_action()
2105 drv->iface, oper, MAC2STR(peer)); in athr_wnm_tfs()
2109 if (*len > IEEE80211_APPIE_MAX - in athr_wnm_tfs()
2112 return -1; in athr_wnm_tfs()
2115 tfs_ie->app_frmtype = IEEE80211_APPIE_FRAME_WNM; in athr_wnm_tfs()
2116 tfs_ie->app_buflen = ETH_ALEN + 2 + 2 + *len; in athr_wnm_tfs()
2119 os_memcpy(&(tfs_ie->app_buf[0]), peer, ETH_ALEN); in athr_wnm_tfs()
2121 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN, &val, 2); in athr_wnm_tfs()
2123 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN + 2, &val, 2); in athr_wnm_tfs()
2126 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN + 2 + 2, ie, *len); in athr_wnm_tfs()
2132 return -1; in athr_wnm_tfs()
2137 tfs_ie->app_frmtype = IEEE80211_APPIE_FRAME_WNM; in athr_wnm_tfs()
2138 tfs_ie->app_buflen = IEEE80211_APPIE_MAX - in athr_wnm_tfs()
2141 os_memcpy(&(tfs_ie->app_buf[0]), peer, ETH_ALEN); in athr_wnm_tfs()
2143 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN, &val, 2); in athr_wnm_tfs()
2145 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN + 2, &val, 2); in athr_wnm_tfs()
2151 return -1; in athr_wnm_tfs()
2154 *len = tfs_ie->app_buflen; in athr_wnm_tfs()
2155 os_memcpy(ie, &(tfs_ie->app_buf[0]), *len); in athr_wnm_tfs()
2156 wpa_printf(MSG_DEBUG, "atheros: %c len=%d", tfs_ie->app_buf[0], in athr_wnm_tfs()
2164 tfs_ie->app_frmtype = IEEE80211_APPIE_FRAME_WNM; in athr_wnm_tfs()
2165 tfs_ie->app_buflen = IEEE80211_APPIE_MAX - in athr_wnm_tfs()
2168 os_memcpy(&(tfs_ie->app_buf[0]), peer, ETH_ALEN); in athr_wnm_tfs()
2170 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN, &val, 2); in athr_wnm_tfs()
2172 os_memcpy(&(tfs_ie->app_buf[0]) + ETH_ALEN + 2, &val, 2); in athr_wnm_tfs()
2178 return -1; in athr_wnm_tfs()
2198 wpa_printf(MSG_DEBUG, "atheros: WNM-Sleep Oper %d, " MACSTR, in atheros_wnm_sleep()
2204 return -1; in atheros_wnm_sleep()
2245 return -1; in atheros_wnm_oper()