driver_i.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * hostapd - internal driver interface wrappers
  3. * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
  4. * Copyright (c) 2007-2008, Intel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Alternatively, this software may be distributed under the terms of BSD
  11. * license.
  12. *
  13. * See README and COPYING for more details.
  14. */
  15. #ifndef DRIVER_I_H
  16. #define DRIVER_I_H
  17. #include "driver.h"
  18. static inline void *
  19. hostapd_driver_init(struct hostapd_data *hapd)
  20. {
  21. if (hapd->driver == NULL || hapd->driver->init == NULL)
  22. return NULL;
  23. return hapd->driver->init(hapd);
  24. }
  25. static inline void *
  26. hostapd_driver_init_bssid(struct hostapd_data *hapd, const u8 *bssid)
  27. {
  28. if (hapd->driver == NULL || hapd->driver->init_bssid == NULL)
  29. return NULL;
  30. return hapd->driver->init_bssid(hapd, bssid);
  31. }
  32. static inline void
  33. hostapd_driver_deinit(struct hostapd_data *hapd)
  34. {
  35. if (hapd->driver == NULL || hapd->driver->deinit == NULL)
  36. return;
  37. hapd->driver->deinit(hapd->drv_priv);
  38. }
  39. static inline int
  40. hostapd_wireless_event_init(struct hostapd_data *hapd)
  41. {
  42. if (hapd->driver == NULL ||
  43. hapd->driver->wireless_event_init == NULL)
  44. return 0;
  45. return hapd->driver->wireless_event_init(hapd->drv_priv);
  46. }
  47. static inline void
  48. hostapd_wireless_event_deinit(struct hostapd_data *hapd)
  49. {
  50. if (hapd->driver == NULL ||
  51. hapd->driver->wireless_event_deinit == NULL)
  52. return;
  53. hapd->driver->wireless_event_deinit(hapd->drv_priv);
  54. }
  55. static inline int
  56. hostapd_set_ieee8021x(const char *ifname, struct hostapd_data *hapd,
  57. int enabled)
  58. {
  59. if (hapd->driver == NULL || hapd->driver->set_ieee8021x == NULL)
  60. return 0;
  61. return hapd->driver->set_ieee8021x(ifname, hapd->drv_priv, enabled);
  62. }
  63. static inline int
  64. hostapd_set_privacy(struct hostapd_data *hapd, int enabled)
  65. {
  66. if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
  67. return 0;
  68. return hapd->driver->set_privacy(hapd->conf->iface, hapd->drv_priv,
  69. enabled);
  70. }
  71. static inline int
  72. hostapd_set_encryption(const char *ifname, struct hostapd_data *hapd,
  73. const char *alg, const u8 *addr, int idx,
  74. u8 *key, size_t key_len, int txkey)
  75. {
  76. if (hapd->driver == NULL || hapd->driver->set_encryption == NULL)
  77. return 0;
  78. return hapd->driver->set_encryption(ifname, hapd->drv_priv, alg, addr,
  79. idx, key, key_len, txkey);
  80. }
  81. static inline int
  82. hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
  83. const u8 *addr, int idx, u8 *seq)
  84. {
  85. if (hapd->driver == NULL || hapd->driver->get_seqnum == NULL)
  86. return 0;
  87. return hapd->driver->get_seqnum(ifname, hapd->drv_priv, addr, idx,
  88. seq);
  89. }
  90. static inline int
  91. hostapd_get_seqnum_igtk(const char *ifname, struct hostapd_data *hapd,
  92. const u8 *addr, int idx, u8 *seq)
  93. {
  94. if (hapd->driver == NULL || hapd->driver->get_seqnum_igtk == NULL)
  95. return -1;
  96. return hapd->driver->get_seqnum_igtk(ifname, hapd->drv_priv, addr, idx,
  97. seq);
  98. }
  99. static inline int
  100. hostapd_flush(struct hostapd_data *hapd)
  101. {
  102. if (hapd->driver == NULL || hapd->driver->flush == NULL)
  103. return 0;
  104. return hapd->driver->flush(hapd->drv_priv);
  105. }
  106. static inline int
  107. hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
  108. size_t elem_len)
  109. {
  110. if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
  111. return 0;
  112. return hapd->driver->set_generic_elem(hapd->conf->iface,
  113. hapd->drv_priv, elem, elem_len);
  114. }
  115. static inline int
  116. hostapd_read_sta_data(struct hostapd_data *hapd,
  117. struct hostap_sta_driver_data *data, const u8 *addr)
  118. {
  119. if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
  120. return -1;
  121. return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
  122. }
  123. static inline int
  124. hostapd_send_eapol(struct hostapd_data *hapd, const u8 *addr, const u8 *data,
  125. size_t data_len, int encrypt)
  126. {
  127. if (hapd->driver == NULL || hapd->driver->send_eapol == NULL)
  128. return 0;
  129. return hapd->driver->send_eapol(hapd->drv_priv, addr, data, data_len,
  130. encrypt, hapd->own_addr);
  131. }
  132. static inline int
  133. hostapd_sta_deauth(struct hostapd_data *hapd, const u8 *addr, int reason)
  134. {
  135. if (hapd->driver == NULL || hapd->driver->sta_deauth == NULL)
  136. return 0;
  137. return hapd->driver->sta_deauth(hapd->drv_priv, addr, reason);
  138. }
  139. static inline int
  140. hostapd_sta_disassoc(struct hostapd_data *hapd, const u8 *addr, int reason)
  141. {
  142. if (hapd->driver == NULL || hapd->driver->sta_disassoc == NULL)
  143. return 0;
  144. return hapd->driver->sta_disassoc(hapd->drv_priv, addr, reason);
  145. }
  146. static inline int
  147. hostapd_sta_remove(struct hostapd_data *hapd, const u8 *addr)
  148. {
  149. if (hapd->driver == NULL || hapd->driver->sta_remove == NULL)
  150. return 0;
  151. return hapd->driver->sta_remove(hapd->drv_priv, addr);
  152. }
  153. static inline int
  154. hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
  155. {
  156. if (hapd->driver == NULL || hapd->driver->get_ssid == NULL)
  157. return 0;
  158. return hapd->driver->get_ssid(hapd->conf->iface, hapd->drv_priv, buf,
  159. len);
  160. }
  161. static inline int
  162. hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
  163. {
  164. if (hapd->driver == NULL || hapd->driver->set_ssid == NULL)
  165. return 0;
  166. return hapd->driver->set_ssid(hapd->conf->iface, hapd->drv_priv, buf,
  167. len);
  168. }
  169. static inline int
  170. hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len,
  171. int flags)
  172. {
  173. if (hapd->driver == NULL || hapd->driver->send_mgmt_frame == NULL)
  174. return 0;
  175. return hapd->driver->send_mgmt_frame(hapd->drv_priv, msg, len, flags);
  176. }
  177. static inline int
  178. hostapd_set_assoc_ap(struct hostapd_data *hapd, const u8 *addr)
  179. {
  180. if (hapd->driver == NULL || hapd->driver->set_assoc_ap == NULL)
  181. return 0;
  182. return hapd->driver->set_assoc_ap(hapd->drv_priv, addr);
  183. }
  184. static inline int
  185. hostapd_set_countermeasures(struct hostapd_data *hapd, int enabled)
  186. {
  187. if (hapd->driver == NULL || hapd->driver->set_countermeasures == NULL)
  188. return 0;
  189. return hapd->driver->set_countermeasures(hapd->drv_priv, enabled);
  190. }
  191. static inline int
  192. hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, const u8 *addr,
  193. u16 aid, u16 capability, const u8 *supp_rates,
  194. size_t supp_rates_len, int flags, u16 listen_interval,
  195. const struct ht_cap_ie *ht_capabilities)
  196. {
  197. if (hapd->driver == NULL)
  198. return 0;
  199. if (hapd->driver->sta_add2) {
  200. struct hostapd_sta_add_params params;
  201. os_memset(&params, 0, sizeof(params));
  202. params.addr = addr;
  203. params.aid = aid;
  204. params.capability = capability;
  205. params.supp_rates = supp_rates;
  206. params.supp_rates_len = supp_rates_len;
  207. params.flags = flags;
  208. params.listen_interval = listen_interval;
  209. params.ht_capabilities = ht_capabilities;
  210. return hapd->driver->sta_add2(ifname, hapd->drv_priv, &params);
  211. }
  212. if (hapd->driver->sta_add == NULL)
  213. return 0;
  214. return hapd->driver->sta_add(ifname, hapd->drv_priv, addr, aid,
  215. capability, (u8 *) supp_rates,
  216. supp_rates_len,
  217. flags, listen_interval);
  218. }
  219. static inline int
  220. hostapd_get_inact_sec(struct hostapd_data *hapd, const u8 *addr)
  221. {
  222. if (hapd->driver == NULL || hapd->driver->get_inact_sec == NULL)
  223. return 0;
  224. return hapd->driver->get_inact_sec(hapd->drv_priv, addr);
  225. }
  226. static inline int
  227. hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int ht_enabled,
  228. int sec_channel_offset)
  229. {
  230. if (hapd->driver == NULL)
  231. return 0;
  232. if (hapd->driver->set_freq2) {
  233. struct hostapd_freq_params data;
  234. os_memset(&data, 0, sizeof(data));
  235. data.mode = mode;
  236. data.freq = freq;
  237. data.ht_enabled = ht_enabled;
  238. data.sec_channel_offset = sec_channel_offset;
  239. return hapd->driver->set_freq2(hapd->drv_priv, &data);
  240. }
  241. if (hapd->driver->set_freq == NULL)
  242. return 0;
  243. return hapd->driver->set_freq(hapd->drv_priv, mode, freq);
  244. }
  245. static inline int
  246. hostapd_set_rts(struct hostapd_data *hapd, int rts)
  247. {
  248. if (hapd->driver == NULL || hapd->driver->set_rts == NULL)
  249. return 0;
  250. return hapd->driver->set_rts(hapd->drv_priv, rts);
  251. }
  252. static inline int
  253. hostapd_get_rts(struct hostapd_data *hapd, int *rts)
  254. {
  255. if (hapd->driver == NULL || hapd->driver->get_rts == NULL)
  256. return 0;
  257. return hapd->driver->get_rts(hapd->drv_priv, rts);
  258. }
  259. static inline int
  260. hostapd_set_frag(struct hostapd_data *hapd, int frag)
  261. {
  262. if (hapd->driver == NULL || hapd->driver->set_frag == NULL)
  263. return 0;
  264. return hapd->driver->set_frag(hapd->drv_priv, frag);
  265. }
  266. static inline int
  267. hostapd_get_frag(struct hostapd_data *hapd, int *frag)
  268. {
  269. if (hapd->driver == NULL || hapd->driver->get_frag == NULL)
  270. return 0;
  271. return hapd->driver->get_frag(hapd->drv_priv, frag);
  272. }
  273. static inline int
  274. hostapd_set_retry(struct hostapd_data *hapd, int short_retry, int long_retry)
  275. {
  276. if (hapd->driver == NULL || hapd->driver->set_retry == NULL)
  277. return 0;
  278. return hapd->driver->set_retry(hapd->drv_priv, short_retry,
  279. long_retry);
  280. }
  281. static inline int
  282. hostapd_get_retry(struct hostapd_data *hapd, int *short_retry, int *long_retry)
  283. {
  284. if (hapd->driver == NULL || hapd->driver->get_retry == NULL)
  285. return 0;
  286. return hapd->driver->get_retry(hapd->drv_priv, short_retry,
  287. long_retry);
  288. }
  289. static inline int
  290. hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
  291. int total_flags, int flags_or, int flags_and)
  292. {
  293. if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)
  294. return 0;
  295. return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
  296. flags_or, flags_and);
  297. }
  298. static inline int
  299. hostapd_set_rate_sets(struct hostapd_data *hapd, int *supp_rates,
  300. int *basic_rates, int mode)
  301. {
  302. if (hapd->driver == NULL || hapd->driver->set_rate_sets == NULL)
  303. return 0;
  304. return hapd->driver->set_rate_sets(hapd->drv_priv, supp_rates,
  305. basic_rates, mode);
  306. }
  307. static inline int
  308. hostapd_set_regulatory_domain(struct hostapd_data *hapd, unsigned int rd)
  309. {
  310. if (hapd->driver == NULL ||
  311. hapd->driver->set_regulatory_domain == NULL)
  312. return 0;
  313. return hapd->driver->set_regulatory_domain(hapd->drv_priv, rd);
  314. }
  315. static inline int
  316. hostapd_set_country(struct hostapd_data *hapd, const char *country)
  317. {
  318. if (hapd->driver == NULL ||
  319. hapd->driver->set_country == NULL)
  320. return 0;
  321. return hapd->driver->set_country(hapd->drv_priv, country);
  322. }
  323. static inline int
  324. hostapd_set_ieee80211d(struct hostapd_data *hapd, int enabled)
  325. {
  326. if (hapd->driver == NULL ||
  327. hapd->driver->set_ieee80211d == NULL)
  328. return 0;
  329. return hapd->driver->set_ieee80211d(hapd->drv_priv, enabled);
  330. }
  331. static inline int
  332. hostapd_sta_clear_stats(struct hostapd_data *hapd, const u8 *addr)
  333. {
  334. if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
  335. return 0;
  336. return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
  337. }
  338. static inline int
  339. hostapd_set_beacon(const char *ifname, struct hostapd_data *hapd,
  340. u8 *head, size_t head_len,
  341. u8 *tail, size_t tail_len)
  342. {
  343. if (hapd->driver == NULL || hapd->driver->set_beacon == NULL)
  344. return 0;
  345. return hapd->driver->set_beacon(ifname, hapd->drv_priv, head, head_len,
  346. tail, tail_len);
  347. }
  348. static inline int
  349. hostapd_set_internal_bridge(struct hostapd_data *hapd, int value)
  350. {
  351. if (hapd->driver == NULL || hapd->driver->set_internal_bridge == NULL)
  352. return 0;
  353. return hapd->driver->set_internal_bridge(hapd->drv_priv, value);
  354. }
  355. static inline int
  356. hostapd_set_beacon_int(struct hostapd_data *hapd, int value)
  357. {
  358. if (hapd->driver == NULL || hapd->driver->set_beacon_int == NULL)
  359. return 0;
  360. return hapd->driver->set_beacon_int(hapd->drv_priv, value);
  361. }
  362. static inline int
  363. hostapd_set_dtim_period(struct hostapd_data *hapd, int value)
  364. {
  365. if (hapd->driver == NULL || hapd->driver->set_dtim_period == NULL)
  366. return 0;
  367. return hapd->driver->set_dtim_period(hapd->conf->iface, hapd->drv_priv,
  368. value);
  369. }
  370. static inline int
  371. hostapd_set_broadcast_ssid(struct hostapd_data *hapd, int value)
  372. {
  373. if (hapd->driver == NULL || hapd->driver->set_broadcast_ssid == NULL)
  374. return 0;
  375. return hapd->driver->set_broadcast_ssid(hapd->drv_priv, value);
  376. }
  377. static inline int
  378. hostapd_set_cts_protect(struct hostapd_data *hapd, int value)
  379. {
  380. if (hapd->driver == NULL || hapd->driver->set_cts_protect == NULL)
  381. return 0;
  382. return hapd->driver->set_cts_protect(hapd->drv_priv, value);
  383. }
  384. static inline int
  385. hostapd_set_key_tx_rx_threshold(struct hostapd_data *hapd, int value)
  386. {
  387. if (hapd->driver == NULL ||
  388. hapd->driver->set_key_tx_rx_threshold == NULL)
  389. return 0;
  390. return hapd->driver->set_key_tx_rx_threshold(hapd->drv_priv, value);
  391. }
  392. static inline int
  393. hostapd_set_preamble(struct hostapd_data *hapd, int value)
  394. {
  395. if (hapd->driver == NULL || hapd->driver->set_preamble == NULL)
  396. return 0;
  397. return hapd->driver->set_preamble(hapd->drv_priv, value);
  398. }
  399. static inline int
  400. hostapd_set_short_slot_time(struct hostapd_data *hapd, int value)
  401. {
  402. if (hapd->driver == NULL || hapd->driver->set_short_slot_time == NULL)
  403. return 0;
  404. return hapd->driver->set_short_slot_time(hapd->drv_priv, value);
  405. }
  406. static inline int
  407. hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
  408. int cw_min, int cw_max, int burst_time)
  409. {
  410. if (hapd->driver == NULL || hapd->driver->set_tx_queue_params == NULL)
  411. return 0;
  412. return hapd->driver->set_tx_queue_params(hapd->drv_priv, queue, aifs,
  413. cw_min, cw_max, burst_time);
  414. }
  415. static inline int
  416. hostapd_bss_add(struct hostapd_data *hapd, const char *ifname, const u8 *bssid)
  417. {
  418. if (hapd->driver == NULL || hapd->driver->bss_add == NULL)
  419. return 0;
  420. return hapd->driver->bss_add(hapd->drv_priv, ifname, bssid);
  421. }
  422. static inline int
  423. hostapd_bss_remove(struct hostapd_data *hapd, const char *ifname)
  424. {
  425. if (hapd->driver == NULL || hapd->driver->bss_remove == NULL)
  426. return 0;
  427. return hapd->driver->bss_remove(hapd->drv_priv, ifname);
  428. }
  429. static inline int
  430. hostapd_valid_bss_mask(struct hostapd_data *hapd, const u8 *addr,
  431. const u8 *mask)
  432. {
  433. if (hapd->driver == NULL || hapd->driver->valid_bss_mask == NULL)
  434. return 1;
  435. return hapd->driver->valid_bss_mask(hapd->drv_priv, addr, mask);
  436. }
  437. static inline int
  438. hostapd_if_add(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
  439. char *ifname, const u8 *addr)
  440. {
  441. if (hapd->driver == NULL || hapd->driver->if_add == NULL)
  442. return -1;
  443. return hapd->driver->if_add(hapd->conf->iface, hapd->drv_priv, type,
  444. ifname, addr);
  445. }
  446. static inline int
  447. hostapd_if_update(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
  448. char *ifname, const u8 *addr)
  449. {
  450. if (hapd->driver == NULL || hapd->driver->if_update == NULL)
  451. return -1;
  452. return hapd->driver->if_update(hapd->drv_priv, type, ifname, addr);
  453. }
  454. static inline int
  455. hostapd_if_remove(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
  456. char *ifname, const u8 *addr)
  457. {
  458. if (hapd->driver == NULL || hapd->driver->if_remove == NULL)
  459. return -1;
  460. return hapd->driver->if_remove(hapd->drv_priv, type, ifname, addr);
  461. }
  462. static inline int
  463. hostapd_passive_scan(struct hostapd_data *hapd, int now, int our_mode_only,
  464. int interval, int _listen, int *channel,
  465. int *last_rx)
  466. {
  467. if (hapd->driver == NULL || hapd->driver->passive_scan == NULL)
  468. return -1;
  469. return hapd->driver->passive_scan(hapd->drv_priv, now, our_mode_only,
  470. interval, _listen, channel, last_rx);
  471. }
  472. static inline struct hostapd_hw_modes *
  473. hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
  474. u16 *flags)
  475. {
  476. if (hapd->driver == NULL || hapd->driver->get_hw_feature_data == NULL)
  477. return NULL;
  478. return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,
  479. flags);
  480. }
  481. static inline int
  482. hostapd_set_sta_vlan(const char *ifname, struct hostapd_data *hapd,
  483. const u8 *addr, int vlan_id)
  484. {
  485. if (hapd->driver == NULL || hapd->driver->set_sta_vlan == NULL)
  486. return 0;
  487. return hapd->driver->set_sta_vlan(hapd->drv_priv, addr, ifname, vlan_id);
  488. }
  489. static inline int
  490. hostapd_driver_commit(struct hostapd_data *hapd)
  491. {
  492. if (hapd->driver == NULL || hapd->driver->commit == NULL)
  493. return 0;
  494. return hapd->driver->commit(hapd->drv_priv);
  495. }
  496. static inline int
  497. hostapd_set_radius_acl_auth(struct hostapd_data *hapd, const u8 *mac,
  498. int accepted, u32 session_timeout)
  499. {
  500. if (hapd->driver == NULL || hapd->driver->set_radius_acl_auth == NULL)
  501. return 0;
  502. return hapd->driver->set_radius_acl_auth(hapd->drv_priv, mac, accepted,
  503. session_timeout);
  504. }
  505. static inline int
  506. hostapd_set_radius_acl_expire(struct hostapd_data *hapd, const u8 *mac)
  507. {
  508. if (hapd->driver == NULL ||
  509. hapd->driver->set_radius_acl_expire == NULL)
  510. return 0;
  511. return hapd->driver->set_radius_acl_expire(hapd->drv_priv, mac);
  512. }
  513. #ifdef CONFIG_IEEE80211N
  514. static inline int
  515. hostapd_set_ht_params(const char *ifname, struct hostapd_data *hapd,
  516. const u8 *ht_capab, size_t ht_capab_len,
  517. const u8 *ht_oper, size_t ht_oper_len)
  518. {
  519. if (hapd->driver == NULL || hapd->driver->set_ht_params == NULL ||
  520. ht_capab == NULL || ht_oper == NULL)
  521. return 0;
  522. return hapd->driver->set_ht_params(
  523. ifname, hapd->drv_priv, ht_capab, ht_capab_len,
  524. ht_oper, ht_oper_len);
  525. }
  526. #endif /* CONFIG_IEEE80211N */
  527. static inline int
  528. hostapd_drv_none(struct hostapd_data *hapd)
  529. {
  530. return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;
  531. }
  532. static inline int
  533. hostapd_set_wps_beacon_ie(struct hostapd_data *hapd, const u8 *ie, size_t len)
  534. {
  535. if (hapd->driver == NULL || hapd->driver->set_wps_beacon_ie == NULL)
  536. return 0;
  537. return hapd->driver->set_wps_beacon_ie(hapd->conf->iface,
  538. hapd->drv_priv, ie, len);
  539. }
  540. static inline int
  541. hostapd_set_wps_probe_resp_ie(struct hostapd_data *hapd, const u8 *ie,
  542. size_t len)
  543. {
  544. if (hapd->driver == NULL ||
  545. hapd->driver->set_wps_probe_resp_ie == NULL)
  546. return 0;
  547. return hapd->driver->set_wps_probe_resp_ie(hapd->conf->iface,
  548. hapd->drv_priv, ie, len);
  549. }
  550. #endif /* DRIVER_I_H */