Commit Graph

2027 Commits

Author SHA1 Message Date
Bill Paul
94215c94fe Fix multicast and promiscuous mode handling for Yukon devices.
Submitted by:	Jung-uk Kim <jkim@niksun.com>
2004-01-21 22:32:15 +00:00
Bill Paul
9afca9391c Calculate the right register offset when clearing TX buffer pointer
registers in rl_stop().

PR:		kern/60250
2004-01-21 22:29:51 +00:00
Alan Cox
2dc8633eab Replace calls to vm_page_alloc_contig() by calls to contigmalloc().
vm_page_alloc_contig() will be removed after the three remaining drivers
that use it are also converted to contigmalloc().
2004-01-13 07:45:10 +00:00
Maxime Henrion
ec6a729924 Some integrated Davicom cards in sparc64 boxes have an all zeros
MAC address in the EEPROM, and we need to get it from OpenFirmware.
This isn't very pretty but time is lacking to do this in a better
way this near 5.2-RELEASE.  This is a RELENG_5_2 candidate.

Original version by:	Marius Strobl <marius@alchemy.franken.de>
Tested by:		Pete Bentley <pete@sorted.org>
Reviewed by:		jake
2004-01-08 19:08:27 +00:00
Don Lewis
4ff4a9bee9 The transmit frame status is stored in the last transmit descriptor for the
frame, not the first.  It is probably also not safe to free the mbuf chain
as soon as the OWN bit is cleared on the first descriptor since the chip
may not be done copying the frame into the transmit FIFO.  Revert the part of
of busdma conversion (if_dc.c rev 1.115) which changed dc_txeof() to look for
the status in the first descriptor and free the mbuf chain when processing
the first descriptor for the frame, and revert the matching changes elsewhere
in the driver.  This part of the busdma change caused the driver to report
spurious collisions and output errors, even when running in full-duplex mode.
Reverting the mbuf chain handling slightly complicates dc_dma_map_txbuf(),
since it is responsible for setting the OWN bits on the descriptors, but does
not normally have direct access to the mbuf chain.

Tested by:
  Dejan Lesjak <dejan.lesjak at ijs.si>  alpha/<Intel 21143 10/100BaseTX>
  "Xin LI" <delphij at frontfree.net>    i386/<Macronix 98713 10/100BaseTX>
  Wiktor Niesiobedzki <bsd at w.evip.pl> i386/<3Com OfficeConnect 10/100B>

Reviewed by:	mux
2004-01-08 06:22:15 +00:00
Bill Paul
a06598ec58 Fix detection of RealTek 8129 PCI cards. Apparently, these cards
report a hardware rev of 0x00000000. Sadly, the 8169 gigE MAC
also reports 0x00000000, so testing against this for exclusion
results in both cards being skipped by rl_probe(). Make the 8169
test more specific by matching against both the hwrev and the PCI
ID for this chip.

PR: kern/60824
2004-01-02 17:22:12 +00:00
Poul-Henning Kamp
8c27747768 Vastly improve performance of IRQ handling on stopped interfaces with
this driver by introducing a flag saying we already stopped the device.

On my Soekris net4801, this took a ping -i 0.001 from spending 80% of
time in interrupt handling to 10% (approx numbers).

This was a particular problem for the net4801 because the tree
interfaces share the same interrupt, but it would be a problem for
any configuration where an unused if_sis interface shares an interrupt
with a busy device.

Other drivers may have similar problems.

Thanks to:	Luigi
2003-12-25 22:14:25 +00:00
Peter Wemm
a89ec05e3e Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.
2003-12-23 02:36:43 +00:00
Poul-Henning Kamp
48529e81e4 Attempt to get the short cable fix to work better on the if_sis:
Only do short-cable on revisions that need it.

Move generic initialization before short-cable fix, in order to not
clobber short cable fix register setting.
2003-12-12 10:15:39 +00:00
David E. O'Brien
a55a017f42 Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.
Requested by:	bde,imp
2003-12-08 07:54:15 +00:00
Warner Losh
65b4a1b917 Remote meteor driver. It hasn't compiled in over 3 years. If someone
makes it compile again, and can test it, we can restore the driver to
the tree.
2003-12-07 04:41:11 +00:00
MIHIRA Sanpei Yoshiro
773c505f3c Add support for ELECOM/Laneed CardBus FastEtherner Card(LD-CBL/TXA)
Submitted by:	Masahiro Yamagishi <night@pluto.dti.ne.jp>
Approved by:	re (scottl)
2003-12-06 02:29:31 +00:00
Bruce Evans
fb0ca10d0c Fixed some minor indentation bugs.
Approved by:	re (scottl)
2003-12-02 12:47:08 +00:00
Bruce Evans
933a354fe5 Fixed breakage of the pci case of the cy driver by the new interrupt
code.  Both the driver and the new code were wrong.  Driver interrupt
handlers are supposed to take "void *vsc" arg, but some including all
COMPAT_ISA drivers and the pci part of the cy driver want an "int unit"
arg.  They got this using bogus casts of function pointers which should
have kept working despite their bogusness.  However, the new interrupt
code doesn't honor requests to pass an arg of ((void *)0), so things
are very broken if the arg is actually a representation of unit 0.

The fix is to use a normal "void *vsc" arg for the pci case and a
wrapper for the COMPAT_ISA case (of the cy driver).  This cleans up
new-busification of the pci case but takes the COMPAT_ISA case a little
further from new-bus.  The corresponding bug for the COMPAT_ISA case
has already been fixed similarly using a wrapper in compat_isa.c and
we need another wrapper just to undo that.

Fixed some directly related style bugs (mainly by removing compatibility
cruft).

cy.c:
Fixed an indirectly related old bug in cyattach_common().  A wrong status
was returned in the unlikely event that malloc() failed.

Approved by:	re (scottl)
2003-12-02 12:36:00 +00:00
Sam Leffler
d927d7ab84 correct typo in interrupt handling for the 2nd port of 2-port cards
Submitted by:	luigi
Reviewed by:	checking original openbsd code
Approved by:	re (scottl)
2003-11-29 19:33:01 +00:00
Warner Losh
347934fa63 Sometimes cardbus attachments don't attach, so while we track down
this problem put these lines back in.  While they should be
unnecessary, they appear to be sometimes necessary.

Reviewed in concept: dfr
Approved by: re (scottl@)
2003-11-28 05:28:29 +00:00
Sam Leffler
5120abbfb4 Drop the driver lock around calls to if_input to avoid a LOR when
the packets are immediately returned for sending (e.g.  when bridging
or packet forwarding).  There are more efficient ways to do this
but for now use the least intrusive approach.

Reviewed by:	imp, rwatson
2003-11-14 19:00:32 +00:00
David E. O'Brien
4dc52c32bf Remove duplicate FBSDID's, move others to their right place. 2003-11-14 17:16:58 +00:00
Warner Losh
3373489b49 reconst poison
re-de u_intXX_t
2003-11-14 05:45:39 +00:00
David E. O'Brien
aa8255025a Try to create some sort of consistency in how the routings to find the
multicast hash are written.  There are still two distinct algorithms used,
and there actually isn't any reason each driver should have its own copy
of this function as they could all share one copy of it (if it grew an
additional argument).
2003-11-13 20:55:53 +00:00
Wilko Bulte
dafa835522 Add vendor ID to make Marvell chipset work. E.g. to be found
on SMC9452TX it seems

Submitted by: Jung-uk Kim <jkim@niksun.com>
Tested by: <Radu Bogdan 'veedee' Rusu> veedee@c7.campus.utcluj.ro
MFC after: 2 weeks
2003-11-12 23:01:15 +00:00
Eric Anholt
a6cb9d8e99 - Disable AGP on ALI chipsets if aperture size is 0.
- Fail in agp_alloc_gatt if the aperture size is 0 instead of panicing in
  contigmalloc.

Reported by:	Bjoern Fischer <bfischer@Techfak.Uni-Bielefeld.DE>
Reviewed by:	jhb
MFC after:	1 week
2003-11-11 21:49:18 +00:00
Peter Wemm
2331fb5799 Ahh, the joys of badge engineering. Tell the sk driver that the
Linksys EG1032 is yet another variation.  It looks just like the 3c940
except it only has a Marvell logo and no 3com logo.
2003-11-07 22:04:26 +00:00
Warner Losh
5b909b0e1e s/driver/device/ for config file line 2003-11-06 03:59:03 +00:00
Warner Losh
8c3252ba92 Change config file syntax to be less FreeBSD 3.x 2003-11-05 20:48:36 +00:00
Poul-Henning Kamp
8dd85c33e3 Free major#100 2003-11-03 10:19:33 +00:00
Doug Rabson
0be389f3ca Remove explicit cardbus attachments from drivers where this is identical
to the pci attachment. Cardbus is a derived class of pci so all pci
drivers are automatically available for matching against cardbus devices.

Reviewed by: imp
2003-11-03 09:22:18 +00:00
Ruslan Ermilov
05992bb56b Correct the spelling of m_devget() in the sysctl variable description. 2003-11-02 21:43:29 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Sam Leffler
b237430cfe mark interrupt handlers MPSAFE 2003-10-29 18:32:14 +00:00
John Baldwin
9f9ccd206d Add simple support for AGP 3.0 including enabling 8x mode. The simple
part of the support is that it still assumes one master and one target
where as AGP 3.0 actually supports multiple devices on the bus.

Submitted by:	Keith Whitwell <keith@tungstengraphics.com>
Sponsored by:	The Weather Channel
2003-10-23 18:08:56 +00:00
John Baldwin
65c3981023 Use a switch statement on the devid instead of if-else for determing which
code to use to see if the onboard video has been disabled or not.

Submitted by:	Keith Whitwell <keith@tungstengraphics.com>
2003-10-23 17:48:30 +00:00
Warner Losh
9d51aaa4e8 Const poison crc routines (why these aren't centralized, I'm not sure). 2003-10-23 16:57:38 +00:00
Mike Silbersack
180b0f65cc Fix m_head handling in sis_encap so that the correct mbuf is always handed
to BPF_MTAP.
2003-10-19 23:28:02 +00:00
Mike Silbersack
a10c0e4574 Fix a problem where m_defrag would allocate a new mbuf to replace the
chain passed into dc_encap, which dc_start was unaware of.  This caused
the old (now invalid) mbuf to be passed to BPF_MTAP.

Spotted by:	Kenjiro Cho <kjc@csl.sony.co.jp>
2003-10-19 23:05:19 +00:00
Poul-Henning Kamp
47850d0ae7 Sanitize the code relating to the /dev/ti%d entries. In particular evict
the evil vnode sniffing code and use destroy_dev() instead.
2003-10-10 20:35:28 +00:00
Martin Blapp
87f4fa1512 Ignore CSR13, CSR14, CSR15 'Media Specific Data' registers
for 21143 based cards which use SIA mode.

This fixes 10mbit mode for ZNYX ZX346Q cards and other
21143 based cards.

PR:		32118
Submitted by:	Rene de Vries <rene@tunix.nl>
		Geert Jan de Groot <GeertJan.deGroot@tunix.nl>

Obtained from:	BSDI

MFC after:	2 weeks
2003-10-05 19:57:10 +00:00
Eric Anholt
7efb14ccd3 Make the i810 AGP device create a "drmsub" child device. This will be attached
to by the DRM for i8xx devices.

Submitted by:	Keith Whitwell <keith@tungstengraphics.com>
2003-10-02 19:49:15 +00:00
Mike Silbersack
43e68b5333 Add a tiny bit more delay in the xl_mii_sync function; this is necessary
for proper intialization in certain 905B + old system combinations.

Tested by:	Jakub Miziolek <jxm@obta.uw.edu.pl>
2003-09-29 02:14:04 +00:00
Wilko Bulte
95ad0a1f28 Add missing file, it is sorely needed to make if_sk.c compile again. 2003-09-20 15:49:22 +00:00
Wilko Bulte
59ce78fef1 Add support for SK-9521 V2.0 and 3COM 3C940.
Tested at 100Mbit only, using Asus P4P800 onboard 3C940.
The -stable version of this patch I have in use for ~2 weeks now, and works
just fine for me.

Based on: Nathan L. Binkert's patch for OpenBSD
Patch submitted by and thanks to: Jung-uk Kim <jkim@niksun.com>
MFC after: 2 weeks
2003-09-20 10:53:08 +00:00
Bill Paul
6110675fd6 Remove jumbo buffer #defines that I ended up not needing. 2003-09-19 02:35:03 +00:00
Eric Anholt
f704d34677 Fix a typo in r1.8: The GTLB enable/flush bit is 1<<7, not 1<<8.
PR:		kern/56297
Submitted by:	Dan Angelescu <mrhsaacdoh@yahoo.com>
2003-09-17 02:58:17 +00:00
Martin Blapp
129eaf7996 Don't read the MAC address from a copy of the EEPROM in the softc
that has been recorded earlier and overwrite it again later by
reading it directly from the EEPROM again.

Read the MAC address from the PAR0/PAR1 registers instead, which
are autoloaded on reboot.

Tested on AN985, AN983B. According to the datasheets, it should
also work for the AL981 (I don't have such a chip on a card at home)

PR:             52988
Submitted by:   Andrew Gordon <arg-bsd@arg.me.uk>
MFC after:      2 weeks
2003-09-16 05:01:27 +00:00
Matthew N. Dodd
cdeb7b18af - Avoid calling pci_get_device() more than once in a single function.
- Provide a mechanism to prevent the use of MMIO.
- Prevent the use of MMIO for all 3c575 cardbus cards.
2003-09-14 16:33:48 +00:00
Bill Paul
c2c6548b3a Teach the re(4) driver about the CFG2 register, which tells us whether
we're on a 32-bit/64-bit bus or not. Use this to decide if we should
set the PCI dual-address cycle enable bit in the C+ command register.
(Enabling DAC on a 32-bit bus seems to do bad things.)

Also, initialize the C+ command register early in the re_init() routine.
The documentation says this register should be configured first.
2003-09-13 23:51:35 +00:00
Bill Paul
abc8ff44d3 - For the 8169 chips, read the station address by forcing an EEPROM
autoload and then copying the contends of the station address
  registers. For some reason, reading the EEPROM on the 8169S doesn't
  work right. This gets around the problem, and allows us to read
  the station address correctly on the 8169S.

- Insert a delay after initiating packet transmition in re_diag() to
  allow lots of time for the frame to echo back to the host, and wait
  for both the 'RX complete' and 'timeout expired' bits in the ISR
  register to be set.

- Deal more intelligently with the fact that the frame length
  field in the RX descriptor is a different width on the 8139C+
  than it is on the 8169/8169S/8110S

- For the 8169, you have to set bit 17 in the TX config register
  to enter digital loopback mode, but for the 8139C+, you have to
  set both bits 17 and 18. Take this into account so that re_diag()
  works properly for both types of chips.
2003-09-11 06:56:46 +00:00
Bill Paul
5c75626b05 Re-enable VLAN_MTU capability for this driver. (Got reverted when
I pulled out the C+/8169 bits.)
2003-09-11 04:05:01 +00:00
Bill Paul
9bac70b851 Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S
ethernet chips. This driver is pretty simple, however it contains
special DSP initialization code which is needed in order to get
the chip to negotiate a gigE link. (This special initialization
may not be needed in subsequent chip revs.) Also:

- Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS)

- Deal with shared interrupts in re_intr(): if interface isn't up,
  return.

- Fix another bug in re_gmii_writereg() (properly apply data field mask)

- Allow PHY driver to read the RL_GMEDIASTAT register via the
  re_gmii_readreg() register (this is register needed to determine
  real time link/media status).
2003-09-11 03:53:46 +00:00
Bill Paul
966a07e907 Teach rl(4) about new hwrev codes. 2003-09-10 15:12:55 +00:00