x86: drop ep80579-drivers

The subtarget on which the driver still depends was removed with
dee8986b95 because it was unmaintained
for a long time.

Signed-off-by: Mathias Kresin <dev@kresin.me>
master
Mathias Kresin 8 years ago
parent 053dc3b77a
commit 36c13e5927
  1. 92
      package/kernel/ep80579-drivers/Makefile
  2. 11755
      package/kernel/ep80579-drivers/patches/001-igbe_update.patch
  3. 22
      package/kernel/ep80579-drivers/patches/002-cflags_cleanup.patch
  4. 53
      package/kernel/ep80579-drivers/patches/003-new_irqf_constants.patch
  5. 56
      package/kernel/ep80579-drivers/patches/100-iegbe_netdev_ops.patch
  6. 41
      package/kernel/ep80579-drivers/patches/101-iegbe_fix_napi_interface.patch
  7. 103
      package/kernel/ep80579-drivers/patches/102-iegbe_nuke_polling_netdev.patch
  8. 60
      package/kernel/ep80579-drivers/patches/103-iegbe_convert_unicast_addr_list.patch
  9. 20
      package/kernel/ep80579-drivers/patches/104-iegbe_group_address_list_and_its_count.patch
  10. 20
      package/kernel/ep80579-drivers/patches/105-iegbe_new_dma_masks.patch
  11. 12
      package/kernel/ep80579-drivers/patches/106-iegbe_new_irqf_constant.patch
  12. 747
      package/kernel/ep80579-drivers/patches/150-ocracoke_island.patch
  13. 11
      package/kernel/ep80579-drivers/patches/200-can_fix_ioctl_numbers.patch
  14. 11
      package/kernel/ep80579-drivers/patches/210-can_include_linux_fs_h.patch
  15. 23
      package/kernel/ep80579-drivers/patches/220-can_fix_irq_request.patch
  16. 40
      package/kernel/ep80579-drivers/patches/230-can_remove_driver_data_direct_access.patch
  17. 59
      package/kernel/ep80579-drivers/patches/300-wdt_compile_fix.patch
  18. 22
      package/kernel/ep80579-drivers/patches/400-edma_fix_irq_request_warning.patch
  19. 22
      package/kernel/ep80579-drivers/patches/500-1588_fix_irq_request_warning.patch
  20. 22
      package/kernel/ep80579-drivers/patches/600-2.6.27_includes.patch
  21. 30
      package/kernel/ep80579-drivers/patches/601-2.6.32_includes.patch
  22. 31
      package/kernel/ep80579-drivers/patches/700-iegbe_kcompat_2.6.30.patch
  23. 11
      package/kernel/ep80579-drivers/patches/701-iegbe_poll_dev.patch
  24. 91
      package/kernel/ep80579-drivers/patches/710-3.3-fix-generated-header-locations.patch
  25. 392
      package/kernel/ep80579-drivers/patches/711-3.3-gbe-fixes.patch
  26. 41
      package/kernel/ep80579-drivers/patches/712-3.3-can-fixes.patch
  27. 33
      package/kernel/ep80579-drivers/patches/713-3.3-gpio-fixes.patch
  28. 31
      package/kernel/ep80579-drivers/patches/714-3.3-wdt-fixes.patch
  29. 33
      package/kernel/ep80579-drivers/patches/715-3.3-1588-fixes.patch

@ -1,92 +0,0 @@
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ep80579-drivers
PKG_VERSION:=1.0.34
PKG_RELEASE:=1
PKG_SOURCE:=Embedded.L.1.0.34.ADI.R100.tar.gz
PKG_SOURCE_URL:=ftp://ftp.adiengineering.com/Archive/OcracokeIsland/Drivers/Linux/1.0.34/
PKG_HASH:=f00684176a3dd1dc9ea8d96ecd1ecade5103f351ed93b9e3a5ff5f3f3295e2a9
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ep80579-drivers/Default
DEPENDS:=@TARGET_x86_ep80579
endef
define KernelPackage/ep80579-eth
$(call KernelPackage/ep80579-drivers/Default)
SUBMENU:=Network Devices
TITLE:=Intel EP80579 ethernet driver
FILES:= \
$(PKG_BUILD_DIR)/Embedded/src/GbE/gcu.ko \
$(PKG_BUILD_DIR)/Embedded/src/GbE/iegbe.ko
AUTOLOAD:=$(call AutoLoad,40,gcu iegbe)
endef
define KernelPackage/ep80579-misc
$(call KernelPackage/ep80579-drivers/Default)
SUBMENU:=Other modules
TITLE:=Misc. Intel EP80579 drivers (DMA,, gpio)
FILES:= \
$(PKG_BUILD_DIR)/Embedded/src/EDMA/dma.ko \
$(PKG_BUILD_DIR)/Embedded/src/GPIO/gpio.ko
AUTOLOAD:=$(call AutoLoad,40,gpio dma)
endef
define KernelPackage/ep80579-can
$(call KernelPackage/ep80579-drivers/Default)
SUBMENU:=Other modules
TITLE:=Intel EP80579 CAN driver
FILES:= \
$(PKG_BUILD_DIR)/Embedded/src/1588/timesync.ko \
$(PKG_BUILD_DIR)/Embedded/src/CAN/can.ko
AUTOLOAD:=$(call AutoLoad,40,timesync can)
endef
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
tar xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)/
$(Build/Patch)
endef
define Build/Compile/Subdir
$(MAKE) -C "$(LINUX_DIR)" \
KSRC="$(LINUX_DIR)" \
KOBJ="$(LINUX_DIR)" \
ENV_DIR=$(PKG_BUILD_DIR)/Embedded \
SUBDIRS="$(PKG_BUILD_DIR)/Embedded/src/$(1)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCHIVER="$(TARGET_CROSS)ar" \
COMPILER="$(TARGET_CC)" \
LINKER="$(TARGET_CROSS)ld" \
ARCH="$(LINUX_KARCH)"
endef
define Build/Compile
$(call Build/Compile/Subdir,GbE)
$(call Build/Compile/Subdir,CAN)
$(call Build/Compile/Subdir,EDMA)
$(call Build/Compile/Subdir,GPIO)
$(call Build/Compile/Subdir,WDT)
$(call Build/Compile/Subdir,1588)
endef
define KernelPackage/ep80579-eth/install
endef
$(eval $(call KernelPackage,ep80579-can))
$(eval $(call KernelPackage,ep80579-eth))
$(eval $(call KernelPackage,ep80579-misc))

File diff suppressed because it is too large Load Diff

@ -1,22 +0,0 @@
--- a/build_system/build_files/common.mk
+++ b/build_system/build_files/common.mk
@@ -122,7 +122,7 @@ CC=$(COMPILER)
LD=$(LINKER)
AR=$(ARCHIVER)
-CFLAGS+=-O2
+#CFLAGS+=-O2
PWD= $(shell pwd)
--- a/build_system/build_files/OS/linux_2.6.mk
+++ b/build_system/build_files/OS/linux_2.6.mk
@@ -80,7 +80,7 @@ endif
ifeq ($(OS_LEVEL), kernel_space)
-CFLAGS+=
+#CFLAGS+=
endif

@ -1,53 +0,0 @@
--- a/Embedded/src/1588/1588.c
+++ b/Embedded/src/1588/1588.c
@@ -291,7 +291,7 @@ int pci_probe(struct pci_dev *dev, const
}
- if ( request_irq(dev->irq, &timesync_isr, SA_SHIRQ, DRIVERNAME,
+ if ( request_irq(dev->irq, &timesync_isr, IRQF_SHARED, DRIVERNAME,
&g_drvr_data) )
{
printk("%s-pci_probe: irq\n", DRIVERNAME);
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -424,7 +424,7 @@ int can_open(struct inode *inode, struct
err = request_irq(
can_os->irq,
can_irq_handler,
- SA_SHIRQ,
+ IRQF_SHARED,
iminor(can_os->inode) ? CAN_PROC_1 : CAN_PROC_0,
&(g_can_os[iminor(can_os->inode)])
);
--- a/Embedded/src/EDMA/dma_linux.c
+++ b/Embedded/src/EDMA/dma_linux.c
@@ -367,7 +367,7 @@ int32_t edma_resume(struct pci_dev *dev)
return -ENODEV;
}
- if (request_irq(dev->irq, &edma_irq_handler, SA_SHIRQ,
+ if (request_irq(dev->irq, &edma_irq_handler, IRQF_SHARED,
g_char_drvr_name, dev) )
{
@@ -829,7 +829,7 @@ int32_t edma_probe(struct pci_dev * dev,
/*
* Obtain a (shared) Interrupt Request (IRQ) Line from the OS.
*/
- if (request_irq(dev->irq, &edma_irq_handler, SA_SHIRQ,
+ if (request_irq(dev->irq, &edma_irq_handler, IRQF_SHARED,
g_char_drvr_name, dev) )
{
--- a/Embedded/src/WDT/iwdt.c
+++ b/Embedded/src/WDT/iwdt.c
@@ -1461,7 +1461,7 @@ static int __init wdt_init_one(struct pc
/* Request irq only if wdt_irq is other than 0 */
if (wdt_irq) {
- if (request_irq(wdt_irq, wdt_isr, SA_INTERRUPT | SA_SHIRQ,
+ if (request_irq(wdt_irq, wdt_isr, IRQF_DISABLED | IRQF_SHARED,
"iwdt", &wdt_miscdev)) {
printk("IRQ %d is not free.\n", wdt_irq);
return -EIO;

@ -1,56 +0,0 @@
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -724,6 +724,26 @@ static void iegbe_dump_eeprom(struct ieg
kfree(data);
}
+static const struct net_device_ops iegbe_netdev_ops = {
+ .ndo_open = iegbe_open,
+ .ndo_stop = iegbe_close,
+ .ndo_start_xmit = iegbe_xmit_frame,
+ .ndo_get_stats = iegbe_get_stats,
+ .ndo_set_rx_mode = iegbe_set_rx_mode,
+ .ndo_set_mac_address = iegbe_set_mac,
+ .ndo_tx_timeout = iegbe_tx_timeout,
+ .ndo_change_mtu = iegbe_change_mtu,
+ .ndo_do_ioctl = iegbe_ioctl,
+ .ndo_validate_addr = eth_validate_addr,
+
+ .ndo_vlan_rx_register = iegbe_vlan_rx_register,
+ .ndo_vlan_rx_add_vid = iegbe_vlan_rx_add_vid,
+ .ndo_vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = iegbe_netpoll,
+#endif
+};
+
/**
* iegbe_probe - Device Initialization Routine
* @pdev: PCI device information struct
@@ -800,24 +820,11 @@ static int __devinit iegbe_probe(struct
if (!hw->hw_addr)
goto err_ioremap;
- netdev->open = &iegbe_open;
- netdev->stop = &iegbe_close;
- netdev->hard_start_xmit = &iegbe_xmit_frame;
- netdev->get_stats = &iegbe_get_stats;
- netdev->set_rx_mode = &iegbe_set_rx_mode;
- netdev->set_mac_address = &iegbe_set_mac;
- netdev->change_mtu = &iegbe_change_mtu;
- netdev->do_ioctl = &iegbe_ioctl;
+ netdev->netdev_ops = &iegbe_netdev_ops;
set_ethtool_ops(netdev);
- netdev->tx_timeout = &iegbe_tx_timeout;
netdev->watchdog_timeo = 5 * HZ;
netif_napi_add(netdev, &adapter->napi, iegbe_clean, 64);
- netdev->vlan_rx_register = iegbe_vlan_rx_register;
- netdev->vlan_rx_add_vid = iegbe_vlan_rx_add_vid;
- netdev->vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- netdev->poll_controller = iegbe_netpoll;
-#endif
+
strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);

@ -1,41 +0,0 @@
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -3465,12 +3465,12 @@ static irqreturn_t iegbe_intr_msi(int ir
printk("Critical error! ICR = 0x%x\n", icr);
return IRQ_HANDLED;
}
- if (likely(netif_rx_schedule_prep(netdev, &adapter->napi))) {
+ if (likely(napi_schedule_prep(&adapter->napi))) {
adapter->total_tx_bytes = 0;
adapter->total_tx_packets = 0;
adapter->total_rx_bytes = 0;
adapter->total_rx_packets = 0;
- __netif_rx_schedule(netdev, &adapter->napi);
+ __napi_schedule(&adapter->napi);
} else
iegbe_irq_enable(adapter);
@@ -3527,12 +3527,12 @@ iegbe_intr(int irq, void *data)
E1000_WRITE_REG(&adapter->hw, IMC, ~0);
E1000_WRITE_FLUSH(&adapter->hw);
}
- if (likely(netif_rx_schedule_prep(netdev, &adapter->napi))) {
+ if (likely(napi_schedule_prep(&adapter->napi))) {
adapter->total_tx_bytes = 0;
adapter->total_tx_packets = 0;
adapter->total_rx_bytes = 0;
adapter->total_rx_packets = 0;
- __netif_rx_schedule(netdev, &adapter->napi);
+ __napi_schedule(&adapter->napi);
} else
/* this really should not happen! if it does it is basically a
* bug, but not a hard error, so enable ints and continue */
@@ -3574,7 +3574,7 @@ static int iegbe_clean(struct napi_struc
if (work_done < budget) {
if (likely(adapter->itr_setting & 3))
iegbe_set_itr(adapter);
- netif_rx_complete(poll_dev, napi);
+ napi_complete(napi);
iegbe_irq_enable(adapter);
}

@ -1,103 +0,0 @@
--- a/Embedded/src/GbE/iegbe.h
+++ b/Embedded/src/GbE/iegbe.h
@@ -316,7 +316,6 @@ struct iegbe_adapter {
int cleaned_count);
struct iegbe_rx_ring *rx_ring; /* One per active queue */
struct napi_struct napi;
- struct net_device *polling_netdev; /* One per active queue */
int num_tx_queues;
int num_rx_queues;
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -763,7 +763,7 @@ static int __devinit iegbe_probe(struct
struct iegbe_hw *hw;
static int cards_found = 0;
- int i, err, pci_using_dac;
+ int err, pci_using_dac;
u16 eeprom_data = 0;
u16 eeprom_apme_mask = E1000_EEPROM_APME;
int bars;
@@ -984,11 +984,8 @@ err_eeprom:
iegbe_phy_hw_reset(hw);
if (hw->flash_address)
iounmap(hw->flash_address);
- for (i = 0; i < adapter->num_rx_queues; i++)
- dev_put(&adapter->polling_netdev[i]);
kfree(adapter->tx_ring);
kfree(adapter->rx_ring);
- kfree(adapter->polling_netdev);
err_sw_init:
iounmap(hw->hw_addr);
err_ioremap:
@@ -1017,7 +1014,6 @@ iegbe_remove(struct pci_dev *pdev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct iegbe_adapter *adapter = netdev_priv(netdev);
uint32_t manc;
- int i;
if(adapter->hw.mac_type >= iegbe_82540
&& adapter->hw.mac_type != iegbe_icp_xxxx
@@ -1030,15 +1026,11 @@ iegbe_remove(struct pci_dev *pdev)
}
unregister_netdev(netdev);
- for (i = 0x0; i < adapter->num_rx_queues; i++)
- dev_put(&adapter->polling_netdev[i]);
-
if(!iegbe_check_phy_reset_block(&adapter->hw)) {
iegbe_phy_hw_reset(&adapter->hw);
}
kfree(adapter->tx_ring);
kfree(adapter->rx_ring);
- kfree(adapter->polling_netdev);
iounmap(adapter->hw.hw_addr);
pci_release_regions(pdev);
@@ -1061,7 +1053,6 @@ iegbe_sw_init(struct iegbe_adapter *adap
struct iegbe_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
- int i;
/* PCI config space info */
@@ -1111,11 +1102,6 @@ iegbe_sw_init(struct iegbe_adapter *adap
return -ENOMEM;
}
- for (i = 0; i < adapter->num_rx_queues; i++) {
- adapter->polling_netdev[i].priv = adapter;
- dev_hold(&adapter->polling_netdev[i]);
- set_bit(__LINK_STATE_START, &adapter->polling_netdev[i].state);
- }
spin_lock_init(&adapter->tx_queue_lock);
/*
@@ -1137,8 +1123,7 @@ iegbe_sw_init(struct iegbe_adapter *adap
* @adapter: board private structure to initialize
*
* We allocate one ring per queue at run-time since we don't know the
- * number of queues at compile-time. The polling_netdev array is
- * intended for Multiqueue, but should work fine with a single queue.
+ * number of queues at compile-time.
**/
static int __devinit
@@ -1158,15 +1143,6 @@ iegbe_alloc_queues(struct iegbe_adapter
return -ENOMEM;
}
- adapter->polling_netdev = kcalloc(adapter->num_rx_queues,
- sizeof(struct net_device),
- GFP_KERNEL);
- if (!adapter->polling_netdev) {
- kfree(adapter->tx_ring);
- kfree(adapter->rx_ring);
- return -ENOMEM;
- }
-
return E1000_SUCCESS;
}

@ -1,60 +0,0 @@
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -2161,7 +2161,8 @@ static void iegbe_set_rx_mode(struct net
{
struct iegbe_adapter *adapter = netdev_priv(netdev);
struct iegbe_hw *hw = &adapter->hw;
- struct dev_addr_list *uc_ptr;
+ struct netdev_hw_addr *ha;
+ bool use_uc = false;
struct dev_addr_list *mc_ptr;
u32 rctl;
u32 hash_value;
@@ -2187,12 +2188,11 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
}
}
- uc_ptr = NULL;
if (netdev->uc_count > rar_entries - 1) {
rctl |= E1000_RCTL_UPE;
} else if (!(netdev->flags & IFF_PROMISC)) {
rctl &= ~E1000_RCTL_UPE;
- uc_ptr = netdev->uc_list;
+ use_uc = true;
}
E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
@@ -2210,13 +2210,20 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
* if there are not 14 addresses, go ahead and clear the filters
* -- with 82571 controllers only 0-13 entries are filled here
*/
+ i = 1;
+ if (use_uc)
+ list_for_each_entry(ha, &netdev->uc_list, list) {
+ if (i == rar_entries)
+ break;
+ iegbe_rar_set(hw, ha->addr, i++);
+ }
+
+ WARN_ON(i == rar_entries);
+
mc_ptr = netdev->mc_list;
- for (i = 1; i < rar_entries; i++) {
- if (uc_ptr) {
- iegbe_rar_set(hw, uc_ptr->da_addr, i);
- uc_ptr = uc_ptr->next;
- } else if (mc_ptr) {
+ for (; i < rar_entries; i++) {
+ if (mc_ptr) {
iegbe_rar_set(hw, mc_ptr->da_addr, i);
mc_ptr = mc_ptr->next;
} else {
@@ -2226,7 +2233,6 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
E1000_WRITE_FLUSH(&adapter->hw);
}
}
- WARN_ON(uc_ptr != NULL);
/* clear the old settings from the multicast hash table */

@ -1,20 +0,0 @@
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -2188,7 +2188,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
}
}
- if (netdev->uc_count > rar_entries - 1) {
+ if (netdev->uc.count > rar_entries - 1) {
rctl |= E1000_RCTL_UPE;
} else if (!(netdev->flags & IFF_PROMISC)) {
rctl &= ~E1000_RCTL_UPE;
@@ -2212,7 +2212,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
*/
i = 1;
if (use_uc)
- list_for_each_entry(ha, &netdev->uc_list, list) {
+ list_for_each_entry(ha, &netdev->uc.list, list) {
if (i == rar_entries)
break;
iegbe_rar_set(hw, ha->addr, i++);

@ -1,20 +0,0 @@
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -775,13 +775,13 @@ static int __devinit iegbe_probe(struct
if (err)
return err;
- if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
- !pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) {
+ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
+ !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
pci_using_dac = 1;
} else {
- err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+ err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (err) {
- err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
+ err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (err) {
E1000_ERR("No usable DMA configuration, "
"aborting\n");

@ -1,12 +0,0 @@
--- a/Embedded/src/GbE/iegbe_ethtool.c
+++ b/Embedded/src/GbE/iegbe_ethtool.c
@@ -944,7 +944,8 @@ iegbe_intr_test(struct iegbe_adapter *ad
*data = 0;
/* Hook up test interrupt handler just for this test */
- if(!request_irq(irq, &iegbe_test_intr, 0, netdev->name, netdev)) {
+ if(!request_irq(irq, &iegbe_test_intr, IRQF_PROBE_SHARED, netdev->name,
+ netdev)) {
shared_int = FALSE;
} else if(request_irq(irq, &iegbe_test_intr, IRQF_SHARED,
netdev->name, netdev)){

@ -1,747 +0,0 @@
--- a/Embedded/src/GbE/iegbe_oem_phy.c
+++ b/Embedded/src/GbE/iegbe_oem_phy.c
@@ -65,6 +65,10 @@ static int32_t iegbe_oem_link_m88_setup(
static int32_t iegbe_oem_set_phy_mode(struct iegbe_hw *hw);
static int32_t iegbe_oem_detect_phy(struct iegbe_hw *hw);
+static int32_t iegbe_oem_link_bcm5481_setup(struct iegbe_hw *hw);
+static int32_t bcm5481_read_18sv (struct iegbe_hw *hw, int sv, uint16_t *data);
+static int32_t oi_phy_setup (struct iegbe_hw *hw);
+
/**
* iegbe_oem_setup_link
* @hw: iegbe_hw struct containing device specific information
@@ -114,6 +118,10 @@ iegbe_oem_setup_link(struct iegbe_hw *hw
}
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ return E1000_SUCCESS;
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_link_m88_setup(hw);
@@ -121,6 +129,12 @@ iegbe_oem_setup_link(struct iegbe_hw *hw
return ret_val;
}
break;
+ case BCM5481_PHY_ID:
+ ret_val = iegbe_oem_link_bcm5481_setup(hw);
+ if(ret_val) {
+ return ret_val;
+ }
+ break;
default:
DEBUGOUT("Invalid PHY ID\n");
return -E1000_ERR_PHY_TYPE;
@@ -179,6 +193,51 @@ iegbe_oem_setup_link(struct iegbe_hw *hw
#endif /* ifdef EXTERNAL_MDIO */
}
+/**
+ * iegbe_oem_link_bcm5481_setup
+ * @hw: iegbe_hw struct containing device specific information
+ *
+ * Returns E1000_SUCCESS, negative E1000 error code on failure
+ *
+ * copied verbatim from iegbe_oem_link_m88_setup
+ **/
+static int32_t
+iegbe_oem_link_bcm5481_setup(struct iegbe_hw *hw)
+{
+ int32_t ret_val;
+ uint16_t phy_data;
+
+ //DEBUGFUNC(__func__);
+
+ if(!hw)
+ return -1;
+
+ /* phy_reset_disable is set in iegbe_oem_set_phy_mode */
+ if(hw->phy_reset_disable)
+ return E1000_SUCCESS;
+
+ // Enable MDIX in extended control reg.
+ ret_val = iegbe_oem_read_phy_reg_ex(hw, BCM5481_ECTRL, &phy_data);
+ if(ret_val)
+ {
+ DEBUGOUT("Unable to read BCM5481_ECTRL register\n");
+ return ret_val;
+ }
+
+ phy_data &= ~BCM5481_ECTRL_DISMDIX;
+ ret_val = iegbe_oem_write_phy_reg_ex(hw, BCM5481_ECTRL, phy_data);
+ if(ret_val)
+ {
+ DEBUGOUT("Unable to write BCM5481_ECTRL register\n");
+ return ret_val;
+ }
+
+ ret_val = oi_phy_setup (hw);
+ if (ret_val)
+ return ret_val;
+
+ return E1000_SUCCESS;
+}
/**
* iegbe_oem_link_m88_setup
@@ -340,6 +399,11 @@ iegbe_oem_force_mdi(struct iegbe_hw *hw,
* see iegbe_phy_force_speed_duplex, which does the following for M88
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_force_mdi() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw,
@@ -415,6 +479,8 @@ iegbe_oem_phy_reset_dsp(struct iegbe_hw
switch (hw->phy_id) {
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
+ case BCM5395S_PHY_ID:
DEBUGOUT("No DSP to reset on OEM PHY\n");
break;
default:
@@ -460,6 +526,11 @@ iegbe_oem_cleanup_after_phy_reset(struct
* see iegbe_phy_force_speed_duplex, which does the following for M88
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_cleanup_after_phy_reset() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
/*
@@ -573,6 +644,11 @@ iegbe_oem_set_phy_mode(struct iegbe_hw *
* use iegbe_set_phy_mode as example
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_set_phy_mode() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_read_eeprom(hw,
@@ -641,6 +717,19 @@ iegbe_oem_detect_phy(struct iegbe_hw *hw
}
hw->phy_type = iegbe_phy_oem;
+{
+ // If MAC2 (BCM5395 switch), manually detect the phy
+ struct iegbe_adapter *adapter;
+ uint32_t device_number;
+ adapter = (struct iegbe_adapter *) hw->back;
+ device_number = PCI_SLOT(adapter->pdev->devfn);
+ if (device_number == ICP_XXXX_MAC_2) {
+ hw->phy_id = BCM5395S_PHY_ID;
+ hw->phy_revision = 0;
+ return E1000_SUCCESS;
+ }
+}
+
ret_val = iegbe_oem_read_phy_reg_ex(hw, PHY_ID1, &phy_id_high);
if(ret_val) {
DEBUGOUT("Unable to read PHY register PHY_ID1\n");
@@ -690,6 +779,8 @@ iegbe_oem_get_tipg(struct iegbe_hw *hw)
switch (hw->phy_id) {
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
+ case BCM5395S_PHY_ID:
phy_num = DEFAULT_ICP_XXXX_TIPG_IPGT;
break;
default:
@@ -738,6 +829,8 @@ iegbe_oem_phy_is_copper(struct iegbe_hw
switch (hw->phy_id) {
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
+ case BCM5395S_PHY_ID:
isCopper = TRUE;
break;
default:
@@ -796,13 +889,13 @@ iegbe_oem_get_phy_dev_number(struct iegb
switch(device_number)
{
case ICP_XXXX_MAC_0:
- hw->phy_addr = 0x00;
+ hw->phy_addr = 0x01;
break;
case ICP_XXXX_MAC_1:
- hw->phy_addr = 0x01;
+ hw->phy_addr = 0x02;
break;
case ICP_XXXX_MAC_2:
- hw->phy_addr = 0x02;
+ hw->phy_addr = 0x00;
break;
default: hw->phy_addr = 0x00;
}
@@ -851,6 +944,12 @@ iegbe_oem_mii_ioctl(struct iegbe_adapter
if(!adapter || !ifr) {
return -1;
}
+
+ // If MAC2 (BCM5395 switch) then leave now
+ if ((PCI_SLOT(adapter->pdev->devfn)) == ICP_XXXX_MAC_2) {
+ return -1;
+ }
+
switch (data->reg_num) {
case PHY_CTRL:
if(mii_reg & MII_CR_POWER_DOWN) {
@@ -987,6 +1086,11 @@ void iegbe_oem_get_phy_regs(struct iegbe
* [10] = mdix mode
*/
switch (adapter->hw.phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_get_phy_regs() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
if(corrected_len > 0) {
@@ -1068,8 +1172,13 @@ iegbe_oem_phy_loopback(struct iegbe_adap
* Loopback configuration is the same for each of the supported PHYs.
*/
switch (adapter->hw.phy_id) {
+ case BCM5395S_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_phy_loopback() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
adapter->hw.autoneg = FALSE;
@@ -1182,8 +1291,14 @@ iegbe_oem_loopback_cleanup(struct iegbe_
}
switch (adapter->hw.phy_id) {
+ case BCM5395S_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_loopback_cleanup() has been called!\n");
+ return;
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
default:
adapter->hw.autoneg = TRUE;
@@ -1243,6 +1358,11 @@ iegbe_oem_phy_speed_downgraded(struct ie
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ *isDowngraded = 0;
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,
@@ -1305,6 +1425,11 @@ iegbe_oem_check_polarity(struct iegbe_hw
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ *polarity = 0;
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
/* return the Polarity bit in the Status register. */
@@ -1367,6 +1492,25 @@ iegbe_oem_phy_is_full_duplex(struct iegb
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ /* Always full duplex */
+ *isFD = 1;
+ break;
+
+ case BCM5481_PHY_ID:
+ ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data);
+ if(ret_val) return ret_val;
+
+ switch (BCM5481_ASTAT_HCD(phy_data)) {
+ case BCM5481_ASTAT_1KBTFD:
+ case BCM5481_ASTAT_100BTXFD:
+ *isFD = 1;
+ break;
+ default:
+ *isFD = 0;
+ }
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,
@@ -1423,6 +1567,25 @@ iegbe_oem_phy_is_speed_1000(struct iegbe
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ /* Always 1000mb */
+ *is1000 = 1;
+ break;
+
+ case BCM5481_PHY_ID:
+ ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data);
+ if(ret_val) return ret_val;
+
+ switch (BCM5481_ASTAT_HCD(phy_data)) {
+ case BCM5481_ASTAT_1KBTFD:
+ case BCM5481_ASTAT_1KBTHD:
+ *is1000 = 1;
+ break;
+ default:
+ *is1000 = 0;
+ }
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,
@@ -1478,6 +1641,25 @@ iegbe_oem_phy_is_speed_100(struct iegbe_
* see iegbe_config_mac_to_phy
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ /* Always 1000Mb, never 100mb */
+ *is100 = 0;
+ break;
+
+ case BCM5481_PHY_ID:
+ ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data);
+ if(ret_val) return ret_val;
+
+ switch (BCM5481_ASTAT_HCD(phy_data)) {
+ case BCM5481_ASTAT_100BTXFD:
+ case BCM5481_ASTAT_100BTXHD:
+ *is100 = 1;
+ break;
+ default:
+ *is100 = 0;
+ }
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw,
@@ -1535,6 +1717,11 @@ iegbe_oem_phy_get_info(struct iegbe_hw *
* see iegbe_phy_m88_get_info
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_phy_get_info() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
/* The downshift status is checked only once, after link is
@@ -1636,8 +1823,13 @@ iegbe_oem_phy_hw_reset(struct iegbe_hw *
* the M88 used in truxton.
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_phy_hw_reset() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw, PHY_CTRL, &phy_data);
if(ret_val) {
DEBUGOUT("Unable to read register PHY_CTRL\n");
@@ -1699,6 +1891,8 @@ iegbe_oem_phy_init_script(struct iegbe_h
switch (hw->phy_id) {
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
+ case BCM5395S_PHY_ID:
DEBUGOUT("Nothing to do for OEM PHY Init");
break;
default:
@@ -1735,6 +1929,11 @@ iegbe_oem_read_phy_reg_ex(struct iegbe_h
return -1;
}
+ if (hw->phy_id == BCM5395S_PHY_ID) {
+ DEBUGOUT("WARNING: iegbe_oem_read_phy_reg_ex() has been unexpectedly called!\n");
+ return -1;
+ }
+
/* call the GCU func that will read the phy
*
* Make note that the M88 phy is what'll be used on Truxton.
@@ -1782,6 +1981,11 @@ iegbe_oem_set_trans_gasket(struct iegbe_
}
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ DEBUGOUT("WARNING: An empty iegbe_oem_set_trans_gasket() has been called!\n");
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
/* Gasket set correctly for Marvell Phys, so nothing to do */
@@ -1886,6 +2090,8 @@ iegbe_oem_phy_needs_reset_with_mac(struc
switch (hw->phy_id) {
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
+ case BCM5395S_PHY_ID:
ret_val = FALSE;
break;
default:
@@ -1935,6 +2141,8 @@ iegbe_oem_config_dsp_after_link_change(s
switch (hw->phy_id) {
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
+ case BCM5481_PHY_ID:
+ case BCM5395S_PHY_ID:
DEBUGOUT("No DSP to configure on OEM PHY");
break;
default:
@@ -1978,6 +2186,12 @@ iegbe_oem_get_cable_length(struct iegbe_
}
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ case BCM5481_PHY_ID:
+ *min_length = 0;
+ *max_length = iegbe_igp_cable_length_150;
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
ret_val = iegbe_oem_read_phy_reg_ex(hw,
@@ -2061,6 +2275,23 @@ iegbe_oem_phy_is_link_up(struct iegbe_hw
*/
switch (hw->phy_id) {
+ case BCM5395S_PHY_ID:
+ /* Link always up */
+ *isUp = TRUE;
+ return E1000_SUCCESS;
+ break;
+
+ case BCM5481_PHY_ID:
+ iegbe_oem_read_phy_reg_ex(hw, BCM5481_ESTAT, &phy_data);
+ ret_val = iegbe_oem_read_phy_reg_ex(hw, BCM5481_ESTAT, &phy_data);
+ if(ret_val)
+ {
+ DEBUGOUT("Unable to read PHY register BCM5481_ESTAT\n");
+ return ret_val;
+ }
+ statusMask = BCM5481_ESTAT_LINK;
+ break;
+
case M88E1000_I_PHY_ID:
case M88E1141_E_PHY_ID:
iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
@@ -2092,3 +2323,210 @@ iegbe_oem_phy_is_link_up(struct iegbe_hw
#endif /* ifdef EXTERNAL_MDIO */
}
+
+
+//-----
+// Read BCM5481 expansion register
+//
+int32_t
+bcm5481_read_ex (struct iegbe_hw *hw, uint16_t reg, uint16_t *data)
+{
+ int ret;
+ uint16_t selector;
+ uint16_t reg_data;
+
+ // Get the current value of bits 15:12
+ ret = iegbe_oem_read_phy_reg_ex (hw, 0x15, &selector);
+ if (ret)
+ return ret;
+
+ // Select the expansion register
+ selector &= 0xf000;
+ selector |= (0xf << 8) | (reg);
+ iegbe_oem_write_phy_reg_ex (hw, 0x17, selector);
+
+ // Read the expansion register
+ ret = iegbe_oem_read_phy_reg_ex (hw, 0x15, &reg_data);
+
+ // De-select the expansion registers.
+ selector &= 0xf000;
+ iegbe_oem_write_phy_reg_ex (hw, 0x17, selector);
+
+ if (ret)
+ return ret;
+
+ *data = reg_data;
+ return ret;
+}
+
+//-----
+// Read reg 0x18 sub-register
+//
+static int32_t
+bcm5481_read_18sv (struct iegbe_hw *hw, int sv, uint16_t *data)
+{
+ int ret;
+ uint16_t tmp_data;
+
+ // Select reg 0x18, sv
+ tmp_data = ((sv & BCM5481_R18H_SV_MASK) << 12) | BCM5481_R18H_SV_MCTRL;
+ ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, tmp_data);
+ if(ret)
+ return ret;
+
+ // Read reg 0x18, sv
+ ret = iegbe_oem_read_phy_reg_ex (hw, BCM5481_R18H, &tmp_data);
+ if(ret)
+ return ret;
+
+ *data = tmp_data;
+ return ret;
+}
+
+//-----
+// Read reg 0x1C sub-register
+//
+int32_t
+bcm5481_read_1csv (struct iegbe_hw *hw, int sv, uint16_t *data)
+{
+ int ret;
+ uint16_t tmp_data;
+
+ // Select reg 0x1c, sv
+ tmp_data = ((sv & BCM5481_R1CH_SV_MASK) << BCM5481_R1CH_SV_SHIFT);
+
+ ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, tmp_data);
+ if(ret)
+ return ret;
+
+ // Read reg 0x1c, sv
+ ret = iegbe_oem_read_phy_reg_ex (hw, BCM5481_R1CH, &tmp_data);
+ if(ret)
+ return ret;
+
+ *data = tmp_data;
+ return ret;
+}
+
+//-----
+// Read-modify-write a 0x1C register.
+//
+// hw - hardware access info.
+// reg - 0x1C register to modify.
+// data - bits which should be set.
+// mask - the '1' bits in this argument will be cleared in the data
+// read from 'reg' then 'data' will be or'd in and the result
+// will be written to 'reg'.
+
+int32_t
+bcm5481_rmw_1csv (struct iegbe_hw *hw, uint16_t reg, uint16_t data, uint16_t mask)
+{
+ int32_t ret;
+ uint16_t reg_data;
+
+ ret = 0;
+
+ ret = bcm5481_read_1csv (hw, reg, &reg_data);
+ if (ret)
+ {
+ DEBUGOUT("Unable to read BCM5481 1CH register\n");
+ printk (KERN_ERR "Unable to read BCM5481 1CH register [0x%x]\n", reg);
+ return ret;
+ }
+
+ reg_data &= ~mask;
+ reg_data |= (BCM5481_R1CH_WE | data);
+
+ ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, reg_data);
+ if(ret)
+ {
+ DEBUGOUT("Unable to write BCM5481 1CH register\n");
+ printk (KERN_ERR "Unable to write BCM5481 1CH register\n");
+ return ret;
+ }
+
+ return ret;
+}
+
+int32_t
+oi_phy_setup (struct iegbe_hw *hw)
+{
+ int ret;
+ uint16_t pmii_data;
+ uint16_t mctrl_data;
+ uint16_t cacr_data;
+
+ ret = 0;
+
+ // Set low power mode via reg 0x18, sv010, bit 6
+ // Do a read-modify-write on reg 0x18, sv010 register to preserve existing bits.
+ ret = bcm5481_read_18sv (hw, BCM5481_R18H_SV_PMII, &pmii_data);
+ if (ret)
+ {
+ DEBUGOUT("Unable to read BCM5481_R18H_SV_PMII register\n");
+ printk (KERN_ERR "Unable to read BCM5481_R18H_SV_PMII register\n");
+ return ret;
+ }
+
+ // Set the LPM bit in the data just read and write back to sv010
+ // The shadow register select bits [2:0] are set by reading the sv010
+ // register.
+ pmii_data |= BCM5481_R18H_SV010_LPM;
+ ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, pmii_data);
+ if(ret)
+ {
+ DEBUGOUT("Unable to write BCM5481_R18H register\n");
+ printk (KERN_ERR "Unable to write BCM5481_R18H register\n");
+ return ret;
+ }
+
+
+ // Set the RGMII RXD to RXC skew bit in reg 0x18, sv111
+
+ if (bcm5481_read_18sv (hw, BCM5481_R18H_SV_MCTRL, &mctrl_data))
+ {
+ DEBUGOUT("Unable to read BCM5481_R18H_SV_MCTRL register\n");
+ printk (KERN_ERR "Unable to read BCM5481_R18H_SV_MCTRL register\n");
+ return ret;
+ }
+ mctrl_data |= (BCM5481_R18H_WE | BCM5481_R18H_SV111_SKEW);
+
+ ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, mctrl_data);
+ if(ret)
+ {
+ DEBUGOUT("Unable to write BCM5481_R18H register\n");
+ printk (KERN_ERR "Unable to write BCM5481_R18H register\n");
+ return ret;
+ }
+
+ // Enable RGMII transmit clock delay in reg 0x1c, sv00011
+ ret = bcm5481_read_1csv (hw, BCM5481_R1CH_CACR, &cacr_data);
+ if (ret)
+ {
+ DEBUGOUT("Unable to read BCM5481_R1CH_CACR register\n");
+ printk (KERN_ERR "Unable to read BCM5481_R1CH_CACR register\n");
+ return ret;
+ }
+
+ cacr_data |= (BCM5481_R1CH_WE | BCM5481_R1CH_CACR_TCD);
+
+ ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, cacr_data);
+ if(ret)
+ {
+ DEBUGOUT("Unable to write BCM5481_R1CH register\n");
+ printk (KERN_ERR "Unable to write BCM5481_R1CH register\n");
+ return ret;
+ }
+
+ // Enable dual link speed indication (0x1c, sv 00010, bit 2)
+ ret = bcm5481_rmw_1csv (hw, BCM5481_R1CH_SC1, BCM5481_R1CH_SC1_LINK, BCM5481_R1CH_SC1_LINK);
+ if (ret)
+ return ret;
+
+ // Enable link and activity on ACTIVITY LED (0x1c, sv 01001, bit 4=1, bit 3=0)
+ ret = bcm5481_rmw_1csv (hw, BCM5481_R1CH_LCTRL, BCM5481_R1CH_LCTRL_ALEN, BCM5481_R1CH_LCTRL_ALEN | BCM5481_R1CH_LCTRL_AEN);
+ if (ret)
+ return ret;
+
+ return ret;
+}
--- a/Embedded/src/GbE/iegbe_oem_phy.h
+++ b/Embedded/src/GbE/iegbe_oem_phy.h
@@ -95,6 +95,8 @@ int32_t iegbe_oem_phy_is_link_up(struct
#define DEFAULT_ICP_XXXX_TIPG_IPGT 8 /* Inter Packet Gap Transmit Time */
#define ICP_XXXX_TIPG_IPGT_MASK 0x000003FFUL
+#define BCM5481_PHY_ID 0x0143BCA0
+#define BCM5395S_PHY_ID 0x0143BCF0
/* Miscellaneous defines */
#ifdef IEGBE_10_100_ONLY
@@ -103,5 +105,65 @@ int32_t iegbe_oem_phy_is_link_up(struct
#define ICP_XXXX_AUTONEG_ADV_DEFAULT 0x2F
#endif
+/* BCM5481 specifics */
+
+#define BCM5481_ECTRL (0x10)
+#define BCM5481_ESTAT (0x11)
+#define BCM5481_RXERR (0x12)
+#define BCM5481_EXPRW (0x15)
+#define BCM5481_EXPACC (0x17)
+#define BCM5481_ASTAT (0x19)
+#define BCM5481_R18H (0x18)
+#define BCM5481_R1CH (0x1c)
+
+/* indirect register access via register 18h */
+
+#define BCM5481_R18H_SV_MASK (7) // Mask for SV bits.
+#define BCM5481_R18H_SV_ACTRL (0) // SV000 Aux. control
+#define BCM5481_R18H_SV_10BT (1) // SV001 10Base-T
+#define BCM5481_R18H_SV_PMII (2) // SV010 Power/MII control
+#define BCM5481_R18H_SV_MTEST (4) // SV100 Misc. test
+#define BCM5481_R18H_SV_MCTRL (7) // SV111 Misc. control
+
+#define BCM5481_R18H_SV001_POL (1 << 13) // Polarity
+#define BCM5481_R18H_SV010_LPM (1 << 6)
+#define BCM5481_R18H_SV111_SKEW (1 << 8)
+#define BCM5481_R18H_WE (1 << 15) // Write enable
+
+// 0x1c registers
+#define BCM5481_R1CH_SV_SHIFT (10)
+#define BCM5481_R1CH_SV_MASK (0x1f)
+#define BCM5481_R1CH_SC1 (0x02) // sv00010 Spare control 1
+#define BCM5481_R1CH_CACR (0x03) // sv00011 Clock alignment control
+#define BCM5481_R1CH_LCTRL (0x09) // sv01001 LED control
+#define BCM5481_R1CH_LEDS1 (0x0d) // sv01101 LED selector 1
+
+// 0x1c common
+#define BCM5481_R1CH_WE (1 << 15) // Write enable
+
+// 0x1c, sv 00010
+#define BCM5481_R1CH_SC1_LINK (1 << 2) // sv00010 Linkspeed
+
+// 0x1c, sv 00011
+#define BCM5481_R1CH_CACR_TCD (1 << 9) // sv00011 RGMII tx clock delay
+
+// 0x1c, sv 01001
+#define BCM5481_R1CH_LCTRL_ALEN (1 << 4) // Activity/Link enable on ACTIVITY LED
+#define BCM5481_R1CH_LCTRL_AEN (1 << 3) // Activity enable on ACTIVITY LED
+
+#define BCM5481_ECTRL_DISMDIX (1 <<14)
+
+#define BCM5481_MCTRL_AUTOMDIX (1 <<9)
+
+#define BCM5481_ESTAT_LINK (1 << 8)
+
+#define BCM5481_ASTAT_ANC (1 << 15)
+#define BCM5481_ASTAT_ANHCD (7 << 8)
+#define BCM5481_ASTAT_HCD(x) ((x >> 8) & 7)
+#define BCM5481_ASTAT_1KBTFD (0x7)
+#define BCM5481_ASTAT_1KBTHD (0x6)
+#define BCM5481_ASTAT_100BTXFD (0x5)
+#define BCM5481_ASTAT_100BTXHD (0x3)
+
#endif /* ifndef _IEGBE_OEM_PHY_H_ */

@ -1,11 +0,0 @@
--- a/Embedded/src/CAN/icp_can_user.h
+++ b/Embedded/src/CAN/icp_can_user.h
@@ -63,6 +63,8 @@
#ifndef __ICP_CAN_USER_H__
#define __ICP_CAN_USER_H__
+#include <linux/ioctl.h>
+
/*****************************************************************************
* Device IO control codes.
*****************************************************************************/

@ -1,11 +0,0 @@
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -70,6 +70,8 @@
#include "can_main.h"
#include "can_ioctl.h"
+#include <linux/fs.h>
+
MODULE_AUTHOR("Intel(R) Corporation");
MODULE_DESCRIPTION("Controller Area Network Driver");

@ -1,23 +0,0 @@
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -654,7 +654,7 @@ int can_dev_io(struct inode *inode, stru
/*****************************************************************************
* Interrupt handler.
*****************************************************************************/
-irqreturn_t can_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t can_irq_handler(int irq, void *dev_id)
{
can_os_t *can_os = (can_os_t *) dev_id;
unsigned int int_status;
--- a/Embedded/src/CAN/can_main.h
+++ b/Embedded/src/CAN/can_main.h
@@ -165,8 +165,7 @@ int can_dev_io(
irqreturn_t can_irq_handler(
int irq,
- void *dev_id,
- struct pt_regs *regs);
+ void *dev_id);
void can_tasklet(
unsigned long arg

@ -1,40 +0,0 @@
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -214,8 +214,8 @@ int can_pci_probe(struct pci_dev *dev, c
spin_lock_init(&(g_can_os[can_num].int_spinlock));
spin_lock_init(&(g_can_os[can_num].open_spinlock));
- dev->dev.driver_data = (void *) &(g_can_os[can_num]);
- if (!dev->dev.driver_data)
+ dev_set_drvdata(&dev->dev, (void *) &(g_can_os[can_num]));
+ if (!dev_get_drvdata(&dev->dev))
{
printk("Couldn't create CAN device %d. Exiting.\n",
dev->device);
@@ -237,7 +237,7 @@ int can_pci_probe(struct pci_dev *dev, c
*****************************************************************************/
void can_pci_remove(struct pci_dev *dev)
{
- can_os_t *can_os = dev->dev.driver_data;
+ can_os_t *can_os = dev_get_drvdata(&dev->dev);
iounmap(can_os->pci_remap);
icp_can_destroy(can_os->can);
@@ -251,7 +251,7 @@ int can_pci_suspend(struct pci_dev *dev,
{
unsigned int i;
unsigned int int_status;
- can_os_t *can_os = dev->dev.driver_data;
+ can_os_t *can_os = dev_get_drvdata(&dev->dev);
int err;
/* Indicate that we are suspending */
@@ -322,7 +322,7 @@ int can_pci_suspend(struct pci_dev *dev,
int can_pci_resume(struct pci_dev *dev)
{
unsigned int i;
- can_os_t *can_os = dev->dev.driver_data;
+ can_os_t *can_os = dev_get_drvdata(&dev->dev);
/* Restore PCI CFG space */
pci_restore_state(dev);

@ -1,59 +0,0 @@
--- a/Embedded/src/WDT/iwdt.c
+++ b/Embedded/src/WDT/iwdt.c
@@ -180,19 +180,19 @@ MODULE_PARM_DESC(wdt_scale, "Intel WDT s
module_param(wdt_intr_type, byte, WDT_INT_TYPE_IRQ);
MODULE_PARM_DESC(wdt_intr_type, "Intel WDT interrupt type (default SERIRQ).");
-module_param(wdt_margin1, uint, TIMER_MARGIN);
+module_param(wdt_margin1, uint, 0);
MODULE_PARM_DESC(wdt_margin1, "First stage Intel WDT timeout in steps of 1 ms by default.");
-module_param(wdt_margin2, uint, TIMER_MARGIN);
+module_param(wdt_margin2, uint, 0);
MODULE_PARM_DESC(wdt_margin2, "Second stage Intel WDT timeout in steps of 1 ms by default.");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Intel WDT can't be stopped once started (default=0)");
-module_param(wdt_index_port, int, 0x4E);
+module_param(wdt_index_port, int, 0);
MODULE_PARM_DESC(wdt_index_port, "WDT Index Port (default 0x4e)");
-module_param(wdt_data_port, int, 0x4E);
+module_param(wdt_data_port, int, 0);
MODULE_PARM_DESC(wdt_data_port, "WDT Data Port (default 0x4f)");
static int wdt_get_iobase(struct pci_dev *dev, u16 *iobase, int *irq);
@@ -218,7 +218,7 @@ static ssize_t wdt_write(struct file *fi
size_t count, loff_t * pos);
static int wdt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
-static irqreturn_t wdt_isr(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t wdt_isr(int irq, void *dev_id);
static void __exit wdt_cleanup(void);
static int __init wdt_init(void);
static int __init wdt_init_one(struct pci_dev *dev,
@@ -255,7 +255,7 @@ static struct pci_driver wdt_driver = {
name: "iwdt",
id_table: lpc_pci_tbl,
probe: wdt_init_one,
- remove: __devexit(wdt_remove_one),
+ remove: __devexit_p(wdt_remove_one),
suspend: wdt_pci_suspend,
resume: wdt_pci_resume,
};
@@ -1393,12 +1393,12 @@ static int wdt_ioctl(struct inode *inode
/*
* Function Name: wdt_isr()
- * Parameter: int irq - irq number, void *dev_id, struct pt_regs *regs
+ * Parameter: int irq - irq number, void *dev_id
* Return Value:: IRQ_NONE - if the interrupt is not for wdt.
* IRQ_HANDLED - if it is for wdt.
* Description: This is the interrupt service routine of the WDT.
*/
-static irqreturn_t wdt_isr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t wdt_isr(int irq, void *dev_id)
{
u8 val;

@ -1,22 +0,0 @@
--- a/Embedded/src/EDMA/dma_linux.c
+++ b/Embedded/src/EDMA/dma_linux.c
@@ -149,8 +149,7 @@ int32_t edma_suspend (struct pci_dev *de
int32_t edma_resume(struct pci_dev *dev);
int32_t initialize_edma_device(struct edma_device *device);
-static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id,
- struct pt_regs * regs);
+static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id);
/* Prototypes - Misc. */
@@ -429,8 +428,7 @@ int32_t edma_release(struct inode * inod
* Return Values: HANDLED = 1, NOT_HANDLED = 0
*****************************************************************************/
-static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id,
- struct pt_regs * regs)
+static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id)
{
uint32_t clear_bits;

@ -1,22 +0,0 @@
--- a/Embedded/src/1588/1588.c
+++ b/Embedded/src/1588/1588.c
@@ -631,7 +631,7 @@ int restore_interrupts(void)
IRQ_NONE => this device did not interrupt
******************************************************************************/
-irqreturn_t timesync_isr(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t timesync_isr(int irq, void *dev_id)
{
if ( !ixTimeSyncAccEventAmmsFlagGet() && !ixTimeSyncAccEventAsmsFlagGet()&&
!ixTimeSyncAccEventAtmFlagGet() && !ixTimeSyncAccEventPpsmFlagGet()&&
--- a/Embedded/src/1588/1588.h
+++ b/Embedded/src/1588/1588.h
@@ -128,7 +128,7 @@ int pci_suspend(struct pci_dev *dev, pm_
int pci_resume(struct pci_dev *dev);
int pci_probe(struct pci_dev *dev, const struct pci_device_id *id);
void pci_remove(struct pci_dev *dev);
-irqreturn_t timesync_isr(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t timesync_isr(int irq, void *dev_id);
// private functions
int save_reg_state(void);

@ -1,22 +0,0 @@
--- a/Embedded/src/CAN/can_main.h
+++ b/Embedded/src/CAN/can_main.h
@@ -65,7 +65,7 @@
#include <linux/interrupt.h>
#include <linux/pci.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
#include <linux/spinlock.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
--- a/Embedded/src/EDMA/dma_linux.c
+++ b/Embedded/src/EDMA/dma_linux.c
@@ -87,7 +87,7 @@
#include <linux/fcntl.h> /* O_ACCMODE */
#include <asm/system.h> /* cli, *_flags */
#include <asm/uaccess.h> /* copy_to_user */
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
#include <asm/io.h> /* inb(), outb() */
#include <linux/kmod.h>
#include <linux/ioport.h> /* request_region */

@ -1,30 +0,0 @@
--- a/Embedded/src/1588/1588.c
+++ b/Embedded/src/1588/1588.c
@@ -72,6 +72,7 @@
*
****************************************************************************/
+#include <linux/sched.h>
#include "1588.h"
MODULE_AUTHOR("Intel(R) Corporation");
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -68,6 +68,7 @@
*
**************************************************************************/
+#include <linux/sched.h>
#include "can_main.h"
#include "can_ioctl.h"
#include <linux/fs.h>
--- a/Embedded/src/WDT/iwdt.c
+++ b/Embedded/src/WDT/iwdt.c
@@ -137,6 +137,7 @@
#include <linux/watchdog.h>
#include <linux/miscdevice.h>
#include <linux/interrupt.h>
+#include <linux/sched.h>
#include "iwdt.h"
MODULE_AUTHOR("Intel(R) Corporation");

@ -1,31 +0,0 @@
--- a/Embedded/src/GbE/kcompat.h
+++ b/Embedded/src/GbE/kcompat.h
@@ -46,12 +46,6 @@ GPL LICENSE SUMMARY
#include <linux/sched.h>
#include <asm/io.h>
-#ifndef IRQ_HANDLED
-#define irqreturn_t void
-#define IRQ_HANDLED
-#define IRQ_NONE
-#endif
-
#ifndef SET_NETDEV_DEV
#define SET_NETDEV_DEV(net, pdev)
#endif
@@ -748,6 +742,15 @@ extern void dump_stack(void);
#endif /* 2.4.24 */
+/*****************************************************************************/
+#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) )
+#ifndef IRQ_HANDLED
+#define irqreturn_t void
+#define IRQ_HANDLED
+#define IRQ_NONE
+#endif
+#endif /* < 2.6.30 */
+
#endif /* _KCOMPAT_H_ */

@ -1,11 +0,0 @@
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -3534,7 +3534,7 @@ static int iegbe_clean(struct napi_struc
int tx_cleaned = 0, work_done = 0;
/* Must NOT use netdev_priv macro here. */
- adapter = poll_dev->priv;
+ adapter = netdev_priv(poll_dev);
/* iegbe_clean is called per-cpu. This lock protects
* tx_ring[0] from being cleaned by multiple cpus

@ -1,91 +0,0 @@
--- a/Embedded/src/GbE/Makefile
+++ b/Embedded/src/GbE/Makefile
@@ -60,19 +60,19 @@ GBE_NAME = iegbe
GCU_NAME = gcu
VERSION_FILE := $(KSRC)/include/linux/version.h
-UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h
-CONFIG_FILE := $(KSRC)/include/linux/autoconf.h
+UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h
+CONFIG_FILE := $(KSRC)/include/generated/autoconf.h
ifeq (,$(wildcard $(VERSION_FILE)))
$(error Linux kernel source not configured - missing version.h)
endif
ifeq (,$(wildcard $(CONFIG_FILE)))
- $(error Linux kernel source not configured - missing autoconf.h)
+ $(error Linux kernel source not configured - missing autoconf.h)
endif
ifeq (,$(wildcard $(UTS_REL_FILE)))
- $(error Linux kernel source not configured - missing utsrelease.h)
+ $(error Linux kernel source not configured - missing utsrelease.h)
endif
# set the install path
--- a/Embedded/src/1588/Makefile
+++ b/Embedded/src/1588/Makefile
@@ -97,8 +97,8 @@ OUTPUT_PATH ?= /
EXTRA_LDFLAGS += -whole-archive
VERSION_FILE := $(KOBJ)/include/linux/version.h
-UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h
-CONFIG_FILE := $(KOBJ)/include/linux/autoconf.h
+UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h
+CONFIG_FILE := $(KOBJ)/include/generated/autoconf.h
# as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h
--- a/Embedded/src/CAN/Makefile
+++ b/Embedded/src/CAN/Makefile
@@ -100,8 +100,8 @@ OUTPUT_PATH ?= /
EXTRA_LDFLAGS += -whole-archive
VERSION_FILE := $(KOBJ)/include/linux/version.h
-UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h
-CONFIG_FILE := $(KOBJ)/include/linux/autoconf.h
+UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h
+CONFIG_FILE := $(KOBJ)/include/generated/autoconf.h
# as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h
--- a/Embedded/src/EDMA/Makefile
+++ b/Embedded/src/EDMA/Makefile
@@ -114,8 +114,8 @@ OUTPUT_PATH ?= /
EXTRA_LDFLAGS += -whole-archive
VERSION_FILE := $(KOBJ)/include/linux/version.h
-UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h
-CONFIG_FILE := $(KOBJ)/include/linux/autoconf.h
+UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h
+CONFIG_FILE := $(KOBJ)/include/generated/autoconf.h
# as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h
--- a/Embedded/src/GPIO/Makefile
+++ b/Embedded/src/GPIO/Makefile
@@ -97,8 +97,8 @@ OUTPUT_PATH ?= /
EXTRA_LDFLAGS += -whole-archive
VERSION_FILE := $(KOBJ)/include/linux/version.h
-UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h
-CONFIG_FILE := $(KOBJ)/include/linux/autoconf.h
+UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h
+CONFIG_FILE := $(KOBJ)/include/generated/autoconf.h
# as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h
--- a/Embedded/src/WDT/Makefile
+++ b/Embedded/src/WDT/Makefile
@@ -99,8 +99,8 @@ OUTPUT_PATH ?= /
EXTRA_LDFLAGS += -whole-archive
VERSION_FILE := $(KOBJ)/include/linux/version.h
-UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h
-CONFIG_FILE := $(KOBJ)/include/linux/autoconf.h
+UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h
+CONFIG_FILE := $(KOBJ)/include/generated/autoconf.h
# as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h

@ -1,392 +0,0 @@
--- a/Embedded/src/GbE/kcompat.h
+++ b/Embedded/src/GbE/kcompat.h
@@ -590,6 +590,10 @@ static inline void _kc_synchronize_irq()
#define ETHTOOL_OPS_COMPAT
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
+#define HAVE_NETIF_MSG 1
+#endif
+
#ifndef HAVE_NETIF_MSG
#define HAVE_NETIF_MSG 1
enum {
--- a/Embedded/src/GbE/iegbe_main.c
+++ b/Embedded/src/GbE/iegbe_main.c
@@ -159,9 +159,9 @@ static void iegbe_smartspeed(struct iegb
static inline int iegbe_82547_fifo_workaround(struct iegbe_adapter *adapter,
struct sk_buff *skb);
-static void iegbe_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp);
-static void iegbe_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
-static void iegbe_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
+static bool iegbe_vlan_used(struct iegbe_adapter *adapter);
+static int iegbe_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
+static int iegbe_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
static void iegbe_restore_vlan(struct iegbe_adapter *adapter);
static int iegbe_notify_reboot(struct notifier_block *,
@@ -324,8 +324,8 @@ static void iegbe_update_mng_vlan(struct
struct net_device *netdev = adapter->netdev;
u16 vid = hw->mng_cookie.vlan_id;
u16 old_vid = adapter->mng_vlan_id;
- if (adapter->vlgrp) {
- if (!vlan_group_get_device(adapter->vlgrp, vid)) {
+ if (iegbe_vlan_used(adapter)) {
+ if (!test_bit(old_vid, adapter->active_vlans)) {
if (hw->mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) {
iegbe_vlan_rx_add_vid(netdev, vid);
@@ -335,7 +335,7 @@ static void iegbe_update_mng_vlan(struct
if ((old_vid != (u16)E1000_MNG_VLAN_NONE) &&
(vid != old_vid) &&
- !vlan_group_get_device(adapter->vlgrp, old_vid))
+ !test_bit(old_vid, adapter->active_vlans))
iegbe_vlan_rx_kill_vid(netdev, old_vid);
} else
adapter->mng_vlan_id = vid;
@@ -736,7 +736,6 @@ static const struct net_device_ops iegbe
.ndo_do_ioctl = iegbe_ioctl,
.ndo_validate_addr = eth_validate_addr,
- .ndo_vlan_rx_register = iegbe_vlan_rx_register,
.ndo_vlan_rx_add_vid = iegbe_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid,
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -767,7 +766,6 @@ static int __devinit iegbe_probe(struct
u16 eeprom_data = 0;
u16 eeprom_apme_mask = E1000_EEPROM_APME;
int bars;
- DECLARE_MAC_BUF(mac);
bars = pci_select_bars(pdev, IORESOURCE_MEM);
err = pci_enable_device(pdev);
@@ -1247,8 +1245,7 @@ static int iegbe_close(struct net_device
if ((hw->mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
- !(adapter->vlgrp &&
- vlan_group_get_device(adapter->vlgrp, adapter->mng_vlan_id))) {
+ !test_bit(adapter->mng_vlan_id, adapter->active_vlans)) {
iegbe_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
}
return 0;
@@ -2163,11 +2160,13 @@ static void iegbe_set_rx_mode(struct net
struct iegbe_hw *hw = &adapter->hw;
struct netdev_hw_addr *ha;
bool use_uc = false;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
struct dev_addr_list *mc_ptr;
- u32 rctl;
u32 hash_value;
- int i, rar_entries = E1000_RAR_ENTRIES;
int mta_reg_count = E1000_NUM_MTA_REGISTERS;
+#endif
+ u32 rctl;
+ int i, rar_entries = E1000_RAR_ENTRIES;
/* reserve RAR[14] for LAA over-write work-around */
if (hw->mac_type == iegbe_82571)
@@ -2220,6 +2219,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
WARN_ON(i == rar_entries);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
mc_ptr = netdev->mc_list;
for (; i < rar_entries; i++) {
@@ -2247,6 +2247,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
hash_value = iegbe_hash_mc_addr(hw, mc_ptr->da_addr);
iegbe_mta_set(hw, hash_value);
}
+#endif
if (hw->mac_type == iegbe_82542_rev2_0)
iegbe_leave_82542_rst(adapter);
@@ -2821,14 +2822,14 @@ static int iegbe_tx_map(struct iegbe_ada
* Avoid terminating buffers within evenly-aligned
* dwords. */
if(unlikely(adapter->pcix_82544 &&
- !((unsigned long)(frag->page+offset+size-1) & 4) &&
+ !((unsigned long)(frag->page.p+offset+size-1) & 4) &&
size > 4))
size -= 4;
buffer_info->length = size;
buffer_info->dma =
pci_map_page(adapter->pdev,
- frag->page,
+ frag->page.p,
offset,
size,
PCI_DMA_TODEVICE);
@@ -3131,7 +3132,7 @@ static int iegbe_xmit_frame(struct sk_bu
}
}
- if (unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) {
+ if (unlikely(iegbe_vlan_used(adapter) && vlan_tx_tag_present(skb))) {
tx_flags |= E1000_TX_FLAGS_VLAN;
tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT);
}
@@ -3832,10 +3833,12 @@ static bool iegbe_clean_rx_irq(struct ie
skb->protocol = eth_type_trans(skb, netdev);
- if (unlikely(adapter->vlgrp &&
+ if (unlikely(iegbe_vlan_used(adapter) &&
(status & E1000_RXD_STAT_VP))) {
- vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
- le16_to_cpu(rx_desc->special));
+ u16 vid;
+
+ vid = le16_to_cpu(rx_desc->special);
+ __vlan_hwaccel_put_tag(skb, vid);
} else {
netif_receive_skb(skb);
}
@@ -3986,9 +3989,10 @@ copydone:
cpu_to_le16(E1000_RXDPS_HDRSTAT_HDRSP)))
adapter->rx_hdr_split++;
- if(unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) {
- vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
- le16_to_cpu(rx_desc->wb.middle.vlan));
+ if(unlikely(iegbe_vlan_used(adapter) && (staterr & E1000_RXD_STAT_VP))) {
+ u16 vid;
+ vid = le16_to_cpu(rx_desc->wb.middle.vlan);
+ __vlan_hwaccel_put_tag(skb, vid);
} else {
netif_receive_skb(skb);
}
@@ -4496,17 +4500,25 @@ iegbe_io_write(struct iegbe_hw *hw, unsi
outl(value, port);
}
-static void iegbe_vlan_rx_register(struct net_device *netdev,
- struct vlan_group *grp)
+static bool iegbe_vlan_used(struct iegbe_adapter *adapter)
+{
+ u16 vid;
+
+ for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
+ return true;
+
+ return false;
+}
+
+static void iegbe_vlan_mode(struct net_device *netdev, bool vlan_on)
{
struct iegbe_adapter *adapter = netdev_priv(netdev);
uint32_t ctrl, rctl;
if (!test_bit(__E1000_DOWN, &adapter->flags))
iegbe_irq_disable(adapter);
- adapter->vlgrp = grp;
- if(grp) {
+ if(vlan_on) {
/* enable VLAN tag insert/strip */
ctrl = E1000_READ_REG(&adapter->hw, CTRL);
ctrl |= E1000_CTRL_VME;
@@ -4538,30 +4550,37 @@ static void iegbe_vlan_rx_register(struc
iegbe_irq_enable(adapter);
}
-static void iegbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+static int iegbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
{
struct iegbe_adapter *adapter = netdev_priv(netdev);
uint32_t vfta, index;
if((adapter->hw.mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
(vid == adapter->mng_vlan_id)) {
- return;
+ return 0;
}
+
+ if (!iegbe_vlan_used(adapter))
+ iegbe_vlan_mode(netdev, true);
+
/* add VID to filter table */
index = (vid >> 0x5) & 0x7F;
vfta = E1000_READ_REG_ARRAY(&adapter->hw, VFTA, index);
vfta |= (0x1 << (vid & 0x1F));
iegbe_write_vfta(&adapter->hw, index, vfta);
+
+ set_bit(vid, adapter->active_vlans);
+
+ return 0;
}
-static void iegbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+static int iegbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
{
struct iegbe_adapter *adapter = netdev_priv(netdev);
u32 vfta, index;
if (!test_bit(__E1000_DOWN, &adapter->flags))
iegbe_irq_disable(adapter);
- vlan_group_set_device(adapter->vlgrp, vid, NULL);
if (!test_bit(__E1000_DOWN, &adapter->flags))
iegbe_irq_enable(adapter);
@@ -4570,21 +4589,26 @@ static void iegbe_vlan_rx_kill_vid(struc
vfta = E1000_READ_REG_ARRAY(&adapter->hw, VFTA, index);
vfta &= ~(0x1 << (vid & 0x1F));
iegbe_write_vfta(&adapter->hw, index, vfta);
+
+ clear_bit(vid, adapter->active_vlans);
+
+ if (!iegbe_vlan_used(adapter))
+ iegbe_vlan_mode(netdev, false);
+
+ return 0;
}
static void iegbe_restore_vlan(struct iegbe_adapter *adapter)
{
- iegbe_vlan_rx_register(adapter->netdev, adapter->vlgrp);
-
- if (adapter->vlgrp) {
u16 vid;
- for (vid = 0x0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
- if (!vlan_group_get_device(adapter->vlgrp, vid))
- continue;
+
+ if (!iegbe_vlan_used(adapter))
+ return;
+
+ iegbe_vlan_mode(adapter->netdev, true);
+ for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
iegbe_vlan_rx_add_vid(adapter->netdev, vid);
}
- }
-}
int iegbe_set_spd_dplx(struct iegbe_adapter *adapter, u16 spddplx)
@@ -4864,10 +4888,11 @@ iegbe_resume(struct pci_dev *pdev)
default:
break;
}
-#endif
return 0x0;
}
+#endif
+
#ifdef CONFIG_NET_POLL_CONTROLLER
/*
--- a/Embedded/src/GbE/iegbe_ethtool.c
+++ b/Embedded/src/GbE/iegbe_ethtool.c
@@ -327,6 +327,7 @@ iegbe_set_pauseparam(struct net_device *
return 0;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
static uint32_t
iegbe_get_rx_csum(struct net_device *netdev)
{
@@ -392,6 +393,7 @@ iegbe_set_tso(struct net_device *netdev,
return 0;
}
#endif /* NETIF_F_TSO */
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
static uint32_t
iegbe_get_msglevel(struct net_device *netdev)
@@ -807,6 +809,7 @@ err_setup_rx:
E1000_82542_##R : E1000_##R; \
return 1; } }
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
static int
iegbe_reg_test(struct iegbe_adapter *adapter, uint64_t *data)
{
@@ -1710,6 +1713,7 @@ iegbe_diag_test(struct net_device *netde
}
msleep_interruptible(0xfa0);
}
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
static void
iegbe_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
@@ -1812,6 +1816,7 @@ iegbe_set_wol(struct net_device *netdev,
/* bit defines for adapter->led_status */
#define E1000_LED_ON 0
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
static void
iegbe_led_blink_callback(unsigned long data)
{
@@ -1864,6 +1869,7 @@ iegbe_phys_id(struct net_device *netdev,
return 0;
}
+#endif
static int
iegbe_nway_reset(struct net_device *netdev)
@@ -1876,11 +1882,13 @@ iegbe_nway_reset(struct net_device *netd
return 0;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
static int
iegbe_get_stats_count(struct net_device *netdev)
{
return E1000_STATS_LEN;
}
+#endif
static void
iegbe_get_ethtool_stats(struct net_device *netdev,
@@ -1936,6 +1944,8 @@ struct ethtool_ops iegbe_ethtool_ops = {
.set_ringparam = iegbe_set_ringparam,
.get_pauseparam = iegbe_get_pauseparam,
.set_pauseparam = iegbe_set_pauseparam,
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
.get_rx_csum = iegbe_get_rx_csum,
.set_rx_csum = iegbe_set_rx_csum,
.get_tx_csum = iegbe_get_tx_csum,
@@ -1946,11 +1956,13 @@ struct ethtool_ops iegbe_ethtool_ops = {
.get_tso = ethtool_op_get_tso,
.set_tso = iegbe_set_tso,
#endif
+
.self_test_count = iegbe_diag_test_count,
.self_test = iegbe_diag_test,
- .get_strings = iegbe_get_strings,
.phys_id = iegbe_phys_id,
.get_stats_count = iegbe_get_stats_count,
+#endif
+ .get_strings = iegbe_get_strings,
.get_ethtool_stats = iegbe_get_ethtool_stats,
};
--- a/Embedded/src/GbE/gcu_main.c
+++ b/Embedded/src/GbE/gcu_main.c
@@ -93,7 +93,7 @@ static struct pci_driver gcu_driver = {
};
static struct gcu_adapter *global_adapter = 0;
-static spinlock_t global_adapter_spinlock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(global_adapter_spinlock);
static unsigned long g_intflags = 0;
MODULE_AUTHOR("Intel(R) Corporation");
--- a/Embedded/src/GbE/iegbe.h
+++ b/Embedded/src/GbE/iegbe.h
@@ -257,7 +257,7 @@ struct iegbe_adapter {
struct timer_list tx_fifo_stall_timer;
struct timer_list watchdog_timer;
struct timer_list phy_info_timer;
- struct vlan_group *vlgrp;
+ unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
uint16_t mng_vlan_id;
uint32_t bd_number;
uint32_t rx_buffer_len;

@ -1,41 +0,0 @@
--- a/Embedded/src/CAN/can_main.c
+++ b/Embedded/src/CAN/can_main.c
@@ -72,6 +72,7 @@
#include "can_main.h"
#include "can_ioctl.h"
#include <linux/fs.h>
+#include <linux/module.h>
MODULE_AUTHOR("Intel(R) Corporation");
@@ -110,7 +111,7 @@ struct file_operations file_ops = {
.owner = THIS_MODULE,
.read = can_read,
.write = can_write,
- .ioctl = can_dev_io,
+ .unlocked_ioctl = can_dev_io,
.open = can_open,
.release = can_release
};
@@ -594,8 +595,7 @@ int icp_can_reset(can_os_t *can_os)
/*****************************************************************************
* Device IO control function. Used by user apps to configure CAN device.
*****************************************************************************/
-int can_dev_io(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
+long can_dev_io(struct file *filp, unsigned int cmd, unsigned long arg)
{
can_os_t *can_os;
unsigned int err=0;
--- a/Embedded/src/CAN/can_main.h
+++ b/Embedded/src/CAN/can_main.h
@@ -157,8 +157,7 @@ ssize_t can_write(
int icp_can_reset(
can_os_t *can_os);
-int can_dev_io(
- struct inode *inode,
+long can_dev_io(
struct file *filp,
unsigned int cmd,
unsigned long arg);

@ -1,33 +0,0 @@
--- a/Embedded/src/GPIO/gpio.h
+++ b/Embedded/src/GPIO/gpio.h
@@ -121,8 +121,7 @@ int gpio_init(void);
void gpio_close(void);
int gpio_open(struct inode *inode, struct file *filp);
int gpio_release(struct inode *inode, struct file *filp);
-int gpio_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
+long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
// private driver functions
int gpio_getpininfo(int Signal, char *pBuff);
@@ -134,7 +133,7 @@ struct file_operations file_ops =
.owner = THIS_MODULE,
.open = gpio_open,
.release = gpio_release,
- .ioctl = gpio_ioctl,
+ .unlocked_ioctl = gpio_ioctl,
};
#endif
--- a/Embedded/src/GPIO/gpio_ref.c
+++ b/Embedded/src/GPIO/gpio_ref.c
@@ -251,8 +251,7 @@ int gpio_release(struct inode *inode, st
0 => success
< 0 => error
******************************************************************************/
-int gpio_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
+long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
gpio_ioctl_t Info;
u_int bitstr = 0;

@ -1,31 +0,0 @@
--- a/Embedded/src/WDT/iwdt.c
+++ b/Embedded/src/WDT/iwdt.c
@@ -217,8 +217,7 @@ static int wdt_open(struct inode *inode,
static int wdt_release(struct inode *inode, struct file *file);
static ssize_t wdt_write(struct file *file, const char *data,
size_t count, loff_t * pos);
-static int wdt_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg);
+static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
static irqreturn_t wdt_isr(int irq, void *dev_id);
static void __exit wdt_cleanup(void);
static int __init wdt_init(void);
@@ -243,7 +242,7 @@ static struct pci_device_id lpc_pci_tbl[
static struct file_operations wdt_fops = {
owner: THIS_MODULE,
write: wdt_write,
- ioctl: wdt_ioctl,
+ unlocked_ioctl: wdt_ioctl,
open: wdt_open,
release: wdt_release,
};
@@ -1201,8 +1200,7 @@ char *wdt_get_ioctl_string(unsigned int
* Return Value: 0 - successful, negative value - failed.
* Description: This function is used to provide IO interface.
*/
-static int wdt_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
u8 mode=0, scale=0, int_type=0;
u32 u_margin=0, dcount=0;

@ -1,33 +0,0 @@
--- a/Embedded/src/1588/1588.c
+++ b/Embedded/src/1588/1588.c
@@ -664,8 +664,7 @@ irqreturn_t timesync_isr(int irq, void *
0 => success
< 0 => error
******************************************************************************/
-int timesync_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
+long timesync_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
wait_queue_head_t *event = NULL;
unsigned int bytes_ret = 0;
--- a/Embedded/src/1588/1588.h
+++ b/Embedded/src/1588/1588.h
@@ -121,8 +121,7 @@ MODULE_DEVICE_TABLE(pci, pci_ids);
// Linux functions
int timesync_open(struct inode *inode, struct file *filp);
int timesync_release(struct inode *inode, struct file *filp);
-int timesync_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
+long timesync_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
void timesync_close(void);
int pci_suspend(struct pci_dev *dev, pm_message_t state);
int pci_resume(struct pci_dev *dev);
@@ -142,7 +141,7 @@ struct file_operations file_ops =
.owner = THIS_MODULE,
.open = timesync_open,
.release = timesync_release,
- .ioctl = timesync_ioctl,
+ .unlocked_ioctl = timesync_ioctl,
};
// Linux pci operations
Loading…
Cancel
Save