]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Split i40e_osdep.h
authorIvan Vecera <ivecera@redhat.com>
Wed, 27 Sep 2023 08:31:33 +0000 (10:31 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 5 Oct 2023 16:13:43 +0000 (09:13 -0700)
Header i40e_osdep.h contains only IO primitives and couple of debug
printing macros. Split this header file to i40e_io.h and i40e_debug.h
and move i40e_debug_mask enum to i40e_debug.h

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.h
drivers/net/ethernet/intel/i40e/i40e_debug.h [new file with mode: 0644]
drivers/net/ethernet/intel/i40e/i40e_hmc.c
drivers/net/ethernet/intel/i40e/i40e_io.h [new file with mode: 0644]
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
drivers/net/ethernet/intel/i40e/i40e_osdep.h [deleted file]
drivers/net/ethernet/intel/i40e/i40e_prototype.h
drivers/net/ethernet/intel/i40e/i40e_type.h

index 1c3d2bc5c3f79fa77d52c6eb3c0cb7fe292de6d2..80125bea80a2a0b340c0747c5225657875a11035 100644 (file)
@@ -4,8 +4,8 @@
 #ifndef _I40E_ADMINQ_H_
 #define _I40E_ADMINQ_H_
 
+#include <linux/mutex.h>
 #include "i40e_alloc.h"
-#include "i40e_osdep.h"
 #include "i40e_adminq_cmd.h"
 
 #define I40E_ADMINQ_DESC(R, i)   \
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debug.h b/drivers/net/ethernet/intel/i40e/i40e_debug.h
new file mode 100644 (file)
index 0000000..27ebc72
--- /dev/null
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright(c) 2023 Intel Corporation. */
+
+#ifndef _I40E_DEBUG_H_
+#define _I40E_DEBUG_H_
+
+#include <linux/dev_printk.h>
+
+/* debug masks - set these bits in hw->debug_mask to control output */
+enum i40e_debug_mask {
+       I40E_DEBUG_INIT                 = 0x00000001,
+       I40E_DEBUG_RELEASE              = 0x00000002,
+
+       I40E_DEBUG_LINK                 = 0x00000010,
+       I40E_DEBUG_PHY                  = 0x00000020,
+       I40E_DEBUG_HMC                  = 0x00000040,
+       I40E_DEBUG_NVM                  = 0x00000080,
+       I40E_DEBUG_LAN                  = 0x00000100,
+       I40E_DEBUG_FLOW                 = 0x00000200,
+       I40E_DEBUG_DCB                  = 0x00000400,
+       I40E_DEBUG_DIAG                 = 0x00000800,
+       I40E_DEBUG_FD                   = 0x00001000,
+       I40E_DEBUG_PACKAGE              = 0x00002000,
+       I40E_DEBUG_IWARP                = 0x00F00000,
+       I40E_DEBUG_AQ_MESSAGE           = 0x01000000,
+       I40E_DEBUG_AQ_DESCRIPTOR        = 0x02000000,
+       I40E_DEBUG_AQ_DESC_BUFFER       = 0x04000000,
+       I40E_DEBUG_AQ_COMMAND           = 0x06000000,
+       I40E_DEBUG_AQ                   = 0x0F000000,
+
+       I40E_DEBUG_USER                 = 0xF0000000,
+
+       I40E_DEBUG_ALL                  = 0xFFFFFFFF
+};
+
+struct i40e_hw;
+struct device *i40e_hw_to_dev(struct i40e_hw *hw);
+
+#define hw_dbg(hw, S, A...) dev_dbg(i40e_hw_to_dev(hw), S, ##A)
+
+#define i40e_debug(h, m, s, ...)                               \
+do {                                                           \
+       if (((m) & (h)->debug_mask))                            \
+               dev_info(i40e_hw_to_dev(hw), s, ##__VA_ARGS__); \
+} while (0)
+
+#endif /* _I40E_DEBUG_H_ */
index 7451d346ae83f55166d5e12976af7bf4136200cd..b383aea652f3eeb5f0376c3f422635fa9dda9f0d 100644 (file)
@@ -2,7 +2,6 @@
 /* Copyright(c) 2013 - 2018 Intel Corporation. */
 
 #include "i40e.h"
-#include "i40e_osdep.h"
 #include "i40e_register.h"
 #include "i40e_alloc.h"
 #include "i40e_hmc.h"
diff --git a/drivers/net/ethernet/intel/i40e/i40e_io.h b/drivers/net/ethernet/intel/i40e/i40e_io.h
new file mode 100644 (file)
index 0000000..2a2ed9a
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright(c) 2023 Intel Corporation. */
+
+#ifndef _I40E_IO_H_
+#define _I40E_IO_H_
+
+/* get readq/writeq support for 32 bit kernels, use the low-first version */
+#include <linux/io-64-nonatomic-lo-hi.h>
+
+#define wr32(a, reg, value)    writel((value), ((a)->hw_addr + (reg)))
+#define rd32(a, reg)           readl((a)->hw_addr + (reg))
+
+#define rd64(a, reg)           readq((a)->hw_addr + (reg))
+#define i40e_flush(a)          readl((a)->hw_addr + I40E_GLGEN_STAT)
+
+#endif /* _I40E_IO_H_ */
index 474365bf0648042b0a3efeec1c583b210606fd5c..830f1de254ef48a97b89ef091a812462a466b815 100644 (file)
@@ -2,7 +2,6 @@
 /* Copyright(c) 2013 - 2018 Intel Corporation. */
 
 #include "i40e.h"
-#include "i40e_osdep.h"
 #include "i40e_register.h"
 #include "i40e_type.h"
 #include "i40e_hmc.h"
diff --git a/drivers/net/ethernet/intel/i40e/i40e_osdep.h b/drivers/net/ethernet/intel/i40e/i40e_osdep.h
deleted file mode 100644 (file)
index fd18895..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright(c) 2013 - 2018 Intel Corporation. */
-
-#ifndef _I40E_OSDEP_H_
-#define _I40E_OSDEP_H_
-
-#include <linux/types.h>
-#include <linux/if_ether.h>
-#include <linux/if_vlan.h>
-#include <linux/tcp.h>
-#include <linux/pci.h>
-#include <linux/highuid.h>
-
-/* get readq/writeq support for 32 bit kernels, use the low-first version */
-#include <linux/io-64-nonatomic-lo-hi.h>
-
-/* File to be the magic between shared code and
- * actual OS primitives
- */
-
-struct i40e_hw;
-struct device *i40e_hw_to_dev(struct i40e_hw *hw);
-
-#define hw_dbg(hw, S, A...) dev_dbg(i40e_hw_to_dev(hw), S, ##A)
-
-#define wr32(a, reg, value)    writel((value), ((a)->hw_addr + (reg)))
-#define rd32(a, reg)           readl((a)->hw_addr + (reg))
-
-#define rd64(a, reg)           readq((a)->hw_addr + (reg))
-#define i40e_flush(a)          readl((a)->hw_addr + I40E_GLGEN_STAT)
-
-#define i40e_debug(h, m, s, ...)                               \
-do {                                                           \
-       if (((m) & (h)->debug_mask))                            \
-               pr_info("i40e %02x:%02x.%x " s,                 \
-                       (h)->bus.bus_id, (h)->bus.device,       \
-                       (h)->bus.func, ##__VA_ARGS__);          \
-} while (0)
-
-#endif /* _I40E_OSDEP_H_ */
index 3eeee224f1fb29993b8b7ef863ac8de45b116b8c..9c9234c0706f090230d2a9d5d2623f46b06dffca 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "i40e_type.h"
 #include "i40e_alloc.h"
+#include "i40e_debug.h"
 #include <linux/avf/virtchnl.h>
 
 /* Prototypes for shared code functions that are not in
index 63cbf7669827ae8678430fcff1528d09bd87f05c..b3980b5b6919ed49d7b6abb19ed274710a895cf1 100644 (file)
@@ -4,7 +4,9 @@
 #ifndef _I40E_TYPE_H_
 #define _I40E_TYPE_H_
 
-#include "i40e_osdep.h"
+#include <linux/delay.h>
+#include <linux/if_ether.h>
+#include "i40e_io.h"
 #include "i40e_register.h"
 #include "i40e_adminq.h"
 #include "i40e_hmc.h"
@@ -40,33 +42,6 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
 #define I40E_QTX_CTL_VM_QUEUE  0x1
 #define I40E_QTX_CTL_PF_QUEUE  0x2
 
-/* debug masks - set these bits in hw->debug_mask to control output */
-enum i40e_debug_mask {
-       I40E_DEBUG_INIT                 = 0x00000001,
-       I40E_DEBUG_RELEASE              = 0x00000002,
-
-       I40E_DEBUG_LINK                 = 0x00000010,
-       I40E_DEBUG_PHY                  = 0x00000020,
-       I40E_DEBUG_HMC                  = 0x00000040,
-       I40E_DEBUG_NVM                  = 0x00000080,
-       I40E_DEBUG_LAN                  = 0x00000100,
-       I40E_DEBUG_FLOW                 = 0x00000200,
-       I40E_DEBUG_DCB                  = 0x00000400,
-       I40E_DEBUG_DIAG                 = 0x00000800,
-       I40E_DEBUG_FD                   = 0x00001000,
-       I40E_DEBUG_PACKAGE              = 0x00002000,
-       I40E_DEBUG_IWARP                = 0x00F00000,
-       I40E_DEBUG_AQ_MESSAGE           = 0x01000000,
-       I40E_DEBUG_AQ_DESCRIPTOR        = 0x02000000,
-       I40E_DEBUG_AQ_DESC_BUFFER       = 0x04000000,
-       I40E_DEBUG_AQ_COMMAND           = 0x06000000,
-       I40E_DEBUG_AQ                   = 0x0F000000,
-
-       I40E_DEBUG_USER                 = 0xF0000000,
-
-       I40E_DEBUG_ALL                  = 0xFFFFFFFF
-};
-
 #define I40E_MDIO_CLAUSE22_STCODE_MASK         I40E_GLGEN_MSCA_STCODE_MASK
 #define I40E_MDIO_CLAUSE22_OPCODE_WRITE_MASK   I40E_GLGEN_MSCA_OPCODE_MASK(1)
 #define I40E_MDIO_CLAUSE22_OPCODE_READ_MASK    I40E_GLGEN_MSCA_OPCODE_MASK(2)