| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Network device driver for Cell Processor-Based Blade and Celleb platform |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Authors : Utz Bacher <utz.bacher@de.ibm.com> |
|---|
| 8 | 9 | * Jens Osterkamp <Jens.Osterkamp@de.ibm.com> |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 12 | | - * the Free Software Foundation; either version 2, or (at your option) |
|---|
| 13 | | - * any later version. |
|---|
| 14 | | - * |
|---|
| 15 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 18 | | - * GNU General Public License for more details. |
|---|
| 19 | | - * |
|---|
| 20 | | - * You should have received a copy of the GNU General Public License |
|---|
| 21 | | - * along with this program; if not, write to the Free Software |
|---|
| 22 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 23 | 10 | */ |
|---|
| 24 | 11 | |
|---|
| 25 | 12 | #include <linux/compiler.h> |
|---|
| .. | .. |
|---|
| 326 | 313 | &chain->dma_addr, GFP_KERNEL); |
|---|
| 327 | 314 | if (!chain->hwring) |
|---|
| 328 | 315 | return -ENOMEM; |
|---|
| 329 | | - |
|---|
| 330 | | - memset(chain->ring, 0, chain->num_desc * sizeof(struct spider_net_descr)); |
|---|
| 331 | 316 | |
|---|
| 332 | 317 | /* Set up the hardware pointers in each descriptor */ |
|---|
| 333 | 318 | descr = chain->ring; |
|---|
| .. | .. |
|---|
| 801 | 786 | /* fallthrough, if we release the descriptors |
|---|
| 802 | 787 | * brutally (then we don't care about |
|---|
| 803 | 788 | * SPIDER_NET_DESCR_CARDOWNED) */ |
|---|
| 789 | + fallthrough; |
|---|
| 804 | 790 | |
|---|
| 805 | 791 | case SPIDER_NET_DESCR_RESPONSE_ERROR: |
|---|
| 806 | 792 | case SPIDER_NET_DESCR_PROTECTION_ERROR: |
|---|
| .. | .. |
|---|
| 1411 | 1397 | show_error = 0; |
|---|
| 1412 | 1398 | break; |
|---|
| 1413 | 1399 | |
|---|
| 1414 | | - case SPIDER_NET_GDDDEN0INT: /* fallthrough */ |
|---|
| 1415 | | - case SPIDER_NET_GDCDEN0INT: /* fallthrough */ |
|---|
| 1416 | | - case SPIDER_NET_GDBDEN0INT: /* fallthrough */ |
|---|
| 1400 | + case SPIDER_NET_GDDDEN0INT: |
|---|
| 1401 | + case SPIDER_NET_GDCDEN0INT: |
|---|
| 1402 | + case SPIDER_NET_GDBDEN0INT: |
|---|
| 1417 | 1403 | case SPIDER_NET_GDADEN0INT: |
|---|
| 1418 | 1404 | /* someone has set RX_DMA_EN to 0 */ |
|---|
| 1419 | 1405 | show_error = 0; |
|---|
| .. | .. |
|---|
| 1463 | 1449 | * Logging is not needed. */ |
|---|
| 1464 | 1450 | show_error = 0; |
|---|
| 1465 | 1451 | break; |
|---|
| 1466 | | - case SPIDER_NET_GRFDFLLINT: /* fallthrough */ |
|---|
| 1467 | | - case SPIDER_NET_GRFCFLLINT: /* fallthrough */ |
|---|
| 1468 | | - case SPIDER_NET_GRFBFLLINT: /* fallthrough */ |
|---|
| 1469 | | - case SPIDER_NET_GRFAFLLINT: /* fallthrough */ |
|---|
| 1452 | + case SPIDER_NET_GRFDFLLINT: |
|---|
| 1453 | + case SPIDER_NET_GRFCFLLINT: |
|---|
| 1454 | + case SPIDER_NET_GRFBFLLINT: |
|---|
| 1455 | + case SPIDER_NET_GRFAFLLINT: |
|---|
| 1470 | 1456 | case SPIDER_NET_GRMFLLINT: |
|---|
| 1471 | 1457 | /* Could happen when rx chain is full */ |
|---|
| 1472 | 1458 | if (card->ignore_rx_ramfull == 0) { |
|---|
| .. | .. |
|---|
| 1487 | 1473 | break; |
|---|
| 1488 | 1474 | |
|---|
| 1489 | 1475 | /* chain end */ |
|---|
| 1490 | | - case SPIDER_NET_GDDDCEINT: /* fallthrough */ |
|---|
| 1491 | | - case SPIDER_NET_GDCDCEINT: /* fallthrough */ |
|---|
| 1492 | | - case SPIDER_NET_GDBDCEINT: /* fallthrough */ |
|---|
| 1476 | + case SPIDER_NET_GDDDCEINT: |
|---|
| 1477 | + case SPIDER_NET_GDCDCEINT: |
|---|
| 1478 | + case SPIDER_NET_GDBDCEINT: |
|---|
| 1493 | 1479 | case SPIDER_NET_GDADCEINT: |
|---|
| 1494 | 1480 | spider_net_resync_head_ptr(card); |
|---|
| 1495 | 1481 | spider_net_refill_rx_chain(card); |
|---|
| .. | .. |
|---|
| 1500 | 1486 | break; |
|---|
| 1501 | 1487 | |
|---|
| 1502 | 1488 | /* invalid descriptor */ |
|---|
| 1503 | | - case SPIDER_NET_GDDINVDINT: /* fallthrough */ |
|---|
| 1504 | | - case SPIDER_NET_GDCINVDINT: /* fallthrough */ |
|---|
| 1505 | | - case SPIDER_NET_GDBINVDINT: /* fallthrough */ |
|---|
| 1489 | + case SPIDER_NET_GDDINVDINT: |
|---|
| 1490 | + case SPIDER_NET_GDCINVDINT: |
|---|
| 1491 | + case SPIDER_NET_GDBINVDINT: |
|---|
| 1506 | 1492 | case SPIDER_NET_GDAINVDINT: |
|---|
| 1507 | 1493 | /* Could happen when rx chain is full */ |
|---|
| 1508 | 1494 | spider_net_resync_head_ptr(card); |
|---|
| .. | .. |
|---|
| 1627 | 1613 | * spider_net_poll_controller - artificial interrupt for netconsole etc. |
|---|
| 1628 | 1614 | * @netdev: interface device structure |
|---|
| 1629 | 1615 | * |
|---|
| 1630 | | - * see Documentation/networking/netconsole.txt |
|---|
| 1616 | + * see Documentation/networking/netconsole.rst |
|---|
| 1631 | 1617 | */ |
|---|
| 1632 | 1618 | static void |
|---|
| 1633 | 1619 | spider_net_poll_controller(struct net_device *netdev) |
|---|
| .. | .. |
|---|
| 2192 | 2178 | * called, if tx hangs. Schedules a task that resets the interface |
|---|
| 2193 | 2179 | */ |
|---|
| 2194 | 2180 | static void |
|---|
| 2195 | | -spider_net_tx_timeout(struct net_device *netdev) |
|---|
| 2181 | +spider_net_tx_timeout(struct net_device *netdev, unsigned int txqueue) |
|---|
| 2196 | 2182 | { |
|---|
| 2197 | 2183 | struct spider_net_card *card; |
|---|
| 2198 | 2184 | |
|---|
| .. | .. |
|---|
| 2323 | 2309 | { |
|---|
| 2324 | 2310 | struct net_device *netdev; |
|---|
| 2325 | 2311 | struct spider_net_card *card; |
|---|
| 2326 | | - size_t alloc_size; |
|---|
| 2327 | 2312 | |
|---|
| 2328 | | - alloc_size = sizeof(struct spider_net_card) + |
|---|
| 2329 | | - (tx_descriptors + rx_descriptors) * sizeof(struct spider_net_descr); |
|---|
| 2330 | | - netdev = alloc_etherdev(alloc_size); |
|---|
| 2313 | + netdev = alloc_etherdev(struct_size(card, darray, |
|---|
| 2314 | + tx_descriptors + rx_descriptors)); |
|---|
| 2331 | 2315 | if (!netdev) |
|---|
| 2332 | 2316 | return NULL; |
|---|
| 2333 | 2317 | |
|---|