Commit Graph

4059 Commits

Author SHA1 Message Date
dyoung 1b19913947 A few fixes affecting user control of the transmit/receive antenna,
and antenna diversity:

Check the hardware capabilities---transmit power control (TPC),
antenna diversity---before setting up the sysctls that control
those capabilities.  Previously, the TPC and ant. diversity sysctls
were not setup because ath_sysctlattach was called before sc_hastpc
and sc_hasdiversity were initialized, so users could not view/control
antenna diversity or TPC settings, even on hardware with those
capabilities.

Obey the user's transmit-antenna selection even when sending IBSS
beacons on hardware with VEOL capability; for all other hardware/modes,
only switch transmit antennas after every four beacons if the user
has not selected a transmit antenna---i.e., they chose antenna 1
or 2 instead of 0 ("auto").
2005-07-27 21:22:57 +00:00
dyoung b496bd99a0 Cosmetic: remove an out-dated "note to self." 2005-07-27 21:13:32 +00:00
dyoung d2ba878019 Resolve conflicts. 2005-07-26 22:52:47 +00:00
drochner 53a6f78e01 disable SYSCTL_SETUP for _LKM until we have a plan how to deal with
it correctly
2005-07-23 16:09:39 +00:00
he d3fc666f98 Make tlp_idle() not be static, so that the newsmips version of the
driver can access that function again.

Approved by thorpej
2005-07-17 18:11:36 +00:00
macallan 71b0921a17 driver for the audio part of SUNW,DBRI ISDN/audio controllers 2005-07-16 18:58:49 +00:00
yamt d7714c3b58 #ifdef out an unused variable in the case of !WI_DEBUG. 2005-07-16 04:06:39 +00:00
dyoung 8e16397dbf Add a sysctl for turning wi(4) debugging on and off.
Do not print the number of tx commands outstanding on entrance to
wi_cmd_intr unless wi_debug > 1.
2005-07-15 22:33:29 +00:00
dyoung 1aeb04f480 Clear IEEE80211_F_DROPUNENC in ic_flags in operating states where
the NIC decryptes & decapsulates WEP frames before passing them to
the host.  "Remember" the state of IEEE80211_F_DROPUNENC in
sc_ic_flags, though, and try our best to honor it as we setup the
hardware state.

This is the second patch of this kind.  The previous patch was
badly broken because wi_mend_flags was basing its decision to clear
IEEE80211_F_DROPUNENC based on the operating state we were
transitioning FROM instead of the state we were transitioning TO.

This fixes a bug that Simon Burge reported, where dhclient wi0
would not get a lease unless and until you ran 'ifconfig wi0'
concurrently (which would frob the IEEE80211_F_DROPUNENC bit in
the right way).  This patch was tested by Simon with his Toshiba
Lucent-clone.
2005-07-14 00:28:51 +00:00
drochner a33487a69f fixes from FUKAUMI Naoki. Changes are
>   Enable WEP (software engine).
>   Add support for WPA[12].
>   Print modes and rates.
>   Add new devices.
>   And some small changes and bug fixes.
2005-07-12 12:13:00 +00:00
yamt d01f5b39f6 specify dma direction hints for bus_dmamap_load_mbuf. 2005-07-11 21:42:58 +00:00
dyoung 55512dd5b2 Add undefined variable 'ic' to rtw_attach. 2005-07-11 06:01:42 +00:00
dyoung ac7254c1e3 Cosmetic: the '_type' argument to ATH_LOCK_IMPL and family is more
properly called '_obj'.
2005-07-10 19:07:39 +00:00
dyoung c23eb30613 Bring an_newstate up-to-date with net80211 conventions. Now an(4)
works again.  Jonathan Perkins reported the bug and tested the
patch.
2005-07-10 19:04:00 +00:00
christos d39684a368 make the isdn drivers compile again with -Wconst, -Wshadow 2005-07-09 02:05:09 +00:00
thorpej 99c4ea1319 - Use ANSI function decls.
- Liberally apply static.
2005-07-08 05:07:31 +00:00
thorpej 9beb4d2c61 Remove the __packed__ attribute from these structures. Everything is
naturally aligned anyway, and __packed__ just causes the compiler to
generate slower code.
2005-07-07 19:02:11 +00:00
christos 66e17a310f add a missing const. 2005-07-07 12:57:03 +00:00
dyoung 86283b24c9 Don't write WEP keys to the chip unless it is enabled.
Suspend and restart the transmit/receive engines while writing WEP
keys.
2005-07-07 00:12:22 +00:00
dyoung 83a9bf2c5c Historically, an(4), ath(4), atw(4), rtw(4), and wi(4) have printed
out their modes and rates at boot.  Revert to the historical
behavior.
2005-07-06 23:58:14 +00:00
dyoung 707b2b4ae1 Avoid an unnecessary API difference between NetBSD and FreeBSD:
back out my change to ieee80211_crypto_encap that made it free its
mbuf argument on error.  I had thought it was a bug.  It was not.
It's the drivers that are broken.  Make an(4), atw(4), ipw(4),
iwi(4), ral(4), rtw(4), ural(4), and wi(4) free the mbuf when
ieee80211_crypto_encap returns NULL.  Also, return ath(4) to the
way it was---i.e., free the mbuf.

Thanks to Sam Leffler to pointing out my mistake.
2005-07-06 23:44:15 +00:00
dyoung 05cab81dd8 Don't write the WEP keys to the device if it is invalid (e.g.,
unplugged) or if it is not enabled.  Fixes kern/30592.
2005-07-06 06:49:25 +00:00
drochner 6d8bb016f7 update PCI/Cardbus ral wlan driver, and adapt to new FreeBSD/NetBSD
80211 framework, from FUKAUMI Naoki per mail to tech-net
2005-07-04 17:50:09 +00:00
dyoung c1446c092d Locking changes.
+ Synchronize ath_calibrate() with ATH_LOCK()/ATH_UNLOCK().  Thanks
  to Steve Woodford for suggesting this fix.  This patch stops
  ath(4) from generating messages "hardware error; resetting" while
  Steve's D-Link DWL-AG650 card is operating (kern/28385).  The
  MiniPCI wireless adapter on one of my Soekris boards also operates
  more reliably following this patch.

+ Use ATH_LOCK_IMPL() and family to synchronize access to the
  transmit queue, also.
2005-07-03 19:58:16 +00:00
dyoung f069ffb8c5 Create per-instance sysctl nodes for ath(4), e.g., hw.ath0.debug,
hw.ath1.debug.
2005-07-03 19:44:50 +00:00
dyoung 3ba3e0571b Bug fix: send all multicast data frames at the lowest possible data
rate, with short preamble turned *off*.  Fixes IBSS operation,
where multicast frames were sent at the highest possible rate with
short preamble turned *on*, so the likelihood of reception was
relatively low, and there was no chance for stations w/o short
preamble capability to receive the frames.

XXX This is a quick fix that I will revisit very soon.  Multicast
data frames are eligible to be sent with short preamble in
IEEE80211_M_STA, IEEE80211_M_HOSTAP modes.  An AP knows who all of
its peers are at all times, so it can make an intelligent decision.
Ditto the AP client.

XXX The rate adaptation should be involved in choosing short/long
preamble.  Also, we can make a reasonable choice of a higher
multicast data rate based on statistics gathered by the rate
adaptation module.
2005-07-03 19:42:10 +00:00
dyoung 967b5afe90 Cosmetic: repair indentation. 2005-07-03 19:31:03 +00:00
drochner c1834d85c2 add drivers for Ralink RT2500-based wireless adapters, written by
Damien Bergamini, ported and submitted by FUKAUMI Naoki per PR kern/30449
I've modified the USB "ural" driver for recent changes to the NetBSD
ieee80211 framework, possibly not completely, but with an ASUS wireless
adapter I'm getting some signs of life.
Didn't care about pci/cardbus for now, hopefully someone with hardware
will do it.
2005-07-01 20:06:56 +00:00
macallan 754d79402b Allow sparc64-style attachment of mouse and keyboard via zstty, needed for
wscons support.
Reviewed by uwe.
2005-06-30 12:07:51 +00:00
dyoung 380ab420c3 Fix $FreeBSD$ RCS IDs, which gave me a real shock when their revision
numbers moved backwards.
2005-06-30 00:52:56 +00:00
dyoung dbad357b04 Here is a grotty hack that lets the RTL8180L handle WEP in the
receive direction, while software handles WEP in the transmit
direction.  When net80211 calls rtw's rtw_key_set with a WEP key,
I point the key's wk_cipher at our "fake" cipher, rtw_cipher_wep,
which is alike to ieee80211_cipher_wep except it provides a different
crypto-decapsulation routine, rtw_wep_decap.  rtw_wep_decap copies
the key passed to it by net80211, clears the key's SWCRYPT flag,
and then calls wep_decap.  Now wep_decap will decapsulate, but it
will *not* re-decrypt.

XXX I need to check whether the hardware supports 40-bit WEP,
XXX 104-bit WEP, or both, and act accordingly.
2005-06-28 07:19:33 +00:00
thorpej 77e4f4547b Remove some extern decls for PCI-specific stuff that are private to
the PCI front-end.
2005-06-28 00:32:27 +00:00
dyoung c0a74e44c8 rtw: Try to get hardware WEP to work. It seems to work in
the RX direction, but not in the TX direction.  The
	  net80211 crypto framework doesn't seem to cope very well
	  with the assymetry (I'm probably missing something), so
	  I will use software WEP for now.

net80211: In ieee80211_compute_duration, figure out whether to add
	  the WEP header to the packet overhead by checking the
	  WEP bit in the Frame Control field of the 802.11 header,
	  instead of checking the IEEE80211_F_PRIVACY flag.

	  Also, if the WEP bit is present, assume that the frame
	  described by (wh, len) has already already been WEP
	  encapsulated, and adjust the payload length accordingly.
	  XXX that's a grotty hack that I will have to revisit,
	  later.
2005-06-27 05:49:13 +00:00
erh 1b6f9cc263 Make sure there is a valid transmit key, before trying to use information
about it.  Fixes a crash when configuring wi0.
2005-06-26 21:51:37 +00:00
dyoung 7bcee8c697 Do not build AP support if 'options IEEE80211_NO_HOSTAP' is in the
kernel configuration.
2005-06-26 04:37:25 +00:00
dyoung 23304515e7 Bug fix: fix WEP by managing keys & crypto in the style of the new
net80211.  It was especially important to zero the IEEE80211_F_DROPUNENC
(discard unencrypted packets) flag in operating modes where the
firmware decrypts for us.  Otherwise, the 802.11 layer discarded
all received frames.  See wi_mend_flags.  From FreeBSD, with
improvements by me.

For better compliance with the "net80211 way":
set sc_cnfauthmode from ic->ic_bss->ni_authmode.  Enter
the RUN state through ieee80211_create_ibss instead of
ieee80211_new_state(IEEE80211_S_RUN).  To sync BSSID in ad hoc
mode, use ieee80211_sta_join() instead of
ieee80211_new_state(IEEE80211_S_RUN).  From FreeBSD.

Configure the firmware to obey IEEE80211_F_DROPUNENC.

As we change to state RUN in STA mode, generate a link-status
message on the routing socket with a call to ieee80211_notify_node_join()
instead of calling rt_ifmsg directly.

Run normal net80211 processing (ieee80211_newstate) on the ->RUN
transition.
2005-06-25 03:56:53 +00:00
dyoung 133d421bca Cosmetic: join lines. 2005-06-25 03:41:50 +00:00
rpaulo ec4e36b7c2 Add support for ASIX AX88140A/AX88141 chipsets using only
the 10/100 MII with inspiration from FreeBSD dc(4) driver.

Tested on i386 and macppc.

Reviewed by Jason Thorpe and ok'ed by Hubert Feyrer.
2005-06-23 23:51:41 +00:00
martin adc4b94498 Remove unused <atomic.h> include; add <sys/device.h> includes where
needed.
2005-06-22 22:07:48 +00:00
dyoung 9063402978 Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD.  Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]).  Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
2005-06-22 06:14:51 +00:00
dyoung d1f006118e Import FreeBSD's ath(4) of 2005-05-18 2005-06-21 20:37:47 +00:00
ws 9d78e0cf36 PR-30566: Poll must not return <sys/errno.h> values.
Start with those places I can easily test.
2005-06-21 14:01:11 +00:00
darcy 77a3cb4427 Fix another portability issue. Part of PR kern/30456. 2005-06-20 20:40:21 +00:00
darcy 67a10100f5 Fix some printf statements to make them more portable. Doesn't completely
fix PR kern/30456 but fixes part of it.
2005-06-20 11:37:47 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
bouyer 3110d2fd7a In wdcprobe1(), wait 5s for the drive to deassert ready. In case of e.g.
pcmcia devices, the drive may still be doing its power-on reset.
XXX From the specs the delay could be up to 31s here, but we don't want to
    wait for 31s if we have a channel with no drives and pull-up resitors on
    the bus.
Based on patch submitted in kern/25659 by Steven M. Bellovin, part of fix for
kern/25659.
2005-06-19 18:14:27 +00:00
bouyer cf4b00e2e4 Remove a (wdc == NULL) test. We know wdc is not NULL at this point. 2005-06-16 20:15:04 +00:00
jmc 1e47a53b95 Constify return string 2005-06-13 20:32:58 +00:00
tls 4a43d21777 Revert the part of revision 1.228 that made HW_NO_TXPRELOAD the default:
it appears to break output on the Soekris net4501, which is a rather
popular platform.

This should fix PR kern/29612 -- if not, I will probably revert it again.
2005-06-12 21:10:47 +00:00
dyoung d485a761e3 Sprinkle __UNCONST() and rename variables to quiet uiet -Wcast-qual,
-Wshadow complaints.
2005-06-10 02:35:34 +00:00