From bc3a52d5a1c459276564790916fa77fd80be499a Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 11 Dec 2009 21:33:56 -0800 Subject: [PATCH] Add backport for Atheros ethernet drivers: atl1x, atl1e, atl1c Signed-off-by: Luis R. Rodriguez --- Makefile | 2 +- config.mk | 6 ++ patches/01-netdev.patch | 146 ++++++++++++++++++++++++++++++++++++++++ scripts/admin-update.sh | 15 ++++- 4 files changed, 166 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1693226f5d9b..bb07bbac9906 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ obj-$(CONFIG_COMPAT_BT) += net/bluetooth/ obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) += drivers/bluetooth/ -#obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ +obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/misc/eeprom/ # Sorry ssb requires pcmica backport for 2.6.33 which is not done yet # drivers/ssb/ diff --git a/config.mk b/config.mk index 874c27e13565..726130f71599 100644 --- a/config.mk +++ b/config.mk @@ -301,6 +301,12 @@ CONFIG_PCI_ATMEL=m CONFIG_MWL8K=m +# Ethernet drivers go here +CONFIG_ATL1=m +CONFIG_ATL2=m +CONFIG_ATL1E=m +CONFIG_ATL1C=m + endif ## end of PCI diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch index 86bf1a98001b..67223d28e793 100644 --- a/patches/01-netdev.patch +++ b/patches/01-netdev.patch @@ -611,3 +611,149 @@ diff -Nur a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c dev->watchdog_timeo = HZ * 2; } +--- a/drivers/net/atl1e/atl1e_main.c 2009-12-11 21:11:18.000000000 -0800 ++++ b/drivers/net/atl1e/atl1e_main.c 2009-12-11 21:11:46.000000000 -0800 +@@ -2219,6 +2219,7 @@ static void atl1e_shutdown(struct pci_de + atl1e_suspend(pdev, PMSG_SUSPEND); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + static const struct net_device_ops atl1e_netdev_ops = { + .ndo_open = atl1e_open, + .ndo_stop = atl1e_close, +@@ -2236,6 +2237,7 @@ static const struct net_device_ops atl1e + #endif + + }; ++#endif + + static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) + { +@@ -2243,7 +2245,18 @@ static int atl1e_init_netdev(struct net_ + pci_set_drvdata(pdev, netdev); + + netdev->irq = pdev->irq; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + netdev->netdev_ops = &atl1e_netdev_ops; ++#else ++ netdev->change_mtu = atl1e_change_mtu; ++ netdev->hard_start_xmit = atl1e_xmit_frame; ++ netdev->open = atl1e_open; ++ netdev->stop = atl1e_close; ++ netdev->tx_timeout = atl1e_tx_timeout; ++ netdev->set_mac_address = atl1e_set_mac_addr; ++ netdev->do_ioctl = atl1e_ioctl; ++ netdev->get_stats = atl1e_get_stats; ++#endif + + netdev->watchdog_timeo = AT_TX_WATCHDOG; + atl1e_set_ethtool_ops(netdev); +--- a/drivers/net/atl1c/atl1c_main.c 2009-12-11 20:28:31.000000000 -0800 ++++ b/drivers/net/atl1c/atl1c_main.c 2009-12-11 21:12:05.000000000 -0800 +@@ -2439,6 +2439,7 @@ static void atl1c_shutdown(struct pci_de + atl1c_suspend(pdev, PMSG_SUSPEND); + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + static const struct net_device_ops atl1c_netdev_ops = { + .ndo_open = atl1c_open, + .ndo_stop = atl1c_close, +@@ -2455,6 +2456,7 @@ static const struct net_device_ops atl1c + .ndo_poll_controller = atl1c_netpoll, + #endif + }; ++#endif + + static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev) + { +@@ -2462,7 +2464,18 @@ static int atl1c_init_netdev(struct net_ + pci_set_drvdata(pdev, netdev); + + netdev->irq = pdev->irq; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + netdev->netdev_ops = &atl1c_netdev_ops; ++#else ++ netdev->change_mtu = atl1c_change_mtu; ++ netdev->hard_start_xmit = atl1c_xmit_frame; ++ netdev->open = atl1c_open; ++ netdev->stop = atl1c_close; ++ netdev->tx_timeout = atl1c_tx_timeout; ++ netdev->set_mac_address = atl1c_set_mac_addr; ++ netdev->do_ioctl = atl1c_ioctl; ++ netdev->get_stats = atl1c_get_stats; ++#endif + netdev->watchdog_timeo = AT_TX_WATCHDOG; + atl1c_set_ethtool_ops(netdev); + +--- drivers/net/atlx/atl1.c.orig 2009-12-11 21:14:54.000000000 -0800 ++++ drivers/net/atlx/atl1.c 2009-12-11 21:29:39.000000000 -0800 +@@ -2878,6 +2878,7 @@ static void atl1_poll_controller(struct + } + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + static const struct net_device_ops atl1_netdev_ops = { + .ndo_open = atl1_open, + .ndo_stop = atl1_close, +@@ -2893,6 +2894,7 @@ static const struct net_device_ops atl1_ + .ndo_poll_controller = atl1_poll_controller, + #endif + }; ++#endif + + /* + * atl1_probe - Device Initialization Routine +@@ -2981,7 +2983,17 @@ static int __devinit atl1_probe(struct p + adapter->mii.phy_id_mask = 0x1f; + adapter->mii.reg_num_mask = 0x1f; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + netdev->netdev_ops = &atl1_netdev_ops; ++#else ++ netdev->change_mtu = atl1_change_mtu; ++ netdev->hard_start_xmit = atl1_xmit_frame; ++ netdev->open = atl1_open; ++ netdev->stop = atl1_close; ++ netdev->tx_timeout = atlx_tx_timeout; ++ netdev->set_mac_address = atl1_set_mac; ++ netdev->do_ioctl = atlx_ioctl; ++#endif + netdev->watchdog_timeo = 5 * HZ; + + netdev->ethtool_ops = &atl1_ethtool_ops; +--- drivers/net/atlx/atl2.c.orig 2009-12-11 21:21:51.000000000 -0800 ++++ drivers/net/atlx/atl2.c 2009-12-11 21:28:17.000000000 -0800 +@@ -1306,6 +1306,7 @@ static void atl2_poll_controller(struct + #endif + + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + static const struct net_device_ops atl2_netdev_ops = { + .ndo_open = atl2_open, + .ndo_stop = atl2_close, +@@ -1321,6 +1322,7 @@ static const struct net_device_ops atl2_ + .ndo_poll_controller = atl2_poll_controller, + #endif + }; ++#endif + + /* + * atl2_probe - Device Initialization Routine +@@ -1395,7 +1397,17 @@ static int __devinit atl2_probe(struct p + + atl2_setup_pcicmd(pdev); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + netdev->netdev_ops = &atl2_netdev_ops; ++#else ++ netdev->change_mtu = atl2_change_mtu; ++ netdev->hard_start_xmit = atl2_xmit_frame; ++ netdev->open = atl2_open; ++ netdev->stop = atl2_close; ++ netdev->tx_timeout = atl2_tx_timeout; ++ netdev->set_mac_address = atl2_set_mac; ++ netdev->do_ioctl = atl2_ioctl; ++#endif + atl2_set_ethtool_ops(netdev); + netdev->watchdog_timeo = 5 * HZ; + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index f8bf87a3a6a7..78652d2b20b5 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -97,6 +97,13 @@ DRIVERS="$DRIVERS drivers/net/wireless/libertas_tf" DRIVERS="$DRIVERS drivers/net/wireless/ipw2x00" DRIVERS="$DRIVERS drivers/net/wireless/wl12xx" DRIVERS="$DRIVERS drivers/net/wireless/iwmc3200wifi" + +# Ethernet drivers +DRIVERS="$DRIVERS drivers/net/atl1c/" +DRIVERS="$DRIVERS drivers/net/atl1e/" +DRIVERS="$DRIVERS drivers/net/atlx/" + +# Bluetooth drivers DRIVERS_BT="drivers/bluetooth" # Drivers that belong the the wireless directory @@ -193,11 +200,15 @@ for i in $RNDIS_REQS; do cp $GIT_TREE/$DIR/$i $DIR/ done -# b44 is dependent on ssb, so its has to be rebuilt as well. DIR="drivers/net" +echo > $DIR/Makefile cp $GIT_TREE/$DIR/b44.[ch] $DIR # Not yet -#echo "obj-\$(CONFIG_B44) += b44.o" > $DIR/Makefile +#echo "obj-\$(CONFIG_B44) += b44.o" >> $DIR/Makefile +echo "obj-\$(CONFIG_ATL1) += atlx/" >> $DIR/Makefile +echo "obj-\$(CONFIG_ATL2) += atlx/" >> $DIR/Makefile +echo "obj-\$(CONFIG_ATL1E) += atl1e/" >> $DIR/Makefile +echo "obj-\$(CONFIG_ATL1C) += atl1c/" >> $DIR/Makefile # Misc mkdir -p drivers/misc/eeprom/ -- 2.30.2