xref: /freebsd/sys/dev/rtwn/rtl8192c/usb/r92cu_tx.c (revision c697fb7f)
1 /*-
2  * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #include <sys/cdefs.h>
18 __FBSDID("$FreeBSD$");
19 
20 #include "opt_wlan.h"
21 
22 #include <sys/param.h>
23 #include <sys/lock.h>
24 #include <sys/mutex.h>
25 #include <sys/mbuf.h>
26 #include <sys/kernel.h>
27 #include <sys/socket.h>
28 #include <sys/systm.h>
29 #include <sys/malloc.h>
30 #include <sys/queue.h>
31 #include <sys/taskqueue.h>
32 #include <sys/bus.h>
33 #include <sys/endian.h>
34 #include <sys/linker.h>
35 
36 #include <net/if.h>
37 #include <net/ethernet.h>
38 #include <net/if_media.h>
39 
40 #include <net80211/ieee80211_var.h>
41 #include <net80211/ieee80211_radiotap.h>
42 
43 #include <dev/rtwn/if_rtwnvar.h>
44 #include <dev/rtwn/if_rtwn_debug.h>
45 
46 #include <dev/rtwn/rtl8192c/usb/r92cu.h>
47 #include <dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h>
48 
49 
50 void
51 r92cu_dump_tx_desc(struct rtwn_softc *sc, const void *desc)
52 {
53 #ifdef RTWN_DEBUG
54 	const struct r92cu_tx_desc *txd = desc;
55 
56 	RTWN_DPRINTF(sc, RTWN_DEBUG_XMIT_DESC,
57 	    "%s: len %d, off %d, flags0 %02X, dw: 1 %08X, 2 %08X, 3 %04X "
58 	    "(seq %04X), 4 %08X, 5 %08X, 6 %08X, sum %04X, pad %04X\n",
59 	    __func__, le16toh(txd->pktlen), txd->offset, txd->flags0,
60 	    le32toh(txd->txdw1), le32toh(txd->txdw2), le16toh(txd->txdw3),
61 	    le16toh(txd->txdseq), le32toh(txd->txdw4), le32toh(txd->txdw5),
62 	    le32toh(txd->txdw6), le16toh(txd->txdsum), le16toh(txd->pad));
63 #endif
64 }
65