aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ps3_gelic_net.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-10net: trans_start cleanupsEric Dumazet1-3/+0
Now that core network takes care of trans_start updates, dont do it in drivers themselves, if possible. Drivers can avoid one cache miss (on dev->trans_start) in their start_xmit() handler. Exceptions are NETIF_F_LLTX drivers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-11Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+1
Conflicts: drivers/net/stmmac/stmmac_main.c drivers/net/wireless/wl12xx/wl1271_cmd.c drivers/net/wireless/wl12xx/wl1271_main.c drivers/net/wireless/wl12xx/wl1271_spi.c net/core/ethtool.c net/mac80211/scan.c
2010-04-03net: convert multicast list to list_headJiri Pirko1-3/+3
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24net/ps3_gelic: remove trailing space in messagesFrans Pop1-2/+2
ps3_gelic_wireless.c: also remove a stray "p" after a newline. Signed-off-by: Frans Pop <elendil@planet.nl> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: linuxppc-dev@ozlabs.org Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-26net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2Jiri Pirko1-1/+1
removed some needless checks and also corrected bug in lp486e (dmi was passed instead of dmi->dmi_addr) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12net: use netdev_mc_count and netdev_mc_empty when appropriateJiri Pirko1-1/+1
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-09Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-1/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits) tree-wide: fix misspelling of "definition" in comments reiserfs: fix misspelling of "journaled" doc: Fix a typo in slub.txt. inotify: remove superfluous return code check hdlc: spelling fix in find_pvc() comment doc: fix regulator docs cut-and-pasteism mtd: Fix comment in Kconfig doc: Fix IRQ chip docs tree-wide: fix assorted typos all over the place drivers/ata/libata-sff.c: comment spelling fixes fix typos/grammos in Documentation/edac.txt sysctl: add missing comments fs/debugfs/inode.c: fix comment typos sgivwfb: Make use of ARRAY_SIZE. sky2: fix sky2_link_down copy/paste comment error tree-wide: fix typos "couter" -> "counter" tree-wide: fix typos "offest" -> "offset" fix kerneldoc for set_irq_msi() spidev: fix double "of of" in comment comment typo fix: sybsystem -> subsystem ...
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa1-1/+1
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-02net/ps3: Add support for gelic link negotiationHideyuki Sasaki1-2/+70
Add ethtool_ops.set_settings support to the PS3 gelic network driver. Allows manual setting of ethernet link speed. Signed-off-by: Hideyuki Sasaki <xhide@rd.scei.sony.co.jp> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-02net/ps3: Cleanup gelic enumsGeoff Levand1-13/+13
Cleanup of the gelic driver enumerations: o Add some missing commas. o Add an Ether port post fix (PS3 currently only supports PORT_0). o Add a new enum gelic_lv1_phy to use when interacting with the PHY. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-02netdev: drivers should make ethtool_ops constStephen Hemminger1-1/+1
No need to put ethtool_ops in data, they should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-12netdev: restore MAC address set and validate operationsBen Hutchings1-0/+1
alloc_etherdev() used to install default implementations of these operations, but they must now be explicitly installed in struct net_device_ops. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-16net/ps3: gelic - Add missing annotationsGeert Uytterhoeven1-10/+12
probe functions should be __devinit Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Acked-by: Geoff Levand <geoffrey.levand@am.sony.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-06-15ps3: shorten ps3_system_bus_[gs]et_driver_data to ps3_system_bus_[gs]et_drvdataGeert Uytterhoeven1-4/+4
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Cc: Geoff Levand <geoffrey.levand@am.sony.com> Cc: Jim Paris <jim@jtan.com> Acked-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-02-01net: replace uses of __constant_{endian}Harvey Harrison1-1/+1
Base versions handle constant folding now. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21PS3: gelic: convert the ethernet part to net_device_opsMasakazu Mokuno1-10/+14
Convert the gelic driver to net_device_ops Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-27net: convert print_mac to %pMJohannes Berg1-4/+2
This converts pretty much everything to print_mac. There were a few things that had conflicts which I have just dropped for now, no harm done. I've built an allyesconfig with this and looked at the files that weren't built very carefully, but it's a huge patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-30ps3: gelic: updown_lock semaphore to mutexDaniel Walker1-5/+5
Signed-off-by: Daniel Walker <dwalker@mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-01[POWERPC] PS3: Gelic network driver Wake-on-LAN supportMasakazu Mokuno1-0/+81
Add Wake-on-LAN support to the PS3 Gelic network driver. Other OS WOL support was introduced in PS3 system firmware 2.20. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-11PS3: gelic: Add wireless support for PS3Masakazu Mokuno1-1/+17
Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Acked-by: Dan Williams <dcbw@redhat.com> Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11PS3: gelic: Add support for dual network interfaceMasakazu Mokuno1-294/+471
Add support for dual network (net_device) interface so that ethernet and wireless can own separate ethX interfaces. V2 - Fix the bug that bringing down and up the interface keeps rx disabled. - Make 'gelic_net_poll_controller()' extern , as David Woodhouse pointed out at the previous submission. - Fix weird usage of member names for the rx descriptor chain V1 - Export functions which are convenient for both interfaces - Move irq allocation/release code to driver probe/remove handlers because interfaces share interrupts. - Allocate skbs by using dev_alloc_skb() instead of netdev_alloc_skb() as the interfaces share the hardware rx queue. - Add gelic_port struct in order to abstract dual interface handling - Change handlers for hardware queues so that they can handle dual {source,destination} interfaces. - Use new NAPI functions This is a prerequisite for the new PS3 wireless support. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11PS3: gelic: add support for port link statusMasakazu Mokuno1-27/+50
Add support for interrupt driven port link status detection. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11PS3: gelic: remove duplicated ethtool handlersMasakazu Mokuno1-40/+3
Remove some ethtool handlers, which duplicate functionality that was already provided by the common ethtool handlers. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11PS3: gelic: code cleanupMasakazu Mokuno1-236/+228
Code cleanup: - Use appropriate prefixes for names instead of fixed 'gelic_net' so that objects of the functions, variables and constants can be estimated. - Remove definitions for IPSec offload to the gelic hardware. This functionality is never supported on PS3. - Group constants with enum. - Use bitwise constants for interrupt status, instead of bit numbers to eliminate shift operations. - Style fixes. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11PS3: gelic: Add endianness macrosMasakazu Mokuno1-31/+39
Mark the members of the structure for DMA descriptors with proper endian annotations and use the appropriate accessor macros. As the gelic driver works only on PS3, all these macros will be expanded to null. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-11PS3: gelic: Fix the wrong dev_id passedMasakazu Mokuno1-1/+1
The device id for lv1_net_set_interrupt_status_indicator() is wrong. This path would be invoked only in the case of an initialization failure. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-25[POWERPC] PS3: Make bus_id and dev_id u64Geert Uytterhoeven1-2/+2
Change the PS3 bus_id and dev_id from type unsigned int to u64. These IDs are 64-bit in the repository, and the special storage notification device has a device ID of ULONG_MAX. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-10-10[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()Joe Perches1-4/+3
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10[NET]: Nuke SET_MODULE_OWNER macro.Ralf Baechle1-1/+0
It's been a useless no-op for long enough in 2.6 so I figured it's time to remove it. The number of people that could object because they're maintaining unified 2.4 and 2.6 drivers is probably rather small. [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ] Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10PS3: Remove the workaround no longer neededMasakazu Mokuno1-12/+4
Removed the workaround that was needed for PS3 firmware versions prior to the first release. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> CC: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10PS3: changed the way to handle tx skbsMasakazu Mokuno1-77/+63
The PS3 virtual network device requires a vlan tag in the sending packet to select the destination device, ethernet port or wireless. As the vlan tag field is in the middle of the passed data, we should insert it into the packet data. To avoid copying much of the packet data, the driver used two tx descriptors for one tx skb; one descriptor was for sending a small static buffer which contained vlan tag and copied header (two mac addresses), one was for the residual data after the vlan field. This patch changes the way to insert the vlan tag. By changing netdev->hard_header_len, we can make the headroom for moving mac address fields in the skb buffer. Then we can send one tx skb with one tx descriptor. This also gives us a tx throughut gain of approx. 20% according to netperf results. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> CC: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10[NET]: Make NAPI polling independent of struct net_device objects.Stephen Hemminger1-25/+20
Several devices have multiple independant RX queues per net device, and some have a single interrupt doorbell for several queues. In either case, it's easier to support layouts like that if the structure representing the poll is independant from the net device itself. The signature of the ->poll() call back goes from: int foo_poll(struct net_device *dev, int *budget) to int foo_poll(struct napi_struct *napi, int budget) The caller is returned the number of RX packets processed (or the number of "NAPI credits" consumed if you want to get abstract). The callee no longer messes around bumping dev->quota, *budget, etc. because that is all handled in the caller upon return. The napi_struct is to be embedded in the device driver private data structures. Furthermore, it is the driver's responsibility to disable all NAPI instances in it's ->stop() device close handler. Since the napi_struct is privatized into the driver's private data structures, only the driver knows how to get at all of the napi_struct instances it may have per-device. With lots of help and suggestions from Rusty Russell, Roland Dreier, Michael Chan, Jeff Garzik, and Jamal Hadi Salim. Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra, Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan. [ Ported to current tree and all drivers converted. Integrated Stephen's follow-on kerneldoc additions, and restored poll_list handling to the old style to fix mutual exclusion issues. -DaveM ] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-08-31PS3: fix the bug that 'ifconfig down' would hangMasakazu Mokuno1-1/+0
Fix the bug that 'ifconfig eth0 down' would hang up, reported by Stefan Assmann <sassmann@suse.de>. As we removed netif_poll_enable() from dev->open(), we should not use netif_poll_disable() in dev->stop(). Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> CC: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: reduce allocation size of rx skb buffersMasakazu Mokuno1-8/+37
Reduced allocation size for rx skb buffers, from 2308 bytes to 1356 per buffer. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: fix rare issue that reenabling rx DMA failsMasakazu Mokuno1-2/+7
Fixed rare issue that 'lv1_net_start_rx_dma failed, status=-9" was shown in dmesg. This meant restarting rx DMA had been rejected by the hypervisor. This issue would caused if the guest os requested starting DMA when the hypervisor thought the DMA was in progress. The state machine for DMA status of the hypervisor would be updated by processing interrupt in the hypervisor. Thus we should wait for the interrupt delivery before restarting DMA. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: removed calling netif_poll_enable() in open()Masakazu Mokuno1-1/+0
Removed use of netif_poll_enable() in open function. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: use ethX as the name of irqMasakazu Mokuno1-1/+1
Use net_device name for registration of irq as many network drivers do. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: use net_device_stats of net_device structureMasakazu Mokuno1-23/+8
Removed the statistics information from private structre. Instead, use net_device_stats in net_device structure. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: removed conditional ethtool supportMasakazu Mokuno1-4/+0
Removed conditional ethtool support. Always enabled. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: tx descriptor handling cleanupMasakazu Mokuno1-53/+71
gelic: TX descriptor handling cleanup - Emitted return value of NETDEV_TX_LOCKED when DMA map or kick failure. Now it would free the skb, update drop packet statistics and return OK. Requested from Jeff Garzik. - Enable tx queue if number of free descriptors are more than 2 - Fixed descriptor leak if dma map for second descriptor failed - Stopped calling xmit handler from interrupt handler in order to recheck tx queue. Instead, call appropriate helper functions. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: some minor cleanupsMasakazu Mokuno1-2/+3
- Removed the embarrassing definition which was used in only one place. - Fixed wrong initialization of dmac_cmd_status. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-24ps3: fix wrong calculation of rx descriptor addressMasakazu Mokuno1-1/+1
Fixed the bug that calculation of the address of rx descriptor was wrong. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10ps3: gigabit ethernet driver for PS3, take3Masakazu Mokuno1-0/+1576
Hi, This is the third submission of the network driver for PS3. The differences from the previous one are: - renamed source file names so that their prefix can match with the module name - added cbe-oss-dev@ozlabs.org line for MAINTAINER file - changed some in copyright comments If there are no more comments, please apply for 2.6.23. Thank you -- Subject: PS3: Ethernet driver From: Masakazu Mokuno <mokuno@sm.sony.co.jp> Add Gigabit Ethernet support for the PS3 game console. The module will be called ps3_gelic. CC: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>