rdev-ops.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133
  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 void rdev_abort_scan(struct cfg80211_registered_device *rdev,
  384. struct wireless_dev *wdev)
  385. {
  386. trace_rdev_abort_scan(&rdev->wiphy, wdev);
  387. rdev->ops->abort_scan(&rdev->wiphy, wdev);
  388. trace_rdev_return_void(&rdev->wiphy);
  389. }
  390. static inline int rdev_auth(struct cfg80211_registered_device *rdev,
  391. struct net_device *dev,
  392. struct cfg80211_auth_request *req)
  393. {
  394. int ret;
  395. trace_rdev_auth(&rdev->wiphy, dev, req);
  396. ret = rdev->ops->auth(&rdev->wiphy, dev, req);
  397. trace_rdev_return_int(&rdev->wiphy, ret);
  398. return ret;
  399. }
  400. static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
  401. struct net_device *dev,
  402. struct cfg80211_assoc_request *req)
  403. {
  404. int ret;
  405. trace_rdev_assoc(&rdev->wiphy, dev, req);
  406. ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
  407. trace_rdev_return_int(&rdev->wiphy, ret);
  408. return ret;
  409. }
  410. static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
  411. struct net_device *dev,
  412. struct cfg80211_deauth_request *req)
  413. {
  414. int ret;
  415. trace_rdev_deauth(&rdev->wiphy, dev, req);
  416. ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
  417. trace_rdev_return_int(&rdev->wiphy, ret);
  418. return ret;
  419. }
  420. static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
  421. struct net_device *dev,
  422. struct cfg80211_disassoc_request *req)
  423. {
  424. int ret;
  425. trace_rdev_disassoc(&rdev->wiphy, dev, req);
  426. ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
  427. trace_rdev_return_int(&rdev->wiphy, ret);
  428. return ret;
  429. }
  430. static inline int rdev_connect(struct cfg80211_registered_device *rdev,
  431. struct net_device *dev,
  432. struct cfg80211_connect_params *sme)
  433. {
  434. int ret;
  435. trace_rdev_connect(&rdev->wiphy, dev, sme);
  436. ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
  437. trace_rdev_return_int(&rdev->wiphy, ret);
  438. return ret;
  439. }
  440. static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
  441. struct net_device *dev, u16 reason_code)
  442. {
  443. int ret;
  444. trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
  445. ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
  446. trace_rdev_return_int(&rdev->wiphy, ret);
  447. return ret;
  448. }
  449. static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
  450. struct net_device *dev,
  451. struct cfg80211_ibss_params *params)
  452. {
  453. int ret;
  454. trace_rdev_join_ibss(&rdev->wiphy, dev, params);
  455. ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
  456. trace_rdev_return_int(&rdev->wiphy, ret);
  457. return ret;
  458. }
  459. static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
  460. struct net_device *dev)
  461. {
  462. int ret;
  463. trace_rdev_leave_ibss(&rdev->wiphy, dev);
  464. ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
  465. trace_rdev_return_int(&rdev->wiphy, ret);
  466. return ret;
  467. }
  468. static inline int
  469. rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
  470. {
  471. int ret;
  472. trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
  473. ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
  474. trace_rdev_return_int(&rdev->wiphy, ret);
  475. return ret;
  476. }
  477. static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
  478. struct wireless_dev *wdev,
  479. enum nl80211_tx_power_setting type, int mbm)
  480. {
  481. int ret;
  482. trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
  483. ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
  484. trace_rdev_return_int(&rdev->wiphy, ret);
  485. return ret;
  486. }
  487. static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
  488. struct wireless_dev *wdev, int *dbm)
  489. {
  490. int ret;
  491. trace_rdev_get_tx_power(&rdev->wiphy, wdev);
  492. ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
  493. trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
  494. return ret;
  495. }
  496. static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
  497. struct net_device *dev, const u8 *addr)
  498. {
  499. int ret;
  500. trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
  501. ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
  502. trace_rdev_return_int(&rdev->wiphy, ret);
  503. return ret;
  504. }
  505. static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
  506. {
  507. trace_rdev_rfkill_poll(&rdev->wiphy);
  508. rdev->ops->rfkill_poll(&rdev->wiphy);
  509. trace_rdev_return_void(&rdev->wiphy);
  510. }
  511. #ifdef CONFIG_NL80211_TESTMODE
  512. static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
  513. struct wireless_dev *wdev,
  514. void *data, int len)
  515. {
  516. int ret;
  517. trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
  518. ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
  519. trace_rdev_return_int(&rdev->wiphy, ret);
  520. return ret;
  521. }
  522. static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
  523. struct sk_buff *skb,
  524. struct netlink_callback *cb, void *data,
  525. int len)
  526. {
  527. int ret;
  528. trace_rdev_testmode_dump(&rdev->wiphy);
  529. ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
  530. trace_rdev_return_int(&rdev->wiphy, ret);
  531. return ret;
  532. }
  533. #endif
  534. static inline int
  535. rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
  536. struct net_device *dev, const u8 *peer,
  537. const struct cfg80211_bitrate_mask *mask)
  538. {
  539. int ret;
  540. trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
  541. ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
  542. trace_rdev_return_int(&rdev->wiphy, ret);
  543. return ret;
  544. }
  545. static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
  546. struct net_device *netdev, int idx,
  547. struct survey_info *info)
  548. {
  549. int ret;
  550. trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
  551. ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
  552. if (ret < 0)
  553. trace_rdev_return_int(&rdev->wiphy, ret);
  554. else
  555. trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
  556. return ret;
  557. }
  558. static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
  559. struct net_device *netdev,
  560. struct cfg80211_pmksa *pmksa)
  561. {
  562. int ret;
  563. trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
  564. ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
  565. trace_rdev_return_int(&rdev->wiphy, ret);
  566. return ret;
  567. }
  568. static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
  569. struct net_device *netdev,
  570. struct cfg80211_pmksa *pmksa)
  571. {
  572. int ret;
  573. trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
  574. ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
  575. trace_rdev_return_int(&rdev->wiphy, ret);
  576. return ret;
  577. }
  578. static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
  579. struct net_device *netdev)
  580. {
  581. int ret;
  582. trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
  583. ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
  584. trace_rdev_return_int(&rdev->wiphy, ret);
  585. return ret;
  586. }
  587. static inline int
  588. rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
  589. struct wireless_dev *wdev,
  590. struct ieee80211_channel *chan,
  591. unsigned int duration, u64 *cookie)
  592. {
  593. int ret;
  594. trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
  595. ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
  596. duration, cookie);
  597. trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
  598. return ret;
  599. }
  600. static inline int
  601. rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
  602. struct wireless_dev *wdev, u64 cookie)
  603. {
  604. int ret;
  605. trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
  606. ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
  607. trace_rdev_return_int(&rdev->wiphy, ret);
  608. return ret;
  609. }
  610. static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
  611. struct wireless_dev *wdev,
  612. struct cfg80211_mgmt_tx_params *params,
  613. u64 *cookie)
  614. {
  615. int ret;
  616. trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
  617. ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
  618. trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
  619. return ret;
  620. }
  621. static inline int
  622. rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
  623. struct wireless_dev *wdev, u64 cookie)
  624. {
  625. int ret;
  626. trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
  627. ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
  628. trace_rdev_return_int(&rdev->wiphy, ret);
  629. return ret;
  630. }
  631. static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
  632. struct net_device *dev, bool enabled,
  633. int timeout)
  634. {
  635. int ret;
  636. trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
  637. ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
  638. trace_rdev_return_int(&rdev->wiphy, ret);
  639. return ret;
  640. }
  641. static inline int
  642. rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
  643. struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
  644. {
  645. int ret;
  646. trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
  647. rssi_hyst);
  648. ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
  649. rssi_hyst);
  650. trace_rdev_return_int(&rdev->wiphy, ret);
  651. return ret;
  652. }
  653. static inline int
  654. rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
  655. struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
  656. {
  657. int ret;
  658. trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
  659. ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
  660. intvl);
  661. trace_rdev_return_int(&rdev->wiphy, ret);
  662. return ret;
  663. }
  664. static inline void
  665. rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
  666. struct wireless_dev *wdev, u16 frame_type, bool reg)
  667. {
  668. might_sleep();
  669. trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
  670. rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
  671. trace_rdev_return_void(&rdev->wiphy);
  672. }
  673. static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
  674. u32 tx_ant, u32 rx_ant)
  675. {
  676. int ret;
  677. trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
  678. ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
  679. trace_rdev_return_int(&rdev->wiphy, ret);
  680. return ret;
  681. }
  682. static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
  683. u32 *tx_ant, u32 *rx_ant)
  684. {
  685. int ret;
  686. trace_rdev_get_antenna(&rdev->wiphy);
  687. ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
  688. if (ret)
  689. trace_rdev_return_int(&rdev->wiphy, ret);
  690. else
  691. trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
  692. *rx_ant);
  693. return ret;
  694. }
  695. static inline int
  696. rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
  697. struct net_device *dev,
  698. struct cfg80211_sched_scan_request *request)
  699. {
  700. int ret;
  701. trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
  702. ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
  703. trace_rdev_return_int(&rdev->wiphy, ret);
  704. return ret;
  705. }
  706. static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
  707. struct net_device *dev)
  708. {
  709. int ret;
  710. trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
  711. ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
  712. trace_rdev_return_int(&rdev->wiphy, ret);
  713. return ret;
  714. }
  715. static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
  716. struct net_device *dev,
  717. struct cfg80211_gtk_rekey_data *data)
  718. {
  719. int ret;
  720. trace_rdev_set_rekey_data(&rdev->wiphy, dev);
  721. ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
  722. trace_rdev_return_int(&rdev->wiphy, ret);
  723. return ret;
  724. }
  725. static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
  726. struct net_device *dev, u8 *peer,
  727. u8 action_code, u8 dialog_token,
  728. u16 status_code, u32 peer_capability,
  729. bool initiator, const u8 *buf, size_t len)
  730. {
  731. int ret;
  732. trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
  733. dialog_token, status_code, peer_capability,
  734. initiator, buf, len);
  735. ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
  736. dialog_token, status_code, peer_capability,
  737. initiator, buf, len);
  738. trace_rdev_return_int(&rdev->wiphy, ret);
  739. return ret;
  740. }
  741. static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
  742. struct net_device *dev, u8 *peer,
  743. enum nl80211_tdls_operation oper)
  744. {
  745. int ret;
  746. trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
  747. ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
  748. trace_rdev_return_int(&rdev->wiphy, ret);
  749. return ret;
  750. }
  751. static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
  752. struct net_device *dev, const u8 *peer,
  753. u64 *cookie)
  754. {
  755. int ret;
  756. trace_rdev_probe_client(&rdev->wiphy, dev, peer);
  757. ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
  758. trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
  759. return ret;
  760. }
  761. static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
  762. struct net_device *dev, u16 noack_map)
  763. {
  764. int ret;
  765. trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
  766. ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
  767. trace_rdev_return_int(&rdev->wiphy, ret);
  768. return ret;
  769. }
  770. static inline int
  771. rdev_get_channel(struct cfg80211_registered_device *rdev,
  772. struct wireless_dev *wdev,
  773. struct cfg80211_chan_def *chandef)
  774. {
  775. int ret;
  776. trace_rdev_get_channel(&rdev->wiphy, wdev);
  777. ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
  778. trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
  779. return ret;
  780. }
  781. static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
  782. struct wireless_dev *wdev)
  783. {
  784. int ret;
  785. trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
  786. ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
  787. trace_rdev_return_int(&rdev->wiphy, ret);
  788. return ret;
  789. }
  790. static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
  791. struct wireless_dev *wdev)
  792. {
  793. trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
  794. rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
  795. trace_rdev_return_void(&rdev->wiphy);
  796. }
  797. static inline int rdev_start_nan(struct cfg80211_registered_device *rdev,
  798. struct wireless_dev *wdev,
  799. struct cfg80211_nan_conf *conf)
  800. {
  801. int ret;
  802. trace_rdev_start_nan(&rdev->wiphy, wdev, conf);
  803. ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf);
  804. trace_rdev_return_int(&rdev->wiphy, ret);
  805. return ret;
  806. }
  807. static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev,
  808. struct wireless_dev *wdev)
  809. {
  810. trace_rdev_stop_nan(&rdev->wiphy, wdev);
  811. rdev->ops->stop_nan(&rdev->wiphy, wdev);
  812. trace_rdev_return_void(&rdev->wiphy);
  813. }
  814. static inline int
  815. rdev_add_nan_func(struct cfg80211_registered_device *rdev,
  816. struct wireless_dev *wdev,
  817. struct cfg80211_nan_func *nan_func)
  818. {
  819. int ret;
  820. trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func);
  821. ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func);
  822. trace_rdev_return_int(&rdev->wiphy, ret);
  823. return ret;
  824. }
  825. static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev,
  826. struct wireless_dev *wdev, u64 cookie)
  827. {
  828. trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie);
  829. rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie);
  830. trace_rdev_return_void(&rdev->wiphy);
  831. }
  832. static inline int
  833. rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
  834. struct wireless_dev *wdev,
  835. struct cfg80211_nan_conf *conf, u32 changes)
  836. {
  837. int ret;
  838. trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes);
  839. if (rdev->ops->nan_change_conf)
  840. ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf,
  841. changes);
  842. else
  843. ret = -ENOTSUPP;
  844. trace_rdev_return_int(&rdev->wiphy, ret);
  845. return ret;
  846. }
  847. static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
  848. struct net_device *dev,
  849. struct cfg80211_acl_data *params)
  850. {
  851. int ret;
  852. trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
  853. ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
  854. trace_rdev_return_int(&rdev->wiphy, ret);
  855. return ret;
  856. }
  857. static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
  858. struct net_device *dev,
  859. struct cfg80211_update_ft_ies_params *ftie)
  860. {
  861. int ret;
  862. trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
  863. ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
  864. trace_rdev_return_int(&rdev->wiphy, ret);
  865. return ret;
  866. }
  867. static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
  868. struct wireless_dev *wdev,
  869. enum nl80211_crit_proto_id protocol,
  870. u16 duration)
  871. {
  872. int ret;
  873. trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
  874. ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
  875. protocol, duration);
  876. trace_rdev_return_int(&rdev->wiphy, ret);
  877. return ret;
  878. }
  879. static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
  880. struct wireless_dev *wdev)
  881. {
  882. trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
  883. rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
  884. trace_rdev_return_void(&rdev->wiphy);
  885. }
  886. static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
  887. struct net_device *dev,
  888. struct cfg80211_csa_settings *params)
  889. {
  890. int ret;
  891. trace_rdev_channel_switch(&rdev->wiphy, dev, params);
  892. ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
  893. trace_rdev_return_int(&rdev->wiphy, ret);
  894. return ret;
  895. }
  896. static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
  897. struct net_device *dev,
  898. struct cfg80211_qos_map *qos_map)
  899. {
  900. int ret = -EOPNOTSUPP;
  901. if (rdev->ops->set_qos_map) {
  902. trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
  903. ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
  904. trace_rdev_return_int(&rdev->wiphy, ret);
  905. }
  906. return ret;
  907. }
  908. static inline int
  909. rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
  910. struct net_device *dev, struct cfg80211_chan_def *chandef)
  911. {
  912. int ret;
  913. trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
  914. ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
  915. trace_rdev_return_int(&rdev->wiphy, ret);
  916. return ret;
  917. }
  918. static inline int
  919. rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
  920. struct net_device *dev, u8 tsid, const u8 *peer,
  921. u8 user_prio, u16 admitted_time)
  922. {
  923. int ret = -EOPNOTSUPP;
  924. trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
  925. user_prio, admitted_time);
  926. if (rdev->ops->add_tx_ts)
  927. ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
  928. user_prio, admitted_time);
  929. trace_rdev_return_int(&rdev->wiphy, ret);
  930. return ret;
  931. }
  932. static inline int
  933. rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
  934. struct net_device *dev, u8 tsid, const u8 *peer)
  935. {
  936. int ret = -EOPNOTSUPP;
  937. trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
  938. if (rdev->ops->del_tx_ts)
  939. ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
  940. trace_rdev_return_int(&rdev->wiphy, ret);
  941. return ret;
  942. }
  943. static inline int
  944. rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
  945. struct net_device *dev, const u8 *addr,
  946. u8 oper_class, struct cfg80211_chan_def *chandef)
  947. {
  948. int ret;
  949. trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
  950. chandef);
  951. ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
  952. oper_class, chandef);
  953. trace_rdev_return_int(&rdev->wiphy, ret);
  954. return ret;
  955. }
  956. static inline void
  957. rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
  958. struct net_device *dev, const u8 *addr)
  959. {
  960. trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
  961. rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
  962. trace_rdev_return_void(&rdev->wiphy);
  963. }
  964. static inline int
  965. rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
  966. struct net_device *dev,
  967. struct cfg80211_chan_def *chandef,
  968. u32 cac_time_ms)
  969. {
  970. int ret = -ENOTSUPP;
  971. trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
  972. cac_time_ms);
  973. if (rdev->ops->start_radar_detection)
  974. ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
  975. chandef, cac_time_ms);
  976. trace_rdev_return_int(&rdev->wiphy, ret);
  977. return ret;
  978. }
  979. static inline int
  980. rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
  981. struct net_device *dev,
  982. int mcast_rate[NUM_NL80211_BANDS])
  983. {
  984. int ret = -ENOTSUPP;
  985. trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
  986. if (rdev->ops->set_mcast_rate)
  987. ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
  988. trace_rdev_return_int(&rdev->wiphy, ret);
  989. return ret;
  990. }
  991. static inline int
  992. rdev_set_coalesce(struct cfg80211_registered_device *rdev,
  993. struct cfg80211_coalesce *coalesce)
  994. {
  995. int ret = -ENOTSUPP;
  996. trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
  997. if (rdev->ops->set_coalesce)
  998. ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
  999. trace_rdev_return_int(&rdev->wiphy, ret);
  1000. return ret;
  1001. }
  1002. #endif /* __CFG80211_RDEV_OPS */