static int init_sdio(struct sdiowm_dev *sdev);
static void release_sdio(struct sdiowm_dev *sdev);
-#ifdef DEBUG
-static void hexdump(char *title, u8 *data, int len)
-{
- int i;
-
- printk(KERN_DEBUG "%s: length = %d\n", title, len);
- for (i = 0; i < len; i++) {
- printk(KERN_DEBUG "%02x ", data[i]);
- if ((i & 0xf) == 0xf)
- printk(KERN_DEBUG "\n");
- }
- printk(KERN_DEBUG "\n");
-}
-#endif
-
static struct sdio_tx *alloc_tx_struct(struct tx_cxt *tx)
{
struct sdio_tx *t = kzalloc(sizeof(*t), GFP_ATOMIC);
spin_unlock_irqrestore(&tx->lock, flags);
-#ifdef DEBUG
- hexdump("sdio_send", tx->sdu_buf + TYPE_A_HEADER_SIZE,
- aggr_len - TYPE_A_HEADER_SIZE);
-#endif
+ print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
+ tx->sdu_buf + TYPE_A_HEADER_SIZE,
+ aggr_len - TYPE_A_HEADER_SIZE, false);
for (pos = TYPE_A_HEADER_SIZE; pos < aggr_len; pos += TX_CHUNK_SIZE) {
len = aggr_len - pos;
{
unsigned long flags;
-#ifdef DEBUG
- hexdump("sdio_send", t->buf + TYPE_A_HEADER_SIZE,
- t->len - TYPE_A_HEADER_SIZE);
-#endif
+ print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
+ t->buf + TYPE_A_HEADER_SIZE,
+ t->len - TYPE_A_HEADER_SIZE, false);
send_sdio_pkt(func, t->buf, t->len);
spin_lock_irqsave(&tx->lock, flags);
}
end_io:
-#ifdef DEBUG
- hexdump("sdio_receive", rx->rx_buf, len);
-#endif
+ print_hex_dump_debug("sdio_receive: ", DUMP_PREFIX_NONE, 16, 1,
+ rx->rx_buf, len, false);
len = control_sdu_tx_flow(sdev, rx->rx_buf, len);
spin_lock_irqsave(&rx->lock, flags);
static void release_usb(struct usbwm_dev *udev);
/*#define DEBUG */
-#ifdef DEBUG
-static void hexdump(char *title, u8 *data, int len)
-{
- int i;
-
- printk(KERN_DEBUG "%s: length = %d\n", title, len);
- for (i = 0; i < len; i++) {
- printk(KERN_DEBUG "%02x ", data[i]);
- if ((i & 0xf) == 0xf)
- printk(KERN_DEBUG "\n");
- }
- printk(KERN_DEBUG "\n");
-}
-#endif
static struct usb_tx *alloc_tx_struct(struct tx_cxt *tx)
{
gdm_usb_send_complete,
t);
-#ifdef DEBUG
- hexdump("usb_send", t->buf, len + padding);
-#endif
+ print_hex_dump_debug("usb_send: ", DUMP_PREFIX_NONE, 16, 1,
+ t->buf, len + padding, false);
#ifdef CONFIG_WIMAX_GDM72XX_USB_PM
if (usbdev->state & USB_STATE_SUSPENDED) {
list_add_tail(&t->p_list, &tx->pending_list);
if (!urb->status) {
cmd_evt = (r->buf[0] << 8) | (r->buf[1]);
-#ifdef DEBUG
- hexdump("usb_receive", r->buf, urb->actual_length);
-#endif
+ print_hex_dump_debug("usb_receive: ", DUMP_PREFIX_NONE, 16, 1,
+ r->buf, urb->actual_length, false);
if (cmd_evt == WIMAX_SDU_TX_FLOW) {
if (r->buf[4] == 0) {
#ifdef DEBUG
static void gdm_wimax_ind_if_updown(struct net_device *dev, int if_up);
#if defined(DEBUG_SDU)
-static void printk_hex(u8 *buf, u32 size)
-{
- int i;
-
- for (i = 0; i < size; i++) {
- if (i && i % 16 == 0)
- printk(KERN_DEBUG "\n%02x ", *buf++);
- else
- printk(KERN_DEBUG "%02x ", *buf++);
- }
-
- printk(KERN_DEBUG "\n");
-}
-
static const char *get_protocol_name(u16 protocol)
{
static char buf[32];
printk(KERN_DEBUG " src=%pI6\n", &ih->saddr);
}
- #if (DUMP_PACKET & DUMP_SDU_ALL)
- printk_hex(data, len);
- #else
- #if (DUMP_PACKET & DUMP_SDU_ARP)
- if (protocol == ETH_P_ARP)
- printk_hex(data, len);
- #endif
- #if (DUMP_PACKET & DUMP_SDU_IP)
- if (protocol == ETH_P_IP || protocol == ETH_P_IPV6)
- printk_hex(data, len);
- #else
- #if (DUMP_PACKET & DUMP_SDU_IP_TCP)
- if (ip_protocol == IPPROTO_TCP)
- printk_hex(data, len);
- #endif
- #if (DUMP_PACKET & DUMP_SDU_IP_UDP)
- if (ip_protocol == IPPROTO_UDP)
- printk_hex(data, len);
- #endif
- #if (DUMP_PACKET & DUMP_SDU_IP_ICMP)
- if (ip_protocol == IPPROTO_ICMP)
- printk_hex(data, len);
- #endif
- #endif
- #endif
+ print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, data, len, false);
}
#endif
};
-
-#if 0
-#define dprintk(fmt, args ...) printk(KERN_DEBUG " [GDM] " fmt, ## args)
-#else
-#define dprintk(...)
-#endif
-
/*#define DEBUG_SDU */
-#if defined(DEBUG_SDU)
-#define DUMP_SDU_ALL (1<<0)
-#define DUMP_SDU_ARP (1<<1)
-#define DUMP_SDU_IP (1<<2)
-#define DUMP_SDU_IP_TCP (1<<8)
-#define DUMP_SDU_IP_UDP (1<<9)
-#define DUMP_SDU_IP_ICMP (1<<10)
-#define DUMP_PACKET (DUMP_SDU_ALL)
-#endif
/*#define DEBUG_HCI */