staging: gdm72xx: use print_hex_dump_debug and remove debug macros
Since the kernel already has a function for hex dumps, use that instead of the driver's own versions. The function supports dynamic debugging, so also remove some unnecessary debug macros. Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
This commit is contained in:
parent
35db0350c5
commit
4db0243565
|
@ -43,21 +43,6 @@
|
||||||
static int init_sdio(struct sdiowm_dev *sdev);
|
static int init_sdio(struct sdiowm_dev *sdev);
|
||||||
static void release_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)
|
static struct sdio_tx *alloc_tx_struct(struct tx_cxt *tx)
|
||||||
{
|
{
|
||||||
struct sdio_tx *t = kzalloc(sizeof(*t), GFP_ATOMIC);
|
struct sdio_tx *t = kzalloc(sizeof(*t), GFP_ATOMIC);
|
||||||
|
@ -297,10 +282,9 @@ static void send_sdu(struct sdio_func *func, struct tx_cxt *tx)
|
||||||
|
|
||||||
spin_unlock_irqrestore(&tx->lock, flags);
|
spin_unlock_irqrestore(&tx->lock, flags);
|
||||||
|
|
||||||
#ifdef DEBUG
|
print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
|
||||||
hexdump("sdio_send", tx->sdu_buf + TYPE_A_HEADER_SIZE,
|
tx->sdu_buf + TYPE_A_HEADER_SIZE,
|
||||||
aggr_len - TYPE_A_HEADER_SIZE);
|
aggr_len - TYPE_A_HEADER_SIZE, false);
|
||||||
#endif
|
|
||||||
|
|
||||||
for (pos = TYPE_A_HEADER_SIZE; pos < aggr_len; pos += TX_CHUNK_SIZE) {
|
for (pos = TYPE_A_HEADER_SIZE; pos < aggr_len; pos += TX_CHUNK_SIZE) {
|
||||||
len = aggr_len - pos;
|
len = aggr_len - pos;
|
||||||
|
@ -335,10 +319,9 @@ static void send_hci(struct sdio_func *func, struct tx_cxt *tx,
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
#ifdef DEBUG
|
print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
|
||||||
hexdump("sdio_send", t->buf + TYPE_A_HEADER_SIZE,
|
t->buf + TYPE_A_HEADER_SIZE,
|
||||||
t->len - TYPE_A_HEADER_SIZE);
|
t->len - TYPE_A_HEADER_SIZE, false);
|
||||||
#endif
|
|
||||||
send_sdio_pkt(func, t->buf, t->len);
|
send_sdio_pkt(func, t->buf, t->len);
|
||||||
|
|
||||||
spin_lock_irqsave(&tx->lock, flags);
|
spin_lock_irqsave(&tx->lock, flags);
|
||||||
|
@ -579,9 +562,8 @@ static void gdm_sdio_irq(struct sdio_func *func)
|
||||||
}
|
}
|
||||||
|
|
||||||
end_io:
|
end_io:
|
||||||
#ifdef DEBUG
|
print_hex_dump_debug("sdio_receive: ", DUMP_PREFIX_NONE, 16, 1,
|
||||||
hexdump("sdio_receive", rx->rx_buf, len);
|
rx->rx_buf, len, false);
|
||||||
#endif
|
|
||||||
len = control_sdu_tx_flow(sdev, rx->rx_buf, len);
|
len = control_sdu_tx_flow(sdev, rx->rx_buf, len);
|
||||||
|
|
||||||
spin_lock_irqsave(&rx->lock, flags);
|
spin_lock_irqsave(&rx->lock, flags);
|
||||||
|
|
|
@ -56,20 +56,6 @@ static int init_usb(struct usbwm_dev *udev);
|
||||||
static void release_usb(struct usbwm_dev *udev);
|
static void release_usb(struct usbwm_dev *udev);
|
||||||
|
|
||||||
/*#define DEBUG */
|
/*#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)
|
static struct usb_tx *alloc_tx_struct(struct tx_cxt *tx)
|
||||||
{
|
{
|
||||||
|
@ -368,9 +354,8 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
|
||||||
gdm_usb_send_complete,
|
gdm_usb_send_complete,
|
||||||
t);
|
t);
|
||||||
|
|
||||||
#ifdef DEBUG
|
print_hex_dump_debug("usb_send: ", DUMP_PREFIX_NONE, 16, 1,
|
||||||
hexdump("usb_send", t->buf, len + padding);
|
t->buf, len + padding, false);
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_WIMAX_GDM72XX_USB_PM
|
#ifdef CONFIG_WIMAX_GDM72XX_USB_PM
|
||||||
if (usbdev->state & USB_STATE_SUSPENDED) {
|
if (usbdev->state & USB_STATE_SUSPENDED) {
|
||||||
list_add_tail(&t->p_list, &tx->pending_list);
|
list_add_tail(&t->p_list, &tx->pending_list);
|
||||||
|
@ -451,9 +436,8 @@ static void gdm_usb_rcv_complete(struct urb *urb)
|
||||||
|
|
||||||
if (!urb->status) {
|
if (!urb->status) {
|
||||||
cmd_evt = (r->buf[0] << 8) | (r->buf[1]);
|
cmd_evt = (r->buf[0] << 8) | (r->buf[1]);
|
||||||
#ifdef DEBUG
|
print_hex_dump_debug("usb_receive: ", DUMP_PREFIX_NONE, 16, 1,
|
||||||
hexdump("usb_receive", r->buf, urb->actual_length);
|
r->buf, urb->actual_length, false);
|
||||||
#endif
|
|
||||||
if (cmd_evt == WIMAX_SDU_TX_FLOW) {
|
if (cmd_evt == WIMAX_SDU_TX_FLOW) {
|
||||||
if (r->buf[4] == 0) {
|
if (r->buf[4] == 0) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
|
@ -63,20 +63,6 @@ static void gdm_wimax_ind_fsm_update(struct net_device *dev, struct fsm_s *fsm);
|
||||||
static void gdm_wimax_ind_if_updown(struct net_device *dev, int if_up);
|
static void gdm_wimax_ind_if_updown(struct net_device *dev, int if_up);
|
||||||
|
|
||||||
#if defined(DEBUG_SDU)
|
#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 const char *get_protocol_name(u16 protocol)
|
||||||
{
|
{
|
||||||
static char buf[32];
|
static char buf[32];
|
||||||
|
@ -175,31 +161,7 @@ static void dump_eth_packet(const char *title, u8 *data, int len)
|
||||||
printk(KERN_DEBUG " src=%pI6\n", &ih->saddr);
|
printk(KERN_DEBUG " src=%pI6\n", &ih->saddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (DUMP_PACKET & DUMP_SDU_ALL)
|
print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, data, len, false);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -62,23 +62,7 @@ struct nic {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define dprintk(fmt, args ...) printk(KERN_DEBUG " [GDM] " fmt, ## args)
|
|
||||||
#else
|
|
||||||
#define dprintk(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*#define DEBUG_SDU */
|
/*#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 */
|
/*#define DEBUG_HCI */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue