struct rte_eth_link *dev_link = &dev->data->dev_link;
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
- switch (cgmii_link_speed(ibuf)) {
+ switch (get_link_speed(ibuf)) {
case SZEDATA2_LINK_SPEED_10G:
link.link_speed = ETH_SPEED_NUM_10G;
break;
/* szedata2 uses only full duplex */
link.link_duplex = ETH_LINK_FULL_DUPLEX;
- link.link_status = (cgmii_ibuf_is_enabled(ibuf) &&
- cgmii_ibuf_is_link_up(ibuf)) ? ETH_LINK_UP : ETH_LINK_DOWN;
+ link.link_status = (ibuf_is_enabled(ibuf) &&
+ ibuf_is_link_up(ibuf)) ? ETH_LINK_UP : ETH_LINK_DOWN;
link.link_autoneg = ETH_LINK_SPEED_FIXED;
{
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
- volatile struct szedata2_cgmii_obuf *obuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_OBUF_BASE_OFF,
- volatile struct szedata2_cgmii_obuf *);
-
- cgmii_ibuf_enable(ibuf);
- cgmii_obuf_enable(obuf);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
+ volatile struct szedata2_obuf *obuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_OBUF_BASE_OFF,
+ volatile struct szedata2_obuf *);
+
+ ibuf_enable(ibuf);
+ obuf_enable(obuf);
return 0;
}
{
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
- volatile struct szedata2_cgmii_obuf *obuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_OBUF_BASE_OFF,
- volatile struct szedata2_cgmii_obuf *);
-
- cgmii_ibuf_disable(ibuf);
- cgmii_obuf_disable(obuf);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
+ volatile struct szedata2_obuf *obuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_OBUF_BASE_OFF,
+ volatile struct szedata2_obuf *);
+
+ ibuf_disable(ibuf);
+ obuf_disable(obuf);
return 0;
}
{
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
- cgmii_ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_PROMISC);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
+ ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_PROMISC);
}
static void
{
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
- cgmii_ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ONLY_VALID);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
+ ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ONLY_VALID);
}
static void
{
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
- cgmii_ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ALL_MULTICAST);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
+ ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ALL_MULTICAST);
}
static void
{
struct pmd_internals *internals = (struct pmd_internals *)
dev->data->dev_private;
- volatile struct szedata2_cgmii_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
- internals->pci_rsc, SZEDATA2_CGMII_IBUF_BASE_OFF,
- volatile struct szedata2_cgmii_ibuf *);
- cgmii_ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ONLY_VALID);
+ volatile struct szedata2_ibuf *ibuf = SZEDATA2_PCI_RESOURCE_PTR(
+ internals->pci_rsc, SZEDATA2_IBUF_BASE_OFF,
+ volatile struct szedata2_ibuf *);
+ ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ONLY_VALID);
}
static const struct eth_dev_ops ops = {
};
/*
- * Structure describes CGMII IBUF address space
+ * Structure describes IBUF address space
*/
-struct szedata2_cgmii_ibuf {
+struct szedata2_ibuf {
/** Total Received Frames Counter low part */
uint32_t trfcl;
/** Correct Frames Counter low part */
uint32_t oroch;
} __rte_packed;
-/* Offset of CGMII IBUF memory for MAC addresses */
-#define SZEDATA2_CGMII_IBUF_MAC_MEM_OFF 0x80
+/* Offset of IBUF memory for MAC addresses */
+#define SZEDATA2_IBUF_MAC_MEM_OFF 0x80
/*
* @return
* false if IBUF is disabled
*/
static inline bool
-cgmii_ibuf_is_enabled(volatile struct szedata2_cgmii_ibuf *ibuf)
+ibuf_is_enabled(volatile struct szedata2_ibuf *ibuf)
{
return ((rte_le_to_cpu_32(ibuf->ibuf_en) & 0x1) != 0) ? true : false;
}
* Enables IBUF.
*/
static inline void
-cgmii_ibuf_enable(volatile struct szedata2_cgmii_ibuf *ibuf)
+ibuf_enable(volatile struct szedata2_ibuf *ibuf)
{
ibuf->ibuf_en =
rte_cpu_to_le_32(rte_le_to_cpu_32(ibuf->ibuf_en) | 0x1);
* Disables IBUF.
*/
static inline void
-cgmii_ibuf_disable(volatile struct szedata2_cgmii_ibuf *ibuf)
+ibuf_disable(volatile struct szedata2_ibuf *ibuf)
{
ibuf->ibuf_en =
rte_cpu_to_le_32(rte_le_to_cpu_32(ibuf->ibuf_en) & ~0x1);
* false if ibuf link is down
*/
static inline bool
-cgmii_ibuf_is_link_up(volatile struct szedata2_cgmii_ibuf *ibuf)
+ibuf_is_link_up(volatile struct szedata2_ibuf *ibuf)
{
return ((rte_le_to_cpu_32(ibuf->ibuf_st) & 0x80) != 0) ? true : false;
}
* MAC address check mode
*/
static inline enum szedata2_mac_check_mode
-cgmii_ibuf_mac_mode_read(volatile struct szedata2_cgmii_ibuf *ibuf)
+ibuf_mac_mode_read(volatile struct szedata2_ibuf *ibuf)
{
switch (rte_le_to_cpu_32(ibuf->mac_chmode) & 0x3) {
case 0x0:
* Writes "mode" in MAC address check mode register.
*/
static inline void
-cgmii_ibuf_mac_mode_write(volatile struct szedata2_cgmii_ibuf *ibuf,
+ibuf_mac_mode_write(volatile struct szedata2_ibuf *ibuf,
enum szedata2_mac_check_mode mode)
{
ibuf->mac_chmode = rte_cpu_to_le_32(
}
/*
- * Structure describes CGMII OBUF address space
+ * Structure describes OBUF address space
*/
-struct szedata2_cgmii_obuf {
+struct szedata2_obuf {
/** Total Sent Frames Counter low part */
uint32_t tsfcl;
/** Octets Sent Counter low part */
* false if OBUF is disabled
*/
static inline bool
-cgmii_obuf_is_enabled(volatile struct szedata2_cgmii_obuf *obuf)
+obuf_is_enabled(volatile struct szedata2_obuf *obuf)
{
return ((rte_le_to_cpu_32(obuf->obuf_en) & 0x1) != 0) ? true : false;
}
* Enables OBUF.
*/
static inline void
-cgmii_obuf_enable(volatile struct szedata2_cgmii_obuf *obuf)
+obuf_enable(volatile struct szedata2_obuf *obuf)
{
obuf->obuf_en =
rte_cpu_to_le_32(rte_le_to_cpu_32(obuf->obuf_en) | 0x1);
* Disables OBUF.
*/
static inline void
-cgmii_obuf_disable(volatile struct szedata2_cgmii_obuf *obuf)
+obuf_disable(volatile struct szedata2_obuf *obuf)
{
obuf->obuf_en =
rte_cpu_to_le_32(rte_le_to_cpu_32(obuf->obuf_en) & ~0x1);
* @return Link speed constant.
*/
static inline enum szedata2_link_speed
-cgmii_link_speed(volatile struct szedata2_cgmii_ibuf *ibuf)
+get_link_speed(volatile struct szedata2_ibuf *ibuf)
{
uint32_t speed = (rte_le_to_cpu_32(ibuf->ibuf_st) & 0x70) >> 4;
switch (speed) {
#elif RTE_LIBRTE_PMD_SZEDATA2_AS == 0
/*
- * CGMII IBUF offset from the beginning of PCI resource address space.
+ * IBUF offset from the beginning of PCI resource address space.
*/
-#define SZEDATA2_CGMII_IBUF_BASE_OFF 0x8000
+#define SZEDATA2_IBUF_BASE_OFF 0x8000
/*
- * Size of CGMII IBUF.
+ * Size of IBUF.
*/
-#define SZEDATA2_CGMII_IBUF_SIZE 0x200
+#define SZEDATA2_IBUF_SIZE 0x200
/*
- * GCMII OBUF offset from the beginning of PCI resource address space.
+ * OBUF offset from the beginning of PCI resource address space.
*/
-#define SZEDATA2_CGMII_OBUF_BASE_OFF 0x9000
+#define SZEDATA2_OBUF_BASE_OFF 0x9000
/*
- * Size of CGMII OBUF.
+ * Size of OBUF.
*/
-#define SZEDATA2_CGMII_OBUF_SIZE 0x100
+#define SZEDATA2_OBUF_SIZE 0x100
#else
#error "RTE_LIBRTE_PMD_SZEDATA2_AS has wrong value, see comments in config file"