summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep_pccard.c
Commit message (Collapse)AuthorAgeFilesLines
* o break newbus api: add a new argument of type driver_filter_t topiso2007-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@
* MFp4: Migrate from CARD_CIS_SCAN to pccard_cis_scanimp2005-09-131-1/+1
|
* Upon relection, we shouldn't allow the tuple structs to be modified byimp2005-07-011-1/+1
| | | | | | | the functor, so make it a const pointer, and chase down the resulting const-poisoning. Approved by: re (scottl)
* Minor cleanup of ep driver and pccard attachment:imp2005-07-011-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Grab the MAC address out of the CIS if the card has the special 3Com 0x88 tuple. Most 3Com cards don't have this tuple, but we prefer it to the eeprom since it only appears to be present when the eeprom doesn't have the info. So far, I've only observed this on my 3C362 and 3C362B cards, but the NetBSD driver implies that the 3C362C also has this tuple, and that some 3C574 cards do too (none of mine do). ep_pccard_mac was written after looking at the NetBSD code. o Store the enet addr in the softc for this device, so we can use the overridden MAC to set the station address. o Create a routine to set the station address and use it where we need it. o setup the cmd shitfs and such before we call ep_alloc(), and remove setting up the cmd shift value there. It initializes to 0, and those attachments that need to frob it do so before calling ep_alloc. o Remove some obsolete comments o No longer a need to export ep_get_macaddr, so make it static o ep_alloc already grabs the EEPROM id, so we don't need to grab it again in ep_pccard_attach. o eliminate unit, it isn't needed, fix some printfs to be device_printf instead. # All my pccards except the 3C1 work now. Didn't test ISA or cbus cards # that I have: 3C509B-TP or 3C569B-J-TPO Tested on: 3C589B, 3C589C, 3C589D, 3C589D-TP, 3C562, 3C562B/3C563B, 3C562D/3C563D, 3CCFE574BT, 3CXEM556, 3CCSH572BT, 3C574-TX, 3CCE589EC, 3CXE589EC, 3CCFEM556, 3C1 Approved by: re (scottl)
* Add a chipset field to the lookup. Use this chipset type to determineimp2005-06-281-168/+58
| | | | | | | | | | | | which command to use to read the eeprom and which devices have an MII. Simplify code by no longer using the OLDCARD compat rouintes (I don't know if this breaks OLDCARD on pc98 or not, but OLDCARD on pc98 days are numbered, I hope). This also removes a number of kludges that we had before because they are OBE. Add a convenience routine to lookup the device to avoid many casts in many places. Tested with: 3C589D-TP, 3CCSH572BT Approved by: re (scottl, blanket ep)
* o When calling ep_get_macaddr(), provide it a local buffer. Add a commentimp2005-06-261-12/+15
| | | | | | | | | that says why we do this (or rather, explains that it is some voodoo magic that's poorly understood). The local buffer fixes the crash on attach. o Rename get_e() to ep_get_e() to avoid namespace pollution. Submitted by: mux Approved by: re (scottl)
* Eliminate unused argument in PCMCIA_CARD macro.imp2005-06-241-7/+7
| | | | | | | | 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)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* Don't print 'unknown id' in the ep_pccard_identify routine. It isimp2005-01-201-2/+1
| | | | | expected to be unknown in some cases, and printing it clutters up things too much.
* u_intXX_t -> uintXX_t while I'm here.imp2005-01-201-2/+2
|
* Only attach to network functions.imp2005-01-201-0/+10
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Fix disordering of pccarddevs.h noticed by bde. Also remove a fewimp2004-05-271-1/+1
| | | | | | redundant includes and fix some of the include disordering. Submitted by: bde
* Move to generating pccarddevs.h on the fly, both for the kernel andimp2004-05-261-1/+1
| | | | | | | the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment.
* MFp4:imp2003-11-021-6/+14
| | | | | | | | | | | | o Remove redundant $FreeBSD$ o Better comments about ep_get_macaddr. o remove one tab in a switch statement (style only) o Recognize ID 0x0035 as the device ID for the 3CXEM556 that I have. This makes the 3CXEM556 work for me. Not 100% sure this is the assigned ID, as I don't have the datasheets for this part, but it does work and get the correct ethrnet address. o Comment about the whole fake IRQ 3 thing. some need it, some don't, all work with it.
* Pass sc to GO_WINDOW macro.imp2003-10-261-4/+2
| | | | | | Use SET_IRQ for pccard case, rather than exapnding it inline. Requested by: mdodd
* Minor style nits suggested by sam and mdodd:imp2003-10-251-1/+1
| | | | | | o give an argument to EP_BUSY_WAIT o use foo_locked rather than foo_body o Add locking assertions for extra safety.
* Whole grab-bag of changes:imp2003-10-251-10/+10
| | | | | | | | o Make the driver MPSAFE o Some changes due to diff reduction effort with vx. o Removed some obsolete junk. Reviewed by: sam, modd
* Transition to using bus_space macros rather than the inb/outb/etc.imp2003-10-181-14/+20
| | | | | | | | | | | | Use EP_{READ,WRITE}{,_MULTI}_{1,2,4} instead. I've had several people submit patches like this over the years of varying qualities, markm being the last. The names were chosen in consulation with mdodd on irc. I've tested this with only PCMCIA cards: 3CCE589EC and 3CCSH572BT. I've not tried with my more extensive ISA, EISA and cbus collection. Reviewed by: mdodd
* Style fixes of the whitespace variety. Fix long lines and tabs.markm2003-08-301-3/+6
|
* Use __FBSDID().obrien2003-08-241-0/+3
| | | | Also some minor style cleanups.
* Style(9) cleanup. There was no consistent style in this driver, andmarkm2003-07-171-51/+48
| | | | | | | The next round of commits will be to fix up locking in it. This lot is to at least give a consistent base to work off. OK'ed by: imp, mdodd
* Make sure that pp_name is non-null before setting the deviceimp2003-04-101-1/+2
| | | | | description. This allows us to rely entirely on the CIS entries if necessary...
* - Free interrupt handler in ep_free().mdodd2003-03-291-18/+1
| | | | | - Move ep_pccard_detach() to if_ep.c and rename to ep_detach() - Specify detach methods for all bus frontends.
* - Return error status instead of value in get_e().mdodd2003-03-291-7/+20
| | | | | - Modify ep_get_macaddr() to return an error status. - Reverse the return value logic of eeprom_rdy().
* network interface driver changes:sam2002-11-141-1/+1
| | | | | | | | | | | | | | 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
* Fix build breakage on my pccard related commit.takawata2002-05-311-1/+1
|
* More devices. Obtained from NetBSD.imp2001-11-151-2/+4
|
* Migrate to PCMCIA_CARD() macrosimp2001-11-151-15/+5
|
* s/PCCARD_/PCMCIA_/g in NEWCARD device tables to enable easier NetBSD sharingimp2001-11-111-15/+15
|
* Use PCCARD_CIS_xxx #defines for the table of oem ids. These usuallyimp2001-01-211-5/+10
| | | | translate to all NULLs (as for all the ones in this commit).
* Add the 3COM ID's that I could find in the pccarddevs file that seemedpeter2001-01-071-0/+22
| | | | | | | | | | | to match the pccard.conf file. There are more ID's that need adding, but these seem to be the common ones. This was committed on an ep0 interface under NEWCARD: ep0: <3Com 3c589 10Mbps Ethernet> at port 0x300-0x30f irq 9 function 0 config 1 on pccard1 ep0: Ethernet address 00:10:4b:df:48:57 Reviewed by: imp
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Remove 7 unnecessary includes frmo phk's scriptimp2000-09-201-1/+0
|
* Implement indirection in the pccard probe/attach. This should make itimp2000-09-191-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | possible to have different probe/attach semantics between the two systems and yet still use the same driver for both. Compatibility methods for OLDCARD drivers. We use these routines to make it possible to call the OLDCARD driver's probe routine in the context that it expects. For OLDCARD these are implemented as pass throughs to the device_{probe,attach} routines. For NEWCARD they are implemented such such that probe becomes strictly a matching routine and attach does both the old probe and old attach. compat devices should use the following: /* Device interface */ DEVMETHOD(device_probe), pccard_compat_probe), DEVMETHOD(device_attach), pccard_compat_attach), /* Card interface */ DEVMETHOD(card_compat_match, foo_match), /* newly written */ DEVMETHOD(card_compat_probe, foo_probe), /* old probe */ DEVMETHOD(card_compat_attach, foo_attach), /* old attach */ This will allow a single driver binary image to be used for both OLDCARD and NEWCARD. Drivers wishing to not retain OLDCARD compatibility needn't do this. ep driver minorly updated. sn driver updated more than minorly. Add module dependencies to allow module to load. Also change name to if_sn. Add some debugging code. attempt to fix the cannot allocate memory problem I'd been seeing. Minor formatting nits.
* Add ID for 3C1. It is a etherlink iii in a CompactFlash form factor.imp2000-09-131-1/+4
| | | | | It doesn't seem to work, but at least is identified correctly. Minor tree housekeeping on my part.
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-1/+2
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* Remove unloaded printf. We do this now in the newbus layer.imp2000-04-171-1/+0
|
* Fix driver to restore function on 3c574 adapters. The panic onmdodd2000-01-151-0/+6
| | | | | | | ifconfig and bogus ethernet address (4b:57:4b:57:4b:57) has been hacked around. I'll revisit this when I have a clue whats going on. Reviewed by: obrien
* Commit kernel part of patches to get the 3Com OfficeConnect 3CXSH572BTimp2000-01-101-4/+3
| | | | | | | working on -current. Submitted by: Eric D. Futch <efutch@nyct.net> Approved by: mdodd
* kill debug printf that says detachimp1999-12-101-2/+0
|
* Fix the hang on card eject problem and maybe the hang on suspendimp1999-12-011-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | problem. o Create new timeout routine so we don't detach the card inside a ISR but instead drop back to spl0 via a timeout of 0. o Actually delete the child of the pccard device rather than just faking it badly. o Fix sio, ed and ep to have pccard detach routines that are int rather than void. o Fix ep and ed pccard detach routines to use if_detach rather than just if_down. if_detach destroys the device, while if_down just marks it down. In this incarnation of the pccard things, we map the disable the slot action to detach the driver, which removes the driver from the device tree. When that is done, a panic would soon follow as the ifconfig tried to down the device. Didn't fix: o Should cache the pccard dev child's pointer in struct slot o remove now unused parts of struct slot o Any driver using softc after detach has been called. sio's softc used to be statically allocated, so you could check sc->gone, but that is now gone. o Didn't remove gone from softc of drivers that use the old pccard method. Didn't test: o ed driver changes o sio driver changes on pccards o suspend (no laptop or apm support on my desktop)
* Kill unneeded #includes. They were left over from the short period ofimp1999-11-201-6/+0
| | | | | time when a strcmp against the device name was required. Sio patches sent to peter for review.
* Add (untested) support for the 3C562D/3C563D. I have been unable toimp1999-10-291-0/+3
| | | | | | | test this support since I don't have the dongle for the card in question and the dongle I have for my 3C589D doesn't seem to work on it. I don't know if this is due to the damage I did to the 562 card in transit from freebsdcon, or a mis-matched dongle...
* Fix identify code. This also fixes the eeprom messages.imp1999-10-281-13/+12
| | | | | | | pccard attachments must activate the resources they want to access. ep didn't do this, so of course thee eeprom came back as busy. ed and sio already did this. It was only due to a bug in the logic that the probe succeeded. These problems have been fixed.
* Last change to pccard_nbk now obviates the need to check the name ofimp1999-10-281-12/+6
| | | | | the device in question. Also fix warnings on if_ep_pccard.c
* HEADS UP! All 3c5x9 users!mdodd1999-10-271-95/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Rip out all the static softc stuff and do softc allocation the right way. - Rewrite most of the ISA code so that it provides a DEVICE_IDENTIFY method to enumerate all non-PnP ISA devices. This has the following consequences: - No 'ep' devices may be hardwired. - All hardwired devices will probably be detected twice. By hardwired I mean: device ep0 at isa? port 0x300 irq 10 - 'ep' devices are ordered by bus, slot, and then MAC address. - Make 3c509B cards work in PnP mode. Yes, they really work. - Convert over to using ifmedia for media selection. No more of this lame 'linkX' stuff. - Consolidate a lot of duplicated code. - Make a stab at not breaking MII based PCCARD devices. I doubt that the PCCARD stuff works any more than it did before my changes but theres hope. My PCCARD hardware should arrive in a week or so. - Retreive the media settings from the card EEPROM rather than guessing. I've got a 3c509-TPO that thinks its got an AUI port and if others can report similar problems I'll write a bit of clever code that will fix this but right now it works correctly on all but 1 card. - Clean up a few things and make some cosmetic changes. - Add myself as the MAINTAINER since nobody else wants to. I'm in the best position to do this as I've got an example of most of the cards: EISA 3c579 bnc/aui MCA 3c529 tp/aui ISA 3c509 tpo ISA-PnP 3c509B combo If someone wants to send me a any cards I don't have I'd appriciate it. Also welcome are 3c59x boards since I'll be folding if_vx and if_ep at some point.
* Add newbus attachment for pccard driver. Heavily tested by me, andimp1999-10-251-154/+218
| | | | | | | | | | | I'm committing this from a laptop running this driver. Have only one devclass for all ep devices (at least for pccard and eisa) so unit numbering is sane. Might not work with both isa and non-isa devices on the same system until ep is updated (Matt has some patches in the pipeline which should resolve this, he wanted me to commit this so he can resolve any conflicts against cvs rather than my patches). Reviewed by: Matt Dodd <mdodd@freebsd.org>
* Duplicated '(' removed.mdodd1999-09-261-1/+1
| | | | Noticed by: Mark Murray <mark@grondar.za>
* - Split out the ISA and PCCARD specific code.mdodd1999-09-261-0/+245
- Split out the prototypes, externs and struct decls from if_epreg.h into if_epvar.h. - Add support for MCA based Etherlink III (3c529) devices. None of this code is used right now; the old if_ep driver is still in place and used. I will eventually get around to converting if_ep_isa.c to newbus once I've had a talk with Peter and DFR about the DEVICE_IDENTIFY() method. I have tested this code on my PS/2. It works. I would like EISA and ISA testers since my example hardware hasn't arrived yet. Add: dev/ep/if_ep.c optional ep dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep card to sys/conf/files Remove: i386/eisa/3c5x9.c optional ep i386/isa/if_ep.c optional ep from sys/i386/conf/files.i386 PCCARD testers wanted! I will switch off and cvs rm the old driver in favor of this copy once I've had positive feedback or have the hardware to verify that it works.
OpenPOWER on IntegriCloud