hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/net/ethernet/broadcom/bcmsysport.h
....@@ -1,11 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Broadcom BCM7xxx System Port Ethernet MAC driver
34 *
45 * Copyright (C) 2014 Broadcom Corporation
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107
118 #ifndef __BCM_SYSPORT_H
....@@ -14,7 +11,7 @@
1411 #include <linux/bitmap.h>
1512 #include <linux/ethtool.h>
1613 #include <linux/if_vlan.h>
17
-#include <linux/net_dim.h>
14
+#include <linux/dim.h>
1815
1916 /* Receive/transmit descriptor format */
2017 #define DESC_ADDR_HI_STATUS_LEN 0x00
....@@ -516,12 +513,6 @@
516513
517514 #define TDMA_DEBUG 0x64c
518515
519
-/* Transmit/Receive descriptor */
520
-struct dma_desc {
521
- u32 addr_status_len;
522
- u32 addr_lo;
523
-};
524
-
525516 /* Number of Receive hardware descriptor words */
526517 #define SP_NUM_HW_RX_DESC_WORDS 1024
527518 #define SP_LT_NUM_HW_RX_DESC_WORDS 256
....@@ -530,7 +521,7 @@
530521 #define SP_NUM_TX_DESC 1536
531522 #define SP_LT_NUM_TX_DESC 256
532523
533
-#define WORDS_PER_DESC (sizeof(struct dma_desc) / sizeof(u32))
524
+#define WORDS_PER_DESC 2
534525
535526 /* Rx/Tx common counter group.*/
536527 struct bcm_sysport_pkt_counters {
....@@ -608,6 +599,8 @@
608599 u32 alloc_rx_buff_failed;
609600 u32 rx_dma_failed;
610601 u32 tx_dma_failed;
602
+ u32 tx_realloc_tsb;
603
+ u32 tx_realloc_tsb_failed;
611604 };
612605
613606 /* HW maintains a large list of counters */
....@@ -709,14 +702,13 @@
709702 u16 event_ctr;
710703 unsigned long packets;
711704 unsigned long bytes;
712
- struct net_dim dim;
705
+ struct dim dim;
713706 };
714707
715708 /* Software view of the TX ring */
716709 struct bcm_sysport_tx_ring {
717710 spinlock_t lock; /* Ring lock for tx reclaim/xmit */
718711 struct napi_struct napi; /* NAPI per tx queue */
719
- dma_addr_t desc_dma; /* DMA cookie */
720712 unsigned int index; /* Ring index */
721713 unsigned int size; /* Ring current size */
722714 unsigned int alloc_size; /* Ring one-time allocated size */
....@@ -725,7 +717,6 @@
725717 unsigned int c_index; /* Last consumer index */
726718 unsigned int clean_index; /* Current clean index */
727719 struct bcm_sysport_cb *cbs; /* Transmit control blocks */
728
- struct dma_desc *desc_cpu; /* CPU view of the descriptor */
729720 struct bcm_sysport_priv *priv; /* private context backpointer */
730721 unsigned long packets; /* packets statistics */
731722 unsigned long bytes; /* bytes statistics */
....@@ -780,6 +771,8 @@
780771 u32 wolopts;
781772 u8 sopass[SOPASS_MAX];
782773 unsigned int wol_irq_disabled:1;
774
+ struct clk *clk;
775
+ struct clk *wol_clk;
783776
784777 /* MIB related fields */
785778 struct bcm_sysport_mib mib;
....@@ -787,6 +780,7 @@
787780 /* Ethtool */
788781 u32 msg_enable;
789782 DECLARE_BITMAP(filters, RXCHK_BRCM_TAG_MAX);
783
+ u32 filters_loc[RXCHK_BRCM_TAG_MAX];
790784
791785 struct bcm_sysport_stats64 stats64;
792786
....@@ -796,7 +790,6 @@
796790 /* map information between switch port queues and local queues */
797791 struct notifier_block dsa_notifier;
798792 unsigned int per_port_num_tx_queues;
799
- unsigned long queue_bitmap;
800793 struct bcm_sysport_tx_ring *ring_map[DSA_MAX_PORTS * 8];
801794
802795 };