aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fxp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add the device ID of fxp(4) NICs found in Sony Vaio VGN-TX1XP laptops.Maxime Henrion2005-12-121-0/+1
| | | | | | | | | PR: kern/90024 Submitted by: Thomas Hurst <tom@hur.st> MFC after: 3 days Notes: svn path=/head/; revision=153339
* - Store pointer to the link-level address right in "struct ifnet"Ruslan Ermilov2005-11-111-1/+1
| | | | | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead. Notes: svn path=/head/; revision=152315
* Catch up with IFP2ENADDR() type change (array -> pointer).Ruslan Ermilov2005-11-111-2/+1
| | | | Notes: svn path=/head/; revision=152311
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceGleb Smirnoff2005-10-051-0/+4
| | | | | | | | | | | | opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules. Reviewed by: bde Notes: svn path=/head/; revision=150968
* Big polling(4) cleanup.Gleb Smirnoff2005-10-011-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb Notes: svn path=/head/; revision=150789
* Convert fxp(4) to use the new bus_alloc_resources() API, it simplifiesMaxime Henrion2005-09-272-60/+42
| | | | | | | the resource allocation code significantly. Notes: svn path=/head/; revision=150610
* Fix an unaligned I/O memory access in the event that a SCB times out.Marcel Moolenaar2005-09-211-3/+9
| | | | | | | | | | | The FXP_SCR_FLOWCONTROL registers is at offset 0x19, but 2 bytes wide. It cannot be read as a word without causing a panic on architectures that enforce strict alignment. MFC after: 3 days Notes: svn path=/head/; revision=150408
* Add callout_drain()'s to foo_detach() after calling foo_stop() to make sureJohn Baldwin2005-08-171-0/+1
| | | | | | | | | | | | that if softclock is running on another CPU and is blocked on our driver lock, we will wait until it has acquired the lock, seen that it was cancelled, dropped the lock, and awakened us so that we can safely destroy the mutex. MFC after: 3 days Notes: svn path=/head/; revision=149203
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-4/+4
| | | | | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days Notes: svn path=/head/; revision=148887
* - Use callout_init_mtx() to close a small race between callout_stop() andJohn Baldwin2005-08-082-71/+25
| | | | | | | | | | | | | | | | the timeout routine. - Fix locking in detach. - Add locking in shutdown. - Don't mess with the PCI command register in resume, the PCI bus driver already does this for us. - Add locking to the non-serial ifmedia routines. - Fix locking in ioctl. - Remove spls and support for 4.x. MFC after: 1 week Notes: svn path=/head/; revision=148872
* Modify device drivers supporting multicast addresses to lock if_addr_mtxRobert Watson2005-08-031-0/+2
| | | | | | | | | | | over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list. Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week Notes: svn path=/head/; revision=148654
* Add a new PCI id for fxp(4) cards found on ICH7-based systems.Maxime Henrion2005-07-291-0/+1
| | | | | | | | | This commit is a RELENG_6 candidate. Submitted by: Martin Nilsson <martin@gneto.com> Notes: svn path=/head/; revision=148546
* Move if_alloc() up in fxp_attach() so there's an ifp beforeBrooks Davis2005-06-111-6/+7
| | | | | | | | | mii_phy_probe() is called. Committed via: fxp0 Notes: svn path=/head/; revision=147289
* Avoid deadlock in fxp driver when system runs out of mbufs.Wes Peters2005-06-101-1/+6
| | | | | | | | MFC after: 1 week Provided by: Ernie Smallis <esmallis@stbernard.com> Notes: svn path=/head/; revision=147282
* Revert the unnecessicary addition of some braces in fxp_attach(). Don'tBrooks Davis2005-06-101-3/+1
| | | | | | | | explicitly free the ifp in fxp_detach(), the call to fxp_release() takes care of it. Notes: svn path=/head/; revision=147269
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-102-24/+32
| | | | | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam Notes: svn path=/head/; revision=147256
* Correct commentWarner Losh2005-06-061-2/+1
| | | | Notes: svn path=/head/; revision=147042
* Remove some variables the last commit stopped using so the code compiles.Brooks Davis2005-06-061-2/+2
| | | | Notes: svn path=/head/; revision=147038
* The PCI bus code saves/restores these config registers now.Warner Losh2005-06-052-20/+0
| | | | Notes: svn path=/head/; revision=147029
* Be more conservative when enabling extended features. There are fxp(4)Maxime Henrion2005-04-222-3/+7
| | | | | | | | | NICs out there that have an utterly bogus revision ID. Reported by: Denis Shaposhnikov <dsh@vlink.ru> Notes: svn path=/head/; revision=145401
* Add a microcode to implement receive bundling for 82551 chipsets withMaxime Henrion2005-04-213-20/+152
| | | | | | | | | | a revision ID of 0x0f (D102 E-step). MFC after: 2 weeks Tested by: pav Notes: svn path=/head/; revision=145368
* Enable extended RFDs and TCBs, and thus checksum offloading, forMaxime Henrion2005-04-211-2/+1
| | | | | | | | | | | | | | latest 82550 and 82551 chipsets (revision IDs 0x0e, 0x0f and 0x10). We were only enabling it for revisions 0x0c and 0x0d, now it's enabled for any 8255x NIC with a revision ID bigger than 0x0c. It should be safe, and this is what Intel does in their open source driver. MFC after: 2 weeks Tested by: Pavel Lobach lobach_pavel at mail dot ru Notes: svn path=/head/; revision=145359
* Unload and destroy the TX DMA maps before destroying the DMA tagMaxime Henrion2005-03-161-4/+3
| | | | | | | | | they're attached to, not after. Spotted by: Coverity via sam Notes: svn path=/head/; revision=143705
* - Encapsulate the code responsible for initializing a new TX descriptorMaxime Henrion2005-03-072-190/+189
| | | | | | | | | | from an mbuf into the fxp_encap() function, as done in other drivers. - Don't waste time calling bus_dmamap_load_mbuf() if we know the mbuf chain is too long to fit in a TX descriptor, call m_defrag() first. - Convert fxp(4) to use bus_dmamap_load_mbuf_sg(). Notes: svn path=/head/; revision=143243
* Cleanup: u_intXX_t -> uintX_t conversion.Maxime Henrion2005-03-063-110/+110
| | | | Notes: svn path=/head/; revision=143167
* Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh2005-03-051-1/+1
| | | | Notes: svn path=/head/; revision=143161
* Add support for fxp(4) cards found in Sony FS570 laptops.Maxime Henrion2005-03-051-0/+1
| | | | | | | Submitted by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk> Notes: svn path=/head/; revision=143150
* Fix the panic recently reported on -current@ occuring when configuringMaxime Henrion2005-03-031-8/+13
| | | | | | | | | | | | | | | a vlan interface attached to a fxp(4) card when it has not been initialized yet. We now set the links from our internel TX descriptor structure to the TX command blocks at attach time rather than at init time. While I'm here, slightly improve the style in fxp_attach(). PR: kern/78112 Reported by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk> and others Tested by: flz, Gavin Atkinson <gavin.atkinson@ury.york.ac.uk> MFC after: 1 week Notes: svn path=/head/; revision=143069
* Fix a stupid bogon from myself, sc->revision wasn't initialized whenMaxime Henrion2005-02-271-10/+10
| | | | | | | | | | | | | | | | testing it to know whether we should enable the 82503 serial mode... Move code to the right location and disallow the use of the 82503 serial mode if the sc->revision field is 0 again. This makes fxp(4) work correctly with ATMEL 350 93C46 cards (3 port 82559 based with a 82555 PHY), as well as with the older ATMEL 220 93C46 (same flavour) and with the even older 10Mbps-only 82557 cards with the 82503 serial interface. Tested by: Andre Albsmeier <andrer@albsmeier.net>, krion MFC after: 2 weeks Notes: svn path=/head/; revision=142655
* Remove an outdated comment about ifnet not being locked.Ruslan Ermilov2005-02-151-3/+0
| | | | | | | OK'ed by: njl, rwatson, sam Notes: svn path=/head/; revision=141950
* Disable ethernet flow control in if_fxp by default, in order to preventRobert Watson2005-01-291-1/+1
| | | | | | | | | | unexpected surprises when a system panics or is left in the debugger. Requested by: kris MFC after: 3 days Notes: svn path=/head/; revision=140993
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-063-3/+3
| | | | Notes: svn path=/head/; revision=139749
* Allow fxp(4) cards with a revision id of 0 to use the 82503 serialMaxime Henrion2005-01-041-1/+1
| | | | | | | | | | | | interface as well. This is not an expected revision id per the datasheet, but unfortunately there are such cards out there with a 82557 chipset, and they want to use the 82503. PR: kern/75739 Reported by: Andre Albsmeier <andre.albsmeier@siemens.com> Notes: svn path=/head/; revision=139683
* Only try to use the 82503 serial interface for the 82557 chipsets. TheMaxime Henrion2004-12-201-2/+2
| | | | | | | | | | | | datasheet says it is only valid for such chipsets and shouldn't be used with others. This fixes some 82559 based cards which otherwise only work at 10Mbit. MFC after: 5 days Tested by: krion Notes: svn path=/head/; revision=139063
* Make interrupt coalescing work on big endian systems.Pyun YongHyeon2004-11-171-2/+4
| | | | | | | | | | Also change struct ucode.length to be in number of elements (u_int32_t) to help endian handling. MFC after: 2 weeks Notes: svn path=/head/; revision=137795
* Add support for the fxp(4) based card in ICH6 (i915) chipsets.Maxime Henrion2004-09-181-0/+1
| | | | | | | | | This is a RELENG_5 candidate. Submitted by: Mike Tancsa <mike@sentex.net> Notes: svn path=/head/; revision=135439
* Deorbit the fxp tuning hint (hint.fxp.UNIT_NUMBER.ipcbxmit_disable)Don Lewis2004-08-111-24/+2
| | | | | | | | introduced in if_fxp.c revision 1.180. The bug fix committed in revision 1.180 fixed the packet truncation problem. Notes: svn path=/head/; revision=133524
* Bring in the first chunk of altq driver modifications. This covers theMax Laier2004-07-021-4/+9
| | | | | | | | | | | | | | following drivers: bfe(4), em(4), fxp(4), lnc(4), tun(4), de(4) rl(4), sis(4) and xl(4) More patches are pending on: http://peoples.freebsd.org/~mlaier/ Please take a look and tell me if "your" driver is missing, so I can fix this. Tested-by: many No-objection: -current, -net Notes: svn path=/head/; revision=131455
* Remove the setting of the pci config variables on power state changes.Warner Losh2004-06-281-37/+2
| | | | | | | The bus does this now. Notes: svn path=/head/; revision=131255
* Abstract the locking in fxp(4) a bit more by using macros forMaxime Henrion2004-06-022-8/+11
| | | | | | | | mtx_assert() and mtx_owned(), as it is done in other places, for instance proc locking. Notes: svn path=/head/; revision=130020
* Use the device sysctl tree instead of rolling our own. Some of theMaxime Henrion2004-06-022-26/+20
| | | | | | | | | | | | | | sysctls were global (hw.fxp_rnr and hw.fxp_noflow), all of them are now per-device. Sample output of "sysctl dev.fxp0" with this patch, with the standard %foo nodes removed : dev.fxp0.int_delay: 1000 dev.fxp0.bundle_max: 6 dev.fxp0.rnr: 0 dev.fxp0.noflow: 0 Notes: svn path=/head/; revision=130019
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* POLA dictates that VLAN_MTU be enabled by default.Yaroslav Tykhiy2004-05-271-1/+7
| | | | | | | | | | | In particular, disabling it was likely to break configurations involving ng_vlan(4) since the latter couldn't control the parent's VLAN_MTU in the way vlan(4) did. Pointed out by: ru Notes: svn path=/head/; revision=129780
* Those sysctls shouldn't be writtable from inside a jail.Pawel Jakub Dawidek2004-05-261-2/+2
| | | | Notes: svn path=/head/; revision=129761
* Teach fxp(4) to control VLAN_MTU in the hardware.Yaroslav Tykhiy2004-05-252-8/+17
| | | | | | | | | | | Now reception of extended frames can be toggled through ioctl(SIOCSIFCAP). The card will also receive extended frames when in promiscuous mode. Notes: svn path=/head/; revision=129718
* Change a if (...) panic() to a KASSERT().Maxime Henrion2004-05-241-2/+2
| | | | Notes: svn path=/head/; revision=129671
* A handler for ioctl(SIOCSIFCAP) should not alter a bit inYaroslav Tykhiy2004-05-231-1/+2
| | | | | | | | | | if_capenable unless the interface driver is actually able to toggle the respective capability on and off. Reviewed by: ru Notes: svn path=/head/; revision=129633
* We don't need to initialize if_output, ether_ifattach() does itMaxime Henrion2004-05-231-1/+0
| | | | | | | for us. Notes: svn path=/head/; revision=129616
* Cosmetic:Yaroslav Tykhiy2004-05-211-2/+6
| | | | | | | | Set capability bits in a consistent way. Add a comment on why the VLAN_MTU stuff comes after ether_ifattach(). Notes: svn path=/head/; revision=129557
* The driver fxp(4) has reception of large frames enabled hardcodedly,Yaroslav Tykhiy2004-05-211-0/+1
| | | | | | | so let VLAN_MTU be marked in if_capenable from the beginning. Notes: svn path=/head/; revision=129553