aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pasemi_mac.c
Commit message (Collapse)AuthorAge
* [NET] drivers/net: statistics cleanup #1 -- save memory and shrink codeJeff Garzik2007-10-10
| | | | | | | | | | | | | | | | | We now have struct net_device_stats embedded in struct net_device, and the default ->get_stats() hook does the obvious thing for us. Run through drivers/net/* and remove the driver-local storage of statistics, and driver-local ->get_stats() hook where applicable. This was just the low-hanging fruit in drivers/net; plenty more drivers remain to be updated. [ Resolved conflicts with napi_struct changes and fix sunqe build regression... -DaveM ] Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NET]: Nuke SET_MODULE_OWNER macro.Ralf Baechle2007-10-10
| | | | | | | | | | | | 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>
* pasemi_mac: Clean TX ring in pollOlof Johansson2007-10-10
| | | | | | | | | | | | | | | | Unfortunately there's no timeout for how long a packet can sit on the TX ring after completion before an interrupt is generated, and we want to have a threshold that's larger than one packet per interrupt. So we have to have a timer that occasionally cleans the TX ring even though there hasn't been an interrupt. Instead of setting up a dedicated timer for this, just clean it in the NAPI poll routine instead. [ Resolved conflicts with napi_struct changes... -DaveM ] Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* pasemi_mac: Enable LLTXOlof Johansson2007-10-10
| | | | | | | | | | | Enable LLTX on pasemi_mac: we're already doing sufficient locking in the driver to enable it. [ Resolved merge conflicts with napi_struct changes... -DaveM ] Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* pasemi_mac: Fix RX checksum flagsOlof Johansson2007-10-10
| | | | | | | RX side flag to use is CHECKSUM_UNNECESSARY, not CHECKSUM_COMPLETE. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Fix TX ring wrap checkingOlof Johansson2007-10-10
| | | | | | | | | The old logic didn't detect full (tx) ring cases properly, causing overruns and general badness. Clean it up a bit and abstract out the ring size checks, always making sure to leave 1 slot open. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Batch up TX buffer freesOlof Johansson2007-10-10
| | | | | | | | | | Postpone pci unmap and skb free of the transmitted buffers to outside of the tx ring lock, batching them up 32 at a time. Also increase the count threshold to 128. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: RX performance tweaksOlof Johansson2007-10-10
| | | | | | | | Various RX performance tweaks, do some explicit prefetching of packet data, etc. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Fix memcpy amount for short receivesOlof Johansson2007-10-10
| | | | | | | Fix up memcpy for short receives. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Enable L2 caching of packet headersOlof Johansson2007-10-10
| | | | | | | | Enable settings to target l2 for the first few cachelines of the packet, since we'll access them to get to the various headers. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Stop using the pci config space accessors for register read/writesOlof Johansson2007-10-10
| | | | | | | | | | | | | | | Move away from using the pci config access functions for simple register access. Our device has all of the registers in the config space (hey, from the hardware point of view it looks reasonable :-), so we need to somehow get to it. Newer firmwares have it in the device tree such that we can just get it and ioremap it there (in case it ever moves in future products). For now, provide a hardcoded fallback for older firmwares. [ Resolved napi_struct conflicts... -DaveM ] Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* pasemi_mac: Abstract out register accessOlof Johansson2007-10-10
| | | | | | | | | Abstract out the PCI config read/write accesses into reg read/write ones, still calling the pci accessors on the back end. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NET]: Make NAPI polling independent of struct net_device objects.Stephen Hemminger2007-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* pasemi_mac: Fix TX interrupt thresholdOlof Johansson2007-07-08
| | | | | | | | It was mistakenly set to interrupt on the second packet instead of first, causing some interesting latency behaviour. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Fix local-mac-address parsingolof@lixom.net2007-05-15
| | | | | | | | | | Turns out we have an old version of firmware that stores the mac address in 'mac-address' as a string instead of a byte array. All versions that use local-mac-address should have it as byte array, so no need to do string parsing for that case. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Terminate PCI ID listolof@lixom.net2007-05-15
| | | | | | | | This caused some very interesting behaviour depending on what happened to be built at the same time. Add terminating empty entry to the list of IDs. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* pasemi_mac: Interrupt ack fixesOlof Johansson2007-05-15
| | | | | | | | | | | | Interrupt ack fixes Fix the packet count resets at interrupt time, using the cacheable packet count status to set number of processed/received packets, since the ack count is the cumulative number of packets processed, and not incremental. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* Merge branch 'upstream-linus' of ↵Linus Torvalds2007-05-08
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (40 commits) [netdrvr] atl1: fix build pasemi_mac: Use local-mac-address instead of mac-address if available pasemi_mac: PHY support pasemi_mac: Add msglevel support and "debug" module param pasemi_mac: Logic cleanup / rx performance improvements pasemi_mac: Minor cleanup / define fixes pasemi_mac: Add SKB reuse / copy-break pasemi_mac: Timer and interrupt fixes pasemi_mac: Abstract and fix up interrupt restart routines pasemi_mac: Move the IRQ mapping from the PCI layer to the driver tc35815: Remove unnecessary skb->dev assignment drivers/net/dm9000: Convert to generic boolean AT91RM9200 Ethernet: Fix multicast addressing AT91RM9200 Ethernet: Support additional PHYs PCMCIA-NETDEV : xirc2ps_cs: bugfix of multicast code sky2: re-enable 88E8056 for most motherboards MIPS: Drop unnecessary CONFIG_ISA from RBTX49XX ne: MIPS: Use platform_driver for ne on RBTX49XX ne: Add NEEDS_PORTLIST to control ISA auto-probe ne: Misc fixes for platform driver. ... Fix conflict in drivers/net/pasemi_mac.c (get_property() got renamed to of_get_property()) manually. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| * pasemi_mac: Use local-mac-address instead of mac-address if availableOlof Johansson2007-05-08
| | | | | | | | | | | | | | | | Use local-mac-address in the device tree instead. Fall back to mac-address for older firmware. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: PHY supportOlof Johansson2007-05-08
| | | | | | | | | | | | | | PHY support for pasemi_mac. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Add msglevel support and "debug" module paramOlof Johansson2007-05-08
| | | | | | | | | | | | | | | | Add msglevel support for pasemi_mac. Move the MODULE_* defines to the top to go together with the variable (similar to tg3). Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Logic cleanup / rx performance improvementsOlof Johansson2007-05-08
| | | | | | | | | | | | | | Logic cleanup and some performance enhancements to the RX path. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Minor cleanup / define fixesOlof Johansson2007-05-08
| | | | | | | | | | | | | | | | | | * Remove some unused defines * Fix a couple of wrong chip register defines, and add a few more fields that might be used in the near future. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Add SKB reuse / copy-breakOlof Johansson2007-05-08
| | | | | | | | | | | | | | Add a copy-break and recycle the SKB in the driver for small packets. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Timer and interrupt fixesOlof Johansson2007-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Timer and interrupt fixes: * Be pickier with what kind of interrupts are acked to avoid the device to get out of sync with the driver state * Set RX count threshhold to 1 (for NAPI interrupted mode), TX count threshold to 32. * Set timer thresholds to current max (~16ms). Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Abstract and fix up interrupt restart routinesOlof Johansson2007-05-08
| | | | | | | | | | | | | | | | Abstract out (and fix up) the interrupt restart routines, making sure we start out in a consistent state. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: Move the IRQ mapping from the PCI layer to the driverOlof Johansson2007-05-08
| | | | | | | | | | | | | | | | Fixes for ethernet IRQ mapping, to be done in the driver instead of in the platform setup code. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * pasemi_mac: A couple of minor bugfixes.Olof Johansson2007-05-08
| | | | | | | | | | | | | | | | | | | | | | | | Bugfixes: * Move the wake_queue logic from tx_intr to clean_tx * Always do wake_queue even if queue wasn't full before clean since it's safe to do * Fix polarity in checks in pasemi_mac_close Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | [POWERPC] Rename get_property to of_get_property: driversStephen Rothwell2007-05-02
|/ | | | | | | | These are all the remaining instances of get_property. Simple rename of get_property to of_get_property. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
* [SK_BUFF]: Introduce skb_network_header_lenArnaldo Carvalho de Melo2007-04-26
| | | | | | | | | | For the common sequence "skb->h.raw - skb->nh.raw", similar to skb->mac_len, that is precalculated tho, don't think we need to bloat skb with one more member, so just use this new helper, reducing the number of non-skbuff.h references to the layer headers even more. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iphArnaldo Carvalho de Melo2007-04-26
| | | | | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SK_BUFF]: Introduce skb_network_header()Arnaldo Carvalho de Melo2007-04-26
| | | | | | | | | For the places where we need a pointer to the network header, it is still legal to touch skb->nh.raw directly if just adding to, subtracting from or setting it to another layer header. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [ETH]: Make eth_type_trans set skb->dev like the other *_type_transArnaldo Carvalho de Melo2007-04-26
| | | | | | | One less thing for drivers writers to worry about. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* PA Semi PWRficient Ethernet driverOlof Johansson2007-02-05
Driver for the PA Semi PWRficient on-chip Ethernet (1/10G) Basic enablement, will be complemented with performance enhancements over time. PHY support will be added as well. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>