| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * File Name: |
|---|
| 3 | 4 | * skfddi.c |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Copyright Information: |
|---|
| 6 | 7 | * Copyright SysKonnect 1998,1999. |
|---|
| 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 as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | 8 | * |
|---|
| 13 | 9 | * The information in this file is provided "AS IS" without warranty. |
|---|
| 14 | 10 | * |
|---|
| .. | .. |
|---|
| 409 | 405 | if (bp->SharedMemSize > 0) { |
|---|
| 410 | 406 | bp->SharedMemSize += 16; // for descriptor alignment |
|---|
| 411 | 407 | |
|---|
| 412 | | - bp->SharedMemAddr = dma_zalloc_coherent(&bp->pdev.dev, |
|---|
| 413 | | - bp->SharedMemSize, |
|---|
| 414 | | - &bp->SharedMemDMA, |
|---|
| 415 | | - GFP_ATOMIC); |
|---|
| 408 | + bp->SharedMemAddr = dma_alloc_coherent(&bp->pdev.dev, |
|---|
| 409 | + bp->SharedMemSize, |
|---|
| 410 | + &bp->SharedMemDMA, |
|---|
| 411 | + GFP_ATOMIC); |
|---|
| 416 | 412 | if (!bp->SharedMemAddr) { |
|---|
| 417 | 413 | printk("could not allocate mem for "); |
|---|
| 418 | 414 | printk("hardware module: %ld byte\n", |
|---|
| .. | .. |
|---|
| 1524 | 1520 | #ifdef DUMPPACKETS |
|---|
| 1525 | 1521 | void dump_data(unsigned char *Data, int length) |
|---|
| 1526 | 1522 | { |
|---|
| 1527 | | - int i, j; |
|---|
| 1528 | | - unsigned char s[255], sh[10]; |
|---|
| 1529 | | - if (length > 64) { |
|---|
| 1530 | | - length = 64; |
|---|
| 1531 | | - } |
|---|
| 1532 | 1523 | printk(KERN_INFO "---Packet start---\n"); |
|---|
| 1533 | | - for (i = 0, j = 0; i < length / 8; i++, j += 8) |
|---|
| 1534 | | - printk(KERN_INFO "%02x %02x %02x %02x %02x %02x %02x %02x\n", |
|---|
| 1535 | | - Data[j + 0], Data[j + 1], Data[j + 2], Data[j + 3], |
|---|
| 1536 | | - Data[j + 4], Data[j + 5], Data[j + 6], Data[j + 7]); |
|---|
| 1537 | | - strcpy(s, ""); |
|---|
| 1538 | | - for (i = 0; i < length % 8; i++) { |
|---|
| 1539 | | - sprintf(sh, "%02x ", Data[j + i]); |
|---|
| 1540 | | - strcat(s, sh); |
|---|
| 1541 | | - } |
|---|
| 1542 | | - printk(KERN_INFO "%s\n", s); |
|---|
| 1524 | + print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, Data, min_t(size_t, length, 64), false); |
|---|
| 1543 | 1525 | printk(KERN_INFO "------------------\n"); |
|---|
| 1544 | 1526 | } // dump_data |
|---|
| 1545 | 1527 | #else |
|---|