From: Albert H. <he...@us...> - 2008-02-24 18:06:01
|
Update of /cvsroot/gc-linux/linux/drivers/net In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv4818/drivers/net Modified Files: Kconfig Makefile gcn-bba.c Log Message: Merged 2.6.24. Added usbgecko driver. Added fixes for: exi, gcn-sd, gcn-mic, gcn-gqr. Adapted: gcn-bba, gcn-gqr, gcn-rtc. Added very primitive support for the Nintendo Wii. Index: gcn-bba.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/net/gcn-bba.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gcn-bba.c 18 Feb 2007 22:56:02 -0000 1.11 +++ gcn-bba.c 24 Feb 2008 18:05:33 -0000 1.12 @@ -2,9 +2,9 @@ * drivers/net/gcn-bba.c * * Nintendo GameCube Broadband Adapter driver - * Copyright (C) 2004-2005 The GameCube Linux Team + * Copyright (C) 2004-2008 The GameCube Linux Team * Copyright (C) 2005 Todd Jeffreys - * Copyright (C) 2004,2005 Albert Herranz + * Copyright (C) 2004,2005,2006,2007,2008 Albert Herranz * * Based on previous work by Stefan Esser, Franz Lehner, Costis and tmbinc. * @@ -379,7 +379,7 @@ static int bba_event_handler(struct exi_channel *exi_channel, unsigned int event, void *dev0); -static int bba_reset(struct net_device *dev); +static int bba_setup_hardware(struct net_device *dev); /* * Opens the network device. @@ -403,7 +403,7 @@ /* reset the hardware to a known state */ exi_dev_take(priv->exi_device); - retval = bba_reset(dev); + retval = bba_setup_hardware(dev); exi_dev_give(priv->exi_device); /* inform the network layer that we are ready */ @@ -737,9 +737,13 @@ /* * Input/Output thread. Sends and receives packets. */ -static int bba_io_thread(void *param) +static int bba_io_thread(void *bba_priv) { - struct bba_private *priv = param; + struct bba_private *priv = bba_priv; +// struct task_struct *me = current; +// struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; + +// sched_setscheduler(me, SCHED_FIFO, ¶m); set_user_nice(current, -20); current->flags |= PF_NOFREEZE; @@ -840,10 +844,22 @@ } /* + * Retrieves the MAC address of the adapter. + * Caller has already taken the exi channel. + */ +static void bba_retrieve_ether_addr(struct net_device *dev) +{ + bba_ins(BBA_NAFR_PAR0, dev->dev_addr, ETH_ALEN); + if (!is_valid_ether_addr(dev->dev_addr)) { + random_ether_addr(dev->dev_addr); + } +} + +/* * Resets the hardware to a known state. * Caller has already taken the exi channel. */ -static int bba_reset(struct net_device *dev) +static void bba_reset_hardware(struct net_device *dev) { struct bba_private *priv = (struct bba_private *)dev->priv; @@ -881,7 +897,7 @@ bba_out8(0x5c, bba_in8(0x5c) | 4); udelay(1000); - /* accept broadcast, assert int for every two packets received */ + /* accept broadcast, assert int for every packet received */ bba_out8(BBA_NCRB, BBA_NCRB_AB | BBA_NCRB_1_PACKET_PER_INT); /* setup receive interrupt time out, in 40ns units */ @@ -900,20 +916,21 @@ bba_out12(BBA_RWP, BBA_INIT_RWP); bba_out12(BBA_RRP, BBA_INIT_RRP); - /* start receiver */ - bba_out8(BBA_NCRA, BBA_NCRA_SR); - /* packet memory won't contain packets with RW, FO, CRC errors */ bba_out8(BBA_GCA, BBA_GCA_ARXERRB); +} - /* retrieve MAC address */ - bba_ins(BBA_NAFR_PAR0, dev->dev_addr, ETH_ALEN); - if (!is_valid_ether_addr(dev->dev_addr)) { - random_ether_addr(dev->dev_addr); - } +/* + * Prepares the hardware for operation. + * Caller has already taken the exi channel. + */ +static int bba_setup_hardware(struct net_device *dev) +{ + /* reset hardware to a sane state */ + bba_reset_hardware(dev); - /* setup broadcast address */ - memset(dev->broadcast, 0xff, ETH_ALEN); + /* start receiver */ + bba_out8(BBA_NCRA, BBA_NCRA_SR); /* clear all interrupts */ bba_out8(BBA_IR, 0xFF); @@ -992,7 +1009,7 @@ if (status & mask) { DBG("bba: killing interrupt!\n"); /* reset the adapter so that we can continue working */ - bba_reset(dev); + bba_setup_hardware(dev); goto out; } @@ -1074,17 +1091,18 @@ */ static int __devinit bba_init_device(struct exi_device *exi_device) { - struct net_device *dev = NULL; + struct net_device *dev; struct bba_private *priv; int err; /* allocate a network device */ dev = alloc_etherdev(sizeof(*priv)); if (!dev) { - printk(KERN_ERR "unable to allocate net device\n"); + bba_printk(KERN_ERR, "unable to allocate net device\n"); err = -ENOMEM; goto err_out; } + SET_NETDEV_DEV(dev, &exi_device->dev); /* we use the event system from the EXI driver, so no irq here */ dev->irq = 0; @@ -1095,8 +1113,6 @@ dev->hard_start_xmit = bba_start_xmit; dev->get_stats = bba_get_stats; - SET_MODULE_OWNER(dev); - priv = netdev_priv(dev); priv->dev = dev; priv->exi_device = exi_device; @@ -1115,25 +1131,33 @@ init_waitqueue_head(&priv->io_waitq); priv->io_thread = kthread_run(bba_io_thread, priv, "kbbaiod"); - ether_setup(dev); + /* the hardware can't do multicast */ dev->flags &= ~IFF_MULTICAST; - err = register_netdev(dev); - if (err) { - bba_printk(KERN_ERR, "Cannot register net device, aborting.\n"); - goto err_out_free_dev; - } - + exi_set_drvdata(exi_device, dev); if (bba_dev) free_netdev(bba_dev); bba_dev = dev; - exi_set_drvdata(exi_device,dev); + /* we need to retrieve the MAC address before registration */ + exi_dev_take(priv->exi_device); + bba_reset_hardware(dev); + bba_retrieve_ether_addr(dev); + exi_dev_give(priv->exi_device); + + /* this makes our device available to the kernel */ + err = register_netdev(dev); + if (err) { + bba_printk(KERN_ERR, "cannot register net device, aborting.\n"); + goto err_out_free_dev; + } return 0; err_out_free_dev: + exi_set_drvdata(exi_device, NULL); free_netdev(dev); + bba_dev = NULL; err_out: return err; Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/net/Makefile,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Makefile 16 Nov 2007 23:26:08 -0000 1.24 +++ Makefile 24 Feb 2008 18:05:33 -0000 1.25 @@ -3,14 +3,19 @@ # obj-$(CONFIG_E1000) += e1000/ +obj-$(CONFIG_E1000E) += e1000e/ obj-$(CONFIG_IBM_EMAC) += ibm_emac/ +obj-$(CONFIG_IBM_NEW_EMAC) += ibm_newemac/ +obj-$(CONFIG_IXGBE) += ixgbe/ obj-$(CONFIG_IXGB) += ixgb/ +obj-$(CONFIG_IP1000) += ipg.o obj-$(CONFIG_CHELSIO_T1) += chelsio/ obj-$(CONFIG_CHELSIO_T3) += cxgb3/ obj-$(CONFIG_EHEA) += ehea/ obj-$(CONFIG_BONDING) += bonding/ obj-$(CONFIG_ATL1) += atl1/ obj-$(CONFIG_GIANFAR) += gianfar_driver.o +obj-$(CONFIG_TEHUTI) += tehuti.o gianfar_driver-objs := gianfar.o \ gianfar_ethtool.o \ @@ -39,7 +44,6 @@ obj-$(CONFIG_MACE) += mace.o obj-$(CONFIG_BMAC) += bmac.o -obj-$(CONFIG_DGRS) += dgrs.o obj-$(CONFIG_VORTEX) += 3c59x.o obj-$(CONFIG_TYPHOON) += typhoon.o obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o @@ -92,6 +96,10 @@ obj-$(CONFIG_HP100) += hp100.o obj-$(CONFIG_SMC9194) += smc9194.o obj-$(CONFIG_FEC) += fec.o +obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx.o +ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y) + obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx_phy.o +endif obj-$(CONFIG_68360_ENET) += 68360enet.o obj-$(CONFIG_WD80x3) += wd.o 8390.o obj-$(CONFIG_EL2) += 3c503.o 8390.o @@ -106,7 +114,7 @@ obj-$(CONFIG_ES3210) += es3210.o 8390.o obj-$(CONFIG_LNE390) += lne390.o 8390.o obj-$(CONFIG_NE3210) += ne3210.o 8390.o -obj-$(CONFIG_NET_SB1250_MAC) += sb1250-mac.o +obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o obj-$(CONFIG_B44) += b44.o obj-$(CONFIG_FORCEDETH) += forcedeth.o obj-$(CONFIG_NE_H8300) += ne-h8300.o @@ -155,6 +163,7 @@ obj-$(CONFIG_8139TOO) += 8139too.o obj-$(CONFIG_ZNET) += znet.o obj-$(CONFIG_LAN_SAA9730) += saa9730.o +obj-$(CONFIG_CPMAC) += cpmac.o obj-$(CONFIG_DEPCA) += depca.o obj-$(CONFIG_EWRK3) += ewrk3.o obj-$(CONFIG_ATP) += atp.o @@ -178,7 +187,6 @@ obj-$(CONFIG_HPLANCE) += hplance.o 7990.o obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o obj-$(CONFIG_EQUALIZER) += eql.o -obj-$(CONFIG_LGUEST_NET) += lguest_net.o obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o @@ -193,6 +201,7 @@ obj-$(CONFIG_MACMACE) += macmace.o obj-$(CONFIG_MAC89x0) += mac89x0.o obj-$(CONFIG_TUN) += tun.o +obj-$(CONFIG_VETH) += veth.o obj-$(CONFIG_NET_NETX) += netx-eth.o obj-$(CONFIG_DL2K) += dl2k.o obj-$(CONFIG_R8169) += r8169.o @@ -237,3 +246,5 @@ obj-$(CONFIG_FS_ENET) += fs_enet/ obj-$(CONFIG_NETXEN_NIC) += netxen/ +obj-$(CONFIG_NIU) += niu.o +obj-$(CONFIG_VIRTIO_NET) += virtio_net.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/net/Kconfig,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Kconfig 19 Nov 2007 17:57:25 -0000 1.28 +++ Kconfig 24 Feb 2008 18:05:32 -0000 1.29 @@ -135,6 +135,13 @@ If you don't know what to use this for, you don't need it. +config VETH + tristate "Virtual ethernet pair device" + ---help--- + This device is a local ethernet tunnel. Devices are created in pairs. + When one end receives the packet it appears on its pair and vice + versa. + config NET_SB1000 [...1193 lines suppressed...] + help + This option enables the ability to dynamically reconfigure target + parameters (interface, IP addresses, port numbers, MAC addresses) + at runtime through a userspace interface exported using configfs. + See <file:Documentation/networking/netconsole.txt> for details. + config NETPOLL def_bool NETCONSOLE @@ -3094,4 +3069,10 @@ config NET_POLL_CONTROLLER def_bool NETPOLL +config VIRTIO_NET + tristate "Virtio network driver (EXPERIMENTAL)" + depends on EXPERIMENTAL && VIRTIO + ---help--- + This is the virtual network driver for lguest. Say Y or M. + endif # NETDEVICES |