debugfs_sta.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. /*
  2. * Copyright 2003-2005 Devicescape Software, Inc.
  3. * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz>
  4. * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
  5. * Copyright 2013-2014 Intel Mobile Communications GmbH
  6. * Copyright(c) 2016 Intel Deutschland GmbH
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/debugfs.h>
  13. #include <linux/ieee80211.h>
  14. #include "ieee80211_i.h"
  15. #include "debugfs.h"
  16. #include "debugfs_sta.h"
  17. #include "sta_info.h"
  18. #include "driver-ops.h"
  19. /* sta attributtes */
  20. #define STA_READ(name, field, format_string) \
  21. static ssize_t sta_ ##name## _read(struct file *file, \
  22. char __user *userbuf, \
  23. size_t count, loff_t *ppos) \
  24. { \
  25. struct sta_info *sta = file->private_data; \
  26. return mac80211_format_buffer(userbuf, count, ppos, \
  27. format_string, sta->field); \
  28. }
  29. #define STA_READ_D(name, field) STA_READ(name, field, "%d\n")
  30. #define STA_OPS(name) \
  31. static const struct file_operations sta_ ##name## _ops = { \
  32. .read = sta_##name##_read, \
  33. .open = simple_open, \
  34. .llseek = generic_file_llseek, \
  35. }
  36. #define STA_OPS_RW(name) \
  37. static const struct file_operations sta_ ##name## _ops = { \
  38. .read = sta_##name##_read, \
  39. .write = sta_##name##_write, \
  40. .open = simple_open, \
  41. .llseek = generic_file_llseek, \
  42. }
  43. #define STA_FILE(name, field, format) \
  44. STA_READ_##format(name, field) \
  45. STA_OPS(name)
  46. STA_FILE(aid, sta.aid, D);
  47. static const char * const sta_flag_names[] = {
  48. #define FLAG(F) [WLAN_STA_##F] = #F
  49. FLAG(AUTH),
  50. FLAG(ASSOC),
  51. FLAG(PS_STA),
  52. FLAG(AUTHORIZED),
  53. FLAG(SHORT_PREAMBLE),
  54. FLAG(WDS),
  55. FLAG(CLEAR_PS_FILT),
  56. FLAG(MFP),
  57. FLAG(BLOCK_BA),
  58. FLAG(PS_DRIVER),
  59. FLAG(PSPOLL),
  60. FLAG(TDLS_PEER),
  61. FLAG(TDLS_PEER_AUTH),
  62. FLAG(TDLS_INITIATOR),
  63. FLAG(TDLS_CHAN_SWITCH),
  64. FLAG(TDLS_OFF_CHANNEL),
  65. FLAG(TDLS_WIDER_BW),
  66. FLAG(UAPSD),
  67. FLAG(SP),
  68. FLAG(4ADDR_EVENT),
  69. FLAG(INSERTED),
  70. FLAG(RATE_CONTROL),
  71. FLAG(TOFFSET_KNOWN),
  72. FLAG(MPSP_OWNER),
  73. FLAG(MPSP_RECIPIENT),
  74. FLAG(PS_DELIVER),
  75. #undef FLAG
  76. };
  77. static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
  78. size_t count, loff_t *ppos)
  79. {
  80. char buf[16 * NUM_WLAN_STA_FLAGS], *pos = buf;
  81. char *end = buf + sizeof(buf) - 1;
  82. struct sta_info *sta = file->private_data;
  83. unsigned int flg;
  84. BUILD_BUG_ON(ARRAY_SIZE(sta_flag_names) != NUM_WLAN_STA_FLAGS);
  85. for (flg = 0; flg < NUM_WLAN_STA_FLAGS; flg++) {
  86. if (test_sta_flag(sta, flg))
  87. pos += scnprintf(pos, end - pos, "%s\n",
  88. sta_flag_names[flg]);
  89. }
  90. return simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf));
  91. }
  92. STA_OPS(flags);
  93. static ssize_t sta_num_ps_buf_frames_read(struct file *file,
  94. char __user *userbuf,
  95. size_t count, loff_t *ppos)
  96. {
  97. struct sta_info *sta = file->private_data;
  98. char buf[17*IEEE80211_NUM_ACS], *p = buf;
  99. int ac;
  100. for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
  101. p += scnprintf(p, sizeof(buf)+buf-p, "AC%d: %d\n", ac,
  102. skb_queue_len(&sta->ps_tx_buf[ac]) +
  103. skb_queue_len(&sta->tx_filtered[ac]));
  104. return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
  105. }
  106. STA_OPS(num_ps_buf_frames);
  107. static ssize_t sta_last_seq_ctrl_read(struct file *file, char __user *userbuf,
  108. size_t count, loff_t *ppos)
  109. {
  110. char buf[15*IEEE80211_NUM_TIDS], *p = buf;
  111. int i;
  112. struct sta_info *sta = file->private_data;
  113. for (i = 0; i < IEEE80211_NUM_TIDS; i++)
  114. p += scnprintf(p, sizeof(buf)+buf-p, "%x ",
  115. le16_to_cpu(sta->last_seq_ctrl[i]));
  116. p += scnprintf(p, sizeof(buf)+buf-p, "\n");
  117. return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
  118. }
  119. STA_OPS(last_seq_ctrl);
  120. static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
  121. size_t count, loff_t *ppos)
  122. {
  123. char buf[71 + IEEE80211_NUM_TIDS * 40], *p = buf;
  124. int i;
  125. struct sta_info *sta = file->private_data;
  126. struct tid_ampdu_rx *tid_rx;
  127. struct tid_ampdu_tx *tid_tx;
  128. rcu_read_lock();
  129. p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n",
  130. sta->ampdu_mlme.dialog_token_allocator + 1);
  131. p += scnprintf(p, sizeof(buf) + buf - p,
  132. "TID\t\tRX\tDTKN\tSSN\t\tTX\tDTKN\tpending\n");
  133. for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
  134. tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[i]);
  135. tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[i]);
  136. p += scnprintf(p, sizeof(buf) + buf - p, "%02d", i);
  137. p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", !!tid_rx);
  138. p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x",
  139. tid_rx ? tid_rx->dialog_token : 0);
  140. p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x",
  141. tid_rx ? tid_rx->ssn : 0);
  142. p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", !!tid_tx);
  143. p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x",
  144. tid_tx ? tid_tx->dialog_token : 0);
  145. p += scnprintf(p, sizeof(buf) + buf - p, "\t%03d",
  146. tid_tx ? skb_queue_len(&tid_tx->pending) : 0);
  147. p += scnprintf(p, sizeof(buf) + buf - p, "\n");
  148. }
  149. rcu_read_unlock();
  150. return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
  151. }
  152. static ssize_t sta_agg_status_write(struct file *file, const char __user *userbuf,
  153. size_t count, loff_t *ppos)
  154. {
  155. char _buf[25] = {}, *buf = _buf;
  156. struct sta_info *sta = file->private_data;
  157. bool start, tx;
  158. unsigned long tid;
  159. char *pos;
  160. int ret, timeout = 5000;
  161. if (count > sizeof(_buf))
  162. return -EINVAL;
  163. if (copy_from_user(buf, userbuf, count))
  164. return -EFAULT;
  165. buf[sizeof(_buf) - 1] = '\0';
  166. pos = buf;
  167. buf = strsep(&pos, " ");
  168. if (!buf)
  169. return -EINVAL;
  170. if (!strcmp(buf, "tx"))
  171. tx = true;
  172. else if (!strcmp(buf, "rx"))
  173. tx = false;
  174. else
  175. return -EINVAL;
  176. buf = strsep(&pos, " ");
  177. if (!buf)
  178. return -EINVAL;
  179. if (!strcmp(buf, "start")) {
  180. start = true;
  181. if (!tx)
  182. return -EINVAL;
  183. } else if (!strcmp(buf, "stop")) {
  184. start = false;
  185. } else {
  186. return -EINVAL;
  187. }
  188. buf = strsep(&pos, " ");
  189. if (!buf)
  190. return -EINVAL;
  191. if (sscanf(buf, "timeout=%d", &timeout) == 1) {
  192. buf = strsep(&pos, " ");
  193. if (!buf || !tx || !start)
  194. return -EINVAL;
  195. }
  196. ret = kstrtoul(buf, 0, &tid);
  197. if (ret || tid >= IEEE80211_NUM_TIDS)
  198. return -EINVAL;
  199. if (tx) {
  200. if (start)
  201. ret = ieee80211_start_tx_ba_session(&sta->sta, tid,
  202. timeout);
  203. else
  204. ret = ieee80211_stop_tx_ba_session(&sta->sta, tid);
  205. } else {
  206. __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT,
  207. 3, true);
  208. ret = 0;
  209. }
  210. return ret ?: count;
  211. }
  212. STA_OPS_RW(agg_status);
  213. static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
  214. size_t count, loff_t *ppos)
  215. {
  216. #define PRINT_HT_CAP(_cond, _str) \
  217. do { \
  218. if (_cond) \
  219. p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \
  220. } while (0)
  221. char buf[512], *p = buf;
  222. int i;
  223. struct sta_info *sta = file->private_data;
  224. struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap;
  225. p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n",
  226. htc->ht_supported ? "" : "not ");
  227. if (htc->ht_supported) {
  228. p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.4x\n", htc->cap);
  229. PRINT_HT_CAP((htc->cap & BIT(0)), "RX LDPC");
  230. PRINT_HT_CAP((htc->cap & BIT(1)), "HT20/HT40");
  231. PRINT_HT_CAP(!(htc->cap & BIT(1)), "HT20");
  232. PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 0, "Static SM Power Save");
  233. PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 1, "Dynamic SM Power Save");
  234. PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 3, "SM Power Save disabled");
  235. PRINT_HT_CAP((htc->cap & BIT(4)), "RX Greenfield");
  236. PRINT_HT_CAP((htc->cap & BIT(5)), "RX HT20 SGI");
  237. PRINT_HT_CAP((htc->cap & BIT(6)), "RX HT40 SGI");
  238. PRINT_HT_CAP((htc->cap & BIT(7)), "TX STBC");
  239. PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 0, "No RX STBC");
  240. PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 1, "RX STBC 1-stream");
  241. PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 2, "RX STBC 2-streams");
  242. PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 3, "RX STBC 3-streams");
  243. PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack");
  244. PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: "
  245. "3839 bytes");
  246. PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: "
  247. "7935 bytes");
  248. /*
  249. * For beacons and probe response this would mean the BSS
  250. * does or does not allow the usage of DSSS/CCK HT40.
  251. * Otherwise it means the STA does or does not use
  252. * DSSS/CCK HT40.
  253. */
  254. PRINT_HT_CAP((htc->cap & BIT(12)), "DSSS/CCK HT40");
  255. PRINT_HT_CAP(!(htc->cap & BIT(12)), "No DSSS/CCK HT40");
  256. /* BIT(13) is reserved */
  257. PRINT_HT_CAP((htc->cap & BIT(14)), "40 MHz Intolerant");
  258. PRINT_HT_CAP((htc->cap & BIT(15)), "L-SIG TXOP protection");
  259. p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n",
  260. htc->ampdu_factor, htc->ampdu_density);
  261. p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:");
  262. for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++)
  263. p += scnprintf(p, sizeof(buf)+buf-p, " %.2x",
  264. htc->mcs.rx_mask[i]);
  265. p += scnprintf(p, sizeof(buf)+buf-p, "\n");
  266. /* If not set this is meaningless */
  267. if (le16_to_cpu(htc->mcs.rx_highest)) {
  268. p += scnprintf(p, sizeof(buf)+buf-p,
  269. "MCS rx highest: %d Mbps\n",
  270. le16_to_cpu(htc->mcs.rx_highest));
  271. }
  272. p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n",
  273. htc->mcs.tx_params);
  274. }
  275. return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
  276. }
  277. STA_OPS(ht_capa);
  278. static ssize_t sta_vht_capa_read(struct file *file, char __user *userbuf,
  279. size_t count, loff_t *ppos)
  280. {
  281. char buf[512], *p = buf;
  282. struct sta_info *sta = file->private_data;
  283. struct ieee80211_sta_vht_cap *vhtc = &sta->sta.vht_cap;
  284. p += scnprintf(p, sizeof(buf) + buf - p, "VHT %ssupported\n",
  285. vhtc->vht_supported ? "" : "not ");
  286. if (vhtc->vht_supported) {
  287. p += scnprintf(p, sizeof(buf) + buf - p, "cap: %#.8x\n",
  288. vhtc->cap);
  289. #define PFLAG(a, b) \
  290. do { \
  291. if (vhtc->cap & IEEE80211_VHT_CAP_ ## a) \
  292. p += scnprintf(p, sizeof(buf) + buf - p, \
  293. "\t\t%s\n", b); \
  294. } while (0)
  295. switch (vhtc->cap & 0x3) {
  296. case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895:
  297. p += scnprintf(p, sizeof(buf) + buf - p,
  298. "\t\tMAX-MPDU-3895\n");
  299. break;
  300. case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991:
  301. p += scnprintf(p, sizeof(buf) + buf - p,
  302. "\t\tMAX-MPDU-7991\n");
  303. break;
  304. case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454:
  305. p += scnprintf(p, sizeof(buf) + buf - p,
  306. "\t\tMAX-MPDU-11454\n");
  307. break;
  308. default:
  309. p += scnprintf(p, sizeof(buf) + buf - p,
  310. "\t\tMAX-MPDU-UNKNOWN\n");
  311. };
  312. switch (vhtc->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
  313. case 0:
  314. p += scnprintf(p, sizeof(buf) + buf - p,
  315. "\t\t80Mhz\n");
  316. break;
  317. case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
  318. p += scnprintf(p, sizeof(buf) + buf - p,
  319. "\t\t160Mhz\n");
  320. break;
  321. case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ:
  322. p += scnprintf(p, sizeof(buf) + buf - p,
  323. "\t\t80+80Mhz\n");
  324. break;
  325. default:
  326. p += scnprintf(p, sizeof(buf) + buf - p,
  327. "\t\tUNKNOWN-MHZ: 0x%x\n",
  328. (vhtc->cap >> 2) & 0x3);
  329. };
  330. PFLAG(RXLDPC, "RXLDPC");
  331. PFLAG(SHORT_GI_80, "SHORT-GI-80");
  332. PFLAG(SHORT_GI_160, "SHORT-GI-160");
  333. PFLAG(TXSTBC, "TXSTBC");
  334. p += scnprintf(p, sizeof(buf) + buf - p,
  335. "\t\tRXSTBC_%d\n", (vhtc->cap >> 8) & 0x7);
  336. PFLAG(SU_BEAMFORMER_CAPABLE, "SU-BEAMFORMER-CAPABLE");
  337. PFLAG(SU_BEAMFORMEE_CAPABLE, "SU-BEAMFORMEE-CAPABLE");
  338. p += scnprintf(p, sizeof(buf) + buf - p,
  339. "\t\tBEAMFORMEE-STS: 0x%x\n",
  340. (vhtc->cap & IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK) >>
  341. IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT);
  342. p += scnprintf(p, sizeof(buf) + buf - p,
  343. "\t\tSOUNDING-DIMENSIONS: 0x%x\n",
  344. (vhtc->cap & IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK)
  345. >> IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT);
  346. PFLAG(MU_BEAMFORMER_CAPABLE, "MU-BEAMFORMER-CAPABLE");
  347. PFLAG(MU_BEAMFORMEE_CAPABLE, "MU-BEAMFORMEE-CAPABLE");
  348. PFLAG(VHT_TXOP_PS, "TXOP-PS");
  349. PFLAG(HTC_VHT, "HTC-VHT");
  350. p += scnprintf(p, sizeof(buf) + buf - p,
  351. "\t\tMPDU-LENGTH-EXPONENT: 0x%x\n",
  352. (vhtc->cap & IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >>
  353. IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
  354. PFLAG(VHT_LINK_ADAPTATION_VHT_UNSOL_MFB,
  355. "LINK-ADAPTATION-VHT-UNSOL-MFB");
  356. p += scnprintf(p, sizeof(buf) + buf - p,
  357. "\t\tLINK-ADAPTATION-VHT-MRQ-MFB: 0x%x\n",
  358. (vhtc->cap & IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB) >> 26);
  359. PFLAG(RX_ANTENNA_PATTERN, "RX-ANTENNA-PATTERN");
  360. PFLAG(TX_ANTENNA_PATTERN, "TX-ANTENNA-PATTERN");
  361. p += scnprintf(p, sizeof(buf)+buf-p, "RX MCS: %.4x\n",
  362. le16_to_cpu(vhtc->vht_mcs.rx_mcs_map));
  363. if (vhtc->vht_mcs.rx_highest)
  364. p += scnprintf(p, sizeof(buf)+buf-p,
  365. "MCS RX highest: %d Mbps\n",
  366. le16_to_cpu(vhtc->vht_mcs.rx_highest));
  367. p += scnprintf(p, sizeof(buf)+buf-p, "TX MCS: %.4x\n",
  368. le16_to_cpu(vhtc->vht_mcs.tx_mcs_map));
  369. if (vhtc->vht_mcs.tx_highest)
  370. p += scnprintf(p, sizeof(buf)+buf-p,
  371. "MCS TX highest: %d Mbps\n",
  372. le16_to_cpu(vhtc->vht_mcs.tx_highest));
  373. }
  374. return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
  375. }
  376. STA_OPS(vht_capa);
  377. #define DEBUGFS_ADD(name) \
  378. debugfs_create_file(#name, 0400, \
  379. sta->debugfs_dir, sta, &sta_ ##name## _ops);
  380. #define DEBUGFS_ADD_COUNTER(name, field) \
  381. if (sizeof(sta->field) == sizeof(u32)) \
  382. debugfs_create_u32(#name, 0400, sta->debugfs_dir, \
  383. (u32 *) &sta->field); \
  384. else \
  385. debugfs_create_u64(#name, 0400, sta->debugfs_dir, \
  386. (u64 *) &sta->field);
  387. void ieee80211_sta_debugfs_add(struct sta_info *sta)
  388. {
  389. struct ieee80211_local *local = sta->local;
  390. struct ieee80211_sub_if_data *sdata = sta->sdata;
  391. struct dentry *stations_dir = sta->sdata->debugfs.subdir_stations;
  392. u8 mac[3*ETH_ALEN];
  393. if (!stations_dir)
  394. return;
  395. snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
  396. /*
  397. * This might fail due to a race condition:
  398. * When mac80211 unlinks a station, the debugfs entries
  399. * remain, but it is already possible to link a new
  400. * station with the same address which triggers adding
  401. * it to debugfs; therefore, if the old station isn't
  402. * destroyed quickly enough the old station's debugfs
  403. * dir might still be around.
  404. */
  405. sta->debugfs_dir = debugfs_create_dir(mac, stations_dir);
  406. if (!sta->debugfs_dir)
  407. return;
  408. DEBUGFS_ADD(flags);
  409. DEBUGFS_ADD(num_ps_buf_frames);
  410. DEBUGFS_ADD(last_seq_ctrl);
  411. DEBUGFS_ADD(agg_status);
  412. DEBUGFS_ADD(ht_capa);
  413. DEBUGFS_ADD(vht_capa);
  414. DEBUGFS_ADD_COUNTER(rx_duplicates, rx_stats.num_duplicates);
  415. DEBUGFS_ADD_COUNTER(rx_fragments, rx_stats.fragments);
  416. DEBUGFS_ADD_COUNTER(tx_filtered, status_stats.filtered);
  417. if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
  418. debugfs_create_x32("driver_buffered_tids", 0400,
  419. sta->debugfs_dir,
  420. (u32 *)&sta->driver_buffered_tids);
  421. else
  422. debugfs_create_x64("driver_buffered_tids", 0400,
  423. sta->debugfs_dir,
  424. (u64 *)&sta->driver_buffered_tids);
  425. drv_sta_add_debugfs(local, sdata, &sta->sta, sta->debugfs_dir);
  426. }
  427. void ieee80211_sta_debugfs_remove(struct sta_info *sta)
  428. {
  429. struct ieee80211_local *local = sta->local;
  430. struct ieee80211_sub_if_data *sdata = sta->sdata;
  431. drv_sta_remove_debugfs(local, sdata, &sta->sta, sta->debugfs_dir);
  432. debugfs_remove_recursive(sta->debugfs_dir);
  433. sta->debugfs_dir = NULL;
  434. }