debug.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /*
  2. * Copyright (c) 2007-2008 Bruno Randolf <bruno@thinktube.com>
  3. *
  4. * This file is free software: you may copy, redistribute and/or modify it
  5. * under the terms of the GNU General Public License as published by the
  6. * Free Software Foundation, either version 2 of the License, or (at your
  7. * option) any later version.
  8. *
  9. * This file is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. *
  18. * This file incorporates work covered by the following copyright and
  19. * permission notice:
  20. *
  21. * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  22. * Copyright (c) 2004-2005 Atheros Communications, Inc.
  23. * Copyright (c) 2006 Devicescape Software, Inc.
  24. * Copyright (c) 2007 Jiri Slaby <jirislaby@gmail.com>
  25. * Copyright (c) 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
  26. *
  27. * All rights reserved.
  28. *
  29. * Redistribution and use in source and binary forms, with or without
  30. * modification, are permitted provided that the following conditions
  31. * are met:
  32. * 1. Redistributions of source code must retain the above copyright
  33. * notice, this list of conditions and the following disclaimer,
  34. * without modification.
  35. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  36. * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
  37. * redistribution must be conditioned upon including a substantially
  38. * similar Disclaimer requirement for further binary redistribution.
  39. * 3. Neither the names of the above-listed copyright holders nor the names
  40. * of any contributors may be used to endorse or promote products derived
  41. * from this software without specific prior written permission.
  42. *
  43. * Alternatively, this software may be distributed under the terms of the
  44. * GNU General Public License ("GPL") version 2 as published by the Free
  45. * Software Foundation.
  46. *
  47. * NO WARRANTY
  48. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  49. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  50. * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
  51. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  52. * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
  53. * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  54. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  55. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  56. * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  57. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  58. * THE POSSIBILITY OF SUCH DAMAGES.
  59. */
  60. #include "base.h"
  61. #include "debug.h"
  62. static unsigned int ath5k_debug;
  63. module_param_named(debug, ath5k_debug, uint, 0);
  64. #ifdef CONFIG_ATH5K_DEBUG
  65. #include <linux/seq_file.h>
  66. #include "reg.h"
  67. static struct dentry *ath5k_global_debugfs;
  68. static int ath5k_debugfs_open(struct inode *inode, struct file *file)
  69. {
  70. file->private_data = inode->i_private;
  71. return 0;
  72. }
  73. /* debugfs: registers */
  74. struct reg {
  75. char *name;
  76. int addr;
  77. };
  78. #define REG_STRUCT_INIT(r) { #r, r }
  79. /* just a few random registers, might want to add more */
  80. static struct reg regs[] = {
  81. REG_STRUCT_INIT(AR5K_CR),
  82. REG_STRUCT_INIT(AR5K_RXDP),
  83. REG_STRUCT_INIT(AR5K_CFG),
  84. REG_STRUCT_INIT(AR5K_IER),
  85. REG_STRUCT_INIT(AR5K_BCR),
  86. REG_STRUCT_INIT(AR5K_RTSD0),
  87. REG_STRUCT_INIT(AR5K_RTSD1),
  88. REG_STRUCT_INIT(AR5K_TXCFG),
  89. REG_STRUCT_INIT(AR5K_RXCFG),
  90. REG_STRUCT_INIT(AR5K_RXJLA),
  91. REG_STRUCT_INIT(AR5K_MIBC),
  92. REG_STRUCT_INIT(AR5K_TOPS),
  93. REG_STRUCT_INIT(AR5K_RXNOFRM),
  94. REG_STRUCT_INIT(AR5K_TXNOFRM),
  95. REG_STRUCT_INIT(AR5K_RPGTO),
  96. REG_STRUCT_INIT(AR5K_RFCNT),
  97. REG_STRUCT_INIT(AR5K_MISC),
  98. REG_STRUCT_INIT(AR5K_QCUDCU_CLKGT),
  99. REG_STRUCT_INIT(AR5K_ISR),
  100. REG_STRUCT_INIT(AR5K_PISR),
  101. REG_STRUCT_INIT(AR5K_SISR0),
  102. REG_STRUCT_INIT(AR5K_SISR1),
  103. REG_STRUCT_INIT(AR5K_SISR2),
  104. REG_STRUCT_INIT(AR5K_SISR3),
  105. REG_STRUCT_INIT(AR5K_SISR4),
  106. REG_STRUCT_INIT(AR5K_IMR),
  107. REG_STRUCT_INIT(AR5K_PIMR),
  108. REG_STRUCT_INIT(AR5K_SIMR0),
  109. REG_STRUCT_INIT(AR5K_SIMR1),
  110. REG_STRUCT_INIT(AR5K_SIMR2),
  111. REG_STRUCT_INIT(AR5K_SIMR3),
  112. REG_STRUCT_INIT(AR5K_SIMR4),
  113. REG_STRUCT_INIT(AR5K_DCM_ADDR),
  114. REG_STRUCT_INIT(AR5K_DCCFG),
  115. REG_STRUCT_INIT(AR5K_CCFG),
  116. REG_STRUCT_INIT(AR5K_CPC0),
  117. REG_STRUCT_INIT(AR5K_CPC1),
  118. REG_STRUCT_INIT(AR5K_CPC2),
  119. REG_STRUCT_INIT(AR5K_CPC3),
  120. REG_STRUCT_INIT(AR5K_CPCOVF),
  121. REG_STRUCT_INIT(AR5K_RESET_CTL),
  122. REG_STRUCT_INIT(AR5K_SLEEP_CTL),
  123. REG_STRUCT_INIT(AR5K_INTPEND),
  124. REG_STRUCT_INIT(AR5K_SFR),
  125. REG_STRUCT_INIT(AR5K_PCICFG),
  126. REG_STRUCT_INIT(AR5K_GPIOCR),
  127. REG_STRUCT_INIT(AR5K_GPIODO),
  128. REG_STRUCT_INIT(AR5K_SREV),
  129. };
  130. static void *reg_start(struct seq_file *seq, loff_t *pos)
  131. {
  132. return *pos < ARRAY_SIZE(regs) ? &regs[*pos] : NULL;
  133. }
  134. static void reg_stop(struct seq_file *seq, void *p)
  135. {
  136. /* nothing to do */
  137. }
  138. static void *reg_next(struct seq_file *seq, void *p, loff_t *pos)
  139. {
  140. ++*pos;
  141. return *pos < ARRAY_SIZE(regs) ? &regs[*pos] : NULL;
  142. }
  143. static int reg_show(struct seq_file *seq, void *p)
  144. {
  145. struct ath5k_softc *sc = seq->private;
  146. struct reg *r = p;
  147. seq_printf(seq, "%-25s0x%08x\n", r->name,
  148. ath5k_hw_reg_read(sc->ah, r->addr));
  149. return 0;
  150. }
  151. static const struct seq_operations register_seq_ops = {
  152. .start = reg_start,
  153. .next = reg_next,
  154. .stop = reg_stop,
  155. .show = reg_show
  156. };
  157. static int open_file_registers(struct inode *inode, struct file *file)
  158. {
  159. struct seq_file *s;
  160. int res;
  161. res = seq_open(file, &register_seq_ops);
  162. if (res == 0) {
  163. s = file->private_data;
  164. s->private = inode->i_private;
  165. }
  166. return res;
  167. }
  168. static const struct file_operations fops_registers = {
  169. .open = open_file_registers,
  170. .read = seq_read,
  171. .llseek = seq_lseek,
  172. .release = seq_release,
  173. .owner = THIS_MODULE,
  174. };
  175. /* debugfs: beacons */
  176. static ssize_t read_file_beacon(struct file *file, char __user *user_buf,
  177. size_t count, loff_t *ppos)
  178. {
  179. struct ath5k_softc *sc = file->private_data;
  180. struct ath5k_hw *ah = sc->ah;
  181. char buf[500];
  182. unsigned int len = 0;
  183. unsigned int v;
  184. u64 tsf;
  185. v = ath5k_hw_reg_read(sc->ah, AR5K_BEACON);
  186. len += snprintf(buf+len, sizeof(buf)-len,
  187. "%-24s0x%08x\tintval: %d\tTIM: 0x%x\n",
  188. "AR5K_BEACON", v, v & AR5K_BEACON_PERIOD,
  189. (v & AR5K_BEACON_TIM) >> AR5K_BEACON_TIM_S);
  190. len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\n",
  191. "AR5K_LAST_TSTP", ath5k_hw_reg_read(sc->ah, AR5K_LAST_TSTP));
  192. len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\n\n",
  193. "AR5K_BEACON_CNT", ath5k_hw_reg_read(sc->ah, AR5K_BEACON_CNT));
  194. v = ath5k_hw_reg_read(sc->ah, AR5K_TIMER0);
  195. len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\tTU: %08x\n",
  196. "AR5K_TIMER0 (TBTT)", v, v);
  197. v = ath5k_hw_reg_read(sc->ah, AR5K_TIMER1);
  198. len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\tTU: %08x\n",
  199. "AR5K_TIMER1 (DMA)", v, v >> 3);
  200. v = ath5k_hw_reg_read(sc->ah, AR5K_TIMER2);
  201. len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\tTU: %08x\n",
  202. "AR5K_TIMER2 (SWBA)", v, v >> 3);
  203. v = ath5k_hw_reg_read(sc->ah, AR5K_TIMER3);
  204. len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\tTU: %08x\n",
  205. "AR5K_TIMER3 (ATIM)", v, v);
  206. tsf = ath5k_hw_get_tsf64(sc->ah);
  207. len += snprintf(buf+len, sizeof(buf)-len,
  208. "TSF\t\t0x%016llx\tTU: %08x\n",
  209. (unsigned long long)tsf, TSF_TO_TU(tsf));
  210. return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  211. }
  212. static ssize_t write_file_beacon(struct file *file,
  213. const char __user *userbuf,
  214. size_t count, loff_t *ppos)
  215. {
  216. struct ath5k_softc *sc = file->private_data;
  217. struct ath5k_hw *ah = sc->ah;
  218. char buf[20];
  219. if (copy_from_user(buf, userbuf, min(count, sizeof(buf))))
  220. return -EFAULT;
  221. if (strncmp(buf, "disable", 7) == 0) {
  222. AR5K_REG_DISABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
  223. printk(KERN_INFO "debugfs disable beacons\n");
  224. } else if (strncmp(buf, "enable", 6) == 0) {
  225. AR5K_REG_ENABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
  226. printk(KERN_INFO "debugfs enable beacons\n");
  227. }
  228. return count;
  229. }
  230. static const struct file_operations fops_beacon = {
  231. .read = read_file_beacon,
  232. .write = write_file_beacon,
  233. .open = ath5k_debugfs_open,
  234. .owner = THIS_MODULE,
  235. };
  236. /* debugfs: reset */
  237. static ssize_t write_file_reset(struct file *file,
  238. const char __user *userbuf,
  239. size_t count, loff_t *ppos)
  240. {
  241. struct ath5k_softc *sc = file->private_data;
  242. tasklet_schedule(&sc->restq);
  243. return count;
  244. }
  245. static const struct file_operations fops_reset = {
  246. .write = write_file_reset,
  247. .open = ath5k_debugfs_open,
  248. .owner = THIS_MODULE,
  249. };
  250. /* debugfs: debug level */
  251. static struct {
  252. enum ath5k_debug_level level;
  253. const char *name;
  254. const char *desc;
  255. } dbg_info[] = {
  256. { ATH5K_DEBUG_RESET, "reset", "reset and initialization" },
  257. { ATH5K_DEBUG_INTR, "intr", "interrupt handling" },
  258. { ATH5K_DEBUG_MODE, "mode", "mode init/setup" },
  259. { ATH5K_DEBUG_XMIT, "xmit", "basic xmit operation" },
  260. { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" },
  261. { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" },
  262. { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" },
  263. { ATH5K_DEBUG_LED, "led", "LED management" },
  264. { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" },
  265. { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" },
  266. { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" },
  267. { ATH5K_DEBUG_TRACE, "trace", "trace function calls" },
  268. { ATH5K_DEBUG_ANY, "all", "show all debug levels" },
  269. };
  270. static ssize_t read_file_debug(struct file *file, char __user *user_buf,
  271. size_t count, loff_t *ppos)
  272. {
  273. struct ath5k_softc *sc = file->private_data;
  274. char buf[700];
  275. unsigned int len = 0;
  276. unsigned int i;
  277. len += snprintf(buf+len, sizeof(buf)-len,
  278. "DEBUG LEVEL: 0x%08x\n\n", sc->debug.level);
  279. for (i = 0; i < ARRAY_SIZE(dbg_info) - 1; i++) {
  280. len += snprintf(buf+len, sizeof(buf)-len,
  281. "%10s %c 0x%08x - %s\n", dbg_info[i].name,
  282. sc->debug.level & dbg_info[i].level ? '+' : ' ',
  283. dbg_info[i].level, dbg_info[i].desc);
  284. }
  285. len += snprintf(buf+len, sizeof(buf)-len,
  286. "%10s %c 0x%08x - %s\n", dbg_info[i].name,
  287. sc->debug.level == dbg_info[i].level ? '+' : ' ',
  288. dbg_info[i].level, dbg_info[i].desc);
  289. return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  290. }
  291. static ssize_t write_file_debug(struct file *file,
  292. const char __user *userbuf,
  293. size_t count, loff_t *ppos)
  294. {
  295. struct ath5k_softc *sc = file->private_data;
  296. unsigned int i;
  297. char buf[20];
  298. if (copy_from_user(buf, userbuf, min(count, sizeof(buf))))
  299. return -EFAULT;
  300. for (i = 0; i < ARRAY_SIZE(dbg_info); i++) {
  301. if (strncmp(buf, dbg_info[i].name,
  302. strlen(dbg_info[i].name)) == 0) {
  303. sc->debug.level ^= dbg_info[i].level; /* toggle bit */
  304. break;
  305. }
  306. }
  307. return count;
  308. }
  309. static const struct file_operations fops_debug = {
  310. .read = read_file_debug,
  311. .write = write_file_debug,
  312. .open = ath5k_debugfs_open,
  313. .owner = THIS_MODULE,
  314. };
  315. /* init */
  316. void
  317. ath5k_debug_init(void)
  318. {
  319. ath5k_global_debugfs = debugfs_create_dir("ath5k", NULL);
  320. }
  321. void
  322. ath5k_debug_init_device(struct ath5k_softc *sc)
  323. {
  324. sc->debug.level = ath5k_debug;
  325. sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
  326. ath5k_global_debugfs);
  327. sc->debug.debugfs_debug = debugfs_create_file("debug", S_IWUSR | S_IRUGO,
  328. sc->debug.debugfs_phydir, sc, &fops_debug);
  329. sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO,
  330. sc->debug.debugfs_phydir, sc, &fops_registers);
  331. sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO,
  332. sc->debug.debugfs_phydir, sc, &fops_beacon);
  333. sc->debug.debugfs_reset = debugfs_create_file("reset", S_IWUSR,
  334. sc->debug.debugfs_phydir, sc, &fops_reset);
  335. }
  336. void
  337. ath5k_debug_finish(void)
  338. {
  339. debugfs_remove(ath5k_global_debugfs);
  340. }
  341. void
  342. ath5k_debug_finish_device(struct ath5k_softc *sc)
  343. {
  344. debugfs_remove(sc->debug.debugfs_debug);
  345. debugfs_remove(sc->debug.debugfs_registers);
  346. debugfs_remove(sc->debug.debugfs_beacon);
  347. debugfs_remove(sc->debug.debugfs_reset);
  348. debugfs_remove(sc->debug.debugfs_phydir);
  349. }
  350. /* functions used in other places */
  351. void
  352. ath5k_debug_dump_bands(struct ath5k_softc *sc)
  353. {
  354. unsigned int b, i;
  355. if (likely(!(sc->debug.level & ATH5K_DEBUG_DUMPBANDS)))
  356. return;
  357. BUG_ON(!sc->sbands);
  358. for (b = 0; b < IEEE80211_NUM_BANDS; b++) {
  359. struct ieee80211_supported_band *band = &sc->sbands[b];
  360. char bname[5];
  361. switch (band->band) {
  362. case IEEE80211_BAND_2GHZ:
  363. strcpy(bname, "2 GHz");
  364. break;
  365. case IEEE80211_BAND_5GHZ:
  366. strcpy(bname, "5 GHz");
  367. break;
  368. default:
  369. printk(KERN_DEBUG "Band not supported: %d\n",
  370. band->band);
  371. return;
  372. }
  373. printk(KERN_DEBUG "Band %s: channels %d, rates %d\n", bname,
  374. band->n_channels, band->n_bitrates);
  375. printk(KERN_DEBUG " channels:\n");
  376. for (i = 0; i < band->n_channels; i++)
  377. printk(KERN_DEBUG " %3d %d %.4x %.4x\n",
  378. ieee80211_frequency_to_channel(
  379. band->channels[i].center_freq),
  380. band->channels[i].center_freq,
  381. band->channels[i].hw_value,
  382. band->channels[i].flags);
  383. printk(KERN_DEBUG " rates:\n");
  384. for (i = 0; i < band->n_bitrates; i++)
  385. printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n",
  386. band->bitrates[i].bitrate,
  387. band->bitrates[i].hw_value,
  388. band->bitrates[i].flags,
  389. band->bitrates[i].hw_value_short);
  390. }
  391. }
  392. static inline void
  393. ath5k_debug_printrxbuf(struct ath5k_buf *bf, int done,
  394. struct ath5k_rx_status *rs)
  395. {
  396. struct ath5k_desc *ds = bf->desc;
  397. struct ath5k_hw_all_rx_desc *rd = &ds->ud.ds_rx;
  398. printk(KERN_DEBUG "R (%p %llx) %08x %08x %08x %08x %08x %08x %c\n",
  399. ds, (unsigned long long)bf->daddr,
  400. ds->ds_link, ds->ds_data,
  401. rd->rx_ctl.rx_control_0, rd->rx_ctl.rx_control_1,
  402. rd->u.rx_stat.rx_status_0, rd->u.rx_stat.rx_status_0,
  403. !done ? ' ' : (rs->rs_status == 0) ? '*' : '!');
  404. }
  405. void
  406. ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah)
  407. {
  408. struct ath5k_desc *ds;
  409. struct ath5k_buf *bf;
  410. struct ath5k_rx_status rs = {};
  411. int status;
  412. if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET)))
  413. return;
  414. printk(KERN_DEBUG "rx queue %x, link %p\n",
  415. ath5k_hw_get_rxdp(ah), sc->rxlink);
  416. spin_lock_bh(&sc->rxbuflock);
  417. list_for_each_entry(bf, &sc->rxbuf, list) {
  418. ds = bf->desc;
  419. status = ah->ah_proc_rx_desc(ah, ds, &rs);
  420. if (!status)
  421. ath5k_debug_printrxbuf(bf, status == 0, &rs);
  422. }
  423. spin_unlock_bh(&sc->rxbuflock);
  424. }
  425. void
  426. ath5k_debug_dump_skb(struct ath5k_softc *sc,
  427. struct sk_buff *skb, const char *prefix, int tx)
  428. {
  429. char buf[16];
  430. if (likely(!((tx && (sc->debug.level & ATH5K_DEBUG_DUMP_TX)) ||
  431. (!tx && (sc->debug.level & ATH5K_DEBUG_DUMP_RX)))))
  432. return;
  433. snprintf(buf, sizeof(buf), "%s %s", wiphy_name(sc->hw->wiphy), prefix);
  434. print_hex_dump_bytes(buf, DUMP_PREFIX_NONE, skb->data,
  435. min(200U, skb->len));
  436. printk(KERN_DEBUG "\n");
  437. }
  438. void
  439. ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf)
  440. {
  441. struct ath5k_desc *ds = bf->desc;
  442. struct ath5k_hw_5212_tx_desc *td = &ds->ud.ds_tx5212;
  443. struct ath5k_tx_status ts = {};
  444. int done;
  445. if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET)))
  446. return;
  447. done = sc->ah->ah_proc_tx_desc(sc->ah, bf->desc, &ts);
  448. printk(KERN_DEBUG "T (%p %llx) %08x %08x %08x %08x %08x %08x %08x "
  449. "%08x %c\n", ds, (unsigned long long)bf->daddr, ds->ds_link,
  450. ds->ds_data, td->tx_ctl.tx_control_0, td->tx_ctl.tx_control_1,
  451. td->tx_ctl.tx_control_2, td->tx_ctl.tx_control_3,
  452. td->tx_stat.tx_status_0, td->tx_stat.tx_status_1,
  453. done ? ' ' : (ts.ts_status == 0) ? '*' : '!');
  454. }
  455. #endif /* ifdef CONFIG_ATH5K_DEBUG */