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