driver_i.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. /*
  2. * wpa_supplicant - Internal driver interface wrappers
  3. * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef DRIVER_I_H
  9. #define DRIVER_I_H
  10. #include "drivers/driver.h"
  11. /* driver_ops */
  12. static inline void * wpa_drv_init(struct wpa_supplicant *wpa_s,
  13. const char *ifname)
  14. {
  15. if (wpa_s->driver->init2)
  16. return wpa_s->driver->init2(wpa_s, ifname,
  17. wpa_s->global_drv_priv);
  18. if (wpa_s->driver->init) {
  19. return wpa_s->driver->init(wpa_s, ifname);
  20. }
  21. return NULL;
  22. }
  23. static inline void wpa_drv_deinit(struct wpa_supplicant *wpa_s)
  24. {
  25. if (wpa_s->driver->deinit)
  26. wpa_s->driver->deinit(wpa_s->drv_priv);
  27. }
  28. static inline int wpa_drv_set_param(struct wpa_supplicant *wpa_s,
  29. const char *param)
  30. {
  31. if (wpa_s->driver->set_param)
  32. return wpa_s->driver->set_param(wpa_s->drv_priv, param);
  33. return 0;
  34. }
  35. static inline int wpa_drv_set_countermeasures(struct wpa_supplicant *wpa_s,
  36. int enabled)
  37. {
  38. if (wpa_s->driver->set_countermeasures) {
  39. return wpa_s->driver->set_countermeasures(wpa_s->drv_priv,
  40. enabled);
  41. }
  42. return -1;
  43. }
  44. static inline int wpa_drv_authenticate(struct wpa_supplicant *wpa_s,
  45. struct wpa_driver_auth_params *params)
  46. {
  47. if (wpa_s->driver->authenticate)
  48. return wpa_s->driver->authenticate(wpa_s->drv_priv, params);
  49. return -1;
  50. }
  51. static inline int wpa_drv_associate(struct wpa_supplicant *wpa_s,
  52. struct wpa_driver_associate_params *params)
  53. {
  54. if (wpa_s->driver->associate) {
  55. return wpa_s->driver->associate(wpa_s->drv_priv, params);
  56. }
  57. return -1;
  58. }
  59. static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s,
  60. struct wpa_driver_scan_params *params)
  61. {
  62. if (wpa_s->driver->scan2)
  63. return wpa_s->driver->scan2(wpa_s->drv_priv, params);
  64. return -1;
  65. }
  66. static inline int wpa_drv_sched_scan(struct wpa_supplicant *wpa_s,
  67. struct wpa_driver_scan_params *params,
  68. u32 interval)
  69. {
  70. if (wpa_s->driver->sched_scan)
  71. return wpa_s->driver->sched_scan(wpa_s->drv_priv,
  72. params, interval);
  73. return -1;
  74. }
  75. static inline int wpa_drv_stop_sched_scan(struct wpa_supplicant *wpa_s)
  76. {
  77. if (wpa_s->driver->stop_sched_scan)
  78. return wpa_s->driver->stop_sched_scan(wpa_s->drv_priv);
  79. return -1;
  80. }
  81. static inline struct wpa_scan_results * wpa_drv_get_scan_results2(
  82. struct wpa_supplicant *wpa_s)
  83. {
  84. if (wpa_s->driver->get_scan_results2)
  85. return wpa_s->driver->get_scan_results2(wpa_s->drv_priv);
  86. return NULL;
  87. }
  88. static inline int wpa_drv_get_bssid(struct wpa_supplicant *wpa_s, u8 *bssid)
  89. {
  90. if (wpa_s->driver->get_bssid) {
  91. return wpa_s->driver->get_bssid(wpa_s->drv_priv, bssid);
  92. }
  93. return -1;
  94. }
  95. static inline int wpa_drv_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid)
  96. {
  97. if (wpa_s->driver->get_ssid) {
  98. return wpa_s->driver->get_ssid(wpa_s->drv_priv, ssid);
  99. }
  100. return -1;
  101. }
  102. static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s,
  103. enum wpa_alg alg, const u8 *addr,
  104. int key_idx, int set_tx,
  105. const u8 *seq, size_t seq_len,
  106. const u8 *key, size_t key_len)
  107. {
  108. if (alg != WPA_ALG_NONE) {
  109. if (key_idx >= 0 && key_idx <= 6)
  110. wpa_s->keys_cleared &= ~BIT(key_idx);
  111. else
  112. wpa_s->keys_cleared = 0;
  113. }
  114. if (wpa_s->driver->set_key) {
  115. return wpa_s->driver->set_key(wpa_s->ifname, wpa_s->drv_priv,
  116. alg, addr, key_idx, set_tx,
  117. seq, seq_len, key, key_len);
  118. }
  119. return -1;
  120. }
  121. static inline int wpa_drv_sta_deauth(struct wpa_supplicant *wpa_s,
  122. const u8 *addr, int reason_code)
  123. {
  124. if (wpa_s->driver->sta_deauth) {
  125. return wpa_s->driver->sta_deauth(wpa_s->drv_priv,
  126. wpa_s->own_addr, addr,
  127. reason_code);
  128. }
  129. return -1;
  130. }
  131. static inline int wpa_drv_deauthenticate(struct wpa_supplicant *wpa_s,
  132. const u8 *addr, int reason_code)
  133. {
  134. if (wpa_s->driver->deauthenticate) {
  135. return wpa_s->driver->deauthenticate(wpa_s->drv_priv, addr,
  136. reason_code);
  137. }
  138. return -1;
  139. }
  140. static inline int wpa_drv_add_pmkid(struct wpa_supplicant *wpa_s,
  141. const u8 *bssid, const u8 *pmkid)
  142. {
  143. if (wpa_s->driver->add_pmkid) {
  144. return wpa_s->driver->add_pmkid(wpa_s->drv_priv, bssid, pmkid);
  145. }
  146. return -1;
  147. }
  148. static inline int wpa_drv_remove_pmkid(struct wpa_supplicant *wpa_s,
  149. const u8 *bssid, const u8 *pmkid)
  150. {
  151. if (wpa_s->driver->remove_pmkid) {
  152. return wpa_s->driver->remove_pmkid(wpa_s->drv_priv, bssid,
  153. pmkid);
  154. }
  155. return -1;
  156. }
  157. static inline int wpa_drv_flush_pmkid(struct wpa_supplicant *wpa_s)
  158. {
  159. if (wpa_s->driver->flush_pmkid) {
  160. return wpa_s->driver->flush_pmkid(wpa_s->drv_priv);
  161. }
  162. return -1;
  163. }
  164. static inline int wpa_drv_get_capa(struct wpa_supplicant *wpa_s,
  165. struct wpa_driver_capa *capa)
  166. {
  167. if (wpa_s->driver->get_capa) {
  168. return wpa_s->driver->get_capa(wpa_s->drv_priv, capa);
  169. }
  170. return -1;
  171. }
  172. static inline void wpa_drv_poll(struct wpa_supplicant *wpa_s)
  173. {
  174. if (wpa_s->driver->poll) {
  175. wpa_s->driver->poll(wpa_s->drv_priv);
  176. }
  177. }
  178. static inline const char * wpa_drv_get_ifname(struct wpa_supplicant *wpa_s)
  179. {
  180. if (wpa_s->driver->get_ifname) {
  181. return wpa_s->driver->get_ifname(wpa_s->drv_priv);
  182. }
  183. return NULL;
  184. }
  185. static inline const u8 * wpa_drv_get_mac_addr(struct wpa_supplicant *wpa_s)
  186. {
  187. if (wpa_s->driver->get_mac_addr) {
  188. return wpa_s->driver->get_mac_addr(wpa_s->drv_priv);
  189. }
  190. return NULL;
  191. }
  192. static inline int wpa_drv_send_eapol(struct wpa_supplicant *wpa_s,
  193. const u8 *dst, u16 proto,
  194. const u8 *data, size_t data_len)
  195. {
  196. if (wpa_s->driver->send_eapol)
  197. return wpa_s->driver->send_eapol(wpa_s->drv_priv, dst, proto,
  198. data, data_len);
  199. return -1;
  200. }
  201. static inline int wpa_drv_set_operstate(struct wpa_supplicant *wpa_s,
  202. int state)
  203. {
  204. if (wpa_s->driver->set_operstate)
  205. return wpa_s->driver->set_operstate(wpa_s->drv_priv, state);
  206. return 0;
  207. }
  208. static inline int wpa_drv_mlme_setprotection(struct wpa_supplicant *wpa_s,
  209. const u8 *addr, int protect_type,
  210. int key_type)
  211. {
  212. if (wpa_s->driver->mlme_setprotection)
  213. return wpa_s->driver->mlme_setprotection(wpa_s->drv_priv, addr,
  214. protect_type,
  215. key_type);
  216. return 0;
  217. }
  218. static inline struct hostapd_hw_modes *
  219. wpa_drv_get_hw_feature_data(struct wpa_supplicant *wpa_s, u16 *num_modes,
  220. u16 *flags)
  221. {
  222. if (wpa_s->driver->get_hw_feature_data)
  223. return wpa_s->driver->get_hw_feature_data(wpa_s->drv_priv,
  224. num_modes, flags);
  225. return NULL;
  226. }
  227. static inline int wpa_drv_set_country(struct wpa_supplicant *wpa_s,
  228. const char *alpha2)
  229. {
  230. if (wpa_s->driver->set_country)
  231. return wpa_s->driver->set_country(wpa_s->drv_priv, alpha2);
  232. return 0;
  233. }
  234. static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
  235. const u8 *data, size_t data_len, int noack)
  236. {
  237. if (wpa_s->driver->send_mlme)
  238. return wpa_s->driver->send_mlme(wpa_s->drv_priv,
  239. data, data_len, noack);
  240. return -1;
  241. }
  242. static inline int wpa_drv_update_ft_ies(struct wpa_supplicant *wpa_s,
  243. const u8 *md,
  244. const u8 *ies, size_t ies_len)
  245. {
  246. if (wpa_s->driver->update_ft_ies)
  247. return wpa_s->driver->update_ft_ies(wpa_s->drv_priv, md,
  248. ies, ies_len);
  249. return -1;
  250. }
  251. static inline int wpa_drv_send_ft_action(struct wpa_supplicant *wpa_s,
  252. u8 action, const u8 *target_ap,
  253. const u8 *ies, size_t ies_len)
  254. {
  255. if (wpa_s->driver->send_ft_action)
  256. return wpa_s->driver->send_ft_action(wpa_s->drv_priv, action,
  257. target_ap, ies, ies_len);
  258. return -1;
  259. }
  260. static inline int wpa_drv_set_ap(struct wpa_supplicant *wpa_s,
  261. struct wpa_driver_ap_params *params)
  262. {
  263. if (wpa_s->driver->set_ap)
  264. return wpa_s->driver->set_ap(wpa_s->drv_priv, params);
  265. return -1;
  266. }
  267. static inline int wpa_drv_sta_add(struct wpa_supplicant *wpa_s,
  268. struct hostapd_sta_add_params *params)
  269. {
  270. if (wpa_s->driver->sta_add)
  271. return wpa_s->driver->sta_add(wpa_s->drv_priv, params);
  272. return -1;
  273. }
  274. static inline int wpa_drv_sta_remove(struct wpa_supplicant *wpa_s,
  275. const u8 *addr)
  276. {
  277. if (wpa_s->driver->sta_remove)
  278. return wpa_s->driver->sta_remove(wpa_s->drv_priv, addr);
  279. return -1;
  280. }
  281. static inline int wpa_drv_hapd_send_eapol(struct wpa_supplicant *wpa_s,
  282. const u8 *addr, const u8 *data,
  283. size_t data_len, int encrypt,
  284. const u8 *own_addr, u32 flags)
  285. {
  286. if (wpa_s->driver->hapd_send_eapol)
  287. return wpa_s->driver->hapd_send_eapol(wpa_s->drv_priv, addr,
  288. data, data_len, encrypt,
  289. own_addr, flags);
  290. return -1;
  291. }
  292. static inline int wpa_drv_sta_set_flags(struct wpa_supplicant *wpa_s,
  293. const u8 *addr, int total_flags,
  294. int flags_or, int flags_and)
  295. {
  296. if (wpa_s->driver->sta_set_flags)
  297. return wpa_s->driver->sta_set_flags(wpa_s->drv_priv, addr,
  298. total_flags, flags_or,
  299. flags_and);
  300. return -1;
  301. }
  302. static inline int wpa_drv_set_supp_port(struct wpa_supplicant *wpa_s,
  303. int authorized)
  304. {
  305. if (wpa_s->driver->set_supp_port) {
  306. return wpa_s->driver->set_supp_port(wpa_s->drv_priv,
  307. authorized);
  308. }
  309. return 0;
  310. }
  311. static inline int wpa_drv_send_action(struct wpa_supplicant *wpa_s,
  312. unsigned int freq,
  313. unsigned int wait,
  314. const u8 *dst, const u8 *src,
  315. const u8 *bssid,
  316. const u8 *data, size_t data_len,
  317. int no_cck)
  318. {
  319. if (wpa_s->driver->send_action)
  320. return wpa_s->driver->send_action(wpa_s->drv_priv, freq,
  321. wait, dst, src, bssid,
  322. data, data_len, no_cck);
  323. return -1;
  324. }
  325. static inline void wpa_drv_send_action_cancel_wait(struct wpa_supplicant *wpa_s)
  326. {
  327. if (wpa_s->driver->send_action_cancel_wait)
  328. wpa_s->driver->send_action_cancel_wait(wpa_s->drv_priv);
  329. }
  330. static inline int wpa_drv_set_freq(struct wpa_supplicant *wpa_s,
  331. struct hostapd_freq_params *freq)
  332. {
  333. if (wpa_s->driver->set_freq)
  334. return wpa_s->driver->set_freq(wpa_s->drv_priv, freq);
  335. return -1;
  336. }
  337. static inline int wpa_drv_if_add(struct wpa_supplicant *wpa_s,
  338. enum wpa_driver_if_type type,
  339. const char *ifname, const u8 *addr,
  340. void *bss_ctx, char *force_ifname,
  341. u8 *if_addr, const char *bridge)
  342. {
  343. if (wpa_s->driver->if_add)
  344. return wpa_s->driver->if_add(wpa_s->drv_priv, type, ifname,
  345. addr, bss_ctx, NULL, force_ifname,
  346. if_addr, bridge, 0);
  347. return -1;
  348. }
  349. static inline int wpa_drv_if_remove(struct wpa_supplicant *wpa_s,
  350. enum wpa_driver_if_type type,
  351. const char *ifname)
  352. {
  353. if (wpa_s->driver->if_remove)
  354. return wpa_s->driver->if_remove(wpa_s->drv_priv, type, ifname);
  355. return -1;
  356. }
  357. static inline int wpa_drv_remain_on_channel(struct wpa_supplicant *wpa_s,
  358. unsigned int freq,
  359. unsigned int duration)
  360. {
  361. if (wpa_s->driver->remain_on_channel)
  362. return wpa_s->driver->remain_on_channel(wpa_s->drv_priv, freq,
  363. duration);
  364. return -1;
  365. }
  366. static inline int wpa_drv_cancel_remain_on_channel(
  367. struct wpa_supplicant *wpa_s)
  368. {
  369. if (wpa_s->driver->cancel_remain_on_channel)
  370. return wpa_s->driver->cancel_remain_on_channel(
  371. wpa_s->drv_priv);
  372. return -1;
  373. }
  374. static inline int wpa_drv_probe_req_report(struct wpa_supplicant *wpa_s,
  375. int report)
  376. {
  377. if (wpa_s->driver->probe_req_report)
  378. return wpa_s->driver->probe_req_report(wpa_s->drv_priv,
  379. report);
  380. return -1;
  381. }
  382. static inline int wpa_drv_deinit_ap(struct wpa_supplicant *wpa_s)
  383. {
  384. if (wpa_s->driver->deinit_ap)
  385. return wpa_s->driver->deinit_ap(wpa_s->drv_priv);
  386. return 0;
  387. }
  388. static inline int wpa_drv_deinit_p2p_cli(struct wpa_supplicant *wpa_s)
  389. {
  390. if (wpa_s->driver->deinit_p2p_cli)
  391. return wpa_s->driver->deinit_p2p_cli(wpa_s->drv_priv);
  392. return 0;
  393. }
  394. static inline void wpa_drv_suspend(struct wpa_supplicant *wpa_s)
  395. {
  396. if (wpa_s->driver->suspend)
  397. wpa_s->driver->suspend(wpa_s->drv_priv);
  398. }
  399. static inline void wpa_drv_resume(struct wpa_supplicant *wpa_s)
  400. {
  401. if (wpa_s->driver->resume)
  402. wpa_s->driver->resume(wpa_s->drv_priv);
  403. }
  404. static inline int wpa_drv_signal_monitor(struct wpa_supplicant *wpa_s,
  405. int threshold, int hysteresis)
  406. {
  407. if (wpa_s->driver->signal_monitor)
  408. return wpa_s->driver->signal_monitor(wpa_s->drv_priv,
  409. threshold, hysteresis);
  410. return -1;
  411. }
  412. static inline int wpa_drv_signal_poll(struct wpa_supplicant *wpa_s,
  413. struct wpa_signal_info *si)
  414. {
  415. if (wpa_s->driver->signal_poll)
  416. return wpa_s->driver->signal_poll(wpa_s->drv_priv, si);
  417. return -1;
  418. }
  419. static inline int wpa_drv_pktcnt_poll(struct wpa_supplicant *wpa_s,
  420. struct hostap_sta_driver_data *sta)
  421. {
  422. if (wpa_s->driver->read_sta_data)
  423. return wpa_s->driver->read_sta_data(wpa_s->drv_priv, sta,
  424. wpa_s->bssid);
  425. return -1;
  426. }
  427. static inline int wpa_drv_set_ap_wps_ie(struct wpa_supplicant *wpa_s,
  428. const struct wpabuf *beacon,
  429. const struct wpabuf *proberesp,
  430. const struct wpabuf *assocresp)
  431. {
  432. if (!wpa_s->driver->set_ap_wps_ie)
  433. return -1;
  434. return wpa_s->driver->set_ap_wps_ie(wpa_s->drv_priv, beacon,
  435. proberesp, assocresp);
  436. }
  437. static inline int wpa_drv_shared_freq(struct wpa_supplicant *wpa_s)
  438. {
  439. if (!wpa_s->driver->shared_freq)
  440. return -1;
  441. return wpa_s->driver->shared_freq(wpa_s->drv_priv);
  442. }
  443. static inline int wpa_drv_get_noa(struct wpa_supplicant *wpa_s,
  444. u8 *buf, size_t buf_len)
  445. {
  446. if (!wpa_s->driver->get_noa)
  447. return -1;
  448. return wpa_s->driver->get_noa(wpa_s->drv_priv, buf, buf_len);
  449. }
  450. static inline int wpa_drv_set_p2p_powersave(struct wpa_supplicant *wpa_s,
  451. int legacy_ps, int opp_ps,
  452. int ctwindow)
  453. {
  454. if (!wpa_s->driver->set_p2p_powersave)
  455. return -1;
  456. return wpa_s->driver->set_p2p_powersave(wpa_s->drv_priv, legacy_ps,
  457. opp_ps, ctwindow);
  458. }
  459. static inline int wpa_drv_ampdu(struct wpa_supplicant *wpa_s, int ampdu)
  460. {
  461. if (!wpa_s->driver->ampdu)
  462. return -1;
  463. return wpa_s->driver->ampdu(wpa_s->drv_priv, ampdu);
  464. }
  465. static inline int wpa_drv_send_tdls_mgmt(struct wpa_supplicant *wpa_s,
  466. const u8 *dst, u8 action_code,
  467. u8 dialog_token, u16 status_code,
  468. const u8 *buf, size_t len)
  469. {
  470. if (wpa_s->driver->send_tdls_mgmt) {
  471. return wpa_s->driver->send_tdls_mgmt(wpa_s->drv_priv, dst,
  472. action_code, dialog_token,
  473. status_code, buf, len);
  474. }
  475. return -1;
  476. }
  477. static inline int wpa_drv_tdls_oper(struct wpa_supplicant *wpa_s,
  478. enum tdls_oper oper, const u8 *peer)
  479. {
  480. if (!wpa_s->driver->tdls_oper)
  481. return -1;
  482. return wpa_s->driver->tdls_oper(wpa_s->drv_priv, oper, peer);
  483. }
  484. #ifdef ANDROID
  485. static inline int wpa_drv_driver_cmd(struct wpa_supplicant *wpa_s,
  486. char *cmd, char *buf, size_t buf_len)
  487. {
  488. if (!wpa_s->driver->driver_cmd)
  489. return -1;
  490. return wpa_s->driver->driver_cmd(wpa_s->drv_priv, cmd, buf, buf_len);
  491. }
  492. #endif /* ANDROID */
  493. static inline void wpa_drv_set_rekey_info(struct wpa_supplicant *wpa_s,
  494. const u8 *kek, const u8 *kck,
  495. const u8 *replay_ctr)
  496. {
  497. if (!wpa_s->driver->set_rekey_info)
  498. return;
  499. wpa_s->driver->set_rekey_info(wpa_s->drv_priv, kek, kck, replay_ctr);
  500. }
  501. static inline int wpa_drv_radio_disable(struct wpa_supplicant *wpa_s,
  502. int disabled)
  503. {
  504. if (!wpa_s->driver->radio_disable)
  505. return -1;
  506. return wpa_s->driver->radio_disable(wpa_s->drv_priv, disabled);
  507. }
  508. static inline int wpa_drv_switch_channel(struct wpa_supplicant *wpa_s,
  509. struct csa_settings *settings)
  510. {
  511. if (!wpa_s->driver->switch_channel)
  512. return -1;
  513. return wpa_s->driver->switch_channel(wpa_s->drv_priv, settings);
  514. }
  515. static inline int wpa_drv_wnm_oper(struct wpa_supplicant *wpa_s,
  516. enum wnm_oper oper, const u8 *peer,
  517. u8 *buf, u16 *buf_len)
  518. {
  519. if (!wpa_s->driver->wnm_oper)
  520. return -1;
  521. return wpa_s->driver->wnm_oper(wpa_s->drv_priv, oper, peer, buf,
  522. buf_len);
  523. }
  524. static inline int wpa_drv_status(struct wpa_supplicant *wpa_s,
  525. char *buf, size_t buflen)
  526. {
  527. if (!wpa_s->driver->status)
  528. return -1;
  529. return wpa_s->driver->status(wpa_s->drv_priv, buf, buflen);
  530. }
  531. static inline int wpa_drv_set_qos_map(struct wpa_supplicant *wpa_s,
  532. const u8 *qos_map_set, u8 qos_map_set_len)
  533. {
  534. if (!wpa_s->driver->set_qos_map)
  535. return -1;
  536. return wpa_s->driver->set_qos_map(wpa_s->drv_priv, qos_map_set,
  537. qos_map_set_len);
  538. }
  539. static inline int wpa_drv_vendor_cmd(struct wpa_supplicant *wpa_s,
  540. int vendor_id, int subcmd, const u8 *data,
  541. size_t data_len, struct wpabuf *buf)
  542. {
  543. if (!wpa_s->driver->vendor_cmd)
  544. return -1;
  545. return wpa_s->driver->vendor_cmd(wpa_s->drv_priv, vendor_id, subcmd,
  546. data, data_len, buf);
  547. }
  548. #endif /* DRIVER_I_H */