summaryrefslogtreecommitdiff
path: root/sys/dev/ic/if_wi.c
AgeCommit message (Collapse)Author
2002-10-27Add an option to use software WEP now that we have a software decryptTodd C. Miller
function. Can be useful for cards that only support 40-bit WEP or where the card firmware lacks weak IVs avoidance. Prism/Symbol only. In the future this will be expanded to support proposed WEP replacements. Based on code from Jamison Adcock.
2002-10-27add a matching wi_do_hostdecrypt()Markus Friedl
2002-10-18Account for the aligned m_data when checking boundaries; from NetBSD.Federico G. Schwindt
mickey and millert ok.
2002-10-18media support; slightly modified from FreeBSD.Federico G. Schwindt
mickey and millert ok.
2002-10-11pad keys of size != RC4KEYLEN or RC4KEYLEN/2 with zero; noticed and tested ↵Markus Friedl
by millert@
2002-10-11Stash the value of letoh16(ver.wi_ver[0]) in a variable so we don'tTodd C. Miller
evaluate the same thing for each loop iteration in wi_get_id(). [ previous commit contained unrelated changes and has been removed ]
2002-10-11Sigh, we can't just put the htole16() in the WI_CARD_IDS macroTodd C. Miller
since gcc doesn't seem to evaluate htole16() of a constant at compile time after all. Noticed by deraadt@
2002-10-10Make wi_get_id() table driven, similar to NetBSD and FreeBSD butTodd C. Miller
make the table itself a #define so we can reuse it in wicontrol. Also add a bunch of chip IDs from NetBSD/FreeBSD. mickey@ OK
2002-10-04Limit the TX key to a valid range; imp@Todd C. Miller
2002-08-30plug mbuf leak.Federico G. Schwindt
2002-08-30only do copyout() if wi_get_debug() returned 0.Federico G. Schwindt
2002-08-13change WI_PORTTYPE_AP -> WI_PORTTYPE_HOSTAP to match FreeBSD and NetBSD.Todd C. Miller
The reason for this is that it is possible in the future to have wi(4) be a real AP using the AP tertiary firmware. mickey@ OK
2002-08-08Fix IFF_PROMISC setting optimization. The point is to avoid theTodd C. Miller
wi_init() if only IFF_PROMISC status has changed. There is no need to change anything if we are in HostAP mode since wi_init() has already turned off the hardware promisc bit when we entered HostAP (HostAP already implies promisc behavior). Noticed by imp@, OK by mickey@
2002-07-16remove prototypes that now live in if_wivar.h.Federico G. Schwindt
2002-07-10use ifp->if_sadl whether possible.Federico G. Schwindt
2002-06-24oops. don't initialize wi_flags and wi_hostap_info here; fixes sparc.Federico G. Schwindt
somehow i didn't commit this. from denver airport.
2002-06-22use 8-bits when accessing the wi_cor_offset; millert@ ok.Federico G. Schwindt
2002-06-21Clear wi_hostap_info.apflags in wi_attach() to guarantee wihap_shutdown()Todd C. Miller
doesn't do the wrong thing with quick card insert/ejects.
2002-06-21Add some missing casts of sc->wi_txbuf -> caddr_tTodd C. Miller
2002-06-21Don't set WI_FLAGS_ATTACHED in sc->wi_flags until after mi attachTodd C. Miller
routines have been called. Avoids a panic when you insert & eject a card very quickly on a slow machine.
2002-06-21don't convert these to little-endian. now ifconfig shows the nwid onFederico G. Schwindt
sparc64 and macppc; tested by me and drahn@ on i386, macppc and sparc64.
2002-06-15Don't advertise hostap as an allowed media type for firmware < 0.80Todd C. Miller
Hopefully this will confuse people with crufty firmware a little less than the old behavior. Supposedly it is possible to get hostap working on prism firmware 0.7.6 but I'm not going to attempt that at this time.
2002-06-14don't allow users to set the IBSS/HostAP SSID to the empty stringTodd C. Miller
2002-06-12Previously, SIOCG80211NWID would return the "desired" netname ifTodd C. Miller
the interface was up, even if it was the empty string. This tends to confuse users who have not set the desired net name (ie: associate with any AP). Now we only return the desired net name if it is not empty and the interface is up. Otherwise we return the current net name (ie: what we are associated with).
2002-06-09a step towards consistancy; in general:Todd T. Fries
'struct arpcom foo' -> 'struct arpcom sc_arpcom' ok itojun@
2002-06-03o when checking the message type, mask with WI_RXSTAT_MSG_TYPE insteadTodd C. Miller
of comparing directly against WI_STAT_1042, WI_STAT_TUNNEL, etc. This is needed by some Symbol cards in ad-hoc mode. o change some ntohs(var) to htons(constant). Adapted from NetBSD (mycroft).
2002-06-02BSD air-tools 0.2 patches from dachb0den labs; h1kari@dachb0den.comTodd C. Miller
The common.h include file has been incorporated into if_wi_ieee.h similar to what is in FreeBSD.
2002-05-31Allow IBSS creation on Symbol cards with station firmware >= 2.5Todd C. Miller
From John Hay via Warner Losh
2002-04-30crc32_tab can be constMichael Shalayeff
2002-04-26Add some bounds checking of wi_len on copyin(). From NetBSD via FreeBSD.Todd C. Miller
2002-04-26Don't set WI_RID_OWN_SSID based on wi_net_name if wi_net_name isTodd C. Miller
not actually set. Closed PR #2569.
2002-04-26We use wi_authtype, not wi_authmode to store the auth type (open systemTodd C. Miller
or shared key).
2002-04-23Clear flags indicating whether or not wi or hostap is active asTodd C. Miller
early as possible. Also move the timeout_del() in wi_stop() to before we disable wi(4) so it doesn't fire at the wrong time. Joint effort between mickey@ and myself.
2002-04-21Symbol version string need not start with 'V'; from NetBSD (onoe)Todd C. Miller
2002-04-16From NetBSD:Todd C. Miller
o Fix m->m_data alignment in wi_rxeof() o Add a comment
2002-04-11Fix Lucent <-> Prism2 WEP interop bug. We only want to set theTodd C. Miller
EXCLUDE_UNENCRYPTED bit in the WI_RID_P2_ENCRYPTION value if we are in shared key mode. Symbol cards, just to be different, supposedly always want the EXCLUDE_UNENCRYPTED bit set (confirmed with the Linux orinoco and spectrum24 drivers). I have so far been unable to get my Symbol card to interop with Lucent or Prism2 WEP. In BSS mode at least, this Symbol card does not list WEP as a capability it supports. This is, to put it mildly, rather annoying.
2002-04-11o Set feature flags based on firmware type and version.Todd C. Miller
o Move the sc->has_wep flag into sc->wi_flags o Only do the COR reset on Symbol cards just to play it safe. o Remove unused sc->sc_enabled variable. o Kill ibss_portmap array in favor of sc->wi_ibss_port, which is stored in little endian. mickey@ OK
2002-04-10o Add ibss and ibss-master mediaopt for ifconfigTodd C. Miller
o Map port type 4 to ibss regardless of firmware type. This gives us a consistent way to set ibss mode.
2002-04-08make hostap work on other-endian machines; tested by drahn@Michael Shalayeff
2002-04-07Don't reset COR in wi_reset(), break it out into its own function andTodd C. Miller
only call it from wi_attach() and wi_pcmcia_activate() (ie: just once). It would be nicer to have the COR reset be part of the bus-specific code but we need to know whether or not we have a Lucent card since old Lucent firmware revs get messed up on a COR soft reset. Even with the COR reset we still need to avoid initializing Symbol cards more than once. However, we *do* want to do a reset after returning from suspend. Therefore, rename wi_gone to wi_flags and store both the attach and init status in it. wi_reset() now checks wi_flags to see if the card should be initialized in the Symbol case. Info on initializing Symbol cards once from NetBSD.
2002-04-06Add support for setting antenna diversity on Symbol cards.Todd C. Miller
Also add some more Symbol-specific RID values I noticed in the Linux orinoco driver.
2002-04-06For PLX-based bridge cards, move printing of pcmcia card CIS stringsTodd C. Miller
out of generic wi_attach() and into wi_pci_attach(). This means we can't print the CIS info for embedded cards like the NCP130 but since those don't have a "real" pcmcia card in them this is really not a problem. Also check to see that there is actually a pcmcia present and give and error if not. CIS magic number taken from the Linux orinoco driver; there may be a better way to do this.
2002-04-06Add support for Symbol cards and printing of the primary stationTodd C. Miller
firmware version. Adapted from NetBSD and the Linux orinoco driver. The Symbol firmware requires that we do a COR soft reset before initializing the card in wi_reset(). Also, setting WI_RID_ROAMING_MODE caused the Symbol card to go into a strange (non-working) mode with firmware 2.x.x. There are some other Symbol additions/oddities that will need to be addressed in the future.
2002-04-05Add another check for sc->wi_gone; from FreeBSDTodd C. Miller
2002-04-04wi_init() now takes a struct wi_softc * not a void * since an sc pointerTodd C. Miller
is available everywhere wi_init() is called. deraadt@ OK
2002-04-03In Host-AP mode, set IBSS SSID to the normal network id. This makesTodd C. Miller
"ifconfig nwid FOO" work correctly in Host-AP mode.
2002-04-02keylen is either 8 (40 bit secret ) or 16 (104 bit)Markus Friedl
wrong index used for RC4SWAP during key setup IV is stored in little endian format; works for millert@
2002-04-02fix keyid encoding wi_tx_keyMarkus Friedl
2002-04-02Prism2 firmware should be reported as version a.b.c not a.b variant c.Todd C. Miller
Only Lucent uses the 'variant' form. Also, prism2 firmware 0.8.2 does WEP w/o requiring promisc mode (from NetBSD). OK mickey@
2002-04-02always reset promisc in hostap mode (a comment added), a couple of ↵Michael Shalayeff
formatiing and byte-swapping fixens as well