#if !defined(__AVM_NET_CFG_HW211) #define __AVM_NET_CFG_HW211 #ifdef CONFIG_AVM_PA #include #include #include #endif #include #include #include "../phy/phy_11G.h" #include "../switch/ifx/common/swi_ifx_common.h" #include "../switch/ifx/7port/swi_7port.h" #include "../switch/ifx/7port/mac_7port.h" #include "../switch/atheros/atheros_mac.h" #include "../phy/avmnet_ar803x.h" extern avmnet_module_t hw211_avmnet_mac_7port_0; extern avmnet_module_t hw211_avmnet_mac_7port_1; extern avmnet_module_t hw211_avmnet_mac_7port_2; extern avmnet_module_t hw211_avmnet_mac_7port_3; extern avmnet_module_t hw211_avmnet_mac_7port_4; extern avmnet_module_t hw211_avmnet_mac_7port_5; avmnet_device_t hw211_avmnet_avm_device_0 = { .device = NULL, .device_name = "eth0", .external_port_no = 0, #if defined(CONFIG_AVM_SCATTER_GATHER) .net_dev_features = NETIF_F_SG | NETIF_F_IP_CSUM, #endif .device_ops = { .ndo_init = ifx_ppa_eth_init, .ndo_get_stats = avmnet_swi_7port_get_net_device_stats, .ndo_open = avmnet_netdev_open, .ndo_stop = avmnet_netdev_stop, .ndo_set_mac_address = ifx_ppa_eth_set_mac_address, .ndo_do_ioctl = ifx_ppa_eth_ioctl, .ndo_tx_timeout = ifx_ppa_eth_tx_timeout, .ndo_start_xmit = ifx_ppa_eth_hard_start_xmit }, .sizeof_priv = sizeof(avmnet_netdev_priv_t), .device_setup = ifx_ppa_setup_eth, .device_setup_priv = ifx_ppa_setup_priv, .flags = AVMNET_DEVICE_IFXPPA_ETH_LAN, .mac_module = &hw211_avmnet_mac_7port_3, }; avmnet_device_t hw211_avmnet_avm_device_1 = { .device = NULL, .device_name = "eth1", .external_port_no = 1, #if defined(CONFIG_AVM_SCATTER_GATHER) .net_dev_features = NETIF_F_SG | NETIF_F_IP_CSUM, #endif .device_ops = { .ndo_init = ifx_ppa_eth_init, .ndo_get_stats = avmnet_swi_7port_get_net_device_stats, .ndo_open = avmnet_netdev_open, .ndo_stop = avmnet_netdev_stop, .ndo_set_mac_address = ifx_ppa_eth_set_mac_address, .ndo_do_ioctl = ifx_ppa_eth_ioctl, .ndo_tx_timeout = ifx_ppa_eth_tx_timeout, .ndo_start_xmit = ifx_ppa_eth_hard_start_xmit }, .sizeof_priv = sizeof(avmnet_netdev_priv_t), .device_setup = ifx_ppa_setup_eth, .device_setup_priv = ifx_ppa_setup_priv, .flags = AVMNET_DEVICE_IFXPPA_ETH_LAN, .mac_module = &hw211_avmnet_mac_7port_1, }; avmnet_device_t hw211_avmnet_avm_device_2 = { .device = NULL, .device_name = "eth2", .external_port_no = 2, #if defined(CONFIG_AVM_SCATTER_GATHER) .net_dev_features = NETIF_F_SG | NETIF_F_IP_CSUM, #endif .device_ops = { .ndo_init = ifx_ppa_eth_init, .ndo_get_stats = avmnet_swi_7port_get_net_device_stats, .ndo_open = avmnet_netdev_open, .ndo_stop = avmnet_netdev_stop, .ndo_set_mac_address = ifx_ppa_eth_set_mac_address, .ndo_do_ioctl = ifx_ppa_eth_ioctl, .ndo_tx_timeout = ifx_ppa_eth_tx_timeout, .ndo_start_xmit = ifx_ppa_eth_hard_start_xmit }, .sizeof_priv = sizeof(avmnet_netdev_priv_t), .device_setup = ifx_ppa_setup_eth, .device_setup_priv = ifx_ppa_setup_priv, .flags = AVMNET_DEVICE_IFXPPA_ETH_LAN, .mac_module = &hw211_avmnet_mac_7port_4, }; avmnet_device_t hw211_avmnet_avm_device_3 = { .device = NULL, .device_name = "eth3", .external_port_no = 3, #if defined(CONFIG_AVM_SCATTER_GATHER) .net_dev_features = NETIF_F_SG | NETIF_F_IP_CSUM, #endif .device_ops = { .ndo_init = ifx_ppa_eth_init, .ndo_get_stats = avmnet_swi_7port_get_net_device_stats, .ndo_open = avmnet_netdev_open, .ndo_stop = avmnet_netdev_stop, .ndo_set_mac_address = ifx_ppa_eth_set_mac_address, .ndo_do_ioctl = ifx_ppa_eth_ioctl, .ndo_tx_timeout = ifx_ppa_eth_tx_timeout, .ndo_start_xmit = ifx_ppa_eth_hard_start_xmit }, .sizeof_priv = sizeof(avmnet_netdev_priv_t), .device_setup = ifx_ppa_setup_eth, .device_setup_priv = ifx_ppa_setup_priv, .flags = AVMNET_DEVICE_IFXPPA_ETH_LAN, .mac_module = &hw211_avmnet_mac_7port_2, }; avmnet_device_t hw211_avmnet_avm_device_4 = { .device = NULL, .device_name = "eth4", .external_port_no = 4, #if defined(CONFIG_AVM_SCATTER_GATHER) .net_dev_features = NETIF_F_SG | NETIF_F_IP_CSUM, #endif .device_ops = { .ndo_init = ifx_ppa_eth_init, .ndo_get_stats = avmnet_swi_7port_get_net_device_stats, .ndo_open = avmnet_netdev_open, .ndo_stop = avmnet_netdev_stop, .ndo_set_mac_address = ifx_ppa_eth_set_mac_address, .ndo_do_ioctl = ifx_ppa_eth_ioctl, .ndo_tx_timeout = ifx_ppa_eth_tx_timeout, .ndo_start_xmit = ifx_ppa_eth_hard_start_xmit }, .sizeof_priv = sizeof(avmnet_netdev_priv_t), .device_setup = ifx_ppa_setup_eth, .device_setup_priv = ifx_ppa_setup_priv, .flags = AVMNET_DEVICE_IFXPPA_ETH_LAN, .mac_module = &hw211_avmnet_mac_7port_5, }; avmnet_device_t *hw211_avmnet_avm_devices[] = { &hw211_avmnet_avm_device_0, &hw211_avmnet_avm_device_1, &hw211_avmnet_avm_device_2, &hw211_avmnet_avm_device_3, &hw211_avmnet_avm_device_4, }; avmnet_module_t hw211_avmnet = { .name = "swi_vr9", .type = avmnet_modtype_switch, .priv = NULL, .initdata.swi = { .flags = ( SWI_DISABLE_LEARNING /*--- | AVMNET_CONFIG_FLAG_MDIOPOLLING ---*/ ), }, .init = avmnet_swi_7port_init, .setup = avmnet_swi_7port_setup, .exit = avmnet_swi_7port_exit, .reg_read = avmnet_swi_7port_reg_read, .reg_write = avmnet_swi_7port_reg_write, .lock = avmnet_swi_7port_lock, .unlock = avmnet_swi_7port_unlock, .status_changed = avmnet_swi_7port_status_changed, .set_status = avmnet_swi_7port_set_status, .poll = avmnet_swi_7port_poll, .setup_irq = avmnet_swi_7port_setup_irq, .powerup = avmnet_swi_7port_powerup, .powerdown = avmnet_swi_7port_powerdown, .suspend = avmnet_swi_7port_suspend, .resume = avmnet_swi_7port_resume, .parent = NULL, .num_children = 6, .children = { &hw211_avmnet_mac_7port_0, &hw211_avmnet_mac_7port_3, &hw211_avmnet_mac_7port_4, &hw211_avmnet_mac_7port_1, &hw211_avmnet_mac_7port_2, &hw211_avmnet_mac_7port_5, } }; extern avmnet_module_t hw211_avmnet_phy_AR8035; extern avmnet_module_t hw211_avmnet_phy_11G_0; extern avmnet_module_t hw211_avmnet_phy_11G_2; extern avmnet_module_t hw211_avmnet_phy_11G_5; extern avmnet_module_t hw211_avmnet_phy_11G_4; avmnet_module_t hw211_avmnet_mac_7port_0 = { .name = "mac_7port_0", .type = avmnet_modtype_mac, .priv = NULL, .initdata.mac = { .mac_nr = 0, .mac_mode = MAC_MODE_RMII, }, MAC_VR9_STDFUNCS, .parent = &hw211_avmnet, .num_children = 0, }; avmnet_module_t hw211_avmnet_mac_7port_1 = { .name = "mac_7port_1", .type = avmnet_modtype_mac, .priv = NULL, .initdata.mac = { .mac_nr = 1, .mac_mode = MAC_MODE_GMII, .flags = AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_ASYM | AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_SYM, }, MAC_VR9_STDFUNCS, .parent = &hw211_avmnet, .num_children = 1, .children = { &hw211_avmnet_phy_11G_4 } }; avmnet_module_t hw211_avmnet_mac_7port_4 = { .name = "mac_7port_4", .type = avmnet_modtype_mac, .priv = NULL, .initdata.mac = { .mac_nr = 4, .mac_mode = MAC_MODE_GMII, .flags = AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_ASYM | AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_SYM, }, MAC_VR9_STDFUNCS, .parent = &hw211_avmnet, .num_children = 1, .children = { &hw211_avmnet_phy_11G_2 } }; avmnet_module_t hw211_avmnet_mac_7port_3 = { .name = "mac_7port_3", .type = avmnet_modtype_mac, .priv = NULL, .initdata.mac = { .mac_nr = 3, .mac_mode = MAC_MODE_GMII, .flags = AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_ASYM | AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_SYM, }, MAC_VR9_STDFUNCS, .parent = &hw211_avmnet, .num_children = 1, .children = { &hw211_avmnet_phy_11G_5 } }; avmnet_module_t hw211_avmnet_mac_7port_2 = { .name = "mac_7port_2", .type = avmnet_modtype_mac, .priv = NULL, .initdata.mac = { .mac_nr = 2, .mac_mode = MAC_MODE_GMII, .flags = AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_ASYM | AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_SYM, }, MAC_VR9_STDFUNCS, .parent = &hw211_avmnet, .num_children = 1, .children = { &hw211_avmnet_phy_11G_0 } }; avmnet_module_t hw211_avmnet_mac_7port_5 = { .name = "mac_7port_5", .type = avmnet_modtype_mac, .priv = NULL, .initdata.mac = { .mac_nr = 5, .mac_mode = MAC_MODE_RGMII_1000, .flags = AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_ASYM | AVMNET_CONFIG_FLAG_MAC_SUPPORT_FC_SYM | AVMNET_CONFIG_FLAG_RX_DELAY | AVMNET_CONFIG_FLAG_TX_DELAY, .tx_delay = 3, .rx_delay = 5, }, MAC_VR9_STDFUNCS, .parent = &hw211_avmnet, .num_children = 1, .children = { &hw211_avmnet_phy_AR8035 } }; avmnet_module_t hw211_avmnet_phy_11G_0 = { .name = "phy_11G_0", .device_id = &hw211_avmnet_avm_device_3, .type = avmnet_modtype_phy, .priv = NULL, .initdata.phy = { .flags = AVMNET_CONFIG_FLAG_PHY_GBIT | AVMNET_CONFIG_FLAG_INTERNAL | AVMNET_CONFIG_FLAG_DEFAULT_EN_FC_RX, .mdio_addr = 2, }, PHY_11G_STDFUNCS, .ethtool_ops = PHY_11G_ETHOPS, .parent = &hw211_avmnet_mac_7port_2, .num_children = 0, .children = {} }; avmnet_module_t hw211_avmnet_phy_11G_4 = { .name = "phy_11G_4", .device_id = &hw211_avmnet_avm_device_1, .type = avmnet_modtype_phy, .priv = NULL, .initdata.phy = { .flags = AVMNET_CONFIG_FLAG_PHY_GBIT | AVMNET_CONFIG_FLAG_INTERNAL | AVMNET_CONFIG_FLAG_DEFAULT_EN_FC_RX, .mdio_addr = 0x01, }, PHY_11G_STDFUNCS, .ethtool_ops = PHY_11G_ETHOPS, .parent = &hw211_avmnet_mac_7port_1, .num_children = 0, .children = {} }; avmnet_module_t hw211_avmnet_phy_11G_2 = { .name = "phy_11G_2", .device_id = &hw211_avmnet_avm_device_2, .type = avmnet_modtype_phy, .priv = NULL, .initdata.phy = { .flags = AVMNET_CONFIG_FLAG_PHY_GBIT | AVMNET_CONFIG_FLAG_INTERNAL | AVMNET_CONFIG_FLAG_DEFAULT_EN_FC_RX, .mdio_addr = 0x04, }, PHY_11G_STDFUNCS, .ethtool_ops = PHY_11G_ETHOPS, .parent = &hw211_avmnet_mac_7port_4, .num_children = 0, .children = {} }; avmnet_module_t hw211_avmnet_phy_11G_5 = { .name = "phy_11G_5", .device_id = &hw211_avmnet_avm_device_0, .type = avmnet_modtype_phy, .priv = NULL, .initdata.phy = { .flags = AVMNET_CONFIG_FLAG_PHY_GBIT | AVMNET_CONFIG_FLAG_INTERNAL | AVMNET_CONFIG_FLAG_DEFAULT_EN_FC_RX, .mdio_addr = 0x03, }, PHY_11G_STDFUNCS, .ethtool_ops = PHY_11G_ETHOPS, .parent = &hw211_avmnet_mac_7port_3, .num_children = 0, .children = {} }; avmnet_module_t hw211_avmnet_phy_AR8035 = { .name = "phy_AR8035_0", .device_id = &hw211_avmnet_avm_device_4, .type = avmnet_modtype_phy, .priv = NULL, .initdata.phy = { .flags = AVMNET_CONFIG_FLAG_PHY_GBIT | AVMNET_CONFIG_FLAG_RESET | AVMNET_CONFIG_FLAG_RX_DELAY | AVMNET_CONFIG_FLAG_DEFAULT_EN_FC_RX, .reset = 0x107 - 7, .mdio_addr = 0, .rx_delay = 0x2ee, }, AR803X_STDFUNCS, .ethtool_ops = AR803X_ETHOPS, .parent = &hw211_avmnet_mac_7port_5, .num_children = 0, .children = {} }; #endif