wnm_ap.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. /*
  2. * hostapd - WNM
  3. * Copyright (c) 2011-2013, Qualcomm Atheros, Inc.
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #include "utils/includes.h"
  9. #include "utils/common.h"
  10. #include "utils/eloop.h"
  11. #include "common/ieee802_11_defs.h"
  12. #include "ap/hostapd.h"
  13. #include "ap/sta_info.h"
  14. #include "ap/ap_config.h"
  15. #include "ap/ap_drv_ops.h"
  16. #include "ap/wpa_auth.h"
  17. #include "wnm_ap.h"
  18. #define MAX_TFS_IE_LEN 1024
  19. /* get the TFS IE from driver */
  20. static int ieee80211_11_get_tfs_ie(struct hostapd_data *hapd, const u8 *addr,
  21. u8 *buf, u16 *buf_len, enum wnm_oper oper)
  22. {
  23. wpa_printf(MSG_DEBUG, "%s: TFS get operation %d", __func__, oper);
  24. return hostapd_drv_wnm_oper(hapd, oper, addr, buf, buf_len);
  25. }
  26. /* set the TFS IE to driver */
  27. static int ieee80211_11_set_tfs_ie(struct hostapd_data *hapd, const u8 *addr,
  28. u8 *buf, u16 *buf_len, enum wnm_oper oper)
  29. {
  30. wpa_printf(MSG_DEBUG, "%s: TFS set operation %d", __func__, oper);
  31. return hostapd_drv_wnm_oper(hapd, oper, addr, buf, buf_len);
  32. }
  33. /* MLME-SLEEPMODE.response */
  34. static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd,
  35. const u8 *addr, u8 dialog_token,
  36. u8 action_type, u16 intval)
  37. {
  38. struct ieee80211_mgmt *mgmt;
  39. int res;
  40. size_t len;
  41. size_t gtk_elem_len = 0;
  42. size_t igtk_elem_len = 0;
  43. struct wnm_sleep_element wnmsleep_ie;
  44. u8 *wnmtfs_ie;
  45. u8 wnmsleep_ie_len;
  46. u16 wnmtfs_ie_len;
  47. u8 *pos;
  48. struct sta_info *sta;
  49. enum wnm_oper tfs_oper = action_type == WNM_SLEEP_MODE_ENTER ?
  50. WNM_SLEEP_TFS_RESP_IE_ADD : WNM_SLEEP_TFS_RESP_IE_NONE;
  51. sta = ap_get_sta(hapd, addr);
  52. if (sta == NULL) {
  53. wpa_printf(MSG_DEBUG, "%s: station not found", __func__);
  54. return -EINVAL;
  55. }
  56. /* WNM-Sleep Mode IE */
  57. os_memset(&wnmsleep_ie, 0, sizeof(struct wnm_sleep_element));
  58. wnmsleep_ie_len = sizeof(struct wnm_sleep_element);
  59. wnmsleep_ie.eid = WLAN_EID_WNMSLEEP;
  60. wnmsleep_ie.len = wnmsleep_ie_len - 2;
  61. wnmsleep_ie.action_type = action_type;
  62. wnmsleep_ie.status = WNM_STATUS_SLEEP_ACCEPT;
  63. wnmsleep_ie.intval = host_to_le16(intval);
  64. /* TFS IE(s) */
  65. wnmtfs_ie = os_zalloc(MAX_TFS_IE_LEN);
  66. if (wnmtfs_ie == NULL)
  67. return -1;
  68. if (ieee80211_11_get_tfs_ie(hapd, addr, wnmtfs_ie, &wnmtfs_ie_len,
  69. tfs_oper)) {
  70. wnmtfs_ie_len = 0;
  71. os_free(wnmtfs_ie);
  72. wnmtfs_ie = NULL;
  73. }
  74. #define MAX_GTK_SUBELEM_LEN 45
  75. #define MAX_IGTK_SUBELEM_LEN 26
  76. mgmt = os_zalloc(sizeof(*mgmt) + wnmsleep_ie_len +
  77. MAX_GTK_SUBELEM_LEN + MAX_IGTK_SUBELEM_LEN);
  78. if (mgmt == NULL) {
  79. wpa_printf(MSG_DEBUG, "MLME: Failed to allocate buffer for "
  80. "WNM-Sleep Response action frame");
  81. return -1;
  82. }
  83. os_memcpy(mgmt->da, addr, ETH_ALEN);
  84. os_memcpy(mgmt->sa, hapd->own_addr, ETH_ALEN);
  85. os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
  86. mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT,
  87. WLAN_FC_STYPE_ACTION);
  88. mgmt->u.action.category = WLAN_ACTION_WNM;
  89. mgmt->u.action.u.wnm_sleep_resp.action = WNM_SLEEP_MODE_RESP;
  90. mgmt->u.action.u.wnm_sleep_resp.dialogtoken = dialog_token;
  91. pos = (u8 *)mgmt->u.action.u.wnm_sleep_resp.variable;
  92. /* add key data if MFP is enabled */
  93. if (!wpa_auth_uses_mfp(sta->wpa_sm) ||
  94. action_type != WNM_SLEEP_MODE_EXIT) {
  95. mgmt->u.action.u.wnm_sleep_resp.keydata_len = 0;
  96. } else {
  97. gtk_elem_len = wpa_wnmsleep_gtk_subelem(sta->wpa_sm, pos);
  98. pos += gtk_elem_len;
  99. wpa_printf(MSG_DEBUG, "Pass 4, gtk_len = %d",
  100. (int) gtk_elem_len);
  101. #ifdef CONFIG_IEEE80211W
  102. res = wpa_wnmsleep_igtk_subelem(sta->wpa_sm, pos);
  103. if (res < 0) {
  104. os_free(wnmtfs_ie);
  105. os_free(mgmt);
  106. return -1;
  107. }
  108. igtk_elem_len = res;
  109. pos += igtk_elem_len;
  110. wpa_printf(MSG_DEBUG, "Pass 4 igtk_len = %d",
  111. (int) igtk_elem_len);
  112. #endif /* CONFIG_IEEE80211W */
  113. WPA_PUT_LE16((u8 *)
  114. &mgmt->u.action.u.wnm_sleep_resp.keydata_len,
  115. gtk_elem_len + igtk_elem_len);
  116. }
  117. os_memcpy(pos, &wnmsleep_ie, wnmsleep_ie_len);
  118. /* copy TFS IE here */
  119. pos += wnmsleep_ie_len;
  120. if (wnmtfs_ie)
  121. os_memcpy(pos, wnmtfs_ie, wnmtfs_ie_len);
  122. len = 1 + sizeof(mgmt->u.action.u.wnm_sleep_resp) + gtk_elem_len +
  123. igtk_elem_len + wnmsleep_ie_len + wnmtfs_ie_len;
  124. /* In driver, response frame should be forced to sent when STA is in
  125. * PS mode */
  126. res = hostapd_drv_send_action(hapd, hapd->iface->freq, 0,
  127. mgmt->da, &mgmt->u.action.category, len);
  128. if (!res) {
  129. wpa_printf(MSG_DEBUG, "Successfully send WNM-Sleep Response "
  130. "frame");
  131. /* when entering wnmsleep
  132. * 1. pause the node in driver
  133. * 2. mark the node so that AP won't update GTK/IGTK during
  134. * WNM Sleep
  135. */
  136. if (wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT &&
  137. wnmsleep_ie.action_type == WNM_SLEEP_MODE_ENTER) {
  138. sta->flags |= WLAN_STA_WNM_SLEEP_MODE;
  139. hostapd_drv_wnm_oper(hapd, WNM_SLEEP_ENTER_CONFIRM,
  140. addr, NULL, NULL);
  141. wpa_set_wnmsleep(sta->wpa_sm, 1);
  142. }
  143. /* when exiting wnmsleep
  144. * 1. unmark the node
  145. * 2. start GTK/IGTK update if MFP is not used
  146. * 3. unpause the node in driver
  147. */
  148. if ((wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT ||
  149. wnmsleep_ie.status ==
  150. WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) &&
  151. wnmsleep_ie.action_type == WNM_SLEEP_MODE_EXIT) {
  152. sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
  153. wpa_set_wnmsleep(sta->wpa_sm, 0);
  154. hostapd_drv_wnm_oper(hapd, WNM_SLEEP_EXIT_CONFIRM,
  155. addr, NULL, NULL);
  156. if (!wpa_auth_uses_mfp(sta->wpa_sm))
  157. wpa_wnmsleep_rekey_gtk(sta->wpa_sm);
  158. }
  159. } else
  160. wpa_printf(MSG_DEBUG, "Fail to send WNM-Sleep Response frame");
  161. #undef MAX_GTK_SUBELEM_LEN
  162. #undef MAX_IGTK_SUBELEM_LEN
  163. os_free(wnmtfs_ie);
  164. os_free(mgmt);
  165. return res;
  166. }
  167. static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd,
  168. const u8 *addr, const u8 *frm, int len)
  169. {
  170. /* Dialog Token [1] | WNM-Sleep Mode IE | TFS Response IE */
  171. const u8 *pos = frm;
  172. u8 dialog_token;
  173. struct wnm_sleep_element *wnmsleep_ie = NULL;
  174. /* multiple TFS Req IE (assuming consecutive) */
  175. u8 *tfsreq_ie_start = NULL;
  176. u8 *tfsreq_ie_end = NULL;
  177. u16 tfsreq_ie_len = 0;
  178. dialog_token = *pos++;
  179. while (pos + 1 < frm + len) {
  180. u8 ie_len = pos[1];
  181. if (pos + 2 + ie_len > frm + len)
  182. break;
  183. if (*pos == WLAN_EID_WNMSLEEP)
  184. wnmsleep_ie = (struct wnm_sleep_element *) pos;
  185. else if (*pos == WLAN_EID_TFS_REQ) {
  186. if (!tfsreq_ie_start)
  187. tfsreq_ie_start = (u8 *) pos;
  188. tfsreq_ie_end = (u8 *) pos;
  189. } else
  190. wpa_printf(MSG_DEBUG, "WNM: EID %d not recognized",
  191. *pos);
  192. pos += ie_len + 2;
  193. }
  194. if (!wnmsleep_ie) {
  195. wpa_printf(MSG_DEBUG, "No WNM-Sleep IE found");
  196. return;
  197. }
  198. if (wnmsleep_ie->action_type == WNM_SLEEP_MODE_ENTER &&
  199. tfsreq_ie_start && tfsreq_ie_end &&
  200. tfsreq_ie_end - tfsreq_ie_start >= 0) {
  201. tfsreq_ie_len = (tfsreq_ie_end + tfsreq_ie_end[1] + 2) -
  202. tfsreq_ie_start;
  203. wpa_printf(MSG_DEBUG, "TFS Req IE(s) found");
  204. /* pass the TFS Req IE(s) to driver for processing */
  205. if (ieee80211_11_set_tfs_ie(hapd, addr, tfsreq_ie_start,
  206. &tfsreq_ie_len,
  207. WNM_SLEEP_TFS_REQ_IE_SET))
  208. wpa_printf(MSG_DEBUG, "Fail to set TFS Req IE");
  209. }
  210. ieee802_11_send_wnmsleep_resp(hapd, addr, dialog_token,
  211. wnmsleep_ie->action_type,
  212. le_to_host16(wnmsleep_ie->intval));
  213. if (wnmsleep_ie->action_type == WNM_SLEEP_MODE_EXIT) {
  214. /* clear the tfs after sending the resp frame */
  215. ieee80211_11_set_tfs_ie(hapd, addr, tfsreq_ie_start,
  216. &tfsreq_ie_len, WNM_SLEEP_TFS_IE_DEL);
  217. }
  218. }
  219. static int ieee802_11_send_bss_trans_mgmt_request(struct hostapd_data *hapd,
  220. const u8 *addr,
  221. u8 dialog_token,
  222. const char *url)
  223. {
  224. struct ieee80211_mgmt *mgmt;
  225. size_t url_len, len;
  226. u8 *pos;
  227. int res;
  228. if (url)
  229. url_len = os_strlen(url);
  230. else
  231. url_len = 0;
  232. mgmt = os_zalloc(sizeof(*mgmt) + (url_len ? 1 + url_len : 0));
  233. if (mgmt == NULL)
  234. return -1;
  235. os_memcpy(mgmt->da, addr, ETH_ALEN);
  236. os_memcpy(mgmt->sa, hapd->own_addr, ETH_ALEN);
  237. os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
  238. mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT,
  239. WLAN_FC_STYPE_ACTION);
  240. mgmt->u.action.category = WLAN_ACTION_WNM;
  241. mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ;
  242. mgmt->u.action.u.bss_tm_req.dialog_token = dialog_token;
  243. mgmt->u.action.u.bss_tm_req.req_mode = 0;
  244. mgmt->u.action.u.bss_tm_req.disassoc_timer = host_to_le16(0);
  245. mgmt->u.action.u.bss_tm_req.validity_interval = 1;
  246. pos = mgmt->u.action.u.bss_tm_req.variable;
  247. if (url) {
  248. *pos++ += url_len;
  249. os_memcpy(pos, url, url_len);
  250. pos += url_len;
  251. }
  252. wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
  253. MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u "
  254. "validity_interval=%u",
  255. MAC2STR(addr), dialog_token,
  256. mgmt->u.action.u.bss_tm_req.req_mode,
  257. le_to_host16(mgmt->u.action.u.bss_tm_req.disassoc_timer),
  258. mgmt->u.action.u.bss_tm_req.validity_interval);
  259. len = pos - &mgmt->u.action.category;
  260. res = hostapd_drv_send_action(hapd, hapd->iface->freq, 0,
  261. mgmt->da, &mgmt->u.action.category, len);
  262. os_free(mgmt);
  263. return res;
  264. }
  265. static void ieee802_11_rx_bss_trans_mgmt_query(struct hostapd_data *hapd,
  266. const u8 *addr, const u8 *frm,
  267. size_t len)
  268. {
  269. u8 dialog_token, reason;
  270. const u8 *pos, *end;
  271. if (len < 2) {
  272. wpa_printf(MSG_DEBUG, "WNM: Ignore too short BSS Transition Management Query from "
  273. MACSTR, MAC2STR(addr));
  274. return;
  275. }
  276. pos = frm;
  277. end = pos + len;
  278. dialog_token = *pos++;
  279. reason = *pos++;
  280. wpa_printf(MSG_DEBUG, "WNM: BSS Transition Management Query from "
  281. MACSTR " dialog_token=%u reason=%u",
  282. MAC2STR(addr), dialog_token, reason);
  283. wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries",
  284. pos, end - pos);
  285. ieee802_11_send_bss_trans_mgmt_request(hapd, addr, dialog_token, NULL);
  286. }
  287. static void ieee802_11_rx_bss_trans_mgmt_resp(struct hostapd_data *hapd,
  288. const u8 *addr, const u8 *frm,
  289. size_t len)
  290. {
  291. u8 dialog_token, status_code, bss_termination_delay;
  292. const u8 *pos, *end;
  293. if (len < 3) {
  294. wpa_printf(MSG_DEBUG, "WNM: Ignore too short BSS Transition Management Response from "
  295. MACSTR, MAC2STR(addr));
  296. return;
  297. }
  298. pos = frm;
  299. end = pos + len;
  300. dialog_token = *pos++;
  301. status_code = *pos++;
  302. bss_termination_delay = *pos++;
  303. wpa_printf(MSG_DEBUG, "WNM: BSS Transition Management Response from "
  304. MACSTR " dialog_token=%u status_code=%u "
  305. "bss_termination_delay=%u", MAC2STR(addr), dialog_token,
  306. status_code, bss_termination_delay);
  307. if (status_code == WNM_BSS_TM_ACCEPT) {
  308. if (end - pos < ETH_ALEN) {
  309. wpa_printf(MSG_DEBUG, "WNM: not enough room for Target BSSID field");
  310. return;
  311. }
  312. wpa_printf(MSG_DEBUG, "WNM: Target BSSID: " MACSTR,
  313. MAC2STR(pos));
  314. pos += ETH_ALEN;
  315. }
  316. wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries",
  317. pos, end - pos);
  318. }
  319. int ieee802_11_rx_wnm_action_ap(struct hostapd_data *hapd,
  320. const struct ieee80211_mgmt *mgmt, size_t len)
  321. {
  322. u8 action;
  323. const u8 *payload;
  324. size_t plen;
  325. if (len < IEEE80211_HDRLEN + 2)
  326. return -1;
  327. payload = &mgmt->u.action.category;
  328. payload++;
  329. action = *payload++;
  330. plen = (((const u8 *) mgmt) + len) - payload;
  331. switch (action) {
  332. case WNM_BSS_TRANS_MGMT_QUERY:
  333. ieee802_11_rx_bss_trans_mgmt_query(hapd, mgmt->sa, payload,
  334. plen);
  335. return 0;
  336. case WNM_BSS_TRANS_MGMT_RESP:
  337. ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload,
  338. plen);
  339. return 0;
  340. case WNM_SLEEP_MODE_REQ:
  341. ieee802_11_rx_wnmsleep_req(hapd, mgmt->sa, payload, plen);
  342. return 0;
  343. }
  344. wpa_printf(MSG_DEBUG, "WNM: Unsupported WNM Action %u from " MACSTR,
  345. action, MAC2STR(mgmt->sa));
  346. return -1;
  347. }
  348. int wnm_send_disassoc_imminent(struct hostapd_data *hapd,
  349. struct sta_info *sta, int disassoc_timer)
  350. {
  351. u8 buf[1000], *pos;
  352. struct ieee80211_mgmt *mgmt;
  353. os_memset(buf, 0, sizeof(buf));
  354. mgmt = (struct ieee80211_mgmt *) buf;
  355. mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT,
  356. WLAN_FC_STYPE_ACTION);
  357. os_memcpy(mgmt->da, sta->addr, ETH_ALEN);
  358. os_memcpy(mgmt->sa, hapd->own_addr, ETH_ALEN);
  359. os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
  360. mgmt->u.action.category = WLAN_ACTION_WNM;
  361. mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ;
  362. mgmt->u.action.u.bss_tm_req.dialog_token = 1;
  363. mgmt->u.action.u.bss_tm_req.req_mode =
  364. WNM_BSS_TM_REQ_DISASSOC_IMMINENT;
  365. mgmt->u.action.u.bss_tm_req.disassoc_timer =
  366. host_to_le16(disassoc_timer);
  367. mgmt->u.action.u.bss_tm_req.validity_interval = 0;
  368. pos = mgmt->u.action.u.bss_tm_req.variable;
  369. wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to "
  370. MACSTR, disassoc_timer, MAC2STR(sta->addr));
  371. if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0) < 0) {
  372. wpa_printf(MSG_DEBUG, "Failed to send BSS Transition "
  373. "Management Request frame");
  374. return -1;
  375. }
  376. return 0;
  377. }
  378. int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd,
  379. struct sta_info *sta, const char *url,
  380. int disassoc_timer)
  381. {
  382. u8 buf[1000], *pos;
  383. struct ieee80211_mgmt *mgmt;
  384. size_t url_len;
  385. os_memset(buf, 0, sizeof(buf));
  386. mgmt = (struct ieee80211_mgmt *) buf;
  387. mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT,
  388. WLAN_FC_STYPE_ACTION);
  389. os_memcpy(mgmt->da, sta->addr, ETH_ALEN);
  390. os_memcpy(mgmt->sa, hapd->own_addr, ETH_ALEN);
  391. os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
  392. mgmt->u.action.category = WLAN_ACTION_WNM;
  393. mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ;
  394. mgmt->u.action.u.bss_tm_req.dialog_token = 1;
  395. mgmt->u.action.u.bss_tm_req.req_mode =
  396. WNM_BSS_TM_REQ_DISASSOC_IMMINENT |
  397. WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT;
  398. mgmt->u.action.u.bss_tm_req.disassoc_timer =
  399. host_to_le16(disassoc_timer);
  400. mgmt->u.action.u.bss_tm_req.validity_interval = 0x01;
  401. pos = mgmt->u.action.u.bss_tm_req.variable;
  402. /* Session Information URL */
  403. url_len = os_strlen(url);
  404. if (url_len > 255)
  405. return -1;
  406. *pos++ = url_len;
  407. os_memcpy(pos, url, url_len);
  408. pos += url_len;
  409. if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0) < 0) {
  410. wpa_printf(MSG_DEBUG, "Failed to send BSS Transition "
  411. "Management Request frame");
  412. return -1;
  413. }
  414. /* send disassociation frame after time-out */
  415. if (disassoc_timer) {
  416. int timeout, beacon_int;
  417. /*
  418. * Prevent STA from reconnecting using cached PMKSA to force
  419. * full authentication with the authentication server (which may
  420. * decide to reject the connection),
  421. */
  422. wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr);
  423. beacon_int = hapd->iconf->beacon_int;
  424. if (beacon_int < 1)
  425. beacon_int = 100; /* best guess */
  426. /* Calculate timeout in ms based on beacon_int in TU */
  427. timeout = disassoc_timer * beacon_int * 128 / 125;
  428. wpa_printf(MSG_DEBUG, "Disassociation timer for " MACSTR
  429. " set to %d ms", MAC2STR(sta->addr), timeout);
  430. sta->timeout_next = STA_DISASSOC_FROM_CLI;
  431. eloop_cancel_timeout(ap_handle_timer, hapd, sta);
  432. eloop_register_timeout(timeout / 1000,
  433. timeout % 1000 * 1000,
  434. ap_handle_timer, hapd, sta);
  435. }
  436. return 0;
  437. }