rdev-ops.h 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. #ifndef __CFG80211_RDEV_OPS
  2. #define __CFG80211_RDEV_OPS
  3. #include <linux/rtnetlink.h>
  4. #include <net/cfg80211.h>
  5. #include "core.h"
  6. #include "trace.h"
  7. static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
  8. struct cfg80211_wowlan *wowlan)
  9. {
  10. int ret;
  11. trace_rdev_suspend(&rdev->wiphy, wowlan);
  12. ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
  13. trace_rdev_return_int(&rdev->wiphy, ret);
  14. return ret;
  15. }
  16. static inline int rdev_resume(struct cfg80211_registered_device *rdev)
  17. {
  18. int ret;
  19. trace_rdev_resume(&rdev->wiphy);
  20. ret = rdev->ops->resume(&rdev->wiphy);
  21. trace_rdev_return_int(&rdev->wiphy, ret);
  22. return ret;
  23. }
  24. static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
  25. bool enabled)
  26. {
  27. trace_rdev_set_wakeup(&rdev->wiphy, enabled);
  28. rdev->ops->set_wakeup(&rdev->wiphy, enabled);
  29. trace_rdev_return_void(&rdev->wiphy);
  30. }
  31. static inline struct wireless_dev
  32. *rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
  33. unsigned char name_assign_type,
  34. enum nl80211_iftype type, u32 *flags,
  35. struct vif_params *params)
  36. {
  37. struct wireless_dev *ret;
  38. trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
  39. ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
  40. type, flags, params);
  41. trace_rdev_return_wdev(&rdev->wiphy, ret);
  42. return ret;
  43. }
  44. static inline int
  45. rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
  46. struct wireless_dev *wdev)
  47. {
  48. int ret;
  49. trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
  50. ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
  51. trace_rdev_return_int(&rdev->wiphy, ret);
  52. return ret;
  53. }
  54. static inline int
  55. rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
  56. struct net_device *dev, enum nl80211_iftype type,
  57. u32 *flags, struct vif_params *params)
  58. {
  59. int ret;
  60. trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
  61. ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags,
  62. params);
  63. trace_rdev_return_int(&rdev->wiphy, ret);
  64. return ret;
  65. }
  66. static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
  67. struct net_device *netdev, u8 key_index,
  68. bool pairwise, const u8 *mac_addr,
  69. struct key_params *params)
  70. {
  71. int ret;
  72. trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
  73. ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise,
  74. mac_addr, params);
  75. trace_rdev_return_int(&rdev->wiphy, ret);
  76. return ret;
  77. }
  78. static inline int
  79. rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
  80. u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie,
  81. void (*callback)(void *cookie, struct key_params*))
  82. {
  83. int ret;
  84. trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
  85. ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise,
  86. mac_addr, cookie, callback);
  87. trace_rdev_return_int(&rdev->wiphy, ret);
  88. return ret;
  89. }
  90. static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
  91. struct net_device *netdev, u8 key_index,
  92. bool pairwise, const u8 *mac_addr)
  93. {
  94. int ret;
  95. trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
  96. ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise,
  97. mac_addr);
  98. trace_rdev_return_int(&rdev->wiphy, ret);
  99. return ret;
  100. }
  101. static inline int
  102. rdev_set_default_key(struct cfg80211_registered_device *rdev,
  103. struct net_device *netdev, u8 key_index, bool unicast,
  104. bool multicast)
  105. {
  106. int ret;
  107. trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index,
  108. unicast, multicast);
  109. ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index,
  110. unicast, multicast);
  111. trace_rdev_return_int(&rdev->wiphy, ret);
  112. return ret;
  113. }
  114. static inline int
  115. rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
  116. struct net_device *netdev, u8 key_index)
  117. {
  118. int ret;
  119. trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index);
  120. ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev,
  121. key_index);
  122. trace_rdev_return_int(&rdev->wiphy, ret);
  123. return ret;
  124. }
  125. static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
  126. struct net_device *dev,
  127. struct cfg80211_ap_settings *settings)
  128. {
  129. int ret;
  130. trace_rdev_start_ap(&rdev->wiphy, dev, settings);
  131. ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings);
  132. trace_rdev_return_int(&rdev->wiphy, ret);
  133. return ret;
  134. }
  135. static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
  136. struct net_device *dev,
  137. struct cfg80211_beacon_data *info)
  138. {
  139. int ret;
  140. trace_rdev_change_beacon(&rdev->wiphy, dev, info);
  141. ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info);
  142. trace_rdev_return_int(&rdev->wiphy, ret);
  143. return ret;
  144. }
  145. static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
  146. struct net_device *dev)
  147. {
  148. int ret;
  149. trace_rdev_stop_ap(&rdev->wiphy, dev);
  150. ret = rdev->ops->stop_ap(&rdev->wiphy, dev);
  151. trace_rdev_return_int(&rdev->wiphy, ret);
  152. return ret;
  153. }
  154. static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
  155. struct net_device *dev, u8 *mac,
  156. struct station_parameters *params)
  157. {
  158. int ret;
  159. trace_rdev_add_station(&rdev->wiphy, dev, mac, params);
  160. ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
  161. trace_rdev_return_int(&rdev->wiphy, ret);
  162. return ret;
  163. }
  164. static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
  165. struct net_device *dev,
  166. struct station_del_parameters *params)
  167. {
  168. int ret;
  169. trace_rdev_del_station(&rdev->wiphy, dev, params);
  170. ret = rdev->ops->del_station(&rdev->wiphy, dev, params);
  171. trace_rdev_return_int(&rdev->wiphy, ret);
  172. return ret;
  173. }
  174. static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
  175. struct net_device *dev, u8 *mac,
  176. struct station_parameters *params)
  177. {
  178. int ret;
  179. trace_rdev_change_station(&rdev->wiphy, dev, mac, params);
  180. ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
  181. trace_rdev_return_int(&rdev->wiphy, ret);
  182. return ret;
  183. }
  184. static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
  185. struct net_device *dev, const u8 *mac,
  186. struct station_info *sinfo)
  187. {
  188. int ret;
  189. trace_rdev_get_station(&rdev->wiphy, dev, mac);
  190. ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
  191. trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
  192. return ret;
  193. }
  194. static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
  195. struct net_device *dev, int idx, u8 *mac,
  196. struct station_info *sinfo)
  197. {
  198. int ret;
  199. trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac);
  200. ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
  201. trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
  202. return ret;
  203. }
  204. static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
  205. struct net_device *dev, u8 *dst, u8 *next_hop)
  206. {
  207. int ret;
  208. trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop);
  209. ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
  210. trace_rdev_return_int(&rdev->wiphy, ret);
  211. return ret;
  212. }
  213. static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
  214. struct net_device *dev, u8 *dst)
  215. {
  216. int ret;
  217. trace_rdev_del_mpath(&rdev->wiphy, dev, dst);
  218. ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
  219. trace_rdev_return_int(&rdev->wiphy, ret);
  220. return ret;
  221. }
  222. static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
  223. struct net_device *dev, u8 *dst,
  224. u8 *next_hop)
  225. {
  226. int ret;
  227. trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop);
  228. ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
  229. trace_rdev_return_int(&rdev->wiphy, ret);
  230. return ret;
  231. }
  232. static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
  233. struct net_device *dev, u8 *dst, u8 *next_hop,
  234. struct mpath_info *pinfo)
  235. {
  236. int ret;
  237. trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop);
  238. ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
  239. trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
  240. return ret;
  241. }
  242. static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev,
  243. struct net_device *dev, u8 *dst, u8 *mpp,
  244. struct mpath_info *pinfo)
  245. {
  246. int ret;
  247. trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp);
  248. ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo);
  249. trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
  250. return ret;
  251. }
  252. static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev,
  253. struct net_device *dev, int idx, u8 *dst,
  254. u8 *next_hop, struct mpath_info *pinfo)
  255. {
  256. int ret;
  257. trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop);
  258. ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
  259. pinfo);
  260. trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
  261. return ret;
  262. }
  263. static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev,
  264. struct net_device *dev, int idx, u8 *dst,
  265. u8 *mpp, struct mpath_info *pinfo)
  266. {
  267. int ret;
  268. trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp);
  269. ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo);
  270. trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
  271. return ret;
  272. }
  273. static inline int
  274. rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
  275. struct net_device *dev, struct mesh_config *conf)
  276. {
  277. int ret;
  278. trace_rdev_get_mesh_config(&rdev->wiphy, dev);
  279. ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
  280. trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf);
  281. return ret;
  282. }
  283. static inline int
  284. rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
  285. struct net_device *dev, u32 mask,
  286. const struct mesh_config *nconf)
  287. {
  288. int ret;
  289. trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf);
  290. ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
  291. trace_rdev_return_int(&rdev->wiphy, ret);
  292. return ret;
  293. }
  294. static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
  295. struct net_device *dev,
  296. const struct mesh_config *conf,
  297. const struct mesh_setup *setup)
  298. {
  299. int ret;
  300. trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup);
  301. ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
  302. trace_rdev_return_int(&rdev->wiphy, ret);
  303. return ret;
  304. }
  305. static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
  306. struct net_device *dev)
  307. {
  308. int ret;
  309. trace_rdev_leave_mesh(&rdev->wiphy, dev);
  310. ret = rdev->ops->leave_mesh(&rdev->wiphy, dev);
  311. trace_rdev_return_int(&rdev->wiphy, ret);
  312. return ret;
  313. }
  314. static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev,
  315. struct net_device *dev,
  316. struct ocb_setup *setup)
  317. {
  318. int ret;
  319. trace_rdev_join_ocb(&rdev->wiphy, dev, setup);
  320. ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup);
  321. trace_rdev_return_int(&rdev->wiphy, ret);
  322. return ret;
  323. }
  324. static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev,
  325. struct net_device *dev)
  326. {
  327. int ret;
  328. trace_rdev_leave_ocb(&rdev->wiphy, dev);
  329. ret = rdev->ops->leave_ocb(&rdev->wiphy, dev);
  330. trace_rdev_return_int(&rdev->wiphy, ret);
  331. return ret;
  332. }
  333. static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
  334. struct net_device *dev,
  335. struct bss_parameters *params)
  336. {
  337. int ret;
  338. trace_rdev_change_bss(&rdev->wiphy, dev, params);
  339. ret = rdev->ops->change_bss(&rdev->wiphy, dev, params);
  340. trace_rdev_return_int(&rdev->wiphy, ret);
  341. return ret;
  342. }
  343. static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
  344. struct net_device *dev,
  345. struct ieee80211_txq_params *params)
  346. {
  347. int ret;
  348. trace_rdev_set_txq_params(&rdev->wiphy, dev, params);
  349. ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
  350. trace_rdev_return_int(&rdev->wiphy, ret);
  351. return ret;
  352. }
  353. static inline int
  354. rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
  355. struct net_device *dev,
  356. struct ieee80211_channel *chan)
  357. {
  358. int ret;
  359. trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
  360. ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
  361. trace_rdev_return_int(&rdev->wiphy, ret);
  362. return ret;
  363. }
  364. static inline int
  365. rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
  366. struct cfg80211_chan_def *chandef)
  367. {
  368. int ret;
  369. trace_rdev_set_monitor_channel(&rdev->wiphy, chandef);
  370. ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef);
  371. trace_rdev_return_int(&rdev->wiphy, ret);
  372. return ret;
  373. }
  374. static inline int rdev_scan(struct cfg80211_registered_device *rdev,
  375. struct cfg80211_scan_request *request)
  376. {
  377. int ret;
  378. trace_rdev_scan(&rdev->wiphy, request);
  379. ret = rdev->ops->scan(&rdev->wiphy, request);
  380. trace_rdev_return_int(&rdev->wiphy, ret);
  381. return ret;
  382. }
  383. static inline int rdev_auth(struct cfg80211_registered_device *rdev,
  384. struct net_device *dev,
  385. struct cfg80211_auth_request *req)
  386. {
  387. int ret;
  388. trace_rdev_auth(&rdev->wiphy, dev, req);
  389. ret = rdev->ops->auth(&rdev->wiphy, dev, req);
  390. trace_rdev_return_int(&rdev->wiphy, ret);
  391. return ret;
  392. }
  393. static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
  394. struct net_device *dev,
  395. struct cfg80211_assoc_request *req)
  396. {
  397. int ret;
  398. trace_rdev_assoc(&rdev->wiphy, dev, req);
  399. ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
  400. trace_rdev_return_int(&rdev->wiphy, ret);
  401. return ret;
  402. }
  403. static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
  404. struct net_device *dev,
  405. struct cfg80211_deauth_request *req)
  406. {
  407. int ret;
  408. trace_rdev_deauth(&rdev->wiphy, dev, req);
  409. ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
  410. trace_rdev_return_int(&rdev->wiphy, ret);
  411. return ret;
  412. }
  413. static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
  414. struct net_device *dev,
  415. struct cfg80211_disassoc_request *req)
  416. {
  417. int ret;
  418. trace_rdev_disassoc(&rdev->wiphy, dev, req);
  419. ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
  420. trace_rdev_return_int(&rdev->wiphy, ret);
  421. return ret;
  422. }
  423. static inline int rdev_connect(struct cfg80211_registered_device *rdev,
  424. struct net_device *dev,
  425. struct cfg80211_connect_params *sme)
  426. {
  427. int ret;
  428. trace_rdev_connect(&rdev->wiphy, dev, sme);
  429. ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
  430. trace_rdev_return_int(&rdev->wiphy, ret);
  431. return ret;
  432. }
  433. static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
  434. struct net_device *dev, u16 reason_code)
  435. {
  436. int ret;
  437. trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
  438. ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
  439. trace_rdev_return_int(&rdev->wiphy, ret);
  440. return ret;
  441. }
  442. static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
  443. struct net_device *dev,
  444. struct cfg80211_ibss_params *params)
  445. {
  446. int ret;
  447. trace_rdev_join_ibss(&rdev->wiphy, dev, params);
  448. ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
  449. trace_rdev_return_int(&rdev->wiphy, ret);
  450. return ret;
  451. }
  452. static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
  453. struct net_device *dev)
  454. {
  455. int ret;
  456. trace_rdev_leave_ibss(&rdev->wiphy, dev);
  457. ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
  458. trace_rdev_return_int(&rdev->wiphy, ret);
  459. return ret;
  460. }
  461. static inline int
  462. rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
  463. {
  464. int ret;
  465. trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
  466. ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
  467. trace_rdev_return_int(&rdev->wiphy, ret);
  468. return ret;
  469. }
  470. static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
  471. struct wireless_dev *wdev,
  472. enum nl80211_tx_power_setting type, int mbm)
  473. {
  474. int ret;
  475. trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
  476. ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
  477. trace_rdev_return_int(&rdev->wiphy, ret);
  478. return ret;
  479. }
  480. static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
  481. struct wireless_dev *wdev, int *dbm)
  482. {
  483. int ret;
  484. trace_rdev_get_tx_power(&rdev->wiphy, wdev);
  485. ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
  486. trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
  487. return ret;
  488. }
  489. static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
  490. struct net_device *dev, const u8 *addr)
  491. {
  492. int ret;
  493. trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
  494. ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
  495. trace_rdev_return_int(&rdev->wiphy, ret);
  496. return ret;
  497. }
  498. static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
  499. {
  500. trace_rdev_rfkill_poll(&rdev->wiphy);
  501. rdev->ops->rfkill_poll(&rdev->wiphy);
  502. trace_rdev_return_void(&rdev->wiphy);
  503. }
  504. #ifdef CONFIG_NL80211_TESTMODE
  505. static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
  506. struct wireless_dev *wdev,
  507. void *data, int len)
  508. {
  509. int ret;
  510. trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
  511. ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
  512. trace_rdev_return_int(&rdev->wiphy, ret);
  513. return ret;
  514. }
  515. static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
  516. struct sk_buff *skb,
  517. struct netlink_callback *cb, void *data,
  518. int len)
  519. {
  520. int ret;
  521. trace_rdev_testmode_dump(&rdev->wiphy);
  522. ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
  523. trace_rdev_return_int(&rdev->wiphy, ret);
  524. return ret;
  525. }
  526. #endif
  527. static inline int
  528. rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
  529. struct net_device *dev, const u8 *peer,
  530. const struct cfg80211_bitrate_mask *mask)
  531. {
  532. int ret;
  533. trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
  534. ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
  535. trace_rdev_return_int(&rdev->wiphy, ret);
  536. return ret;
  537. }
  538. static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
  539. struct net_device *netdev, int idx,
  540. struct survey_info *info)
  541. {
  542. int ret;
  543. trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
  544. ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
  545. if (ret < 0)
  546. trace_rdev_return_int(&rdev->wiphy, ret);
  547. else
  548. trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
  549. return ret;
  550. }
  551. static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
  552. struct net_device *netdev,
  553. struct cfg80211_pmksa *pmksa)
  554. {
  555. int ret;
  556. trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
  557. ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
  558. trace_rdev_return_int(&rdev->wiphy, ret);
  559. return ret;
  560. }
  561. static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
  562. struct net_device *netdev,
  563. struct cfg80211_pmksa *pmksa)
  564. {
  565. int ret;
  566. trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
  567. ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
  568. trace_rdev_return_int(&rdev->wiphy, ret);
  569. return ret;
  570. }
  571. static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
  572. struct net_device *netdev)
  573. {
  574. int ret;
  575. trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
  576. ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
  577. trace_rdev_return_int(&rdev->wiphy, ret);
  578. return ret;
  579. }
  580. static inline int
  581. rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
  582. struct wireless_dev *wdev,
  583. struct ieee80211_channel *chan,
  584. unsigned int duration, u64 *cookie)
  585. {
  586. int ret;
  587. trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
  588. ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
  589. duration, cookie);
  590. trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
  591. return ret;
  592. }
  593. static inline int
  594. rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
  595. struct wireless_dev *wdev, u64 cookie)
  596. {
  597. int ret;
  598. trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
  599. ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
  600. trace_rdev_return_int(&rdev->wiphy, ret);
  601. return ret;
  602. }
  603. static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
  604. struct wireless_dev *wdev,
  605. struct cfg80211_mgmt_tx_params *params,
  606. u64 *cookie)
  607. {
  608. int ret;
  609. trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
  610. ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
  611. trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
  612. return ret;
  613. }
  614. static inline int
  615. rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
  616. struct wireless_dev *wdev, u64 cookie)
  617. {
  618. int ret;
  619. trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
  620. ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
  621. trace_rdev_return_int(&rdev->wiphy, ret);
  622. return ret;
  623. }
  624. static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
  625. struct net_device *dev, bool enabled,
  626. int timeout)
  627. {
  628. int ret;
  629. trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
  630. ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
  631. trace_rdev_return_int(&rdev->wiphy, ret);
  632. return ret;
  633. }
  634. static inline int
  635. rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
  636. struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
  637. {
  638. int ret;
  639. trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
  640. rssi_hyst);
  641. ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
  642. rssi_hyst);
  643. trace_rdev_return_int(&rdev->wiphy, ret);
  644. return ret;
  645. }
  646. static inline int
  647. rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
  648. struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
  649. {
  650. int ret;
  651. trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
  652. ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
  653. intvl);
  654. trace_rdev_return_int(&rdev->wiphy, ret);
  655. return ret;
  656. }
  657. static inline void
  658. rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
  659. struct wireless_dev *wdev, u16 frame_type, bool reg)
  660. {
  661. trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
  662. rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
  663. trace_rdev_return_void(&rdev->wiphy);
  664. }
  665. static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
  666. u32 tx_ant, u32 rx_ant)
  667. {
  668. int ret;
  669. trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
  670. ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
  671. trace_rdev_return_int(&rdev->wiphy, ret);
  672. return ret;
  673. }
  674. static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
  675. u32 *tx_ant, u32 *rx_ant)
  676. {
  677. int ret;
  678. trace_rdev_get_antenna(&rdev->wiphy);
  679. ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
  680. if (ret)
  681. trace_rdev_return_int(&rdev->wiphy, ret);
  682. else
  683. trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
  684. *rx_ant);
  685. return ret;
  686. }
  687. static inline int
  688. rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
  689. struct net_device *dev,
  690. struct cfg80211_sched_scan_request *request)
  691. {
  692. int ret;
  693. trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
  694. ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
  695. trace_rdev_return_int(&rdev->wiphy, ret);
  696. return ret;
  697. }
  698. static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
  699. struct net_device *dev)
  700. {
  701. int ret;
  702. trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
  703. ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
  704. trace_rdev_return_int(&rdev->wiphy, ret);
  705. return ret;
  706. }
  707. static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
  708. struct net_device *dev,
  709. struct cfg80211_gtk_rekey_data *data)
  710. {
  711. int ret;
  712. trace_rdev_set_rekey_data(&rdev->wiphy, dev);
  713. ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
  714. trace_rdev_return_int(&rdev->wiphy, ret);
  715. return ret;
  716. }
  717. static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
  718. struct net_device *dev, u8 *peer,
  719. u8 action_code, u8 dialog_token,
  720. u16 status_code, u32 peer_capability,
  721. bool initiator, const u8 *buf, size_t len)
  722. {
  723. int ret;
  724. trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
  725. dialog_token, status_code, peer_capability,
  726. initiator, buf, len);
  727. ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
  728. dialog_token, status_code, peer_capability,
  729. initiator, buf, len);
  730. trace_rdev_return_int(&rdev->wiphy, ret);
  731. return ret;
  732. }
  733. static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
  734. struct net_device *dev, u8 *peer,
  735. enum nl80211_tdls_operation oper)
  736. {
  737. int ret;
  738. trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
  739. ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
  740. trace_rdev_return_int(&rdev->wiphy, ret);
  741. return ret;
  742. }
  743. static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
  744. struct net_device *dev, const u8 *peer,
  745. u64 *cookie)
  746. {
  747. int ret;
  748. trace_rdev_probe_client(&rdev->wiphy, dev, peer);
  749. ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
  750. trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
  751. return ret;
  752. }
  753. static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
  754. struct net_device *dev, u16 noack_map)
  755. {
  756. int ret;
  757. trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
  758. ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
  759. trace_rdev_return_int(&rdev->wiphy, ret);
  760. return ret;
  761. }
  762. static inline int
  763. rdev_get_channel(struct cfg80211_registered_device *rdev,
  764. struct wireless_dev *wdev,
  765. struct cfg80211_chan_def *chandef)
  766. {
  767. int ret;
  768. trace_rdev_get_channel(&rdev->wiphy, wdev);
  769. ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
  770. trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
  771. return ret;
  772. }
  773. static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
  774. struct wireless_dev *wdev)
  775. {
  776. int ret;
  777. trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
  778. ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
  779. trace_rdev_return_int(&rdev->wiphy, ret);
  780. return ret;
  781. }
  782. static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
  783. struct wireless_dev *wdev)
  784. {
  785. trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
  786. rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
  787. trace_rdev_return_void(&rdev->wiphy);
  788. }
  789. static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
  790. struct net_device *dev,
  791. struct cfg80211_acl_data *params)
  792. {
  793. int ret;
  794. trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
  795. ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
  796. trace_rdev_return_int(&rdev->wiphy, ret);
  797. return ret;
  798. }
  799. static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
  800. struct net_device *dev,
  801. struct cfg80211_update_ft_ies_params *ftie)
  802. {
  803. int ret;
  804. trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
  805. ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
  806. trace_rdev_return_int(&rdev->wiphy, ret);
  807. return ret;
  808. }
  809. static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
  810. struct wireless_dev *wdev,
  811. enum nl80211_crit_proto_id protocol,
  812. u16 duration)
  813. {
  814. int ret;
  815. trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
  816. ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
  817. protocol, duration);
  818. trace_rdev_return_int(&rdev->wiphy, ret);
  819. return ret;
  820. }
  821. static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
  822. struct wireless_dev *wdev)
  823. {
  824. trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
  825. rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
  826. trace_rdev_return_void(&rdev->wiphy);
  827. }
  828. static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
  829. struct net_device *dev,
  830. struct cfg80211_csa_settings *params)
  831. {
  832. int ret;
  833. trace_rdev_channel_switch(&rdev->wiphy, dev, params);
  834. ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
  835. trace_rdev_return_int(&rdev->wiphy, ret);
  836. return ret;
  837. }
  838. static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
  839. struct net_device *dev,
  840. struct cfg80211_qos_map *qos_map)
  841. {
  842. int ret = -EOPNOTSUPP;
  843. if (rdev->ops->set_qos_map) {
  844. trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
  845. ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
  846. trace_rdev_return_int(&rdev->wiphy, ret);
  847. }
  848. return ret;
  849. }
  850. static inline int
  851. rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
  852. struct net_device *dev, struct cfg80211_chan_def *chandef)
  853. {
  854. int ret;
  855. trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
  856. ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
  857. trace_rdev_return_int(&rdev->wiphy, ret);
  858. return ret;
  859. }
  860. static inline int
  861. rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
  862. struct net_device *dev, u8 tsid, const u8 *peer,
  863. u8 user_prio, u16 admitted_time)
  864. {
  865. int ret = -EOPNOTSUPP;
  866. trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
  867. user_prio, admitted_time);
  868. if (rdev->ops->add_tx_ts)
  869. ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
  870. user_prio, admitted_time);
  871. trace_rdev_return_int(&rdev->wiphy, ret);
  872. return ret;
  873. }
  874. static inline int
  875. rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
  876. struct net_device *dev, u8 tsid, const u8 *peer)
  877. {
  878. int ret = -EOPNOTSUPP;
  879. trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
  880. if (rdev->ops->del_tx_ts)
  881. ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
  882. trace_rdev_return_int(&rdev->wiphy, ret);
  883. return ret;
  884. }
  885. static inline int
  886. rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
  887. struct net_device *dev, const u8 *addr,
  888. u8 oper_class, struct cfg80211_chan_def *chandef)
  889. {
  890. int ret;
  891. trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
  892. chandef);
  893. ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
  894. oper_class, chandef);
  895. trace_rdev_return_int(&rdev->wiphy, ret);
  896. return ret;
  897. }
  898. static inline void
  899. rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
  900. struct net_device *dev, const u8 *addr)
  901. {
  902. trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
  903. rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
  904. trace_rdev_return_void(&rdev->wiphy);
  905. }
  906. #endif /* __CFG80211_RDEV_OPS */