summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bge.c
AgeCommit message (Collapse)Author
2009-01-27make drivers tell the mclgeti allocator what their maximum ring size isDavid Gwynne
to prevent the hwm growing beyond that. this allows the livelock mitigation to do something where the hwm used to grow beyond twice the rx rings size. ok kettenis@ claudio@
2008-12-23sizeof(bge_devices) / sizeof(bge_devices[0]) -> nitems(bge_devices)David Gwynne
2008-12-23if we cant put enough packets on the rx ring then schedule a timeout toDavid Gwynne
try again later. tested by many
2008-12-03switch bge over to using MCLGETI when allocating mbufs for the rx ring.David Gwynne
tested by many including henning@ sthen@ naddy@ krw@ robert@ jmc@ jsg@ weerd@ and ingo schwarze on a variety of machines include i386, amd64, alpha, and sparc64.
2008-11-28Eliminate the redundant bits of code for MTU and multicast handlingBrad Smith
from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
2008-11-22perform bus_dmamap_syncs on the rx mbufs. this is obviously maintained byDavid Gwynne
monkeys. found by toby's bounce buffers. ok krw deraadt uwe fwk matthieu, drahn, mbalmer, robert, yuo, ratchov, claudio, rainer, art.
2008-11-09Introduce bpf_mtap_ether(), which for the benefit of bpf listenersChristian Weisgerber
creates the VLAN encapsulation from the tag stored in the mbuf header. Idea from FreeBSD, input from claudio@ and canacar@. Switch all hardware VLAN enabled drivers to the new function. ok claudio@
2008-11-08brad, noone said you could go making changes like that (doubling theTheo de Raadt
amount of memory and interrupt time each bge uses) without discussing it with other people. lots of people are complaining about the lack of communication in your process, and you are going to have to change that.
2008-11-08When initializing the standard RX ring, do not allocate mbufs clusters for theTheo de Raadt
whole ring.
2008-11-08Clean up some of the comments.Brad Smith
2008-11-08When initializing the standard RX ring, allocate mbufs clusters for theBrad Smith
whole ring.
2008-11-07When initializing the MAC put the PHY into ready state for BCM5906Brad Smith
chipsets. From the Linux tg3 driver via FreeBSD. Tested by Jordi Creix <jbcreix dot mail at gmail dot com>
2008-10-19Re-add support for RX VLAN tag stripping.Brad Smith
Tested by naddy@
2008-10-16Switch the existing TX VLAN hardware support over to having theChristian Weisgerber
tag in the header. Convert TX tagging in the drivers. Help and ok brad@
2008-10-14Change m_devget()'s outdated and unused "offset" argument: It isChristian Weisgerber
now the offset into the first mbuf of the target chain before copying the source data over. From FreeBSD. Convert drivers' use of m_devget(). Mostly from thib@. Update mbuf(9) man page. ok claudio@, thib@
2008-10-02First step towards cleaning up the Ethernet driver ioctl handling.Brad Smith
Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@
2008-09-23Rewrite two small sections of code in bge_blockinit() to simplify theBrad Smith
code. No functional change. ok krw@
2008-09-18Introduce the infrastructure required to support hardware VLAN tagChristian Weisgerber
stripping: Add a field to the mbuf pkthdr to hold the tag and an mbuf flag that tells if the tag is valid. Inspired by FreeBSD. Struct packing suggested by kettenis@. csum_flags is now 16 bits. Adapt to this in the drivers. ok reyk@, henning@
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-09-08Fix a link state issue reported by reyk@Brad Smith
In some situations we were not clearing pending link state attentions. Because of this we were not getting further interrupts for link state changes, thus never went into iface UP state. Force an interrupt at the end of bge_ifmedia_upd so we will call bge_link_upd, clear the link state attention and get further interrupts. From FreeBSD ok reyk@
2008-08-26Better strategy to single out onboard bge(4)'s on sparc64 machines.Mark Kettenis
ok deraadt@
2008-08-24Tadpole Viper onboard ethernet has no eeprom either, but the PROM entryTheo de Raadt
has subsystem ids set to the same as the regular ids, so the heuristic does not work. So look for the TAD,Viper machine name. When we get our hand on a Bullfrog (with a PCI slot) we will need to revisit this. ok kettenis
2008-08-24proper indentTheo de Raadt
2008-07-17Add a flag and allow the driver to identify the BCM5788 chipsets. They'reBrad Smith
slightly different from the other chipsets using the BCM5705 ASIC. ok jsg@
2008-07-16Enable the read DMA engine's PCI read request burst length long burstBrad Smith
mode (4KB) for PCIe chips. This resolves the poor TX performance for the PCIe chips. The result being a bit under double the TX performance on a Gig connection (roughly 495 Mb/s -> 940 Mb/s). Tested by reyk@, sthen@, brad@ and a few end users.
2008-06-07Add baudrate handling for fiber boards using the TBI interface.Brad Smith
ok deraadt@
2008-05-24And another Fujitsu Gigabit Etherenet card that is a bge(4) in disguise.Brad Smith
2008-05-23Another Fujitsu Gigabit Etherenet card that is a bge(4) in disguise.Mark Kettenis
2008-05-23Simplify the combination use of pci_mapreg_type()/pci_mapreg_map() asBrad Smith
suggested by dlg@ awhile ago. ok dlg@
2008-05-21Fujitsu PRIMEPOWER250/450 secondary LAN is a BCM5703C in disguise.Mark Kettenis
2008-05-14Add the Altima AC1003 PCI id.Brad Smith
ok dlg@
2008-05-12Call mii_pollstat() instead of bge_tick() in bge_link_upd() so that linkBrad Smith
state transitions are noticed and the appropriate routing socket messages are generated. ok kettenis@ krw@
2008-05-11Remove special casing of the BCM5700 B2 chipset so that this revision alsoBrad Smith
uses MII interrupts to detect link state transitions as is done for all of the other BCM5700 revisions, without this change link state transitions are not being detected at all. ok kettenis@
2008-05-11Revert the last commit as this is not the proper way of fixing the issue.Brad Smith
ok krw@
2008-05-09Attempt to fix link status change handling so that the proper RTM_IFINFOKenneth R Westerback
messages are generated when links go down or come up. Works on available devices, put in tree to encourage wide testing. Enables latest dhclient changes to work their magic on bge. Feedback from brad@ ok deraadt@ beck@ reyk@
2008-04-20rev 1.35 added special register settings for BCM5704 chipsets whenBrad Smith
in TBI mode for fiber adapters which causes problems for some systems. Add code to detect when the special settings are necessary which helps with some blade systems. From FreeBSD ok dlg@
2008-04-20Add a workaround for a CRC bug errata with BCM5701 A0 and B0 chipsetBrad Smith
revisions. From Linux via FreeBSD. ok dlg@
2008-04-03Clean up the DMA read/write control register setup code and add someBrad Smith
comments. Tested by a number of users with a variety of chipsets. From FreeBSD ok kettenis@
2008-03-21Pass the MIIF_HAVEFIBER flag along to mii_attach() for MII based fiberBrad Smith
adapters. Tested by brad@ and johan@ to ensure flow control is still working for copper adapters.
2008-02-20When collecting the hardware statistics add the interfaces input errorsBrad Smith
counter and out of receive buffer descriptors counter to the network stacks input errors counter. Based on a diff from mickey@ though updated for -current and added support for BCM5705 or newer chipsets from brad@. Tested it with BCM5704 on i386/amd64, BCM5700 on sparc64, BCM5701/BCM5751M on i386 and BCM5721/BCM5780 on amd64. ok krw@ sthen@ dlg@
2008-02-20when bge has link, use autopolling for link status, not direct mii polls.Stuart Henderson
fixes input errors on BCM5701/5702X/5704 and may avoid firmware hangs on some cards if asf/ipmi support is added. original diff from Oleg Bulyzhin in a freebsd-net post and ported by mickey; included stats counter changes which don't apply to -current so they are split out and not included here. "The rest of the diff looks ok" brad. tested on 5701/5702X/5703X/5704C/5721 by mpf naddy okan beck sthen ok beck (before splitting out stats changes), krw, henning. closes kernel/5699
2008-02-18Add initial bits for fiber support with the BCM5714/BCM5715/BCM5780 chipsets.Brad Smith
Tested by brad@, chl@, sthen@, Johan Mson Lindman and Ian Lindsay <iml04@hampshire.edu> ok dlg@
2008-02-17- Correct clearing of the IFF_OACTIVE flag by ensuring the flag isBrad Smith
only cleared if there is enough slack space since bge_encap() will return anyway and IFF_OACTIVE will be set again. - Only reset the watchdog timer when all packets have been processed. - Have bge_start() do a fast return if the adapter is not running or the IFF_OACTIVE flag is set. Tested by brad@, chl@, krw@, landry@, sthen@ and Johan Mson Lindman. ok dlg@
2008-02-02- Simplify statistics updates and remove redundant register reads.Brad Smith
- Add discarded RX packets to input errors for the BCM5705 or newer chipsets. Unfortunately output errors cannot be added because the equivalent to the ifOutDiscards register does not exist. - Replace misleading and wrong BGE_RX_STATS/BGE_TX_STATS with BGE_MAC_STATS. They were reversed but just happened to work. From FreeBSD Tested by chl@, landy@, sthen@, krw@, okan@ and brad@ ok dlg@
2008-01-31recognize the BCM5755 C0 ASIC revision.Brad Smith
tested by Rodolfo Gouveia and marco@ ok kettenis@ marco@ dlg@
2007-11-17Rename fiber TBI flag from BGE_TBI to BGE_PHY_FIBER_TBI. No functional change.Brad Smith
ok dlg@
2007-10-13Add support for BCM5906.Mark Kettenis
ok deraadt@
2007-10-09Use %zu for printing size_t values.Ray Lai
OK dlg.
2007-06-21rework how the IFF_PROMISC and IFF_ALLMULTI flags are dealt with, and howDavid Gwynne
the multicast filter is programmed. IFF_ALLMULTI is for use by the driver and only the driver, meaning that we have to clear it when its not needed anymore. now that the ethernet layer counts the number of multicast address ranges we can check that early to determine if ALLMULTI is needed, rather than doing the stupid goto allmulti dance as we iterate over the multicast address list. the imperfect multicast filter is a 16 byte wide bitfield, so we can use the "setbit" macro to build it in memory, and then write it to the hardware as a bus_space region. this simplifies the code a lot and avoids confusing bitshifts on u_int32_ts to get the bits in the right place. tested by krw on amd64, naddy on alpha, deraadt on sparc64, and beck on various bits. ok beck
2007-05-03The ring replenish threshold change needed to work around a hardwareTom Cosgrove
problem also appears to be required on the BCM5754/5787 in the Dell PowerEdge SC440 and OptiPlex GX745. dlg identified the problem and came up with the fix. Tested by dlg@, ckuethe@, reyk@; thanks. ok dlg@ beck@ reyk@