aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/if_ti.c
Commit message (Collapse)AuthorAgeFilesLines
* The if_ti Tigon I/II driver has moved to /sys/dev/tiScott Long2005-12-101-3553/+0
| | | | 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
* 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-101-28/+36
| | | | | | | | | | | | | | | | | | | | | | | 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-211-21/+88
| | | | | | | | 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-53/+49
| | | | | | | 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-071-1/+1
| | | | 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-39/+38
| | | | 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-161-3/+3
| | | | | | | 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-141-0/+4
| | | | | | | | | | | 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
* Prefer new location of pci include files (which have only been in theWarner Losh2003-08-221-2/+2
| | | | | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD. Notes: svn path=/head/; revision=119288
* Enable IFCAP_VLAN_MTU and increase MTU for it.Hidetoshi Shimokawa2003-08-051-2/+3
| | | | | | | Reviewed by: wpaul Notes: svn path=/head/; revision=118454
* Remove code that tries to detect if the MCLSHIFT and MSIZE macrosMaxime Henrion2003-06-131-46/+0
| | | | | | | | | | are the same that those of the kernel in the KLD_MODULE case. If we ever want to detect that kind of problems, this is not the right place to do this since every network driver would be affected by such desynchronisation. Notes: svn path=/head/; revision=116310
* Remove now unused pointer to etherheader.Poul-Henning Kamp2003-05-311-2/+0
| | | | | | | Found by: FlexeLint Notes: svn path=/head/; revision=115527
* Use newly minted device_is_attached rather than device_is_alive to seeWarner Losh2003-04-211-1/+1
| | | | | | | | | | | | if attach succeeded. device_is_alive just tells us that probe succeeded. Since we were using it to do things like detach net interfaces, this caused problems when there were errors in the attach routine. Symptoms of problem reported by: martin blapp Notes: svn path=/head/; revision=113812
* Revise attach/detach resource cleanupNate Lawson2003-04-171-5/+13
| | | | | | | | | | | | | | | | | | - Unconditionally call *_stop() if device is in the tree. This is to prevent callouts from happening after the device is gone. Checks for bus_child_present() should be added in the future to keep from touching potentially non-existent hardware in *_detach(). Found by iedowse@. - Always check for and free miibus children, even if the device is not in the tree since some failure cases could have gotten here. - Call ether_ifdetach() in the irq setup failure case - ti(4), xl(4): move ifmedia_init() calls to the beginning of attach so that ifmedia_removeall() can be unconditionally called on detach. There is no way to detect whether ifmedia has been initialized without using a separate variable (as tl(4) does). - Add comments to indicate assumptions of code path Notes: svn path=/head/; revision=113609
* - Don't call pci_enable_io() in drivers (unless needed for resume).Matthew N. Dodd2003-04-161-9/+0
| | | | | | | | - Don't test memory/port status and emit an error message; the PCI bus code will do this now. Notes: svn path=/head/; revision=113545
* - Express hard dependencies on bus (pci, isa, pccard) andMatthew N. Dodd2003-04-151-1/+3
| | | | | | | | | | | network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.) Notes: svn path=/head/; revision=113506
* Use __FBSDID rather than rcsid[].David E. O'Brien2003-04-031-7/+3
| | | | Notes: svn path=/head/; revision=113038
* Fix KASSERT syntax error.Poul-Henning Kamp2003-04-011-1/+1
| | | | Notes: svn path=/head/; revision=112930
* Clean up locking and resource management for pci/if_*Nate Lawson2003-03-311-50/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove locking of the softc in the attach method, instead depending on bus_setup_intr being at the end of attach (delaying interrupt enable until after ether_ifattach is called) - Call *_detach directly in the error case of attach, depending on checking in detach to only free resources that were allocated. This puts all resource freeing in one place, avoiding thinkos that lead to memory leaks. - Add bus_child_present check to calls to *_stop in the detach method to be sure hw is present before touching its registers. - Remove bzero softc calls since device_t should do this for us. - dc: move interrupt allocation back where it was before. It was unnecessary to move it. This reverts part of 1.88 - rl: move irq allocation before ether_ifattach. Problems might have been caused by allocating the irq after enabling interrupts on the card. - rl: call rl_stop before ether_ifdetach - sf: call sf_stop before ether_ifdetach - sis: add missed free of sis_tag - sis: check errors from tag creation - sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation - sk: remove duplicate initialization of sk_dev - ste: add missed bus_generic_detach - ti: call ti_stop before ether_ifdetach - ti: add missed error setting in ti_rdata alloc failure - vr: add missed error setting in I/O, memory mapping cases - xl: add missed error setting in I/O, memory mapping cases - xl: remove multi-level goto on attach failure - xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation - Calls to free(9) are unconditional because it is valid to call free with a null pointer. Reviewed by: imp, mdodd Notes: svn path=/head/; revision=112872
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-13/+5
| | | | | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl) Notes: svn path=/head/; revision=111815
* Spell noread() and nowrite() correctly (ie: not "NULL")Poul-Henning Kamp2003-03-021-2/+2
| | | | Notes: svn path=/head/; revision=111759
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-8/+8
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-8/+8
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* o track either_ifattach/ether_ifdetach API changesSam Leffler2002-11-141-29/+16
| | | | | | | | | | | | | | o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes Reviewed by: many Approved by: re Notes: svn path=/head/; revision=106936
* Use %z to print a size_t value.John Baldwin2002-11-081-1/+1
| | | | Notes: svn path=/head/; revision=106627
* Be consistent about functions being static.Poul-Henning Kamp2002-10-161-2/+2
| | | | | | | Spotted by: FlexeLint. Notes: svn path=/head/; revision=105219