summaryrefslogtreecommitdiffstats
path: root/sys/dev/vge
Commit message (Collapse)AuthorAgeFilesLines
* Fix the hardware VLAN tagging. TX was broken on little-endianru2006-11-301-2/+7
| | | | | | | | | | | | | | machines and both TX and RX were broken on big-endian machines. The chip design is crazy -- on RX, it puts the 16-bit VLAN tag in network byte order (big-endian) in the 32-bit little-endian register! Thanks to John Baldwin for helping me document this change! ;-) Tested by: sat (amd64), test program (sparc64) PR: kern/105054 MFC after: 3 days
* Remove pre-5.3 compatibility ifdefs.brueffer2006-11-291-61/+0
| | | | | Approved by: rwatson (mentor) MFC after: 5 days
* Move ethernet VLAN tags from mtags to its own mbuf packet header fieldandre2006-09-171-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m_pkthdr.ether_vlan. The presence of the M_VLANTAG flag on the mbuf signifies the presence and validity of its content. Drivers that support hardware VLAN tag stripping fill in the received VLAN tag (containing both vlan and priority information) into the ether_vtag mbuf packet header field: m->m_pkthdr.ether_vtag = vlan_id; /* ntohs()? */ m->m_flags |= M_VLANTAG; to mark the packet m with the specified VLAN tag. On output the driver should check the mbuf for the M_VLANTAG flag to see if a VLAN tag is present and valid: if (m->m_flags & M_VLANTAG) { ... = m->m_pkthdr.ether_vtag; /* htons()? */ ... pass tag to hardware ... } VLAN tags are stored in host byte order. Byte swapping may be necessary. (Note: This driver conversion was mechanic and did not add or remove any byte swapping in the drivers.) Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition. No more tag memory allocation have to be done. Reviewed by: thompsa, yar Sponsored by: TCP/IP Optimization Fundraise 2005
* Add locking to vge_ifmedia_upd().mr2006-09-041-0/+2
| | | | | | | | With this WD-timeouts for vge(4) got reduced signifficantly. Testet on -stable. Submitted by: Oleg Bulyzhin MFC after: 1 day
* Do not touch ifp->if_baudrate in miibus aware drivers.glebius2006-02-141-1/+0
|
* - Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag inglebius2005-12-181-2/+5
| | | | | | | | | case if memory allocation failed. - Remove fourth argument from VLAN_INPUT_TAG(), that was used incorrectly in almost all drivers. Indicate failure with mbuf value of NULL. In collaboration with: yongari, ru, sam
* - Store pointer to the link-level address right in "struct ifnet"ru2005-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.
* Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntaximp2005-10-221-1/+1
| | | | (device miibus) in time for 7.0 :-)
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceglebius2005-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
* Big polling(4) cleanup.glebius2005-10-011-54/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weimp2005-09-191-2/+2
| | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call.
* Fix "struct ifnet" leaks when attach() fails in the middle.ru2005-09-161-1/+2
|
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-10/+10
| | | | | | | | | | | | | | 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
* Modify device drivers supporting multicast addresses to lock if_addr_mtxrwatson2005-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
* Move if_alloc() up so it's before mii_phy_probe().brooks2005-06-111-6/+7
|
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-102-16/+22
| | | | | | | | | | | | | | | | | | | | 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
* Remove some variables the last commit stopped using so the code compiles.brooks2005-06-061-2/+0
|
* The PCI bus code saves/restores these config registers now.imp2005-06-052-21/+0
|
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-291-2/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Remove the extra EEPROM reload step I added before. vge_reset()wpaul2005-04-251-2/+0
| | | | already does this anyway.
* Correct the if_link_state_change() logic: when the link went down,wpaul2005-04-251-2/+2
| | | | | if_link_state_change() reported link up, and when the link went up, if_link_state_change() reported link down. These should be swapped.
* Reading the EEPROM to learn the station address doesn't seem to workwpaul2005-04-251-0/+11
| | | | | | | | | on boards with VIA gigE controllers that are embedded in VIA chipsets. Presumably, they don't have an external EEPROM and store the MAC address somewhere else. To get around this, force an autoload and read the station address from the RX filter registers instead. This has been tested to work on both embedded and standalone controllers.
* Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, returnimp2005-03-011-1/+1
| | | | | BUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vx both support so that xl will snarf them on up.
* Use if_link_state_change() instead of rt_ifmsg(). Remove include net/route.h.glebius2005-02-071-9/+4
| | | | Reviewed by: wpaul, sam
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-063-3/+3
|
* Remove unneeded TX channel wakeup from vge_txeof(). This was putwpaul2004-09-111-1/+0
| | | | | there for testing and forgotten. It's not really needed, and taking it out saves a register access.
* Remove unneeded VGE_UNLOCK() in vge_detach().wpaul2004-09-111-1/+0
|
* Add device driver support for the VIA Networking Technologieswpaul2004-09-103-0/+3316
VT6122 gigabit ethernet chip and integrated 10/100/1000 copper PHY. The vge driver has been added to GENERIC for i386, pc98 and amd64, but not to sparc or ia64 since I don't have the ability to test it there. The vge(4) driver supports VLANs, checksum offload and jumbo frames. Also added the lge(4) and nge(4) drivers to GENERIC for i386 and pc98 since I was in the neighborhood. There's no reason to leave them out anymore.
OpenPOWER on IntegriCloud