aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cs
Commit message (Collapse)AuthorAgeFilesLines
* Improve the EEPROM parsing, based on finding a datasheet that describesWarner Losh2008-07-092-36/+45
| | | | | | | | | | | | | | | | | | it in detail. When setting media, don't error out when a specific media is selected. # Note: There may be some issues still here since the EtherJet PC Card doesn't # conform to the datasheet. Many different kinds of dongles can be plugged in # and it is unknown how to ask which one it is. Also, add a /* bad! */ comment to a 1/2 second delay after we set the DC/DC parameters. This should be a *sleep of some sort for !cold. Fortunately it is the only one and is only used when setting media, so the benefit from removing it is small. Unfortunately, it likely serves as an exemplar of good programming techniques, which it isn't. Notes: svn path=/head/; revision=180388
* Tweak a comment and a constant to restore old 30ms upper bound.Warner Losh2008-06-061-3/+3
| | | | | | | cs_readreg takes ~2us not ~1us to run. Notes: svn path=/head/; revision=179621
* o Remove unused cs_debug tunable. I think I added it and then nothing withWarner Losh2008-06-061-10/+22
| | | | | | | | | | | | | | it. Bad imp. Removing us dips us under 10,000 in size too. o Replace an unconditional 30ms DELAY (yes, busy wait) with a check of the SIBUSY bit in the SelfST register before accessing the eeprom. This changes the time to read the EEPROM from 2 * 20 * 30ms (1.2s) to < 20*25us (.0005s) and make the attach of the card tolerable when ethernet media is present. Include data from the datasheet about why this works. While this is a 2500x speed increase, it doesn't really matter at all once the card is probed... o set dev earlier in softc. Notes: svn path=/head/; revision=179620
* Forgot to commit these files too :-(Warner Losh2008-06-062-3/+3
| | | | Notes: svn path=/head/; revision=179618
* Minor clean up to shave about 1.5k off the size of the driver:Warner Losh2008-06-064-95/+12
| | | | | | | | | | | | o remove unused fields from softc and args from cs_alloc_irq o remove some commented code that will never be implemented. o Don't try to send a packet and see if it worked. We don't need this anymore, and it doesn't add any value. o tweaks for BNC and AUI. o limit possible time hung in the kernel to 4s rather than 40s. Notes: svn path=/head/; revision=179597
* Simplify error checking when reading the function....Warner Losh2008-06-061-3/+1
| | | | Notes: svn path=/head/; revision=179594
* cs has detach, remove bogus ifdef.Warner Losh2008-06-061-3/+1
| | | | | | | Remove dedundant initialization of error to 0. Notes: svn path=/head/; revision=179593
* Remove unused fields in softc. If they are ever really needed again,Warner Losh2008-06-064-27/+3
| | | | | | | | | they can re-added. Remove CS_NAME. Don't whine when there's an ignored checksum error: User has said STFU, so we should S the FU. (remove mandated properties). Notes: svn path=/head/; revision=179591
* Make the cs(4) driver MPSAFE:John Baldwin2008-06-054-67/+118
| | | | | | | | | | | | - Add a mutex to the softc to protect the softc and the device hardware. - Add a private timer to manage transmit watchdogs rather than using if_timer/if_watchdog. - Setup the interrupt handler after ether_ifattach(). Tested by: imp Notes: svn path=/head/; revision=179560
* Fix the media auto code by breaking it :-). Auto now just means 'useWarner Losh2008-06-051-19/+8
| | | | | | | | | | | | | | | 10BaseT' since it required 10BaseT to have carrier to switch to it. This chip makes it hard to do proper auto, so we don't do it. We can't test carrier on things easily. Don't insist on carrier when we set the media. Don't report failures. Remove a 1s! delay that appears to not be needed. With these patches, and John Baldwin's patches, I'm able to pass packets on my IBM EtherJet card again. Notes: svn path=/head/; revision=179553
* o Improve the probe code dealing with interrupts.Warner Losh2008-06-041-83/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | o When forced to be 10baseT, don't require that the 10baseT interface have link to succeed. Still require it for IFM_AUTO, however, since it appears that there's no way to tell if a specific type of interface worked. I'm doing a web search for a datasheet now to see if there's anything obvious. o Minor incidental formatting nits, including collapsing code of the form if (foo) { bar(); } else { if (baz) bing(); } into: if (foo) { bar(); } else if (baz) { bing(); } to save an indentation level. o Remove stray reference to 3.x config file syntax. # I believe John's patches still apply after this... Notes: svn path=/head/; revision=179532
* Correct logic error that would prevent cs pccards from working onWarner Losh2008-06-031-8/+8
| | | | | | | | | | | | systems where the CardBus bridge was connected to a APIC. The case where the probe routine is told to not setup the IRQ was mishandled but the error was masked in the case where the IRQ was a valid one for the card. MFC after: 1 week Notes: svn path=/head/; revision=179507
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-232-2/+2
| | | | | | | | | | | | | | | | 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
* - Consistently use if_printf() only in interface methods: if_start(),Gleb Smirnoff2006-09-152-12/+15
| | | | | | | | | | | 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 multicast support for cs89x0 chips. Just setting the RX_MULTCAST_ACCEPTPhilip Paeps2006-03-101-18/+56
| | | | | | | | | | | flag isn't enough - the filter needs to be set up too, or no multicast frames are accepted. Sponsored by: Philips Industrial Applications (indirectly) MFC after: 3 days Notes: svn path=/head/; revision=156559
* Use ETHER_ADDR_LEN rather than 6.Warner Losh2006-02-111-1/+1
| | | | Notes: svn path=/head/; revision=155526
* Remove oldcard support by removing the compat shims.Warner Losh2005-09-201-21/+5
| | | | Notes: svn path=/head/; revision=150394
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh2005-09-191-1/+1
| | | | | | | | | | 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. Notes: svn path=/head/; revision=150306
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-12/+12
| | | | | | | | | | | | | | | | | 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
* Eliminate unused argument in PCMCIA_CARD macro.Warner Losh2005-06-241-1/+1
| | | | | | | | | | | Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments. Approved by: re (dwhite) Notes: svn path=/head/; revision=147580
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-102-29/+39
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix the worst offenders of style(9) with a small style sweep.Warner Losh2005-01-281-48/+36
| | | | Notes: svn path=/head/; revision=140928
* Cleanup tabs vs spaces.Warner Losh2005-01-283-204/+202
| | | | Notes: svn path=/head/; revision=140927
* For the PC Card implementation of the CS8920M that's in my IBMWarner Losh2005-01-283-3/+8
| | | | | | | | | | | | | | | | EtherJet, the interrupt is selected in the eeprom based on the layout of the PC Card board. Since this is encoded into the EEPROM, and has no relationship to the IRQ that the pccard bridge routes the PC Card's interrupt pin to. As such, stop writing to that register. This gets my EtherJet working. # The eeprom reading code appears to be totally wrong for my EtherJet # card. This causes the card to bogusly detect the media options # available. Notes: svn path=/head/; revision=140926
* Setting hw.cs.recv_delay should set the delay, not the ignore theWarner Losh2005-01-281-1/+1
| | | | | | | eeprom checksum. Notes: svn path=/head/; revision=140925
* error = is needed before ether_ioctl() so that unsupported/unknownWarner Losh2005-01-281-1/+1
| | | | | | | | | | IOCLTs are properly handled. This gets the cs driver properly reporting things via ifconfig. # my pccard still doesn't work. Notes: svn path=/head/; revision=140921
* Write cs_detach() and use it. This resolves the twin problems of theWarner Losh2005-01-273-2/+17
| | | | | | | | cs1 interface linger on card eject, as well as the warnings about the card still using resources. Ooops. Notes: svn path=/head/; revision=140888
* Only attach to network functions (unlikely to matter since I'm notWarner Losh2005-01-201-0/+10
| | | | | | | aware of any multi-function cs cards, but it doesn't hurt). Notes: svn path=/head/; revision=140524
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-065-5/+5
| | | | Notes: svn path=/head/; revision=139749
* Since if_cs doesn't contain locking or run with INTR_MPSAFE, markRobert Watson2004-08-131-1/+2
| | | | | | | the interface as IFF_NEEDSGIANT so if_start is run holding Giant. Notes: svn path=/head/; revision=133681
* Fix disordering of pccarddevs.h noticed by bde. Also remove a fewWarner Losh2004-05-271-1/+1
| | | | | | | | | redundant includes and fix some of the include disordering. Submitted by: bde Notes: svn path=/head/; revision=129764
* Move to generating pccarddevs.h on the fly, both for the kernel andWarner Losh2004-05-261-1/+1
| | | | | | | | | | the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment. Notes: svn path=/head/; revision=129740
* 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
* We don't need the dependency on the pccard module here.Warner Losh2004-05-081-1/+0
| | | | Notes: svn path=/head/; revision=129047
* Remove improper use of if_addrhead in device drivers to checkLuigi Rizzo2004-04-151-4/+0
| | | | | | | | | | | | | | | if the link-level address has been initialized already. The majority of modern drivers never does this and works fine, which makes me think that the check is totally unnecessary and a residue of cut&paste from other drivers. This change is done to simplify locking because now almost none of the drivers uses this field. The exceptions are "ct" "ctau" and "cx" where i am not sure if i can remove that part. Notes: svn path=/head/; revision=128293
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-2/+2
| | | | | | | | 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-4/+0
| | | | Notes: svn path=/head/; revision=126966
* o Add sysctl to allow ignoring checksum of eeprom.Warner Losh2003-11-042-53/+77
| | | | | | | | | | | | | | | o Fix minor type problems o Fix minor problem with a couple debug printfs. o Default to a sane media type when none is reported. o Minor style changes The PR complains this will fix the IBM 300GL cards. Submitted by: Max Gotlib PR: 11462 Notes: svn path=/head/; revision=122024
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-314-11/+9
| | | | | | | | | | | | | | | | 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
* There is no way to enter the attach routine twice with the same softcBrooks Davis2003-10-301-67/+65
| | | | | | | | | | without a detach call in between so don't try to deal with that possiability. This is a diff-reduction commit for the upcoming if_xname conversion. Notes: svn path=/head/; revision=121752
* Use __FBSDID().David E. O'Brien2003-08-243-3/+9
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* - Express hard dependencies on bus (pci, isa, pccard) andMatthew N. Dodd2003-04-152-3/+6
| | | | | | | | | | | 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
* Make sure that pp_name is non-null before setting the deviceWarner Losh2003-04-101-1/+2
| | | | | | | | description. This allows us to rely entirely on the CIS entries if necessary... Notes: svn path=/head/; revision=113315
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* network interface driver changes:Sam Leffler2002-11-141-18/+6
| | | | | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re Notes: svn path=/head/; revision=106937
* Use if_printf(ifp, "blah") instead ofBrooks Davis2002-10-011-23/+18
| | | | | | | printf(CS_NAME"%d: blah", ifp->if_unit); Notes: svn path=/head/; revision=104252
* Migrate to PCMCIA_CARD() macrosWarner Losh2001-11-151-3/+1
| | | | Notes: svn path=/head/; revision=86394
* s/PCCARD_/PCMCIA_/g in NEWCARD device tables to enable easier NetBSD sharingWarner Losh2001-11-111-3/+3
| | | | Notes: svn path=/head/; revision=86273
* Additional enhancments to allow IBM Etherjet cards to be probed,Warner Losh2001-02-234-110/+136
| | | | | | | | | | | | | | | | | | | | attached and ifconfigable. The card doesn't interrupt yet. Also, move towards bus space by introducing new macros/inline functions which make such a move much easier than before. These inline functions are setup now to work around an IBM EtherJet pccard cardbus bridge incompatibility. The card works in 8 bit mode, but not in 16-bit mode when it is connected to a cardbus bridge for reasons unknown. The Linux driver also has a similar workaround in it. Future work will include making the above workaround runtime conditional rather than compile time conditional, as well as fixing the interrupts in pccards and converting it to bus space. Notes: svn path=/head/; revision=72940