summaryrefslogtreecommitdiff
path: root/sys/dev/ti
Commit message (Collapse)AuthorAgeFilesLines
* Copy releng/7.2 to release/7.2.0 for FreeBSD 7.2-RELEASE.release/7.2.0_cvsKen Smith2009-05-014-4/+4
| | | | | | Approved by: re (implicit) This commit was manufactured to restore the state of the 7.2-RELEASE image.
* MFC: Fix function prototype for device_shutdown method.Pyun YongHyeon2008-03-131-2/+4
| | | | Notes: svn path=/stable/7/; revision=177136
* MFC rev 1.131 if_ti.cRemko Lodder2008-02-261-0/+1
| | | | | | | | | | | | | | Set the baudrate for if_ti. PR: kern/40516 Submitted by: "Jin Guojun[VFF]" <jin at adsl-63-198-35-122 dot dsl dot snfc21 dot pacbell dot net> Approved by: imp (mentor, implicit for minor changes) MFC After: 1 week Approved by: imp (mentor, implicit) Notes: svn path=/stable/7/; revision=176601
* Catch up the rest of the drivers with the ether_vlan_mtap modifications.Christian S.J. Peron2007-03-041-1/+1
| | | | | | | | | | | | | If these drivers are setting M_VLANTAG because they are stripping the layer 2 802.1Q headers, then they need to be re-inserting them so any bpf(4) peers can properly decode them. It should be noted that this is compiled tested only. MFC after: 3 weeks Notes: svn path=/head/; revision=167190
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Change the remainder of the drivers for DMA'ing devices enabled in theMarius Strobl2007-01-211-1/+1
| | | | | | | | | | | sparc64 GENERIC and the sound device drivers known working on sparc64 to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4), stge(4) and ti(4) these changes are runtime tested (unless I booted up the wrong kernels again...). Notes: svn path=/head/; revision=166165
* Move ethernet VLAN tags from mtags to its own mbuf packet header fieldAndre Oppermann2006-09-171-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=162375
* - Consistently use if_printf() only in interface methods: if_start(),Gleb Smirnoff2006-09-151-46/+47
| | | | | | | | | | | if_watchdog, etc., or in functions used only in these methods. In all other functions in the driver use device_printf(). - Use __func__ instead of typing function name. Submitted by: Alex Lyashkov <umka sevcity.net> Notes: svn path=/head/; revision=162321
* Fix invalid reference of mbuf chains.Pyun YongHyeon2006-08-121-25/+25
| | | | | | | | | | | | | Use proper pointer dereference to inform modified mbuf chains to caller. While I'm here perform checksum offload setup after loading DMA maps. In collaboration with: glebius Notes: svn path=/head/; revision=161236
* - Tx side bus_dmamap_load_mbuf_sg(9) support. This reduces bookkeepingPyun YongHyeon2006-01-032-168/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requiried to keep consistent softc state before/after callback function invocation and supposed to be sligntly faster than previous one as it wouldn't incur callback overhead. With this change callback function was gone. - Decrease TI_MAXTXSEGS to 32 from 128. It seems that most mbuf chain length is less than 32 and it would be re-packed with m_defrag(9) if its chain length is larger than TI_MAXTXSEGS. This would protect ti(4) against possible kernel stack overflow when txsegs[] is put on stack. Alternatively, we can embed the txsegs[] into softc. However, that would waste memory and make Tx/Rx speration hard when we want to sperate Tx/Rx handlers to optimize locking. - Fix dma map tracking used in Tx path. Previously it used the dma map of the last mbuf chain in ti_txeof() which was incorrect as ti(4) used dma map of the first mbuf chain when it loads a mbuf chain with bus_dmamap_load_mbuf(9). Correct the bug by introducing queues that keep track of active/inactive dma maps/mbuf chain. - Use ti_txcnt to check whether driver need to set watchdog timer instead of blidnly clearing the timer in ti_txeof(). - Remove the 3rd arg. of ti_encap(). Since ti(4) now caches the last descriptor index(ti_tx_saved_prodidx) used in Tx there is no need to pass it as a fuction arg. - Change data type of producer/consumer index to int from u_int16_t in order to remove implicit type conversions in Tx/Rx handlers. - Check interface queue before getting a mbuf chain to reduce locking overhead. - Check number of available Tx descriptores to be 16 or higher in ti_start(). This wouldn't protect Tx descriptor shortage but it would reduce number of bus_dmamap_unload(9) calls in ti_encap() when we are about to running out of Tx descriptors. - Command NIC to send packets ony when the driver really has packets enqueued. Previously it always set TI_MB_SENDPROD_IDX which would command NIC to DMA Tx descriptors into NIC local memory regardless of Tx descriptor changes. Reviewed by: scottl Notes: svn path=/head/; revision=153982
* Cache the tx producer index instead of reading it every time ti_start isScott Long2005-12-282-1/+4
| | | | | | | called. Notes: svn path=/head/; revision=153778
* Fix a serious regression from the busdma conversion. Check to make sureScott Long2005-12-281-10/+17
| | | | | | | | that we don't overrun the tx descriptor ring before actually trying to overrun it. Notes: svn path=/head/; revision=153776
* Bring big-endian architecture support for ti(4).Pyun YongHyeon2005-12-282-241/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . remove unnecessay header files after Scott's bus_dma(9) commit. . remove global variable tis which was introduced at the time of zero_copy(9) changes. The variable tis was not used at all. The same applyes to ti_links in softc so axe it. . deregister variables. . axe ti_vhandle and switch to use explicit register access for accessing NIC local memory. Creates three variants of ti_mem to read/write NIC local memory(ti_mem_read, ti_mem_write) and clearing NIC local memory(ti_mem_zero). This greatly enhances code readability and have ti(4) drop using shared memory scheme for Tigon 1. As Tigon 1 switched to use explicit register access for Tx, axe ti_tx_ring_nic/ti_cmd_ring in softc.(Tigon 2 used to host ring scheme which means there is no need to access NIC local memory via register access for Tx and NIC would DMA the modified Tx rings into its local memory.) [1] . introduce new macro TI_EVENT_*/TI_CMD_* to handle NIC envent/command. Instead of using bit fields assginment for accessing the event, use shift operations to set/get it. [1] . add additional check for valid DMA tags in ti_free_dmamaps(). . add missing bus_dmamap_sync/bus_dmamap_unload in ti_free_*_ring_*. . fix locking nits(MTX_RECURSE mutex) and make ti(4) MPSAFE. . change data type of ti_rdata_phys to bus_addr_t and don't blindly cast to uint32_t. . rearrange detach path and make ti(4) survive during device detach. . for Tigon 1, use explicit register access for checking Tx descriptors in ti_encap()/ti_txeof(). [1] . properly call bus_dmamap_sync(9) for updating statistics. . remove extra semicolon in ti_encap() . rewrite loading MAC address to work on strict-alignment architectures. . move TI_RD_OFF macro to if_tireg.h . axe ETHER_ALIGN as it's already defined in <net/ethernet.h>. . make macros immuine from expansion by adding parenthesis and do-while. . remove alpha specific hack as vtophys(9) is no longer used in ti(4) after Scott's bus_dma(9) fix. Reviewed by: scottl Obtained from: OpenBSD [1] Notes: svn path=/head/; revision=153770
* - Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag inGleb Smirnoff2005-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 Notes: svn path=/head/; revision=153512
* Fix the Tigon I/II driver to support 64-bit DMA. In the process, convert itScott Long2005-12-142-99/+347
| | | | | | | | | | | | | | | | | | | | | | | to use busdma. Unlike most of the other drivers, but similar to the if_em driver, pre-allocate the dmamaps at init time instead of allocating them on the fly when descriptors need to be filled. This isn't ideal right now because a map is allocated for every descriptor slot in the tx, rx, mini, and jumbo rings (which is a lot!) in order to simplify the bookkeeping, even though the driver might support filling only a subset of those slots. Luckily, maps are typically NULL on i386 and amd64, so the cost isn't very high. It could be an issue with sparc64, but the driver isn't endian clean either, and that is a much bigger problem to solve first. Note that jumbo frame support is under-tested, and I'm not even sure if it till really works correctly given the evil VM magic that is does. The changes here attempt to preserve the existing semanitcs. Thanks to Martin Nillson for contributing the Netgear card for this work. MFC-After: 3 weeks Notes: svn path=/head/; revision=153396
* Allocate the jumbo rx frame buffer with busdma.Scott Long2005-12-102-15/+28
| | | | Notes: svn path=/head/; revision=153288
* if_ti has been operating with locks for a while, so remove the GIANT markers.Scott Long2005-12-101-20/+29
| | | | | | | Also fix man potential locking problems in the cdev ioctl handler. Notes: svn path=/head/; revision=153281
* The if_ti Tigon I/II driver has moved to /sys/dev/tiScott Long2005-12-101-3/+3
| | | | Notes: svn path=/head/; revision=153280
* - 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
* In detach method, move if_free() after bus_teardown_intr().Ruslan Ermilov2005-10-131-2/+2
| | | | Notes: svn path=/head/; revision=151297
* Use if_printf() and device_printf().John Baldwin2005-09-291-90/+92
| | | | Notes: svn path=/head/; revision=150719
* Typo.John Baldwin2005-09-291-1/+1
| | | | Notes: svn path=/head/; revision=150716
* Fix "struct ifnet" leaks when attach() fails in the middle, e.g.Ruslan Ermilov2005-09-161-2/+2
| | | | | | | | | when mii_phy_probe() or bus_setup_intr() fails. For drivers that call their detach() in this case, call if_free() there to cover this case too. Notes: svn path=/head/; revision=150213
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-13/+14
| | | | | | | | | | | | | | | | | 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
* 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
* Fix ifnet fallout in if_ti.Scott Long2005-07-071-8/+7
| | | | | | | | Reviewed by: brooks Approved by: re Notes: svn path=/head/; revision=147805
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-102-29/+37
| | | | | | | | | | | | | | | | | | | | | | | 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
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-1/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* If resource allocation fails, we could wind up freeing the cdev without itScott Long2005-03-311-1/+2
| | | | | | | | | being allocated. Add a simple check for this. Submitted by: yongari Notes: svn path=/head/; revision=144407
* deal with malloc failure when setting up the multicast filterSam Leffler2005-03-261-0/+4
| | | | | | | Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144165
* Start the process of modernizing the Tigon driver by using busdma for theScott Long2005-03-212-21/+92
| | | | | | | | descriptor and configuration data. Thanks to Martin Nilsson for providing hardware. Notes: svn path=/head/; revision=143903
* Fix style(9) issues with __P removal.Warner Losh2005-02-241-59/+55
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=142407
* Return BUS_PROBE_DEFAULT instead of 0.Warner Losh2005-02-241-1/+1
| | | | Notes: svn path=/head/; revision=142398
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-072-2/+2
| | | | Notes: svn path=/head/; revision=139825
* Update the Tigon 1 and 2 driver to use the sf_buf API for implementingAlan Cox2004-12-061-15/+23
| | | | | | | | | | | | | | | zero-copy receive of jumbo frames. This eliminates the need for the jumbo frame allocator implemented in kern/uipc_jumbo.c and sys/jumbo.h. Remove it. Note: Zero-copy receive of jumbo frames did not work without these changes; I believe there was insufficient locking on the jumbo vm object. Tested by: ken@ Discussed with: gallatin@ Notes: svn path=/head/; revision=138424
* Tag a last set of PCI network interfaces as IFF_NEEDSGIANT until theyRobert Watson2004-08-281-1/+2
| | | | | | | are either locked down or demonstrated MPSAFE. Notes: svn path=/head/; revision=134442
* Whitespace pass.Bruce M Simpson2004-07-051-40/+39
| | | | Notes: svn path=/head/; revision=131655
* style(9):Bruce M Simpson2004-07-051-75/+75
| | | | | | | | - Space before bracketized non-void function returns. - Space before condition for conditional blocks. Notes: svn path=/head/; revision=131654
* Eliminate redundant return keywords.Bruce M Simpson2004-07-051-48/+0
| | | | Notes: svn path=/head/; revision=131653
* Whitespace nitsBruce M Simpson2004-07-051-23/+23
| | | | Notes: svn path=/head/; revision=131652
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-162-4/+4
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129878
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-3/+3
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Announce ethernet MAC addresss in ether_ifattach().Matthew N. Dodd2004-03-141-6/+0
| | | | Notes: svn path=/head/; revision=126966
* Stop setting ifp->if_output to ether_output() since ether_ifattach()Maxime Henrion2004-03-111-1/+0
| | | | | | | does it for us already. Notes: svn path=/head/; revision=126847
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-0/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Device megapatch 1/6:Poul-Henning Kamp2004-02-211-2/+0
| | | | | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number. Notes: svn path=/head/; revision=126076
* Drop the driver lock around calls to if_input to avoid a LOR whenSam Leffler2003-11-142-0/+5
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=122689
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-3/+2
| | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=121816
* Sanitize the code relating to the /dev/ti%d entries. In particular evictPoul-Henning Kamp2003-10-101-68/+6
| | | | | | | the evil vnode sniffing code and use destroy_dev() instead. Notes: svn path=/head/; revision=120980