hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/net/ethernet/ibm/emac/core.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * drivers/net/ethernet/ibm/emac/core.h
34 *
....@@ -15,12 +16,6 @@
1516 * Armin Kuster <akuster@mvista.com>
1617 * Johnnie Peters <jpeters@mvista.com>
1718 * Copyright 2000, 2001 MontaVista Softare Inc.
18
- *
19
- * This program is free software; you can redistribute it and/or modify it
20
- * under the terms of the GNU General Public License as published by the
21
- * Free Software Foundation; either version 2 of the License, or (at your
22
- * option) any later version.
23
- *
2419 */
2520 #ifndef __IBM_NEWEMAC_CORE_H
2621 #define __IBM_NEWEMAC_CORE_H
....@@ -68,22 +63,18 @@
6863 return mal_rx_size(ETH_DATA_LEN + EMAC_MTU_OVERHEAD);
6964 }
7065
71
-#define EMAC_DMA_ALIGN(x) ALIGN((x), dma_get_cache_alignment())
72
-
73
-#define EMAC_RX_SKB_HEADROOM \
74
- EMAC_DMA_ALIGN(CONFIG_IBM_EMAC_RX_SKB_HEADROOM)
75
-
7666 /* Size of RX skb for the given MTU */
7767 static inline int emac_rx_skb_size(int mtu)
7868 {
7969 int size = max(mtu + EMAC_MTU_OVERHEAD, emac_rx_size(mtu));
80
- return EMAC_DMA_ALIGN(size + 2) + EMAC_RX_SKB_HEADROOM;
70
+
71
+ return SKB_DATA_ALIGN(size + NET_IP_ALIGN) + NET_SKB_PAD;
8172 }
8273
8374 /* RX DMA sync size */
8475 static inline int emac_rx_sync_size(int mtu)
8576 {
86
- return EMAC_DMA_ALIGN(emac_rx_size(mtu) + 2);
77
+ return SKB_DATA_ALIGN(emac_rx_size(mtu) + NET_IP_ALIGN);
8778 }
8879
8980 /* Driver statistcs is split into two parts to make it more cache friendly:
....@@ -180,7 +171,7 @@
180171 struct mal_commac commac;
181172
182173 /* PHY infos */
183
- int phy_mode;
174
+ phy_interface_t phy_mode;
184175 u32 phy_map;
185176 u32 phy_address;
186177 u32 phy_feat_exc;
....@@ -390,6 +381,9 @@
390381 #define EMAC4SYNC_XAHT_SLOTS_SHIFT 8
391382 #define EMAC4SYNC_XAHT_WIDTH_SHIFT 5
392383
384
+/* The largest span between slots and widths above is 3 */
385
+#define EMAC_XAHT_MAX_REGS (1 << 3)
386
+
393387 #define EMAC_XAHT_SLOTS(dev) (1 << (dev)->xaht_slots_shift)
394388 #define EMAC_XAHT_WIDTH(dev) (1 << (dev)->xaht_width_shift)
395389 #define EMAC_XAHT_REGS(dev) (1 << ((dev)->xaht_slots_shift - \