driver-ops.h 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  1. #ifndef __MAC80211_DRIVER_OPS
  2. #define __MAC80211_DRIVER_OPS
  3. #include <net/mac80211.h>
  4. #include "ieee80211_i.h"
  5. #include "trace.h"
  6. static inline bool check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
  7. {
  8. return !WARN(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER),
  9. "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",
  10. sdata->dev ? sdata->dev->name : sdata->name, sdata->flags);
  11. }
  12. static inline struct ieee80211_sub_if_data *
  13. get_bss_sdata(struct ieee80211_sub_if_data *sdata)
  14. {
  15. if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  16. sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
  17. u.ap);
  18. return sdata;
  19. }
  20. static inline void drv_tx(struct ieee80211_local *local,
  21. struct ieee80211_tx_control *control,
  22. struct sk_buff *skb)
  23. {
  24. local->ops->tx(&local->hw, control, skb);
  25. }
  26. static inline void drv_get_et_strings(struct ieee80211_sub_if_data *sdata,
  27. u32 sset, u8 *data)
  28. {
  29. struct ieee80211_local *local = sdata->local;
  30. if (local->ops->get_et_strings) {
  31. trace_drv_get_et_strings(local, sset);
  32. local->ops->get_et_strings(&local->hw, &sdata->vif, sset, data);
  33. trace_drv_return_void(local);
  34. }
  35. }
  36. static inline void drv_get_et_stats(struct ieee80211_sub_if_data *sdata,
  37. struct ethtool_stats *stats,
  38. u64 *data)
  39. {
  40. struct ieee80211_local *local = sdata->local;
  41. if (local->ops->get_et_stats) {
  42. trace_drv_get_et_stats(local);
  43. local->ops->get_et_stats(&local->hw, &sdata->vif, stats, data);
  44. trace_drv_return_void(local);
  45. }
  46. }
  47. static inline int drv_get_et_sset_count(struct ieee80211_sub_if_data *sdata,
  48. int sset)
  49. {
  50. struct ieee80211_local *local = sdata->local;
  51. int rv = 0;
  52. if (local->ops->get_et_sset_count) {
  53. trace_drv_get_et_sset_count(local, sset);
  54. rv = local->ops->get_et_sset_count(&local->hw, &sdata->vif,
  55. sset);
  56. trace_drv_return_int(local, rv);
  57. }
  58. return rv;
  59. }
  60. static inline int drv_start(struct ieee80211_local *local)
  61. {
  62. int ret;
  63. might_sleep();
  64. trace_drv_start(local);
  65. local->started = true;
  66. smp_mb();
  67. ret = local->ops->start(&local->hw);
  68. trace_drv_return_int(local, ret);
  69. return ret;
  70. }
  71. static inline void drv_stop(struct ieee80211_local *local)
  72. {
  73. might_sleep();
  74. trace_drv_stop(local);
  75. local->ops->stop(&local->hw);
  76. trace_drv_return_void(local);
  77. /* sync away all work on the tasklet before clearing started */
  78. tasklet_disable(&local->tasklet);
  79. tasklet_enable(&local->tasklet);
  80. barrier();
  81. local->started = false;
  82. }
  83. #ifdef CONFIG_PM
  84. static inline int drv_suspend(struct ieee80211_local *local,
  85. struct cfg80211_wowlan *wowlan)
  86. {
  87. int ret;
  88. might_sleep();
  89. trace_drv_suspend(local);
  90. ret = local->ops->suspend(&local->hw, wowlan);
  91. trace_drv_return_int(local, ret);
  92. return ret;
  93. }
  94. static inline int drv_resume(struct ieee80211_local *local)
  95. {
  96. int ret;
  97. might_sleep();
  98. trace_drv_resume(local);
  99. ret = local->ops->resume(&local->hw);
  100. trace_drv_return_int(local, ret);
  101. return ret;
  102. }
  103. static inline void drv_set_wakeup(struct ieee80211_local *local,
  104. bool enabled)
  105. {
  106. might_sleep();
  107. if (!local->ops->set_wakeup)
  108. return;
  109. trace_drv_set_wakeup(local, enabled);
  110. local->ops->set_wakeup(&local->hw, enabled);
  111. trace_drv_return_void(local);
  112. }
  113. #endif
  114. static inline int drv_add_interface(struct ieee80211_local *local,
  115. struct ieee80211_sub_if_data *sdata)
  116. {
  117. int ret;
  118. might_sleep();
  119. if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
  120. (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
  121. !ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF) &&
  122. !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE))))
  123. return -EINVAL;
  124. trace_drv_add_interface(local, sdata);
  125. ret = local->ops->add_interface(&local->hw, &sdata->vif);
  126. trace_drv_return_int(local, ret);
  127. if (ret == 0)
  128. sdata->flags |= IEEE80211_SDATA_IN_DRIVER;
  129. return ret;
  130. }
  131. static inline int drv_change_interface(struct ieee80211_local *local,
  132. struct ieee80211_sub_if_data *sdata,
  133. enum nl80211_iftype type, bool p2p)
  134. {
  135. int ret;
  136. might_sleep();
  137. if (!check_sdata_in_driver(sdata))
  138. return -EIO;
  139. trace_drv_change_interface(local, sdata, type, p2p);
  140. ret = local->ops->change_interface(&local->hw, &sdata->vif, type, p2p);
  141. trace_drv_return_int(local, ret);
  142. return ret;
  143. }
  144. static inline void drv_remove_interface(struct ieee80211_local *local,
  145. struct ieee80211_sub_if_data *sdata)
  146. {
  147. might_sleep();
  148. if (!check_sdata_in_driver(sdata))
  149. return;
  150. trace_drv_remove_interface(local, sdata);
  151. local->ops->remove_interface(&local->hw, &sdata->vif);
  152. sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
  153. trace_drv_return_void(local);
  154. }
  155. static inline int drv_config(struct ieee80211_local *local, u32 changed)
  156. {
  157. int ret;
  158. might_sleep();
  159. trace_drv_config(local, changed);
  160. ret = local->ops->config(&local->hw, changed);
  161. trace_drv_return_int(local, ret);
  162. return ret;
  163. }
  164. static inline void drv_bss_info_changed(struct ieee80211_local *local,
  165. struct ieee80211_sub_if_data *sdata,
  166. struct ieee80211_bss_conf *info,
  167. u32 changed)
  168. {
  169. might_sleep();
  170. if (WARN_ON_ONCE(changed & (BSS_CHANGED_BEACON |
  171. BSS_CHANGED_BEACON_ENABLED) &&
  172. sdata->vif.type != NL80211_IFTYPE_AP &&
  173. sdata->vif.type != NL80211_IFTYPE_ADHOC &&
  174. sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
  175. sdata->vif.type != NL80211_IFTYPE_OCB))
  176. return;
  177. if (WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE ||
  178. sdata->vif.type == NL80211_IFTYPE_MONITOR))
  179. return;
  180. if (!check_sdata_in_driver(sdata))
  181. return;
  182. trace_drv_bss_info_changed(local, sdata, info, changed);
  183. if (local->ops->bss_info_changed)
  184. local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed);
  185. trace_drv_return_void(local);
  186. }
  187. static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
  188. struct netdev_hw_addr_list *mc_list)
  189. {
  190. u64 ret = 0;
  191. trace_drv_prepare_multicast(local, mc_list->count);
  192. if (local->ops->prepare_multicast)
  193. ret = local->ops->prepare_multicast(&local->hw, mc_list);
  194. trace_drv_return_u64(local, ret);
  195. return ret;
  196. }
  197. static inline void drv_configure_filter(struct ieee80211_local *local,
  198. unsigned int changed_flags,
  199. unsigned int *total_flags,
  200. u64 multicast)
  201. {
  202. might_sleep();
  203. trace_drv_configure_filter(local, changed_flags, total_flags,
  204. multicast);
  205. local->ops->configure_filter(&local->hw, changed_flags, total_flags,
  206. multicast);
  207. trace_drv_return_void(local);
  208. }
  209. static inline int drv_set_tim(struct ieee80211_local *local,
  210. struct ieee80211_sta *sta, bool set)
  211. {
  212. int ret = 0;
  213. trace_drv_set_tim(local, sta, set);
  214. if (local->ops->set_tim)
  215. ret = local->ops->set_tim(&local->hw, sta, set);
  216. trace_drv_return_int(local, ret);
  217. return ret;
  218. }
  219. static inline int drv_set_key(struct ieee80211_local *local,
  220. enum set_key_cmd cmd,
  221. struct ieee80211_sub_if_data *sdata,
  222. struct ieee80211_sta *sta,
  223. struct ieee80211_key_conf *key)
  224. {
  225. int ret;
  226. might_sleep();
  227. sdata = get_bss_sdata(sdata);
  228. if (!check_sdata_in_driver(sdata))
  229. return -EIO;
  230. trace_drv_set_key(local, cmd, sdata, sta, key);
  231. ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
  232. trace_drv_return_int(local, ret);
  233. return ret;
  234. }
  235. static inline void drv_update_tkip_key(struct ieee80211_local *local,
  236. struct ieee80211_sub_if_data *sdata,
  237. struct ieee80211_key_conf *conf,
  238. struct sta_info *sta, u32 iv32,
  239. u16 *phase1key)
  240. {
  241. struct ieee80211_sta *ista = NULL;
  242. if (sta)
  243. ista = &sta->sta;
  244. sdata = get_bss_sdata(sdata);
  245. if (!check_sdata_in_driver(sdata))
  246. return;
  247. trace_drv_update_tkip_key(local, sdata, conf, ista, iv32);
  248. if (local->ops->update_tkip_key)
  249. local->ops->update_tkip_key(&local->hw, &sdata->vif, conf,
  250. ista, iv32, phase1key);
  251. trace_drv_return_void(local);
  252. }
  253. static inline int drv_hw_scan(struct ieee80211_local *local,
  254. struct ieee80211_sub_if_data *sdata,
  255. struct ieee80211_scan_request *req)
  256. {
  257. int ret;
  258. might_sleep();
  259. if (!check_sdata_in_driver(sdata))
  260. return -EIO;
  261. trace_drv_hw_scan(local, sdata);
  262. ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
  263. trace_drv_return_int(local, ret);
  264. return ret;
  265. }
  266. static inline void drv_cancel_hw_scan(struct ieee80211_local *local,
  267. struct ieee80211_sub_if_data *sdata)
  268. {
  269. might_sleep();
  270. if (!check_sdata_in_driver(sdata))
  271. return;
  272. trace_drv_cancel_hw_scan(local, sdata);
  273. local->ops->cancel_hw_scan(&local->hw, &sdata->vif);
  274. trace_drv_return_void(local);
  275. }
  276. static inline int
  277. drv_sched_scan_start(struct ieee80211_local *local,
  278. struct ieee80211_sub_if_data *sdata,
  279. struct cfg80211_sched_scan_request *req,
  280. struct ieee80211_scan_ies *ies)
  281. {
  282. int ret;
  283. might_sleep();
  284. if (!check_sdata_in_driver(sdata))
  285. return -EIO;
  286. trace_drv_sched_scan_start(local, sdata);
  287. ret = local->ops->sched_scan_start(&local->hw, &sdata->vif,
  288. req, ies);
  289. trace_drv_return_int(local, ret);
  290. return ret;
  291. }
  292. static inline int drv_sched_scan_stop(struct ieee80211_local *local,
  293. struct ieee80211_sub_if_data *sdata)
  294. {
  295. int ret;
  296. might_sleep();
  297. if (!check_sdata_in_driver(sdata))
  298. return -EIO;
  299. trace_drv_sched_scan_stop(local, sdata);
  300. ret = local->ops->sched_scan_stop(&local->hw, &sdata->vif);
  301. trace_drv_return_int(local, ret);
  302. return ret;
  303. }
  304. static inline void drv_sw_scan_start(struct ieee80211_local *local,
  305. struct ieee80211_sub_if_data *sdata,
  306. const u8 *mac_addr)
  307. {
  308. might_sleep();
  309. trace_drv_sw_scan_start(local, sdata, mac_addr);
  310. if (local->ops->sw_scan_start)
  311. local->ops->sw_scan_start(&local->hw, &sdata->vif, mac_addr);
  312. trace_drv_return_void(local);
  313. }
  314. static inline void drv_sw_scan_complete(struct ieee80211_local *local,
  315. struct ieee80211_sub_if_data *sdata)
  316. {
  317. might_sleep();
  318. trace_drv_sw_scan_complete(local, sdata);
  319. if (local->ops->sw_scan_complete)
  320. local->ops->sw_scan_complete(&local->hw, &sdata->vif);
  321. trace_drv_return_void(local);
  322. }
  323. static inline int drv_get_stats(struct ieee80211_local *local,
  324. struct ieee80211_low_level_stats *stats)
  325. {
  326. int ret = -EOPNOTSUPP;
  327. might_sleep();
  328. if (local->ops->get_stats)
  329. ret = local->ops->get_stats(&local->hw, stats);
  330. trace_drv_get_stats(local, stats, ret);
  331. return ret;
  332. }
  333. static inline void drv_get_key_seq(struct ieee80211_local *local,
  334. struct ieee80211_key *key,
  335. struct ieee80211_key_seq *seq)
  336. {
  337. if (local->ops->get_key_seq)
  338. local->ops->get_key_seq(&local->hw, &key->conf, seq);
  339. trace_drv_get_key_seq(local, &key->conf);
  340. }
  341. static inline int drv_set_frag_threshold(struct ieee80211_local *local,
  342. u32 value)
  343. {
  344. int ret = 0;
  345. might_sleep();
  346. trace_drv_set_frag_threshold(local, value);
  347. if (local->ops->set_frag_threshold)
  348. ret = local->ops->set_frag_threshold(&local->hw, value);
  349. trace_drv_return_int(local, ret);
  350. return ret;
  351. }
  352. static inline int drv_set_rts_threshold(struct ieee80211_local *local,
  353. u32 value)
  354. {
  355. int ret = 0;
  356. might_sleep();
  357. trace_drv_set_rts_threshold(local, value);
  358. if (local->ops->set_rts_threshold)
  359. ret = local->ops->set_rts_threshold(&local->hw, value);
  360. trace_drv_return_int(local, ret);
  361. return ret;
  362. }
  363. static inline int drv_set_coverage_class(struct ieee80211_local *local,
  364. s16 value)
  365. {
  366. int ret = 0;
  367. might_sleep();
  368. trace_drv_set_coverage_class(local, value);
  369. if (local->ops->set_coverage_class)
  370. local->ops->set_coverage_class(&local->hw, value);
  371. else
  372. ret = -EOPNOTSUPP;
  373. trace_drv_return_int(local, ret);
  374. return ret;
  375. }
  376. static inline void drv_sta_notify(struct ieee80211_local *local,
  377. struct ieee80211_sub_if_data *sdata,
  378. enum sta_notify_cmd cmd,
  379. struct ieee80211_sta *sta)
  380. {
  381. sdata = get_bss_sdata(sdata);
  382. if (!check_sdata_in_driver(sdata))
  383. return;
  384. trace_drv_sta_notify(local, sdata, cmd, sta);
  385. if (local->ops->sta_notify)
  386. local->ops->sta_notify(&local->hw, &sdata->vif, cmd, sta);
  387. trace_drv_return_void(local);
  388. }
  389. static inline int drv_sta_add(struct ieee80211_local *local,
  390. struct ieee80211_sub_if_data *sdata,
  391. struct ieee80211_sta *sta)
  392. {
  393. int ret = 0;
  394. might_sleep();
  395. sdata = get_bss_sdata(sdata);
  396. if (!check_sdata_in_driver(sdata))
  397. return -EIO;
  398. trace_drv_sta_add(local, sdata, sta);
  399. if (local->ops->sta_add)
  400. ret = local->ops->sta_add(&local->hw, &sdata->vif, sta);
  401. trace_drv_return_int(local, ret);
  402. return ret;
  403. }
  404. static inline void drv_sta_remove(struct ieee80211_local *local,
  405. struct ieee80211_sub_if_data *sdata,
  406. struct ieee80211_sta *sta)
  407. {
  408. might_sleep();
  409. sdata = get_bss_sdata(sdata);
  410. if (!check_sdata_in_driver(sdata))
  411. return;
  412. trace_drv_sta_remove(local, sdata, sta);
  413. if (local->ops->sta_remove)
  414. local->ops->sta_remove(&local->hw, &sdata->vif, sta);
  415. trace_drv_return_void(local);
  416. }
  417. #ifdef CONFIG_MAC80211_DEBUGFS
  418. static inline void drv_sta_add_debugfs(struct ieee80211_local *local,
  419. struct ieee80211_sub_if_data *sdata,
  420. struct ieee80211_sta *sta,
  421. struct dentry *dir)
  422. {
  423. might_sleep();
  424. sdata = get_bss_sdata(sdata);
  425. if (!check_sdata_in_driver(sdata))
  426. return;
  427. if (local->ops->sta_add_debugfs)
  428. local->ops->sta_add_debugfs(&local->hw, &sdata->vif,
  429. sta, dir);
  430. }
  431. static inline void drv_sta_remove_debugfs(struct ieee80211_local *local,
  432. struct ieee80211_sub_if_data *sdata,
  433. struct ieee80211_sta *sta,
  434. struct dentry *dir)
  435. {
  436. might_sleep();
  437. sdata = get_bss_sdata(sdata);
  438. check_sdata_in_driver(sdata);
  439. if (local->ops->sta_remove_debugfs)
  440. local->ops->sta_remove_debugfs(&local->hw, &sdata->vif,
  441. sta, dir);
  442. }
  443. #endif
  444. static inline void drv_sta_pre_rcu_remove(struct ieee80211_local *local,
  445. struct ieee80211_sub_if_data *sdata,
  446. struct sta_info *sta)
  447. {
  448. might_sleep();
  449. sdata = get_bss_sdata(sdata);
  450. if (!check_sdata_in_driver(sdata))
  451. return;
  452. trace_drv_sta_pre_rcu_remove(local, sdata, &sta->sta);
  453. if (local->ops->sta_pre_rcu_remove)
  454. local->ops->sta_pre_rcu_remove(&local->hw, &sdata->vif,
  455. &sta->sta);
  456. trace_drv_return_void(local);
  457. }
  458. __must_check
  459. int drv_sta_state(struct ieee80211_local *local,
  460. struct ieee80211_sub_if_data *sdata,
  461. struct sta_info *sta,
  462. enum ieee80211_sta_state old_state,
  463. enum ieee80211_sta_state new_state);
  464. static inline void drv_sta_rc_update(struct ieee80211_local *local,
  465. struct ieee80211_sub_if_data *sdata,
  466. struct ieee80211_sta *sta, u32 changed)
  467. {
  468. sdata = get_bss_sdata(sdata);
  469. if (!check_sdata_in_driver(sdata))
  470. return;
  471. WARN_ON(changed & IEEE80211_RC_SUPP_RATES_CHANGED &&
  472. (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
  473. sdata->vif.type != NL80211_IFTYPE_MESH_POINT));
  474. trace_drv_sta_rc_update(local, sdata, sta, changed);
  475. if (local->ops->sta_rc_update)
  476. local->ops->sta_rc_update(&local->hw, &sdata->vif,
  477. sta, changed);
  478. trace_drv_return_void(local);
  479. }
  480. static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
  481. struct ieee80211_sub_if_data *sdata,
  482. struct ieee80211_sta *sta)
  483. {
  484. sdata = get_bss_sdata(sdata);
  485. if (!check_sdata_in_driver(sdata))
  486. return;
  487. trace_drv_sta_rate_tbl_update(local, sdata, sta);
  488. if (local->ops->sta_rate_tbl_update)
  489. local->ops->sta_rate_tbl_update(&local->hw, &sdata->vif, sta);
  490. trace_drv_return_void(local);
  491. }
  492. static inline void drv_sta_statistics(struct ieee80211_local *local,
  493. struct ieee80211_sub_if_data *sdata,
  494. struct ieee80211_sta *sta,
  495. struct station_info *sinfo)
  496. {
  497. sdata = get_bss_sdata(sdata);
  498. if (!check_sdata_in_driver(sdata))
  499. return;
  500. trace_drv_sta_statistics(local, sdata, sta);
  501. if (local->ops->sta_statistics)
  502. local->ops->sta_statistics(&local->hw, &sdata->vif, sta, sinfo);
  503. trace_drv_return_void(local);
  504. }
  505. static inline int drv_conf_tx(struct ieee80211_local *local,
  506. struct ieee80211_sub_if_data *sdata, u16 ac,
  507. const struct ieee80211_tx_queue_params *params)
  508. {
  509. int ret = -EOPNOTSUPP;
  510. might_sleep();
  511. if (!check_sdata_in_driver(sdata))
  512. return -EIO;
  513. if (WARN_ONCE(params->cw_min == 0 ||
  514. params->cw_min > params->cw_max,
  515. "%s: invalid CW_min/CW_max: %d/%d\n",
  516. sdata->name, params->cw_min, params->cw_max))
  517. return -EINVAL;
  518. trace_drv_conf_tx(local, sdata, ac, params);
  519. if (local->ops->conf_tx)
  520. ret = local->ops->conf_tx(&local->hw, &sdata->vif,
  521. ac, params);
  522. trace_drv_return_int(local, ret);
  523. return ret;
  524. }
  525. static inline u64 drv_get_tsf(struct ieee80211_local *local,
  526. struct ieee80211_sub_if_data *sdata)
  527. {
  528. u64 ret = -1ULL;
  529. might_sleep();
  530. if (!check_sdata_in_driver(sdata))
  531. return ret;
  532. trace_drv_get_tsf(local, sdata);
  533. if (local->ops->get_tsf)
  534. ret = local->ops->get_tsf(&local->hw, &sdata->vif);
  535. trace_drv_return_u64(local, ret);
  536. return ret;
  537. }
  538. static inline void drv_set_tsf(struct ieee80211_local *local,
  539. struct ieee80211_sub_if_data *sdata,
  540. u64 tsf)
  541. {
  542. might_sleep();
  543. if (!check_sdata_in_driver(sdata))
  544. return;
  545. trace_drv_set_tsf(local, sdata, tsf);
  546. if (local->ops->set_tsf)
  547. local->ops->set_tsf(&local->hw, &sdata->vif, tsf);
  548. trace_drv_return_void(local);
  549. }
  550. static inline void drv_reset_tsf(struct ieee80211_local *local,
  551. struct ieee80211_sub_if_data *sdata)
  552. {
  553. might_sleep();
  554. if (!check_sdata_in_driver(sdata))
  555. return;
  556. trace_drv_reset_tsf(local, sdata);
  557. if (local->ops->reset_tsf)
  558. local->ops->reset_tsf(&local->hw, &sdata->vif);
  559. trace_drv_return_void(local);
  560. }
  561. static inline int drv_tx_last_beacon(struct ieee80211_local *local)
  562. {
  563. int ret = 0; /* default unsupported op for less congestion */
  564. might_sleep();
  565. trace_drv_tx_last_beacon(local);
  566. if (local->ops->tx_last_beacon)
  567. ret = local->ops->tx_last_beacon(&local->hw);
  568. trace_drv_return_int(local, ret);
  569. return ret;
  570. }
  571. static inline int drv_ampdu_action(struct ieee80211_local *local,
  572. struct ieee80211_sub_if_data *sdata,
  573. enum ieee80211_ampdu_mlme_action action,
  574. struct ieee80211_sta *sta, u16 tid,
  575. u16 *ssn, u8 buf_size)
  576. {
  577. int ret = -EOPNOTSUPP;
  578. might_sleep();
  579. sdata = get_bss_sdata(sdata);
  580. if (!check_sdata_in_driver(sdata))
  581. return -EIO;
  582. trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, buf_size);
  583. if (local->ops->ampdu_action)
  584. ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
  585. sta, tid, ssn, buf_size);
  586. trace_drv_return_int(local, ret);
  587. return ret;
  588. }
  589. static inline int drv_get_survey(struct ieee80211_local *local, int idx,
  590. struct survey_info *survey)
  591. {
  592. int ret = -EOPNOTSUPP;
  593. trace_drv_get_survey(local, idx, survey);
  594. if (local->ops->get_survey)
  595. ret = local->ops->get_survey(&local->hw, idx, survey);
  596. trace_drv_return_int(local, ret);
  597. return ret;
  598. }
  599. static inline void drv_rfkill_poll(struct ieee80211_local *local)
  600. {
  601. might_sleep();
  602. if (local->ops->rfkill_poll)
  603. local->ops->rfkill_poll(&local->hw);
  604. }
  605. static inline void drv_flush(struct ieee80211_local *local,
  606. struct ieee80211_sub_if_data *sdata,
  607. u32 queues, bool drop)
  608. {
  609. struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
  610. might_sleep();
  611. if (sdata && !check_sdata_in_driver(sdata))
  612. return;
  613. trace_drv_flush(local, queues, drop);
  614. if (local->ops->flush)
  615. local->ops->flush(&local->hw, vif, queues, drop);
  616. trace_drv_return_void(local);
  617. }
  618. static inline void drv_channel_switch(struct ieee80211_local *local,
  619. struct ieee80211_sub_if_data *sdata,
  620. struct ieee80211_channel_switch *ch_switch)
  621. {
  622. might_sleep();
  623. trace_drv_channel_switch(local, sdata, ch_switch);
  624. local->ops->channel_switch(&local->hw, &sdata->vif, ch_switch);
  625. trace_drv_return_void(local);
  626. }
  627. static inline int drv_set_antenna(struct ieee80211_local *local,
  628. u32 tx_ant, u32 rx_ant)
  629. {
  630. int ret = -EOPNOTSUPP;
  631. might_sleep();
  632. if (local->ops->set_antenna)
  633. ret = local->ops->set_antenna(&local->hw, tx_ant, rx_ant);
  634. trace_drv_set_antenna(local, tx_ant, rx_ant, ret);
  635. return ret;
  636. }
  637. static inline int drv_get_antenna(struct ieee80211_local *local,
  638. u32 *tx_ant, u32 *rx_ant)
  639. {
  640. int ret = -EOPNOTSUPP;
  641. might_sleep();
  642. if (local->ops->get_antenna)
  643. ret = local->ops->get_antenna(&local->hw, tx_ant, rx_ant);
  644. trace_drv_get_antenna(local, *tx_ant, *rx_ant, ret);
  645. return ret;
  646. }
  647. static inline int drv_remain_on_channel(struct ieee80211_local *local,
  648. struct ieee80211_sub_if_data *sdata,
  649. struct ieee80211_channel *chan,
  650. unsigned int duration,
  651. enum ieee80211_roc_type type)
  652. {
  653. int ret;
  654. might_sleep();
  655. trace_drv_remain_on_channel(local, sdata, chan, duration, type);
  656. ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
  657. chan, duration, type);
  658. trace_drv_return_int(local, ret);
  659. return ret;
  660. }
  661. static inline int drv_cancel_remain_on_channel(struct ieee80211_local *local)
  662. {
  663. int ret;
  664. might_sleep();
  665. trace_drv_cancel_remain_on_channel(local);
  666. ret = local->ops->cancel_remain_on_channel(&local->hw);
  667. trace_drv_return_int(local, ret);
  668. return ret;
  669. }
  670. static inline int drv_set_ringparam(struct ieee80211_local *local,
  671. u32 tx, u32 rx)
  672. {
  673. int ret = -ENOTSUPP;
  674. might_sleep();
  675. trace_drv_set_ringparam(local, tx, rx);
  676. if (local->ops->set_ringparam)
  677. ret = local->ops->set_ringparam(&local->hw, tx, rx);
  678. trace_drv_return_int(local, ret);
  679. return ret;
  680. }
  681. static inline void drv_get_ringparam(struct ieee80211_local *local,
  682. u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
  683. {
  684. might_sleep();
  685. trace_drv_get_ringparam(local, tx, tx_max, rx, rx_max);
  686. if (local->ops->get_ringparam)
  687. local->ops->get_ringparam(&local->hw, tx, tx_max, rx, rx_max);
  688. trace_drv_return_void(local);
  689. }
  690. static inline bool drv_tx_frames_pending(struct ieee80211_local *local)
  691. {
  692. bool ret = false;
  693. might_sleep();
  694. trace_drv_tx_frames_pending(local);
  695. if (local->ops->tx_frames_pending)
  696. ret = local->ops->tx_frames_pending(&local->hw);
  697. trace_drv_return_bool(local, ret);
  698. return ret;
  699. }
  700. static inline int drv_set_bitrate_mask(struct ieee80211_local *local,
  701. struct ieee80211_sub_if_data *sdata,
  702. const struct cfg80211_bitrate_mask *mask)
  703. {
  704. int ret = -EOPNOTSUPP;
  705. might_sleep();
  706. if (!check_sdata_in_driver(sdata))
  707. return -EIO;
  708. trace_drv_set_bitrate_mask(local, sdata, mask);
  709. if (local->ops->set_bitrate_mask)
  710. ret = local->ops->set_bitrate_mask(&local->hw,
  711. &sdata->vif, mask);
  712. trace_drv_return_int(local, ret);
  713. return ret;
  714. }
  715. static inline void drv_set_rekey_data(struct ieee80211_local *local,
  716. struct ieee80211_sub_if_data *sdata,
  717. struct cfg80211_gtk_rekey_data *data)
  718. {
  719. if (!check_sdata_in_driver(sdata))
  720. return;
  721. trace_drv_set_rekey_data(local, sdata, data);
  722. if (local->ops->set_rekey_data)
  723. local->ops->set_rekey_data(&local->hw, &sdata->vif, data);
  724. trace_drv_return_void(local);
  725. }
  726. static inline void drv_event_callback(struct ieee80211_local *local,
  727. struct ieee80211_sub_if_data *sdata,
  728. const struct ieee80211_event *event)
  729. {
  730. trace_drv_event_callback(local, sdata, event);
  731. if (local->ops->event_callback)
  732. local->ops->event_callback(&local->hw, &sdata->vif, event);
  733. trace_drv_return_void(local);
  734. }
  735. static inline void
  736. drv_release_buffered_frames(struct ieee80211_local *local,
  737. struct sta_info *sta, u16 tids, int num_frames,
  738. enum ieee80211_frame_release_type reason,
  739. bool more_data)
  740. {
  741. trace_drv_release_buffered_frames(local, &sta->sta, tids, num_frames,
  742. reason, more_data);
  743. if (local->ops->release_buffered_frames)
  744. local->ops->release_buffered_frames(&local->hw, &sta->sta, tids,
  745. num_frames, reason,
  746. more_data);
  747. trace_drv_return_void(local);
  748. }
  749. static inline void
  750. drv_allow_buffered_frames(struct ieee80211_local *local,
  751. struct sta_info *sta, u16 tids, int num_frames,
  752. enum ieee80211_frame_release_type reason,
  753. bool more_data)
  754. {
  755. trace_drv_allow_buffered_frames(local, &sta->sta, tids, num_frames,
  756. reason, more_data);
  757. if (local->ops->allow_buffered_frames)
  758. local->ops->allow_buffered_frames(&local->hw, &sta->sta,
  759. tids, num_frames, reason,
  760. more_data);
  761. trace_drv_return_void(local);
  762. }
  763. static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
  764. struct ieee80211_sub_if_data *sdata)
  765. {
  766. might_sleep();
  767. if (!check_sdata_in_driver(sdata))
  768. return;
  769. WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
  770. trace_drv_mgd_prepare_tx(local, sdata);
  771. if (local->ops->mgd_prepare_tx)
  772. local->ops->mgd_prepare_tx(&local->hw, &sdata->vif);
  773. trace_drv_return_void(local);
  774. }
  775. static inline void
  776. drv_mgd_protect_tdls_discover(struct ieee80211_local *local,
  777. struct ieee80211_sub_if_data *sdata)
  778. {
  779. might_sleep();
  780. if (!check_sdata_in_driver(sdata))
  781. return;
  782. WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
  783. trace_drv_mgd_protect_tdls_discover(local, sdata);
  784. if (local->ops->mgd_protect_tdls_discover)
  785. local->ops->mgd_protect_tdls_discover(&local->hw, &sdata->vif);
  786. trace_drv_return_void(local);
  787. }
  788. static inline int drv_add_chanctx(struct ieee80211_local *local,
  789. struct ieee80211_chanctx *ctx)
  790. {
  791. int ret = -EOPNOTSUPP;
  792. trace_drv_add_chanctx(local, ctx);
  793. if (local->ops->add_chanctx)
  794. ret = local->ops->add_chanctx(&local->hw, &ctx->conf);
  795. trace_drv_return_int(local, ret);
  796. if (!ret)
  797. ctx->driver_present = true;
  798. return ret;
  799. }
  800. static inline void drv_remove_chanctx(struct ieee80211_local *local,
  801. struct ieee80211_chanctx *ctx)
  802. {
  803. if (WARN_ON(!ctx->driver_present))
  804. return;
  805. trace_drv_remove_chanctx(local, ctx);
  806. if (local->ops->remove_chanctx)
  807. local->ops->remove_chanctx(&local->hw, &ctx->conf);
  808. trace_drv_return_void(local);
  809. ctx->driver_present = false;
  810. }
  811. static inline void drv_change_chanctx(struct ieee80211_local *local,
  812. struct ieee80211_chanctx *ctx,
  813. u32 changed)
  814. {
  815. trace_drv_change_chanctx(local, ctx, changed);
  816. if (local->ops->change_chanctx) {
  817. WARN_ON_ONCE(!ctx->driver_present);
  818. local->ops->change_chanctx(&local->hw, &ctx->conf, changed);
  819. }
  820. trace_drv_return_void(local);
  821. }
  822. static inline int drv_assign_vif_chanctx(struct ieee80211_local *local,
  823. struct ieee80211_sub_if_data *sdata,
  824. struct ieee80211_chanctx *ctx)
  825. {
  826. int ret = 0;
  827. if (!check_sdata_in_driver(sdata))
  828. return -EIO;
  829. trace_drv_assign_vif_chanctx(local, sdata, ctx);
  830. if (local->ops->assign_vif_chanctx) {
  831. WARN_ON_ONCE(!ctx->driver_present);
  832. ret = local->ops->assign_vif_chanctx(&local->hw,
  833. &sdata->vif,
  834. &ctx->conf);
  835. }
  836. trace_drv_return_int(local, ret);
  837. return ret;
  838. }
  839. static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local,
  840. struct ieee80211_sub_if_data *sdata,
  841. struct ieee80211_chanctx *ctx)
  842. {
  843. if (!check_sdata_in_driver(sdata))
  844. return;
  845. trace_drv_unassign_vif_chanctx(local, sdata, ctx);
  846. if (local->ops->unassign_vif_chanctx) {
  847. WARN_ON_ONCE(!ctx->driver_present);
  848. local->ops->unassign_vif_chanctx(&local->hw,
  849. &sdata->vif,
  850. &ctx->conf);
  851. }
  852. trace_drv_return_void(local);
  853. }
  854. static inline int
  855. drv_switch_vif_chanctx(struct ieee80211_local *local,
  856. struct ieee80211_vif_chanctx_switch *vifs,
  857. int n_vifs,
  858. enum ieee80211_chanctx_switch_mode mode)
  859. {
  860. int ret = 0;
  861. int i;
  862. if (!local->ops->switch_vif_chanctx)
  863. return -EOPNOTSUPP;
  864. for (i = 0; i < n_vifs; i++) {
  865. struct ieee80211_chanctx *new_ctx =
  866. container_of(vifs[i].new_ctx,
  867. struct ieee80211_chanctx,
  868. conf);
  869. struct ieee80211_chanctx *old_ctx =
  870. container_of(vifs[i].old_ctx,
  871. struct ieee80211_chanctx,
  872. conf);
  873. WARN_ON_ONCE(!old_ctx->driver_present);
  874. WARN_ON_ONCE((mode == CHANCTX_SWMODE_SWAP_CONTEXTS &&
  875. new_ctx->driver_present) ||
  876. (mode == CHANCTX_SWMODE_REASSIGN_VIF &&
  877. !new_ctx->driver_present));
  878. }
  879. trace_drv_switch_vif_chanctx(local, vifs, n_vifs, mode);
  880. ret = local->ops->switch_vif_chanctx(&local->hw,
  881. vifs, n_vifs, mode);
  882. trace_drv_return_int(local, ret);
  883. if (!ret && mode == CHANCTX_SWMODE_SWAP_CONTEXTS) {
  884. for (i = 0; i < n_vifs; i++) {
  885. struct ieee80211_chanctx *new_ctx =
  886. container_of(vifs[i].new_ctx,
  887. struct ieee80211_chanctx,
  888. conf);
  889. struct ieee80211_chanctx *old_ctx =
  890. container_of(vifs[i].old_ctx,
  891. struct ieee80211_chanctx,
  892. conf);
  893. new_ctx->driver_present = true;
  894. old_ctx->driver_present = false;
  895. }
  896. }
  897. return ret;
  898. }
  899. static inline int drv_start_ap(struct ieee80211_local *local,
  900. struct ieee80211_sub_if_data *sdata)
  901. {
  902. int ret = 0;
  903. if (!check_sdata_in_driver(sdata))
  904. return -EIO;
  905. trace_drv_start_ap(local, sdata, &sdata->vif.bss_conf);
  906. if (local->ops->start_ap)
  907. ret = local->ops->start_ap(&local->hw, &sdata->vif);
  908. trace_drv_return_int(local, ret);
  909. return ret;
  910. }
  911. static inline void drv_stop_ap(struct ieee80211_local *local,
  912. struct ieee80211_sub_if_data *sdata)
  913. {
  914. if (!check_sdata_in_driver(sdata))
  915. return;
  916. trace_drv_stop_ap(local, sdata);
  917. if (local->ops->stop_ap)
  918. local->ops->stop_ap(&local->hw, &sdata->vif);
  919. trace_drv_return_void(local);
  920. }
  921. static inline void
  922. drv_reconfig_complete(struct ieee80211_local *local,
  923. enum ieee80211_reconfig_type reconfig_type)
  924. {
  925. might_sleep();
  926. trace_drv_reconfig_complete(local, reconfig_type);
  927. if (local->ops->reconfig_complete)
  928. local->ops->reconfig_complete(&local->hw, reconfig_type);
  929. trace_drv_return_void(local);
  930. }
  931. static inline void
  932. drv_set_default_unicast_key(struct ieee80211_local *local,
  933. struct ieee80211_sub_if_data *sdata,
  934. int key_idx)
  935. {
  936. if (!check_sdata_in_driver(sdata))
  937. return;
  938. WARN_ON_ONCE(key_idx < -1 || key_idx > 3);
  939. trace_drv_set_default_unicast_key(local, sdata, key_idx);
  940. if (local->ops->set_default_unicast_key)
  941. local->ops->set_default_unicast_key(&local->hw, &sdata->vif,
  942. key_idx);
  943. trace_drv_return_void(local);
  944. }
  945. #if IS_ENABLED(CONFIG_IPV6)
  946. static inline void drv_ipv6_addr_change(struct ieee80211_local *local,
  947. struct ieee80211_sub_if_data *sdata,
  948. struct inet6_dev *idev)
  949. {
  950. trace_drv_ipv6_addr_change(local, sdata);
  951. if (local->ops->ipv6_addr_change)
  952. local->ops->ipv6_addr_change(&local->hw, &sdata->vif, idev);
  953. trace_drv_return_void(local);
  954. }
  955. #endif
  956. static inline void
  957. drv_channel_switch_beacon(struct ieee80211_sub_if_data *sdata,
  958. struct cfg80211_chan_def *chandef)
  959. {
  960. struct ieee80211_local *local = sdata->local;
  961. if (local->ops->channel_switch_beacon) {
  962. trace_drv_channel_switch_beacon(local, sdata, chandef);
  963. local->ops->channel_switch_beacon(&local->hw, &sdata->vif,
  964. chandef);
  965. }
  966. }
  967. static inline int
  968. drv_pre_channel_switch(struct ieee80211_sub_if_data *sdata,
  969. struct ieee80211_channel_switch *ch_switch)
  970. {
  971. struct ieee80211_local *local = sdata->local;
  972. int ret = 0;
  973. if (!check_sdata_in_driver(sdata))
  974. return -EIO;
  975. trace_drv_pre_channel_switch(local, sdata, ch_switch);
  976. if (local->ops->pre_channel_switch)
  977. ret = local->ops->pre_channel_switch(&local->hw, &sdata->vif,
  978. ch_switch);
  979. trace_drv_return_int(local, ret);
  980. return ret;
  981. }
  982. static inline int
  983. drv_post_channel_switch(struct ieee80211_sub_if_data *sdata)
  984. {
  985. struct ieee80211_local *local = sdata->local;
  986. int ret = 0;
  987. if (!check_sdata_in_driver(sdata))
  988. return -EIO;
  989. trace_drv_post_channel_switch(local, sdata);
  990. if (local->ops->post_channel_switch)
  991. ret = local->ops->post_channel_switch(&local->hw, &sdata->vif);
  992. trace_drv_return_int(local, ret);
  993. return ret;
  994. }
  995. static inline int drv_join_ibss(struct ieee80211_local *local,
  996. struct ieee80211_sub_if_data *sdata)
  997. {
  998. int ret = 0;
  999. might_sleep();
  1000. if (!check_sdata_in_driver(sdata))
  1001. return -EIO;
  1002. trace_drv_join_ibss(local, sdata, &sdata->vif.bss_conf);
  1003. if (local->ops->join_ibss)
  1004. ret = local->ops->join_ibss(&local->hw, &sdata->vif);
  1005. trace_drv_return_int(local, ret);
  1006. return ret;
  1007. }
  1008. static inline void drv_leave_ibss(struct ieee80211_local *local,
  1009. struct ieee80211_sub_if_data *sdata)
  1010. {
  1011. might_sleep();
  1012. if (!check_sdata_in_driver(sdata))
  1013. return;
  1014. trace_drv_leave_ibss(local, sdata);
  1015. if (local->ops->leave_ibss)
  1016. local->ops->leave_ibss(&local->hw, &sdata->vif);
  1017. trace_drv_return_void(local);
  1018. }
  1019. static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
  1020. struct ieee80211_sta *sta)
  1021. {
  1022. u32 ret = 0;
  1023. trace_drv_get_expected_throughput(sta);
  1024. if (local->ops->get_expected_throughput)
  1025. ret = local->ops->get_expected_throughput(sta);
  1026. trace_drv_return_u32(local, ret);
  1027. return ret;
  1028. }
  1029. static inline int drv_get_txpower(struct ieee80211_local *local,
  1030. struct ieee80211_sub_if_data *sdata, int *dbm)
  1031. {
  1032. int ret;
  1033. if (!local->ops->get_txpower)
  1034. return -EOPNOTSUPP;
  1035. ret = local->ops->get_txpower(&local->hw, &sdata->vif, dbm);
  1036. trace_drv_get_txpower(local, sdata, *dbm, ret);
  1037. return ret;
  1038. }
  1039. static inline int
  1040. drv_tdls_channel_switch(struct ieee80211_local *local,
  1041. struct ieee80211_sub_if_data *sdata,
  1042. struct ieee80211_sta *sta, u8 oper_class,
  1043. struct cfg80211_chan_def *chandef,
  1044. struct sk_buff *tmpl_skb, u32 ch_sw_tm_ie)
  1045. {
  1046. int ret;
  1047. might_sleep();
  1048. if (!check_sdata_in_driver(sdata))
  1049. return -EIO;
  1050. if (!local->ops->tdls_channel_switch)
  1051. return -EOPNOTSUPP;
  1052. trace_drv_tdls_channel_switch(local, sdata, sta, oper_class, chandef);
  1053. ret = local->ops->tdls_channel_switch(&local->hw, &sdata->vif, sta,
  1054. oper_class, chandef, tmpl_skb,
  1055. ch_sw_tm_ie);
  1056. trace_drv_return_int(local, ret);
  1057. return ret;
  1058. }
  1059. static inline void
  1060. drv_tdls_cancel_channel_switch(struct ieee80211_local *local,
  1061. struct ieee80211_sub_if_data *sdata,
  1062. struct ieee80211_sta *sta)
  1063. {
  1064. might_sleep();
  1065. if (!check_sdata_in_driver(sdata))
  1066. return;
  1067. if (!local->ops->tdls_cancel_channel_switch)
  1068. return;
  1069. trace_drv_tdls_cancel_channel_switch(local, sdata, sta);
  1070. local->ops->tdls_cancel_channel_switch(&local->hw, &sdata->vif, sta);
  1071. trace_drv_return_void(local);
  1072. }
  1073. static inline void
  1074. drv_tdls_recv_channel_switch(struct ieee80211_local *local,
  1075. struct ieee80211_sub_if_data *sdata,
  1076. struct ieee80211_tdls_ch_sw_params *params)
  1077. {
  1078. trace_drv_tdls_recv_channel_switch(local, sdata, params);
  1079. if (local->ops->tdls_recv_channel_switch)
  1080. local->ops->tdls_recv_channel_switch(&local->hw, &sdata->vif,
  1081. params);
  1082. trace_drv_return_void(local);
  1083. }
  1084. static inline void drv_wake_tx_queue(struct ieee80211_local *local,
  1085. struct txq_info *txq)
  1086. {
  1087. struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);
  1088. if (!check_sdata_in_driver(sdata))
  1089. return;
  1090. trace_drv_wake_tx_queue(local, sdata, txq);
  1091. local->ops->wake_tx_queue(&local->hw, &txq->txq);
  1092. }
  1093. #endif /* __MAC80211_DRIVER_OPS */